@raycast/api 1.93.2 → 1.94.1

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.
@@ -1,4 +1,4 @@
1
- "use strict";var Ql=Object.create;var Xe=Object.defineProperty;var ef=Object.getOwnPropertyDescriptor;var tf=Object.getOwnPropertyNames;var rf=Object.getPrototypeOf,nf=Object.prototype.hasOwnProperty;var D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),of=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},to=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of tf(t))!nf.call(e,o)&&o!==r&&Xe(e,o,{get:()=>t[o],enumerable:!(n=ef(t,o))||n.enumerable});return e};var T=(e,t,r)=>(r=e!=null?Ql(rf(e)):{},to(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),sf=e=>to(Xe({},"__esModule",{value:!0}),e);var co=D((Cg,ao)=>{var df=require("node:tty"),pf=df?.WriteStream?.prototype?.hasColors?.()??!1,g=(e,t)=>{if(!pf)return o=>o;let r=`\x1B[${e}m`,n=`\x1B[${t}m`;return o=>{let i=o+"",s=i.indexOf(n);if(s===-1)return r+i+n;let a=r,c=0;for(;s!==-1;)a+=i.slice(c,s)+r,c=s+n.length,s=i.indexOf(n,c);return a+=i.slice(c)+n,a}},h={};h.reset=g(0,0);h.bold=g(1,22);h.dim=g(2,22);h.italic=g(3,23);h.underline=g(4,24);h.overline=g(53,55);h.inverse=g(7,27);h.hidden=g(8,28);h.strikethrough=g(9,29);h.black=g(30,39);h.red=g(31,39);h.green=g(32,39);h.yellow=g(33,39);h.blue=g(34,39);h.magenta=g(35,39);h.cyan=g(36,39);h.white=g(37,39);h.gray=g(90,39);h.bgBlack=g(40,49);h.bgRed=g(41,49);h.bgGreen=g(42,49);h.bgYellow=g(43,49);h.bgBlue=g(44,49);h.bgMagenta=g(45,49);h.bgCyan=g(46,49);h.bgWhite=g(47,49);h.bgGray=g(100,49);h.redBright=g(91,39);h.greenBright=g(92,39);h.yellowBright=g(93,39);h.blueBright=g(94,39);h.magentaBright=g(95,39);h.cyanBright=g(96,39);h.whiteBright=g(97,39);h.bgRedBright=g(101,49);h.bgGreenBright=g(102,49);h.bgYellowBright=g(103,49);h.bgBlueBright=g(104,49);h.bgMagentaBright=g(105,49);h.bgCyanBright=g(106,49);h.bgWhiteBright=g(107,49);ao.exports=h});var Ko=D((pS,Ho)=>{Ho.exports=qo;qo.sync=cd;var Vo=require("fs");function ad(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Yo(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:ad(t,r)}function qo(e,t,r){Vo.stat(e,function(n,o){r(n,n?!1:Yo(o,e,t))})}function cd(e,t){return Yo(Vo.statSync(e),e,t)}});var ei=D((uS,Qo)=>{Qo.exports=Jo;Jo.sync=ld;var Xo=require("fs");function Jo(e,t,r){Xo.stat(e,function(n,o){r(n,n?!1:Zo(o,t))})}function ld(e,t){return Zo(Xo.statSync(e),t)}function Zo(e,t){return e.isFile()&&fd(e,t)}function fd(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),f=parseInt("001",8),l=a|c,d=r&f||r&c&&o===s||r&a&&n===i||r&l&&i===0;return d}});var ri=D((hS,ti)=>{var mS=require("fs"),ut;process.platform==="win32"||global.TESTING_WINDOWS?ut=Ko():ut=ei();ti.exports=Pr;Pr.sync=dd;function Pr(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Pr(e,t||{},function(i,s){i?o(i):n(s)})})}ut(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function dd(e,t){try{return ut.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var li=D((gS,ci)=>{var he=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ni=require("path"),pd=he?";":":",oi=ri(),ii=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),si=(e,t)=>{let r=t.colon||pd,n=e.match(/\//)||he&&e.match(/\\/)?[""]:[...he?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=he?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=he?o.split(r):[""];return he&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},ai=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=si(e,t),s=[],a=f=>new Promise((l,d)=>{if(f===n.length)return t.all&&s.length?l(s):d(ii(e));let p=n[f],u=/^".*"$/.test(p)?p.slice(1,-1):p,m=ni.join(u,e),S=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+m:m;l(c(S,f,0))}),c=(f,l,d)=>new Promise((p,u)=>{if(d===o.length)return p(a(l+1));let m=o[d];oi(f+m,{pathExt:i},(S,E)=>{if(!S&&E)if(t.all)s.push(f+m);else return p(f+m);return p(c(f,l,d+1))})});return r?a(0).then(f=>r(null,f),r):a(0)},ud=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=si(e,t),i=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,f=ni.join(c,e),l=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;for(let d=0;d<n.length;d++){let p=l+n[d];try{if(oi.sync(p,{pathExt:o}))if(t.all)i.push(p);else return p}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw ii(e)};ci.exports=ai;ai.sync=ud});var di=D((yS,Br)=>{"use strict";var fi=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Br.exports=fi;Br.exports.default=fi});var hi=D((SS,mi)=>{"use strict";var pi=require("path"),md=li(),hd=di();function ui(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=md.sync(e.command,{path:r[hd({env:r})],pathExt:t?pi.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=pi.resolve(o?e.options.cwd:"",s)),s}function gd(e){return ui(e)||ui(e,!0)}mi.exports=gd});var gi=D((bS,Fr)=>{"use strict";var Lr=/([()\][%!^"`<>&|;, *?])/g;function yd(e){return e=e.replace(Lr,"^$1"),e}function Sd(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Lr,"^$1"),t&&(e=e.replace(Lr,"^$1")),e}Fr.exports.command=yd;Fr.exports.argument=Sd});var Si=D((wS,yi)=>{"use strict";yi.exports=/^#!(.*)/});var wi=D((xS,bi)=>{"use strict";var bd=Si();bi.exports=(e="")=>{let t=e.match(bd);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Ei=D((ES,xi)=>{"use strict";var $r=require("fs"),wd=wi();function xd(e){let r=Buffer.alloc(150),n;try{n=$r.openSync(e,"r"),$r.readSync(n,r,0,150,0),$r.closeSync(n)}catch{}return wd(r.toString())}xi.exports=xd});var Ii=D((TS,Oi)=>{"use strict";var Ed=require("path"),Ti=hi(),Ai=gi(),Td=Ei(),Ad=process.platform==="win32",Od=/\.(?:com|exe)$/i,Id=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Dd(e){e.file=Ti(e);let t=e.file&&Td(e.file);return t?(e.args.unshift(e.file),e.command=t,Ti(e)):e.file}function Rd(e){if(!Ad)return e;let t=Dd(e),r=!Od.test(t);if(e.options.forceShell||r){let n=Id.test(t);e.command=Ed.normalize(e.command),e.command=Ai.command(e.command),e.args=e.args.map(i=>Ai.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Cd(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:Rd(n)}Oi.exports=Cd});var Ci=D((AS,Ri)=>{"use strict";var Ur=process.platform==="win32";function vr(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Md(e,t){if(!Ur)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=Di(o,t,"spawn");if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function Di(e,t){return Ur&&e===1&&!t.file?vr(t.original,"spawn"):null}function Pd(e,t){return Ur&&e===1&&!t.file?vr(t.original,"spawnSync"):null}Ri.exports={hookChildProcess:Md,verifyENOENT:Di,verifyENOENTSync:Pd,notFoundError:vr}});var Bi=D((OS,ge)=>{"use strict";var Mi=require("child_process"),Nr=Ii(),_r=Ci();function Pi(e,t,r){let n=Nr(e,t,r),o=Mi.spawn(n.command,n.args,n.options);return _r.hookChildProcess(o,n),o}function Bd(e,t,r){let n=Nr(e,t,r),o=Mi.spawnSync(n.command,n.args,n.options);return o.error=o.error||_r.verifyENOENTSync(o.status,n),o}ge.exports=Pi;ge.exports.spawn=Pi;ge.exports.sync=Bd;ge.exports._parse=Nr;ge.exports._enoent=_r});var Tg={};of(Tg,{default:()=>dr});module.exports=sf(Tg);var Zl=require("@oclif/core");var X=require("@oclif/core");var Pe=T(require("node:fs")),ur=T(require("node:path")),no=T(require("node:os"));var ro={production:{url:"https://www.raycast.com",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},staging:{url:"https://www.rayca.st",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},development:{url:"http://localhost:3000",clientID:"rOCD_LhnXFObSLu9v7788qOGu25FZDqEzGjet4Q45ZY"}}[process.env.API_ENV||"production"],af="e69bae0ec90f5e838555",z={},oo;function io(e){oo=e;try{z=JSON.parse(Pe.readFileSync(ur.join(ff(),"config.json"),"utf8"))}catch(t){if(t instanceof Error&&t.code==="ENOENT")return;throw new Error(`Failed to read config file: ${t}`)}}function cf(e){switch(e){case"raycastApiURL":return process.env.RAY_APIURL||z.APIURL||ro.url;case"raycastAccessToken":return process.env.RAY_TOKEN||z.Token||z.AccessToken||"";case"raycastClientId":return process.env.RAY_CLIENT_ID||z.ClientID||ro.clientID;case"githubClientId":return process.env.RAY_GithubClientID||z.GithubClientID||af;case"githubAccessToken":return process.env.GITHUB_ACCESS_TOKEN||z.GithubAccessToken||"";case"flavorName":return process.env.RAY_Target||(typeof z.Target>"u"?so("release"):z.Target)}}function so(e){switch(e){case"debug":return"debug";case"internal":return"internal";case"release":return"";case void 0:return cf("flavorName")}}function lf(){let e=so(oo);return e==""?"raycast":`raycast-${e}`}function ff(){let e=ur.join(no.default.homedir(),".config",lf());return Pe.mkdirSync(e,{recursive:!0}),e}var w=T(co());var oe=[];oe.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&oe.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&oe.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Je=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",mr=Symbol.for("signal-exit emitter"),hr=globalThis,uf=Object.defineProperty.bind(Object),gr=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(hr[mr])return hr[mr];uf(hr,mr,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(r,n)===!0||o;return t==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},Ze=class{},mf=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),yr=class extends Ze{onExit(){return()=>{}}load(){}unload(){}},Sr=class extends Ze{#t=br.platform==="win32"?"SIGINT":"SIGHUP";#r=new gr;#e;#n;#i;#o={};#s=!1;constructor(t){super(),this.#e=t,this.#o={};for(let r of oe)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),n.length===o){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||t.kill(t.pid,a)}};this.#i=t.reallyExit,this.#n=t.emit}onExit(t,r){if(!Je(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,t),()=>{this.#r.removeListener(n,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let t of oe)try{let r=this.#o[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#c(t,...r),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#s&&(this.#s=!1,oe.forEach(t=>{let r=this.#o[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#i,this.#r.count-=1)}#a(t){return Je(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let n=this.#n;if(t==="exit"&&Je(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,t,...r)}},br=globalThis.process,{onExit:lo,load:Bg,unload:Lg}=mf(Je(br)?new Sr(br):new yr);var wr=T(require("node:process"),1);function xr(){let{env:e}=wr.default,{TERM:t,TERM_PROGRAM:r}=e;return wr.default.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Ug=(0,w.blue)((0,w.dim)("internal only"));var ie={wait:`\u{1F550}${(0,w.blue)("wait")} - `,info:`${process.env.GITHUB_ACTIONS==="true"?"\u2139\uFE0F":"\u2139\uFE0F "}${(0,w.cyan)("info")} - `,success:`\u2705${(0,w.green)("ready")} - `,warn:`${process.env.GITHUB_ACTIONS==="true"?"\u26A0\uFE0F":"\u26A0\uFE0F "}${(0,w.yellow)("warn")} - `,error:`\u{1F4A5}${(0,w.red)("error")} - `,event:`\u26A1\uFE0F${(0,w.magenta)("event")} - `,paymentPrompt:`\u{1F4B0}${(0,w.yellowBright)("plan")} - `},hf=!0;function fo(e,t){e||(ie.wait=`${(0,w.blue)("wait")} - `,ie.info=`${(0,w.cyan)("info")} - `,ie.success=`${(0,w.green)("ready")} - `,ie.warn=`${(0,w.yellow)("warn")} - `,ie.error=`${(0,w.red)("error")} - `,ie.event=`${(0,w.magenta)("event")} - `,ie.paymentPrompt=`${(0,w.yellowBright)("plan")} - `),t&&(hf=!1)}var Qe=class extends X.Command{static baseFlags={"exit-on-error":X.Flags.boolean({default:!0,helpGroup:"GLOBAL",aliases:["exitOnError"],deprecateAliases:!0,summary:"Always exit with non-zero code on error",allowNo:!0}),emoji:X.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Prefix output with emojis \u{1F308}"}),help:X.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Show the help message for the command"}),"non-interactive":X.Flags.boolean({char:"I",default:!1,helpGroup:"GLOBAL",summary:"Disable interactive outputs, useful for CI"}),target:X.Flags.option({char:"t",description:"Raycast app target",helpGroup:"GLOBAL",multiple:!1,options:["debug","internal","release"],hidden:!0})()};flags;args;async init(){await super.init(),process.on("SIGINT",()=>process.exit(1));let{args:t,flags:r}=await this.parse({flags:this.ctor.flags,baseFlags:super.ctor.baseFlags,enableJsonFlag:this.ctor.enableJsonFlag,args:this.ctor.args,strict:this.ctor.strict});this.flags=r,this.args=t,io(this.flags.target),fo(this.flags.emoji,this.flags["non-interactive"])}error(t,r){return r?.message&&t instanceof Error&&(t.message=`${r.message} (${t.message})`,delete r.message),super.error(t,r)}async catch(t){return super.catch(t)}async finally(t){return super.finally(t)}};function x(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var po=require("node:url"),pe=(e,t)=>{let r=Tr(gf(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},gf=e=>Er(e)?e.toString():e,Er=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,Tr=e=>e instanceof URL?(0,po.fileURLToPath)(e):e;var et=(e,t=[],r={})=>{let n=pe(e,"First argument"),[o,i]=x(t)?[[],t]:[t,r];if(!Array.isArray(o))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${o}`);let s=o.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!x(i))throw new TypeError(`Last argument must be an options object: ${i}`);return[n,s,i]};var xo=require("node:child_process");var uo=require("node:string_decoder"),{toString:mo}=Object.prototype,ho=e=>mo.call(e)==="[object ArrayBuffer]",A=e=>mo.call(e)==="[object Uint8Array]",W=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),yf=new TextEncoder,go=e=>yf.encode(e),Sf=new TextDecoder,tt=e=>Sf.decode(e),yo=(e,t)=>bf(e,t).join(""),bf=(e,t)=>{if(t==="utf8"&&e.every(i=>typeof i=="string"))return e;let r=new uo.StringDecoder(t),n=e.map(i=>typeof i=="string"?go(i):i).map(i=>r.write(i)),o=r.end();return o===""?n:[...n,o]},Be=e=>e.length===1&&A(e[0])?e[0]:Ar(wf(e)),wf=e=>e.map(t=>typeof t=="string"?go(t):t),Ar=e=>{let t=new Uint8Array(xf(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},xf=e=>{let t=0;for(let r of e)t+=r.length;return t};var Eo=e=>Array.isArray(e)&&Array.isArray(e.raw),To=(e,t)=>{let r=[];for(let[i,s]of e.entries())r=Ef({templates:e,expressions:t,tokens:r,index:i,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...o]=r;return[n,o,{}]},Ef=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{if(o===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[n]}`);let{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:a}=Tf(o,e.raw[n]),c=bo(r,i,s);if(n===t.length)return c;let f=t[n],l=Array.isArray(f)?f.map(d=>wo(d)):[wo(f)];return bo(c,l,a)},Tf=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,o=So.has(t[0]);for(let s=0,a=0;s<e.length;s+=1,a+=1){let c=t[a];if(So.has(c))n!==s&&r.push(e.slice(n,s)),n=s+1;else if(c==="\\"){let f=t[a+1];f==="u"&&t[a+2]==="{"?a=t.indexOf("}",a+3):a+=Af[f]??1}}let i=n===e.length;return i||r.push(e.slice(n)),{nextTokens:r,leadingWhitespaces:o,trailingWhitespaces:i}},So=new Set([" "," ","\r",`
1
+ "use strict";var Ql=Object.create;var Xe=Object.defineProperty;var ef=Object.getOwnPropertyDescriptor;var tf=Object.getOwnPropertyNames;var rf=Object.getPrototypeOf,nf=Object.prototype.hasOwnProperty;var D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),of=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},to=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of tf(t))!nf.call(e,o)&&o!==r&&Xe(e,o,{get:()=>t[o],enumerable:!(n=ef(t,o))||n.enumerable});return e};var T=(e,t,r)=>(r=e!=null?Ql(rf(e)):{},to(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),sf=e=>to(Xe({},"__esModule",{value:!0}),e);var co=D((Cg,ao)=>{var df=require("node:tty"),pf=df?.WriteStream?.prototype?.hasColors?.()??!1,g=(e,t)=>{if(!pf)return o=>o;let r=`\x1B[${e}m`,n=`\x1B[${t}m`;return o=>{let i=o+"",s=i.indexOf(n);if(s===-1)return r+i+n;let a=r,c=0;for(;s!==-1;)a+=i.slice(c,s)+r,c=s+n.length,s=i.indexOf(n,c);return a+=i.slice(c)+n,a}},h={};h.reset=g(0,0);h.bold=g(1,22);h.dim=g(2,22);h.italic=g(3,23);h.underline=g(4,24);h.overline=g(53,55);h.inverse=g(7,27);h.hidden=g(8,28);h.strikethrough=g(9,29);h.black=g(30,39);h.red=g(31,39);h.green=g(32,39);h.yellow=g(33,39);h.blue=g(34,39);h.magenta=g(35,39);h.cyan=g(36,39);h.white=g(37,39);h.gray=g(90,39);h.bgBlack=g(40,49);h.bgRed=g(41,49);h.bgGreen=g(42,49);h.bgYellow=g(43,49);h.bgBlue=g(44,49);h.bgMagenta=g(45,49);h.bgCyan=g(46,49);h.bgWhite=g(47,49);h.bgGray=g(100,49);h.redBright=g(91,39);h.greenBright=g(92,39);h.yellowBright=g(93,39);h.blueBright=g(94,39);h.magentaBright=g(95,39);h.cyanBright=g(96,39);h.whiteBright=g(97,39);h.bgRedBright=g(101,49);h.bgGreenBright=g(102,49);h.bgYellowBright=g(103,49);h.bgBlueBright=g(104,49);h.bgMagentaBright=g(105,49);h.bgCyanBright=g(106,49);h.bgWhiteBright=g(107,49);ao.exports=h});var Ko=D((pS,Ho)=>{Ho.exports=qo;qo.sync=cd;var Vo=require("fs");function ad(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Yo(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:ad(t,r)}function qo(e,t,r){Vo.stat(e,function(n,o){r(n,n?!1:Yo(o,e,t))})}function cd(e,t){return Yo(Vo.statSync(e),e,t)}});var ei=D((uS,Qo)=>{Qo.exports=Jo;Jo.sync=ld;var Xo=require("fs");function Jo(e,t,r){Xo.stat(e,function(n,o){r(n,n?!1:Zo(o,t))})}function ld(e,t){return Zo(Xo.statSync(e),t)}function Zo(e,t){return e.isFile()&&fd(e,t)}function fd(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),f=parseInt("001",8),l=a|c,d=r&f||r&c&&o===s||r&a&&n===i||r&l&&i===0;return d}});var ri=D((hS,ti)=>{var mS=require("fs"),ut;process.platform==="win32"||global.TESTING_WINDOWS?ut=Ko():ut=ei();ti.exports=Pr;Pr.sync=dd;function Pr(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Pr(e,t||{},function(i,s){i?o(i):n(s)})})}ut(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function dd(e,t){try{return ut.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var li=D((gS,ci)=>{var he=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ni=require("path"),pd=he?";":":",oi=ri(),ii=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),si=(e,t)=>{let r=t.colon||pd,n=e.match(/\//)||he&&e.match(/\\/)?[""]:[...he?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=he?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=he?o.split(r):[""];return he&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},ai=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=si(e,t),s=[],a=f=>new Promise((l,d)=>{if(f===n.length)return t.all&&s.length?l(s):d(ii(e));let p=n[f],u=/^".*"$/.test(p)?p.slice(1,-1):p,m=ni.join(u,e),S=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+m:m;l(c(S,f,0))}),c=(f,l,d)=>new Promise((p,u)=>{if(d===o.length)return p(a(l+1));let m=o[d];oi(f+m,{pathExt:i},(S,E)=>{if(!S&&E)if(t.all)s.push(f+m);else return p(f+m);return p(c(f,l,d+1))})});return r?a(0).then(f=>r(null,f),r):a(0)},ud=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=si(e,t),i=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,f=ni.join(c,e),l=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;for(let d=0;d<n.length;d++){let p=l+n[d];try{if(oi.sync(p,{pathExt:o}))if(t.all)i.push(p);else return p}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw ii(e)};ci.exports=ai;ai.sync=ud});var di=D((yS,Br)=>{"use strict";var fi=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Br.exports=fi;Br.exports.default=fi});var hi=D((SS,mi)=>{"use strict";var pi=require("path"),md=li(),hd=di();function ui(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=md.sync(e.command,{path:r[hd({env:r})],pathExt:t?pi.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=pi.resolve(o?e.options.cwd:"",s)),s}function gd(e){return ui(e)||ui(e,!0)}mi.exports=gd});var gi=D((bS,Fr)=>{"use strict";var Lr=/([()\][%!^"`<>&|;, *?])/g;function yd(e){return e=e.replace(Lr,"^$1"),e}function Sd(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Lr,"^$1"),t&&(e=e.replace(Lr,"^$1")),e}Fr.exports.command=yd;Fr.exports.argument=Sd});var Si=D((wS,yi)=>{"use strict";yi.exports=/^#!(.*)/});var wi=D((xS,bi)=>{"use strict";var bd=Si();bi.exports=(e="")=>{let t=e.match(bd);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Ei=D((ES,xi)=>{"use strict";var $r=require("fs"),wd=wi();function xd(e){let r=Buffer.alloc(150),n;try{n=$r.openSync(e,"r"),$r.readSync(n,r,0,150,0),$r.closeSync(n)}catch{}return wd(r.toString())}xi.exports=xd});var Ii=D((TS,Oi)=>{"use strict";var Ed=require("path"),Ti=hi(),Ai=gi(),Td=Ei(),Ad=process.platform==="win32",Od=/\.(?:com|exe)$/i,Id=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Dd(e){e.file=Ti(e);let t=e.file&&Td(e.file);return t?(e.args.unshift(e.file),e.command=t,Ti(e)):e.file}function Rd(e){if(!Ad)return e;let t=Dd(e),r=!Od.test(t);if(e.options.forceShell||r){let n=Id.test(t);e.command=Ed.normalize(e.command),e.command=Ai.command(e.command),e.args=e.args.map(i=>Ai.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Cd(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:Rd(n)}Oi.exports=Cd});var Ci=D((AS,Ri)=>{"use strict";var Ur=process.platform==="win32";function vr(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Md(e,t){if(!Ur)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=Di(o,t,"spawn");if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function Di(e,t){return Ur&&e===1&&!t.file?vr(t.original,"spawn"):null}function Pd(e,t){return Ur&&e===1&&!t.file?vr(t.original,"spawnSync"):null}Ri.exports={hookChildProcess:Md,verifyENOENT:Di,verifyENOENTSync:Pd,notFoundError:vr}});var Bi=D((OS,ge)=>{"use strict";var Mi=require("child_process"),Nr=Ii(),_r=Ci();function Pi(e,t,r){let n=Nr(e,t,r),o=Mi.spawn(n.command,n.args,n.options);return _r.hookChildProcess(o,n),o}function Bd(e,t,r){let n=Nr(e,t,r),o=Mi.spawnSync(n.command,n.args,n.options);return o.error=o.error||_r.verifyENOENTSync(o.status,n),o}ge.exports=Pi;ge.exports.spawn=Pi;ge.exports.sync=Bd;ge.exports._parse=Nr;ge.exports._enoent=_r});var Tg={};of(Tg,{default:()=>dr});module.exports=sf(Tg);var Zl=require("@oclif/core");var X=require("@oclif/core");var Pe=T(require("node:fs")),ur=T(require("node:path")),no=T(require("node:os"));var ro={production:{url:"https://www.raycast.com",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},staging:{url:"https://www.rayca.st",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},development:{url:"http://localhost:3000",clientID:"rOCD_LhnXFObSLu9v7788qOGu25FZDqEzGjet4Q45ZY"}}[process.env.API_ENV||"production"],af="e69bae0ec90f5e838555",z={},oo;function io(e){oo=e;try{z=JSON.parse(Pe.readFileSync(ur.join(ff(),"config.json"),"utf8"))}catch(t){if(t instanceof Error&&t.code==="ENOENT")return;throw new Error(`Failed to read config file: ${t}`)}}function cf(e){switch(e){case"raycastApiURL":return process.env.RAY_APIURL||z.APIURL||ro.url;case"raycastAccessToken":return process.env.RAY_TOKEN||z.Token||z.AccessToken||"";case"raycastClientId":return process.env.RAY_CLIENT_ID||z.ClientID||ro.clientID;case"githubClientId":return process.env.RAY_GithubClientID||z.GithubClientID||af;case"githubAccessToken":return process.env.GITHUB_ACCESS_TOKEN||z.GithubAccessToken||"";case"flavorName":return process.env.RAY_Target||(typeof z.Target>"u"?so("release"):z.Target)}}function so(e){switch(e){case"debug":return"debug";case"internal":return"internal";case"release":return"";case"x":return"x";case"x-internal":return"x-internal";case"x-debug":return"x-debug";case void 0:return cf("flavorName")}}function lf(){let e=so(oo);return e==""?"raycast":`raycast-${e}`}function ff(){let e=ur.join(no.default.homedir(),".config",lf());return Pe.mkdirSync(e,{recursive:!0}),e}var w=T(co());var oe=[];oe.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&oe.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&oe.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Je=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",mr=Symbol.for("signal-exit emitter"),hr=globalThis,uf=Object.defineProperty.bind(Object),gr=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(hr[mr])return hr[mr];uf(hr,mr,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(r,n)===!0||o;return t==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},Ze=class{},mf=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),yr=class extends Ze{onExit(){return()=>{}}load(){}unload(){}},Sr=class extends Ze{#t=br.platform==="win32"?"SIGINT":"SIGHUP";#r=new gr;#e;#n;#i;#o={};#s=!1;constructor(t){super(),this.#e=t,this.#o={};for(let r of oe)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),n.length===o){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||t.kill(t.pid,a)}};this.#i=t.reallyExit,this.#n=t.emit}onExit(t,r){if(!Je(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,t),()=>{this.#r.removeListener(n,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let t of oe)try{let r=this.#o[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#c(t,...r),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#s&&(this.#s=!1,oe.forEach(t=>{let r=this.#o[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#i,this.#r.count-=1)}#a(t){return Je(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let n=this.#n;if(t==="exit"&&Je(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,t,...r)}},br=globalThis.process,{onExit:lo,load:Bg,unload:Lg}=mf(Je(br)?new Sr(br):new yr);var wr=T(require("node:process"),1);function xr(){let{env:e}=wr.default,{TERM:t,TERM_PROGRAM:r}=e;return wr.default.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Ug=(0,w.blue)((0,w.dim)("internal only"));var ie={wait:`\u{1F550}${(0,w.blue)("wait")} - `,info:`${process.env.GITHUB_ACTIONS==="true"?"\u2139\uFE0F":"\u2139\uFE0F "}${(0,w.cyan)("info")} - `,success:`\u2705${(0,w.green)("ready")} - `,warn:`${process.env.GITHUB_ACTIONS==="true"?"\u26A0\uFE0F":"\u26A0\uFE0F "}${(0,w.yellow)("warn")} - `,error:`\u{1F4A5}${(0,w.red)("error")} - `,event:`\u26A1\uFE0F${(0,w.magenta)("event")} - `,paymentPrompt:`\u{1F4B0}${(0,w.yellowBright)("plan")} - `},hf=!0;function fo(e,t){e||(ie.wait=`${(0,w.blue)("wait")} - `,ie.info=`${(0,w.cyan)("info")} - `,ie.success=`${(0,w.green)("ready")} - `,ie.warn=`${(0,w.yellow)("warn")} - `,ie.error=`${(0,w.red)("error")} - `,ie.event=`${(0,w.magenta)("event")} - `,ie.paymentPrompt=`${(0,w.yellowBright)("plan")} - `),t&&(hf=!1)}var Qe=class extends X.Command{static baseFlags={"exit-on-error":X.Flags.boolean({default:!0,helpGroup:"GLOBAL",aliases:["exitOnError"],deprecateAliases:!0,summary:"Always exit with non-zero code on error",allowNo:!0}),emoji:X.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Prefix output with emojis \u{1F308}"}),help:X.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Show the help message for the command"}),"non-interactive":X.Flags.boolean({char:"I",default:!1,helpGroup:"GLOBAL",summary:"Disable interactive outputs, useful for CI"}),target:X.Flags.option({char:"t",description:"Raycast app target",helpGroup:"GLOBAL",multiple:!1,options:["debug","internal","release","x","x-debug","x-internal"],hidden:!0})()};flags;args;async init(){await super.init(),process.on("SIGINT",()=>process.exit(1));let{args:t,flags:r}=await this.parse({flags:this.ctor.flags,baseFlags:super.ctor.baseFlags,enableJsonFlag:this.ctor.enableJsonFlag,args:this.ctor.args,strict:this.ctor.strict});this.flags=r,this.args=t,io(this.flags.target),fo(this.flags.emoji,this.flags["non-interactive"])}error(t,r){return r?.message&&t instanceof Error&&(t.message=`${r.message} (${t.message})`,delete r.message),super.error(t,r)}async catch(t){return super.catch(t)}async finally(t){return super.finally(t)}};function x(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var po=require("node:url"),pe=(e,t)=>{let r=Tr(gf(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},gf=e=>Er(e)?e.toString():e,Er=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,Tr=e=>e instanceof URL?(0,po.fileURLToPath)(e):e;var et=(e,t=[],r={})=>{let n=pe(e,"First argument"),[o,i]=x(t)?[[],t]:[t,r];if(!Array.isArray(o))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${o}`);let s=o.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!x(i))throw new TypeError(`Last argument must be an options object: ${i}`);return[n,s,i]};var xo=require("node:child_process");var uo=require("node:string_decoder"),{toString:mo}=Object.prototype,ho=e=>mo.call(e)==="[object ArrayBuffer]",A=e=>mo.call(e)==="[object Uint8Array]",W=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),yf=new TextEncoder,go=e=>yf.encode(e),Sf=new TextDecoder,tt=e=>Sf.decode(e),yo=(e,t)=>bf(e,t).join(""),bf=(e,t)=>{if(t==="utf8"&&e.every(i=>typeof i=="string"))return e;let r=new uo.StringDecoder(t),n=e.map(i=>typeof i=="string"?go(i):i).map(i=>r.write(i)),o=r.end();return o===""?n:[...n,o]},Be=e=>e.length===1&&A(e[0])?e[0]:Ar(wf(e)),wf=e=>e.map(t=>typeof t=="string"?go(t):t),Ar=e=>{let t=new Uint8Array(xf(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},xf=e=>{let t=0;for(let r of e)t+=r.length;return t};var Eo=e=>Array.isArray(e)&&Array.isArray(e.raw),To=(e,t)=>{let r=[];for(let[i,s]of e.entries())r=Ef({templates:e,expressions:t,tokens:r,index:i,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...o]=r;return[n,o,{}]},Ef=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{if(o===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[n]}`);let{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:a}=Tf(o,e.raw[n]),c=bo(r,i,s);if(n===t.length)return c;let f=t[n],l=Array.isArray(f)?f.map(d=>wo(d)):[wo(f)];return bo(c,l,a)},Tf=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,o=So.has(t[0]);for(let s=0,a=0;s<e.length;s+=1,a+=1){let c=t[a];if(So.has(c))n!==s&&r.push(e.slice(n,s)),n=s+1;else if(c==="\\"){let f=t[a+1];f==="u"&&t[a+2]==="{"?a=t.indexOf("}",a+3):a+=Af[f]??1}}let i=n===e.length;return i||r.push(e.slice(n)),{nextTokens:r,leadingWhitespaces:o,trailingWhitespaces:i}},So=new Set([" "," ","\r",`
2
2
  `]),Af={x:3,u:5},bo=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],wo=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(x(e)&&("stdout"in e||"isMaxBuffer"in e))return Of(e);throw e instanceof xo.ChildProcess||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},Of=({stdout:e})=>{if(typeof e=="string")return e;if(A(e))return tt(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};var Lc=require("node:child_process");var Oo=require("node:util");var rt=T(require("node:process"),1),B=e=>nt.includes(e),nt=[rt.default.stdin,rt.default.stdout,rt.default.stderr],M=["stdin","stdout","stderr"],ot=e=>M[e]??`stdio[${e}]`;var Io=e=>{let t={...e};for(let r of Dr)t[r]=Or(e,r);return t},Or=(e,t)=>{let r=Array.from({length:If(e)+1}),n=Df(e[t],r,t);return Bf(n,t)},If=({stdio:e})=>Array.isArray(e)?Math.max(e.length,M.length):M.length,Df=(e,t,r)=>x(e)?Rf(e,t,r):t.fill(e),Rf=(e,t,r)=>{for(let n of Object.keys(e).sort(Cf))for(let o of Mf(n,r,t))t[o]=e[n];return t},Cf=(e,t)=>Ao(e)<Ao(t)?1:-1,Ao=e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,Mf=(e,t,r)=>{if(e==="ipc")return[r.length-1];let n=Ir(e);if(n===void 0||n===0)throw new TypeError(`"${t}.${e}" is invalid.
3
3
  It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
4
4
  Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},Ir=e=>{if(e==="all")return e;if(M.includes(e))return M.indexOf(e);let t=Pf.exec(e);if(t!==null)return Number(t[1])},Pf=/^fd(\d+)$/,Bf=(e,t)=>e.map(r=>r===void 0?Ff[t]:r),Lf=(0,Oo.debuglog)("execa").enabled?"full":"none",Ff={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:Lf,stripFinalNewline:!0},Dr=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],V=(e,t)=>t==="ipc"?e.at(-1):e[t];var ue=({verbose:e},t)=>Rr(e,t)!=="none",me=({verbose:e},t)=>!["none","short"].includes(Rr(e,t)),Do=({verbose:e},t)=>{let r=Rr(e,t);return it(r)?r:void 0},Rr=(e,t)=>t===void 0?$f(e):V(e,t),$f=e=>e.find(t=>it(t))??st.findLast(t=>e.includes(t)),it=e=>typeof e=="function",st=["none","short","full"];var Go=require("node:util");var Ro=require("node:process"),Co=require("node:util"),Mo=(e,t)=>{let r=[e,...t],n=r.join(" "),o=r.map(i=>kf(Po(i))).join(" ");return{command:n,escapedCommand:o}},Le=e=>(0,Co.stripVTControlCharacters)(e).split(`