@5minds/processcube_app_sdk 5.1.0-develop-8d17a9-lutgvjzv → 5.1.0-develop-fe7d56-luuyajv6
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.
|
@@ -2,5 +2,12 @@ type DynamicLinkProps = {
|
|
|
2
2
|
href: string;
|
|
3
3
|
children: any;
|
|
4
4
|
};
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated This component should no longer be used.
|
|
7
|
+
* It will be removed in a future version of this package.
|
|
8
|
+
* Please use the NextJS Link component instead.
|
|
9
|
+
*
|
|
10
|
+
* Former workaround for https://github.com/vercel/next.js/issues/42991#issuecomment-1592921378
|
|
11
|
+
*/
|
|
5
12
|
export declare function DynamicLink({ href, children }: DynamicLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
6
13
|
export {};
|
package/build/client/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var m=Object.create;var i=Object.defineProperty;var
|
|
1
|
+
"use client";var m=Object.create;var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var k=(e,n)=>{for(var r in n)i(e,r,{get:n[r],enumerable:!0})},a=(e,n,r,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of u(n))!l.call(e,t)&&t!==r&&i(e,t,{get:()=>n[t],enumerable:!(o=s(n,t))||o.enumerable});return e};var y=(e,n,r)=>(r=e!=null?m(f(e)):{},a(n||!e||!e.__esModule?i(r,"default",{value:e,enumerable:!0}):r,e)),D=e=>a(i({},"__esModule",{value:!0}),e);var h={};k(h,{DynamicLink:()=>d});module.exports=D(h);var x=require("client-only");var c=require("next/navigation"),p=y(require("react"),1);function d({href:e,children:n}){console.warn("The DynamicLink component is deprecated. Please use the NextJS Link component instead.");let r=(0,c.useRouter)();return p.default.createElement("a",{href:e,onClick:o=>{o.preventDefault(),r.replace(e),r.refresh()}},n)}0&&(module.exports={DynamicLink});
|
package/build/client/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"client-only";import{useRouter as o}from"next/navigation";import i from"react";function
|
|
1
|
+
"use client";import"client-only";import{useRouter as o}from"next/navigation";import i from"react";function p({href:e,children:r}){console.warn("The DynamicLink component is deprecated. Please use the NextJS Link component instead.");let n=o();return i.createElement("a",{href:e,onClick:t=>{t.preventDefault(),n.replace(e),n.refresh()}},r)}export{p as DynamicLink};
|
package/build/server/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var se=(e,s)=>{for(var t in s)_(e,t,{get:s[t],enumerable:!0})},te=(e,s,t,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let n of z(s))!ee.call(e,n)&&n!==t&&_(e,n,{get:()=>s[n],enumerable:!(r=Q(s,n))||r.enumerable});return e};var re=e=>te(_({},"__esModule",{value:!0}),e);var Ne={};se(Ne,{finishUserTask:()=>Se,finishUserTaskAndGetNext:()=>ke,getActiveProcessInstances:()=>fe,getAssignedUserTasksByIdentity:()=>we,getEngineClient:()=>de,getIdentity:()=>pe,getReservedUserTasksByIdentity:()=>ye,getUserTasks:()=>j,getWaitingUserTaskByFlowNodeInstanceId:()=>$,getWaitingUserTasks:()=>me,getWaitingUserTasksByCorrelationId:()=>ge,getWaitingUserTasksByFlowNodeId:()=>Ie,getWaitingUserTasksByProcessInstanceId:()=>Ee,navigateToUrl:()=>_e,startProcess:()=>xe,waitForUserTask:()=>Te,withApplicationSdk:()=>Ce});module.exports=re(Ne);var ls=require("only-server"),ds=require("../common/index.cjs");var U=require("node:child_process"),E=require("node:fs"),a=require("node:path"),h=require("chokidar"),O=require("esbuild"),L=require("jwt-decode"),y=require("openid-client"),A=require("@5minds/processcube_engine_sdk");var P=require("@5minds/processcube_engine_client"),x=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",o=new P.EngineClient(x);var ne={token:"ZHVtbXlfdG9rZW4=",userId:"dummy_token"},oe=.85,g=["external_task.ts","external_task.js"],S=process.env.PROCESSCUBE_AUTHORITY_URL!==void 0,T=new A.Logger("processcube_app_sdk:external_task_adapter"),f={},m;async function F(e){if(e&&!(0,E.existsSync)(e))throw new Error(`Invalid customExternalTasksDirPath. The given path '${e}' does not exist`);y.custom.setHttpOptionsDefaults({timeout:1e5});let s=await D();m=await W(s),await ae(s);let t=le(e);(0,h.watch)(t).on("add",async r=>{if(g.includes((0,a.basename)(r)))return b(r,t)}).on("change",async r=>{if(g.includes((0,a.basename)(r)))return ie(r,t)}).on("unlink",async r=>{g.includes((0,a.basename)(r))&&v(r)}).on("error",r=>T.error(`Watcher error: ${r}`))}async function b(e,s){let t=(0,a.dirname)(e);if((await E.promises.readdir(t)).filter(C=>g.includes(C)).length>1){T.error(`Multiple external task files found in directory ${t}. Stopping all external task workers for this directory.`),f[t]&&v(e);return}let i=await B(e),l=(0,a.relative)(s,t),k=M(l),I=(0,a.join)(__dirname,"lib/ExternalTaskWorkerProcess.cjs"),d=(0,U.fork)(I,{env:{NODE_ENV:process.env.NODE_ENV,PROCESSCUBE_ENGINE_URL:x}});f[t]=d,d.once("disconnect",()=>{delete f[t]}),d.send({action:"create",payload:{topic:k,identity:m,moduleString:i,workerPath:e}})}async function ie(e,s){let t=(0,a.dirname)(e),r=f[t];if(!r)return b(e,s);let n=await B(e),i=(0,a.relative)(s,t),l=M(i);r.send({action:"restart",payload:{topic:l,identity:m,moduleString:n,workerPath:e}})}function v(e){let s=(0,a.dirname)(e),t=f[s];t&&t.kill()}async function D(){if(!S)return null;if(!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID||!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET){let r=new Error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing. For help, please refer to our documentation on environment variables at: https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#authority");throw T.error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing",{err:r}),r}let e=await y.Issuer.discover(process.env.PROCESSCUBE_AUTHORITY_URL);return await new e.Client({client_id:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID,client_secret:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET}).grant({grant_type:"client_credentials",scope:"engine_etw"})}function W(e){if(!S||e===null)return ne;let s=e.access_token,t=(0,L.jwtDecode)(s);return{token:e.access_token,userId:t.sub}}async function ae(e){let s=5;if(!S||e===null)return;let r=await ce(e)*oe*1e3,n=async()=>{try{let i=await D();m=W(i);for(let l of Object.values(f))l.send({action:"updateIdentity",payload:{identity:m}});s=5,setTimeout(n,r)}catch(i){if(s===0){T.error("Could not refresh identity for external task worker processes. Stopping all external task workers.",{error:i});for(let k of Object.values(f))k.kill();return}T.error("Could not refresh identity for external task worker processes.",{error:i,retryCount:s}),s--;let l=2*1e3;setTimeout(n,l)}};setTimeout(n,r)}async function B(e){let s=await(0,O.build)({entryPoints:[e],write:!1,bundle:!0,platform:"node",target:"node18",format:"cjs",external:["@opentelemetry/api"]});if(s.errors.length>0)throw T.error(`Could not transpile file at '${e}'`,{errors:s.errors}),new Error(`Could not transpile file at '${e}'`);return s.warnings.length>0&&T.warn(`Transpiled file at '${e}' with warnings`,{warnings:s.warnings}),s.outputFiles[0].text}async function ce(e){let s=e.expires_in;if(!s&&e.expires_at&&(s=Math.floor(e.expires_at-Date.now()/1e3)),s===void 0)throw new Error("Could not determine the time until the access token for external task workers expires");return s}function M(e){return e.replace(/^\.\/+|\([^)]+\)|^\/*|\/*$/g,"").replace(/[\/]{2,}/g,"/")}function le(e){let s,t=[e,(0,a.join)(process.cwd(),"app"),(0,a.join)(process.cwd(),"src","app")];for(let r of t)if(r&&(0,E.existsSync)(r)){s=r;break}if(!s)throw new Error("Could not find external tasks directory");return s}function de(){return o}var N=require("next-auth/jwt"),q=require("next/dist/compiled/@edge-runtime/cookies"),p=require("next/headers"),ue=process.env.NEXTAUTH_URL?.startsWith("https://"),K=`${ue?"__Secure-":""}next-auth.session-token`;async function pe(){let e=await(0,N.getToken)({req:{cookies:(0,p.cookies)(),headers:(0,p.headers)()}});if(e?.expiresAt&&Date.now()>=e.expiresAt*1e3){let t=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:(0,p.cookies)().toString()}}),r=new q.ResponseCookies(t.headers),n=r.get(K);if(n){let i=!1;try{(0,p.cookies)().set(K,n.value,{...n})}catch{i=!0}if(e=await(0,N.getToken)({req:{cookies:i?r:(0,p.cookies)(),headers:(0,p.headers)()}}),e?.error)throw e.error}}if(!e?.accessToken||!e?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:e?.accessToken,userId:e?.sub}}var X=require("@5minds/processcube_engine_client");async function fe(e){return await o.processInstances.query({...e?.query,state:X.DataModels.ProcessInstances.ProcessInstanceState.running},e?.options)}var u=require("@5minds/processcube_engine_client"),c=require("../common/index.cjs");async function Te(e={},s){let{correlationId:t,processInstanceId:r,flowNodeId:n}=e;return new Promise(async(i,l)=>{let k=await o.userTasks.onUserTaskWaiting(async d=>{let C=t!==void 0&&d.correlationId!==t,Y=d.flowNodeInstanceId===void 0,Z=r!==void 0&&d.processInstanceId!==r,J=n!==void 0&&d.flowNodeId!==n;if(C||Y||Z||J)return;let R=await $(d.flowNodeInstanceId,{identity:s});return o.notification.removeSubscription(k,s),R===null?l(new Error(`UserTask with instance ID "${d.flowNodeInstanceId}" does not exist.`)):i(R)},{identity:s}),I=await j({correlationId:t,processInstanceId:r,flowNodeId:n,state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:s});I.userTasks.length>0&&(o.notification.removeSubscription(k,s),i(I.userTasks[0]))})}async function ke(e,s={},t={},r){await o.userTasks.finishUserTask(e,t,r);let n={state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,...s},i=await o.userTasks.query(n,{identity:r});return(0,c.mapUserTask)(i.userTasks[0])}async function j(...e){let s=await o.userTasks.query(...e);return(0,c.mapUserTaskList)(s)}async function me(e){let s=await o.userTasks.query({state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return(0,c.mapUserTaskList)(s)}async function Ee(e,s){let t=await o.userTasks.query({processInstanceId:e,state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},s);return(0,c.mapUserTaskList)(t)}async function Ie(e,s){let t=await o.userTasks.query({flowNodeId:e,state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},s);return(0,c.mapUserTaskList)(t)}async function $(e,s){let t=await o.userTasks.query({flowNodeInstanceId:e,state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{...s,limit:1});return t.userTasks.length===0?null:(0,c.mapUserTask)(t.userTasks[0])}async function ge(e,s){let t=await o.userTasks.query({correlationId:e,state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},s);return(0,c.mapUserTaskList)(t)}async function ye(e,s){let t=await o.userTasks.query({state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...s}),r=t.userTasks.filter(n=>n.actualOwnerId===e.userId);return t.userTasks=r,(0,c.mapUserTaskList)(t)}async function we(e,s){let t=await o.userTasks.query({state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...s}),r=t.userTasks.filter(n=>n.assignedUserIds?.includes(e.userId));return t.userTasks=r,(0,c.mapUserTaskList)(t)}var w=require("next/dist/shared/lib/constants");var G=!1;function Ce(e={}){let{applicationSdk:s,...t}=e;return async(r,n)=>{let i=r===w.PHASE_DEVELOPMENT_SERVER||r===w.PHASE_PRODUCTION_SERVER;return s?.useExternalTasks&&i&&!G&&(G=!0,await F(s?.customExternalTasksDirPath)),t}}var H=require("next/cache"),V=require("next/navigation");function _e(e){(0,H.revalidatePath)(e),(0,V.redirect)(e)}async function xe(...e){return await o.processModels.startProcessInstance(...e)}async function Se(...e){await o.userTasks.finishUserTask(...e)}0&&(module.exports={finishUserTask,finishUserTaskAndGetNext,getActiveProcessInstances,getAssignedUserTasksByIdentity,getEngineClient,getIdentity,getReservedUserTasksByIdentity,getUserTasks,getWaitingUserTaskByFlowNodeInstanceId,getWaitingUserTasks,getWaitingUserTasksByCorrelationId,getWaitingUserTasksByFlowNodeId,getWaitingUserTasksByProcessInstanceId,navigateToUrl,startProcess,waitForUserTask,withApplicationSdk});
|
|
1
|
+
var _=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var se=(e,s)=>{for(var t in s)_(e,t,{get:s[t],enumerable:!0})},te=(e,s,t,n)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of z(s))!ee.call(e,r)&&r!==t&&_(e,r,{get:()=>s[r],enumerable:!(n=Q(s,r))||n.enumerable});return e};var ne=e=>te(_({},"__esModule",{value:!0}),e);var Ne={};se(Ne,{finishUserTask:()=>Pe,finishUserTaskAndGetNext:()=>ke,getActiveProcessInstances:()=>fe,getAssignedUserTasksByIdentity:()=>Ce,getEngineClient:()=>le,getIdentity:()=>pe,getReservedUserTasksByIdentity:()=>we,getUserTasks:()=>G,getWaitingUserTaskByFlowNodeInstanceId:()=>$,getWaitingUserTasks:()=>me,getWaitingUserTasksByCorrelationId:()=>ye,getWaitingUserTasksByFlowNodeId:()=>ge,getWaitingUserTasksByProcessInstanceId:()=>Ee,navigateToUrl:()=>_e,startProcess:()=>xe,waitForProcessEnd:()=>Ie,waitForUserTask:()=>Te,withApplicationSdk:()=>Se});module.exports=ne(Ne);var ls=require("only-server"),us=require("../common/index.cjs");var U=require("node:child_process"),E=require("node:fs"),c=require("node:path"),b=require("chokidar"),O=require("esbuild"),A=require("jwt-decode"),w=require("openid-client"),F=require("@5minds/processcube_engine_sdk");var h=require("@5minds/processcube_engine_client"),x=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",o=new h.EngineClient(x);var re={token:"ZHVtbXlfdG9rZW4=",userId:"dummy_token"},oe=.85,y=["external_task.ts","external_task.js"],P=process.env.PROCESSCUBE_AUTHORITY_URL!==void 0,k=new F.Logger("processcube_app_sdk:external_task_adapter"),T={},m;async function L(e){if(e&&!(0,E.existsSync)(e))throw new Error(`Invalid customExternalTasksDirPath. The given path '${e}' does not exist`);w.custom.setHttpOptionsDefaults({timeout:1e5});let s=await M();m=await W(s),await ie(s);let t=de(e);(0,b.watch)(t).on("add",async n=>{if(y.includes((0,c.basename)(n)))return v(n,t)}).on("change",async n=>{if(y.includes((0,c.basename)(n)))return ae(n,t)}).on("unlink",async n=>{y.includes((0,c.basename)(n))&&D(n)}).on("error",n=>k.error(`Watcher error: ${n}`))}async function v(e,s){let t=(0,c.dirname)(e);if((await E.promises.readdir(t)).filter(S=>y.includes(S)).length>1){k.error(`Multiple external task files found in directory ${t}. Stopping all external task workers for this directory.`),T[t]&&D(e);return}let a=await B(e),i=(0,c.relative)(s,t),p=q(i),I=(0,c.join)(__dirname,"lib/ExternalTaskWorkerProcess.cjs"),d=(0,U.fork)(I,{env:{NODE_ENV:process.env.NODE_ENV,PROCESSCUBE_ENGINE_URL:x}});T[t]=d,d.once("disconnect",()=>{delete T[t]}),d.send({action:"create",payload:{topic:p,identity:m,moduleString:a,workerPath:e}})}async function ae(e,s){let t=(0,c.dirname)(e),n=T[t];if(!n)return v(e,s);let r=await B(e),a=(0,c.relative)(s,t),i=q(a);n.send({action:"restart",payload:{topic:i,identity:m,moduleString:r,workerPath:e}})}function D(e){let s=(0,c.dirname)(e),t=T[s];t&&t.kill()}async function M(){if(!P)return null;if(!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID||!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET){let n=new Error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing. For help, please refer to our documentation on environment variables at: https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#authority");throw k.error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing",{err:n}),n}let e=await w.Issuer.discover(process.env.PROCESSCUBE_AUTHORITY_URL);return await new e.Client({client_id:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID,client_secret:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET}).grant({grant_type:"client_credentials",scope:"engine_etw"})}function W(e){if(!P||e===null)return re;let s=e.access_token,t=(0,A.jwtDecode)(s);return{token:e.access_token,userId:t.sub}}async function ie(e){let s=5;if(!P||e===null)return;let n=await ce(e)*oe*1e3,r=async()=>{try{let a=await M();m=W(a);for(let i of Object.values(T))i.send({action:"updateIdentity",payload:{identity:m}});s=5,setTimeout(r,n)}catch(a){if(s===0){k.error("Could not refresh identity for external task worker processes. Stopping all external task workers.",{error:a});for(let p of Object.values(T))p.kill();return}k.error("Could not refresh identity for external task worker processes.",{error:a,retryCount:s}),s--;let i=2*1e3;setTimeout(r,i)}};setTimeout(r,n)}async function B(e){let s=await(0,O.build)({entryPoints:[e],write:!1,bundle:!0,platform:"node",target:"node18",format:"cjs",external:["@opentelemetry/api"]});if(s.errors.length>0)throw k.error(`Could not transpile file at '${e}'`,{errors:s.errors}),new Error(`Could not transpile file at '${e}'`);return s.warnings.length>0&&k.warn(`Transpiled file at '${e}' with warnings`,{warnings:s.warnings}),s.outputFiles[0].text}async function ce(e){let s=e.expires_in;if(!s&&e.expires_at&&(s=Math.floor(e.expires_at-Date.now()/1e3)),s===void 0)throw new Error("Could not determine the time until the access token for external task workers expires");return s}function q(e){return e.replace(/^\.\/+|\([^)]+\)|^\/*|\/*$/g,"").replace(/[\/]{2,}/g,"/")}function de(e){let s,t=[e,(0,c.join)(process.cwd(),"app"),(0,c.join)(process.cwd(),"src","app")];for(let n of t)if(n&&(0,E.existsSync)(n)){s=n;break}if(!s)throw new Error("Could not find external tasks directory");return s}function le(){return o}var N=require("next-auth/jwt"),X=require("next/dist/compiled/@edge-runtime/cookies"),f=require("next/headers"),ue=process.env.NEXTAUTH_URL?.startsWith("https://"),K=`${ue?"__Secure-":""}next-auth.session-token`;async function pe(){let e=await(0,N.getToken)({req:{cookies:(0,f.cookies)(),headers:(0,f.headers)()}});if(e?.expiresAt&&Date.now()>=e.expiresAt*1e3){let t=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:(0,f.cookies)().toString()}}),n=new X.ResponseCookies(t.headers),r=n.get(K);if(r){let a=!1;try{(0,f.cookies)().set(K,r.value,{...r})}catch{a=!0}if(e=await(0,N.getToken)({req:{cookies:a?n:(0,f.cookies)(),headers:(0,f.headers)()}}),e?.error)throw e.error}}if(!e?.accessToken||!e?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:e?.accessToken,userId:e?.sub}}var g=require("@5minds/processcube_engine_client");async function fe(e){return await o.processInstances.query({...e?.query,state:g.DataModels.ProcessInstances.ProcessInstanceState.running},e?.options)}async function Ie(e){let{processInstanceId:s}=e;return new Promise(async(t,n)=>{let r=[],a=async i=>{if(s!==void 0&&i.processInstanceId!==s)return;let I=await o.processInstances.query({processInstanceId:i.processInstanceId});for(let d of r)o.notification.removeSubscription(d);return I.totalCount===0?n(new Error(`Process with instance ID "${i.processInstanceId}" does not exist.`)):t(I.processInstances[0])};if(r.push(await o.notification.onProcessEnded(a)),r.push(await o.notification.onProcessError(a)),r.push(await o.notification.onProcessTerminated(a)),s){let i=await o.processInstances.query({processInstanceId:s,state:[g.DataModels.ProcessInstances.ProcessInstanceState.finished,g.DataModels.ProcessInstances.ProcessInstanceState.terminated,g.DataModels.ProcessInstances.ProcessInstanceState.error]});if(i.totalCount>0){for(let p of r)o.notification.removeSubscription(p);t(i.processInstances[0])}}})}var u=require("@5minds/processcube_engine_client"),l=require("../common/index.cjs");async function Te(e={},s){let{correlationId:t,processInstanceId:n,flowNodeId:r}=e;return new Promise(async(a,i)=>{let p=await o.userTasks.onUserTaskWaiting(async d=>{let S=t!==void 0&&d.correlationId!==t,Y=d.flowNodeInstanceId===void 0,Z=n!==void 0&&d.processInstanceId!==n,J=r!==void 0&&d.flowNodeId!==r;if(S||Y||Z||J)return;let R=await $(d.flowNodeInstanceId,{identity:s});return o.notification.removeSubscription(p,s),R===null?i(new Error(`UserTask with instance ID "${d.flowNodeInstanceId}" does not exist.`)):a(R)},{identity:s}),I=await G({correlationId:t,processInstanceId:n,flowNodeId:r,state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:s});I.userTasks.length>0&&(o.notification.removeSubscription(p,s),a(I.userTasks[0]))})}async function ke(e,s={},t={},n){await o.userTasks.finishUserTask(e,t,n);let r={state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,...s},a=await o.userTasks.query(r,{identity:n});return(0,l.mapUserTask)(a.userTasks[0])}async function G(...e){let s=await o.userTasks.query(...e);return(0,l.mapUserTaskList)(s)}async function me(e){let s=await o.userTasks.query({state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return(0,l.mapUserTaskList)(s)}async function Ee(e,s){let t=await o.userTasks.query({processInstanceId:e,state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},s);return(0,l.mapUserTaskList)(t)}async function ge(e,s){let t=await o.userTasks.query({flowNodeId:e,state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},s);return(0,l.mapUserTaskList)(t)}async function $(e,s){let t=await o.userTasks.query({flowNodeInstanceId:e,state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{...s,limit:1});return t.userTasks.length===0?null:(0,l.mapUserTask)(t.userTasks[0])}async function ye(e,s){let t=await o.userTasks.query({correlationId:e,state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},s);return(0,l.mapUserTaskList)(t)}async function we(e,s){let t=await o.userTasks.query({state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...s}),n=t.userTasks.filter(r=>r.actualOwnerId===e.userId);return t.userTasks=n,(0,l.mapUserTaskList)(t)}async function Ce(e,s){let t=await o.userTasks.query({state:u.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...s}),n=t.userTasks.filter(r=>r.assignedUserIds?.includes(e.userId));return t.userTasks=n,(0,l.mapUserTaskList)(t)}var C=require("next/dist/shared/lib/constants");var j=!1;function Se(e={}){let{applicationSdk:s,...t}=e;return async(n,r)=>{let a=n===C.PHASE_DEVELOPMENT_SERVER||n===C.PHASE_PRODUCTION_SERVER;return s?.useExternalTasks&&a&&!j&&(j=!0,await L(s?.customExternalTasksDirPath)),t}}var H=require("next/cache"),V=require("next/navigation");function _e(e){(0,H.revalidatePath)(e),(0,V.redirect)(e)}async function xe(...e){return await o.processModels.startProcessInstance(...e)}async function Pe(...e){await o.userTasks.finishUserTask(...e)}0&&(module.exports={finishUserTask,finishUserTaskAndGetNext,getActiveProcessInstances,getAssignedUserTasksByIdentity,getEngineClient,getIdentity,getReservedUserTasksByIdentity,getUserTasks,getWaitingUserTaskByFlowNodeInstanceId,getWaitingUserTasks,getWaitingUserTasksByCorrelationId,getWaitingUserTasksByFlowNodeId,getWaitingUserTasksByProcessInstanceId,navigateToUrl,startProcess,waitForProcessEnd,waitForUserTask,withApplicationSdk});
|
package/build/server/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var Sn=Object.create;var as=Object.defineProperty;var Cn=Object.getOwnPropertyDescriptor;var xn=Object.getOwnPropertyNames;var bn=Object.getPrototypeOf,In=Object.prototype.hasOwnProperty;var L=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,s)=>(typeof require<"u"?require:e)[s]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var vn=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xn(e))!In.call(t,n)&&n!==s&&as(t,n,{get:()=>e[n],enumerable:!(r=Cn(e,n))||r.enumerable});return t};var kn=(t,e,s)=>(s=t!=null?Sn(bn(t)):{},vn(e||!t||!t.__esModule?as(s,"default",{value:t,enumerable:!0}):s,t));var we=v((fc,hs)=>{"use strict";var Nn=L("path"),re="\\\\/",cs=`[^${re}]`,ne="\\.",On="\\+",Pn="\\?",Fe="\\/",Ln="(?=.)",ls="[^/]",it=`(?:${Fe}|$)`,us=`(?:^|${Fe})`,ot=`${ne}{1,2}${it}`,Hn=`(?!${ne})`,Dn=`(?!${us}${ot})`,Fn=`(?!${ne}{0,1}${it})`,$n=`(?!${ot})`,Un=`[^.${Fe}]`,Mn=`${ls}*?`,fs={DOT_LITERAL:ne,PLUS_LITERAL:On,QMARK_LITERAL:Pn,SLASH_LITERAL:Fe,ONE_CHAR:Ln,QMARK:ls,END_ANCHOR:it,DOTS_SLASH:ot,NO_DOT:Hn,NO_DOTS:Dn,NO_DOT_SLASH:Fn,NO_DOTS_SLASH:$n,QMARK_NO_DOT:Un,STAR:Mn,START_ANCHOR:us},Wn={...fs,SLASH_LITERAL:`[${re}]`,QMARK:cs,STAR:`${cs}*?`,DOTS_SLASH:`${ne}{1,2}(?:[${re}]|$)`,NO_DOT:`(?!${ne})`,NO_DOTS:`(?!(?:^|[${re}])${ne}{1,2}(?:[${re}]|$))`,NO_DOT_SLASH:`(?!${ne}{0,1}(?:[${re}]|$))`,NO_DOTS_SLASH:`(?!${ne}{1,2}(?:[${re}]|$))`,QMARK_NO_DOT:`[^.${re}]`,START_ANCHOR:`(?:^|[${re}])`,END_ANCHOR:`(?:[${re}]|$)`},Bn={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};hs.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Bn,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Nn.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Wn:fs}}});var $e=v(Y=>{"use strict";var Gn=L("path"),qn=process.platform==="win32",{REGEX_BACKSLASH:Kn,REGEX_REMOVE_BACKSLASH:Vn,REGEX_SPECIAL_CHARS:jn,REGEX_SPECIAL_CHARS_GLOBAL:Yn}=we();Y.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Y.hasRegexChars=t=>jn.test(t);Y.isRegexChar=t=>t.length===1&&Y.hasRegexChars(t);Y.escapeRegex=t=>t.replace(Yn,"\\$1");Y.toPosixSlashes=t=>t.replace(Kn,"/");Y.removeBackslashes=t=>t.replace(Vn,e=>e==="\\"?"":e);Y.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Y.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:qn===!0||Gn.sep==="\\";Y.escapeLast=(t,e,s)=>{let r=t.lastIndexOf(e,s);return r===-1?t:t[r-1]==="\\"?Y.escapeLast(t,e,r-1):`${t.slice(0,r)}\\${t.slice(r)}`};Y.removePrefix=(t,e={})=>{let s=t;return s.startsWith("./")&&(s=s.slice(2),e.prefix="./"),s};Y.wrapOutput=(t,e={},s={})=>{let r=s.contains?"":"^",n=s.contains?"":"$",o=`${r}(?:${t})${n}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var Rs=v((dc,ys)=>{"use strict";var ds=$e(),{CHAR_ASTERISK:at,CHAR_AT:zn,CHAR_BACKWARD_SLASH:Ae,CHAR_COMMA:Xn,CHAR_DOT:ct,CHAR_EXCLAMATION_MARK:lt,CHAR_FORWARD_SLASH:ms,CHAR_LEFT_CURLY_BRACE:ut,CHAR_LEFT_PARENTHESES:ft,CHAR_LEFT_SQUARE_BRACKET:Qn,CHAR_PLUS:Zn,CHAR_QUESTION_MARK:ps,CHAR_RIGHT_CURLY_BRACE:Jn,CHAR_RIGHT_PARENTHESES:_s,CHAR_RIGHT_SQUARE_BRACKET:ei}=we(),Es=t=>t===ms||t===Ae,gs=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},ti=(t,e)=>{let s=e||{},r=t.length-1,n=s.parts===!0||s.scanToEnd===!0,o=[],i=[],a=[],c=t,u=-1,f=0,h=0,l=!1,m=!1,y=!1,w=!1,T=!1,x=!1,H=!1,F=!1,ee=!1,q=!1,ae=0,K,A,I={value:"",depth:0,isGlob:!1},G=()=>u>=r,_=()=>c.charCodeAt(u+1),P=()=>(K=A,c.charCodeAt(++u));for(;u<r;){A=P();let V;if(A===Ae){H=I.backslashes=!0,A=P(),A===ut&&(x=!0);continue}if(x===!0||A===ut){for(ae++;G()!==!0&&(A=P());){if(A===Ae){H=I.backslashes=!0,P();continue}if(A===ut){ae++;continue}if(x!==!0&&A===ct&&(A=P())===ct){if(l=I.isBrace=!0,y=I.isGlob=!0,q=!0,n===!0)continue;break}if(x!==!0&&A===Xn){if(l=I.isBrace=!0,y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===Jn&&(ae--,ae===0)){x=!1,l=I.isBrace=!0,q=!0;break}}if(n===!0)continue;break}if(A===ms){if(o.push(u),i.push(I),I={value:"",depth:0,isGlob:!1},q===!0)continue;if(K===ct&&u===f+1){f+=2;continue}h=u+1;continue}if(s.noext!==!0&&(A===Zn||A===zn||A===at||A===ps||A===lt)===!0&&_()===ft){if(y=I.isGlob=!0,w=I.isExtglob=!0,q=!0,A===lt&&u===f&&(ee=!0),n===!0){for(;G()!==!0&&(A=P());){if(A===Ae){H=I.backslashes=!0,A=P();continue}if(A===_s){y=I.isGlob=!0,q=!0;break}}continue}break}if(A===at){if(K===at&&(T=I.isGlobstar=!0),y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===ps){if(y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===Qn){for(;G()!==!0&&(V=P());){if(V===Ae){H=I.backslashes=!0,P();continue}if(V===ei){m=I.isBracket=!0,y=I.isGlob=!0,q=!0;break}}if(n===!0)continue;break}if(s.nonegate!==!0&&A===lt&&u===f){F=I.negated=!0,f++;continue}if(s.noparen!==!0&&A===ft){if(y=I.isGlob=!0,n===!0){for(;G()!==!0&&(A=P());){if(A===ft){H=I.backslashes=!0,A=P();continue}if(A===_s){q=!0;break}}continue}break}if(y===!0){if(q=!0,n===!0)continue;break}}s.noext===!0&&(w=!1,y=!1);let N=c,ce="",d="";f>0&&(ce=c.slice(0,f),c=c.slice(f),h-=f),N&&y===!0&&h>0?(N=c.slice(0,h),d=c.slice(h)):y===!0?(N="",d=c):N=c,N&&N!==""&&N!=="/"&&N!==c&&Es(N.charCodeAt(N.length-1))&&(N=N.slice(0,-1)),s.unescape===!0&&(d&&(d=ds.removeBackslashes(d)),N&&H===!0&&(N=ds.removeBackslashes(N)));let p={prefix:ce,input:t,start:f,base:N,glob:d,isBrace:l,isBracket:m,isGlob:y,isExtglob:w,isGlobstar:T,negated:F,negatedExtglob:ee};if(s.tokens===!0&&(p.maxDepth=0,Es(A)||i.push(I),p.tokens=i),s.parts===!0||s.tokens===!0){let V;for(let b=0;b<o.length;b++){let te=V?V+1:f,se=o[b],z=t.slice(te,se);s.tokens&&(b===0&&f!==0?(i[b].isPrefix=!0,i[b].value=ce):i[b].value=z,gs(i[b]),p.maxDepth+=i[b].depth),(b!==0||z!=="")&&a.push(z),V=se}if(V&&V+1<t.length){let b=t.slice(V+1);a.push(b),s.tokens&&(i[i.length-1].value=b,gs(i[i.length-1]),p.maxDepth+=i[i.length-1].depth)}p.slashes=o,p.parts=a}return p};ys.exports=ti});var Ts=v((pc,As)=>{"use strict";var Ue=we(),X=$e(),{MAX_LENGTH:Me,POSIX_REGEX_SOURCE:si,REGEX_NON_SPECIAL_CHARS:ri,REGEX_SPECIAL_CHARS_BACKREF:ni,REPLACEMENTS:ws}=Ue,ii=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let s=`[${t.join("-")}]`;try{new RegExp(s)}catch{return t.map(n=>X.escapeRegex(n)).join("..")}return s},Ee=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,ht=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=ws[t]||t;let s={...e},r=typeof s.maxLength=="number"?Math.min(Me,s.maxLength):Me,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);let o={type:"bos",value:"",output:s.prepend||""},i=[o],a=s.capture?"":"?:",c=X.isWindows(e),u=Ue.globChars(c),f=Ue.extglobChars(u),{DOT_LITERAL:h,PLUS_LITERAL:l,SLASH_LITERAL:m,ONE_CHAR:y,DOTS_SLASH:w,NO_DOT:T,NO_DOT_SLASH:x,NO_DOTS_SLASH:H,QMARK:F,QMARK_NO_DOT:ee,STAR:q,START_ANCHOR:ae}=u,K=g=>`(${a}(?:(?!${ae}${g.dot?w:h}).)*?)`,A=s.dot?"":T,I=s.dot?F:ee,G=s.bash===!0?K(s):q;s.capture&&(G=`(${G})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);let _={input:t,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=X.removePrefix(t,_),n=t.length;let P=[],N=[],ce=[],d=o,p,V=()=>_.index===n-1,b=_.peek=(g=1)=>t[_.index+g],te=_.advance=()=>t[++_.index]||"",se=()=>t.slice(_.index+1),z=(g="",O=0)=>{_.consumed+=g,_.index+=O},Pe=g=>{_.output+=g.output!=null?g.output:g.value,z(g.value)},An=()=>{let g=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)te(),_.start++,g++;return g%2===0?!1:(_.negated=!0,_.start++,!0)},Le=g=>{_[g]++,ce.push(g)},le=g=>{_[g]--,ce.pop()},C=g=>{if(d.type==="globstar"){let O=_.braces>0&&(g.type==="comma"||g.type==="brace"),E=g.extglob===!0||P.length&&(g.type==="pipe"||g.type==="paren");g.type!=="slash"&&g.type!=="paren"&&!O&&!E&&(_.output=_.output.slice(0,-d.output.length),d.type="star",d.value="*",d.output=G,_.output+=d.output)}if(P.length&&g.type!=="paren"&&(P[P.length-1].inner+=g.value),(g.value||g.output)&&Pe(g),d&&d.type==="text"&&g.type==="text"){d.value+=g.value,d.output=(d.output||"")+g.value;return}g.prev=d,i.push(g),d=g},He=(g,O)=>{let E={...f[O],conditions:1,inner:""};E.prev=d,E.parens=_.parens,E.output=_.output;let S=(s.capture?"(":"")+E.open;Le("parens"),C({type:g,value:O,output:_.output?"":y}),C({type:"paren",extglob:!0,value:te(),output:S}),P.push(E)},Tn=g=>{let O=g.close+(s.capture?")":""),E;if(g.type==="negate"){let S=G;if(g.inner&&g.inner.length>1&&g.inner.includes("/")&&(S=K(s)),(S!==G||V()||/^\)+$/.test(se()))&&(O=g.close=`)$))${S}`),g.inner.includes("*")&&(E=se())&&/^\.[^\\/.]+$/.test(E)){let D=ht(E,{...e,fastpaths:!1}).output;O=g.close=`)${D})${S})`}g.prev.type==="bos"&&(_.negatedExtglob=!0)}C({type:"paren",extglob:!0,value:p,output:O}),le("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let g=!1,O=t.replace(ni,(E,S,D,j,M,nt)=>j==="\\"?(g=!0,E):j==="?"?S?S+j+(M?F.repeat(M.length):""):nt===0?I+(M?F.repeat(M.length):""):F.repeat(D.length):j==="."?h.repeat(D.length):j==="*"?S?S+j+(M?G:""):G:S?E:`\\${E}`);return g===!0&&(s.unescape===!0?O=O.replace(/\\/g,""):O=O.replace(/\\+/g,E=>E.length%2===0?"\\\\":E?"\\":"")),O===t&&s.contains===!0?(_.output=t,_):(_.output=X.wrapOutput(O,_,e),_)}for(;!V();){if(p=te(),p==="\0")continue;if(p==="\\"){let E=b();if(E==="/"&&s.bash!==!0||E==="."||E===";")continue;if(!E){p+="\\",C({type:"text",value:p});continue}let S=/^\\+/.exec(se()),D=0;if(S&&S[0].length>2&&(D=S[0].length,_.index+=D,D%2!==0&&(p+="\\")),s.unescape===!0?p=te():p+=te(),_.brackets===0){C({type:"text",value:p});continue}}if(_.brackets>0&&(p!=="]"||d.value==="["||d.value==="[^")){if(s.posix!==!1&&p===":"){let E=d.value.slice(1);if(E.includes("[")&&(d.posix=!0,E.includes(":"))){let S=d.value.lastIndexOf("["),D=d.value.slice(0,S),j=d.value.slice(S+2),M=si[j];if(M){d.value=D+M,_.backtrack=!0,te(),!o.output&&i.indexOf(d)===1&&(o.output=y);continue}}}(p==="["&&b()!==":"||p==="-"&&b()==="]")&&(p=`\\${p}`),p==="]"&&(d.value==="["||d.value==="[^")&&(p=`\\${p}`),s.posix===!0&&p==="!"&&d.value==="["&&(p="^"),d.value+=p,Pe({value:p});continue}if(_.quotes===1&&p!=='"'){p=X.escapeRegex(p),d.value+=p,Pe({value:p});continue}if(p==='"'){_.quotes=_.quotes===1?0:1,s.keepQuotes===!0&&C({type:"text",value:p});continue}if(p==="("){Le("parens"),C({type:"paren",value:p});continue}if(p===")"){if(_.parens===0&&s.strictBrackets===!0)throw new SyntaxError(Ee("opening","("));let E=P[P.length-1];if(E&&_.parens===E.parens+1){Tn(P.pop());continue}C({type:"paren",value:p,output:_.parens?")":"\\)"}),le("parens");continue}if(p==="["){if(s.nobracket===!0||!se().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(Ee("closing","]"));p=`\\${p}`}else Le("brackets");C({type:"bracket",value:p});continue}if(p==="]"){if(s.nobracket===!0||d&&d.type==="bracket"&&d.value.length===1){C({type:"text",value:p,output:`\\${p}`});continue}if(_.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(Ee("opening","["));C({type:"text",value:p,output:`\\${p}`});continue}le("brackets");let E=d.value.slice(1);if(d.posix!==!0&&E[0]==="^"&&!E.includes("/")&&(p=`/${p}`),d.value+=p,Pe({value:p}),s.literalBrackets===!1||X.hasRegexChars(E))continue;let S=X.escapeRegex(d.value);if(_.output=_.output.slice(0,-d.value.length),s.literalBrackets===!0){_.output+=S,d.value=S;continue}d.value=`(${a}${S}|${d.value})`,_.output+=d.value;continue}if(p==="{"&&s.nobrace!==!0){Le("braces");let E={type:"brace",value:p,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};N.push(E),C(E);continue}if(p==="}"){let E=N[N.length-1];if(s.nobrace===!0||!E){C({type:"text",value:p,output:p});continue}let S=")";if(E.dots===!0){let D=i.slice(),j=[];for(let M=D.length-1;M>=0&&(i.pop(),D[M].type!=="brace");M--)D[M].type!=="dots"&&j.unshift(D[M].value);S=ii(j,s),_.backtrack=!0}if(E.comma!==!0&&E.dots!==!0){let D=_.output.slice(0,E.outputIndex),j=_.tokens.slice(E.tokensIndex);E.value=E.output="\\{",p=S="\\}",_.output=D;for(let M of j)_.output+=M.output||M.value}C({type:"brace",value:p,output:S}),le("braces"),N.pop();continue}if(p==="|"){P.length>0&&P[P.length-1].conditions++,C({type:"text",value:p});continue}if(p===","){let E=p,S=N[N.length-1];S&&ce[ce.length-1]==="braces"&&(S.comma=!0,E="|"),C({type:"comma",value:p,output:E});continue}if(p==="/"){if(d.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",i.pop(),d=o;continue}C({type:"slash",value:p,output:m});continue}if(p==="."){if(_.braces>0&&d.type==="dot"){d.value==="."&&(d.output=h);let E=N[N.length-1];d.type="dots",d.output+=p,d.value+=p,E.dots=!0;continue}if(_.braces+_.parens===0&&d.type!=="bos"&&d.type!=="slash"){C({type:"text",value:p,output:h});continue}C({type:"dot",value:p,output:h});continue}if(p==="?"){if(!(d&&d.value==="(")&&s.noextglob!==!0&&b()==="("&&b(2)!=="?"){He("qmark",p);continue}if(d&&d.type==="paren"){let S=b(),D=p;if(S==="<"&&!X.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(d.value==="("&&!/[!=<:]/.test(S)||S==="<"&&!/<([!=]|\w+>)/.test(se()))&&(D=`\\${p}`),C({type:"text",value:p,output:D});continue}if(s.dot!==!0&&(d.type==="slash"||d.type==="bos")){C({type:"qmark",value:p,output:ee});continue}C({type:"qmark",value:p,output:F});continue}if(p==="!"){if(s.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){He("negate",p);continue}if(s.nonegate!==!0&&_.index===0){An();continue}}if(p==="+"){if(s.noextglob!==!0&&b()==="("&&b(2)!=="?"){He("plus",p);continue}if(d&&d.value==="("||s.regex===!1){C({type:"plus",value:p,output:l});continue}if(d&&(d.type==="bracket"||d.type==="paren"||d.type==="brace")||_.parens>0){C({type:"plus",value:p});continue}C({type:"plus",value:l});continue}if(p==="@"){if(s.noextglob!==!0&&b()==="("&&b(2)!=="?"){C({type:"at",extglob:!0,value:p,output:""});continue}C({type:"text",value:p});continue}if(p!=="*"){(p==="$"||p==="^")&&(p=`\\${p}`);let E=ri.exec(se());E&&(p+=E[0],_.index+=E[0].length),C({type:"text",value:p});continue}if(d&&(d.type==="globstar"||d.star===!0)){d.type="star",d.star=!0,d.value+=p,d.output=G,_.backtrack=!0,_.globstar=!0,z(p);continue}let g=se();if(s.noextglob!==!0&&/^\([^?]/.test(g)){He("star",p);continue}if(d.type==="star"){if(s.noglobstar===!0){z(p);continue}let E=d.prev,S=E.prev,D=E.type==="slash"||E.type==="bos",j=S&&(S.type==="star"||S.type==="globstar");if(s.bash===!0&&(!D||g[0]&&g[0]!=="/")){C({type:"star",value:p,output:""});continue}let M=_.braces>0&&(E.type==="comma"||E.type==="brace"),nt=P.length&&(E.type==="pipe"||E.type==="paren");if(!D&&E.type!=="paren"&&!M&&!nt){C({type:"star",value:p,output:""});continue}for(;g.slice(0,3)==="/**";){let De=t[_.index+4];if(De&&De!=="/")break;g=g.slice(3),z("/**",3)}if(E.type==="bos"&&V()){d.type="globstar",d.value+=p,d.output=K(s),_.output=d.output,_.globstar=!0,z(p);continue}if(E.type==="slash"&&E.prev.type!=="bos"&&!j&&V()){_.output=_.output.slice(0,-(E.output+d.output).length),E.output=`(?:${E.output}`,d.type="globstar",d.output=K(s)+(s.strictSlashes?")":"|$)"),d.value+=p,_.globstar=!0,_.output+=E.output+d.output,z(p);continue}if(E.type==="slash"&&E.prev.type!=="bos"&&g[0]==="/"){let De=g[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(E.output+d.output).length),E.output=`(?:${E.output}`,d.type="globstar",d.output=`${K(s)}${m}|${m}${De})`,d.value+=p,_.output+=E.output+d.output,_.globstar=!0,z(p+te()),C({type:"slash",value:"/",output:""});continue}if(E.type==="bos"&&g[0]==="/"){d.type="globstar",d.value+=p,d.output=`(?:^|${m}|${K(s)}${m})`,_.output=d.output,_.globstar=!0,z(p+te()),C({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-d.output.length),d.type="globstar",d.output=K(s),d.value+=p,_.output+=d.output,_.globstar=!0,z(p);continue}let O={type:"star",value:p,output:G};if(s.bash===!0){O.output=".*?",(d.type==="bos"||d.type==="slash")&&(O.output=A+O.output),C(O);continue}if(d&&(d.type==="bracket"||d.type==="paren")&&s.regex===!0){O.output=p,C(O);continue}(_.index===_.start||d.type==="slash"||d.type==="dot")&&(d.type==="dot"?(_.output+=x,d.output+=x):s.dot===!0?(_.output+=H,d.output+=H):(_.output+=A,d.output+=A),b()!=="*"&&(_.output+=y,d.output+=y)),C(O)}for(;_.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(Ee("closing","]"));_.output=X.escapeLast(_.output,"["),le("brackets")}for(;_.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(Ee("closing",")"));_.output=X.escapeLast(_.output,"("),le("parens")}for(;_.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(Ee("closing","}"));_.output=X.escapeLast(_.output,"{"),le("braces")}if(s.strictSlashes!==!0&&(d.type==="star"||d.type==="bracket")&&C({type:"maybe_slash",value:"",output:`${m}?`}),_.backtrack===!0){_.output="";for(let g of _.tokens)_.output+=g.output!=null?g.output:g.value,g.suffix&&(_.output+=g.suffix)}return _};ht.fastpaths=(t,e)=>{let s={...e},r=typeof s.maxLength=="number"?Math.min(Me,s.maxLength):Me,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);t=ws[t]||t;let o=X.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:f,NO_DOTS:h,NO_DOTS_SLASH:l,STAR:m,START_ANCHOR:y}=Ue.globChars(o),w=s.dot?h:f,T=s.dot?l:f,x=s.capture?"":"?:",H={negated:!1,prefix:""},F=s.bash===!0?".*?":m;s.capture&&(F=`(${F})`);let ee=A=>A.noglobstar===!0?F:`(${x}(?:(?!${y}${A.dot?u:i}).)*?)`,q=A=>{switch(A){case"*":return`${w}${c}${F}`;case".*":return`${i}${c}${F}`;case"*.*":return`${w}${F}${i}${c}${F}`;case"*/*":return`${w}${F}${a}${c}${T}${F}`;case"**":return w+ee(s);case"**/*":return`(?:${w}${ee(s)}${a})?${T}${c}${F}`;case"**/*.*":return`(?:${w}${ee(s)}${a})?${T}${F}${i}${c}${F}`;case"**/.*":return`(?:${w}${ee(s)}${a})?${i}${c}${F}`;default:{let I=/^(.*?)\.(\w+)$/.exec(A);if(!I)return;let G=q(I[1]);return G?G+i+I[2]:void 0}}},ae=X.removePrefix(t,H),K=q(ae);return K&&s.strictSlashes!==!0&&(K+=`${a}?`),K};As.exports=ht});var Cs=v((_c,Ss)=>{"use strict";var oi=L("path"),ai=Rs(),dt=Ts(),pt=$e(),ci=we(),li=t=>t&&typeof t=="object"&&!Array.isArray(t),U=(t,e,s=!1)=>{if(Array.isArray(t)){let f=t.map(l=>U(l,e,s));return l=>{for(let m of f){let y=m(l);if(y)return y}return!1}}let r=li(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let n=e||{},o=pt.isWindows(e),i=r?U.compileRe(t,e):U.makeRe(t,e,!1,!0),a=i.state;delete i.state;let c=()=>!1;if(n.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};c=U(n.ignore,f,s)}let u=(f,h=!1)=>{let{isMatch:l,match:m,output:y}=U.test(f,i,e,{glob:t,posix:o}),w={glob:t,state:a,regex:i,posix:o,input:f,output:y,match:m,isMatch:l};return typeof n.onResult=="function"&&n.onResult(w),l===!1?(w.isMatch=!1,h?w:!1):c(f)?(typeof n.onIgnore=="function"&&n.onIgnore(w),w.isMatch=!1,h?w:!1):(typeof n.onMatch=="function"&&n.onMatch(w),h?w:!0)};return s&&(u.state=a),u};U.test=(t,e,s,{glob:r,posix:n}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=s||{},i=o.format||(n?pt.toPosixSlashes:null),a=t===r,c=a&&i?i(t):t;return a===!1&&(c=i?i(t):t,a=c===r),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=U.matchBase(t,e,s,n):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};U.matchBase=(t,e,s,r=pt.isWindows(s))=>(e instanceof RegExp?e:U.makeRe(e,s)).test(oi.basename(t));U.isMatch=(t,e,s)=>U(e,s)(t);U.parse=(t,e)=>Array.isArray(t)?t.map(s=>U.parse(s,e)):dt(t,{...e,fastpaths:!1});U.scan=(t,e)=>ai(t,e);U.compileRe=(t,e,s=!1,r=!1)=>{if(s===!0)return t.output;let n=e||{},o=n.contains?"":"^",i=n.contains?"":"$",a=`${o}(?:${t.output})${i}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=U.toRegex(a,e);return r===!0&&(c.state=t),c};U.makeRe=(t,e={},s=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(n.output=dt.fastpaths(t,e)),n.output||(n=dt(t,e)),U.compileRe(n,e,s,r)};U.toRegex=(t,e)=>{try{let s=e||{};return new RegExp(t,s.flags||(s.nocase?"i":""))}catch(s){if(e&&e.debug===!0)throw s;return/$^/}};U.constants=ci;Ss.exports=U});var _t=v((Ec,xs)=>{"use strict";xs.exports=Cs()});var Ls=v((gc,Ps)=>{"use strict";var Se=L("fs"),{Readable:ui}=L("stream"),Te=L("path"),{promisify:qe}=L("util"),Et=_t(),fi=qe(Se.readdir),hi=qe(Se.stat),bs=qe(Se.lstat),di=qe(Se.realpath),pi="!",Ns="READDIRP_RECURSIVE_ERROR",_i=new Set(["ENOENT","EPERM","EACCES","ELOOP",Ns]),gt="files",Os="directories",Be="files_directories",We="all",Is=[gt,Os,Be,We],Ei=t=>_i.has(t.code),[vs,gi]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),mi=process.platform==="win32"&&(vs>10||vs===10&&gi>=5),ks=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=Et(t.trim());return s=>e(s.basename)}if(Array.isArray(t)){let e=[],s=[];for(let r of t){let n=r.trim();n.charAt(0)===pi?s.push(Et(n.slice(1))):e.push(Et(n))}return s.length>0?e.length>0?r=>e.some(n=>n(r.basename))&&!s.some(n=>n(r.basename)):r=>!s.some(n=>n(r.basename)):r=>e.some(n=>n(r.basename))}}},Ge=class t extends ui{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:gt,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let s={...t.defaultOptions,...e},{root:r,type:n}=s;this._fileFilter=ks(s.fileFilter),this._directoryFilter=ks(s.directoryFilter);let o=s.lstat?bs:hi;mi?this._stat=i=>o(i,{bigint:!0}):this._stat=o,this._maxDepth=s.depth,this._wantsDir=[Os,Be,We].includes(n),this._wantsFile=[gt,Be,We].includes(n),this._wantsEverything=n===We,this._root=Te.resolve(r),this._isDirent="Dirent"in Se&&!s.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:s,depth:r,files:n=[]}=this.parent||{};if(n.length>0){let o=n.splice(0,e).map(i=>this._formatEntry(i,s));for(let i of await Promise.all(o)){if(this.destroyed)return;let a=await this._getEntryType(i);a==="directory"&&this._directoryFilter(i)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(i.fullPath,r+1)),this._wantsDir&&(this.push(i),e--)):(a==="file"||this._includeAsFile(i))&&this._fileFilter(i)&&this._wantsFile&&(this.push(i),e--)}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(s){this.destroy(s)}finally{this.reading=!1}}}async _exploreDir(e,s){let r;try{r=await fi(e,this._rdOptions)}catch(n){this._onError(n)}return{files:r,depth:s,path:e}}async _formatEntry(e,s){let r;try{let n=this._isDirent?e.name:e,o=Te.resolve(Te.join(s,n));r={path:Te.relative(this._root,o),fullPath:o,basename:n},r[this._statsProp]=this._isDirent?e:await this._stat(o)}catch(n){this._onError(n)}return r}_onError(e){Ei(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let s=e&&e[this._statsProp];if(s){if(s.isFile())return"file";if(s.isDirectory())return"directory";if(s&&s.isSymbolicLink()){let r=e.fullPath;try{let n=await di(r),o=await bs(n);if(o.isFile())return"file";if(o.isDirectory()){let i=n.length;if(r.startsWith(n)&&r.substr(i,1)===Te.sep){let a=new Error(`Circular symlink detected: "${r}" points to "${n}"`);return a.code=Ns,this._onError(a)}return"directory"}}catch(n){this._onError(n)}}}}_includeAsFile(e){let s=e&&e[this._statsProp];return s&&this._wantsEverything&&!s.isDirectory()}},ge=(t,e={})=>{let s=e.entryType||e.type;if(s==="both"&&(s=Be),s&&(e.type=s),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(s&&!Is.includes(s))throw new Error(`readdirp: Invalid type passed. Use one of ${Is.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new Ge(e)},yi=(t,e={})=>new Promise((s,r)=>{let n=[];ge(t,e).on("data",o=>n.push(o)).on("end",()=>s(n)).on("error",o=>r(o))});ge.promise=yi;ge.ReaddirpStream=Ge;ge.default=ge;Ps.exports=ge});var mt=v((mc,Hs)=>{Hs.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var s=t.length;if(s<=1)return t;var r="";if(s>4&&t[3]==="\\"){var n=t[2];(n==="?"||n===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),r="//")}var o=t.split(/[/\\]+/);return e!==!1&&o[o.length-1]===""&&o.pop(),r+o.join("/")}});var Ws=v((Us,Ms)=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});var $s=_t(),Ri=mt(),Ds="!",wi={returnIndex:!1},Ai=t=>Array.isArray(t)?t:[t],Ti=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let s=$s(t,e);return r=>t===r||s(r)}return t instanceof RegExp?s=>t.test(s):s=>!1},Fs=(t,e,s,r)=>{let n=Array.isArray(s),o=n?s[0]:s;if(!n&&typeof o!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(o));let i=Ri(o,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(i))return r?-1:!1}let a=n&&[i].concat(s.slice(1));for(let c=0;c<t.length;c++){let u=t[c];if(n?u(...a):u(i))return r?c:!0}return r?-1:!1},yt=(t,e,s=wi)=>{if(t==null)throw new TypeError("anymatch: specify first argument");let r=typeof s=="boolean"?{returnIndex:s}:s,n=r.returnIndex||!1,o=Ai(t),i=o.filter(c=>typeof c=="string"&&c.charAt(0)===Ds).map(c=>c.slice(1)).map(c=>$s(c,r)),a=o.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==Ds).map(c=>Ti(c,r));return e==null?(c,u=!1)=>Fs(a,i,c,typeof u=="boolean"?u:!1):Fs(a,i,e,n)};yt.default=yt;Ms.exports=yt});var Gs=v((yc,Bs)=>{Bs.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var s;s=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(s[2])return!0;e=e.slice(s.index+s[0].length)}return!1}});var Rt=v((Rc,Ks)=>{var Si=Gs(),qs={"{":"}","(":")","[":"]"},Ci=function(t){if(t[0]==="!")return!0;for(var e=0,s=-2,r=-2,n=-2,o=-2,i=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||r!==-1&&t[e]==="["&&t[e+1]!=="]"&&(r<e&&(r=t.indexOf("]",e)),r>e&&(i===-1||i>r||(i=t.indexOf("\\",e),i===-1||i>r)))||n!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(n=t.indexOf("}",e),n>e&&(i=t.indexOf("\\",e),i===-1||i>n))||o!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(o=t.indexOf(")",e),o>e&&(i=t.indexOf("\\",e),i===-1||i>o))||s!==-1&&t[e]==="("&&t[e+1]!=="|"&&(s<e&&(s=t.indexOf("|",e)),s!==-1&&t[s+1]!==")"&&(o=t.indexOf(")",s),o>s&&(i=t.indexOf("\\",s),i===-1||i>o))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var c=qs[a];if(c){var u=t.indexOf(c,e);u!==-1&&(e=u+1)}if(t[e]==="!")return!0}else e++}return!1},xi=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var s=t[e+1];e+=2;var r=qs[s];if(r){var n=t.indexOf(r,e);n!==-1&&(e=n+1)}if(t[e]==="!")return!0}else e++}return!1};Ks.exports=function(e,s){if(typeof e!="string"||e==="")return!1;if(Si(e))return!0;var r=Ci;return s&&s.strict===!1&&(r=xi),r(e)}});var js=v((wc,Vs)=>{"use strict";var bi=Rt(),Ii=L("path").posix.dirname,vi=L("os").platform()==="win32",wt="/",ki=/\\/g,Ni=/[\{\[].*[\}\]]$/,Oi=/(^|[^\\])([\{\[]|\([^\)]+$)/,Pi=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Vs.exports=function(e,s){var r=Object.assign({flipBackslashes:!0},s);r.flipBackslashes&&vi&&e.indexOf(wt)<0&&(e=e.replace(ki,wt)),Ni.test(e)&&(e+=wt),e+="a";do e=Ii(e);while(bi(e)||Oi.test(e));return e.replace(Pi,"$1")}});var Ke=v(Z=>{"use strict";Z.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;Z.find=(t,e)=>t.nodes.find(s=>s.type===e);Z.exceedsLimit=(t,e,s=1,r)=>r===!1||!Z.isInteger(t)||!Z.isInteger(e)?!1:(Number(e)-Number(t))/Number(s)>=r;Z.escapeNode=(t,e=0,s)=>{let r=t.nodes[e];r&&(s&&r.type===s||r.type==="open"||r.type==="close")&&r.escaped!==!0&&(r.value="\\"+r.value,r.escaped=!0)};Z.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);Z.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;Z.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;Z.reduce=t=>t.reduce((e,s)=>(s.type==="text"&&e.push(s.value),s.type==="range"&&(s.type="text"),e),[]);Z.flatten=(...t)=>{let e=[],s=r=>{for(let n=0;n<r.length;n++){let o=r[n];Array.isArray(o)?s(o,e):o!==void 0&&e.push(o)}return e};return s(t),e}});var Ve=v((Tc,zs)=>{"use strict";var Ys=Ke();zs.exports=(t,e={})=>{let s=(r,n={})=>{let o=e.escapeInvalid&&Ys.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a="";if(r.value)return(o||i)&&Ys.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(let c of r.nodes)a+=s(c);return a};return s(t)}});var Qs=v((Sc,Xs)=>{"use strict";Xs.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var or=v((Cc,ir)=>{"use strict";var Zs=Qs(),ue=(t,e,s)=>{if(Zs(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Zs(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...s};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let n=String(r.relaxZeros),o=String(r.shorthand),i=String(r.capture),a=String(r.wrap),c=t+":"+e+"="+n+o+i+a;if(ue.cache.hasOwnProperty(c))return ue.cache[c].result;let u=Math.min(t,e),f=Math.max(t,e);if(Math.abs(u-f)===1){let w=t+"|"+e;return r.capture?`(${w})`:r.wrap===!1?w:`(?:${w})`}let h=nr(t)||nr(e),l={min:t,max:e,a:u,b:f},m=[],y=[];if(h&&(l.isPadded=h,l.maxLen=String(l.max).length),u<0){let w=f<0?Math.abs(f):1;y=Js(w,Math.abs(u),l,r),u=l.a=0}return f>=0&&(m=Js(u,f,l,r)),l.negatives=y,l.positives=m,l.result=Li(y,m,r),r.capture===!0?l.result=`(${l.result})`:r.wrap!==!1&&m.length+y.length>1&&(l.result=`(?:${l.result})`),ue.cache[c]=l,l.result};function Li(t,e,s){let r=At(t,e,"-",!1,s)||[],n=At(e,t,"",!1,s)||[],o=At(t,e,"-?",!0,s)||[];return r.concat(o).concat(n).join("|")}function Hi(t,e){let s=1,r=1,n=tr(t,s),o=new Set([e]);for(;t<=n&&n<=e;)o.add(n),s+=1,n=tr(t,s);for(n=sr(e+1,r)-1;t<n&&n<=e;)o.add(n),r+=1,n=sr(e+1,r)-1;return o=[...o],o.sort($i),o}function Di(t,e,s){if(t===e)return{pattern:t,count:[],digits:0};let r=Fi(t,e),n=r.length,o="",i=0;for(let a=0;a<n;a++){let[c,u]=r[a];c===u?o+=c:c!=="0"||u!=="9"?o+=Ui(c,u,s):i++}return i&&(o+=s.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[i],digits:n}}function Js(t,e,s,r){let n=Hi(t,e),o=[],i=t,a;for(let c=0;c<n.length;c++){let u=n[c],f=Di(String(i),String(u),r),h="";if(!s.isPadded&&a&&a.pattern===f.pattern){a.count.length>1&&a.count.pop(),a.count.push(f.count[0]),a.string=a.pattern+rr(a.count),i=u+1;continue}s.isPadded&&(h=Mi(u,s,r)),f.string=h+f.pattern+rr(f.count),o.push(f),i=u+1,a=f}return o}function At(t,e,s,r,n){let o=[];for(let i of t){let{string:a}=i;!r&&!er(e,"string",a)&&o.push(s+a),r&&er(e,"string",a)&&o.push(s+a)}return o}function Fi(t,e){let s=[];for(let r=0;r<t.length;r++)s.push([t[r],e[r]]);return s}function $i(t,e){return t>e?1:e>t?-1:0}function er(t,e,s){return t.some(r=>r[e]===s)}function tr(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function sr(t,e){return t-t%Math.pow(10,e)}function rr(t){let[e=0,s=""]=t;return s||e>1?`{${e+(s?","+s:"")}}`:""}function Ui(t,e,s){return`[${t}${e-t===1?"":"-"}${e}]`}function nr(t){return/^-?(0+)\d/.test(t)}function Mi(t,e,s){if(!e.isPadded)return t;let r=Math.abs(e.maxLen-String(t).length),n=s.relaxZeros!==!1;switch(r){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${r}}`:`0{${r}}`}}ue.cache={};ue.clearCache=()=>ue.cache={};ir.exports=ue});var Ct=v((xc,pr)=>{"use strict";var Wi=L("util"),lr=or(),ar=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Bi=t=>e=>t===!0?Number(e):String(e),Tt=t=>typeof t=="number"||typeof t=="string"&&t!=="",Ce=t=>Number.isInteger(+t),St=t=>{let e=`${t}`,s=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++s]==="0";);return s>0},Gi=(t,e,s)=>typeof t=="string"||typeof e=="string"?!0:s.stringify===!0,qi=(t,e,s)=>{if(e>0){let r=t[0]==="-"?"-":"";r&&(t=t.slice(1)),t=r+t.padStart(r?e-1:e,"0")}return s===!1?String(t):t},cr=(t,e)=>{let s=t[0]==="-"?"-":"";for(s&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return s?"-"+t:t},Ki=(t,e)=>{t.negatives.sort((i,a)=>i<a?-1:i>a?1:0),t.positives.sort((i,a)=>i<a?-1:i>a?1:0);let s=e.capture?"":"?:",r="",n="",o;return t.positives.length&&(r=t.positives.join("|")),t.negatives.length&&(n=`-(${s}${t.negatives.join("|")})`),r&&n?o=`${r}|${n}`:o=r||n,e.wrap?`(${s}${o})`:o},ur=(t,e,s,r)=>{if(s)return lr(t,e,{wrap:!1,...r});let n=String.fromCharCode(t);if(t===e)return n;let o=String.fromCharCode(e);return`[${n}-${o}]`},fr=(t,e,s)=>{if(Array.isArray(t)){let r=s.wrap===!0,n=s.capture?"":"?:";return r?`(${n}${t.join("|")})`:t.join("|")}return lr(t,e,s)},hr=(...t)=>new RangeError("Invalid range arguments: "+Wi.inspect(...t)),dr=(t,e,s)=>{if(s.strictRanges===!0)throw hr([t,e]);return[]},Vi=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},ji=(t,e,s=1,r={})=>{let n=Number(t),o=Number(e);if(!Number.isInteger(n)||!Number.isInteger(o)){if(r.strictRanges===!0)throw hr([t,e]);return[]}n===0&&(n=0),o===0&&(o=0);let i=n>o,a=String(t),c=String(e),u=String(s);s=Math.max(Math.abs(s),1);let f=St(a)||St(c)||St(u),h=f?Math.max(a.length,c.length,u.length):0,l=f===!1&&Gi(t,e,r)===!1,m=r.transform||Bi(l);if(r.toRegex&&s===1)return ur(cr(t,h),cr(e,h),!0,r);let y={negatives:[],positives:[]},w=H=>y[H<0?"negatives":"positives"].push(Math.abs(H)),T=[],x=0;for(;i?n>=o:n<=o;)r.toRegex===!0&&s>1?w(n):T.push(qi(m(n,x),h,l)),n=i?n-s:n+s,x++;return r.toRegex===!0?s>1?Ki(y,r):fr(T,null,{wrap:!1,...r}):T},Yi=(t,e,s=1,r={})=>{if(!Ce(t)&&t.length>1||!Ce(e)&&e.length>1)return dr(t,e,r);let n=r.transform||(l=>String.fromCharCode(l)),o=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),a=o>i,c=Math.min(o,i),u=Math.max(o,i);if(r.toRegex&&s===1)return ur(c,u,!1,r);let f=[],h=0;for(;a?o>=i:o<=i;)f.push(n(o,h)),o=a?o-s:o+s,h++;return r.toRegex===!0?fr(f,null,{wrap:!1,options:r}):f},je=(t,e,s,r={})=>{if(e==null&&Tt(t))return[t];if(!Tt(t)||!Tt(e))return dr(t,e,r);if(typeof s=="function")return je(t,e,1,{transform:s});if(ar(s))return je(t,e,0,s);let n={...r};return n.capture===!0&&(n.wrap=!0),s=s||n.step||1,Ce(s)?Ce(t)&&Ce(e)?ji(t,e,s,n):Yi(t,e,Math.max(Math.abs(s),1),n):s!=null&&!ar(s)?Vi(s,n):je(t,e,1,s)};pr.exports=je});var gr=v((bc,Er)=>{"use strict";var zi=Ct(),_r=Ke(),Xi=(t,e={})=>{let s=(r,n={})=>{let o=_r.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a=o===!0||i===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(r.isOpen===!0||r.isClose===!0)return c+r.value;if(r.type==="open")return a?c+r.value:"(";if(r.type==="close")return a?c+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":a?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let f=_r.reduce(r.nodes),h=zi(...f,{...e,wrap:!1,toRegex:!0});if(h.length!==0)return f.length>1&&h.length>1?`(${h})`:h}if(r.nodes)for(let f of r.nodes)u+=s(f,r);return u};return s(t)};Er.exports=Xi});var Rr=v((Ic,yr)=>{"use strict";var Qi=Ct(),mr=Ve(),me=Ke(),fe=(t="",e="",s=!1)=>{let r=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return s?me.flatten(e).map(n=>`{${n}}`):e;for(let n of t)if(Array.isArray(n))for(let o of n)r.push(fe(o,e,s));else for(let o of e)s===!0&&typeof o=="string"&&(o=`{${o}}`),r.push(Array.isArray(o)?fe(n,o,s):n+o);return me.flatten(r)},Zi=(t,e={})=>{let s=e.rangeLimit===void 0?1e3:e.rangeLimit,r=(n,o={})=>{n.queue=[];let i=o,a=o.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,a=i.queue;if(n.invalid||n.dollar){a.push(fe(a.pop(),mr(n,e)));return}if(n.type==="brace"&&n.invalid!==!0&&n.nodes.length===2){a.push(fe(a.pop(),["{}"]));return}if(n.nodes&&n.ranges>0){let h=me.reduce(n.nodes);if(me.exceedsLimit(...h,e.step,s))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=Qi(...h,e);l.length===0&&(l=mr(n,e)),a.push(fe(a.pop(),l)),n.nodes=[];return}let c=me.encloseBrace(n),u=n.queue,f=n;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,u=f.queue;for(let h=0;h<n.nodes.length;h++){let l=n.nodes[h];if(l.type==="comma"&&n.type==="brace"){h===1&&u.push(""),u.push("");continue}if(l.type==="close"){a.push(fe(a.pop(),u,c));continue}if(l.value&&l.type!=="open"){u.push(fe(u.pop(),l.value));continue}l.nodes&&r(l,n)}return u};return me.flatten(r(t))};yr.exports=Zi});var Ar=v((vc,wr)=>{"use strict";wr.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
2
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var br=v((kc,xr)=>{"use strict";var Ji=Ve(),{MAX_LENGTH:Tr,CHAR_BACKSLASH:xt,CHAR_BACKTICK:eo,CHAR_COMMA:to,CHAR_DOT:so,CHAR_LEFT_PARENTHESES:ro,CHAR_RIGHT_PARENTHESES:no,CHAR_LEFT_CURLY_BRACE:io,CHAR_RIGHT_CURLY_BRACE:oo,CHAR_LEFT_SQUARE_BRACKET:Sr,CHAR_RIGHT_SQUARE_BRACKET:Cr,CHAR_DOUBLE_QUOTE:ao,CHAR_SINGLE_QUOTE:co,CHAR_NO_BREAK_SPACE:lo,CHAR_ZERO_WIDTH_NOBREAK_SPACE:uo}=Ar(),fo=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let s=e||{},r=typeof s.maxLength=="number"?Math.min(Tr,s.maxLength):Tr;if(t.length>r)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${r})`);let n={type:"root",input:t,nodes:[]},o=[n],i=n,a=n,c=0,u=t.length,f=0,h=0,l,m={},y=()=>t[f++],w=T=>{if(T.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&T.type==="text"){a.value+=T.value;return}return i.nodes.push(T),T.parent=i,T.prev=a,a=T,T};for(w({type:"bos"});f<u;)if(i=o[o.length-1],l=y(),!(l===uo||l===lo)){if(l===xt){w({type:"text",value:(e.keepEscaping?l:"")+y()});continue}if(l===Cr){w({type:"text",value:"\\"+l});continue}if(l===Sr){c++;let T=!0,x;for(;f<u&&(x=y());){if(l+=x,x===Sr){c++;continue}if(x===xt){l+=y();continue}if(x===Cr&&(c--,c===0))break}w({type:"text",value:l});continue}if(l===ro){i=w({type:"paren",nodes:[]}),o.push(i),w({type:"text",value:l});continue}if(l===no){if(i.type!=="paren"){w({type:"text",value:l});continue}i=o.pop(),w({type:"text",value:l}),i=o[o.length-1];continue}if(l===ao||l===co||l===eo){let T=l,x;for(e.keepQuotes!==!0&&(l="");f<u&&(x=y());){if(x===xt){l+=x+y();continue}if(x===T){e.keepQuotes===!0&&(l+=x);break}l+=x}w({type:"text",value:l});continue}if(l===io){h++;let x={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||i.dollar===!0,depth:h,commas:0,ranges:0,nodes:[]};i=w(x),o.push(i),w({type:"open",value:l});continue}if(l===oo){if(i.type!=="brace"){w({type:"text",value:l});continue}let T="close";i=o.pop(),i.close=!0,w({type:T,value:l}),h--,i=o[o.length-1];continue}if(l===to&&h>0){if(i.ranges>0){i.ranges=0;let T=i.nodes.shift();i.nodes=[T,{type:"text",value:Ji(i)}]}w({type:"comma",value:l}),i.commas++;continue}if(l===so&&h>0&&i.commas===0){let T=i.nodes;if(h===0||T.length===0){w({type:"text",value:l});continue}if(a.type==="dot"){if(i.range=[],a.value+=l,a.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,a.type="text";continue}i.ranges++,i.args=[];continue}if(a.type==="range"){T.pop();let x=T[T.length-1];x.value+=a.value+l,a=x,i.ranges--;continue}w({type:"dot",value:l});continue}w({type:"text",value:l})}do if(i=o.pop(),i.type!=="root"){i.nodes.forEach(H=>{H.nodes||(H.type==="open"&&(H.isOpen=!0),H.type==="close"&&(H.isClose=!0),H.nodes||(H.type="text"),H.invalid=!0)});let T=o[o.length-1],x=T.nodes.indexOf(i);T.nodes.splice(x,1,...i.nodes)}while(o.length>0);return w({type:"eos"}),n};xr.exports=fo});var kr=v((Nc,vr)=>{"use strict";var Ir=Ve(),ho=gr(),po=Rr(),_o=br(),Q=(t,e={})=>{let s=[];if(Array.isArray(t))for(let r of t){let n=Q.create(r,e);Array.isArray(n)?s.push(...n):s.push(n)}else s=[].concat(Q.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(s=[...new Set(s)]),s};Q.parse=(t,e={})=>_o(t,e);Q.stringify=(t,e={})=>Ir(typeof t=="string"?Q.parse(t,e):t,e);Q.compile=(t,e={})=>(typeof t=="string"&&(t=Q.parse(t,e)),ho(t,e));Q.expand=(t,e={})=>{typeof t=="string"&&(t=Q.parse(t,e));let s=po(t,e);return e.noempty===!0&&(s=s.filter(Boolean)),e.nodupes===!0&&(s=[...new Set(s)]),s};Q.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Q.compile(t,e):Q.expand(t,e);vr.exports=Q});var Nr=v((Oc,Eo)=>{Eo.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var Pr=v((Pc,Or)=>{Or.exports=Nr()});var Hr=v((Lc,Lr)=>{"use strict";var go=L("path"),mo=Pr(),yo=new Set(mo);Lr.exports=t=>yo.has(go.extname(t).slice(1).toLowerCase())});var Ye=v(R=>{"use strict";var{sep:Ro}=L("path"),{platform:bt}=process,wo=L("os");R.EV_ALL="all";R.EV_READY="ready";R.EV_ADD="add";R.EV_CHANGE="change";R.EV_ADD_DIR="addDir";R.EV_UNLINK="unlink";R.EV_UNLINK_DIR="unlinkDir";R.EV_RAW="raw";R.EV_ERROR="error";R.STR_DATA="data";R.STR_END="end";R.STR_CLOSE="close";R.FSEVENT_CREATED="created";R.FSEVENT_MODIFIED="modified";R.FSEVENT_DELETED="deleted";R.FSEVENT_MOVED="moved";R.FSEVENT_CLONED="cloned";R.FSEVENT_UNKNOWN="unknown";R.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;R.FSEVENT_TYPE_FILE="file";R.FSEVENT_TYPE_DIRECTORY="directory";R.FSEVENT_TYPE_SYMLINK="symlink";R.KEY_LISTENERS="listeners";R.KEY_ERR="errHandlers";R.KEY_RAW="rawEmitters";R.HANDLER_KEYS=[R.KEY_LISTENERS,R.KEY_ERR,R.KEY_RAW];R.DOT_SLASH=`.${Ro}`;R.BACK_SLASH_RE=/\\/g;R.DOUBLE_SLASH_RE=/\/\//;R.SLASH_OR_BACK_SLASH_RE=/[/\\]/;R.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;R.REPLACER_RE=/^\.[/\\]/;R.SLASH="/";R.SLASH_SLASH="//";R.BRACE_START="{";R.BANG="!";R.ONE_DOT=".";R.TWO_DOTS="..";R.STAR="*";R.GLOBSTAR="**";R.ROOT_GLOBSTAR="/**/*";R.SLASH_GLOBSTAR="/**";R.DIR_SUFFIX="Dir";R.ANYMATCH_OPTS={dot:!0};R.STRING_TYPE="string";R.FUNCTION_TYPE="function";R.EMPTY_STR="";R.EMPTY_FN=()=>{};R.IDENTITY_FN=t=>t;R.isWindows=bt==="win32";R.isMacos=bt==="darwin";R.isLinux=bt==="linux";R.isIBMi=wo.type()==="OS400"});var Wr=v((Dc,Mr)=>{"use strict";var ie=L("fs"),W=L("path"),{promisify:ve}=L("util"),Ao=Hr(),{isWindows:To,isLinux:So,EMPTY_FN:Co,EMPTY_STR:xo,KEY_LISTENERS:ye,KEY_ERR:It,KEY_RAW:xe,HANDLER_KEYS:bo,EV_CHANGE:Xe,EV_ADD:ze,EV_ADD_DIR:Io,EV_ERROR:Fr,STR_DATA:vo,STR_END:ko,BRACE_START:No,STAR:Oo}=Ye(),Po="watch",Lo=ve(ie.open),$r=ve(ie.stat),Ho=ve(ie.lstat),Do=ve(ie.close),vt=ve(ie.realpath),Fo={lstat:Ho,stat:$r},Nt=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},be=(t,e,s)=>{let r=t[e];r instanceof Set||(t[e]=r=new Set([r])),r.add(s)},$o=t=>e=>{let s=t[e];s instanceof Set?s.clear():delete t[e]},Ie=(t,e,s)=>{let r=t[e];r instanceof Set?r.delete(s):r===s&&delete t[e]},Ur=t=>t instanceof Set?t.size===0:!t,Qe=new Map;function Dr(t,e,s,r,n){let o=(i,a)=>{s(t),n(i,a,{watchedPath:t}),a&&t!==a&&Ze(W.resolve(t,a),ye,W.join(t,a))};try{return ie.watch(t,e,o)}catch(i){r(i)}}var Ze=(t,e,s,r,n)=>{let o=Qe.get(t);o&&Nt(o[e],i=>{i(s,r,n)})},Uo=(t,e,s,r)=>{let{listener:n,errHandler:o,rawEmitter:i}=r,a=Qe.get(e),c;if(!s.persistent)return c=Dr(t,s,n,o,i),c.close.bind(c);if(a)be(a,ye,n),be(a,It,o),be(a,xe,i);else{if(c=Dr(t,s,Ze.bind(null,e,ye),o,Ze.bind(null,e,xe)),!c)return;c.on(Fr,async u=>{let f=Ze.bind(null,e,It);if(a.watcherUnusable=!0,To&&u.code==="EPERM")try{let h=await Lo(t,"r");await Do(h),f(u)}catch{}else f(u)}),a={listeners:n,errHandlers:o,rawEmitters:i,watcher:c},Qe.set(e,a)}return()=>{Ie(a,ye,n),Ie(a,It,o),Ie(a,xe,i),Ur(a.listeners)&&(a.watcher.close(),Qe.delete(e),bo.forEach($o(a)),a.watcher=void 0,Object.freeze(a))}},kt=new Map,Mo=(t,e,s,r)=>{let{listener:n,rawEmitter:o}=r,i=kt.get(e),a=new Set,c=new Set,u=i&&i.options;return u&&(u.persistent<s.persistent||u.interval>s.interval)&&(a=i.listeners,c=i.rawEmitters,ie.unwatchFile(e),i=void 0),i?(be(i,ye,n),be(i,xe,o)):(i={listeners:n,rawEmitters:o,options:s,watcher:ie.watchFile(e,s,(f,h)=>{Nt(i.rawEmitters,m=>{m(Xe,e,{curr:f,prev:h})});let l=f.mtimeMs;(f.size!==h.size||l>h.mtimeMs||l===0)&&Nt(i.listeners,m=>m(t,f))})},kt.set(e,i)),()=>{Ie(i,ye,n),Ie(i,xe,o),Ur(i.listeners)&&(kt.delete(e),ie.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}},Ot=class{constructor(e){this.fsw=e,this._boundHandleError=s=>e._handleError(s)}_watchWithNodeFs(e,s){let r=this.fsw.options,n=W.dirname(e),o=W.basename(e);this.fsw._getWatchedDir(n).add(o);let a=W.resolve(e),c={persistent:r.persistent};s||(s=Co);let u;return r.usePolling?(c.interval=r.enableBinaryInterval&&Ao(o)?r.binaryInterval:r.interval,u=Mo(e,a,c,{listener:s,rawEmitter:this.fsw._emitRaw})):u=Uo(e,a,c,{listener:s,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),u}_handleFile(e,s,r){if(this.fsw.closed)return;let n=W.dirname(e),o=W.basename(e),i=this.fsw._getWatchedDir(n),a=s;if(i.has(o))return;let c=async(f,h)=>{if(this.fsw._throttle(Po,e,5)){if(!h||h.mtimeMs===0)try{let l=await $r(e);if(this.fsw.closed)return;let m=l.atimeMs,y=l.mtimeMs;(!m||m<=y||y!==a.mtimeMs)&&this.fsw._emit(Xe,e,l),So&&a.ino!==l.ino?(this.fsw._closeFile(f),a=l,this.fsw._addPathCloser(f,this._watchWithNodeFs(e,c))):a=l}catch{this.fsw._remove(n,o)}else if(i.has(o)){let l=h.atimeMs,m=h.mtimeMs;(!l||l<=m||m!==a.mtimeMs)&&this.fsw._emit(Xe,e,h),a=h}}},u=this._watchWithNodeFs(e,c);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(ze,e,0))return;this.fsw._emit(ze,e,s)}return u}async _handleSymlink(e,s,r,n){if(this.fsw.closed)return;let o=e.fullPath,i=this.fsw._getWatchedDir(s);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await vt(r)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(n)?this.fsw._symlinkPaths.get(o)!==a&&(this.fsw._symlinkPaths.set(o,a),this.fsw._emit(Xe,r,e.stats)):(i.add(n),this.fsw._symlinkPaths.set(o,a),this.fsw._emit(ze,r,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(o))return!0;this.fsw._symlinkPaths.set(o,!0)}_handleRead(e,s,r,n,o,i,a){if(e=W.join(e,xo),!r.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(r.path),u=new Set,f=this.fsw._readdirp(e,{fileFilter:h=>r.filterPath(h),directoryFilter:h=>r.filterDir(h),depth:0}).on(vo,async h=>{if(this.fsw.closed){f=void 0;return}let l=h.path,m=W.join(e,l);if(u.add(l),!(h.stats.isSymbolicLink()&&await this._handleSymlink(h,e,m,l))){if(this.fsw.closed){f=void 0;return}(l===n||!n&&!c.has(l))&&(this.fsw._incrReadyCount(),m=W.join(o,W.relative(o,m)),this._addToNodeFs(m,s,r,i+1))}}).on(Fr,this._boundHandleError);return new Promise(h=>f.once(ko,()=>{if(this.fsw.closed){f=void 0;return}let l=a?a.clear():!1;h(),c.getChildren().filter(m=>m!==e&&!u.has(m)&&(!r.hasGlob||r.filterPath({fullPath:W.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m)}),f=void 0,l&&this._handleRead(e,!1,r,n,o,i,a)}))}async _handleDir(e,s,r,n,o,i,a){let c=this.fsw._getWatchedDir(W.dirname(e)),u=c.has(W.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!o&&!u&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(Io,e,s),c.add(W.basename(e)),this.fsw._getWatchedDir(e);let f,h,l=this.fsw.options.depth;if((l==null||n<=l)&&!this.fsw._symlinkPaths.has(a)){if(!o&&(await this._handleRead(e,r,i,o,e,n,f),this.fsw.closed))return;h=this._watchWithNodeFs(e,(m,y)=>{y&&y.mtimeMs===0||this._handleRead(m,!1,i,o,e,n,f)})}return h}async _addToNodeFs(e,s,r,n,o){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let a=this.fsw._getWatchHelpers(e,n);!a.hasGlob&&r&&(a.hasGlob=r.hasGlob,a.globFilter=r.globFilter,a.filterPath=c=>r.filterPath(c),a.filterDir=c=>r.filterDir(c));try{let c=await Fo[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return i(),!1;let u=this.fsw.options.followSymlinks&&!e.includes(Oo)&&!e.includes(No),f;if(c.isDirectory()){let h=W.resolve(e),l=u?await vt(e):e;if(this.fsw.closed||(f=await this._handleDir(a.watchPath,c,s,n,o,a,l),this.fsw.closed))return;h!==l&&l!==void 0&&this.fsw._symlinkPaths.set(h,l)}else if(c.isSymbolicLink()){let h=u?await vt(e):e;if(this.fsw.closed)return;let l=W.dirname(a.watchPath);if(this.fsw._getWatchedDir(l).add(a.watchPath),this.fsw._emit(ze,a.watchPath,c),f=await this._handleDir(l,c,s,n,e,a,h),this.fsw.closed)return;h!==void 0&&this.fsw._symlinkPaths.set(W.resolve(e),h)}else f=this._handleFile(a.watchPath,c,s);return i(),this.fsw._addPathCloser(e,f),!1}catch(c){if(this.fsw._handleError(c))return i(),e}}};Mr.exports=Ot});var Yr=v((Fc,Mt)=>{"use strict";var $t=L("fs"),B=L("path"),{promisify:Ut}=L("util"),Re;try{Re=L("fsevents")}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(Re){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),s=Number.parseInt(t[2],10);e===8&&s<16&&(Re=void 0)}}var{EV_ADD:Pt,EV_CHANGE:Wo,EV_ADD_DIR:Br,EV_UNLINK:Je,EV_ERROR:Bo,STR_DATA:Go,STR_END:qo,FSEVENT_CREATED:Ko,FSEVENT_MODIFIED:Vo,FSEVENT_DELETED:jo,FSEVENT_MOVED:Yo,FSEVENT_UNKNOWN:zo,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:Xo,FSEVENT_TYPE_FILE:Qo,FSEVENT_TYPE_DIRECTORY:ke,FSEVENT_TYPE_SYMLINK:jr,ROOT_GLOBSTAR:Gr,DIR_SUFFIX:Zo,DOT_SLASH:qr,FUNCTION_TYPE:Lt,EMPTY_FN:Jo,IDENTITY_FN:ea}=Ye(),ta=t=>isNaN(t)?{}:{depth:t},Dt=Ut($t.stat),sa=Ut($t.lstat),Kr=Ut($t.realpath),ra={stat:Dt,lstat:sa},he=new Map,na=10,ia=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),oa=(t,e)=>({stop:Re.watch(t,e)});function aa(t,e,s,r){let n=B.extname(e)?B.dirname(e):e,o=B.dirname(n),i=he.get(n);ca(o)&&(n=o);let a=B.resolve(t),c=a!==e,u=(h,l,m)=>{c&&(h=h.replace(e,a)),(h===a||!h.indexOf(a+B.sep))&&s(h,l,m)},f=!1;for(let h of he.keys())if(e.indexOf(B.resolve(h)+B.sep)===0){n=h,i=he.get(n),f=!0;break}return i||f?i.listeners.add(u):(i={listeners:new Set([u]),rawEmitter:r,watcher:oa(n,(h,l)=>{if(!i.listeners.size||l&Xo)return;let m=Re.getInfo(h,l);i.listeners.forEach(y=>{y(h,l,m)}),i.rawEmitter(m.event,h,m)})},he.set(n,i)),()=>{let h=i.listeners;if(h.delete(u),!h.size&&(he.delete(n),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}var ca=t=>{let e=0;for(let s of he.keys())if(s.indexOf(t)===0&&(e++,e>=na))return!0;return!1},la=()=>Re&&he.size<128,Ht=(t,e)=>{let s=0;for(;!t.indexOf(e)&&(t=B.dirname(t))!==e;)s++;return s},Vr=(t,e)=>t.type===ke&&e.isDirectory()||t.type===jr&&e.isSymbolicLink()||t.type===Qo&&e.isFile(),Ft=class{constructor(e){this.fsw=e}checkIgnored(e,s){let r=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,s))return r.add(e),s&&s.isDirectory()&&r.add(e+Gr),!0;r.delete(e),r.delete(e+Gr)}addOrChange(e,s,r,n,o,i,a,c){let u=o.has(i)?Wo:Pt;this.handleEvent(u,e,s,r,n,o,i,a,c)}async checkExists(e,s,r,n,o,i,a,c){try{let u=await Dt(e);if(this.fsw.closed)return;Vr(a,u)?this.addOrChange(e,s,r,n,o,i,a,c):this.handleEvent(Je,e,s,r,n,o,i,a,c)}catch(u){u.code==="EACCES"?this.addOrChange(e,s,r,n,o,i,a,c):this.handleEvent(Je,e,s,r,n,o,i,a,c)}}handleEvent(e,s,r,n,o,i,a,c,u){if(!(this.fsw.closed||this.checkIgnored(s)))if(e===Je){let f=c.type===ke;(f||i.has(a))&&this.fsw._remove(o,a,f)}else{if(e===Pt){if(c.type===ke&&this.fsw._getWatchedDir(s),c.type===jr&&u.followSymlinks){let h=u.depth===void 0?void 0:Ht(r,n)+1;return this._addToFsEvents(s,!1,!0,h)}this.fsw._getWatchedDir(o).add(a)}let f=c.type===ke?e+Zo:e;this.fsw._emit(f,s),f===Br&&this._addToFsEvents(s,!1,!0)}}_watchWithFsEvents(e,s,r,n){if(this.fsw.closed||this.fsw._isIgnored(e))return;let o=this.fsw.options,a=aa(e,s,async(c,u,f)=>{if(this.fsw.closed||o.depth!==void 0&&Ht(c,s)>o.depth)return;let h=r(B.join(e,B.relative(e,c)));if(n&&!n(h))return;let l=B.dirname(h),m=B.basename(h),y=this.fsw._getWatchedDir(f.type===ke?h:l);if(ia.has(u)||f.event===zo)if(typeof o.ignored===Lt){let w;try{w=await Dt(h)}catch{}if(this.fsw.closed||this.checkIgnored(h,w))return;Vr(f,w)?this.addOrChange(h,c,s,l,y,m,f,o):this.handleEvent(Je,h,c,s,l,y,m,f,o)}else this.checkExists(h,c,s,l,y,m,f,o);else switch(f.event){case Ko:case Vo:return this.addOrChange(h,c,s,l,y,m,f,o);case jo:case Yo:return this.checkExists(h,c,s,l,y,m,f,o)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,s,r,n){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(s))){this.fsw._symlinkPaths.set(s,!0),this.fsw._incrReadyCount();try{let o=await Kr(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(o))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(o||e,i=>{let a=e;return o&&o!==qr?a=i.replace(o,e):i!==qr&&(a=B.join(e,i)),r(a)},!1,n)}catch(o){if(this.fsw._handleError(o))return this.fsw._emitReady()}}}emitAdd(e,s,r,n,o){let i=r(e),a=s.isDirectory(),c=this.fsw._getWatchedDir(B.dirname(i)),u=B.basename(i);a&&this.fsw._getWatchedDir(i),!c.has(u)&&(c.add(u),(!n.ignoreInitial||o===!0)&&this.fsw._emit(a?Br:Pt,i,s))}initWatch(e,s,r,n){if(this.fsw.closed)return;let o=this._watchWithFsEvents(r.watchPath,B.resolve(e||r.watchPath),n,r.globFilter);this.fsw._addPathCloser(s,o)}async _addToFsEvents(e,s,r,n){if(this.fsw.closed)return;let o=this.fsw.options,i=typeof s===Lt?s:ea,a=this.fsw._getWatchHelpers(e);try{let c=await ra[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(i(e),c,i,o,r),n&&n>o.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:u=>a.filterPath(u),directoryFilter:u=>a.filterDir(u),...ta(o.depth-(n||0))}).on(Go,u=>{if(this.fsw.closed||u.stats.isDirectory()&&!a.filterPath(u))return;let f=B.join(a.watchPath,u.path),{fullPath:h}=u;if(a.followSymlinks&&u.stats.isSymbolicLink()){let l=o.depth===void 0?void 0:Ht(f,B.resolve(a.watchPath))+1;this._handleFsEventsSymlink(f,h,i,l)}else this.emitAdd(f,u.stats,i,o,r)}).on(Bo,Jo).on(qo,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,i,o,r),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(o.persistent&&r!==!0)if(typeof s===Lt)this.initWatch(void 0,e,a,i);else{let c;try{c=await Kr(a.watchPath)}catch{}this.initWatch(c,e,a,i)}}};Mt.exports=Ft;Mt.exports.canUse=la});var on=v(ts=>{"use strict";var{EventEmitter:ua}=L("events"),Jt=L("fs"),k=L("path"),{promisify:tn}=L("util"),fa=Ls(),Vt=Ws().default,ha=js(),Wt=Rt(),da=kr(),pa=mt(),_a=Wr(),zr=Yr(),{EV_ALL:Bt,EV_READY:Ea,EV_ADD:et,EV_CHANGE:Ne,EV_UNLINK:Xr,EV_ADD_DIR:ga,EV_UNLINK_DIR:ma,EV_RAW:ya,EV_ERROR:Gt,STR_CLOSE:Ra,STR_END:wa,BACK_SLASH_RE:Aa,DOUBLE_SLASH_RE:Qr,SLASH_OR_BACK_SLASH_RE:Ta,DOT_RE:Sa,REPLACER_RE:Ca,SLASH:qt,SLASH_SLASH:xa,BRACE_START:ba,BANG:jt,ONE_DOT:sn,TWO_DOTS:Ia,GLOBSTAR:va,SLASH_GLOBSTAR:Kt,ANYMATCH_OPTS:Yt,STRING_TYPE:es,FUNCTION_TYPE:ka,EMPTY_STR:zt,EMPTY_FN:Na,isWindows:Oa,isMacos:Pa,isIBMi:La}=Ye(),Ha=tn(Jt.stat),Da=tn(Jt.readdir),Xt=(t=[])=>Array.isArray(t)?t:[t],rn=(t,e=[])=>(t.forEach(s=>{Array.isArray(s)?rn(s,e):e.push(s)}),e),Zr=t=>{let e=rn(Xt(t));if(!e.every(s=>typeof s===es))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(nn)},Jr=t=>{let e=t.replace(Aa,qt),s=!1;for(e.startsWith(xa)&&(s=!0);e.match(Qr);)e=e.replace(Qr,qt);return s&&(e=qt+e),e},nn=t=>Jr(k.normalize(Jr(t))),en=(t=zt)=>e=>typeof e!==es?e:nn(k.isAbsolute(e)?e:k.join(t,e)),Fa=(t,e)=>k.isAbsolute(t)?t:t.startsWith(jt)?jt+k.join(e,t.slice(1)):k.join(e,t),J=(t,e)=>t[e]===void 0,Qt=class{constructor(e,s){this.path=e,this._removeWatcher=s,this.items=new Set}add(e){let{items:s}=this;s&&e!==sn&&e!==Ia&&s.add(e)}async remove(e){let{items:s}=this;if(!s||(s.delete(e),s.size>0))return;let r=this.path;try{await Da(r)}catch{this._removeWatcher&&this._removeWatcher(k.dirname(r),k.basename(r))}}has(e){let{items:s}=this;if(s)return s.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},$a="stat",Ua="lstat",Zt=class{constructor(e,s,r,n){this.fsw=n,this.path=e=e.replace(Ca,zt),this.watchPath=s,this.fullWatchPath=k.resolve(s),this.hasGlob=s!==e,e===zt&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&r?void 0:!1,this.globFilter=this.hasGlob?Vt(e,void 0,Yt):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(o=>{o.length>1&&o.pop()}),this.followSymlinks=r,this.statMethod=r?$a:Ua}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return k.join(this.watchPath,k.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:s}=e;if(s&&s.isSymbolicLink())return this.filterDir(e);let r=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===ka?this.globFilter(r):!0)&&this.fsw._isntIgnored(r,s)&&this.fsw._hasReadPermissions(s)}getDirParts(e){if(!this.hasGlob)return[];let s=[];return(e.includes(ba)?da.expand(e):[e]).forEach(n=>{s.push(k.relative(this.watchPath,n).split(Ta))}),s}filterDir(e){if(this.hasGlob){let s=this.getDirParts(this.checkGlobSymlink(e)),r=!1;this.unmatchedGlob=!this.dirParts.some(n=>n.every((o,i)=>(o===va&&(r=!0),r||!s[0][i]||Vt(o,s[0][i],Yt))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},tt=class extends ua{constructor(e){super();let s={};e&&Object.assign(s,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,J(s,"persistent")&&(s.persistent=!0),J(s,"ignoreInitial")&&(s.ignoreInitial=!1),J(s,"ignorePermissionErrors")&&(s.ignorePermissionErrors=!1),J(s,"interval")&&(s.interval=100),J(s,"binaryInterval")&&(s.binaryInterval=300),J(s,"disableGlobbing")&&(s.disableGlobbing=!1),s.enableBinaryInterval=s.binaryInterval!==s.interval,J(s,"useFsEvents")&&(s.useFsEvents=!s.usePolling),zr.canUse()||(s.useFsEvents=!1),J(s,"usePolling")&&!s.useFsEvents&&(s.usePolling=Pa),La&&(s.usePolling=!0);let n=process.env.CHOKIDAR_USEPOLLING;if(n!==void 0){let c=n.toLowerCase();c==="false"||c==="0"?s.usePolling=!1:c==="true"||c==="1"?s.usePolling=!0:s.usePolling=!!c}let o=process.env.CHOKIDAR_INTERVAL;o&&(s.interval=Number.parseInt(o,10)),J(s,"atomic")&&(s.atomic=!s.usePolling&&!s.useFsEvents),s.atomic&&(this._pendingUnlinks=new Map),J(s,"followSymlinks")&&(s.followSymlinks=!0),J(s,"awaitWriteFinish")&&(s.awaitWriteFinish=!1),s.awaitWriteFinish===!0&&(s.awaitWriteFinish={});let i=s.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),s.ignored&&(s.ignored=Xt(s.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=Na,this._readyEmitted=!0,process.nextTick(()=>this.emit(Ea)))},this._emitRaw=(...c)=>this.emit(ya,...c),this._readyEmitted=!1,this.options=s,s.useFsEvents?this._fsEventsHandler=new zr(this):this._nodeFsHandler=new _a(this),Object.freeze(s)}add(e,s,r){let{cwd:n,disableGlobbing:o}=this.options;this.closed=!1;let i=Zr(e);return n&&(i=i.map(a=>{let c=Fa(a,n);return o||!Wt(a)?c:pa(c)})),i=i.filter(a=>a.startsWith(jt)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+Kt),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount+=i.length),i.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!r,0,0,s);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(k.dirname(c),k.basename(s||c))})})),this}unwatch(e){if(this.closed)return this;let s=Zr(e),{cwd:r}=this.options;return s.forEach(n=>{!k.isAbsolute(n)&&!this._closers.has(n)&&(r&&(n=k.join(r,n)),n=k.resolve(n)),this._closePath(n),this._ignoredPaths.add(n),this._watched.has(n)&&this._ignoredPaths.add(n+Kt),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(s=>s.forEach(r=>{let n=r();n instanceof Promise&&e.push(n)})),this._streams.forEach(s=>s.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(s=>s.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(s=>{this[`_${s}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((s,r)=>{let n=this.options.cwd?k.relative(this.options.cwd,r):r;e[n||sn]=s.getChildren().sort()}),e}emitWithAll(e,s){this.emit(...s),e!==Gt&&this.emit(Bt,...s)}async _emit(e,s,r,n,o){if(this.closed)return;let i=this.options;Oa&&(s=k.normalize(s)),i.cwd&&(s=k.relative(i.cwd,s));let a=[e,s];o!==void 0?a.push(r,n,o):n!==void 0?a.push(r,n):r!==void 0&&a.push(r);let c=i.awaitWriteFinish,u;if(c&&(u=this._pendingWrites.get(s)))return u.lastChange=new Date,this;if(i.atomic){if(e===Xr)return this._pendingUnlinks.set(s,a),setTimeout(()=>{this._pendingUnlinks.forEach((f,h)=>{this.emit(...f),this.emit(Bt,...f),this._pendingUnlinks.delete(h)})},typeof i.atomic=="number"?i.atomic:100),this;e===et&&this._pendingUnlinks.has(s)&&(e=a[0]=Ne,this._pendingUnlinks.delete(s))}if(c&&(e===et||e===Ne)&&this._readyEmitted){let f=(h,l)=>{h?(e=a[0]=Gt,a[1]=h,this.emitWithAll(e,a)):l&&(a.length>2?a[2]=l:a.push(l),this.emitWithAll(e,a))};return this._awaitWriteFinish(s,c.stabilityThreshold,e,f),this}if(e===Ne&&!this._throttle(Ne,s,50))return this;if(i.alwaysStat&&r===void 0&&(e===et||e===ga||e===Ne)){let f=i.cwd?k.join(i.cwd,s):s,h;try{h=await Ha(f)}catch{}if(!h||this.closed)return;a.push(h)}return this.emitWithAll(e,a),this}_handleError(e){let s=e&&e.code;return e&&s!=="ENOENT"&&s!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||s!=="EPERM"&&s!=="EACCES")&&this.emit(Gt,e),e||this.closed}_throttle(e,s,r){this._throttled.has(e)||this._throttled.set(e,new Map);let n=this._throttled.get(e),o=n.get(s);if(o)return o.count++,!1;let i,a=()=>{let u=n.get(s),f=u?u.count:0;return n.delete(s),clearTimeout(i),u&&clearTimeout(u.timeoutObject),f};i=setTimeout(a,r);let c={timeoutObject:i,clear:a,count:0};return n.set(s,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,s,r,n){let o,i=e;this.options.cwd&&!k.isAbsolute(e)&&(i=k.join(this.options.cwd,e));let a=new Date,c=u=>{Jt.stat(i,(f,h)=>{if(f||!this._pendingWrites.has(e)){f&&f.code!=="ENOENT"&&n(f);return}let l=Number(new Date);u&&h.size!==u.size&&(this._pendingWrites.get(e).lastChange=l);let m=this._pendingWrites.get(e);l-m.lastChange>=s?(this._pendingWrites.delete(e),n(void 0,h)):o=setTimeout(c,this.options.awaitWriteFinish.pollInterval,h)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(o),r)}),o=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,s){if(this.options.atomic&&Sa.test(e))return!0;if(!this._userIgnored){let{cwd:r}=this.options,n=this.options.ignored,o=n&&n.map(en(r)),i=Xt(o).filter(c=>typeof c===es&&!Wt(c)).map(c=>c+Kt),a=this._getGlobIgnored().map(en(r)).concat(o,i);this._userIgnored=Vt(a,void 0,Yt)}return this._userIgnored([e,s])}_isntIgnored(e,s){return!this._isIgnored(e,s)}_getWatchHelpers(e,s){let r=s||this.options.disableGlobbing||!Wt(e)?e:ha(e),n=this.options.followSymlinks;return new Zt(e,r,n,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let s=k.resolve(e);return this._watched.has(s)||this._watched.set(s,new Qt(s,this._boundRemove)),this._watched.get(s)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let r=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(r.toString(8)[0],10))}_remove(e,s,r){let n=k.join(e,s),o=k.resolve(n);if(r=r??(this._watched.has(n)||this._watched.has(o)),!this._throttle("remove",n,100))return;!r&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,s,!0),this._getWatchedDir(n).getChildren().forEach(l=>this._remove(n,l));let c=this._getWatchedDir(e),u=c.has(s);c.remove(s),this._symlinkPaths.has(o)&&this._symlinkPaths.delete(o);let f=n;if(this.options.cwd&&(f=k.relative(this.options.cwd,n)),this.options.awaitWriteFinish&&this._pendingWrites.has(f)&&this._pendingWrites.get(f).cancelWait()===et)return;this._watched.delete(n),this._watched.delete(o);let h=r?ma:Xr;u&&!this._isIgnored(n)&&this._emit(h,n),this.options.useFsEvents||this._closePath(n)}_closePath(e){this._closeFile(e);let s=k.dirname(e);this._getWatchedDir(s).remove(k.basename(e))}_closeFile(e){let s=this._closers.get(e);s&&(s.forEach(r=>r()),this._closers.delete(e))}_addPathCloser(e,s){if(!s)return;let r=this._closers.get(e);r||(r=[],this._closers.set(e,r)),r.push(s)}_readdirp(e,s){if(this.closed)return;let r={type:Bt,alwaysStat:!0,lstat:!0,...s},n=fa(e,r);return this._streams.add(n),n.once(Ra,()=>{n=void 0}),n.once(wa,()=>{n&&(this._streams.delete(n),n=void 0)}),n}};ts.FSWatcher=tt;var Ma=(t,e)=>{let s=new tt(e);return s.add(t),s};ts.watch=Ma});import"only-server";import"../common/index.mjs";var ln=kn(on(),1);import{fork as Ba}from"node:child_process";import{existsSync as an,promises as Ga}from"node:fs";import{basename as rs,dirname as is,join as ns,relative as cn}from"node:path";import{build as qa}from"esbuild";import{jwtDecode as Ka}from"jwt-decode";import{Issuer as Va,custom as ja}from"openid-client";import{Logger as Ya}from"@5minds/processcube_engine_sdk";import{EngineClient as Wa}from"@5minds/processcube_engine_client";var ss=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",$=new Wa(ss);var za={token:"ZHVtbXlfdG9rZW4=",userId:"dummy_token"},Xa=.85,st=["external_task.ts","external_task.js"],os=process.env.PROCESSCUBE_AUTHORITY_URL!==void 0,pe=new Ya("processcube_app_sdk:external_task_adapter"),de={},Oe;async function un(t){if(t&&!an(t))throw new Error(`Invalid customExternalTasksDirPath. The given path '${t}' does not exist`);ja.setHttpOptionsDefaults({timeout:1e5});let e=await dn();Oe=await pn(e),await Za(e);let s=ec(t);(0,ln.watch)(s).on("add",async r=>{if(st.includes(rs(r)))return fn(r,s)}).on("change",async r=>{if(st.includes(rs(r)))return Qa(r,s)}).on("unlink",async r=>{st.includes(rs(r))&&hn(r)}).on("error",r=>pe.error(`Watcher error: ${r}`))}async function fn(t,e){let s=is(t);if((await Ga.readdir(s)).filter(f=>st.includes(f)).length>1){pe.error(`Multiple external task files found in directory ${s}. Stopping all external task workers for this directory.`),de[s]&&hn(t);return}let o=await _n(t),i=cn(e,s),a=En(i),c=ns(__dirname,"lib/ExternalTaskWorkerProcess.cjs"),u=Ba(c,{env:{NODE_ENV:process.env.NODE_ENV,PROCESSCUBE_ENGINE_URL:ss}});de[s]=u,u.once("disconnect",()=>{delete de[s]}),u.send({action:"create",payload:{topic:a,identity:Oe,moduleString:o,workerPath:t}})}async function Qa(t,e){let s=is(t),r=de[s];if(!r)return fn(t,e);let n=await _n(t),o=cn(e,s),i=En(o);r.send({action:"restart",payload:{topic:i,identity:Oe,moduleString:n,workerPath:t}})}function hn(t){let e=is(t),s=de[e];s&&s.kill()}async function dn(){if(!os)return null;if(!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID||!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET){let r=new Error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing. For help, please refer to our documentation on environment variables at: https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#authority");throw pe.error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing",{err:r}),r}let t=await Va.discover(process.env.PROCESSCUBE_AUTHORITY_URL);return await new t.Client({client_id:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID,client_secret:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET}).grant({grant_type:"client_credentials",scope:"engine_etw"})}function pn(t){if(!os||t===null)return za;let e=t.access_token,s=Ka(e);return{token:t.access_token,userId:s.sub}}async function Za(t){let e=5;if(!os||t===null)return;let r=await Ja(t)*Xa*1e3,n=async()=>{try{let o=await dn();Oe=pn(o);for(let i of Object.values(de))i.send({action:"updateIdentity",payload:{identity:Oe}});e=5,setTimeout(n,r)}catch(o){if(e===0){pe.error("Could not refresh identity for external task worker processes. Stopping all external task workers.",{error:o});for(let a of Object.values(de))a.kill();return}pe.error("Could not refresh identity for external task worker processes.",{error:o,retryCount:e}),e--;let i=2*1e3;setTimeout(n,i)}};setTimeout(n,r)}async function _n(t){let e=await qa({entryPoints:[t],write:!1,bundle:!0,platform:"node",target:"node18",format:"cjs",external:["@opentelemetry/api"]});if(e.errors.length>0)throw pe.error(`Could not transpile file at '${t}'`,{errors:e.errors}),new Error(`Could not transpile file at '${t}'`);return e.warnings.length>0&&pe.warn(`Transpiled file at '${t}' with warnings`,{warnings:e.warnings}),e.outputFiles[0].text}async function Ja(t){let e=t.expires_in;if(!e&&t.expires_at&&(e=Math.floor(t.expires_at-Date.now()/1e3)),e===void 0)throw new Error("Could not determine the time until the access token for external task workers expires");return e}function En(t){return t.replace(/^\.\/+|\([^)]+\)|^\/*|\/*$/g,"").replace(/[\/]{2,}/g,"/")}function ec(t){let e,s=[t,ns(process.cwd(),"app"),ns(process.cwd(),"src","app")];for(let r of s)if(r&&an(r)){e=r;break}if(!e)throw new Error("Could not find external tasks directory");return e}function el(){return $}import{getToken as gn}from"next-auth/jwt";import{ResponseCookies as tc}from"next/dist/compiled/@edge-runtime/cookies";import{cookies as rt,headers as mn}from"next/headers";var sc=process.env.NEXTAUTH_URL?.startsWith("https://"),yn=`${sc?"__Secure-":""}next-auth.session-token`;async function il(){let t=await gn({req:{cookies:rt(),headers:mn()}});if(t?.expiresAt&&Date.now()>=t.expiresAt*1e3){let s=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:rt().toString()}}),r=new tc(s.headers),n=r.get(yn);if(n){let o=!1;try{rt().set(yn,n.value,{...n})}catch{o=!0}if(t=await gn({req:{cookies:o?r:rt(),headers:mn()}}),t?.error)throw t.error}}if(!t?.accessToken||!t?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:t?.accessToken,userId:t?.sub}}import{DataModels as rc}from"@5minds/processcube_engine_client";async function ll(t){return await $.processInstances.query({...t?.query,state:rc.ProcessInstances.ProcessInstanceState.running},t?.options)}import{DataModels as oe}from"@5minds/processcube_engine_client";import{mapUserTask as Rn,mapUserTaskList as _e}from"../common/index.mjs";async function El(t={},e){let{correlationId:s,processInstanceId:r,flowNodeId:n}=t;return new Promise(async(o,i)=>{let a=await $.userTasks.onUserTaskWaiting(async u=>{let f=s!==void 0&&u.correlationId!==s,h=u.flowNodeInstanceId===void 0,l=r!==void 0&&u.processInstanceId!==r,m=n!==void 0&&u.flowNodeId!==n;if(f||h||l||m)return;let y=await ic(u.flowNodeInstanceId,{identity:e});return $.notification.removeSubscription(a,e),y===null?i(new Error(`UserTask with instance ID "${u.flowNodeInstanceId}" does not exist.`)):o(y)},{identity:e}),c=await nc({correlationId:s,processInstanceId:r,flowNodeId:n,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e});c.userTasks.length>0&&($.notification.removeSubscription(a,e),o(c.userTasks[0]))})}async function gl(t,e={},s={},r){await $.userTasks.finishUserTask(t,s,r);let n={state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended,...e},o=await $.userTasks.query(n,{identity:r});return Rn(o.userTasks[0])}async function nc(...t){let e=await $.userTasks.query(...t);return _e(e)}async function ml(t){let e=await $.userTasks.query({state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},t);return _e(e)}async function yl(t,e){let s=await $.userTasks.query({processInstanceId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(s)}async function Rl(t,e){let s=await $.userTasks.query({flowNodeId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(s)}async function ic(t,e){let s=await $.userTasks.query({flowNodeInstanceId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{...e,limit:1});return s.userTasks.length===0?null:Rn(s.userTasks[0])}async function wl(t,e){let s=await $.userTasks.query({correlationId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(s)}async function Al(t,e){let s=await $.userTasks.query({state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:t,...e}),r=s.userTasks.filter(n=>n.actualOwnerId===t.userId);return s.userTasks=r,_e(s)}async function Tl(t,e){let s=await $.userTasks.query({state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:t,...e}),r=s.userTasks.filter(n=>n.assignedUserIds?.includes(t.userId));return s.userTasks=r,_e(s)}import{PHASE_DEVELOPMENT_SERVER as oc,PHASE_PRODUCTION_SERVER as ac}from"next/dist/shared/lib/constants";var wn=!1;function Ll(t={}){let{applicationSdk:e,...s}=t;return async(r,n)=>{let o=r===oc||r===ac;return e?.useExternalTasks&&o&&!wn&&(wn=!0,await un(e?.customExternalTasksDirPath)),s}}import{revalidatePath as cc}from"next/cache";import{redirect as lc}from"next/navigation";function Ml(t){cc(t),lc(t)}async function Gl(...t){return await $.processModels.startProcessInstance(...t)}async function Vl(...t){await $.userTasks.finishUserTask(...t)}export{Vl as finishUserTask,gl as finishUserTaskAndGetNext,ll as getActiveProcessInstances,Tl as getAssignedUserTasksByIdentity,el as getEngineClient,il as getIdentity,Al as getReservedUserTasksByIdentity,nc as getUserTasks,ic as getWaitingUserTaskByFlowNodeInstanceId,ml as getWaitingUserTasks,wl as getWaitingUserTasksByCorrelationId,Rl as getWaitingUserTasksByFlowNodeId,yl as getWaitingUserTasksByProcessInstanceId,Ml as navigateToUrl,Gl as startProcess,El as waitForUserTask,Ll as withApplicationSdk};
|
|
1
|
+
var Cn=Object.create;var cs=Object.defineProperty;var xn=Object.getOwnPropertyDescriptor;var bn=Object.getOwnPropertyNames;var In=Object.getPrototypeOf,vn=Object.prototype.hasOwnProperty;var H=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,s)=>(typeof require<"u"?require:e)[s]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var kn=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of bn(e))!vn.call(t,n)&&n!==s&&cs(t,n,{get:()=>e[n],enumerable:!(r=xn(e,n))||r.enumerable});return t};var Nn=(t,e,s)=>(s=t!=null?Cn(In(t)):{},kn(e||!t||!t.__esModule?cs(s,"default",{value:t,enumerable:!0}):s,t));var we=v((fc,ds)=>{"use strict";var Pn=H("path"),re="\\\\/",ls=`[^${re}]`,ne="\\.",On="\\+",Ln="\\?",Fe="\\/",Hn="(?=.)",us="[^/]",ot=`(?:${Fe}|$)`,fs=`(?:^|${Fe})`,at=`${ne}{1,2}${ot}`,Dn=`(?!${ne})`,Fn=`(?!${fs}${at})`,$n=`(?!${ne}{0,1}${ot})`,Mn=`(?!${at})`,Un=`[^.${Fe}]`,Wn=`${us}*?`,hs={DOT_LITERAL:ne,PLUS_LITERAL:On,QMARK_LITERAL:Ln,SLASH_LITERAL:Fe,ONE_CHAR:Hn,QMARK:us,END_ANCHOR:ot,DOTS_SLASH:at,NO_DOT:Dn,NO_DOTS:Fn,NO_DOT_SLASH:$n,NO_DOTS_SLASH:Mn,QMARK_NO_DOT:Un,STAR:Wn,START_ANCHOR:fs},Bn={...hs,SLASH_LITERAL:`[${re}]`,QMARK:ls,STAR:`${ls}*?`,DOTS_SLASH:`${ne}{1,2}(?:[${re}]|$)`,NO_DOT:`(?!${ne})`,NO_DOTS:`(?!(?:^|[${re}])${ne}{1,2}(?:[${re}]|$))`,NO_DOT_SLASH:`(?!${ne}{0,1}(?:[${re}]|$))`,NO_DOTS_SLASH:`(?!${ne}{1,2}(?:[${re}]|$))`,QMARK_NO_DOT:`[^.${re}]`,START_ANCHOR:`(?:^|[${re}])`,END_ANCHOR:`(?:[${re}]|$)`},Gn={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};ds.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Gn,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Pn.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Bn:hs}}});var $e=v(Y=>{"use strict";var qn=H("path"),Kn=process.platform==="win32",{REGEX_BACKSLASH:Vn,REGEX_REMOVE_BACKSLASH:jn,REGEX_SPECIAL_CHARS:Yn,REGEX_SPECIAL_CHARS_GLOBAL:zn}=we();Y.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Y.hasRegexChars=t=>Yn.test(t);Y.isRegexChar=t=>t.length===1&&Y.hasRegexChars(t);Y.escapeRegex=t=>t.replace(zn,"\\$1");Y.toPosixSlashes=t=>t.replace(Vn,"/");Y.removeBackslashes=t=>t.replace(jn,e=>e==="\\"?"":e);Y.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Y.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:Kn===!0||qn.sep==="\\";Y.escapeLast=(t,e,s)=>{let r=t.lastIndexOf(e,s);return r===-1?t:t[r-1]==="\\"?Y.escapeLast(t,e,r-1):`${t.slice(0,r)}\\${t.slice(r)}`};Y.removePrefix=(t,e={})=>{let s=t;return s.startsWith("./")&&(s=s.slice(2),e.prefix="./"),s};Y.wrapOutput=(t,e={},s={})=>{let r=s.contains?"":"^",n=s.contains?"":"$",o=`${r}(?:${t})${n}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var ws=v((dc,Rs)=>{"use strict";var ps=$e(),{CHAR_ASTERISK:ct,CHAR_AT:Xn,CHAR_BACKWARD_SLASH:Ae,CHAR_COMMA:Qn,CHAR_DOT:lt,CHAR_EXCLAMATION_MARK:ut,CHAR_FORWARD_SLASH:ys,CHAR_LEFT_CURLY_BRACE:ft,CHAR_LEFT_PARENTHESES:ht,CHAR_LEFT_SQUARE_BRACKET:Zn,CHAR_PLUS:Jn,CHAR_QUESTION_MARK:_s,CHAR_RIGHT_CURLY_BRACE:ei,CHAR_RIGHT_PARENTHESES:Es,CHAR_RIGHT_SQUARE_BRACKET:ti}=we(),gs=t=>t===ys||t===Ae,ms=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},si=(t,e)=>{let s=e||{},r=t.length-1,n=s.parts===!0||s.scanToEnd===!0,o=[],i=[],a=[],c=t,u=-1,f=0,h=0,l=!1,m=!1,y=!1,w=!1,S=!1,x=!1,D=!1,$=!1,ee=!1,q=!1,ae=0,K,A,I={value:"",depth:0,isGlob:!1},G=()=>u>=r,_=()=>c.charCodeAt(u+1),L=()=>(K=A,c.charCodeAt(++u));for(;u<r;){A=L();let V;if(A===Ae){D=I.backslashes=!0,A=L(),A===ft&&(x=!0);continue}if(x===!0||A===ft){for(ae++;G()!==!0&&(A=L());){if(A===Ae){D=I.backslashes=!0,L();continue}if(A===ft){ae++;continue}if(x!==!0&&A===lt&&(A=L())===lt){if(l=I.isBrace=!0,y=I.isGlob=!0,q=!0,n===!0)continue;break}if(x!==!0&&A===Qn){if(l=I.isBrace=!0,y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===ei&&(ae--,ae===0)){x=!1,l=I.isBrace=!0,q=!0;break}}if(n===!0)continue;break}if(A===ys){if(o.push(u),i.push(I),I={value:"",depth:0,isGlob:!1},q===!0)continue;if(K===lt&&u===f+1){f+=2;continue}h=u+1;continue}if(s.noext!==!0&&(A===Jn||A===Xn||A===ct||A===_s||A===ut)===!0&&_()===ht){if(y=I.isGlob=!0,w=I.isExtglob=!0,q=!0,A===ut&&u===f&&(ee=!0),n===!0){for(;G()!==!0&&(A=L());){if(A===Ae){D=I.backslashes=!0,A=L();continue}if(A===Es){y=I.isGlob=!0,q=!0;break}}continue}break}if(A===ct){if(K===ct&&(S=I.isGlobstar=!0),y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===_s){if(y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===Zn){for(;G()!==!0&&(V=L());){if(V===Ae){D=I.backslashes=!0,L();continue}if(V===ti){m=I.isBracket=!0,y=I.isGlob=!0,q=!0;break}}if(n===!0)continue;break}if(s.nonegate!==!0&&A===ut&&u===f){$=I.negated=!0,f++;continue}if(s.noparen!==!0&&A===ht){if(y=I.isGlob=!0,n===!0){for(;G()!==!0&&(A=L());){if(A===ht){D=I.backslashes=!0,A=L();continue}if(A===Es){q=!0;break}}continue}break}if(y===!0){if(q=!0,n===!0)continue;break}}s.noext===!0&&(w=!1,y=!1);let P=c,ce="",d="";f>0&&(ce=c.slice(0,f),c=c.slice(f),h-=f),P&&y===!0&&h>0?(P=c.slice(0,h),d=c.slice(h)):y===!0?(P="",d=c):P=c,P&&P!==""&&P!=="/"&&P!==c&&gs(P.charCodeAt(P.length-1))&&(P=P.slice(0,-1)),s.unescape===!0&&(d&&(d=ps.removeBackslashes(d)),P&&D===!0&&(P=ps.removeBackslashes(P)));let p={prefix:ce,input:t,start:f,base:P,glob:d,isBrace:l,isBracket:m,isGlob:y,isExtglob:w,isGlobstar:S,negated:$,negatedExtglob:ee};if(s.tokens===!0&&(p.maxDepth=0,gs(A)||i.push(I),p.tokens=i),s.parts===!0||s.tokens===!0){let V;for(let b=0;b<o.length;b++){let te=V?V+1:f,se=o[b],z=t.slice(te,se);s.tokens&&(b===0&&f!==0?(i[b].isPrefix=!0,i[b].value=ce):i[b].value=z,ms(i[b]),p.maxDepth+=i[b].depth),(b!==0||z!=="")&&a.push(z),V=se}if(V&&V+1<t.length){let b=t.slice(V+1);a.push(b),s.tokens&&(i[i.length-1].value=b,ms(i[i.length-1]),p.maxDepth+=i[i.length-1].depth)}p.slashes=o,p.parts=a}return p};Rs.exports=si});var Ts=v((pc,Ss)=>{"use strict";var Me=we(),X=$e(),{MAX_LENGTH:Ue,POSIX_REGEX_SOURCE:ri,REGEX_NON_SPECIAL_CHARS:ni,REGEX_SPECIAL_CHARS_BACKREF:ii,REPLACEMENTS:As}=Me,oi=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let s=`[${t.join("-")}]`;try{new RegExp(s)}catch{return t.map(n=>X.escapeRegex(n)).join("..")}return s},Ee=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,dt=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=As[t]||t;let s={...e},r=typeof s.maxLength=="number"?Math.min(Ue,s.maxLength):Ue,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);let o={type:"bos",value:"",output:s.prepend||""},i=[o],a=s.capture?"":"?:",c=X.isWindows(e),u=Me.globChars(c),f=Me.extglobChars(u),{DOT_LITERAL:h,PLUS_LITERAL:l,SLASH_LITERAL:m,ONE_CHAR:y,DOTS_SLASH:w,NO_DOT:S,NO_DOT_SLASH:x,NO_DOTS_SLASH:D,QMARK:$,QMARK_NO_DOT:ee,STAR:q,START_ANCHOR:ae}=u,K=g=>`(${a}(?:(?!${ae}${g.dot?w:h}).)*?)`,A=s.dot?"":S,I=s.dot?$:ee,G=s.bash===!0?K(s):q;s.capture&&(G=`(${G})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);let _={input:t,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=X.removePrefix(t,_),n=t.length;let L=[],P=[],ce=[],d=o,p,V=()=>_.index===n-1,b=_.peek=(g=1)=>t[_.index+g],te=_.advance=()=>t[++_.index]||"",se=()=>t.slice(_.index+1),z=(g="",O=0)=>{_.consumed+=g,_.index+=O},Oe=g=>{_.output+=g.output!=null?g.output:g.value,z(g.value)},Sn=()=>{let g=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)te(),_.start++,g++;return g%2===0?!1:(_.negated=!0,_.start++,!0)},Le=g=>{_[g]++,ce.push(g)},le=g=>{_[g]--,ce.pop()},C=g=>{if(d.type==="globstar"){let O=_.braces>0&&(g.type==="comma"||g.type==="brace"),E=g.extglob===!0||L.length&&(g.type==="pipe"||g.type==="paren");g.type!=="slash"&&g.type!=="paren"&&!O&&!E&&(_.output=_.output.slice(0,-d.output.length),d.type="star",d.value="*",d.output=G,_.output+=d.output)}if(L.length&&g.type!=="paren"&&(L[L.length-1].inner+=g.value),(g.value||g.output)&&Oe(g),d&&d.type==="text"&&g.type==="text"){d.value+=g.value,d.output=(d.output||"")+g.value;return}g.prev=d,i.push(g),d=g},He=(g,O)=>{let E={...f[O],conditions:1,inner:""};E.prev=d,E.parens=_.parens,E.output=_.output;let T=(s.capture?"(":"")+E.open;Le("parens"),C({type:g,value:O,output:_.output?"":y}),C({type:"paren",extglob:!0,value:te(),output:T}),L.push(E)},Tn=g=>{let O=g.close+(s.capture?")":""),E;if(g.type==="negate"){let T=G;if(g.inner&&g.inner.length>1&&g.inner.includes("/")&&(T=K(s)),(T!==G||V()||/^\)+$/.test(se()))&&(O=g.close=`)$))${T}`),g.inner.includes("*")&&(E=se())&&/^\.[^\\/.]+$/.test(E)){let F=dt(E,{...e,fastpaths:!1}).output;O=g.close=`)${F})${T})`}g.prev.type==="bos"&&(_.negatedExtglob=!0)}C({type:"paren",extglob:!0,value:p,output:O}),le("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let g=!1,O=t.replace(ii,(E,T,F,j,U,it)=>j==="\\"?(g=!0,E):j==="?"?T?T+j+(U?$.repeat(U.length):""):it===0?I+(U?$.repeat(U.length):""):$.repeat(F.length):j==="."?h.repeat(F.length):j==="*"?T?T+j+(U?G:""):G:T?E:`\\${E}`);return g===!0&&(s.unescape===!0?O=O.replace(/\\/g,""):O=O.replace(/\\+/g,E=>E.length%2===0?"\\\\":E?"\\":"")),O===t&&s.contains===!0?(_.output=t,_):(_.output=X.wrapOutput(O,_,e),_)}for(;!V();){if(p=te(),p==="\0")continue;if(p==="\\"){let E=b();if(E==="/"&&s.bash!==!0||E==="."||E===";")continue;if(!E){p+="\\",C({type:"text",value:p});continue}let T=/^\\+/.exec(se()),F=0;if(T&&T[0].length>2&&(F=T[0].length,_.index+=F,F%2!==0&&(p+="\\")),s.unescape===!0?p=te():p+=te(),_.brackets===0){C({type:"text",value:p});continue}}if(_.brackets>0&&(p!=="]"||d.value==="["||d.value==="[^")){if(s.posix!==!1&&p===":"){let E=d.value.slice(1);if(E.includes("[")&&(d.posix=!0,E.includes(":"))){let T=d.value.lastIndexOf("["),F=d.value.slice(0,T),j=d.value.slice(T+2),U=ri[j];if(U){d.value=F+U,_.backtrack=!0,te(),!o.output&&i.indexOf(d)===1&&(o.output=y);continue}}}(p==="["&&b()!==":"||p==="-"&&b()==="]")&&(p=`\\${p}`),p==="]"&&(d.value==="["||d.value==="[^")&&(p=`\\${p}`),s.posix===!0&&p==="!"&&d.value==="["&&(p="^"),d.value+=p,Oe({value:p});continue}if(_.quotes===1&&p!=='"'){p=X.escapeRegex(p),d.value+=p,Oe({value:p});continue}if(p==='"'){_.quotes=_.quotes===1?0:1,s.keepQuotes===!0&&C({type:"text",value:p});continue}if(p==="("){Le("parens"),C({type:"paren",value:p});continue}if(p===")"){if(_.parens===0&&s.strictBrackets===!0)throw new SyntaxError(Ee("opening","("));let E=L[L.length-1];if(E&&_.parens===E.parens+1){Tn(L.pop());continue}C({type:"paren",value:p,output:_.parens?")":"\\)"}),le("parens");continue}if(p==="["){if(s.nobracket===!0||!se().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(Ee("closing","]"));p=`\\${p}`}else Le("brackets");C({type:"bracket",value:p});continue}if(p==="]"){if(s.nobracket===!0||d&&d.type==="bracket"&&d.value.length===1){C({type:"text",value:p,output:`\\${p}`});continue}if(_.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(Ee("opening","["));C({type:"text",value:p,output:`\\${p}`});continue}le("brackets");let E=d.value.slice(1);if(d.posix!==!0&&E[0]==="^"&&!E.includes("/")&&(p=`/${p}`),d.value+=p,Oe({value:p}),s.literalBrackets===!1||X.hasRegexChars(E))continue;let T=X.escapeRegex(d.value);if(_.output=_.output.slice(0,-d.value.length),s.literalBrackets===!0){_.output+=T,d.value=T;continue}d.value=`(${a}${T}|${d.value})`,_.output+=d.value;continue}if(p==="{"&&s.nobrace!==!0){Le("braces");let E={type:"brace",value:p,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};P.push(E),C(E);continue}if(p==="}"){let E=P[P.length-1];if(s.nobrace===!0||!E){C({type:"text",value:p,output:p});continue}let T=")";if(E.dots===!0){let F=i.slice(),j=[];for(let U=F.length-1;U>=0&&(i.pop(),F[U].type!=="brace");U--)F[U].type!=="dots"&&j.unshift(F[U].value);T=oi(j,s),_.backtrack=!0}if(E.comma!==!0&&E.dots!==!0){let F=_.output.slice(0,E.outputIndex),j=_.tokens.slice(E.tokensIndex);E.value=E.output="\\{",p=T="\\}",_.output=F;for(let U of j)_.output+=U.output||U.value}C({type:"brace",value:p,output:T}),le("braces"),P.pop();continue}if(p==="|"){L.length>0&&L[L.length-1].conditions++,C({type:"text",value:p});continue}if(p===","){let E=p,T=P[P.length-1];T&&ce[ce.length-1]==="braces"&&(T.comma=!0,E="|"),C({type:"comma",value:p,output:E});continue}if(p==="/"){if(d.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",i.pop(),d=o;continue}C({type:"slash",value:p,output:m});continue}if(p==="."){if(_.braces>0&&d.type==="dot"){d.value==="."&&(d.output=h);let E=P[P.length-1];d.type="dots",d.output+=p,d.value+=p,E.dots=!0;continue}if(_.braces+_.parens===0&&d.type!=="bos"&&d.type!=="slash"){C({type:"text",value:p,output:h});continue}C({type:"dot",value:p,output:h});continue}if(p==="?"){if(!(d&&d.value==="(")&&s.noextglob!==!0&&b()==="("&&b(2)!=="?"){He("qmark",p);continue}if(d&&d.type==="paren"){let T=b(),F=p;if(T==="<"&&!X.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(d.value==="("&&!/[!=<:]/.test(T)||T==="<"&&!/<([!=]|\w+>)/.test(se()))&&(F=`\\${p}`),C({type:"text",value:p,output:F});continue}if(s.dot!==!0&&(d.type==="slash"||d.type==="bos")){C({type:"qmark",value:p,output:ee});continue}C({type:"qmark",value:p,output:$});continue}if(p==="!"){if(s.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){He("negate",p);continue}if(s.nonegate!==!0&&_.index===0){Sn();continue}}if(p==="+"){if(s.noextglob!==!0&&b()==="("&&b(2)!=="?"){He("plus",p);continue}if(d&&d.value==="("||s.regex===!1){C({type:"plus",value:p,output:l});continue}if(d&&(d.type==="bracket"||d.type==="paren"||d.type==="brace")||_.parens>0){C({type:"plus",value:p});continue}C({type:"plus",value:l});continue}if(p==="@"){if(s.noextglob!==!0&&b()==="("&&b(2)!=="?"){C({type:"at",extglob:!0,value:p,output:""});continue}C({type:"text",value:p});continue}if(p!=="*"){(p==="$"||p==="^")&&(p=`\\${p}`);let E=ni.exec(se());E&&(p+=E[0],_.index+=E[0].length),C({type:"text",value:p});continue}if(d&&(d.type==="globstar"||d.star===!0)){d.type="star",d.star=!0,d.value+=p,d.output=G,_.backtrack=!0,_.globstar=!0,z(p);continue}let g=se();if(s.noextglob!==!0&&/^\([^?]/.test(g)){He("star",p);continue}if(d.type==="star"){if(s.noglobstar===!0){z(p);continue}let E=d.prev,T=E.prev,F=E.type==="slash"||E.type==="bos",j=T&&(T.type==="star"||T.type==="globstar");if(s.bash===!0&&(!F||g[0]&&g[0]!=="/")){C({type:"star",value:p,output:""});continue}let U=_.braces>0&&(E.type==="comma"||E.type==="brace"),it=L.length&&(E.type==="pipe"||E.type==="paren");if(!F&&E.type!=="paren"&&!U&&!it){C({type:"star",value:p,output:""});continue}for(;g.slice(0,3)==="/**";){let De=t[_.index+4];if(De&&De!=="/")break;g=g.slice(3),z("/**",3)}if(E.type==="bos"&&V()){d.type="globstar",d.value+=p,d.output=K(s),_.output=d.output,_.globstar=!0,z(p);continue}if(E.type==="slash"&&E.prev.type!=="bos"&&!j&&V()){_.output=_.output.slice(0,-(E.output+d.output).length),E.output=`(?:${E.output}`,d.type="globstar",d.output=K(s)+(s.strictSlashes?")":"|$)"),d.value+=p,_.globstar=!0,_.output+=E.output+d.output,z(p);continue}if(E.type==="slash"&&E.prev.type!=="bos"&&g[0]==="/"){let De=g[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(E.output+d.output).length),E.output=`(?:${E.output}`,d.type="globstar",d.output=`${K(s)}${m}|${m}${De})`,d.value+=p,_.output+=E.output+d.output,_.globstar=!0,z(p+te()),C({type:"slash",value:"/",output:""});continue}if(E.type==="bos"&&g[0]==="/"){d.type="globstar",d.value+=p,d.output=`(?:^|${m}|${K(s)}${m})`,_.output=d.output,_.globstar=!0,z(p+te()),C({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-d.output.length),d.type="globstar",d.output=K(s),d.value+=p,_.output+=d.output,_.globstar=!0,z(p);continue}let O={type:"star",value:p,output:G};if(s.bash===!0){O.output=".*?",(d.type==="bos"||d.type==="slash")&&(O.output=A+O.output),C(O);continue}if(d&&(d.type==="bracket"||d.type==="paren")&&s.regex===!0){O.output=p,C(O);continue}(_.index===_.start||d.type==="slash"||d.type==="dot")&&(d.type==="dot"?(_.output+=x,d.output+=x):s.dot===!0?(_.output+=D,d.output+=D):(_.output+=A,d.output+=A),b()!=="*"&&(_.output+=y,d.output+=y)),C(O)}for(;_.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(Ee("closing","]"));_.output=X.escapeLast(_.output,"["),le("brackets")}for(;_.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(Ee("closing",")"));_.output=X.escapeLast(_.output,"("),le("parens")}for(;_.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(Ee("closing","}"));_.output=X.escapeLast(_.output,"{"),le("braces")}if(s.strictSlashes!==!0&&(d.type==="star"||d.type==="bracket")&&C({type:"maybe_slash",value:"",output:`${m}?`}),_.backtrack===!0){_.output="";for(let g of _.tokens)_.output+=g.output!=null?g.output:g.value,g.suffix&&(_.output+=g.suffix)}return _};dt.fastpaths=(t,e)=>{let s={...e},r=typeof s.maxLength=="number"?Math.min(Ue,s.maxLength):Ue,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);t=As[t]||t;let o=X.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:f,NO_DOTS:h,NO_DOTS_SLASH:l,STAR:m,START_ANCHOR:y}=Me.globChars(o),w=s.dot?h:f,S=s.dot?l:f,x=s.capture?"":"?:",D={negated:!1,prefix:""},$=s.bash===!0?".*?":m;s.capture&&($=`(${$})`);let ee=A=>A.noglobstar===!0?$:`(${x}(?:(?!${y}${A.dot?u:i}).)*?)`,q=A=>{switch(A){case"*":return`${w}${c}${$}`;case".*":return`${i}${c}${$}`;case"*.*":return`${w}${$}${i}${c}${$}`;case"*/*":return`${w}${$}${a}${c}${S}${$}`;case"**":return w+ee(s);case"**/*":return`(?:${w}${ee(s)}${a})?${S}${c}${$}`;case"**/*.*":return`(?:${w}${ee(s)}${a})?${S}${$}${i}${c}${$}`;case"**/.*":return`(?:${w}${ee(s)}${a})?${i}${c}${$}`;default:{let I=/^(.*?)\.(\w+)$/.exec(A);if(!I)return;let G=q(I[1]);return G?G+i+I[2]:void 0}}},ae=X.removePrefix(t,D),K=q(ae);return K&&s.strictSlashes!==!0&&(K+=`${a}?`),K};Ss.exports=dt});var xs=v((_c,Cs)=>{"use strict";var ai=H("path"),ci=ws(),pt=Ts(),_t=$e(),li=we(),ui=t=>t&&typeof t=="object"&&!Array.isArray(t),M=(t,e,s=!1)=>{if(Array.isArray(t)){let f=t.map(l=>M(l,e,s));return l=>{for(let m of f){let y=m(l);if(y)return y}return!1}}let r=ui(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let n=e||{},o=_t.isWindows(e),i=r?M.compileRe(t,e):M.makeRe(t,e,!1,!0),a=i.state;delete i.state;let c=()=>!1;if(n.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};c=M(n.ignore,f,s)}let u=(f,h=!1)=>{let{isMatch:l,match:m,output:y}=M.test(f,i,e,{glob:t,posix:o}),w={glob:t,state:a,regex:i,posix:o,input:f,output:y,match:m,isMatch:l};return typeof n.onResult=="function"&&n.onResult(w),l===!1?(w.isMatch=!1,h?w:!1):c(f)?(typeof n.onIgnore=="function"&&n.onIgnore(w),w.isMatch=!1,h?w:!1):(typeof n.onMatch=="function"&&n.onMatch(w),h?w:!0)};return s&&(u.state=a),u};M.test=(t,e,s,{glob:r,posix:n}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=s||{},i=o.format||(n?_t.toPosixSlashes:null),a=t===r,c=a&&i?i(t):t;return a===!1&&(c=i?i(t):t,a=c===r),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=M.matchBase(t,e,s,n):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};M.matchBase=(t,e,s,r=_t.isWindows(s))=>(e instanceof RegExp?e:M.makeRe(e,s)).test(ai.basename(t));M.isMatch=(t,e,s)=>M(e,s)(t);M.parse=(t,e)=>Array.isArray(t)?t.map(s=>M.parse(s,e)):pt(t,{...e,fastpaths:!1});M.scan=(t,e)=>ci(t,e);M.compileRe=(t,e,s=!1,r=!1)=>{if(s===!0)return t.output;let n=e||{},o=n.contains?"":"^",i=n.contains?"":"$",a=`${o}(?:${t.output})${i}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=M.toRegex(a,e);return r===!0&&(c.state=t),c};M.makeRe=(t,e={},s=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(n.output=pt.fastpaths(t,e)),n.output||(n=pt(t,e)),M.compileRe(n,e,s,r)};M.toRegex=(t,e)=>{try{let s=e||{};return new RegExp(t,s.flags||(s.nocase?"i":""))}catch(s){if(e&&e.debug===!0)throw s;return/$^/}};M.constants=li;Cs.exports=M});var Et=v((Ec,bs)=>{"use strict";bs.exports=xs()});var Hs=v((gc,Ls)=>{"use strict";var Te=H("fs"),{Readable:fi}=H("stream"),Se=H("path"),{promisify:qe}=H("util"),gt=Et(),hi=qe(Te.readdir),di=qe(Te.stat),Is=qe(Te.lstat),pi=qe(Te.realpath),_i="!",Ps="READDIRP_RECURSIVE_ERROR",Ei=new Set(["ENOENT","EPERM","EACCES","ELOOP",Ps]),mt="files",Os="directories",Be="files_directories",We="all",vs=[mt,Os,Be,We],gi=t=>Ei.has(t.code),[ks,mi]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),yi=process.platform==="win32"&&(ks>10||ks===10&&mi>=5),Ns=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=gt(t.trim());return s=>e(s.basename)}if(Array.isArray(t)){let e=[],s=[];for(let r of t){let n=r.trim();n.charAt(0)===_i?s.push(gt(n.slice(1))):e.push(gt(n))}return s.length>0?e.length>0?r=>e.some(n=>n(r.basename))&&!s.some(n=>n(r.basename)):r=>!s.some(n=>n(r.basename)):r=>e.some(n=>n(r.basename))}}},Ge=class t extends fi{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:mt,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let s={...t.defaultOptions,...e},{root:r,type:n}=s;this._fileFilter=Ns(s.fileFilter),this._directoryFilter=Ns(s.directoryFilter);let o=s.lstat?Is:di;yi?this._stat=i=>o(i,{bigint:!0}):this._stat=o,this._maxDepth=s.depth,this._wantsDir=[Os,Be,We].includes(n),this._wantsFile=[mt,Be,We].includes(n),this._wantsEverything=n===We,this._root=Se.resolve(r),this._isDirent="Dirent"in Te&&!s.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:s,depth:r,files:n=[]}=this.parent||{};if(n.length>0){let o=n.splice(0,e).map(i=>this._formatEntry(i,s));for(let i of await Promise.all(o)){if(this.destroyed)return;let a=await this._getEntryType(i);a==="directory"&&this._directoryFilter(i)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(i.fullPath,r+1)),this._wantsDir&&(this.push(i),e--)):(a==="file"||this._includeAsFile(i))&&this._fileFilter(i)&&this._wantsFile&&(this.push(i),e--)}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(s){this.destroy(s)}finally{this.reading=!1}}}async _exploreDir(e,s){let r;try{r=await hi(e,this._rdOptions)}catch(n){this._onError(n)}return{files:r,depth:s,path:e}}async _formatEntry(e,s){let r;try{let n=this._isDirent?e.name:e,o=Se.resolve(Se.join(s,n));r={path:Se.relative(this._root,o),fullPath:o,basename:n},r[this._statsProp]=this._isDirent?e:await this._stat(o)}catch(n){this._onError(n)}return r}_onError(e){gi(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let s=e&&e[this._statsProp];if(s){if(s.isFile())return"file";if(s.isDirectory())return"directory";if(s&&s.isSymbolicLink()){let r=e.fullPath;try{let n=await pi(r),o=await Is(n);if(o.isFile())return"file";if(o.isDirectory()){let i=n.length;if(r.startsWith(n)&&r.substr(i,1)===Se.sep){let a=new Error(`Circular symlink detected: "${r}" points to "${n}"`);return a.code=Ps,this._onError(a)}return"directory"}}catch(n){this._onError(n)}}}}_includeAsFile(e){let s=e&&e[this._statsProp];return s&&this._wantsEverything&&!s.isDirectory()}},ge=(t,e={})=>{let s=e.entryType||e.type;if(s==="both"&&(s=Be),s&&(e.type=s),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(s&&!vs.includes(s))throw new Error(`readdirp: Invalid type passed. Use one of ${vs.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new Ge(e)},Ri=(t,e={})=>new Promise((s,r)=>{let n=[];ge(t,e).on("data",o=>n.push(o)).on("end",()=>s(n)).on("error",o=>r(o))});ge.promise=Ri;ge.ReaddirpStream=Ge;ge.default=ge;Ls.exports=ge});var yt=v((mc,Ds)=>{Ds.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var s=t.length;if(s<=1)return t;var r="";if(s>4&&t[3]==="\\"){var n=t[2];(n==="?"||n===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),r="//")}var o=t.split(/[/\\]+/);return e!==!1&&o[o.length-1]===""&&o.pop(),r+o.join("/")}});var Bs=v((Us,Ws)=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});var Ms=Et(),wi=yt(),Fs="!",Ai={returnIndex:!1},Si=t=>Array.isArray(t)?t:[t],Ti=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let s=Ms(t,e);return r=>t===r||s(r)}return t instanceof RegExp?s=>t.test(s):s=>!1},$s=(t,e,s,r)=>{let n=Array.isArray(s),o=n?s[0]:s;if(!n&&typeof o!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(o));let i=wi(o,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(i))return r?-1:!1}let a=n&&[i].concat(s.slice(1));for(let c=0;c<t.length;c++){let u=t[c];if(n?u(...a):u(i))return r?c:!0}return r?-1:!1},Rt=(t,e,s=Ai)=>{if(t==null)throw new TypeError("anymatch: specify first argument");let r=typeof s=="boolean"?{returnIndex:s}:s,n=r.returnIndex||!1,o=Si(t),i=o.filter(c=>typeof c=="string"&&c.charAt(0)===Fs).map(c=>c.slice(1)).map(c=>Ms(c,r)),a=o.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==Fs).map(c=>Ti(c,r));return e==null?(c,u=!1)=>$s(a,i,c,typeof u=="boolean"?u:!1):$s(a,i,e,n)};Rt.default=Rt;Ws.exports=Rt});var qs=v((yc,Gs)=>{Gs.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var s;s=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(s[2])return!0;e=e.slice(s.index+s[0].length)}return!1}});var wt=v((Rc,Vs)=>{var Ci=qs(),Ks={"{":"}","(":")","[":"]"},xi=function(t){if(t[0]==="!")return!0;for(var e=0,s=-2,r=-2,n=-2,o=-2,i=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||r!==-1&&t[e]==="["&&t[e+1]!=="]"&&(r<e&&(r=t.indexOf("]",e)),r>e&&(i===-1||i>r||(i=t.indexOf("\\",e),i===-1||i>r)))||n!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(n=t.indexOf("}",e),n>e&&(i=t.indexOf("\\",e),i===-1||i>n))||o!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(o=t.indexOf(")",e),o>e&&(i=t.indexOf("\\",e),i===-1||i>o))||s!==-1&&t[e]==="("&&t[e+1]!=="|"&&(s<e&&(s=t.indexOf("|",e)),s!==-1&&t[s+1]!==")"&&(o=t.indexOf(")",s),o>s&&(i=t.indexOf("\\",s),i===-1||i>o))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var c=Ks[a];if(c){var u=t.indexOf(c,e);u!==-1&&(e=u+1)}if(t[e]==="!")return!0}else e++}return!1},bi=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var s=t[e+1];e+=2;var r=Ks[s];if(r){var n=t.indexOf(r,e);n!==-1&&(e=n+1)}if(t[e]==="!")return!0}else e++}return!1};Vs.exports=function(e,s){if(typeof e!="string"||e==="")return!1;if(Ci(e))return!0;var r=xi;return s&&s.strict===!1&&(r=bi),r(e)}});var Ys=v((wc,js)=>{"use strict";var Ii=wt(),vi=H("path").posix.dirname,ki=H("os").platform()==="win32",At="/",Ni=/\\/g,Pi=/[\{\[].*[\}\]]$/,Oi=/(^|[^\\])([\{\[]|\([^\)]+$)/,Li=/\\([\!\*\?\|\[\]\(\)\{\}])/g;js.exports=function(e,s){var r=Object.assign({flipBackslashes:!0},s);r.flipBackslashes&&ki&&e.indexOf(At)<0&&(e=e.replace(Ni,At)),Pi.test(e)&&(e+=At),e+="a";do e=vi(e);while(Ii(e)||Oi.test(e));return e.replace(Li,"$1")}});var Ke=v(Z=>{"use strict";Z.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;Z.find=(t,e)=>t.nodes.find(s=>s.type===e);Z.exceedsLimit=(t,e,s=1,r)=>r===!1||!Z.isInteger(t)||!Z.isInteger(e)?!1:(Number(e)-Number(t))/Number(s)>=r;Z.escapeNode=(t,e=0,s)=>{let r=t.nodes[e];r&&(s&&r.type===s||r.type==="open"||r.type==="close")&&r.escaped!==!0&&(r.value="\\"+r.value,r.escaped=!0)};Z.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);Z.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;Z.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;Z.reduce=t=>t.reduce((e,s)=>(s.type==="text"&&e.push(s.value),s.type==="range"&&(s.type="text"),e),[]);Z.flatten=(...t)=>{let e=[],s=r=>{for(let n=0;n<r.length;n++){let o=r[n];Array.isArray(o)?s(o,e):o!==void 0&&e.push(o)}return e};return s(t),e}});var Ve=v((Sc,Xs)=>{"use strict";var zs=Ke();Xs.exports=(t,e={})=>{let s=(r,n={})=>{let o=e.escapeInvalid&&zs.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a="";if(r.value)return(o||i)&&zs.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(let c of r.nodes)a+=s(c);return a};return s(t)}});var Zs=v((Tc,Qs)=>{"use strict";Qs.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var ar=v((Cc,or)=>{"use strict";var Js=Zs(),ue=(t,e,s)=>{if(Js(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Js(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...s};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let n=String(r.relaxZeros),o=String(r.shorthand),i=String(r.capture),a=String(r.wrap),c=t+":"+e+"="+n+o+i+a;if(ue.cache.hasOwnProperty(c))return ue.cache[c].result;let u=Math.min(t,e),f=Math.max(t,e);if(Math.abs(u-f)===1){let w=t+"|"+e;return r.capture?`(${w})`:r.wrap===!1?w:`(?:${w})`}let h=ir(t)||ir(e),l={min:t,max:e,a:u,b:f},m=[],y=[];if(h&&(l.isPadded=h,l.maxLen=String(l.max).length),u<0){let w=f<0?Math.abs(f):1;y=er(w,Math.abs(u),l,r),u=l.a=0}return f>=0&&(m=er(u,f,l,r)),l.negatives=y,l.positives=m,l.result=Hi(y,m,r),r.capture===!0?l.result=`(${l.result})`:r.wrap!==!1&&m.length+y.length>1&&(l.result=`(?:${l.result})`),ue.cache[c]=l,l.result};function Hi(t,e,s){let r=St(t,e,"-",!1,s)||[],n=St(e,t,"",!1,s)||[],o=St(t,e,"-?",!0,s)||[];return r.concat(o).concat(n).join("|")}function Di(t,e){let s=1,r=1,n=sr(t,s),o=new Set([e]);for(;t<=n&&n<=e;)o.add(n),s+=1,n=sr(t,s);for(n=rr(e+1,r)-1;t<n&&n<=e;)o.add(n),r+=1,n=rr(e+1,r)-1;return o=[...o],o.sort(Mi),o}function Fi(t,e,s){if(t===e)return{pattern:t,count:[],digits:0};let r=$i(t,e),n=r.length,o="",i=0;for(let a=0;a<n;a++){let[c,u]=r[a];c===u?o+=c:c!=="0"||u!=="9"?o+=Ui(c,u,s):i++}return i&&(o+=s.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[i],digits:n}}function er(t,e,s,r){let n=Di(t,e),o=[],i=t,a;for(let c=0;c<n.length;c++){let u=n[c],f=Fi(String(i),String(u),r),h="";if(!s.isPadded&&a&&a.pattern===f.pattern){a.count.length>1&&a.count.pop(),a.count.push(f.count[0]),a.string=a.pattern+nr(a.count),i=u+1;continue}s.isPadded&&(h=Wi(u,s,r)),f.string=h+f.pattern+nr(f.count),o.push(f),i=u+1,a=f}return o}function St(t,e,s,r,n){let o=[];for(let i of t){let{string:a}=i;!r&&!tr(e,"string",a)&&o.push(s+a),r&&tr(e,"string",a)&&o.push(s+a)}return o}function $i(t,e){let s=[];for(let r=0;r<t.length;r++)s.push([t[r],e[r]]);return s}function Mi(t,e){return t>e?1:e>t?-1:0}function tr(t,e,s){return t.some(r=>r[e]===s)}function sr(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function rr(t,e){return t-t%Math.pow(10,e)}function nr(t){let[e=0,s=""]=t;return s||e>1?`{${e+(s?","+s:"")}}`:""}function Ui(t,e,s){return`[${t}${e-t===1?"":"-"}${e}]`}function ir(t){return/^-?(0+)\d/.test(t)}function Wi(t,e,s){if(!e.isPadded)return t;let r=Math.abs(e.maxLen-String(t).length),n=s.relaxZeros!==!1;switch(r){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${r}}`:`0{${r}}`}}ue.cache={};ue.clearCache=()=>ue.cache={};or.exports=ue});var xt=v((xc,_r)=>{"use strict";var Bi=H("util"),ur=ar(),cr=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Gi=t=>e=>t===!0?Number(e):String(e),Tt=t=>typeof t=="number"||typeof t=="string"&&t!=="",Ce=t=>Number.isInteger(+t),Ct=t=>{let e=`${t}`,s=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++s]==="0";);return s>0},qi=(t,e,s)=>typeof t=="string"||typeof e=="string"?!0:s.stringify===!0,Ki=(t,e,s)=>{if(e>0){let r=t[0]==="-"?"-":"";r&&(t=t.slice(1)),t=r+t.padStart(r?e-1:e,"0")}return s===!1?String(t):t},lr=(t,e)=>{let s=t[0]==="-"?"-":"";for(s&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return s?"-"+t:t},Vi=(t,e)=>{t.negatives.sort((i,a)=>i<a?-1:i>a?1:0),t.positives.sort((i,a)=>i<a?-1:i>a?1:0);let s=e.capture?"":"?:",r="",n="",o;return t.positives.length&&(r=t.positives.join("|")),t.negatives.length&&(n=`-(${s}${t.negatives.join("|")})`),r&&n?o=`${r}|${n}`:o=r||n,e.wrap?`(${s}${o})`:o},fr=(t,e,s,r)=>{if(s)return ur(t,e,{wrap:!1,...r});let n=String.fromCharCode(t);if(t===e)return n;let o=String.fromCharCode(e);return`[${n}-${o}]`},hr=(t,e,s)=>{if(Array.isArray(t)){let r=s.wrap===!0,n=s.capture?"":"?:";return r?`(${n}${t.join("|")})`:t.join("|")}return ur(t,e,s)},dr=(...t)=>new RangeError("Invalid range arguments: "+Bi.inspect(...t)),pr=(t,e,s)=>{if(s.strictRanges===!0)throw dr([t,e]);return[]},ji=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},Yi=(t,e,s=1,r={})=>{let n=Number(t),o=Number(e);if(!Number.isInteger(n)||!Number.isInteger(o)){if(r.strictRanges===!0)throw dr([t,e]);return[]}n===0&&(n=0),o===0&&(o=0);let i=n>o,a=String(t),c=String(e),u=String(s);s=Math.max(Math.abs(s),1);let f=Ct(a)||Ct(c)||Ct(u),h=f?Math.max(a.length,c.length,u.length):0,l=f===!1&&qi(t,e,r)===!1,m=r.transform||Gi(l);if(r.toRegex&&s===1)return fr(lr(t,h),lr(e,h),!0,r);let y={negatives:[],positives:[]},w=D=>y[D<0?"negatives":"positives"].push(Math.abs(D)),S=[],x=0;for(;i?n>=o:n<=o;)r.toRegex===!0&&s>1?w(n):S.push(Ki(m(n,x),h,l)),n=i?n-s:n+s,x++;return r.toRegex===!0?s>1?Vi(y,r):hr(S,null,{wrap:!1,...r}):S},zi=(t,e,s=1,r={})=>{if(!Ce(t)&&t.length>1||!Ce(e)&&e.length>1)return pr(t,e,r);let n=r.transform||(l=>String.fromCharCode(l)),o=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),a=o>i,c=Math.min(o,i),u=Math.max(o,i);if(r.toRegex&&s===1)return fr(c,u,!1,r);let f=[],h=0;for(;a?o>=i:o<=i;)f.push(n(o,h)),o=a?o-s:o+s,h++;return r.toRegex===!0?hr(f,null,{wrap:!1,options:r}):f},je=(t,e,s,r={})=>{if(e==null&&Tt(t))return[t];if(!Tt(t)||!Tt(e))return pr(t,e,r);if(typeof s=="function")return je(t,e,1,{transform:s});if(cr(s))return je(t,e,0,s);let n={...r};return n.capture===!0&&(n.wrap=!0),s=s||n.step||1,Ce(s)?Ce(t)&&Ce(e)?Yi(t,e,s,n):zi(t,e,Math.max(Math.abs(s),1),n):s!=null&&!cr(s)?ji(s,n):je(t,e,1,s)};_r.exports=je});var mr=v((bc,gr)=>{"use strict";var Xi=xt(),Er=Ke(),Qi=(t,e={})=>{let s=(r,n={})=>{let o=Er.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a=o===!0||i===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(r.isOpen===!0||r.isClose===!0)return c+r.value;if(r.type==="open")return a?c+r.value:"(";if(r.type==="close")return a?c+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":a?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let f=Er.reduce(r.nodes),h=Xi(...f,{...e,wrap:!1,toRegex:!0});if(h.length!==0)return f.length>1&&h.length>1?`(${h})`:h}if(r.nodes)for(let f of r.nodes)u+=s(f,r);return u};return s(t)};gr.exports=Qi});var wr=v((Ic,Rr)=>{"use strict";var Zi=xt(),yr=Ve(),me=Ke(),fe=(t="",e="",s=!1)=>{let r=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return s?me.flatten(e).map(n=>`{${n}}`):e;for(let n of t)if(Array.isArray(n))for(let o of n)r.push(fe(o,e,s));else for(let o of e)s===!0&&typeof o=="string"&&(o=`{${o}}`),r.push(Array.isArray(o)?fe(n,o,s):n+o);return me.flatten(r)},Ji=(t,e={})=>{let s=e.rangeLimit===void 0?1e3:e.rangeLimit,r=(n,o={})=>{n.queue=[];let i=o,a=o.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,a=i.queue;if(n.invalid||n.dollar){a.push(fe(a.pop(),yr(n,e)));return}if(n.type==="brace"&&n.invalid!==!0&&n.nodes.length===2){a.push(fe(a.pop(),["{}"]));return}if(n.nodes&&n.ranges>0){let h=me.reduce(n.nodes);if(me.exceedsLimit(...h,e.step,s))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=Zi(...h,e);l.length===0&&(l=yr(n,e)),a.push(fe(a.pop(),l)),n.nodes=[];return}let c=me.encloseBrace(n),u=n.queue,f=n;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,u=f.queue;for(let h=0;h<n.nodes.length;h++){let l=n.nodes[h];if(l.type==="comma"&&n.type==="brace"){h===1&&u.push(""),u.push("");continue}if(l.type==="close"){a.push(fe(a.pop(),u,c));continue}if(l.value&&l.type!=="open"){u.push(fe(u.pop(),l.value));continue}l.nodes&&r(l,n)}return u};return me.flatten(r(t))};Rr.exports=Ji});var Sr=v((vc,Ar)=>{"use strict";Ar.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
2
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Ir=v((kc,br)=>{"use strict";var eo=Ve(),{MAX_LENGTH:Tr,CHAR_BACKSLASH:bt,CHAR_BACKTICK:to,CHAR_COMMA:so,CHAR_DOT:ro,CHAR_LEFT_PARENTHESES:no,CHAR_RIGHT_PARENTHESES:io,CHAR_LEFT_CURLY_BRACE:oo,CHAR_RIGHT_CURLY_BRACE:ao,CHAR_LEFT_SQUARE_BRACKET:Cr,CHAR_RIGHT_SQUARE_BRACKET:xr,CHAR_DOUBLE_QUOTE:co,CHAR_SINGLE_QUOTE:lo,CHAR_NO_BREAK_SPACE:uo,CHAR_ZERO_WIDTH_NOBREAK_SPACE:fo}=Sr(),ho=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let s=e||{},r=typeof s.maxLength=="number"?Math.min(Tr,s.maxLength):Tr;if(t.length>r)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${r})`);let n={type:"root",input:t,nodes:[]},o=[n],i=n,a=n,c=0,u=t.length,f=0,h=0,l,m={},y=()=>t[f++],w=S=>{if(S.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&S.type==="text"){a.value+=S.value;return}return i.nodes.push(S),S.parent=i,S.prev=a,a=S,S};for(w({type:"bos"});f<u;)if(i=o[o.length-1],l=y(),!(l===fo||l===uo)){if(l===bt){w({type:"text",value:(e.keepEscaping?l:"")+y()});continue}if(l===xr){w({type:"text",value:"\\"+l});continue}if(l===Cr){c++;let S=!0,x;for(;f<u&&(x=y());){if(l+=x,x===Cr){c++;continue}if(x===bt){l+=y();continue}if(x===xr&&(c--,c===0))break}w({type:"text",value:l});continue}if(l===no){i=w({type:"paren",nodes:[]}),o.push(i),w({type:"text",value:l});continue}if(l===io){if(i.type!=="paren"){w({type:"text",value:l});continue}i=o.pop(),w({type:"text",value:l}),i=o[o.length-1];continue}if(l===co||l===lo||l===to){let S=l,x;for(e.keepQuotes!==!0&&(l="");f<u&&(x=y());){if(x===bt){l+=x+y();continue}if(x===S){e.keepQuotes===!0&&(l+=x);break}l+=x}w({type:"text",value:l});continue}if(l===oo){h++;let x={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||i.dollar===!0,depth:h,commas:0,ranges:0,nodes:[]};i=w(x),o.push(i),w({type:"open",value:l});continue}if(l===ao){if(i.type!=="brace"){w({type:"text",value:l});continue}let S="close";i=o.pop(),i.close=!0,w({type:S,value:l}),h--,i=o[o.length-1];continue}if(l===so&&h>0){if(i.ranges>0){i.ranges=0;let S=i.nodes.shift();i.nodes=[S,{type:"text",value:eo(i)}]}w({type:"comma",value:l}),i.commas++;continue}if(l===ro&&h>0&&i.commas===0){let S=i.nodes;if(h===0||S.length===0){w({type:"text",value:l});continue}if(a.type==="dot"){if(i.range=[],a.value+=l,a.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,a.type="text";continue}i.ranges++,i.args=[];continue}if(a.type==="range"){S.pop();let x=S[S.length-1];x.value+=a.value+l,a=x,i.ranges--;continue}w({type:"dot",value:l});continue}w({type:"text",value:l})}do if(i=o.pop(),i.type!=="root"){i.nodes.forEach(D=>{D.nodes||(D.type==="open"&&(D.isOpen=!0),D.type==="close"&&(D.isClose=!0),D.nodes||(D.type="text"),D.invalid=!0)});let S=o[o.length-1],x=S.nodes.indexOf(i);S.nodes.splice(x,1,...i.nodes)}while(o.length>0);return w({type:"eos"}),n};br.exports=ho});var Nr=v((Nc,kr)=>{"use strict";var vr=Ve(),po=mr(),_o=wr(),Eo=Ir(),Q=(t,e={})=>{let s=[];if(Array.isArray(t))for(let r of t){let n=Q.create(r,e);Array.isArray(n)?s.push(...n):s.push(n)}else s=[].concat(Q.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(s=[...new Set(s)]),s};Q.parse=(t,e={})=>Eo(t,e);Q.stringify=(t,e={})=>vr(typeof t=="string"?Q.parse(t,e):t,e);Q.compile=(t,e={})=>(typeof t=="string"&&(t=Q.parse(t,e)),po(t,e));Q.expand=(t,e={})=>{typeof t=="string"&&(t=Q.parse(t,e));let s=_o(t,e);return e.noempty===!0&&(s=s.filter(Boolean)),e.nodupes===!0&&(s=[...new Set(s)]),s};Q.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Q.compile(t,e):Q.expand(t,e);kr.exports=Q});var Pr=v((Pc,go)=>{go.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var Lr=v((Oc,Or)=>{Or.exports=Pr()});var Dr=v((Lc,Hr)=>{"use strict";var mo=H("path"),yo=Lr(),Ro=new Set(yo);Hr.exports=t=>Ro.has(mo.extname(t).slice(1).toLowerCase())});var Ye=v(R=>{"use strict";var{sep:wo}=H("path"),{platform:It}=process,Ao=H("os");R.EV_ALL="all";R.EV_READY="ready";R.EV_ADD="add";R.EV_CHANGE="change";R.EV_ADD_DIR="addDir";R.EV_UNLINK="unlink";R.EV_UNLINK_DIR="unlinkDir";R.EV_RAW="raw";R.EV_ERROR="error";R.STR_DATA="data";R.STR_END="end";R.STR_CLOSE="close";R.FSEVENT_CREATED="created";R.FSEVENT_MODIFIED="modified";R.FSEVENT_DELETED="deleted";R.FSEVENT_MOVED="moved";R.FSEVENT_CLONED="cloned";R.FSEVENT_UNKNOWN="unknown";R.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;R.FSEVENT_TYPE_FILE="file";R.FSEVENT_TYPE_DIRECTORY="directory";R.FSEVENT_TYPE_SYMLINK="symlink";R.KEY_LISTENERS="listeners";R.KEY_ERR="errHandlers";R.KEY_RAW="rawEmitters";R.HANDLER_KEYS=[R.KEY_LISTENERS,R.KEY_ERR,R.KEY_RAW];R.DOT_SLASH=`.${wo}`;R.BACK_SLASH_RE=/\\/g;R.DOUBLE_SLASH_RE=/\/\//;R.SLASH_OR_BACK_SLASH_RE=/[/\\]/;R.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;R.REPLACER_RE=/^\.[/\\]/;R.SLASH="/";R.SLASH_SLASH="//";R.BRACE_START="{";R.BANG="!";R.ONE_DOT=".";R.TWO_DOTS="..";R.STAR="*";R.GLOBSTAR="**";R.ROOT_GLOBSTAR="/**/*";R.SLASH_GLOBSTAR="/**";R.DIR_SUFFIX="Dir";R.ANYMATCH_OPTS={dot:!0};R.STRING_TYPE="string";R.FUNCTION_TYPE="function";R.EMPTY_STR="";R.EMPTY_FN=()=>{};R.IDENTITY_FN=t=>t;R.isWindows=It==="win32";R.isMacos=It==="darwin";R.isLinux=It==="linux";R.isIBMi=Ao.type()==="OS400"});var Br=v((Dc,Wr)=>{"use strict";var ie=H("fs"),W=H("path"),{promisify:ve}=H("util"),So=Dr(),{isWindows:To,isLinux:Co,EMPTY_FN:xo,EMPTY_STR:bo,KEY_LISTENERS:ye,KEY_ERR:vt,KEY_RAW:xe,HANDLER_KEYS:Io,EV_CHANGE:Xe,EV_ADD:ze,EV_ADD_DIR:vo,EV_ERROR:$r,STR_DATA:ko,STR_END:No,BRACE_START:Po,STAR:Oo}=Ye(),Lo="watch",Ho=ve(ie.open),Mr=ve(ie.stat),Do=ve(ie.lstat),Fo=ve(ie.close),kt=ve(ie.realpath),$o={lstat:Do,stat:Mr},Pt=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},be=(t,e,s)=>{let r=t[e];r instanceof Set||(t[e]=r=new Set([r])),r.add(s)},Mo=t=>e=>{let s=t[e];s instanceof Set?s.clear():delete t[e]},Ie=(t,e,s)=>{let r=t[e];r instanceof Set?r.delete(s):r===s&&delete t[e]},Ur=t=>t instanceof Set?t.size===0:!t,Qe=new Map;function Fr(t,e,s,r,n){let o=(i,a)=>{s(t),n(i,a,{watchedPath:t}),a&&t!==a&&Ze(W.resolve(t,a),ye,W.join(t,a))};try{return ie.watch(t,e,o)}catch(i){r(i)}}var Ze=(t,e,s,r,n)=>{let o=Qe.get(t);o&&Pt(o[e],i=>{i(s,r,n)})},Uo=(t,e,s,r)=>{let{listener:n,errHandler:o,rawEmitter:i}=r,a=Qe.get(e),c;if(!s.persistent)return c=Fr(t,s,n,o,i),c.close.bind(c);if(a)be(a,ye,n),be(a,vt,o),be(a,xe,i);else{if(c=Fr(t,s,Ze.bind(null,e,ye),o,Ze.bind(null,e,xe)),!c)return;c.on($r,async u=>{let f=Ze.bind(null,e,vt);if(a.watcherUnusable=!0,To&&u.code==="EPERM")try{let h=await Ho(t,"r");await Fo(h),f(u)}catch{}else f(u)}),a={listeners:n,errHandlers:o,rawEmitters:i,watcher:c},Qe.set(e,a)}return()=>{Ie(a,ye,n),Ie(a,vt,o),Ie(a,xe,i),Ur(a.listeners)&&(a.watcher.close(),Qe.delete(e),Io.forEach(Mo(a)),a.watcher=void 0,Object.freeze(a))}},Nt=new Map,Wo=(t,e,s,r)=>{let{listener:n,rawEmitter:o}=r,i=Nt.get(e),a=new Set,c=new Set,u=i&&i.options;return u&&(u.persistent<s.persistent||u.interval>s.interval)&&(a=i.listeners,c=i.rawEmitters,ie.unwatchFile(e),i=void 0),i?(be(i,ye,n),be(i,xe,o)):(i={listeners:n,rawEmitters:o,options:s,watcher:ie.watchFile(e,s,(f,h)=>{Pt(i.rawEmitters,m=>{m(Xe,e,{curr:f,prev:h})});let l=f.mtimeMs;(f.size!==h.size||l>h.mtimeMs||l===0)&&Pt(i.listeners,m=>m(t,f))})},Nt.set(e,i)),()=>{Ie(i,ye,n),Ie(i,xe,o),Ur(i.listeners)&&(Nt.delete(e),ie.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}},Ot=class{constructor(e){this.fsw=e,this._boundHandleError=s=>e._handleError(s)}_watchWithNodeFs(e,s){let r=this.fsw.options,n=W.dirname(e),o=W.basename(e);this.fsw._getWatchedDir(n).add(o);let a=W.resolve(e),c={persistent:r.persistent};s||(s=xo);let u;return r.usePolling?(c.interval=r.enableBinaryInterval&&So(o)?r.binaryInterval:r.interval,u=Wo(e,a,c,{listener:s,rawEmitter:this.fsw._emitRaw})):u=Uo(e,a,c,{listener:s,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),u}_handleFile(e,s,r){if(this.fsw.closed)return;let n=W.dirname(e),o=W.basename(e),i=this.fsw._getWatchedDir(n),a=s;if(i.has(o))return;let c=async(f,h)=>{if(this.fsw._throttle(Lo,e,5)){if(!h||h.mtimeMs===0)try{let l=await Mr(e);if(this.fsw.closed)return;let m=l.atimeMs,y=l.mtimeMs;(!m||m<=y||y!==a.mtimeMs)&&this.fsw._emit(Xe,e,l),Co&&a.ino!==l.ino?(this.fsw._closeFile(f),a=l,this.fsw._addPathCloser(f,this._watchWithNodeFs(e,c))):a=l}catch{this.fsw._remove(n,o)}else if(i.has(o)){let l=h.atimeMs,m=h.mtimeMs;(!l||l<=m||m!==a.mtimeMs)&&this.fsw._emit(Xe,e,h),a=h}}},u=this._watchWithNodeFs(e,c);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(ze,e,0))return;this.fsw._emit(ze,e,s)}return u}async _handleSymlink(e,s,r,n){if(this.fsw.closed)return;let o=e.fullPath,i=this.fsw._getWatchedDir(s);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await kt(r)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(n)?this.fsw._symlinkPaths.get(o)!==a&&(this.fsw._symlinkPaths.set(o,a),this.fsw._emit(Xe,r,e.stats)):(i.add(n),this.fsw._symlinkPaths.set(o,a),this.fsw._emit(ze,r,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(o))return!0;this.fsw._symlinkPaths.set(o,!0)}_handleRead(e,s,r,n,o,i,a){if(e=W.join(e,bo),!r.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(r.path),u=new Set,f=this.fsw._readdirp(e,{fileFilter:h=>r.filterPath(h),directoryFilter:h=>r.filterDir(h),depth:0}).on(ko,async h=>{if(this.fsw.closed){f=void 0;return}let l=h.path,m=W.join(e,l);if(u.add(l),!(h.stats.isSymbolicLink()&&await this._handleSymlink(h,e,m,l))){if(this.fsw.closed){f=void 0;return}(l===n||!n&&!c.has(l))&&(this.fsw._incrReadyCount(),m=W.join(o,W.relative(o,m)),this._addToNodeFs(m,s,r,i+1))}}).on($r,this._boundHandleError);return new Promise(h=>f.once(No,()=>{if(this.fsw.closed){f=void 0;return}let l=a?a.clear():!1;h(),c.getChildren().filter(m=>m!==e&&!u.has(m)&&(!r.hasGlob||r.filterPath({fullPath:W.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m)}),f=void 0,l&&this._handleRead(e,!1,r,n,o,i,a)}))}async _handleDir(e,s,r,n,o,i,a){let c=this.fsw._getWatchedDir(W.dirname(e)),u=c.has(W.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!o&&!u&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(vo,e,s),c.add(W.basename(e)),this.fsw._getWatchedDir(e);let f,h,l=this.fsw.options.depth;if((l==null||n<=l)&&!this.fsw._symlinkPaths.has(a)){if(!o&&(await this._handleRead(e,r,i,o,e,n,f),this.fsw.closed))return;h=this._watchWithNodeFs(e,(m,y)=>{y&&y.mtimeMs===0||this._handleRead(m,!1,i,o,e,n,f)})}return h}async _addToNodeFs(e,s,r,n,o){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let a=this.fsw._getWatchHelpers(e,n);!a.hasGlob&&r&&(a.hasGlob=r.hasGlob,a.globFilter=r.globFilter,a.filterPath=c=>r.filterPath(c),a.filterDir=c=>r.filterDir(c));try{let c=await $o[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return i(),!1;let u=this.fsw.options.followSymlinks&&!e.includes(Oo)&&!e.includes(Po),f;if(c.isDirectory()){let h=W.resolve(e),l=u?await kt(e):e;if(this.fsw.closed||(f=await this._handleDir(a.watchPath,c,s,n,o,a,l),this.fsw.closed))return;h!==l&&l!==void 0&&this.fsw._symlinkPaths.set(h,l)}else if(c.isSymbolicLink()){let h=u?await kt(e):e;if(this.fsw.closed)return;let l=W.dirname(a.watchPath);if(this.fsw._getWatchedDir(l).add(a.watchPath),this.fsw._emit(ze,a.watchPath,c),f=await this._handleDir(l,c,s,n,e,a,h),this.fsw.closed)return;h!==void 0&&this.fsw._symlinkPaths.set(W.resolve(e),h)}else f=this._handleFile(a.watchPath,c,s);return i(),this.fsw._addPathCloser(e,f),!1}catch(c){if(this.fsw._handleError(c))return i(),e}}};Wr.exports=Ot});var zr=v((Fc,Wt)=>{"use strict";var Mt=H("fs"),B=H("path"),{promisify:Ut}=H("util"),Re;try{Re=H("fsevents")}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(Re){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),s=Number.parseInt(t[2],10);e===8&&s<16&&(Re=void 0)}}var{EV_ADD:Lt,EV_CHANGE:Bo,EV_ADD_DIR:Gr,EV_UNLINK:Je,EV_ERROR:Go,STR_DATA:qo,STR_END:Ko,FSEVENT_CREATED:Vo,FSEVENT_MODIFIED:jo,FSEVENT_DELETED:Yo,FSEVENT_MOVED:zo,FSEVENT_UNKNOWN:Xo,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:Qo,FSEVENT_TYPE_FILE:Zo,FSEVENT_TYPE_DIRECTORY:ke,FSEVENT_TYPE_SYMLINK:Yr,ROOT_GLOBSTAR:qr,DIR_SUFFIX:Jo,DOT_SLASH:Kr,FUNCTION_TYPE:Ht,EMPTY_FN:ea,IDENTITY_FN:ta}=Ye(),sa=t=>isNaN(t)?{}:{depth:t},Ft=Ut(Mt.stat),ra=Ut(Mt.lstat),Vr=Ut(Mt.realpath),na={stat:Ft,lstat:ra},he=new Map,ia=10,oa=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),aa=(t,e)=>({stop:Re.watch(t,e)});function ca(t,e,s,r){let n=B.extname(e)?B.dirname(e):e,o=B.dirname(n),i=he.get(n);la(o)&&(n=o);let a=B.resolve(t),c=a!==e,u=(h,l,m)=>{c&&(h=h.replace(e,a)),(h===a||!h.indexOf(a+B.sep))&&s(h,l,m)},f=!1;for(let h of he.keys())if(e.indexOf(B.resolve(h)+B.sep)===0){n=h,i=he.get(n),f=!0;break}return i||f?i.listeners.add(u):(i={listeners:new Set([u]),rawEmitter:r,watcher:aa(n,(h,l)=>{if(!i.listeners.size||l&Qo)return;let m=Re.getInfo(h,l);i.listeners.forEach(y=>{y(h,l,m)}),i.rawEmitter(m.event,h,m)})},he.set(n,i)),()=>{let h=i.listeners;if(h.delete(u),!h.size&&(he.delete(n),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}var la=t=>{let e=0;for(let s of he.keys())if(s.indexOf(t)===0&&(e++,e>=ia))return!0;return!1},ua=()=>Re&&he.size<128,Dt=(t,e)=>{let s=0;for(;!t.indexOf(e)&&(t=B.dirname(t))!==e;)s++;return s},jr=(t,e)=>t.type===ke&&e.isDirectory()||t.type===Yr&&e.isSymbolicLink()||t.type===Zo&&e.isFile(),$t=class{constructor(e){this.fsw=e}checkIgnored(e,s){let r=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,s))return r.add(e),s&&s.isDirectory()&&r.add(e+qr),!0;r.delete(e),r.delete(e+qr)}addOrChange(e,s,r,n,o,i,a,c){let u=o.has(i)?Bo:Lt;this.handleEvent(u,e,s,r,n,o,i,a,c)}async checkExists(e,s,r,n,o,i,a,c){try{let u=await Ft(e);if(this.fsw.closed)return;jr(a,u)?this.addOrChange(e,s,r,n,o,i,a,c):this.handleEvent(Je,e,s,r,n,o,i,a,c)}catch(u){u.code==="EACCES"?this.addOrChange(e,s,r,n,o,i,a,c):this.handleEvent(Je,e,s,r,n,o,i,a,c)}}handleEvent(e,s,r,n,o,i,a,c,u){if(!(this.fsw.closed||this.checkIgnored(s)))if(e===Je){let f=c.type===ke;(f||i.has(a))&&this.fsw._remove(o,a,f)}else{if(e===Lt){if(c.type===ke&&this.fsw._getWatchedDir(s),c.type===Yr&&u.followSymlinks){let h=u.depth===void 0?void 0:Dt(r,n)+1;return this._addToFsEvents(s,!1,!0,h)}this.fsw._getWatchedDir(o).add(a)}let f=c.type===ke?e+Jo:e;this.fsw._emit(f,s),f===Gr&&this._addToFsEvents(s,!1,!0)}}_watchWithFsEvents(e,s,r,n){if(this.fsw.closed||this.fsw._isIgnored(e))return;let o=this.fsw.options,a=ca(e,s,async(c,u,f)=>{if(this.fsw.closed||o.depth!==void 0&&Dt(c,s)>o.depth)return;let h=r(B.join(e,B.relative(e,c)));if(n&&!n(h))return;let l=B.dirname(h),m=B.basename(h),y=this.fsw._getWatchedDir(f.type===ke?h:l);if(oa.has(u)||f.event===Xo)if(typeof o.ignored===Ht){let w;try{w=await Ft(h)}catch{}if(this.fsw.closed||this.checkIgnored(h,w))return;jr(f,w)?this.addOrChange(h,c,s,l,y,m,f,o):this.handleEvent(Je,h,c,s,l,y,m,f,o)}else this.checkExists(h,c,s,l,y,m,f,o);else switch(f.event){case Vo:case jo:return this.addOrChange(h,c,s,l,y,m,f,o);case Yo:case zo:return this.checkExists(h,c,s,l,y,m,f,o)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,s,r,n){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(s))){this.fsw._symlinkPaths.set(s,!0),this.fsw._incrReadyCount();try{let o=await Vr(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(o))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(o||e,i=>{let a=e;return o&&o!==Kr?a=i.replace(o,e):i!==Kr&&(a=B.join(e,i)),r(a)},!1,n)}catch(o){if(this.fsw._handleError(o))return this.fsw._emitReady()}}}emitAdd(e,s,r,n,o){let i=r(e),a=s.isDirectory(),c=this.fsw._getWatchedDir(B.dirname(i)),u=B.basename(i);a&&this.fsw._getWatchedDir(i),!c.has(u)&&(c.add(u),(!n.ignoreInitial||o===!0)&&this.fsw._emit(a?Gr:Lt,i,s))}initWatch(e,s,r,n){if(this.fsw.closed)return;let o=this._watchWithFsEvents(r.watchPath,B.resolve(e||r.watchPath),n,r.globFilter);this.fsw._addPathCloser(s,o)}async _addToFsEvents(e,s,r,n){if(this.fsw.closed)return;let o=this.fsw.options,i=typeof s===Ht?s:ta,a=this.fsw._getWatchHelpers(e);try{let c=await na[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(i(e),c,i,o,r),n&&n>o.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:u=>a.filterPath(u),directoryFilter:u=>a.filterDir(u),...sa(o.depth-(n||0))}).on(qo,u=>{if(this.fsw.closed||u.stats.isDirectory()&&!a.filterPath(u))return;let f=B.join(a.watchPath,u.path),{fullPath:h}=u;if(a.followSymlinks&&u.stats.isSymbolicLink()){let l=o.depth===void 0?void 0:Dt(f,B.resolve(a.watchPath))+1;this._handleFsEventsSymlink(f,h,i,l)}else this.emitAdd(f,u.stats,i,o,r)}).on(Go,ea).on(Ko,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,i,o,r),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(o.persistent&&r!==!0)if(typeof s===Ht)this.initWatch(void 0,e,a,i);else{let c;try{c=await Vr(a.watchPath)}catch{}this.initWatch(c,e,a,i)}}};Wt.exports=$t;Wt.exports.canUse=ua});var an=v(ss=>{"use strict";var{EventEmitter:fa}=H("events"),es=H("fs"),k=H("path"),{promisify:sn}=H("util"),ha=Hs(),jt=Bs().default,da=Ys(),Bt=wt(),pa=Nr(),_a=yt(),Ea=Br(),Xr=zr(),{EV_ALL:Gt,EV_READY:ga,EV_ADD:et,EV_CHANGE:Ne,EV_UNLINK:Qr,EV_ADD_DIR:ma,EV_UNLINK_DIR:ya,EV_RAW:Ra,EV_ERROR:qt,STR_CLOSE:wa,STR_END:Aa,BACK_SLASH_RE:Sa,DOUBLE_SLASH_RE:Zr,SLASH_OR_BACK_SLASH_RE:Ta,DOT_RE:Ca,REPLACER_RE:xa,SLASH:Kt,SLASH_SLASH:ba,BRACE_START:Ia,BANG:Yt,ONE_DOT:rn,TWO_DOTS:va,GLOBSTAR:ka,SLASH_GLOBSTAR:Vt,ANYMATCH_OPTS:zt,STRING_TYPE:ts,FUNCTION_TYPE:Na,EMPTY_STR:Xt,EMPTY_FN:Pa,isWindows:Oa,isMacos:La,isIBMi:Ha}=Ye(),Da=sn(es.stat),Fa=sn(es.readdir),Qt=(t=[])=>Array.isArray(t)?t:[t],nn=(t,e=[])=>(t.forEach(s=>{Array.isArray(s)?nn(s,e):e.push(s)}),e),Jr=t=>{let e=nn(Qt(t));if(!e.every(s=>typeof s===ts))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(on)},en=t=>{let e=t.replace(Sa,Kt),s=!1;for(e.startsWith(ba)&&(s=!0);e.match(Zr);)e=e.replace(Zr,Kt);return s&&(e=Kt+e),e},on=t=>en(k.normalize(en(t))),tn=(t=Xt)=>e=>typeof e!==ts?e:on(k.isAbsolute(e)?e:k.join(t,e)),$a=(t,e)=>k.isAbsolute(t)?t:t.startsWith(Yt)?Yt+k.join(e,t.slice(1)):k.join(e,t),J=(t,e)=>t[e]===void 0,Zt=class{constructor(e,s){this.path=e,this._removeWatcher=s,this.items=new Set}add(e){let{items:s}=this;s&&e!==rn&&e!==va&&s.add(e)}async remove(e){let{items:s}=this;if(!s||(s.delete(e),s.size>0))return;let r=this.path;try{await Fa(r)}catch{this._removeWatcher&&this._removeWatcher(k.dirname(r),k.basename(r))}}has(e){let{items:s}=this;if(s)return s.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},Ma="stat",Ua="lstat",Jt=class{constructor(e,s,r,n){this.fsw=n,this.path=e=e.replace(xa,Xt),this.watchPath=s,this.fullWatchPath=k.resolve(s),this.hasGlob=s!==e,e===Xt&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&r?void 0:!1,this.globFilter=this.hasGlob?jt(e,void 0,zt):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(o=>{o.length>1&&o.pop()}),this.followSymlinks=r,this.statMethod=r?Ma:Ua}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return k.join(this.watchPath,k.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:s}=e;if(s&&s.isSymbolicLink())return this.filterDir(e);let r=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===Na?this.globFilter(r):!0)&&this.fsw._isntIgnored(r,s)&&this.fsw._hasReadPermissions(s)}getDirParts(e){if(!this.hasGlob)return[];let s=[];return(e.includes(Ia)?pa.expand(e):[e]).forEach(n=>{s.push(k.relative(this.watchPath,n).split(Ta))}),s}filterDir(e){if(this.hasGlob){let s=this.getDirParts(this.checkGlobSymlink(e)),r=!1;this.unmatchedGlob=!this.dirParts.some(n=>n.every((o,i)=>(o===ka&&(r=!0),r||!s[0][i]||jt(o,s[0][i],zt))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},tt=class extends fa{constructor(e){super();let s={};e&&Object.assign(s,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,J(s,"persistent")&&(s.persistent=!0),J(s,"ignoreInitial")&&(s.ignoreInitial=!1),J(s,"ignorePermissionErrors")&&(s.ignorePermissionErrors=!1),J(s,"interval")&&(s.interval=100),J(s,"binaryInterval")&&(s.binaryInterval=300),J(s,"disableGlobbing")&&(s.disableGlobbing=!1),s.enableBinaryInterval=s.binaryInterval!==s.interval,J(s,"useFsEvents")&&(s.useFsEvents=!s.usePolling),Xr.canUse()||(s.useFsEvents=!1),J(s,"usePolling")&&!s.useFsEvents&&(s.usePolling=La),Ha&&(s.usePolling=!0);let n=process.env.CHOKIDAR_USEPOLLING;if(n!==void 0){let c=n.toLowerCase();c==="false"||c==="0"?s.usePolling=!1:c==="true"||c==="1"?s.usePolling=!0:s.usePolling=!!c}let o=process.env.CHOKIDAR_INTERVAL;o&&(s.interval=Number.parseInt(o,10)),J(s,"atomic")&&(s.atomic=!s.usePolling&&!s.useFsEvents),s.atomic&&(this._pendingUnlinks=new Map),J(s,"followSymlinks")&&(s.followSymlinks=!0),J(s,"awaitWriteFinish")&&(s.awaitWriteFinish=!1),s.awaitWriteFinish===!0&&(s.awaitWriteFinish={});let i=s.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),s.ignored&&(s.ignored=Qt(s.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=Pa,this._readyEmitted=!0,process.nextTick(()=>this.emit(ga)))},this._emitRaw=(...c)=>this.emit(Ra,...c),this._readyEmitted=!1,this.options=s,s.useFsEvents?this._fsEventsHandler=new Xr(this):this._nodeFsHandler=new Ea(this),Object.freeze(s)}add(e,s,r){let{cwd:n,disableGlobbing:o}=this.options;this.closed=!1;let i=Jr(e);return n&&(i=i.map(a=>{let c=$a(a,n);return o||!Bt(a)?c:_a(c)})),i=i.filter(a=>a.startsWith(Yt)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+Vt),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount+=i.length),i.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!r,0,0,s);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(k.dirname(c),k.basename(s||c))})})),this}unwatch(e){if(this.closed)return this;let s=Jr(e),{cwd:r}=this.options;return s.forEach(n=>{!k.isAbsolute(n)&&!this._closers.has(n)&&(r&&(n=k.join(r,n)),n=k.resolve(n)),this._closePath(n),this._ignoredPaths.add(n),this._watched.has(n)&&this._ignoredPaths.add(n+Vt),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(s=>s.forEach(r=>{let n=r();n instanceof Promise&&e.push(n)})),this._streams.forEach(s=>s.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(s=>s.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(s=>{this[`_${s}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((s,r)=>{let n=this.options.cwd?k.relative(this.options.cwd,r):r;e[n||rn]=s.getChildren().sort()}),e}emitWithAll(e,s){this.emit(...s),e!==qt&&this.emit(Gt,...s)}async _emit(e,s,r,n,o){if(this.closed)return;let i=this.options;Oa&&(s=k.normalize(s)),i.cwd&&(s=k.relative(i.cwd,s));let a=[e,s];o!==void 0?a.push(r,n,o):n!==void 0?a.push(r,n):r!==void 0&&a.push(r);let c=i.awaitWriteFinish,u;if(c&&(u=this._pendingWrites.get(s)))return u.lastChange=new Date,this;if(i.atomic){if(e===Qr)return this._pendingUnlinks.set(s,a),setTimeout(()=>{this._pendingUnlinks.forEach((f,h)=>{this.emit(...f),this.emit(Gt,...f),this._pendingUnlinks.delete(h)})},typeof i.atomic=="number"?i.atomic:100),this;e===et&&this._pendingUnlinks.has(s)&&(e=a[0]=Ne,this._pendingUnlinks.delete(s))}if(c&&(e===et||e===Ne)&&this._readyEmitted){let f=(h,l)=>{h?(e=a[0]=qt,a[1]=h,this.emitWithAll(e,a)):l&&(a.length>2?a[2]=l:a.push(l),this.emitWithAll(e,a))};return this._awaitWriteFinish(s,c.stabilityThreshold,e,f),this}if(e===Ne&&!this._throttle(Ne,s,50))return this;if(i.alwaysStat&&r===void 0&&(e===et||e===ma||e===Ne)){let f=i.cwd?k.join(i.cwd,s):s,h;try{h=await Da(f)}catch{}if(!h||this.closed)return;a.push(h)}return this.emitWithAll(e,a),this}_handleError(e){let s=e&&e.code;return e&&s!=="ENOENT"&&s!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||s!=="EPERM"&&s!=="EACCES")&&this.emit(qt,e),e||this.closed}_throttle(e,s,r){this._throttled.has(e)||this._throttled.set(e,new Map);let n=this._throttled.get(e),o=n.get(s);if(o)return o.count++,!1;let i,a=()=>{let u=n.get(s),f=u?u.count:0;return n.delete(s),clearTimeout(i),u&&clearTimeout(u.timeoutObject),f};i=setTimeout(a,r);let c={timeoutObject:i,clear:a,count:0};return n.set(s,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,s,r,n){let o,i=e;this.options.cwd&&!k.isAbsolute(e)&&(i=k.join(this.options.cwd,e));let a=new Date,c=u=>{es.stat(i,(f,h)=>{if(f||!this._pendingWrites.has(e)){f&&f.code!=="ENOENT"&&n(f);return}let l=Number(new Date);u&&h.size!==u.size&&(this._pendingWrites.get(e).lastChange=l);let m=this._pendingWrites.get(e);l-m.lastChange>=s?(this._pendingWrites.delete(e),n(void 0,h)):o=setTimeout(c,this.options.awaitWriteFinish.pollInterval,h)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(o),r)}),o=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,s){if(this.options.atomic&&Ca.test(e))return!0;if(!this._userIgnored){let{cwd:r}=this.options,n=this.options.ignored,o=n&&n.map(tn(r)),i=Qt(o).filter(c=>typeof c===ts&&!Bt(c)).map(c=>c+Vt),a=this._getGlobIgnored().map(tn(r)).concat(o,i);this._userIgnored=jt(a,void 0,zt)}return this._userIgnored([e,s])}_isntIgnored(e,s){return!this._isIgnored(e,s)}_getWatchHelpers(e,s){let r=s||this.options.disableGlobbing||!Bt(e)?e:da(e),n=this.options.followSymlinks;return new Jt(e,r,n,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let s=k.resolve(e);return this._watched.has(s)||this._watched.set(s,new Zt(s,this._boundRemove)),this._watched.get(s)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let r=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(r.toString(8)[0],10))}_remove(e,s,r){let n=k.join(e,s),o=k.resolve(n);if(r=r??(this._watched.has(n)||this._watched.has(o)),!this._throttle("remove",n,100))return;!r&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,s,!0),this._getWatchedDir(n).getChildren().forEach(l=>this._remove(n,l));let c=this._getWatchedDir(e),u=c.has(s);c.remove(s),this._symlinkPaths.has(o)&&this._symlinkPaths.delete(o);let f=n;if(this.options.cwd&&(f=k.relative(this.options.cwd,n)),this.options.awaitWriteFinish&&this._pendingWrites.has(f)&&this._pendingWrites.get(f).cancelWait()===et)return;this._watched.delete(n),this._watched.delete(o);let h=r?ya:Qr;u&&!this._isIgnored(n)&&this._emit(h,n),this.options.useFsEvents||this._closePath(n)}_closePath(e){this._closeFile(e);let s=k.dirname(e);this._getWatchedDir(s).remove(k.basename(e))}_closeFile(e){let s=this._closers.get(e);s&&(s.forEach(r=>r()),this._closers.delete(e))}_addPathCloser(e,s){if(!s)return;let r=this._closers.get(e);r||(r=[],this._closers.set(e,r)),r.push(s)}_readdirp(e,s){if(this.closed)return;let r={type:Gt,alwaysStat:!0,lstat:!0,...s},n=ha(e,r);return this._streams.add(n),n.once(wa,()=>{n=void 0}),n.once(Aa,()=>{n&&(this._streams.delete(n),n=void 0)}),n}};ss.FSWatcher=tt;var Wa=(t,e)=>{let s=new tt(e);return s.add(t),s};ss.watch=Wa});import"only-server";import"../common/index.mjs";var un=Nn(an(),1);import{fork as Ga}from"node:child_process";import{existsSync as cn,promises as qa}from"node:fs";import{basename as ns,dirname as os,join as is,relative as ln}from"node:path";import{build as Ka}from"esbuild";import{jwtDecode as Va}from"jwt-decode";import{Issuer as ja,custom as Ya}from"openid-client";import{Logger as za}from"@5minds/processcube_engine_sdk";import{EngineClient as Ba}from"@5minds/processcube_engine_client";var rs=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",N=new Ba(rs);var Xa={token:"ZHVtbXlfdG9rZW4=",userId:"dummy_token"},Qa=.85,st=["external_task.ts","external_task.js"],as=process.env.PROCESSCUBE_AUTHORITY_URL!==void 0,pe=new za("processcube_app_sdk:external_task_adapter"),de={},Pe;async function fn(t){if(t&&!cn(t))throw new Error(`Invalid customExternalTasksDirPath. The given path '${t}' does not exist`);Ya.setHttpOptionsDefaults({timeout:1e5});let e=await pn();Pe=await _n(e),await Ja(e);let s=tc(t);(0,un.watch)(s).on("add",async r=>{if(st.includes(ns(r)))return hn(r,s)}).on("change",async r=>{if(st.includes(ns(r)))return Za(r,s)}).on("unlink",async r=>{st.includes(ns(r))&&dn(r)}).on("error",r=>pe.error(`Watcher error: ${r}`))}async function hn(t,e){let s=os(t);if((await qa.readdir(s)).filter(f=>st.includes(f)).length>1){pe.error(`Multiple external task files found in directory ${s}. Stopping all external task workers for this directory.`),de[s]&&dn(t);return}let o=await En(t),i=ln(e,s),a=gn(i),c=is(__dirname,"lib/ExternalTaskWorkerProcess.cjs"),u=Ga(c,{env:{NODE_ENV:process.env.NODE_ENV,PROCESSCUBE_ENGINE_URL:rs}});de[s]=u,u.once("disconnect",()=>{delete de[s]}),u.send({action:"create",payload:{topic:a,identity:Pe,moduleString:o,workerPath:t}})}async function Za(t,e){let s=os(t),r=de[s];if(!r)return hn(t,e);let n=await En(t),o=ln(e,s),i=gn(o);r.send({action:"restart",payload:{topic:i,identity:Pe,moduleString:n,workerPath:t}})}function dn(t){let e=os(t),s=de[e];s&&s.kill()}async function pn(){if(!as)return null;if(!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID||!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET){let r=new Error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing. For help, please refer to our documentation on environment variables at: https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#authority");throw pe.error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing",{err:r}),r}let t=await ja.discover(process.env.PROCESSCUBE_AUTHORITY_URL);return await new t.Client({client_id:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID,client_secret:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET}).grant({grant_type:"client_credentials",scope:"engine_etw"})}function _n(t){if(!as||t===null)return Xa;let e=t.access_token,s=Va(e);return{token:t.access_token,userId:s.sub}}async function Ja(t){let e=5;if(!as||t===null)return;let r=await ec(t)*Qa*1e3,n=async()=>{try{let o=await pn();Pe=_n(o);for(let i of Object.values(de))i.send({action:"updateIdentity",payload:{identity:Pe}});e=5,setTimeout(n,r)}catch(o){if(e===0){pe.error("Could not refresh identity for external task worker processes. Stopping all external task workers.",{error:o});for(let a of Object.values(de))a.kill();return}pe.error("Could not refresh identity for external task worker processes.",{error:o,retryCount:e}),e--;let i=2*1e3;setTimeout(n,i)}};setTimeout(n,r)}async function En(t){let e=await Ka({entryPoints:[t],write:!1,bundle:!0,platform:"node",target:"node18",format:"cjs",external:["@opentelemetry/api"]});if(e.errors.length>0)throw pe.error(`Could not transpile file at '${t}'`,{errors:e.errors}),new Error(`Could not transpile file at '${t}'`);return e.warnings.length>0&&pe.warn(`Transpiled file at '${t}' with warnings`,{warnings:e.warnings}),e.outputFiles[0].text}async function ec(t){let e=t.expires_in;if(!e&&t.expires_at&&(e=Math.floor(t.expires_at-Date.now()/1e3)),e===void 0)throw new Error("Could not determine the time until the access token for external task workers expires");return e}function gn(t){return t.replace(/^\.\/+|\([^)]+\)|^\/*|\/*$/g,"").replace(/[\/]{2,}/g,"/")}function tc(t){let e,s=[t,is(process.cwd(),"app"),is(process.cwd(),"src","app")];for(let r of s)if(r&&cn(r)){e=r;break}if(!e)throw new Error("Could not find external tasks directory");return e}function el(){return N}import{getToken as mn}from"next-auth/jwt";import{ResponseCookies as sc}from"next/dist/compiled/@edge-runtime/cookies";import{cookies as rt,headers as yn}from"next/headers";var rc=process.env.NEXTAUTH_URL?.startsWith("https://"),Rn=`${rc?"__Secure-":""}next-auth.session-token`;async function il(){let t=await mn({req:{cookies:rt(),headers:yn()}});if(t?.expiresAt&&Date.now()>=t.expiresAt*1e3){let s=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:rt().toString()}}),r=new sc(s.headers),n=r.get(Rn);if(n){let o=!1;try{rt().set(Rn,n.value,{...n})}catch{o=!0}if(t=await mn({req:{cookies:o?r:rt(),headers:yn()}}),t?.error)throw t.error}}if(!t?.accessToken||!t?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:t?.accessToken,userId:t?.sub}}import{DataModels as nt}from"@5minds/processcube_engine_client";async function ll(t){return await N.processInstances.query({...t?.query,state:nt.ProcessInstances.ProcessInstanceState.running},t?.options)}async function ul(t){let{processInstanceId:e}=t;return new Promise(async(s,r)=>{let n=[],o=async i=>{if(e!==void 0&&i.processInstanceId!==e)return;let c=await N.processInstances.query({processInstanceId:i.processInstanceId});for(let u of n)N.notification.removeSubscription(u);return c.totalCount===0?r(new Error(`Process with instance ID "${i.processInstanceId}" does not exist.`)):s(c.processInstances[0])};if(n.push(await N.notification.onProcessEnded(o)),n.push(await N.notification.onProcessError(o)),n.push(await N.notification.onProcessTerminated(o)),e){let i=await N.processInstances.query({processInstanceId:e,state:[nt.ProcessInstances.ProcessInstanceState.finished,nt.ProcessInstances.ProcessInstanceState.terminated,nt.ProcessInstances.ProcessInstanceState.error]});if(i.totalCount>0){for(let a of n)N.notification.removeSubscription(a);s(i.processInstances[0])}}})}import{DataModels as oe}from"@5minds/processcube_engine_client";import{mapUserTask as wn,mapUserTaskList as _e}from"../common/index.mjs";async function gl(t={},e){let{correlationId:s,processInstanceId:r,flowNodeId:n}=t;return new Promise(async(o,i)=>{let a=await N.userTasks.onUserTaskWaiting(async u=>{let f=s!==void 0&&u.correlationId!==s,h=u.flowNodeInstanceId===void 0,l=r!==void 0&&u.processInstanceId!==r,m=n!==void 0&&u.flowNodeId!==n;if(f||h||l||m)return;let y=await ic(u.flowNodeInstanceId,{identity:e});return N.notification.removeSubscription(a,e),y===null?i(new Error(`UserTask with instance ID "${u.flowNodeInstanceId}" does not exist.`)):o(y)},{identity:e}),c=await nc({correlationId:s,processInstanceId:r,flowNodeId:n,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e});c.userTasks.length>0&&(N.notification.removeSubscription(a,e),o(c.userTasks[0]))})}async function ml(t,e={},s={},r){await N.userTasks.finishUserTask(t,s,r);let n={state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended,...e},o=await N.userTasks.query(n,{identity:r});return wn(o.userTasks[0])}async function nc(...t){let e=await N.userTasks.query(...t);return _e(e)}async function yl(t){let e=await N.userTasks.query({state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},t);return _e(e)}async function Rl(t,e){let s=await N.userTasks.query({processInstanceId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(s)}async function wl(t,e){let s=await N.userTasks.query({flowNodeId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(s)}async function ic(t,e){let s=await N.userTasks.query({flowNodeInstanceId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{...e,limit:1});return s.userTasks.length===0?null:wn(s.userTasks[0])}async function Al(t,e){let s=await N.userTasks.query({correlationId:t,state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(s)}async function Sl(t,e){let s=await N.userTasks.query({state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:t,...e}),r=s.userTasks.filter(n=>n.actualOwnerId===t.userId);return s.userTasks=r,_e(s)}async function Tl(t,e){let s=await N.userTasks.query({state:oe.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:t,...e}),r=s.userTasks.filter(n=>n.assignedUserIds?.includes(t.userId));return s.userTasks=r,_e(s)}import{PHASE_DEVELOPMENT_SERVER as oc,PHASE_PRODUCTION_SERVER as ac}from"next/dist/shared/lib/constants";var An=!1;function Hl(t={}){let{applicationSdk:e,...s}=t;return async(r,n)=>{let o=r===oc||r===ac;return e?.useExternalTasks&&o&&!An&&(An=!0,await fn(e?.customExternalTasksDirPath)),s}}import{revalidatePath as cc}from"next/cache";import{redirect as lc}from"next/navigation";function Wl(t){cc(t),lc(t)}async function ql(...t){return await N.processModels.startProcessInstance(...t)}async function jl(...t){await N.userTasks.finishUserTask(...t)}export{jl as finishUserTask,ml as finishUserTaskAndGetNext,ll as getActiveProcessInstances,Tl as getAssignedUserTasksByIdentity,el as getEngineClient,il as getIdentity,Sl as getReservedUserTasksByIdentity,nc as getUserTasks,ic as getWaitingUserTaskByFlowNodeInstanceId,yl as getWaitingUserTasks,Al as getWaitingUserTasksByCorrelationId,wl as getWaitingUserTasksByFlowNodeId,Rl as getWaitingUserTasksByProcessInstanceId,Wl as navigateToUrl,ql as startProcess,ul as waitForProcessEnd,gl as waitForUserTask,Hl as withApplicationSdk};
|
|
3
3
|
/*! Bundled license information:
|
|
4
4
|
|
|
5
5
|
normalize-path/index.js:
|
|
@@ -9,3 +9,14 @@ export declare function getActiveProcessInstances(query?: {
|
|
|
9
9
|
query?: Omit<DataModels.ProcessInstances.ProcessInstanceQuery, 'state'>;
|
|
10
10
|
options?: Parameters<typeof Client.processInstances.query>[1];
|
|
11
11
|
}): Promise<DataModels.ProcessInstances.ProcessInstanceList>;
|
|
12
|
+
/**
|
|
13
|
+
* This function will wait until a ProcessInstance is finished, terminated or errored.
|
|
14
|
+
* If the processInstance is already finished, it will instantly be returned.
|
|
15
|
+
*
|
|
16
|
+
* @param filterBy Additional filter options
|
|
17
|
+
* @param filterBy.processInstanceId The ID of the ProcessInstance to wait for
|
|
18
|
+
* @returns {Promise<DataModels.ProcessInstances.ProcessInstance>} The ProcessInstance.
|
|
19
|
+
*/
|
|
20
|
+
export declare function waitForProcessEnd(filterBy: {
|
|
21
|
+
processInstanceId?: string;
|
|
22
|
+
}): Promise<DataModels.ProcessInstances.ProcessInstance>;
|
package/package.json
CHANGED