diff --git a/.drone.env b/.drone.env index d8592750807..d09a2e87afc 100644 --- a/.drone.env +++ b/.drone.env @@ -1,3 +1,3 @@ # The version of OCIS to use in pipelines that test against OCIS -OCIS_COMMITID=49541e6cc244f933e1d42b0462664eb6f1ab4ad4 +OCIS_COMMITID=ee97594742b23550d1f35a1002a3d83700950622 OCIS_BRANCH=master diff --git a/.drone.star b/.drone.star index b22a061a746..7974ffef8ca 100644 --- a/.drone.star +++ b/.drone.star @@ -6,7 +6,6 @@ NOTIFICATIONS = 3 ALPINE_GIT = "alpine/git:latest" DEEPDRIVER_DOCKER_ORACLE_XE_11G = "deepdiver/docker-oracle-xe-11g:latest" DRONE_CLI_ALPINE = "drone/cli:alpine" -MELTWATER_DRONE_CACHE = "meltwater/drone-cache:v1" MINIO_MC = "minio/mc:RELEASE.2021-03-23T05-46-11Z" OC_CI_ALPINE = "owncloudci/alpine:latest" OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier" @@ -27,6 +26,7 @@ PLUGINS_GH_PAGES = "plugins/gh-pages:1" PLUGINS_GIT_ACTION = "plugins/git-action:1" PLUGINS_GITHUB_RELEASE = "plugins/github-release:1" PLUGINS_S3 = "plugins/s3" +PLUGINS_S3_CACHE = "plugins/s3-cache:1" PLUGINS_SLACK = "plugins/slack:1" SELENIUM_STANDALONE_CHROME_DEBUG = "selenium/standalone-chrome-debug:3.141.59" SELENIUM_STANDALONE_FIREFOX_DEBUG = "selenium/standalone-firefox-debug:3.141.59" @@ -174,7 +174,6 @@ config = { "EXPECTED_FAILURES_FILE": "%s/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md" % dir["web"], "WEB_UI_CONFIG": "%s/dist/config.json" % dir["web"], }, - "visualTesting": False, "screenShots": True, }, # These suites have all or most of their scenarios expected to fail. @@ -188,7 +187,6 @@ config = { "EXPECTED_FAILURES_FILE": "%s/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md" % dir["web"], "WEB_UI_CONFIG": "%s/dist/config.json" % dir["web"], }, - "visualTesting": False, "screenShots": True, "retry": False, }, @@ -205,7 +203,6 @@ config = { "EXPECTED_FAILURES_FILE": "%s/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md" % dir["web"], "WEB_UI_CONFIG": "%s/dist/config.json" % dir["web"], }, - "visualTesting": False, "screenShots": True, "notificationsAppNeeded": True, }, @@ -513,7 +510,6 @@ config = { "EXPECTED_FAILURES_FILE": "%s/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md" % dir["web"], }, "runningOnOCIS": True, - "visualTesting": False, "filterTags": "not @skip and not @skipOnOCIS and not @notToImplementOnOCIS", "screenShots": True, }, @@ -1262,7 +1258,6 @@ def acceptance(ctx): "federatedServerVersion": OC10_VERSION, "runningOnOCIS": False, "screenShots": False, - "visualTesting": False, "openIdConnect": False, "oc10IntegrationAppIncluded": False, "skip": False, @@ -1396,12 +1391,7 @@ def acceptance(ctx): steps += waitForMiddlewareService() # run the acceptance tests - steps += runWebuiAcceptanceTests(ctx, suite, alternateSuiteName, params["filterTags"], params["extraEnvironment"], params["visualTesting"], params["screenShots"], params["retry"]) - - # capture the screenshots from visual regression testing (only runs on failure) - if (params["visualTesting"]): - steps += listScreenShots() + uploadVisualDiff() + uploadVisualScreenShots() - steps += buildGithubCommentVisualDiff(ctx, suiteName, params["runningOnOCIS"]) + steps += runWebuiAcceptanceTests(ctx, suite, alternateSuiteName, params["filterTags"], params["extraEnvironment"], params["screenShots"], params["retry"]) # Capture the screenshots from acceptance tests (only runs on failure) if (params["screenShots"]): @@ -2164,6 +2154,7 @@ def ocisService(): "STORAGE_USERS_DRIVER_OWNCLOUD_DATADIR": "/srv/app/tmp/ocis/owncloud/data", "WEB_ASSET_PATH": "%s/dist" % dir["web"], "WEB_UI_CONFIG": "/srv/config/drone/config-ocis.json", + "FRONTEND_ENABLE_RESHARING": "true", }, "commands": [ "cd %s/ocis-build" % dir["base"], @@ -2347,7 +2338,7 @@ def copyFilesForUpload(): ], }] -def runWebuiAcceptanceTests(ctx, suite, alternateSuiteName, filterTags, extraEnvironment, visualTesting, screenShots, retry): +def runWebuiAcceptanceTests(ctx, suite, alternateSuiteName, filterTags, extraEnvironment, screenShots, retry): environment = {} if (filterTags != ""): environment["TEST_TAGS"] = filterTags @@ -2363,8 +2354,6 @@ def runWebuiAcceptanceTests(ctx, suite, alternateSuiteName, filterTags, extraEnv if (ctx.build.event == "cron") or (not retry): environment["RERUN_FAILED_WEBUI_SCENARIOS"] = "false" - if (visualTesting): - environment["VISUAL_TEST"] = "true" if (screenShots): environment["SCREENSHOTS"] = "true" environment["SERVER_HOST"] = "http://web" @@ -2578,134 +2567,6 @@ def uploadScreenshots(): }, }] -def listScreenShots(): - return [{ - "name": "list screenshots-visual", - "image": OC_CI_NODEJS, - "commands": [ - "ls -laR %s/tests/vrt" % dir["web"], - ], - "when": { - "status": [ - "failure", - ], - }, - }] - -def uploadVisualDiff(): - return [{ - "name": "upload-diff-screenshots", - "image": PLUGINS_S3, - "pull": "if-not-exists", - "settings": { - "bucket": { - "from_secret": "cache_public_s3_bucket", - }, - "endpoint": { - "from_secret": "cache_public_s3_server", - }, - "path_style": True, - "source": "%s/tests/vrt/diff/**/*" % dir["web"], - "strip_prefix": "%s/tests/vrt" % dir["web"], - "target": "/${DRONE_REPO}/${DRONE_BUILD_NUMBER}/vrt/screenshots", - }, - "environment": { - "AWS_ACCESS_KEY_ID": { - "from_secret": "cache_public_s3_access_key", - }, - "AWS_SECRET_ACCESS_KEY": { - "from_secret": "cache_public_s3_secret_key", - }, - }, - "when": { - "status": [ - "failure", - ], - "event": [ - "pull_request", - ], - }, - }] - -def uploadVisualScreenShots(): - return [{ - "name": "upload-latest-screenshots", - "image": PLUGINS_S3, - "pull": "if-not-exists", - "settings": { - "bucket": { - "from_secret": "cache_public_s3_bucket", - }, - "endpoint": { - "from_secret": "cache_public_s3_server", - }, - "path_style": True, - "source": "%s/tests/vrt/latest/**/*" % dir["web"], - "strip_prefix": "%s/tests/vrt" % dir["web"], - "target": "/${DRONE_REPO}/${DRONE_BUILD_NUMBER}/vrt/screenshots", - }, - "environment": { - "AWS_ACCESS_KEY_ID": { - "from_secret": "cache_public_s3_access_key", - }, - "AWS_SECRET_ACCESS_KEY": { - "from_secret": "cache_public_s3_secret_key", - }, - }, - "when": { - "status": [ - "failure", - ], - "event": [ - "pull_request", - ], - }, - }] - -def buildGithubCommentVisualDiff(ctx, suite, runningOnOCIS): - backend = "ocis" if runningOnOCIS else "oc10" - branch = ctx.build.source if ctx.build.event == "pull_request" else "master" - return [{ - "name": "build-github-comment-vrt", - "image": OC_UBUNTU, - "commands": [ - "cd %s/tests/vrt" % dir["web"], - "if [ ! -d diff ]; then exit 0; fi", - "cd diff", - "if [ ! -d %s ]; then exit 0; fi" % backend, - "cd %s" % backend, - "ls -la", - 'echo "
:boom: Visual regression tests failed. Please find the screenshots inside ...\\n\\n

\\n\\n" >> %s/comments.file' % dir["web"], - 'echo "Diff Image:
" >> %s/comments.file' % dir["web"], - 'for f in *.png; do echo \'!\'"[$f]($CACHE_ENDPOINT/$CACHE_BUCKET/${DRONE_REPO}/${DRONE_BUILD_NUMBER}/vrt/screenshots/diff/%s/$f)" >> %s/comments.file; done' % (backend, dir["web"]), - "cd ../../latest", - "cd %s" % backend, - 'echo "Actual Image:
" >> %s/comments.file' % dir["web"], - 'for f in *.png; do echo \'!\'"[$f]($CACHE_ENDPOINT/$CACHE_BUCKET/${DRONE_REPO}/${DRONE_BUILD_NUMBER}/vrt/screenshots/latest/%s/$f)" >> %s/comments.file; done' % (backend, dir["web"]), - 'echo "Comparing Against:
" >> %s/comments.file' % dir["web"], - 'for f in *.png; do echo \'!\'"[$f](https://raw.githubusercontent.com/owncloud/web/%s/tests/vrt/baseline/%s/$f)" >> %s/comments.file; done' % (branch, backend, dir["web"]), - 'echo "\n

" >> %s/comments.file' % dir["web"], - "more %s/comments.file" % dir["web"], - ], - "environment": { - "TEST_CONTEXT": suite, - "CACHE_ENDPOINT": { - "from_secret": "cache_public_s3_server", - }, - "CACHE_BUCKET": { - "from_secret": "cache_public_s3_bucket", - }, - }, - "when": { - "status": [ - "failure", - ], - "event": [ - "pull_request", - ], - }, - }] - def buildGithubComment(suite): return [{ "name": "build-github-comment", @@ -3063,7 +2924,7 @@ def skipIfUnchanged(ctx, type): return [] -def genericCache(name, action, mounts, cache_key): +def genericCache(name, action, mounts): rebuild = "false" restore = "false" if action == "rebuild": @@ -3075,31 +2936,25 @@ def genericCache(name, action, mounts, cache_key): step = { "name": "%s_%s" % (action, name), - "image": MELTWATER_DRONE_CACHE, - "environment": { - "AWS_ACCESS_KEY_ID": { - "from_secret": "cache_s3_access_key", - }, - "AWS_SECRET_ACCESS_KEY": { - "from_secret": "cache_s3_secret_key", - }, - }, + "image": PLUGINS_S3_CACHE, "settings": { "endpoint": { "from_secret": "cache_s3_endpoint", }, - "bucket": "cache", - "region": "us-east-1", # not used at all, but fails if not given! - "path_style": "true", - "cache_key": cache_key, "rebuild": rebuild, "restore": restore, "mount": mounts, + "access_key": { + "from_secret": "cache_s3_access_key", + }, + "secret_key": { + "from_secret": "cache_s3_secret_key", + }, }, } return step -def genericCachePurge(ctx, name, cache_key): +def genericCachePurge(ctx, name): return { "kind": "pipeline", "type": "docker", @@ -3111,16 +2966,20 @@ def genericCachePurge(ctx, name, cache_key): "steps": [ { "name": "purge-cache", - "image": MINIO_MC, - "failure": "ignore", - "environment": { - "MC_HOST_cache": { - "from_secret": "cache_s3_connection_url", + "image": PLUGINS_S3_CACHE, + "settings": { + "access_key": { + "from_secret": "cache_s3_access_key", + }, + "endpoint": { + "from_secret": "cache_s3_endpoint", + }, + "flush": True, + "flush_age": "14", + "secret_key": { + "from_secret": "cache_s3_secret_key", }, }, - "commands": [ - "mc rm --recursive --force cache/cache/%s/%s" % (ctx.repo.name, cache_key), - ], }, ], "trigger": { @@ -3138,11 +2997,10 @@ def genericCachePurge(ctx, name, cache_key): def genericBuildArtifactCache(ctx, name, action, path): name = "%s_build_artifact_cache" % (name) - cache_key = "%s/%s/%s" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}", name) if action == "rebuild" or action == "restore": - return genericCache(name, action, [path], cache_key) + return genericCache(name, action, [path]) if action == "purge": - return genericCachePurge(ctx, name, cache_key) + return genericCachePurge(ctx, name) return [] def restoreBuildArtifactCache(ctx, name, path): diff --git a/.gitignore b/.gitignore index 766e9d8214a..36f2c9a5b33 100644 --- a/.gitignore +++ b/.gitignore @@ -60,10 +60,6 @@ tests/acceptance/.yarn/* !tests/acceptance/.yarn/sdks !tests/acceptance/.yarn/versions -# visual regression testing artifacts -/tests/vrt/diff -/tests/vrt/latest - # acceptance test artifacts logfile.txt comments.file diff --git a/.yarn/releases/yarn-3.1.0.cjs b/.yarn/releases/yarn-3.1.0.cjs index 8584827cdbe..d7379ce02ba 100755 --- a/.yarn/releases/yarn-3.1.0.cjs +++ b/.yarn/releases/yarn-3.1.0.cjs @@ -43,7 +43,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e. `),type:zt.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}je.performRuntimeChecks=ZIe;function $Ie(t,e,r){var i=[],n=!1,s=(0,Ee.compact)((0,Ee.flatten)((0,Ee.mapValues)(t.modes,function(l){return l}))),o=(0,Ee.reject)(s,function(l){return l[ao]===zt.Lexer.NA}),a=tG(r);return e&&(0,Ee.forEach)(o,function(l){var c=eG(l,a);if(c!==!1){var u=gG(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,Ee.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,Eu.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS for details.`,type:zt.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}je.performWarningRuntimeChecks=$Ie;function eEe(t){var e={},r=(0,Ee.keys)(t);return(0,Ee.forEach)(r,function(i){var n=t[i];if((0,Ee.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}je.cloneEmptyGroups=eEe;function qv(t){var e=t.PATTERN;if((0,Ee.isRegExp)(e))return!1;if((0,Ee.isFunction)(e))return!0;if((0,Ee.has)(e,"exec"))return!0;if((0,Ee.isString)(e))return!1;throw Error("non exhaustive match")}je.isCustomPattern=qv;function $H(t){return(0,Ee.isString)(t)&&t.length===1?t.charCodeAt(0):!1}je.isShortPattern=$H;je.LineTerminatorOptimizedTester={test:function(t){for(var e=t.length,r=this.lastIndex;r Token Type `)+(" Root cause: "+e.errMsg+`. @@ -66,8 +66,8 @@ but found: '`+a+"'";if(n)return o+n+l;var c=(0,Rs.reduce)(e,function(h,p){return but found: '`+o+"'";if(i)return s+i+a;var l=(0,Rs.map)(e,function(u){return"["+(0,Rs.map)(u,function(g){return(0,Bu.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences:: `+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(aa.defaultParserErrorProvider);aa.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(t,e){var r="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+t.name+"<-";return r}};aa.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(t,e){function r(u){return u instanceof iS.Terminal?u.terminalType.name:u instanceof iS.NonTerminal?u.nonTerminalName:""}var i=t.name,n=(0,Rs.first)(e),s=n.idx,o=(0,_G.getProductionDslName)(n),a=r(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+` - appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` `),c},buildNamespaceConflictError:function(t){var e=`Namespace conflict found in grammar. `+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+t.name+`>. @@ -86,7 +86,7 @@ This could lead to an infinite loop.`;return r},buildTokenNameError:function(t){ `+(" inside <"+t.topLevelRule.name+`> Rule. has `+(t.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(t){var e=t.topLevelRule.name,r=FEe.map(t.leftRecursionPath,function(s){return s.name}),i=e+" --> "+r.concat([e]).join(" --> "),n=`Left Recursion found in grammar. `+("rule: <"+e+`> can be invoked from itself (directly or indirectly) -`)+(`without consuming any Tokens. The grammar path that causes this is: +`)+(`without consuming any Tokens. The grammar path that causes this is: `+i+` `)+` To fix this refactor your grammar to remove the left recursion. see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(t){return"deprecated"},buildDuplicateRuleNameError:function(t){var e;t.topLevelRule instanceof iS.Rule?e=t.topLevelRule.name:e=t.topLevelRule;var r="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+t.grammarName+"<-";return r}}});var $G=I(sA=>{"use strict";var NEe=sA&&sA.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(sA,"__esModule",{value:!0});sA.GastRefResolverVisitor=sA.resolveGrammar=void 0;var LEe=Tn(),XG=Dt(),TEe=wu();function MEe(t,e){var r=new ZG(t,e);return r.resolveRefs(),r.errors}sA.resolveGrammar=MEe;var ZG=function(t){NEe(e,t);function e(r,i){var n=t.call(this)||this;return n.nameToTopRule=r,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var r=this;(0,XG.forEach)((0,XG.values)(this.nameToTopRule),function(i){r.currTopLevel=i,i.accept(r)})},e.prototype.visitNonTerminal=function(r){var i=this.nameToTopRule[r.nonTerminalName];if(i)r.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,r);this.errors.push({message:n,type:LEe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:r.nonTerminalName})}},e}(TEe.GAstVisitor);sA.GastRefResolverVisitor=ZG});var Vh=I(Br=>{"use strict";var Fl=Br&&Br.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(Br,"__esModule",{value:!0});Br.nextPossibleTokensAfter=Br.possiblePathsFrom=Br.NextTerminalAfterAtLeastOneSepWalker=Br.NextTerminalAfterAtLeastOneWalker=Br.NextTerminalAfterManySepWalker=Br.NextTerminalAfterManyWalker=Br.AbstractNextTerminalAfterProductionWalker=Br.NextAfterTokenWalker=Br.AbstractNextPossibleTokensWalker=void 0;var ej=IE(),xt=Dt(),OEe=tS(),Et=hn(),tj=function(t){Fl(e,t);function e(r,i){var n=t.call(this)||this;return n.topProd=r,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,xt.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,xt.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(r,i){i===void 0&&(i=[]),this.found||t.prototype.walk.call(this,r,i)},e.prototype.walkProdRef=function(r,i,n){if(r.referencedRule.name===this.nextProductionName&&r.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(r.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,xt.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(ej.RestWalker);Br.AbstractNextPossibleTokensWalker=tj;var KEe=function(t){Fl(e,t);function e(r,i){var n=t.call(this,r,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return e.prototype.walkTerminal=function(r,i,n){if(this.isAtEndOfPath&&r.terminalType.name===this.nextTerminalName&&r.idx===this.nextTerminalOccurrence&&!this.found){var s=i.concat(n),o=new Et.Alternative({definition:s});this.possibleTokTypes=(0,OEe.first)(o),this.found=!0}},e}(tj);Br.NextAfterTokenWalker=KEe;var zh=function(t){Fl(e,t);function e(r,i){var n=t.call(this)||this;return n.topRule=r,n.occurrence=i,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}(ej.RestWalker);Br.AbstractNextTerminalAfterProductionWalker=zh;var UEe=function(t){Fl(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkMany=function(r,i,n){if(r.idx===this.occurrence){var s=(0,xt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Et.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else t.prototype.walkMany.call(this,r,i,n)},e}(zh);Br.NextTerminalAfterManyWalker=UEe;var HEe=function(t){Fl(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkManySep=function(r,i,n){if(r.idx===this.occurrence){var s=(0,xt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Et.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else t.prototype.walkManySep.call(this,r,i,n)},e}(zh);Br.NextTerminalAfterManySepWalker=HEe;var GEe=function(t){Fl(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkAtLeastOne=function(r,i,n){if(r.idx===this.occurrence){var s=(0,xt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Et.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else t.prototype.walkAtLeastOne.call(this,r,i,n)},e}(zh);Br.NextTerminalAfterAtLeastOneWalker=GEe;var jEe=function(t){Fl(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.walkAtLeastOneSep=function(r,i,n){if(r.idx===this.occurrence){var s=(0,xt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Et.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else t.prototype.walkAtLeastOneSep.call(this,r,i,n)},e}(zh);Br.NextTerminalAfterAtLeastOneSepWalker=jEe;function rj(t,e,r){r===void 0&&(r=[]),r=(0,xt.cloneArr)(r);var i=[],n=0;function s(c){return c.concat((0,xt.drop)(t,n+1))}function o(c){var u=rj(s(c),e,r);return i.concat(u)}for(;r.length=0;W--){var X=E.definition[W],F={idx:p,def:X.definition.concat((0,xt.drop)(h)),ruleStack:d,occurrenceStack:m};g.push(F),g.push(o)}else if(E instanceof Et.Alternative)g.push({idx:p,def:E.definition.concat((0,xt.drop)(h)),ruleStack:d,occurrenceStack:m});else if(E instanceof Et.Rule)g.push(YEe(E,p,d,m));else throw Error("non exhaustive match")}}return u}Br.nextPossibleTokensAfter=qEe;function YEe(t,e,r,i){var n=(0,xt.cloneArr)(r);n.push(t.name);var s=(0,xt.cloneArr)(i);return s.push(1),{idx:e,def:t.definition,ruleStack:n,occurrenceStack:s}}});var _h=I(Gt=>{"use strict";var ij=Gt&&Gt.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(Gt,"__esModule",{value:!0});Gt.areTokenCategoriesNotUsed=Gt.isStrictPrefixOfPath=Gt.containsPath=Gt.getLookaheadPathsForOptionalProd=Gt.getLookaheadPathsForOr=Gt.lookAheadSequenceFromAlternatives=Gt.buildSingleAlternativeLookaheadFunction=Gt.buildAlternativesLookAheadFunc=Gt.buildLookaheadFuncForOptionalProd=Gt.buildLookaheadFuncForOr=Gt.getProdType=Gt.PROD_TYPE=void 0;var _t=Dt(),nj=Vh(),JEe=IE(),bE=yu(),oA=hn(),WEe=wu(),zr;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(zr=Gt.PROD_TYPE||(Gt.PROD_TYPE={}));function zEe(t){if(t instanceof oA.Option)return zr.OPTION;if(t instanceof oA.Repetition)return zr.REPETITION;if(t instanceof oA.RepetitionMandatory)return zr.REPETITION_MANDATORY;if(t instanceof oA.RepetitionMandatoryWithSeparator)return zr.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof oA.RepetitionWithSeparator)return zr.REPETITION_WITH_SEPARATOR;if(t instanceof oA.Alternation)return zr.ALTERNATION;throw Error("non exhaustive match")}Gt.getProdType=zEe;function VEe(t,e,r,i,n,s){var o=sj(t,e,r),a=nS(o)?bE.tokenStructuredMatcherNoCategories:bE.tokenStructuredMatcher;return s(o,i,a,n)}Gt.buildLookaheadFuncForOr=VEe;function _Ee(t,e,r,i,n,s){var o=oj(t,e,n,r),a=nS(o)?bE.tokenStructuredMatcherNoCategories:bE.tokenStructuredMatcher;return s(o[0],a,i)}Gt.buildLookaheadFuncForOptionalProd=_Ee;function XEe(t,e,r,i){var n=t.length,s=(0,_t.every)(t,function(l){return(0,_t.every)(l,function(c){return c.length===1})});if(e)return function(l){for(var c=(0,_t.map)(l,function(b){return b.GATE}),u=0;u{"use strict";var aS=Mt&&Mt.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.checkPrefixAlternativesAmbiguities=Mt.validateSomeNonEmptyLookaheadPath=Mt.validateTooManyAlts=Mt.RepetionCollector=Mt.validateAmbiguousAlternationAlternatives=Mt.validateEmptyOrAlternative=Mt.getFirstNoneTerminal=Mt.validateNoLeftRecursion=Mt.validateRuleIsOverridden=Mt.validateRuleDoesNotAlreadyExist=Mt.OccurrenceValidationCollector=Mt.identifyProductionForDuplicates=Mt.validateGrammar=void 0;var jt=Dt(),Cr=Dt(),uo=Tn(),AS=Jh(),Qu=_h(),rye=Vh(),Fs=hn(),lS=wu();function sye(t,e,r,i,n){var s=jt.map(t,function(h){return iye(h,i)}),o=jt.map(t,function(h){return cS(h,h,i)}),a=[],l=[],c=[];(0,Cr.every)(o,Cr.isEmpty)&&(a=(0,Cr.map)(t,function(h){return uj(h,i)}),l=(0,Cr.map)(t,function(h){return gj(h,e,i)}),c=hj(t,e,i));var u=nye(t,r,i),g=(0,Cr.map)(t,function(h){return fj(h,i)}),f=(0,Cr.map)(t,function(h){return cj(h,t,n,i)});return jt.flatten(s.concat(c,o,a,l,u,g,f))}Mt.validateGrammar=sye;function iye(t,e){var r=new Cj;t.accept(r);var i=r.allProductions,n=jt.groupBy(i,pj),s=jt.pick(n,function(a){return a.length>1}),o=jt.map(jt.values(s),function(a){var l=jt.first(a),c=e.buildDuplicateFoundError(t,a),u=(0,AS.getProductionDslName)(l),g={message:c,type:uo.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:l.idx},f=dj(l);return f&&(g.parameter=f),g});return o}function pj(t){return(0,AS.getProductionDslName)(t)+"_#_"+t.idx+"_#_"+dj(t)}Mt.identifyProductionForDuplicates=pj;function dj(t){return t instanceof Fs.Terminal?t.terminalType.name:t instanceof Fs.NonTerminal?t.nonTerminalName:""}var Cj=function(t){aS(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.allProductions=[],r}return e.prototype.visitNonTerminal=function(r){this.allProductions.push(r)},e.prototype.visitOption=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatory=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetition=function(r){this.allProductions.push(r)},e.prototype.visitAlternation=function(r){this.allProductions.push(r)},e.prototype.visitTerminal=function(r){this.allProductions.push(r)},e}(lS.GAstVisitor);Mt.OccurrenceValidationCollector=Cj;function cj(t,e,r,i){var n=[],s=(0,Cr.reduce)(e,function(a,l){return l.name===t.name?a+1:a},0);if(s>1){var o=i.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});n.push({message:o,type:uo.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:t.name})}return n}Mt.validateRuleDoesNotAlreadyExist=cj;function oye(t,e,r){var i=[],n;return jt.contains(e,t)||(n="Invalid rule override, rule: ->"+t+"<- cannot be overridden in the grammar: ->"+r+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:uo.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:t})),i}Mt.validateRuleIsOverridden=oye;function cS(t,e,r,i){i===void 0&&(i=[]);var n=[],s=Xh(e.definition);if(jt.isEmpty(s))return[];var o=t.name,a=jt.contains(s,t);a&&n.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:i}),type:uo.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:o});var l=jt.difference(s,i.concat([t])),c=jt.map(l,function(u){var g=jt.cloneArr(i);return g.push(u),cS(t,u,r,g)});return n.concat(jt.flatten(c))}Mt.validateNoLeftRecursion=cS;function Xh(t){var e=[];if(jt.isEmpty(t))return e;var r=jt.first(t);if(r instanceof Fs.NonTerminal)e.push(r.referencedRule);else if(r instanceof Fs.Alternative||r instanceof Fs.Option||r instanceof Fs.RepetitionMandatory||r instanceof Fs.RepetitionMandatoryWithSeparator||r instanceof Fs.RepetitionWithSeparator||r instanceof Fs.Repetition)e=e.concat(Xh(r.definition));else if(r instanceof Fs.Alternation)e=jt.flatten(jt.map(r.definition,function(o){return Xh(o.definition)}));else if(!(r instanceof Fs.Terminal))throw Error("non exhaustive match");var i=(0,AS.isOptionalProd)(r),n=t.length>1;if(i&&n){var s=jt.drop(t);return e.concat(Xh(s))}else return e}Mt.getFirstNoneTerminal=Xh;var uS=function(t){aS(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.alternations=[],r}return e.prototype.visitAlternation=function(r){this.alternations.push(r)},e}(lS.GAstVisitor);function uj(t,e){var r=new uS;t.accept(r);var i=r.alternations,n=jt.reduce(i,function(s,o){var a=jt.dropRight(o.definition),l=jt.map(a,function(c,u){var g=(0,rye.nextPossibleTokensAfter)([c],[],null,1);return jt.isEmpty(g)?{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:u}),type:uo.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:u+1}:null});return s.concat(jt.compact(l))},[]);return n}Mt.validateEmptyOrAlternative=uj;function gj(t,e,r){var i=new uS;t.accept(i);var n=i.alternations;n=(0,Cr.reject)(n,function(o){return o.ignoreAmbiguities===!0});var s=jt.reduce(n,function(o,a){var l=a.idx,c=a.maxLookahead||e,u=(0,Qu.getLookaheadPathsForOr)(l,t,c,a),g=aye(u,a,t,r),f=mj(u,a,t,r);return o.concat(g,f)},[]);return s}Mt.validateAmbiguousAlternationAlternatives=gj;var Ij=function(t){aS(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.allProductions=[],r}return e.prototype.visitRepetitionWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatory=function(r){this.allProductions.push(r)},e.prototype.visitRepetitionMandatoryWithSeparator=function(r){this.allProductions.push(r)},e.prototype.visitRepetition=function(r){this.allProductions.push(r)},e}(lS.GAstVisitor);Mt.RepetionCollector=Ij;function fj(t,e){var r=new uS;t.accept(r);var i=r.alternations,n=jt.reduce(i,function(s,o){return o.definition.length>255&&s.push({message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:uo.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}),s},[]);return n}Mt.validateTooManyAlts=fj;function hj(t,e,r){var i=[];return(0,Cr.forEach)(t,function(n){var s=new Ij;n.accept(s);var o=s.allProductions;(0,Cr.forEach)(o,function(a){var l=(0,Qu.getProdType)(a),c=a.maxLookahead||e,u=a.idx,g=(0,Qu.getLookaheadPathsForOptionalProd)(u,n,l,c),f=g[0];if((0,Cr.isEmpty)((0,Cr.flatten)(f))){var h=r.buildEmptyRepetitionError({topLevelRule:n,repetition:a});i.push({message:h,type:uo.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:n.name})}})}),i}Mt.validateSomeNonEmptyLookaheadPath=hj;function aye(t,e,r,i){var n=[],s=(0,Cr.reduce)(t,function(a,l,c){return e.definition[c].ignoreAmbiguities===!0||(0,Cr.forEach)(l,function(u){var g=[c];(0,Cr.forEach)(t,function(f,h){c!==h&&(0,Qu.containsPath)(f,u)&&e.definition[h].ignoreAmbiguities!==!0&&g.push(h)}),g.length>1&&!(0,Qu.containsPath)(n,u)&&(n.push(u),a.push({alts:g,path:u}))}),a},[]),o=jt.map(s,function(a){var l=(0,Cr.map)(a.alts,function(u){return u+1}),c=i.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:a.path});return{message:c,type:uo.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:[a.alts]}});return o}function mj(t,e,r,i){var n=[],s=(0,Cr.reduce)(t,function(o,a,l){var c=(0,Cr.map)(a,function(u){return{idx:l,path:u}});return o.concat(c)},[]);return(0,Cr.forEach)(s,function(o){var a=e.definition[o.idx];if(a.ignoreAmbiguities!==!0){var l=o.idx,c=o.path,u=(0,Cr.findAll)(s,function(f){return e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.validateGrammar=bu.resolveGrammar=void 0;var fS=Dt(),Aye=$G(),lye=gS(),Ej=Wh();function cye(t){t=(0,fS.defaults)(t,{errMsgProvider:Ej.defaultGrammarResolverErrorProvider});var e={};return(0,fS.forEach)(t.rules,function(r){e[r.name]=r}),(0,Aye.resolveGrammar)(e,t.errMsgProvider)}bu.resolveGrammar=cye;function uye(t){return t=(0,fS.defaults)(t,{errMsgProvider:Ej.defaultGrammarValidatorErrorProvider}),(0,lye.validateGrammar)(t.rules,t.maxLookahead,t.tokenTypes,t.errMsgProvider,t.grammarName)}bu.validateGrammar=uye});var vu=I(dn=>{"use strict";var Zh=dn&&dn.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(dn,"__esModule",{value:!0});dn.EarlyExitException=dn.NotAllInputParsedException=dn.NoViableAltException=dn.MismatchedTokenException=dn.isRecognitionException=void 0;var gye=Dt(),wj="MismatchedTokenException",Bj="NoViableAltException",Qj="EarlyExitException",bj="NotAllInputParsedException",vj=[wj,Bj,Qj,bj];Object.freeze(vj);function fye(t){return(0,gye.contains)(vj,t.name)}dn.isRecognitionException=fye;var vE=function(t){Zh(e,t);function e(r,i){var n=this.constructor,s=t.call(this,r)||this;return s.token=i,s.resyncedTokens=[],Object.setPrototypeOf(s,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(s,s.constructor),s}return e}(Error),hye=function(t){Zh(e,t);function e(r,i,n){var s=t.call(this,r,i)||this;return s.previousToken=n,s.name=wj,s}return e}(vE);dn.MismatchedTokenException=hye;var pye=function(t){Zh(e,t);function e(r,i,n){var s=t.call(this,r,i)||this;return s.previousToken=n,s.name=Bj,s}return e}(vE);dn.NoViableAltException=pye;var dye=function(t){Zh(e,t);function e(r,i){var n=t.call(this,r,i)||this;return n.name=bj,n}return e}(vE);dn.NotAllInputParsedException=dye;var Cye=function(t){Zh(e,t);function e(r,i,n){var s=t.call(this,r,i)||this;return s.previousToken=n,s.name=Qj,s}return e}(vE);dn.EarlyExitException=Cye});var pS=I(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.attemptInRepetitionRecovery=xi.Recoverable=xi.InRuleRecoveryException=xi.IN_RULE_RECOVERY_EXCEPTION=xi.EOF_FOLLOW_KEY=void 0;var SE=nA(),ts=Dt(),mye=vu(),Iye=rS(),Eye=Tn();xi.EOF_FOLLOW_KEY={};xi.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function hS(t){this.name=xi.IN_RULE_RECOVERY_EXCEPTION,this.message=t}xi.InRuleRecoveryException=hS;hS.prototype=Error.prototype;var yye=function(){function t(){}return t.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,ts.has)(e,"recoveryEnabled")?e.recoveryEnabled:Eye.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Sj)},t.prototype.getTokenToInsert=function(e){var r=(0,SE.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r},t.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},t.prototype.tryInRepetitionRecovery=function(e,r,i,n){for(var s=this,o=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],c=!1,u=this.LA(1),g=this.LA(1),f=function(){var h=s.LA(0),p=s.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:h,ruleName:s.getCurrRuleFullName()}),d=new mye.MismatchedTokenException(p,u,s.LA(0));d.resyncedTokens=(0,ts.dropRight)(l),s.SAVE_ERROR(d)};!c;)if(this.tokenMatcher(g,n)){f();return}else if(i.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(g,o)?c=!0:(g=this.SKIP_TOKEN(),this.addToResyncTokens(g,l));this.importLexerState(a)},t.prototype.shouldInRepetitionRecoveryBeTried=function(e,r,i){return!(i===!1||e===void 0||r===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))},t.prototype.getFollowsForInRuleRecovery=function(e,r){var i=this.getCurrentGrammarPath(e,r),n=this.getNextPossibleTokenTypes(i);return n},t.prototype.tryInRuleRecovery=function(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r)){var i=this.getTokenToInsert(e);return i}if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new hS("sad sad panda")},t.prototype.canPerformInRuleRecovery=function(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)},t.prototype.canRecoverWithSingleTokenInsertion=function(e,r){var i=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,ts.isEmpty)(r))return!1;var n=this.LA(1),s=(0,ts.find)(r,function(o){return i.tokenMatcher(n,o)})!==void 0;return s},t.prototype.canRecoverWithSingleTokenDeletion=function(e){var r=this.tokenMatcher(this.LA(2),e);return r},t.prototype.isInCurrentRuleReSyncSet=function(e){var r=this.getCurrFollowKey(),i=this.getFollowSetFromFollowKey(r);return(0,ts.contains)(i,e)},t.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),r=this.LA(1),i=2;;){var n=r.tokenType;if((0,ts.contains)(e,n))return n;r=this.LA(i),i++}},t.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return xi.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),i=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(i)}},t.prototype.buildFullFollowKeyStack=function(){var e=this,r=this.RULE_STACK,i=this.RULE_OCCURRENCE_STACK;return(0,ts.map)(r,function(n,s){return s===0?xi.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:i[s],inRule:e.shortRuleNameToFullName(r[s-1])}})},t.prototype.flattenFollowSet=function(){var e=this,r=(0,ts.map)(this.buildFullFollowKeyStack(),function(i){return e.getFollowSetFromFollowKey(i)});return(0,ts.flatten)(r)},t.prototype.getFollowSetFromFollowKey=function(e){if(e===xi.EOF_FOLLOW_KEY)return[SE.EOF];var r=e.ruleName+e.idxInCallingRule+Iye.IN+e.inRule;return this.resyncFollows[r]},t.prototype.addToResyncTokens=function(e,r){return this.tokenMatcher(e,SE.EOF)||r.push(e),r},t.prototype.reSyncTo=function(e){for(var r=[],i=this.LA(1);this.tokenMatcher(i,e)===!1;)i=this.SKIP_TOKEN(),this.addToResyncTokens(i,r);return(0,ts.dropRight)(r)},t.prototype.attemptInRepetitionRecovery=function(e,r,i,n,s,o,a){},t.prototype.getCurrentGrammarPath=function(e,r){var i=this.getHumanReadableRuleStack(),n=(0,ts.cloneArr)(this.RULE_OCCURRENCE_STACK),s={ruleStack:i,occurrenceStack:n,lastTok:e,lastTokOccurrence:r};return s},t.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,ts.map)(this.RULE_STACK,function(r){return e.shortRuleNameToFullName(r)})},t}();xi.Recoverable=yye;function Sj(t,e,r,i,n,s,o){var a=this.getKeyForAutomaticLookahead(i,n),l=this.firstAfterRepMap[a];if(l===void 0){var c=this.getCurrRuleFullName(),u=this.getGAstProductions()[c],g=new s(u,n);l=g.startWalking(),this.firstAfterRepMap[a]=l}var f=l.token,h=l.occurrence,p=l.isEndOfRule;this.RULE_STACK.length===1&&p&&f===void 0&&(f=SE.EOF,h=1),this.shouldInRepetitionRecoveryBeTried(f,h,o)&&this.tryInRepetitionRecovery(t,e,r,f)}xi.attemptInRepetitionRecovery=Sj});var xE=I(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.getKeyForAutomaticLookahead=Nt.AT_LEAST_ONE_SEP_IDX=Nt.MANY_SEP_IDX=Nt.AT_LEAST_ONE_IDX=Nt.MANY_IDX=Nt.OPTION_IDX=Nt.OR_IDX=Nt.BITS_FOR_ALT_IDX=Nt.BITS_FOR_RULE_IDX=Nt.BITS_FOR_OCCURRENCE_IDX=Nt.BITS_FOR_METHOD_TYPE=void 0;Nt.BITS_FOR_METHOD_TYPE=4;Nt.BITS_FOR_OCCURRENCE_IDX=8;Nt.BITS_FOR_RULE_IDX=12;Nt.BITS_FOR_ALT_IDX=8;Nt.OR_IDX=1<{"use strict";Object.defineProperty(kE,"__esModule",{value:!0});kE.LooksAhead=void 0;var Aa=_h(),Ns=Dt(),xj=Tn(),la=xE(),Nl=Jh(),Bye=function(){function t(){}return t.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,Ns.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:xj.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,Ns.has)(e,"maxLookahead")?e.maxLookahead:xj.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,Ns.isES2015MapSupported)()?new Map:[],(0,Ns.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},t.prototype.preComputeLookaheadFunctions=function(e){var r=this;(0,Ns.forEach)(e,function(i){r.TRACE_INIT(i.name+" Rule Lookahead",function(){var n=(0,Nl.collectMethods)(i),s=n.alternation,o=n.repetition,a=n.option,l=n.repetitionMandatory,c=n.repetitionMandatoryWithSeparator,u=n.repetitionWithSeparator;(0,Ns.forEach)(s,function(g){var f=g.idx===0?"":g.idx;r.TRACE_INIT(""+(0,Nl.getProductionDslName)(g)+f,function(){var h=(0,Aa.buildLookaheadFuncForOr)(g.idx,i,g.maxLookahead||r.maxLookahead,g.hasPredicates,r.dynamicTokensEnabled,r.lookAheadBuilderForAlternatives),p=(0,la.getKeyForAutomaticLookahead)(r.fullRuleNameToShort[i.name],la.OR_IDX,g.idx);r.setLaFuncCache(p,h)})}),(0,Ns.forEach)(o,function(g){r.computeLookaheadFunc(i,g.idx,la.MANY_IDX,Aa.PROD_TYPE.REPETITION,g.maxLookahead,(0,Nl.getProductionDslName)(g))}),(0,Ns.forEach)(a,function(g){r.computeLookaheadFunc(i,g.idx,la.OPTION_IDX,Aa.PROD_TYPE.OPTION,g.maxLookahead,(0,Nl.getProductionDslName)(g))}),(0,Ns.forEach)(l,function(g){r.computeLookaheadFunc(i,g.idx,la.AT_LEAST_ONE_IDX,Aa.PROD_TYPE.REPETITION_MANDATORY,g.maxLookahead,(0,Nl.getProductionDslName)(g))}),(0,Ns.forEach)(c,function(g){r.computeLookaheadFunc(i,g.idx,la.AT_LEAST_ONE_SEP_IDX,Aa.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,g.maxLookahead,(0,Nl.getProductionDslName)(g))}),(0,Ns.forEach)(u,function(g){r.computeLookaheadFunc(i,g.idx,la.MANY_SEP_IDX,Aa.PROD_TYPE.REPETITION_WITH_SEPARATOR,g.maxLookahead,(0,Nl.getProductionDslName)(g))})})})},t.prototype.computeLookaheadFunc=function(e,r,i,n,s,o){var a=this;this.TRACE_INIT(""+o+(r===0?"":r),function(){var l=(0,Aa.buildLookaheadFuncForOptionalProd)(r,e,s||a.maxLookahead,a.dynamicTokensEnabled,n,a.lookAheadBuilderForOptional),c=(0,la.getKeyForAutomaticLookahead)(a.fullRuleNameToShort[e.name],i,r);a.setLaFuncCache(c,l)})},t.prototype.lookAheadBuilderForOptional=function(e,r,i){return(0,Aa.buildSingleAlternativeLookaheadFunction)(e,r,i)},t.prototype.lookAheadBuilderForAlternatives=function(e,r,i,n){return(0,Aa.buildAlternativesLookAheadFunc)(e,r,i,n)},t.prototype.getKeyForAutomaticLookahead=function(e,r){var i=this.getLastExplicitRuleShortName();return(0,la.getKeyForAutomaticLookahead)(i,e,r)},t.prototype.getLaFuncFromCache=function(e){},t.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},t.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},t.prototype.setLaFuncCache=function(e,r){},t.prototype.setLaFuncCacheUsingMap=function(e,r){this.lookAheadFuncsCache.set(e,r)},t.prototype.setLaFuncUsingObj=function(e,r){this.lookAheadFuncsCache[e]=r},t}();kE.LooksAhead=Bye});var Pj=I(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.addNoneTerminalToCst=go.addTerminalToCst=go.setNodeLocationFull=go.setNodeLocationOnlyOffset=void 0;function Qye(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset{"use strict";Object.defineProperty(aA,"__esModule",{value:!0});aA.defineNameProp=aA.functionName=aA.classNameFromInstance=void 0;var xye=Dt();function kye(t){return Dj(t.constructor)}aA.classNameFromInstance=kye;var Rj="name";function Dj(t){var e=t.name;return e||"anonymous"}aA.functionName=Dj;function Pye(t,e){var r=Object.getOwnPropertyDescriptor(t,Rj);return(0,xye.isUndefined)(r)||r.configurable?(Object.defineProperty(t,Rj,{enumerable:!1,configurable:!0,writable:!1,value:e}),!0):!1}aA.defineNameProp=Pye});var Mj=I(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.validateRedundantMethods=mi.validateMissingCstMethods=mi.validateVisitor=mi.CstVisitorDefinitionError=mi.createBaseVisitorConstructorWithDefaults=mi.createBaseSemanticVisitorConstructor=mi.defaultVisit=void 0;var rs=Dt(),$h=dS();function Fj(t,e){for(var r=(0,rs.keys)(t),i=r.length,n=0;n: @@ -133,7 +133,7 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis `,u=` -
+
`,g=` `;return a+l+c+u+g+f}jE.createSyntaxDiagramsCode=Iwe});var mY=I(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.Parser=He.createSyntaxDiagramsCode=He.clearCache=He.GAstVisitor=He.serializeProduction=He.serializeGrammar=He.Terminal=He.Rule=He.RepetitionWithSeparator=He.RepetitionMandatoryWithSeparator=He.RepetitionMandatory=He.Repetition=He.Option=He.NonTerminal=He.Alternative=He.Alternation=He.defaultLexerErrorProvider=He.NoViableAltException=He.NotAllInputParsedException=He.MismatchedTokenException=He.isRecognitionException=He.EarlyExitException=He.defaultParserErrorProvider=He.tokenName=He.tokenMatcher=He.tokenLabel=He.EOF=He.createTokenInstance=He.createToken=He.LexerDefinitionErrorType=He.Lexer=He.EMPTY_ALT=He.ParserDefinitionErrorType=He.EmbeddedActionsParser=He.CstParser=He.VERSION=void 0;var Ewe=Uv();Object.defineProperty(He,"VERSION",{enumerable:!0,get:function(){return Ewe.VERSION}});var YE=Tn();Object.defineProperty(He,"CstParser",{enumerable:!0,get:function(){return YE.CstParser}});Object.defineProperty(He,"EmbeddedActionsParser",{enumerable:!0,get:function(){return YE.EmbeddedActionsParser}});Object.defineProperty(He,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return YE.ParserDefinitionErrorType}});Object.defineProperty(He,"EMPTY_ALT",{enumerable:!0,get:function(){return YE.EMPTY_ALT}});var dY=Gh();Object.defineProperty(He,"Lexer",{enumerable:!0,get:function(){return dY.Lexer}});Object.defineProperty(He,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return dY.LexerDefinitionErrorType}});var ku=nA();Object.defineProperty(He,"createToken",{enumerable:!0,get:function(){return ku.createToken}});Object.defineProperty(He,"createTokenInstance",{enumerable:!0,get:function(){return ku.createTokenInstance}});Object.defineProperty(He,"EOF",{enumerable:!0,get:function(){return ku.EOF}});Object.defineProperty(He,"tokenLabel",{enumerable:!0,get:function(){return ku.tokenLabel}});Object.defineProperty(He,"tokenMatcher",{enumerable:!0,get:function(){return ku.tokenMatcher}});Object.defineProperty(He,"tokenName",{enumerable:!0,get:function(){return ku.tokenName}});var ywe=Wh();Object.defineProperty(He,"defaultParserErrorProvider",{enumerable:!0,get:function(){return ywe.defaultParserErrorProvider}});var rp=vu();Object.defineProperty(He,"EarlyExitException",{enumerable:!0,get:function(){return rp.EarlyExitException}});Object.defineProperty(He,"isRecognitionException",{enumerable:!0,get:function(){return rp.isRecognitionException}});Object.defineProperty(He,"MismatchedTokenException",{enumerable:!0,get:function(){return rp.MismatchedTokenException}});Object.defineProperty(He,"NotAllInputParsedException",{enumerable:!0,get:function(){return rp.NotAllInputParsedException}});Object.defineProperty(He,"NoViableAltException",{enumerable:!0,get:function(){return rp.NoViableAltException}});var wwe=_v();Object.defineProperty(He,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return wwe.defaultLexerErrorProvider}});var ho=hn();Object.defineProperty(He,"Alternation",{enumerable:!0,get:function(){return ho.Alternation}});Object.defineProperty(He,"Alternative",{enumerable:!0,get:function(){return ho.Alternative}});Object.defineProperty(He,"NonTerminal",{enumerable:!0,get:function(){return ho.NonTerminal}});Object.defineProperty(He,"Option",{enumerable:!0,get:function(){return ho.Option}});Object.defineProperty(He,"Repetition",{enumerable:!0,get:function(){return ho.Repetition}});Object.defineProperty(He,"RepetitionMandatory",{enumerable:!0,get:function(){return ho.RepetitionMandatory}});Object.defineProperty(He,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return ho.RepetitionMandatoryWithSeparator}});Object.defineProperty(He,"RepetitionWithSeparator",{enumerable:!0,get:function(){return ho.RepetitionWithSeparator}});Object.defineProperty(He,"Rule",{enumerable:!0,get:function(){return ho.Rule}});Object.defineProperty(He,"Terminal",{enumerable:!0,get:function(){return ho.Terminal}});var CY=hn();Object.defineProperty(He,"serializeGrammar",{enumerable:!0,get:function(){return CY.serializeGrammar}});Object.defineProperty(He,"serializeProduction",{enumerable:!0,get:function(){return CY.serializeProduction}});var Bwe=wu();Object.defineProperty(He,"GAstVisitor",{enumerable:!0,get:function(){return Bwe.GAstVisitor}});function Qwe(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API. It performs no action other than printing this message. - Please avoid using it as it will be completely removed in the future`)}He.clearCache=Qwe;var bwe=pY();Object.defineProperty(He,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return bwe.createSyntaxDiagramsCode}});var vwe=function(){function t(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead. + Please avoid using it as it will be completely removed in the future`)}He.clearCache=Qwe;var bwe=pY();Object.defineProperty(He,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return bwe.createSyntaxDiagramsCode}});var vwe=function(){function t(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return t}();He.Parser=vwe});var yY=I((Trt,IY)=>{var qE=mY(),ca=qE.createToken,EY=qE.tokenMatcher,yS=qE.Lexer,Swe=qE.EmbeddedActionsParser;IY.exports=t=>{let e=ca({name:"LogicalOperator",pattern:yS.NA}),r=ca({name:"Or",pattern:/\|/,categories:e}),i=ca({name:"Xor",pattern:/\^/,categories:e}),n=ca({name:"And",pattern:/&/,categories:e}),s=ca({name:"Not",pattern:/!/}),o=ca({name:"LParen",pattern:/\(/}),a=ca({name:"RParen",pattern:/\)/}),l=ca({name:"Query",pattern:t}),u=[ca({name:"WhiteSpace",pattern:/\s+/,group:yS.SKIPPED}),r,i,n,o,a,s,e,l],g=new yS(u);class f extends Swe{constructor(p){super(u);this.RULE("expression",()=>this.SUBRULE(this.logicalExpression)),this.RULE("logicalExpression",()=>{let m=this.SUBRULE(this.atomicExpression);return this.MANY(()=>{let E=m,B=this.CONSUME(e),b=this.SUBRULE2(this.atomicExpression);EY(B,r)?m=R=>E(R)||b(R):EY(B,i)?m=R=>!!(E(R)^b(R)):m=R=>E(R)&&b(R)}),m}),this.RULE("atomicExpression",()=>this.OR([{ALT:()=>this.SUBRULE(this.parenthesisExpression)},{ALT:()=>{let{image:d}=this.CONSUME(l);return m=>m(d)}},{ALT:()=>{this.CONSUME(s);let d=this.SUBRULE(this.atomicExpression);return m=>!d(m)}}])),this.RULE("parenthesisExpression",()=>{let d;return this.CONSUME(o),d=this.SUBRULE(this.expression),this.CONSUME(a),d}),this.performSelfAnalysis()}}return{TinylogicLexer:g,TinylogicParser:f}}});var wY=I(JE=>{var xwe=yY();JE.makeParser=(t=/[a-z]+/)=>{let{TinylogicLexer:e,TinylogicParser:r}=xwe(t),i=new r;return(n,s)=>{let o=e.tokenize(n);return i.input=o.tokens,i.expression()(s)}};JE.parse=JE.makeParser()});var QY=I((Ort,BY)=>{"use strict";BY.exports=(...t)=>[...new Set([].concat(...t))]});var wS=I((Krt,bY)=>{"use strict";var kwe=require("stream"),vY=kwe.PassThrough,Pwe=Array.prototype.slice;bY.exports=Dwe;function Dwe(){let t=[],e=!1,r=Pwe.call(arguments),i=r[r.length-1];i&&!Array.isArray(i)&&i.pipe==null?r.pop():i={};let n=i.end!==!1;i.objectMode==null&&(i.objectMode=!0),i.highWaterMark==null&&(i.highWaterMark=64*1024);let s=vY(i);function o(){for(let c=0,u=arguments.length;c0||(e=!1,a())}function f(h){function p(){h.removeListener("merge2UnpipeEnd",p),h.removeListener("end",p),g()}if(h._readableState.endEmitted)return g();h.on("merge2UnpipeEnd",p),h.on("end",p),h.pipe(s,{end:!1}),h.resume()}for(let h=0;h{"use strict";Object.defineProperty(WE,"__esModule",{value:!0});function Rwe(t){return t.reduce((e,r)=>[].concat(e,r),[])}WE.flatten=Rwe;function Fwe(t,e){let r=[[]],i=0;for(let n of t)e(n)?(i++,r[i]=[]):r[i].push(n);return r}WE.splitWhen=Fwe});var kY=I(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});function Nwe(t){return t.code==="ENOENT"}BS.isEnoentCodeError=Nwe});var DY=I(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var PY=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Lwe(t,e){return new PY(t,e)}QS.createDirentFromStats=Lwe});var RY=I(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});var Twe=require("path"),Mwe=2,Owe=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;function Kwe(t){return t.replace(/\\/g,"/")}Pu.unixify=Kwe;function Uwe(t,e){return Twe.resolve(t,e)}Pu.makeAbsolute=Uwe;function Hwe(t){return t.replace(Owe,"\\$2")}Pu.escape=Hwe;function Gwe(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(Mwe)}return t}Pu.removeLeadingDotSegment=Gwe});var NY=I((Yrt,FY)=>{FY.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var TY=I((qrt,LY)=>{var jwe=NY(),Ywe={"{":"}","(":")","[":"]"},qwe=/\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/,Jwe=/\\(.)|(^!|[*?{}()[\]]|\(\?)/;LY.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(jwe(e))return!0;var i=qwe,n;for(r&&r.strict===!1&&(i=Jwe);n=i.exec(e);){if(n[2])return!0;var s=n.index+n[0].length,o=n[1],a=o?Ywe[o]:null;if(o&&a){var l=e.indexOf(a,s);l!==-1&&(s=l+1)}e=e.slice(s)}return!1}});var OY=I((Jrt,MY)=>{"use strict";var Wwe=TY(),zwe=require("path").posix.dirname,Vwe=require("os").platform()==="win32",bS="/",_we=/\\/g,Xwe=/[\{\[].*[\}\]]$/,Zwe=/(^|[^\\])([\{\[]|\([^\)]+$)/,$we=/\\([\!\*\?\|\[\]\(\)\{\}])/g;MY.exports=function(e,r){var i=Object.assign({flipBackslashes:!0},r);i.flipBackslashes&&Vwe&&e.indexOf(bS)<0&&(e=e.replace(_we,bS)),Xwe.test(e)&&(e+=bS),e+="a";do e=zwe(e);while(Wwe(e)||Zwe.test(e));return e.replace($we,"$1")}});var WY=I(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});var eBe=require("path"),tBe=OY(),KY=Nn(),rBe=iv(),UY="**",iBe="\\",nBe=/[*?]|^!/,sBe=/\[.*]/,oBe=/(?:^|[^!*+?@])\(.*\|.*\)/,aBe=/[!*+?@]\(.*\)/,ABe=/{.*(?:,|\.\.).*}/;function GY(t,e={}){return!HY(t,e)}Hr.isStaticPattern=GY;function HY(t,e={}){return!!(e.caseSensitiveMatch===!1||t.includes(iBe)||nBe.test(t)||sBe.test(t)||oBe.test(t)||e.extglob!==!1&&aBe.test(t)||e.braceExpansion!==!1&&ABe.test(t))}Hr.isDynamicPattern=HY;function lBe(t){return zE(t)?t.slice(1):t}Hr.convertToPositivePattern=lBe;function cBe(t){return"!"+t}Hr.convertToNegativePattern=cBe;function zE(t){return t.startsWith("!")&&t[1]!=="("}Hr.isNegativePattern=zE;function jY(t){return!zE(t)}Hr.isPositivePattern=jY;function uBe(t){return t.filter(zE)}Hr.getNegativePatterns=uBe;function gBe(t){return t.filter(jY)}Hr.getPositivePatterns=gBe;function fBe(t){return tBe(t,{flipBackslashes:!1})}Hr.getBaseDirectory=fBe;function hBe(t){return t.includes(UY)}Hr.hasGlobStar=hBe;function YY(t){return t.endsWith("/"+UY)}Hr.endsWithSlashGlobStar=YY;function pBe(t){let e=eBe.basename(t);return YY(t)||GY(e)}Hr.isAffectDepthOfReadingPattern=pBe;function dBe(t){return t.reduce((e,r)=>e.concat(qY(r)),[])}Hr.expandPatternsWithBraceExpansion=dBe;function qY(t){return KY.braces(t,{expand:!0,nodupes:!0})}Hr.expandBraceExpansion=qY;function CBe(t,e){let r=rBe.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.parts.length===0?[t]:r.parts}Hr.getPatternParts=CBe;function JY(t,e){return KY.makeRe(t,e)}Hr.makeRe=JY;function mBe(t,e){return t.map(r=>JY(r,e))}Hr.convertPatternsToRe=mBe;function IBe(t,e){return e.some(r=>r.test(t))}Hr.matchAny=IBe});var VY=I(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});var EBe=wS();function yBe(t){let e=EBe(t);return t.forEach(r=>{r.once("error",i=>e.emit("error",i))}),e.once("close",()=>zY(t)),e.once("end",()=>zY(t)),e}vS.merge=yBe;function zY(t){t.forEach(e=>e.emit("close"))}});var _Y=I(VE=>{"use strict";Object.defineProperty(VE,"__esModule",{value:!0});function wBe(t){return typeof t=="string"}VE.isString=wBe;function BBe(t){return t===""}VE.isEmpty=BBe});var ga=I(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var QBe=xY();ua.array=QBe;var bBe=kY();ua.errno=bBe;var vBe=DY();ua.fs=vBe;var SBe=RY();ua.path=SBe;var xBe=WY();ua.pattern=xBe;var kBe=VY();ua.stream=kBe;var PBe=_Y();ua.string=PBe});var tq=I(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var Ll=ga();function DBe(t,e){let r=XY(t),i=ZY(t,e.ignore),n=r.filter(l=>Ll.pattern.isStaticPattern(l,e)),s=r.filter(l=>Ll.pattern.isDynamicPattern(l,e)),o=SS(n,i,!1),a=SS(s,i,!0);return o.concat(a)}fa.generate=DBe;function SS(t,e,r){let i=$Y(t);return"."in i?[xS(".",t,e,r)]:eq(i,e,r)}fa.convertPatternsToTasks=SS;function XY(t){return Ll.pattern.getPositivePatterns(t)}fa.getPositivePatterns=XY;function ZY(t,e){return Ll.pattern.getNegativePatterns(t).concat(e).map(Ll.pattern.convertToPositivePattern)}fa.getNegativePatternsAsPositive=ZY;function $Y(t){let e={};return t.reduce((r,i)=>{let n=Ll.pattern.getBaseDirectory(i);return n in r?r[n].push(i):r[n]=[i],r},e)}fa.groupPatternsByBaseDirectory=$Y;function eq(t,e,r){return Object.keys(t).map(i=>xS(i,t[i],e,r))}fa.convertPatternGroupsToTasks=eq;function xS(t,e,r,i){return{dynamic:i,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(Ll.pattern.convertToNegativePattern))}}fa.convertPatternGroupToTask=xS});var iq=I(_E=>{"use strict";Object.defineProperty(_E,"__esModule",{value:!0});_E.read=void 0;function RBe(t,e,r){e.fs.lstat(t,(i,n)=>{if(i!==null){rq(r,i);return}if(!n.isSymbolicLink()||!e.followSymbolicLink){kS(r,n);return}e.fs.stat(t,(s,o)=>{if(s!==null){if(e.throwErrorOnBrokenSymbolicLink){rq(r,s);return}kS(r,n);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),kS(r,o)})})}_E.read=RBe;function rq(t,e){t(e)}function kS(t,e){t(null,e)}});var nq=I(XE=>{"use strict";Object.defineProperty(XE,"__esModule",{value:!0});XE.read=void 0;function FBe(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let i=e.fs.statSync(t);return e.markSymbolicLink&&(i.isSymbolicLink=()=>!0),i}catch(i){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw i}}XE.read=FBe});var sq=I(AA=>{"use strict";Object.defineProperty(AA,"__esModule",{value:!0});AA.createFileSystemAdapter=AA.FILE_SYSTEM_ADAPTER=void 0;var ZE=require("fs");AA.FILE_SYSTEM_ADAPTER={lstat:ZE.lstat,stat:ZE.stat,lstatSync:ZE.lstatSync,statSync:ZE.statSync};function NBe(t){return t===void 0?AA.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},AA.FILE_SYSTEM_ADAPTER),t)}AA.createFileSystemAdapter=NBe});var aq=I(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var LBe=sq(),oq=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=LBe.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e!=null?e:r}};PS.default=oq});var Tl=I(lA=>{"use strict";Object.defineProperty(lA,"__esModule",{value:!0});lA.statSync=lA.stat=lA.Settings=void 0;var Aq=iq(),TBe=nq(),DS=aq();lA.Settings=DS.default;function MBe(t,e,r){if(typeof e=="function"){Aq.read(t,RS(),e);return}Aq.read(t,RS(e),r)}lA.stat=MBe;function OBe(t,e){let r=RS(e);return TBe.read(t,r)}lA.statSync=OBe;function RS(t={}){return t instanceof DS.default?t:new DS.default(t)}});var cq=I((iit,lq)=>{lq.exports=KBe;function KBe(t,e){var r,i,n,s=!0;Array.isArray(t)?(r=[],i=t.length):(n=Object.keys(t),r={},i=n.length);function o(l){function c(){e&&e(l,r),e=null}s?process.nextTick(c):c()}function a(l,c,u){r[l]=u,(--i==0||c)&&o(c)}i?n?n.forEach(function(l){t[l](function(c,u){a(l,c,u)})}):t.forEach(function(l,c){l(function(u,g){a(c,u,g)})}):o(null),s=!1}});var FS=I($E=>{"use strict";Object.defineProperty($E,"__esModule",{value:!0});$E.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var ey=process.versions.node.split(".");if(ey[0]===void 0||ey[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var uq=Number.parseInt(ey[0],10),UBe=Number.parseInt(ey[1],10),gq=10,HBe=10,GBe=uq>gq,jBe=uq===gq&&UBe>=HBe;$E.IS_SUPPORT_READDIR_WITH_FILE_TYPES=GBe||jBe});var hq=I(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.createDirentFromStats=void 0;var fq=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function YBe(t,e){return new fq(t,e)}ty.createDirentFromStats=YBe});var NS=I(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.fs=void 0;var qBe=hq();ry.fs=qBe});var LS=I(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.joinPathSegments=void 0;function JBe(t,e,r){return t.endsWith(r)?t+e:t+r+e}iy.joinPathSegments=JBe});var Eq=I(cA=>{"use strict";Object.defineProperty(cA,"__esModule",{value:!0});cA.readdir=cA.readdirWithFileTypes=cA.read=void 0;var WBe=Tl(),pq=cq(),zBe=FS(),dq=NS(),Cq=LS();function VBe(t,e,r){if(!e.stats&&zBe.IS_SUPPORT_READDIR_WITH_FILE_TYPES){mq(t,e,r);return}Iq(t,e,r)}cA.read=VBe;function mq(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(i,n)=>{if(i!==null){ny(r,i);return}let s=n.map(a=>({dirent:a,name:a.name,path:Cq.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){TS(r,s);return}let o=s.map(a=>_Be(a,e));pq(o,(a,l)=>{if(a!==null){ny(r,a);return}TS(r,l)})})}cA.readdirWithFileTypes=mq;function _Be(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(i,n)=>{if(i!==null){if(e.throwErrorOnBrokenSymbolicLink){r(i);return}r(null,t);return}t.dirent=dq.fs.createDirentFromStats(t.name,n),r(null,t)})}}function Iq(t,e,r){e.fs.readdir(t,(i,n)=>{if(i!==null){ny(r,i);return}let s=n.map(o=>{let a=Cq.joinPathSegments(t,o,e.pathSegmentSeparator);return l=>{WBe.stat(a,e.fsStatSettings,(c,u)=>{if(c!==null){l(c);return}let g={name:o,path:a,dirent:dq.fs.createDirentFromStats(o,u)};e.stats&&(g.stats=u),l(null,g)})}});pq(s,(o,a)=>{if(o!==null){ny(r,o);return}TS(r,a)})})}cA.readdir=Iq;function ny(t,e){t(e)}function TS(t,e){t(null,e)}});var bq=I(uA=>{"use strict";Object.defineProperty(uA,"__esModule",{value:!0});uA.readdir=uA.readdirWithFileTypes=uA.read=void 0;var XBe=Tl(),ZBe=FS(),yq=NS(),wq=LS();function $Be(t,e){return!e.stats&&ZBe.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Bq(t,e):Qq(t,e)}uA.read=$Be;function Bq(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(i=>{let n={dirent:i,name:i.name,path:wq.joinPathSegments(t,i.name,e.pathSegmentSeparator)};if(n.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let s=e.fs.statSync(n.path);n.dirent=yq.fs.createDirentFromStats(n.name,s)}catch(s){if(e.throwErrorOnBrokenSymbolicLink)throw s}return n})}uA.readdirWithFileTypes=Bq;function Qq(t,e){return e.fs.readdirSync(t).map(i=>{let n=wq.joinPathSegments(t,i,e.pathSegmentSeparator),s=XBe.statSync(n,e.fsStatSettings),o={name:i,path:n,dirent:yq.fs.createDirentFromStats(i,s)};return e.stats&&(o.stats=s),o})}uA.readdir=Qq});var vq=I(gA=>{"use strict";Object.defineProperty(gA,"__esModule",{value:!0});gA.createFileSystemAdapter=gA.FILE_SYSTEM_ADAPTER=void 0;var Du=require("fs");gA.FILE_SYSTEM_ADAPTER={lstat:Du.lstat,stat:Du.stat,lstatSync:Du.lstatSync,statSync:Du.statSync,readdir:Du.readdir,readdirSync:Du.readdirSync};function e0e(t){return t===void 0?gA.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},gA.FILE_SYSTEM_ADAPTER),t)}gA.createFileSystemAdapter=e0e});var xq=I(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var t0e=require("path"),r0e=Tl(),i0e=vq(),Sq=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=i0e.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t0e.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new r0e.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e!=null?e:r}};MS.default=Sq});var sy=I(fA=>{"use strict";Object.defineProperty(fA,"__esModule",{value:!0});fA.Settings=fA.scandirSync=fA.scandir=void 0;var kq=Eq(),n0e=bq(),OS=xq();fA.Settings=OS.default;function s0e(t,e,r){if(typeof e=="function"){kq.read(t,KS(),e);return}kq.read(t,KS(e),r)}fA.scandir=s0e;function o0e(t,e){let r=KS(e);return n0e.read(t,r)}fA.scandirSync=o0e;function KS(t={}){return t instanceof OS.default?t:new OS.default(t)}});var Dq=I((fit,Pq)=>{"use strict";function a0e(t){var e=new t,r=e;function i(){var s=e;return s.next?e=s.next:(e=new t,r=e),s.next=null,s}function n(s){r.next=s,r=s}return{get:i,release:n}}Pq.exports=a0e});var Fq=I((hit,US)=>{"use strict";var A0e=Dq();function Rq(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),r<1)throw new Error("fastqueue concurrency must be greater than 1");var i=A0e(l0e),n=null,s=null,o=0,a=null,l={push:d,drain:po,saturated:po,pause:u,paused:!1,concurrency:r,running:c,resume:h,idle:p,length:g,getQueue:f,unshift:m,empty:po,kill:B,killAndDrain:b,error:R};return l;function c(){return o}function u(){l.paused=!0}function g(){for(var H=n,L=0;H;)H=H.next,L++;return L}function f(){for(var H=n,L=[];H;)L.push(H.value),H=H.next;return L}function h(){if(!!l.paused){l.paused=!1;for(var H=0;H{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.joinPathSegments=Co.replacePathSegmentSeparator=Co.isAppliedFilter=Co.isFatalError=void 0;function u0e(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}Co.isFatalError=u0e;function g0e(t,e){return t===null||t(e)}Co.isAppliedFilter=g0e;function f0e(t,e){return t.split(/[/\\]/).join(e)}Co.replacePathSegmentSeparator=f0e;function h0e(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}Co.joinPathSegments=h0e});var GS=I(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var p0e=oy(),Nq=class{constructor(e,r){this._root=e,this._settings=r,this._root=p0e.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};HS.default=Nq});var YS=I(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var d0e=require("events"),C0e=sy(),m0e=Fq(),ay=oy(),I0e=GS(),Lq=class extends I0e.default{constructor(e,r){super(e,r);this._settings=r,this._scandir=C0e.scandir,this._emitter=new d0e.EventEmitter,this._queue=m0e(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let i={directory:e,base:r};this._queue.push(i,n=>{n!==null&&this._handleError(n)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(i,n)=>{if(i!==null){r(i,void 0);return}for(let s of n)this._handleEntry(s,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!ay.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let i=e.path;r!==void 0&&(e.path=ay.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),ay.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&ay.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(i,e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};jS.default=Lq});var Mq=I(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});var E0e=YS(),Tq=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new E0e.default(this._root,this._settings),this._storage=new Set}read(e){this._reader.onError(r=>{y0e(e,r)}),this._reader.onEntry(r=>{this._storage.add(r)}),this._reader.onEnd(()=>{w0e(e,[...this._storage])}),this._reader.read()}};qS.default=Tq;function y0e(t,e){t(e)}function w0e(t,e){t(null,e)}});var Kq=I(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});var B0e=require("stream"),Q0e=YS(),Oq=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Q0e.default(this._root,this._settings),this._stream=new B0e.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};JS.default=Oq});var Hq=I(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var b0e=sy(),Ay=oy(),v0e=GS(),Uq=class extends v0e.default{constructor(){super(...arguments);this._scandir=b0e.scandirSync,this._storage=new Set,this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),[...this._storage]}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let i=this._scandir(e,this._settings.fsScandirSettings);for(let n of i)this._handleEntry(n,r)}catch(i){this._handleError(i)}}_handleError(e){if(!!Ay.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let i=e.path;r!==void 0&&(e.path=Ay.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Ay.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&Ay.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(i,e.path)}_pushToStorage(e){this._storage.add(e)}};WS.default=Uq});var jq=I(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var S0e=Hq(),Gq=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new S0e.default(this._root,this._settings)}read(){return this._reader.read()}};zS.default=Gq});var qq=I(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var x0e=require("path"),k0e=sy(),Yq=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,x0e.sep),this.fsScandirSettings=new k0e.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e!=null?e:r}};VS.default=Yq});var XS=I(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.Settings=mo.walkStream=mo.walkSync=mo.walk=void 0;var Jq=Mq(),P0e=Kq(),D0e=jq(),_S=qq();mo.Settings=_S.default;function R0e(t,e,r){if(typeof e=="function"){new Jq.default(t,ly()).read(e);return}new Jq.default(t,ly(e)).read(r)}mo.walk=R0e;function F0e(t,e){let r=ly(e);return new D0e.default(t,r).read()}mo.walkSync=F0e;function N0e(t,e){let r=ly(e);return new P0e.default(t,r).read()}mo.walkStream=N0e;function ly(t={}){return t instanceof _S.default?t:new _S.default(t)}});var $S=I(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});var L0e=require("path"),T0e=Tl(),Wq=ga(),zq=class{constructor(e){this._settings=e,this._fsStatSettings=new T0e.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return L0e.resolve(this._settings.cwd,e)}_makeEntry(e,r){let i={name:r,path:r,dirent:Wq.fs.createDirentFromStats(r,e)};return this._settings.stats&&(i.stats=e),i}_isFatalError(e){return!Wq.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};ZS.default=zq});var tx=I(ex=>{"use strict";Object.defineProperty(ex,"__esModule",{value:!0});var M0e=require("stream"),O0e=Tl(),K0e=XS(),U0e=$S(),Vq=class extends U0e.default{constructor(){super(...arguments);this._walkStream=K0e.walkStream,this._stat=O0e.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let i=e.map(this._getFullEntryPath,this),n=new M0e.PassThrough({objectMode:!0});n._write=(s,o,a)=>this._getEntry(i[s],e[s],r).then(l=>{l!==null&&r.entryFilter(l)&&n.push(l),s===i.length-1&&n.end(),a()}).catch(a);for(let s=0;sthis._makeEntry(n,r)).catch(n=>{if(i.errorFilter(n))return null;throw n})}_getStat(e){return new Promise((r,i)=>{this._stat(e,this._fsStatSettings,(n,s)=>n===null?r(s):i(n))})}};ex.default=Vq});var Xq=I(rx=>{"use strict";Object.defineProperty(rx,"__esModule",{value:!0});var Ru=ga(),_q=class{constructor(e,r,i){this._patterns=e,this._settings=r,this._micromatchOptions=i,this._storage=[],this._fillStorage()}_fillStorage(){let e=Ru.pattern.expandPatternsWithBraceExpansion(this._patterns);for(let r of e){let i=this._getPatternSegments(r),n=this._splitSegmentsIntoSections(i);this._storage.push({complete:n.length<=1,pattern:r,segments:i,sections:n})}}_getPatternSegments(e){return Ru.pattern.getPatternParts(e,this._micromatchOptions).map(i=>Ru.pattern.isDynamicPattern(i,this._settings)?{dynamic:!0,pattern:i,patternRe:Ru.pattern.makeRe(i,this._micromatchOptions)}:{dynamic:!1,pattern:i})}_splitSegmentsIntoSections(e){return Ru.array.splitWhen(e,r=>r.dynamic&&Ru.pattern.hasGlobStar(r.pattern))}};rx.default=_q});var $q=I(ix=>{"use strict";Object.defineProperty(ix,"__esModule",{value:!0});var H0e=Xq(),Zq=class extends H0e.default{match(e){let r=e.split("/"),i=r.length,n=this._storage.filter(s=>!s.complete||s.segments.length>i);for(let s of n){let o=s.sections[0];if(!s.complete&&i>o.length||r.every((l,c)=>{let u=s.segments[c];return!!(u.dynamic&&u.patternRe.test(l)||!u.dynamic&&u.pattern===l)}))return!0}return!1}};ix.default=Zq});var tJ=I(nx=>{"use strict";Object.defineProperty(nx,"__esModule",{value:!0});var cy=ga(),G0e=$q(),eJ=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,i){let n=this._getMatcher(r),s=this._getNegativePatternsRe(i);return o=>this._filter(e,o,n,s)}_getMatcher(e){return new G0e.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(cy.pattern.isAffectDepthOfReadingPattern);return cy.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,i,n){let s=this._getEntryLevel(e,r.path);if(this._isSkippedByDeep(s)||this._isSkippedSymbolicLink(r))return!1;let o=cy.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(o,i)?!1:this._isSkippedByNegativePatterns(o,n)}_isSkippedByDeep(e){return e>=this._settings.deep}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_getEntryLevel(e,r){let i=e.split("/").length;return r.split("/").length-(e===""?0:i)}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!cy.pattern.matchAny(e,r)}};nx.default=eJ});var iJ=I(sx=>{"use strict";Object.defineProperty(sx,"__esModule",{value:!0});var ip=ga(),rJ=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let i=ip.pattern.convertPatternsToRe(e,this._micromatchOptions),n=ip.pattern.convertPatternsToRe(r,this._micromatchOptions);return s=>this._filter(s,i,n)}_filter(e,r,i){if(this._settings.unique){if(this._isDuplicateEntry(e))return!1;this._createIndexRecord(e)}if(this._onlyFileFilter(e)||this._onlyDirectoryFilter(e)||this._isSkippedByAbsoluteNegativePatterns(e,i))return!1;let n=this._settings.baseNameMatch?e.name:e.path;return this._isMatchToPatterns(n,r)&&!this._isMatchToPatterns(e.path,i)}_isDuplicateEntry(e){return this.index.has(e.path)}_createIndexRecord(e){this.index.set(e.path,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(e,r){if(!this._settings.absolute)return!1;let i=ip.path.makeAbsolute(this._settings.cwd,e.path);return this._isMatchToPatterns(i,r)}_isMatchToPatterns(e,r){let i=ip.path.removeLeadingDotSegment(e);return ip.pattern.matchAny(i,r)}};sx.default=rJ});var sJ=I(ox=>{"use strict";Object.defineProperty(ox,"__esModule",{value:!0});var j0e=ga(),nJ=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return j0e.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};ox.default=nJ});var AJ=I(ax=>{"use strict";Object.defineProperty(ax,"__esModule",{value:!0});var oJ=ga(),aJ=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=oJ.path.makeAbsolute(this._settings.cwd,r),r=oJ.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};ax.default=aJ});var uy=I(Ax=>{"use strict";Object.defineProperty(Ax,"__esModule",{value:!0});var Y0e=require("path"),q0e=tJ(),J0e=iJ(),W0e=sJ(),z0e=AJ(),lJ=class{constructor(e){this._settings=e,this.errorFilter=new W0e.default(this._settings),this.entryFilter=new J0e.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new q0e.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new z0e.default(this._settings)}_getRootDirectory(e){return Y0e.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};Ax.default=lJ});var uJ=I(lx=>{"use strict";Object.defineProperty(lx,"__esModule",{value:!0});var V0e=tx(),_0e=uy(),cJ=class extends _0e.default{constructor(){super(...arguments);this._reader=new V0e.default(this._settings)}read(e){let r=this._getRootDirectory(e),i=this._getReaderOptions(e),n=[];return new Promise((s,o)=>{let a=this.api(r,e,i);a.once("error",o),a.on("data",l=>n.push(i.transform(l))),a.once("end",()=>s(n))})}api(e,r,i){return r.dynamic?this._reader.dynamic(e,i):this._reader.static(r.patterns,i)}};lx.default=cJ});var fJ=I(cx=>{"use strict";Object.defineProperty(cx,"__esModule",{value:!0});var X0e=require("stream"),Z0e=tx(),$0e=uy(),gJ=class extends $0e.default{constructor(){super(...arguments);this._reader=new Z0e.default(this._settings)}read(e){let r=this._getRootDirectory(e),i=this._getReaderOptions(e),n=this.api(r,e,i),s=new X0e.Readable({objectMode:!0,read:()=>{}});return n.once("error",o=>s.emit("error",o)).on("data",o=>s.emit("data",i.transform(o))).once("end",()=>s.emit("end")),s.once("close",()=>n.destroy()),s}api(e,r,i){return r.dynamic?this._reader.dynamic(e,i):this._reader.static(r.patterns,i)}};cx.default=gJ});var pJ=I(ux=>{"use strict";Object.defineProperty(ux,"__esModule",{value:!0});var eQe=Tl(),tQe=XS(),rQe=$S(),hJ=class extends rQe.default{constructor(){super(...arguments);this._walkSync=tQe.walkSync,this._statSync=eQe.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let i=[];for(let n of e){let s=this._getFullEntryPath(n),o=this._getEntry(s,n,r);o===null||!r.entryFilter(o)||i.push(o)}return i}_getEntry(e,r,i){try{let n=this._getStat(e);return this._makeEntry(n,r)}catch(n){if(i.errorFilter(n))return null;throw n}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};ux.default=hJ});var CJ=I(gx=>{"use strict";Object.defineProperty(gx,"__esModule",{value:!0});var iQe=pJ(),nQe=uy(),dJ=class extends nQe.default{constructor(){super(...arguments);this._reader=new iQe.default(this._settings)}read(e){let r=this._getRootDirectory(e),i=this._getReaderOptions(e);return this.api(r,e,i).map(i.transform)}api(e,r,i){return r.dynamic?this._reader.dynamic(e,i):this._reader.static(r.patterns,i)}};gx.default=dJ});var IJ=I(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});var Fu=require("fs"),sQe=require("os"),oQe=sQe.cpus().length;np.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:Fu.lstat,lstatSync:Fu.lstatSync,stat:Fu.stat,statSync:Fu.statSync,readdir:Fu.readdir,readdirSync:Fu.readdirSync};var mJ=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,oQe),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,Infinity),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},np.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};np.default=mJ});var gy=I((Oit,EJ)=>{"use strict";var yJ=tq(),aQe=uJ(),AQe=fJ(),lQe=CJ(),fx=IJ(),Ml=ga();async function px(t,e){Nu(t);let r=hx(t,aQe.default,e),i=await Promise.all(r);return Ml.array.flatten(i)}(function(t){function e(o,a){Nu(o);let l=hx(o,lQe.default,a);return Ml.array.flatten(l)}t.sync=e;function r(o,a){Nu(o);let l=hx(o,AQe.default,a);return Ml.stream.merge(l)}t.stream=r;function i(o,a){Nu(o);let l=[].concat(o),c=new fx.default(a);return yJ.generate(l,c)}t.generateTasks=i;function n(o,a){Nu(o);let l=new fx.default(a);return Ml.pattern.isDynamicPattern(o,l)}t.isDynamicPattern=n;function s(o){return Nu(o),Ml.path.escape(o)}t.escapePath=s})(px||(px={}));function hx(t,e,r){let i=[].concat(t),n=new fx.default(r),s=yJ.generate(i,n),o=new e(n);return s.map(o.read,o)}function Nu(t){if(![].concat(t).every(i=>Ml.string.isString(i)&&!Ml.string.isEmpty(i)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}EJ.exports=px});var BJ=I(Ol=>{"use strict";var{promisify:cQe}=require("util"),wJ=require("fs");async function dx(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await cQe(wJ[t])(r))[e]()}catch(i){if(i.code==="ENOENT")return!1;throw i}}function Cx(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return wJ[t](r)[e]()}catch(i){if(i.code==="ENOENT")return!1;throw i}}Ol.isFile=dx.bind(null,"stat","isFile");Ol.isDirectory=dx.bind(null,"stat","isDirectory");Ol.isSymlink=dx.bind(null,"lstat","isSymbolicLink");Ol.isFileSync=Cx.bind(null,"statSync","isFile");Ol.isDirectorySync=Cx.bind(null,"statSync","isDirectory");Ol.isSymlinkSync=Cx.bind(null,"lstatSync","isSymbolicLink")});var xJ=I((Uit,mx)=>{"use strict";var Kl=require("path"),QJ=BJ(),bJ=t=>t.length>1?`{${t.join(",")}}`:t[0],vJ=(t,e)=>{let r=t[0]==="!"?t.slice(1):t;return Kl.isAbsolute(r)?r:Kl.join(e,r)},uQe=(t,e)=>Kl.extname(t)?`**/${t}`:`**/${t}.${bJ(e)}`,SJ=(t,e)=>{if(e.files&&!Array.isArray(e.files))throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof e.files}\``);if(e.extensions&&!Array.isArray(e.extensions))throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof e.extensions}\``);return e.files&&e.extensions?e.files.map(r=>Kl.posix.join(t,uQe(r,e.extensions))):e.files?e.files.map(r=>Kl.posix.join(t,`**/${r}`)):e.extensions?[Kl.posix.join(t,`**/*.${bJ(e.extensions)}`)]:[Kl.posix.join(t,"**")]};mx.exports=async(t,e)=>{if(e=P({cwd:process.cwd()},e),typeof e.cwd!="string")throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof e.cwd}\``);let r=await Promise.all([].concat(t).map(async i=>await QJ.isDirectory(vJ(i,e.cwd))?SJ(i,e):i));return[].concat.apply([],r)};mx.exports.sync=(t,e)=>{if(e=P({cwd:process.cwd()},e),typeof e.cwd!="string")throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof e.cwd}\``);let r=[].concat(t).map(i=>QJ.isDirectorySync(vJ(i,e.cwd))?SJ(i,e):i);return[].concat.apply([],r)}});var TJ=I((Hit,kJ)=>{function PJ(t){return Array.isArray(t)?t:[t]}var gQe=/^\s+$/,fQe=/^\\!/,hQe=/^\\#/,pQe=/\r?\n/g,dQe=/^\.*\/|^\.+$/,Ix="/",DJ=typeof Symbol!="undefined"?Symbol.for("node-ignore"):"node-ignore",CQe=(t,e,r)=>Object.defineProperty(t,e,{value:r}),mQe=/([0-z])-([0-z])/g,IQe=t=>t.replace(mQe,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:""),EQe=[[/\\?\s+$/,t=>t.indexOf("\\")===0?" ":""],[/\\\s/g,()=>" "],[/[\\^$.|*+(){]/g,t=>`\\${t}`],[/\[([^\]/]*)($|\])/g,(t,e,r)=>r==="]"?`[${IQe(e)}]`:`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6`${e}[^\\/]*`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`],[/\\\\\\/g,()=>"\\"]],RJ=Object.create(null),yQe=(t,e,r)=>{let i=RJ[t];if(i)return i;let n=EQe.reduce((s,o)=>s.replace(o[0],o[1].bind(t)),t);return RJ[t]=r?new RegExp(n,"i"):new RegExp(n)},Ex=t=>typeof t=="string",wQe=t=>t&&Ex(t)&&!gQe.test(t)&&t.indexOf("#")!==0,BQe=t=>t.split(pQe),FJ=class{constructor(e,r,i,n){this.origin=e,this.pattern=r,this.negative=i,this.regex=n}},QQe=(t,e)=>{let r=t,i=!1;t.indexOf("!")===0&&(i=!0,t=t.substr(1)),t=t.replace(fQe,"!").replace(hQe,"#");let n=yQe(t,i,e);return new FJ(r,t,i,n)},bQe=(t,e)=>{throw new e(t)},ha=(t,e,r)=>Ex(t)?t?ha.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),NJ=t=>dQe.test(t);ha.isNotRelative=NJ;ha.convert=t=>t;var LJ=class{constructor({ignorecase:e=!0}={}){this._rules=[],this._ignorecase=e,CQe(this,DJ,!0),this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[DJ]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(wQe(e)){let r=QQe(e,this._ignorecase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,PJ(Ex(e)?BQe(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let i=!1,n=!1;return this._rules.forEach(s=>{let{negative:o}=s;if(n===o&&i!==n||o&&!i&&!n&&!r)return;s.regex.test(e)&&(i=!o,n=o)}),{ignored:i,unignored:n}}_test(e,r,i,n){let s=e&&ha.convert(e);return ha(s,e,bQe),this._t(s,r,i,n)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(Ix)),n.pop(),!n.length)return r[e]=this._testOne(e,i);let s=this._t(n.join(Ix)+Ix,r,i,n);return r[e]=s.ignored?s:this._testOne(e,i)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return PJ(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},fy=t=>new LJ(t),vQe=()=>!1,SQe=t=>ha(t&&ha.convert(t),t,vQe);fy.isPathValid=SQe;fy.default=fy;kJ.exports=fy;if(typeof process!="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");ha.convert=t;let e=/^[a-z]:\//i;ha.isNotRelative=r=>e.test(r)||NJ(r)}});var OJ=I((Git,MJ)=>{"use strict";MJ.exports=t=>{let e=/^\\\\\?\\/.test(t),r=/[^\u0000-\u0080]+/.test(t);return e||r?t:t.replace(/\\/g,"/")}});var qJ=I((jit,yx)=>{"use strict";var{promisify:xQe}=require("util"),KJ=require("fs"),pa=require("path"),UJ=gy(),kQe=TJ(),sp=OJ(),HJ=["**/node_modules/**","**/flow-typed/**","**/coverage/**","**/.git"],PQe=xQe(KJ.readFile),DQe=t=>e=>e.startsWith("!")?"!"+pa.posix.join(t,e.slice(1)):pa.posix.join(t,e),RQe=(t,e)=>{let r=sp(pa.relative(e.cwd,pa.dirname(e.fileName)));return t.split(/\r?\n/).filter(Boolean).filter(i=>!i.startsWith("#")).map(DQe(r))},GJ=t=>{let e=kQe();for(let r of t)e.add(RQe(r.content,{cwd:r.cwd,fileName:r.filePath}));return e},FQe=(t,e)=>{if(t=sp(t),pa.isAbsolute(e)){if(sp(e).startsWith(t))return e;throw new Error(`Path ${e} is not in cwd ${t}`)}return pa.join(t,e)},jJ=(t,e)=>r=>t.ignores(sp(pa.relative(e,FQe(e,r.path||r)))),NQe=async(t,e)=>{let r=pa.join(e,t),i=await PQe(r,"utf8");return{cwd:e,filePath:r,content:i}},LQe=(t,e)=>{let r=pa.join(e,t),i=KJ.readFileSync(r,"utf8");return{cwd:e,filePath:r,content:i}},YJ=({ignore:t=[],cwd:e=sp(process.cwd())}={})=>({ignore:t,cwd:e});yx.exports=async t=>{t=YJ(t);let e=await UJ("**/.gitignore",{ignore:HJ.concat(t.ignore),cwd:t.cwd}),r=await Promise.all(e.map(n=>NQe(n,t.cwd))),i=GJ(r);return jJ(i,t.cwd)};yx.exports.sync=t=>{t=YJ(t);let r=UJ.sync("**/.gitignore",{ignore:HJ.concat(t.ignore),cwd:t.cwd}).map(n=>LQe(n,t.cwd)),i=GJ(r);return jJ(i,t.cwd)}});var VJ=I((Yit,JJ)=>{"use strict";var{Transform:TQe}=require("stream"),wx=class extends TQe{constructor(){super({objectMode:!0})}},WJ=class extends wx{constructor(e){super();this._filter=e}_transform(e,r,i){this._filter(e)&&this.push(e),i()}},zJ=class extends wx{constructor(){super();this._pushed=new Set}_transform(e,r,i){this._pushed.has(e)||(this.push(e),this._pushed.add(e)),i()}};JJ.exports={FilterStream:WJ,UniqueStream:zJ}});var vx=I((qit,Ul)=>{"use strict";var _J=require("fs"),hy=QY(),MQe=wS(),py=gy(),dy=xJ(),Bx=qJ(),{FilterStream:OQe,UniqueStream:KQe}=VJ(),XJ=()=>!1,ZJ=t=>t[0]==="!",UQe=t=>{if(!t.every(e=>typeof e=="string"))throw new TypeError("Patterns must be a string or an array of strings")},HQe=(t={})=>{if(!t.cwd)return;let e;try{e=_J.statSync(t.cwd)}catch{return}if(!e.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},GQe=t=>t.stats instanceof _J.Stats?t.path:t,Cy=(t,e)=>{t=hy([].concat(t)),UQe(t),HQe(e);let r=[];e=P({ignore:[],expandDirectories:!0},e);for(let[i,n]of t.entries()){if(ZJ(n))continue;let s=t.slice(i).filter(a=>ZJ(a)).map(a=>a.slice(1)),o=_(P({},e),{ignore:e.ignore.concat(s)});r.push({pattern:n,options:o})}return r},jQe=(t,e)=>{let r={};return t.options.cwd&&(r.cwd=t.options.cwd),Array.isArray(t.options.expandDirectories)?r=_(P({},r),{files:t.options.expandDirectories}):typeof t.options.expandDirectories=="object"&&(r=P(P({},r),t.options.expandDirectories)),e(t.pattern,r)},Qx=(t,e)=>t.options.expandDirectories?jQe(t,e):[t.pattern],$J=t=>t&&t.gitignore?Bx.sync({cwd:t.cwd,ignore:t.ignore}):XJ,bx=t=>e=>{let{options:r}=t;return r.ignore&&Array.isArray(r.ignore)&&r.expandDirectories&&(r.ignore=dy.sync(r.ignore)),{pattern:e,options:r}};Ul.exports=async(t,e)=>{let r=Cy(t,e),i=async()=>e&&e.gitignore?Bx({cwd:e.cwd,ignore:e.ignore}):XJ,n=async()=>{let l=await Promise.all(r.map(async c=>{let u=await Qx(c,dy);return Promise.all(u.map(bx(c)))}));return hy(...l)},[s,o]=await Promise.all([i(),n()]),a=await Promise.all(o.map(l=>py(l.pattern,l.options)));return hy(...a).filter(l=>!s(GQe(l)))};Ul.exports.sync=(t,e)=>{let r=Cy(t,e),i=[];for(let o of r){let a=Qx(o,dy.sync).map(bx(o));i.push(...a)}let n=$J(e),s=[];for(let o of i)s=hy(s,py.sync(o.pattern,o.options));return s.filter(o=>!n(o))};Ul.exports.stream=(t,e)=>{let r=Cy(t,e),i=[];for(let a of r){let l=Qx(a,dy.sync).map(bx(a));i.push(...l)}let n=$J(e),s=new OQe(a=>!n(a)),o=new KQe;return MQe(i.map(a=>py.stream(a.pattern,a.options))).pipe(s).pipe(o)};Ul.exports.generateGlobTasks=Cy;Ul.exports.hasMagic=(t,e)=>[].concat(t).some(r=>py.isDynamicPattern(r,e));Ul.exports.gitignore=Bx});var Ca=I((da,Dy)=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});var A3=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function ibe(t){return A3.includes(t)}var nbe=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...A3];function sbe(t){return nbe.includes(t)}var obe=["null","undefined","string","number","bigint","boolean","symbol"];function abe(t){return obe.includes(t)}function Hu(t){return e=>typeof e===t}var{toString:l3}=Object.prototype,mp=t=>{let e=l3.call(t).slice(8,-1);if(/HTML\w+Element/.test(e)&&j.domElement(t))return"HTMLElement";if(sbe(e))return e},er=t=>e=>mp(e)===t;function j(t){if(t===null)return"null";switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(j.observable(t))return"Observable";if(j.array(t))return"Array";if(j.buffer(t))return"Buffer";let e=mp(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}j.undefined=Hu("undefined");j.string=Hu("string");var Abe=Hu("number");j.number=t=>Abe(t)&&!j.nan(t);j.bigint=Hu("bigint");j.function_=Hu("function");j.null_=t=>t===null;j.class_=t=>j.function_(t)&&t.toString().startsWith("class ");j.boolean=t=>t===!0||t===!1;j.symbol=Hu("symbol");j.numericString=t=>j.string(t)&&!j.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));j.array=(t,e)=>Array.isArray(t)?j.function_(e)?t.every(e):!0:!1;j.buffer=t=>{var e,r,i,n;return(n=(i=(r=(e=t)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.isBuffer)===null||i===void 0?void 0:i.call(r,t))!==null&&n!==void 0?n:!1};j.nullOrUndefined=t=>j.null_(t)||j.undefined(t);j.object=t=>!j.null_(t)&&(typeof t=="object"||j.function_(t));j.iterable=t=>{var e;return j.function_((e=t)===null||e===void 0?void 0:e[Symbol.iterator])};j.asyncIterable=t=>{var e;return j.function_((e=t)===null||e===void 0?void 0:e[Symbol.asyncIterator])};j.generator=t=>j.iterable(t)&&j.function_(t.next)&&j.function_(t.throw);j.asyncGenerator=t=>j.asyncIterable(t)&&j.function_(t.next)&&j.function_(t.throw);j.nativePromise=t=>er("Promise")(t);var lbe=t=>{var e,r;return j.function_((e=t)===null||e===void 0?void 0:e.then)&&j.function_((r=t)===null||r===void 0?void 0:r.catch)};j.promise=t=>j.nativePromise(t)||lbe(t);j.generatorFunction=er("GeneratorFunction");j.asyncGeneratorFunction=t=>mp(t)==="AsyncGeneratorFunction";j.asyncFunction=t=>mp(t)==="AsyncFunction";j.boundFunction=t=>j.function_(t)&&!t.hasOwnProperty("prototype");j.regExp=er("RegExp");j.date=er("Date");j.error=er("Error");j.map=t=>er("Map")(t);j.set=t=>er("Set")(t);j.weakMap=t=>er("WeakMap")(t);j.weakSet=t=>er("WeakSet")(t);j.int8Array=er("Int8Array");j.uint8Array=er("Uint8Array");j.uint8ClampedArray=er("Uint8ClampedArray");j.int16Array=er("Int16Array");j.uint16Array=er("Uint16Array");j.int32Array=er("Int32Array");j.uint32Array=er("Uint32Array");j.float32Array=er("Float32Array");j.float64Array=er("Float64Array");j.bigInt64Array=er("BigInt64Array");j.bigUint64Array=er("BigUint64Array");j.arrayBuffer=er("ArrayBuffer");j.sharedArrayBuffer=er("SharedArrayBuffer");j.dataView=er("DataView");j.directInstanceOf=(t,e)=>Object.getPrototypeOf(t)===e.prototype;j.urlInstance=t=>er("URL")(t);j.urlString=t=>{if(!j.string(t))return!1;try{return new URL(t),!0}catch(e){return!1}};j.truthy=t=>Boolean(t);j.falsy=t=>!t;j.nan=t=>Number.isNaN(t);j.primitive=t=>j.null_(t)||abe(typeof t);j.integer=t=>Number.isInteger(t);j.safeInteger=t=>Number.isSafeInteger(t);j.plainObject=t=>{if(l3.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};j.typedArray=t=>ibe(mp(t));var cbe=t=>j.safeInteger(t)&&t>=0;j.arrayLike=t=>!j.nullOrUndefined(t)&&!j.function_(t)&&cbe(t.length);j.inRange=(t,e)=>{if(j.number(e))return t>=Math.min(0,e)&&t<=Math.max(e,0);if(j.array(e)&&e.length===2)return t>=Math.min(...e)&&t<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var ube=1,gbe=["innerHTML","ownerDocument","style","attributes","nodeValue"];j.domElement=t=>j.object(t)&&t.nodeType===ube&&j.string(t.nodeName)&&!j.plainObject(t)&&gbe.every(e=>e in t);j.observable=t=>{var e,r,i,n;return t?t===((r=(e=t)[Symbol.observable])===null||r===void 0?void 0:r.call(e))||t===((n=(i=t)["@@observable"])===null||n===void 0?void 0:n.call(i)):!1};j.nodeStream=t=>j.object(t)&&j.function_(t.pipe)&&!j.observable(t);j.infinite=t=>t===Infinity||t===-Infinity;var c3=t=>e=>j.integer(e)&&Math.abs(e%2)===t;j.evenInteger=c3(0);j.oddInteger=c3(1);j.emptyArray=t=>j.array(t)&&t.length===0;j.nonEmptyArray=t=>j.array(t)&&t.length>0;j.emptyString=t=>j.string(t)&&t.length===0;j.nonEmptyString=t=>j.string(t)&&t.length>0;var fbe=t=>j.string(t)&&!/\S/.test(t);j.emptyStringOrWhitespace=t=>j.emptyString(t)||fbe(t);j.emptyObject=t=>j.object(t)&&!j.map(t)&&!j.set(t)&&Object.keys(t).length===0;j.nonEmptyObject=t=>j.object(t)&&!j.map(t)&&!j.set(t)&&Object.keys(t).length>0;j.emptySet=t=>j.set(t)&&t.size===0;j.nonEmptySet=t=>j.set(t)&&t.size>0;j.emptyMap=t=>j.map(t)&&t.size===0;j.nonEmptyMap=t=>j.map(t)&&t.size>0;j.propertyKey=t=>j.any([j.string,j.number,j.symbol],t);j.formData=t=>er("FormData")(t);j.urlSearchParams=t=>er("URLSearchParams")(t);var u3=(t,e,r)=>{if(!j.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(r.length===0)throw new TypeError("Invalid number of values");return t.call(r,e)};j.any=(t,...e)=>(j.array(t)?t:[t]).some(i=>u3(Array.prototype.some,i,e));j.all=(t,...e)=>u3(Array.prototype.every,t,e);var Te=(t,e,r,i={})=>{if(!t){let{multipleValues:n}=i,s=n?`received values of types ${[...new Set(r.map(o=>`\`${j(o)}\``))].join(", ")}`:`received value of type \`${j(r)}\``;throw new TypeError(`Expected value which is \`${e}\`, ${s}.`)}};da.assert={undefined:t=>Te(j.undefined(t),"undefined",t),string:t=>Te(j.string(t),"string",t),number:t=>Te(j.number(t),"number",t),bigint:t=>Te(j.bigint(t),"bigint",t),function_:t=>Te(j.function_(t),"Function",t),null_:t=>Te(j.null_(t),"null",t),class_:t=>Te(j.class_(t),"Class",t),boolean:t=>Te(j.boolean(t),"boolean",t),symbol:t=>Te(j.symbol(t),"symbol",t),numericString:t=>Te(j.numericString(t),"string with a number",t),array:(t,e)=>{Te(j.array(t),"Array",t),e&&t.forEach(e)},buffer:t=>Te(j.buffer(t),"Buffer",t),nullOrUndefined:t=>Te(j.nullOrUndefined(t),"null or undefined",t),object:t=>Te(j.object(t),"Object",t),iterable:t=>Te(j.iterable(t),"Iterable",t),asyncIterable:t=>Te(j.asyncIterable(t),"AsyncIterable",t),generator:t=>Te(j.generator(t),"Generator",t),asyncGenerator:t=>Te(j.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>Te(j.nativePromise(t),"native Promise",t),promise:t=>Te(j.promise(t),"Promise",t),generatorFunction:t=>Te(j.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>Te(j.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>Te(j.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>Te(j.boundFunction(t),"Function",t),regExp:t=>Te(j.regExp(t),"RegExp",t),date:t=>Te(j.date(t),"Date",t),error:t=>Te(j.error(t),"Error",t),map:t=>Te(j.map(t),"Map",t),set:t=>Te(j.set(t),"Set",t),weakMap:t=>Te(j.weakMap(t),"WeakMap",t),weakSet:t=>Te(j.weakSet(t),"WeakSet",t),int8Array:t=>Te(j.int8Array(t),"Int8Array",t),uint8Array:t=>Te(j.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>Te(j.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>Te(j.int16Array(t),"Int16Array",t),uint16Array:t=>Te(j.uint16Array(t),"Uint16Array",t),int32Array:t=>Te(j.int32Array(t),"Int32Array",t),uint32Array:t=>Te(j.uint32Array(t),"Uint32Array",t),float32Array:t=>Te(j.float32Array(t),"Float32Array",t),float64Array:t=>Te(j.float64Array(t),"Float64Array",t),bigInt64Array:t=>Te(j.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>Te(j.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>Te(j.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>Te(j.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>Te(j.dataView(t),"DataView",t),urlInstance:t=>Te(j.urlInstance(t),"URL",t),urlString:t=>Te(j.urlString(t),"string with a URL",t),truthy:t=>Te(j.truthy(t),"truthy",t),falsy:t=>Te(j.falsy(t),"falsy",t),nan:t=>Te(j.nan(t),"NaN",t),primitive:t=>Te(j.primitive(t),"primitive",t),integer:t=>Te(j.integer(t),"integer",t),safeInteger:t=>Te(j.safeInteger(t),"integer",t),plainObject:t=>Te(j.plainObject(t),"plain object",t),typedArray:t=>Te(j.typedArray(t),"TypedArray",t),arrayLike:t=>Te(j.arrayLike(t),"array-like",t),domElement:t=>Te(j.domElement(t),"HTMLElement",t),observable:t=>Te(j.observable(t),"Observable",t),nodeStream:t=>Te(j.nodeStream(t),"Node.js Stream",t),infinite:t=>Te(j.infinite(t),"infinite number",t),emptyArray:t=>Te(j.emptyArray(t),"empty array",t),nonEmptyArray:t=>Te(j.nonEmptyArray(t),"non-empty array",t),emptyString:t=>Te(j.emptyString(t),"empty string",t),nonEmptyString:t=>Te(j.nonEmptyString(t),"non-empty string",t),emptyStringOrWhitespace:t=>Te(j.emptyStringOrWhitespace(t),"empty string or whitespace",t),emptyObject:t=>Te(j.emptyObject(t),"empty object",t),nonEmptyObject:t=>Te(j.nonEmptyObject(t),"non-empty object",t),emptySet:t=>Te(j.emptySet(t),"empty set",t),nonEmptySet:t=>Te(j.nonEmptySet(t),"non-empty set",t),emptyMap:t=>Te(j.emptyMap(t),"empty map",t),nonEmptyMap:t=>Te(j.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>Te(j.propertyKey(t),"PropertyKey",t),formData:t=>Te(j.formData(t),"FormData",t),urlSearchParams:t=>Te(j.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>Te(j.evenInteger(t),"even integer",t),oddInteger:t=>Te(j.oddInteger(t),"odd integer",t),directInstanceOf:(t,e)=>Te(j.directInstanceOf(t,e),"T",t),inRange:(t,e)=>Te(j.inRange(t,e),"in range",t),any:(t,...e)=>Te(j.any(t,...e),"predicate returns truthy for any value",e,{multipleValues:!0}),all:(t,...e)=>Te(j.all(t,...e),"predicate returns truthy for all values",e,{multipleValues:!0})};Object.defineProperties(j,{class:{value:j.class_},function:{value:j.function_},null:{value:j.null_}});Object.defineProperties(da.assert,{class:{value:da.assert.class_},function:{value:da.assert.function_},null:{value:da.assert.null_}});da.default=j;Dy.exports=j;Dy.exports.default=j;Dy.exports.assert=da.assert});var g3=I((gnt,Ux)=>{"use strict";var Hx=class extends Error{constructor(e){super(e||"Promise was canceled");this.name="CancelError"}get isCanceled(){return!0}},Ip=class{static fn(e){return(...r)=>new Ip((i,n,s)=>{r.push(s),e(...r).then(i,n)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((r,i)=>{this._reject=i;let n=a=>{this._isPending=!1,r(a)},s=a=>{this._isPending=!1,i(a)},o=a=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(a)};return Object.defineProperties(o,{shouldReject:{get:()=>this._rejectOnCancel,set:a=>{this._rejectOnCancel=a}}}),e(n,s,o)})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._cancelHandlers.length>0)try{for(let r of this._cancelHandlers)r()}catch(r){this._reject(r)}this._isCanceled=!0,this._rejectOnCancel&&this._reject(new Hx(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(Ip.prototype,Promise.prototype);Ux.exports=Ip;Ux.exports.CancelError=Hx});var f3=I((Gx,jx)=>{"use strict";Object.defineProperty(Gx,"__esModule",{value:!0});var hbe=require("tls"),Yx=(t,e)=>{let r;typeof e=="function"?r={connect:e}:r=e;let i=typeof r.connect=="function",n=typeof r.secureConnect=="function",s=typeof r.close=="function",o=()=>{i&&r.connect(),t instanceof hbe.TLSSocket&&n&&(t.authorized?r.secureConnect():t.authorizationError||t.once("secureConnect",r.secureConnect)),s&&t.once("close",r.close)};t.writable&&!t.connecting?o():t.connecting?t.once("connect",o):t.destroyed&&s&&r.close(t._hadError)};Gx.default=Yx;jx.exports=Yx;jx.exports.default=Yx});var h3=I((qx,Jx)=>{"use strict";Object.defineProperty(qx,"__esModule",{value:!0});var pbe=f3(),dbe=Number(process.versions.node.split(".")[0]),Wx=t=>{let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};t.timings=e;let r=o=>{let a=o.emit.bind(o);o.emit=(l,...c)=>(l==="error"&&(e.error=Date.now(),e.phases.total=e.error-e.start,o.emit=a),a(l,...c))};r(t),t.prependOnceListener("abort",()=>{e.abort=Date.now(),(!e.response||dbe>=13)&&(e.phases.total=Date.now()-e.start)});let i=o=>{e.socket=Date.now(),e.phases.wait=e.socket-e.start;let a=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};o.prependOnceListener("lookup",a),pbe.default(o,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(o.removeListener("lookup",a),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};t.socket?i(t.socket):t.prependOnceListener("socket",i);let n=()=>{var o;e.upload=Date.now(),e.phases.request=e.upload-(o=e.secureConnect,o!=null?o:e.connect)};return(()=>typeof t.writableFinished=="boolean"?t.writableFinished:t.finished&&t.outputSize===0&&(!t.socket||t.socket.writableLength===0))()?n():t.prependOnceListener("finish",n),t.prependOnceListener("response",o=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,o.timings=e,r(o),o.prependOnceListener("end",()=>{e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start})}),e};qx.default=Wx;Jx.exports=Wx;Jx.exports.default=Wx});var y3=I((fnt,zx)=>{"use strict";var{V4MAPPED:Cbe,ADDRCONFIG:mbe,ALL:p3,promises:{Resolver:d3},lookup:Ibe}=require("dns"),{promisify:Vx}=require("util"),Ebe=require("os"),Gu=Symbol("cacheableLookupCreateConnection"),_x=Symbol("cacheableLookupInstance"),C3=Symbol("expires"),ybe=typeof p3=="number",m3=t=>{if(!(t&&typeof t.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},wbe=t=>{for(let e of t)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},I3=()=>{let t=!1,e=!1;for(let r of Object.values(Ebe.networkInterfaces()))for(let i of r)if(!i.internal&&(i.family==="IPv6"?e=!0:t=!0,t&&e))return{has4:t,has6:e};return{has4:t,has6:e}},Bbe=t=>Symbol.iterator in t,E3={ttl:!0},Qbe={all:!0},Xx=class{constructor({cache:e=new Map,maxTtl:r=Infinity,fallbackDuration:i=3600,errorTtl:n=.15,resolver:s=new d3,lookup:o=Ibe}={}){if(this.maxTtl=r,this.errorTtl=n,this._cache=e,this._resolver=s,this._dnsLookup=Vx(o),this._resolver instanceof d3?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=Vx(this._resolver.resolve4.bind(this._resolver)),this._resolve6=Vx(this._resolver.resolve6.bind(this._resolver))),this._iface=I3(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,i<1)this._fallback=!1;else{this._fallback=!0;let a=setInterval(()=>{this._hostnamesToFallback.clear()},i*1e3);a.unref&&a.unref()}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,r,i){if(typeof r=="function"?(i=r,r={}):typeof r=="number"&&(r={family:r}),!i)throw new Error("Callback must be a function.");this.lookupAsync(e,r).then(n=>{r.all?i(null,n):i(null,n.address,n.family,n.expires,n.ttl)},i)}async lookupAsync(e,r={}){typeof r=="number"&&(r={family:r});let i=await this.query(e);if(r.family===6){let n=i.filter(s=>s.family===6);r.hints&Cbe&&(ybe&&r.hints&p3||n.length===0)?wbe(i):i=n}else r.family===4&&(i=i.filter(n=>n.family===4));if(r.hints&mbe){let{_iface:n}=this;i=i.filter(s=>s.family===6?n.has6:n.has4)}if(i.length===0){let n=new Error(`cacheableLookup ENOTFOUND ${e}`);throw n.code="ENOTFOUND",n.hostname=e,n}return r.all?i:i[0]}async query(e){let r=await this._cache.get(e);if(!r){let i=this._pending[e];if(i)r=await i;else{let n=this.queryAndCache(e);this._pending[e]=n,r=await n}}return r=r.map(i=>P({},i)),r}async _resolve(e){let r=async c=>{try{return await c}catch(u){if(u.code==="ENODATA"||u.code==="ENOTFOUND")return[];throw u}},[i,n]=await Promise.all([this._resolve4(e,E3),this._resolve6(e,E3)].map(c=>r(c))),s=0,o=0,a=0,l=Date.now();for(let c of i)c.family=4,c.expires=l+c.ttl*1e3,s=Math.max(s,c.ttl);for(let c of n)c.family=6,c.expires=l+c.ttl*1e3,o=Math.max(o,c.ttl);return i.length>0?n.length>0?a=Math.min(s,o):a=s:a=o,{entries:[...i,...n],cacheTtl:a}}async _lookup(e){try{return{entries:await this._dnsLookup(e,{all:!0}),cacheTtl:0}}catch(r){return{entries:[],cacheTtl:0}}}async _set(e,r,i){if(this.maxTtl>0&&i>0){i=Math.min(i,this.maxTtl)*1e3,r[C3]=Date.now()+i;try{await this._cache.set(e,r,i)}catch(n){this.lookupAsync=async()=>{let s=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw s.cause=n,s}}Bbe(this._cache)&&this._tick(i)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,Qbe);try{let r=await this._resolve(e);r.entries.length===0&&this._fallback&&(r=await this._lookup(e),r.entries.length!==0&&this._hostnamesToFallback.add(e));let i=r.entries.length===0?this.errorTtl:r.cacheTtl;return await this._set(e,r.entries,i),delete this._pending[e],r.entries}catch(r){throw delete this._pending[e],r}}_tick(e){let r=this._nextRemovalTime;(!r||e{this._nextRemovalTime=!1;let i=Infinity,n=Date.now();for(let[s,o]of this._cache){let a=o[C3];n>=a?this._cache.delete(s):a("lookup"in r||(r.lookup=this.lookup),e[Gu](r,i))}uninstall(e){if(m3(e),e[Gu]){if(e[_x]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[Gu],delete e[Gu],delete e[_x]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=I3(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};zx.exports=Xx;zx.exports.default=Xx});var Q3=I((hnt,Zx)=>{"use strict";var bbe=typeof URL=="undefined"?require("url").URL:URL,vbe="text/plain",Sbe="us-ascii",w3=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),xbe=(t,{stripHash:e})=>{let r=t.match(/^data:([^,]*?),([^#]*?)(?:#(.*))?$/);if(!r)throw new Error(`Invalid URL: ${t}`);let i=r[1].split(";"),n=r[2],s=e?"":r[3],o=!1;i[i.length-1]==="base64"&&(i.pop(),o=!0);let a=(i.shift()||"").toLowerCase(),c=[...i.map(u=>{let[g,f=""]=u.split("=").map(h=>h.trim());return g==="charset"&&(f=f.toLowerCase(),f===Sbe)?"":`${g}${f?`=${f}`:""}`}).filter(Boolean)];return o&&c.push("base64"),(c.length!==0||a&&a!==vbe)&&c.unshift(a),`data:${c.join(";")},${o?n.trim():n}${s?`#${s}`:""}`},B3=(t,e)=>{if(e=P({defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0},e),Reflect.has(e,"normalizeHttps"))throw new Error("options.normalizeHttps is renamed to options.forceHttp");if(Reflect.has(e,"normalizeHttp"))throw new Error("options.normalizeHttp is renamed to options.forceHttps");if(Reflect.has(e,"stripFragment"))throw new Error("options.stripFragment is renamed to options.stripHash");if(t=t.trim(),/^data:/i.test(t))return xbe(t,e);let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let n=new bbe(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&n.protocol==="https:"&&(n.protocol="http:"),e.forceHttps&&n.protocol==="http:"&&(n.protocol="https:"),e.stripAuthentication&&(n.username="",n.password=""),e.stripHash&&(n.hash=""),n.pathname&&(n.pathname=n.pathname.replace(/((?!:).|^)\/{2,}/g,(s,o)=>/^(?!\/)/g.test(o)?`${o}/`:"/")),n.pathname&&(n.pathname=decodeURI(n.pathname)),e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let s=n.pathname.split("/"),o=s[s.length-1];w3(o,e.removeDirectoryIndex)&&(s=s.slice(0,s.length-1),n.pathname=s.slice(1).join("/")+"/")}if(n.hostname&&(n.hostname=n.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(n.hostname)&&(n.hostname=n.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let s of[...n.searchParams.keys()])w3(s,e.removeQueryParameters)&&n.searchParams.delete(s);return e.sortQueryParameters&&n.searchParams.sort(),e.removeTrailingSlash&&(n.pathname=n.pathname.replace(/\/$/,"")),t=n.toString(),(e.removeTrailingSlash||n.pathname==="/")&&n.hash===""&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t};Zx.exports=B3;Zx.exports.default=B3});var S3=I((pnt,b3)=>{b3.exports=v3;function v3(t,e){if(t&&e)return v3(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(i){r[i]=t[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n{var x3=S3();$x.exports=x3(Ry);$x.exports.strict=x3(k3);Ry.proto=Ry(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Ry(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return k3(this)},configurable:!0})});function Ry(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function k3(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}});var tk=I((Cnt,P3)=>{var kbe=ek(),Pbe=function(){},Dbe=function(t){return t.setHeader&&typeof t.abort=="function"},Rbe=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},D3=function(t,e,r){if(typeof e=="function")return D3(t,null,e);e||(e={}),r=kbe(r||Pbe);var i=t._writableState,n=t._readableState,s=e.readable||e.readable!==!1&&t.readable,o=e.writable||e.writable!==!1&&t.writable,a=function(){t.writable||l()},l=function(){o=!1,s||r.call(t)},c=function(){s=!1,o||r.call(t)},u=function(p){r.call(t,p?new Error("exited with error code: "+p):null)},g=function(p){r.call(t,p)},f=function(){if(s&&!(n&&n.ended))return r.call(t,new Error("premature close"));if(o&&!(i&&i.ended))return r.call(t,new Error("premature close"))},h=function(){t.req.on("finish",l)};return Dbe(t)?(t.on("complete",l),t.on("abort",f),t.req?h():t.on("request",h)):o&&!i&&(t.on("end",a),t.on("close",a)),Rbe(t)&&t.on("exit",u),t.on("end",c),t.on("finish",l),e.error!==!1&&t.on("error",g),t.on("close",f),function(){t.removeListener("complete",l),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",l),t.removeListener("end",a),t.removeListener("close",a),t.removeListener("finish",l),t.removeListener("exit",u),t.removeListener("end",c),t.removeListener("error",g),t.removeListener("close",f)}};P3.exports=D3});var N3=I((mnt,R3)=>{var Fbe=ek(),Nbe=tk(),rk=require("fs"),Ep=function(){},Lbe=/^v?\.0/.test(process.version),Fy=function(t){return typeof t=="function"},Tbe=function(t){return!Lbe||!rk?!1:(t instanceof(rk.ReadStream||Ep)||t instanceof(rk.WriteStream||Ep))&&Fy(t.close)},Mbe=function(t){return t.setHeader&&Fy(t.abort)},Obe=function(t,e,r,i){i=Fbe(i);var n=!1;t.on("close",function(){n=!0}),Nbe(t,{readable:e,writable:r},function(o){if(o)return i(o);n=!0,i()});var s=!1;return function(o){if(!n&&!s){if(s=!0,Tbe(t))return t.close(Ep);if(Mbe(t))return t.abort();if(Fy(t.destroy))return t.destroy();i(o||new Error("stream was destroyed"))}}},F3=function(t){t()},Kbe=function(t,e){return t.pipe(e)},Ube=function(){var t=Array.prototype.slice.call(arguments),e=Fy(t[t.length-1]||Ep)&&t.pop()||Ep;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var r,i=t.map(function(n,s){var o=s0;return Obe(n,o,a,function(l){r||(r=l),l&&i.forEach(F3),!o&&(i.forEach(F3),e(r))})});return t.reduce(Kbe)};R3.exports=Ube});var T3=I((Int,L3)=>{"use strict";var{PassThrough:Hbe}=require("stream");L3.exports=t=>{t=P({},t);let{array:e}=t,{encoding:r}=t,i=r==="buffer",n=!1;e?n=!(r||i):r=r||"utf8",i&&(r=null);let s=new Hbe({objectMode:n});r&&s.setEncoding(r);let o=0,a=[];return s.on("data",l=>{a.push(l),n?o=a.length:o+=l.length}),s.getBufferedValue=()=>e?a:i?Buffer.concat(a,o):a.join(""),s.getBufferedLength=()=>o,s}});var M3=I((Ent,ju)=>{"use strict";var Gbe=N3(),jbe=T3(),ik=class extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}};async function Ny(t,e){if(!t)return Promise.reject(new Error("Expected a stream"));e=P({maxBuffer:Infinity},e);let{maxBuffer:r}=e,i;return await new Promise((n,s)=>{let o=a=>{a&&(a.bufferedData=i.getBufferedValue()),s(a)};i=Gbe(t,jbe(e),a=>{if(a){o(a);return}n()}),i.on("data",()=>{i.getBufferedLength()>r&&o(new ik)})}),i.getBufferedValue()}ju.exports=Ny;ju.exports.default=Ny;ju.exports.buffer=(t,e)=>Ny(t,_(P({},e),{encoding:"buffer"}));ju.exports.array=(t,e)=>Ny(t,_(P({},e),{array:!0}));ju.exports.MaxBufferError=ik});var K3=I((wnt,O3)=>{"use strict";var Ybe=[200,203,204,206,300,301,404,405,410,414,501],qbe=[200,203,204,300,301,302,303,307,308,404,405,410,414,501],Jbe={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},Wbe={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function nk(t){let e={};if(!t)return e;let r=t.trim().split(/\s*,\s*/);for(let i of r){let[n,s]=i.split(/\s*=\s*/,2);e[n]=s===void 0?!0:s.replace(/^"|"$/g,"")}return e}function zbe(t){let e=[];for(let r in t){let i=t[r];e.push(i===!0?r:r+"="+i)}if(!!e.length)return e.join(", ")}O3.exports=class{constructor(e,r,{shared:i,cacheHeuristic:n,immutableMinTimeToLive:s,ignoreCargoCult:o,trustServerDate:a,_fromObject:l}={}){if(l){this._fromObject(l);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=i!==!1,this._trustServerDate=a!==void 0?a:!0,this._cacheHeuristic=n!==void 0?n:.1,this._immutableMinTtl=s!==void 0?s:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=nk(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=nk(e.headers["cache-control"]),o&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":zbe(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),!r.headers["cache-control"]&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&qbe.indexOf(this._status)!==-1&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc.public||this._rescc["max-age"]||this._rescc["s-maxage"]||Ybe.indexOf(this._status)!==-1))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=nk(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)||r["max-age"]&&this.age()>r["max-age"]||r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]||this.stale()&&!(r["max-stale"]&&!this._rescc["must-revalidate"]&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let i of r)if(e.headers[i]!==this._reqHeaders[i])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let i in e)Jbe[i]||(r[i]=e[i]);if(e.connection){let i=e.connection.trim().split(/\s*,\s*/);for(let n of i)delete r[n]}if(r.warning){let i=r.warning.split(/,/).filter(n=>!/^\s*1[0-9][0-9]/.test(n));i.length?r.warning=i.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){return this._trustServerDate?this._serverDate():this._responseTime}_serverDate(){let e=Date.parse(this._resHeaders.date);if(isFinite(e)){let r=8*3600*1e3;if(Math.abs(this._responseTime-e)e&&(e=i)}let r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){let e=parseInt(this._resHeaders.age);return isFinite(e)?e:0}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return parseInt(this._rescc["s-maxage"],10)}if(this._rescc["max-age"])return parseInt(this._rescc["max-age"],10);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this._serverDate();if(this._resHeaders.expires){let i=Date.parse(this._resHeaders.expires);return Number.isNaN(i)||ii)return Math.max(e,(r-i)/1e3*this._cacheHeuristic)}return e}timeToLive(){return Math.max(0,this.maxAge()-this.age())*1e3}stale(){return this.maxAge()<=this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let n=r["if-none-match"].split(/,/).filter(s=>!/^\s*W\//.test(s));n.length?r["if-none-match"]=n.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),!r||!r.headers)throw Error("Response headers missing");let i=!1;if(r.status!==void 0&&r.status!=304?i=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?i=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?i=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?i=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(i=!0),!i)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let n={};for(let o in this._resHeaders)n[o]=o in r.headers&&!Wbe[o]?r.headers[o]:this._resHeaders[o];let s=Object.assign({},r,{status:this._status,method:this._method,headers:n});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,trustServerDate:this._trustServerDate}),modified:!1,matches:!0}}}});var Ly=I((Bnt,U3)=>{"use strict";U3.exports=t=>{let e={};for(let[r,i]of Object.entries(t))e[r.toLowerCase()]=i;return e}});var j3=I((Qnt,H3)=>{"use strict";var Vbe=require("stream").Readable,_be=Ly(),G3=class extends Vbe{constructor(e,r,i,n){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof r!="object")throw new TypeError("Argument `headers` should be an object");if(!(i instanceof Buffer))throw new TypeError("Argument `body` should be a buffer");if(typeof n!="string")throw new TypeError("Argument `url` should be a string");super();this.statusCode=e,this.headers=_be(r),this.body=i,this.url=n}_read(){this.push(this.body),this.push(null)}};H3.exports=G3});var q3=I((bnt,Y3)=>{"use strict";var Xbe=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];Y3.exports=(t,e)=>{let r=new Set(Object.keys(t).concat(Xbe));for(let i of r)i in e||(e[i]=typeof t[i]=="function"?t[i].bind(t):t[i])}});var W3=I((vnt,J3)=>{"use strict";var Zbe=require("stream").PassThrough,$be=q3(),eve=t=>{if(!(t&&t.pipe))throw new TypeError("Parameter `response` must be a response stream.");let e=new Zbe;return $be(t,e),t.pipe(e)};J3.exports=eve});var z3=I(sk=>{sk.stringify=function t(e){if(typeof e=="undefined")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e=="object"){var r="",i=Array.isArray(e);r=i?"[":"{";var n=!0;for(var s in e){var o=typeof e[s]=="function"||!i&&typeof e[s]=="undefined";Object.hasOwnProperty.call(e,s)&&!o&&(n||(r+=","),n=!1,i?e[s]==null?r+="null":r+=t(e[s]):e[s]!==void 0&&(r+=t(s)+":"+t(e[s])))}return r+=i?"]":"}",r}else return typeof e=="string"?JSON.stringify(/^:/.test(e)?":"+e:e):typeof e=="undefined"?"null":JSON.stringify(e)};sk.parse=function(t){return JSON.parse(t,function(e,r){return typeof r=="string"?/^:base64:/.test(r)?Buffer.from(r.substring(8),"base64"):/^:/.test(r)?r.substring(1):r:r})}});var Z3=I((xnt,V3)=>{"use strict";var tve=require("events"),_3=z3(),rve=t=>{let e={redis:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql"};if(t.adapter||t.uri){let r=t.adapter||/^[^:]*/.exec(t.uri)[0];return new(require(e[r]))(t)}return new Map},X3=class extends tve{constructor(e,r){super();if(this.opts=Object.assign({namespace:"keyv",serialize:_3.stringify,deserialize:_3.parse},typeof e=="string"?{uri:e}:e,r),!this.opts.store){let i=Object.assign({},this.opts);this.opts.store=rve(i)}typeof this.opts.store.on=="function"&&this.opts.store.on("error",i=>this.emit("error",i)),this.opts.store.namespace=this.opts.namespace}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}get(e,r){e=this._getKeyPrefix(e);let{store:i}=this.opts;return Promise.resolve().then(()=>i.get(e)).then(n=>typeof n=="string"?this.opts.deserialize(n):n).then(n=>{if(n!==void 0){if(typeof n.expires=="number"&&Date.now()>n.expires){this.delete(e);return}return r&&r.raw?n:n.value}})}set(e,r,i){e=this._getKeyPrefix(e),typeof i=="undefined"&&(i=this.opts.ttl),i===0&&(i=void 0);let{store:n}=this.opts;return Promise.resolve().then(()=>{let s=typeof i=="number"?Date.now()+i:null;return r={value:r,expires:s},this.opts.serialize(r)}).then(s=>n.set(e,s,i)).then(()=>!0)}delete(e){e=this._getKeyPrefix(e);let{store:r}=this.opts;return Promise.resolve().then(()=>r.delete(e))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}};V3.exports=X3});var tW=I((knt,$3)=>{"use strict";var ive=require("events"),Ty=require("url"),nve=Q3(),sve=M3(),ok=K3(),eW=j3(),ove=Ly(),ave=W3(),Ave=Z3(),yo=class{constructor(e,r){if(typeof e!="function")throw new TypeError("Parameter `request` must be a function");return this.cache=new Ave({uri:typeof r=="string"&&r,store:typeof r!="string"&&r,namespace:"cacheable-request"}),this.createCacheableRequest(e)}createCacheableRequest(e){return(r,i)=>{let n;if(typeof r=="string")n=ak(Ty.parse(r)),r={};else if(r instanceof Ty.URL)n=ak(Ty.parse(r.toString())),r={};else{let[g,...f]=(r.path||"").split("?"),h=f.length>0?`?${f.join("?")}`:"";n=ak(_(P({},r),{pathname:g,search:h}))}r=P(P({headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1},r),lve(n)),r.headers=ove(r.headers);let s=new ive,o=nve(Ty.format(n),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),a=`${r.method}:${o}`,l=!1,c=!1,u=g=>{c=!0;let f=!1,h,p=new Promise(m=>{h=()=>{f||(f=!0,m())}}),d=m=>{if(l&&!g.forceRefresh){m.status=m.statusCode;let B=ok.fromObject(l.cachePolicy).revalidatedPolicy(g,m);if(!B.modified){let b=B.policy.responseHeaders();m=new eW(l.statusCode,b,l.body,l.url),m.cachePolicy=B.policy,m.fromCache=!0}}m.fromCache||(m.cachePolicy=new ok(g,m,g),m.fromCache=!1);let E;g.cache&&m.cachePolicy.storable()?(E=ave(m),(async()=>{try{let B=sve.buffer(m);if(await Promise.race([p,new Promise(L=>m.once("end",L))]),f)return;let b=await B,R={cachePolicy:m.cachePolicy.toObject(),url:m.url,statusCode:m.fromCache?l.statusCode:m.statusCode,body:b},H=g.strictTtl?m.cachePolicy.timeToLive():void 0;g.maxTtl&&(H=H?Math.min(H,g.maxTtl):g.maxTtl),await this.cache.set(a,R,H)}catch(B){s.emit("error",new yo.CacheError(B))}})()):g.cache&&l&&(async()=>{try{await this.cache.delete(a)}catch(B){s.emit("error",new yo.CacheError(B))}})(),s.emit("response",E||m),typeof i=="function"&&i(E||m)};try{let m=e(g,d);m.once("error",h),m.once("abort",h),s.emit("request",m)}catch(m){s.emit("error",new yo.RequestError(m))}};return(async()=>{let g=async h=>{await Promise.resolve();let p=h.cache?await this.cache.get(a):void 0;if(typeof p=="undefined")return u(h);let d=ok.fromObject(p.cachePolicy);if(d.satisfiesWithoutRevalidation(h)&&!h.forceRefresh){let m=d.responseHeaders(),E=new eW(p.statusCode,m,p.body,p.url);E.cachePolicy=d,E.fromCache=!0,s.emit("response",E),typeof i=="function"&&i(E)}else l=p,h.headers=d.revalidationHeaders(h),u(h)},f=h=>s.emit("error",new yo.CacheError(h));this.cache.once("error",f),s.on("response",()=>this.cache.removeListener("error",f));try{await g(r)}catch(h){r.automaticFailover&&!c&&u(r),s.emit("error",new yo.CacheError(h))}})(),s}}};function lve(t){let e=P({},t);return e.path=`${t.pathname||"/"}${t.search||""}`,delete e.pathname,delete e.search,e}function ak(t){return{protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search}}yo.RequestError=class extends Error{constructor(t){super(t.message);this.name="RequestError",Object.assign(this,t)}};yo.CacheError=class extends Error{constructor(t){super(t.message);this.name="CacheError",Object.assign(this,t)}};$3.exports=yo});var iW=I((Pnt,rW)=>{"use strict";var cve=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];rW.exports=(t,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set(Object.keys(t).concat(cve)),i={};for(let n of r)n in e||(i[n]={get(){let s=t[n];return typeof s=="function"?s.bind(t):s},set(s){t[n]=s},enumerable:!0,configurable:!1});return Object.defineProperties(e,i),t.once("aborted",()=>{e.destroy(),e.emit("aborted")}),t.once("close",()=>{t.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var sW=I((Dnt,nW)=>{"use strict";var{Transform:uve,PassThrough:gve}=require("stream"),Ak=require("zlib"),fve=iW();nW.exports=t=>{let e=(t.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return t;let r=e==="br";if(r&&typeof Ak.createBrotliDecompress!="function")return t.destroy(new Error("Brotli is not supported on Node.js < 12")),t;let i=!0,n=new uve({transform(a,l,c){i=!1,c(null,a)},flush(a){a()}}),s=new gve({autoDestroy:!1,destroy(a,l){t.destroy(),l(a)}}),o=r?Ak.createBrotliDecompress():Ak.createUnzip();return o.once("error",a=>{if(i&&!t.readable){s.end();return}s.destroy(a)}),fve(t,s),t.pipe(n).pipe(o).pipe(s),s}});var lk=I((Rnt,oW)=>{"use strict";var aW=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,r){if(this.cache.set(e,r),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[i,n]of this.oldCache.entries())this.onEviction(i,n);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let r=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,r),r}}set(e,r){return this.cache.has(e)?this.cache.set(e,r):this._set(e,r),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[r]=e;this.cache.has(r)||(yield e)}}get size(){let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}};oW.exports=aW});var uk=I((Fnt,AW)=>{"use strict";var hve=require("events"),pve=require("tls"),dve=require("http2"),Cve=lk(),_i=Symbol("currentStreamsCount"),lW=Symbol("request"),ns=Symbol("cachedOriginSet"),Yu=Symbol("gracefullyClosing"),mve=["maxDeflateDynamicTableSize","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","localAddress","path","rejectUnauthorized","minDHSize","ca","cert","clientCertEngine","ciphers","key","pfx","servername","minVersion","maxVersion","secureProtocol","crl","honorCipherOrder","ecdhCurve","dhparam","secureOptions","sessionIdContext"],Ive=(t,e,r)=>{let i=0,n=t.length;for(;i>>1;r(t[s],e)?i=s+1:n=s}return i},Eve=(t,e)=>t.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,ck=(t,e)=>{for(let r of t)r[ns].lengthe[ns].includes(i))&&r[_i]+e[_i]<=e.remoteSettings.maxConcurrentStreams&&cW(r)},yve=(t,e)=>{for(let r of t)e[ns].lengthr[ns].includes(i))&&e[_i]+r[_i]<=r.remoteSettings.maxConcurrentStreams&&cW(e)},uW=({agent:t,isFree:e})=>{let r={};for(let i in t.sessions){let s=t.sessions[i].filter(o=>{let a=o[ma.kCurrentStreamsCount]{t[Yu]=!0,t[_i]===0&&t.close()},ma=class extends hve{constructor({timeout:e=6e4,maxSessions:r=Infinity,maxFreeSessions:i=10,maxCachedTlsSessions:n=100}={}){super();this.sessions={},this.queue={},this.timeout=e,this.maxSessions=r,this.maxFreeSessions=i,this._freeSessionsCount=0,this._sessionsCount=0,this.settings={enablePush:!1},this.tlsSessionCache=new Cve({maxSize:n})}static normalizeOrigin(e,r){return typeof e=="string"&&(e=new URL(e)),r&&e.hostname!==r&&(e.hostname=r),e.origin}normalizeOptions(e){let r="";if(e)for(let i of mve)e[i]&&(r+=`:${e[i]}`);return r}_tryToCreateNewSession(e,r){if(!(e in this.queue)||!(r in this.queue[e]))return;let i=this.queue[e][r];this._sessionsCount{Array.isArray(i)?(i=[...i],n()):i=[{resolve:n,reject:s}];let o=this.normalizeOptions(r),a=ma.normalizeOrigin(e,r&&r.servername);if(a===void 0){for(let{reject:u}of i)u(new TypeError("The `origin` argument needs to be a string or an URL object"));return}if(o in this.sessions){let u=this.sessions[o],g=-1,f=-1,h;for(let p of u){let d=p.remoteSettings.maxConcurrentStreams;if(d=d||p[Yu]||p.destroyed)continue;h||(g=d),m>f&&(h=p,f=m)}}if(h){if(i.length!==1){for(let{reject:p}of i){let d=new Error(`Expected the length of listeners to be 1, got ${i.length}. Please report this to https://github.com/szmarczak/http2-wrapper/`);p(d)}return}i[0].resolve(h);return}}if(o in this.queue){if(a in this.queue[o]){this.queue[o][a].listeners.push(...i),this._tryToCreateNewSession(o,a);return}}else this.queue[o]={};let l=()=>{o in this.queue&&this.queue[o][a]===c&&(delete this.queue[o][a],Object.keys(this.queue[o]).length===0&&delete this.queue[o])},c=()=>{let u=`${a}:${o}`,g=!1;try{let f=dve.connect(e,P({createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(u)},r));f[_i]=0,f[Yu]=!1;let h=()=>f[_i]{this.tlsSessionCache.set(u,m)}),f.once("error",m=>{for(let{reject:E}of i)E(m);this.tlsSessionCache.delete(u)}),f.setTimeout(this.timeout,()=>{f.destroy()}),f.once("close",()=>{if(g){p&&this._freeSessionsCount--,this._sessionsCount--;let m=this.sessions[o];m.splice(m.indexOf(f),1),m.length===0&&delete this.sessions[o]}else{let m=new Error("Session closed without receiving a SETTINGS frame");m.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:E}of i)E(m);l()}this._tryToCreateNewSession(o,a)});let d=()=>{if(!(!(o in this.queue)||!h())){for(let m of f[ns])if(m in this.queue[o]){let{listeners:E}=this.queue[o][m];for(;E.length!==0&&h();)E.shift().resolve(f);let B=this.queue[o];if(B[m].listeners.length===0&&(delete B[m],Object.keys(B).length===0)){delete this.queue[o];break}if(!h())break}}};f.on("origin",()=>{f[ns]=f.originSet,!!h()&&(d(),ck(this.sessions[o],f))}),f.once("remoteSettings",()=>{if(f.ref(),f.unref(),this._sessionsCount++,c.destroyed){let m=new Error("Agent has been destroyed");for(let E of i)E.reject(m);f.destroy();return}f[ns]=f.originSet;{let m=this.sessions;if(o in m){let E=m[o];E.splice(Ive(E,f,Eve),0,f)}else m[o]=[f]}this._freeSessionsCount+=1,g=!0,this.emit("session",f),d(),l(),f[_i]===0&&this._freeSessionsCount>this.maxFreeSessions&&f.close(),i.length!==0&&(this.getSession(a,r,i),i.length=0),f.on("remoteSettings",()=>{d(),ck(this.sessions[o],f)})}),f[lW]=f.request,f.request=(m,E)=>{if(f[Yu])throw new Error("The session is gracefully closing. No new streams are allowed.");let B=f[lW](m,E);return f.ref(),++f[_i],f[_i]===f.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,B.once("close",()=>{if(p=h(),--f[_i],!f.destroyed&&!f.closed&&(yve(this.sessions[o],f),h()&&!f.closed)){p||(this._freeSessionsCount++,p=!0);let b=f[_i]===0;b&&f.unref(),b&&(this._freeSessionsCount>this.maxFreeSessions||f[Yu])?f.close():(ck(this.sessions[o],f),d())}}),B}}catch(f){for(let h of i)h.reject(f);l()}};c.listeners=i,c.completed=!1,c.destroyed=!1,this.queue[o][a]=c,this._tryToCreateNewSession(o,a)})}request(e,r,i,n){return new Promise((s,o)=>{this.getSession(e,r,[{reject:o,resolve:a=>{try{s(a.request(i,n))}catch(l){o(l)}}}])})}createConnection(e,r){return ma.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let i=e.port||443,n=e.hostname||e.host;return typeof r.servername=="undefined"&&(r.servername=n),pve.connect(i,n,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[_i]===0&&r.close()}destroy(e){for(let r of Object.values(this.sessions))for(let i of r)i.destroy(e);for(let r of Object.values(this.queue))for(let i of Object.values(r))i.destroyed=!0;this.queue={}}get freeSessions(){return uW({agent:this,isFree:!0})}get busySessions(){return uW({agent:this,isFree:!1})}};ma.kCurrentStreamsCount=_i;ma.kGracefullyClosing=Yu;AW.exports={Agent:ma,globalAgent:new ma}});var gk=I((Nnt,gW)=>{"use strict";var{Readable:wve}=require("stream"),fW=class extends wve{constructor(e,r){super({highWaterMark:r,autoDestroy:!1});this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};gW.exports=fW});var fk=I((Lnt,hW)=>{"use strict";hW.exports=t=>{let e={protocol:t.protocol,hostname:typeof t.hostname=="string"&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return typeof t.port=="string"&&t.port.length!==0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||""}:${t.password||""}`),e}});var dW=I((Tnt,pW)=>{"use strict";pW.exports=(t,e,r)=>{for(let i of r)t.on(i,(...n)=>e.emit(i,...n))}});var mW=I((Mnt,CW)=>{"use strict";CW.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var EW=I((Knt,IW)=>{"use strict";var qu=(t,e,r)=>{IW.exports[e]=class extends t{constructor(...n){super(typeof r=="string"?r:r(n));this.name=`${super.name} [${e}]`,this.code=e}}};qu(TypeError,"ERR_INVALID_ARG_TYPE",t=>{let e=t[0].includes(".")?"property":"argument",r=t[1],i=Array.isArray(r);return i&&(r=`${r.slice(0,-1).join(", ")} or ${r.slice(-1)}`),`The "${t[0]}" ${e} must be ${i?"one of":"of"} type ${r}. Received ${typeof t[2]}`});qu(TypeError,"ERR_INVALID_PROTOCOL",t=>`Protocol "${t[0]}" not supported. Expected "${t[1]}"`);qu(Error,"ERR_HTTP_HEADERS_SENT",t=>`Cannot ${t[0]} headers after they are sent to the client`);qu(TypeError,"ERR_INVALID_HTTP_TOKEN",t=>`${t[0]} must be a valid HTTP token [${t[1]}]`);qu(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",t=>`Invalid value "${t[0]} for header "${t[1]}"`);qu(TypeError,"ERR_INVALID_CHAR",t=>`Invalid character in ${t[0]} [${t[1]}]`)});var Ck=I((Unt,yW)=>{"use strict";var Bve=require("http2"),{Writable:Qve}=require("stream"),{Agent:wW,globalAgent:bve}=uk(),vve=gk(),Sve=fk(),xve=dW(),kve=mW(),{ERR_INVALID_ARG_TYPE:hk,ERR_INVALID_PROTOCOL:Pve,ERR_HTTP_HEADERS_SENT:BW,ERR_INVALID_HTTP_TOKEN:Dve,ERR_HTTP_INVALID_HEADER_VALUE:Rve,ERR_INVALID_CHAR:Fve}=EW(),{HTTP2_HEADER_STATUS:QW,HTTP2_HEADER_METHOD:bW,HTTP2_HEADER_PATH:vW,HTTP2_METHOD_CONNECT:Nve}=Bve.constants,Pi=Symbol("headers"),pk=Symbol("origin"),dk=Symbol("session"),SW=Symbol("options"),My=Symbol("flushedHeaders"),yp=Symbol("jobs"),Lve=/^[\^`\-\w!#$%&*+.|~]+$/,Tve=/[^\t\u0020-\u007E\u0080-\u00FF]/,xW=class extends Qve{constructor(e,r,i){super({autoDestroy:!1});let n=typeof e=="string"||e instanceof URL;if(n&&(e=Sve(e instanceof URL?e:new URL(e))),typeof r=="function"||r===void 0?(i=r,r=n?e:P({},e)):r=P(P({},e),r),r.h2session)this[dk]=r.h2session;else if(r.agent===!1)this.agent=new wW({maxFreeSessions:0});else if(typeof r.agent=="undefined"||r.agent===null)typeof r.createConnection=="function"?(this.agent=new wW({maxFreeSessions:0}),this.agent.createConnection=r.createConnection):this.agent=bve;else if(typeof r.agent.request=="function")this.agent=r.agent;else throw new hk("options.agent",["Agent-like Object","undefined","false"],r.agent);if(r.protocol&&r.protocol!=="https:")throw new Pve(r.protocol,"https:");let s=r.port||r.defaultPort||this.agent&&this.agent.defaultPort||443,o=r.hostname||r.host||"localhost";delete r.hostname,delete r.host,delete r.port;let{timeout:a}=r;if(r.timeout=void 0,this[Pi]=Object.create(null),this[yp]=[],this.socket=null,this.connection=null,this.method=r.method||"GET",this.path=r.path,this.res=null,this.aborted=!1,this.reusedSocket=!1,r.headers)for(let[l,c]of Object.entries(r.headers))this.setHeader(l,c);r.auth&&!("authorization"in this[Pi])&&(this[Pi].authorization="Basic "+Buffer.from(r.auth).toString("base64")),r.session=r.tlsSession,r.path=r.socketPath,this[SW]=r,s===443?(this[pk]=`https://${o}`,":authority"in this[Pi]||(this[Pi][":authority"]=o)):(this[pk]=`https://${o}:${s}`,":authority"in this[Pi]||(this[Pi][":authority"]=`${o}:${s}`)),a&&this.setTimeout(a),i&&this.once("response",i),this[My]=!1}get method(){return this[Pi][bW]}set method(e){e&&(this[Pi][bW]=e.toUpperCase())}get path(){return this[Pi][vW]}set path(e){e&&(this[Pi][vW]=e)}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(e,r,i){if(this._mustNotHaveABody){i(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let n=()=>this._request.write(e,r,i);this._request?n():this[yp].push(n)}_final(e){if(this.destroyed)return;this.flushHeaders();let r=()=>{if(this._mustNotHaveABody){e();return}this._request.end(e)};this._request?r():this[yp].push(r)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}_destroy(e,r){this.res&&this.res._dump(),this._request&&this._request.destroy(),r(e)}async flushHeaders(){if(this[My]||this.destroyed)return;this[My]=!0;let e=this.method===Nve,r=i=>{if(this._request=i,this.destroyed){i.destroy();return}e||xve(i,this,["timeout","continue","close","error"]);let n=o=>(...a)=>{!this.writable&&!this.destroyed?o(...a):this.once("finish",()=>{o(...a)})};i.once("response",n((o,a,l)=>{let c=new vve(this.socket,i.readableHighWaterMark);this.res=c,c.req=this,c.statusCode=o[QW],c.headers=o,c.rawHeaders=l,c.once("end",()=>{this.aborted?(c.aborted=!0,c.emit("aborted")):(c.complete=!0,c.socket=null,c.connection=null)}),e?(c.upgrade=!0,this.emit("connect",c,i,Buffer.alloc(0))?this.emit("close"):i.destroy()):(i.on("data",u=>{!c._dumped&&!c.push(u)&&i.pause()}),i.once("end",()=>{c.push(null)}),this.emit("response",c)||c._dump())})),i.once("headers",n(o=>this.emit("information",{statusCode:o[QW]}))),i.once("trailers",n((o,a,l)=>{let{res:c}=this;c.trailers=o,c.rawTrailers=l}));let{socket:s}=i.session;this.socket=s,this.connection=s;for(let o of this[yp])o();this.emit("socket",this.socket)};if(this[dk])try{r(this[dk].request(this[Pi]))}catch(i){this.emit("error",i)}else{this.reusedSocket=!0;try{r(await this.agent.request(this[pk],this[SW],this[Pi]))}catch(i){this.emit("error",i)}}}getHeader(e){if(typeof e!="string")throw new hk("name","string",e);return this[Pi][e.toLowerCase()]}get headersSent(){return this[My]}removeHeader(e){if(typeof e!="string")throw new hk("name","string",e);if(this.headersSent)throw new BW("remove");delete this[Pi][e.toLowerCase()]}setHeader(e,r){if(this.headersSent)throw new BW("set");if(typeof e!="string"||!Lve.test(e)&&!kve(e))throw new Dve("Header name",e);if(typeof r=="undefined")throw new Rve(r,e);if(Tve.test(r))throw new Fve("header content",e);this[Pi][e.toLowerCase()]=r}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,r){let i=()=>this._request.setTimeout(e,r);return this._request?i():this[yp].push(i),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(e){}};yW.exports=xW});var PW=I((Hnt,kW)=>{"use strict";var Mve=require("tls");kW.exports=(t={})=>new Promise((e,r)=>{let i=Mve.connect(t,()=>{t.resolveSocket?(i.off("error",r),e({alpnProtocol:i.alpnProtocol,socket:i})):(i.destroy(),e({alpnProtocol:i.alpnProtocol}))});i.on("error",r)})});var RW=I((Gnt,DW)=>{"use strict";var Ove=require("net");DW.exports=t=>{let e=t.host,r=t.headers&&t.headers.host;return r&&(r.startsWith("[")?r.indexOf("]")===-1?e=r:e=r.slice(1,-1):e=r.split(":",1)[0]),Ove.isIP(e)?"":e}});var LW=I((jnt,mk)=>{"use strict";var FW=require("http"),Ik=require("https"),Kve=PW(),Uve=lk(),Hve=Ck(),Gve=RW(),jve=fk(),Oy=new Uve({maxSize:100}),wp=new Map,NW=(t,e,r)=>{e._httpMessage={shouldKeepAlive:!0};let i=()=>{t.emit("free",e,r)};e.on("free",i);let n=()=>{t.removeSocket(e,r)};e.on("close",n);let s=()=>{t.removeSocket(e,r),e.off("close",n),e.off("free",i),e.off("agentRemove",s)};e.on("agentRemove",s),t.emit("free",e,r)},Yve=async t=>{let e=`${t.host}:${t.port}:${t.ALPNProtocols.sort()}`;if(!Oy.has(e)){if(wp.has(e))return(await wp.get(e)).alpnProtocol;let{path:r,agent:i}=t;t.path=t.socketPath;let n=Kve(t);wp.set(e,n);try{let{socket:s,alpnProtocol:o}=await n;if(Oy.set(e,o),t.path=r,o==="h2")s.destroy();else{let{globalAgent:a}=Ik,l=Ik.Agent.prototype.createConnection;i?i.createConnection===l?NW(i,s,t):s.destroy():a.createConnection===l?NW(a,s,t):s.destroy()}return wp.delete(e),o}catch(s){throw wp.delete(e),s}}return Oy.get(e)};mk.exports=async(t,e,r)=>{if((typeof t=="string"||t instanceof URL)&&(t=jve(new URL(t))),typeof e=="function"&&(r=e,e=void 0),e=_(P(P({ALPNProtocols:["h2","http/1.1"]},t),e),{resolveSocket:!0}),!Array.isArray(e.ALPNProtocols)||e.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");e.protocol=e.protocol||"https:";let i=e.protocol==="https:";e.host=e.hostname||e.host||"localhost",e.session=e.tlsSession,e.servername=e.servername||Gve(e),e.port=e.port||(i?443:80),e._defaultAgent=i?Ik.globalAgent:FW.globalAgent;let n=e.agent;if(n){if(n.addRequest)throw new Error("The `options.agent` object can contain only `http`, `https` or `http2` properties");e.agent=n[i?"https":"http"]}return i&&await Yve(e)==="h2"?(n&&(e.agent=n.http2),new Hve(e,r)):FW.request(e,r)};mk.exports.protocolCache=Oy});var MW=I((Ynt,TW)=>{"use strict";var qve=require("http2"),Jve=uk(),Ek=Ck(),Wve=gk(),zve=LW(),Vve=(t,e,r)=>new Ek(t,e,r),_ve=(t,e,r)=>{let i=new Ek(t,e,r);return i.end(),i};TW.exports=_(P(_(P({},qve),{ClientRequest:Ek,IncomingMessage:Wve}),Jve),{request:Vve,get:_ve,auto:zve})});var wk=I(yk=>{"use strict";Object.defineProperty(yk,"__esModule",{value:!0});var OW=Ca();yk.default=t=>OW.default.nodeStream(t)&&OW.default.function_(t.getBoundary)});var GW=I(Bk=>{"use strict";Object.defineProperty(Bk,"__esModule",{value:!0});var KW=require("fs"),UW=require("util"),HW=Ca(),Xve=wk(),Zve=UW.promisify(KW.stat);Bk.default=async(t,e)=>{if(e&&"content-length"in e)return Number(e["content-length"]);if(!t)return 0;if(HW.default.string(t))return Buffer.byteLength(t);if(HW.default.buffer(t))return t.length;if(Xve.default(t))return UW.promisify(t.getLength.bind(t))();if(t instanceof KW.ReadStream){let{size:r}=await Zve(t.path);return r===0?void 0:r}}});var bk=I(Qk=>{"use strict";Object.defineProperty(Qk,"__esModule",{value:!0});function $ve(t,e,r){let i={};for(let n of r)i[n]=(...s)=>{e.emit(n,...s)},t.on(n,i[n]);return()=>{for(let n of r)t.off(n,i[n])}}Qk.default=$ve});var jW=I(vk=>{"use strict";Object.defineProperty(vk,"__esModule",{value:!0});vk.default=()=>{let t=[];return{once(e,r,i){e.once(r,i),t.push({origin:e,event:r,fn:i})},unhandleAll(){for(let e of t){let{origin:r,event:i,fn:n}=e;r.removeListener(i,n)}t.length=0}}}});var qW=I(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.TimeoutError=void 0;var eSe=require("net"),tSe=jW(),YW=Symbol("reentry"),rSe=()=>{},Sk=class extends Error{constructor(e,r){super(`Timeout awaiting '${r}' for ${e}ms`);this.event=r,this.name="TimeoutError",this.code="ETIMEDOUT"}};Bp.TimeoutError=Sk;Bp.default=(t,e,r)=>{if(YW in t)return rSe;t[YW]=!0;let i=[],{once:n,unhandleAll:s}=tSe.default(),o=(g,f,h)=>{var p;let d=setTimeout(f,g,g,h);(p=d.unref)===null||p===void 0||p.call(d);let m=()=>{clearTimeout(d)};return i.push(m),m},{host:a,hostname:l}=r,c=(g,f)=>{t.destroy(new Sk(g,f))},u=()=>{for(let g of i)g();s()};if(t.once("error",g=>{if(u(),t.listenerCount("error")===0)throw g}),t.once("close",u),n(t,"response",g=>{n(g,"end",u)}),typeof e.request!="undefined"&&o(e.request,c,"request"),typeof e.socket!="undefined"){let g=()=>{c(e.socket,"socket")};t.setTimeout(e.socket,g),i.push(()=>{t.removeListener("timeout",g)})}return n(t,"socket",g=>{var f;let{socketPath:h}=t;if(g.connecting){let p=Boolean(h!=null?h:eSe.isIP((f=l!=null?l:a)!==null&&f!==void 0?f:"")!==0);if(typeof e.lookup!="undefined"&&!p&&typeof g.address().address=="undefined"){let d=o(e.lookup,c,"lookup");n(g,"lookup",d)}if(typeof e.connect!="undefined"){let d=()=>o(e.connect,c,"connect");p?n(g,"connect",d()):n(g,"lookup",m=>{m===null&&n(g,"connect",d())})}typeof e.secureConnect!="undefined"&&r.protocol==="https:"&&n(g,"connect",()=>{let d=o(e.secureConnect,c,"secureConnect");n(g,"secureConnect",d)})}if(typeof e.send!="undefined"){let p=()=>o(e.send,c,"send");g.connecting?n(g,"connect",()=>{n(t,"upload-complete",p())}):n(t,"upload-complete",p())}}),typeof e.response!="undefined"&&n(t,"upload-complete",()=>{let g=o(e.response,c,"response");n(t,"response",g)}),u}});var WW=I(xk=>{"use strict";Object.defineProperty(xk,"__esModule",{value:!0});var JW=Ca();xk.default=t=>{t=t;let e={protocol:t.protocol,hostname:JW.default.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return JW.default.string(t.port)&&t.port.length>0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||""}:${t.password||""}`),e}});var zW=I(kk=>{"use strict";Object.defineProperty(kk,"__esModule",{value:!0});var iSe=require("url"),nSe=["protocol","host","hostname","port","pathname","search"];kk.default=(t,e)=>{var r,i;if(e.path){if(e.pathname)throw new TypeError("Parameters `path` and `pathname` are mutually exclusive.");if(e.search)throw new TypeError("Parameters `path` and `search` are mutually exclusive.");if(e.searchParams)throw new TypeError("Parameters `path` and `searchParams` are mutually exclusive.")}if(e.search&&e.searchParams)throw new TypeError("Parameters `search` and `searchParams` are mutually exclusive.");if(!t){if(!e.protocol)throw new TypeError("No URL protocol specified");t=`${e.protocol}//${(i=(r=e.hostname)!==null&&r!==void 0?r:e.host)!==null&&i!==void 0?i:""}`}let n=new iSe.URL(t);if(e.path){let s=e.path.indexOf("?");s===-1?e.pathname=e.path:(e.pathname=e.path.slice(0,s),e.search=e.path.slice(s+1)),delete e.path}for(let s of nSe)e[s]&&(n[s]=e[s].toString());return n}});var _W=I(Pk=>{"use strict";Object.defineProperty(Pk,"__esModule",{value:!0});var VW=class{constructor(){this.weakMap=new WeakMap,this.map=new Map}set(e,r){typeof e=="object"?this.weakMap.set(e,r):this.map.set(e,r)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}};Pk.default=VW});var Rk=I(Dk=>{"use strict";Object.defineProperty(Dk,"__esModule",{value:!0});var sSe=async t=>{let e=[],r=0;for await(let i of t)e.push(i),r+=Buffer.byteLength(i);return Buffer.isBuffer(e[0])?Buffer.concat(e,r):Buffer.from(e.join(""))};Dk.default=sSe});var ZW=I(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.dnsLookupIpVersionToFamily=ql.isDnsLookupIpVersion=void 0;var XW={auto:0,ipv4:4,ipv6:6};ql.isDnsLookupIpVersion=t=>t in XW;ql.dnsLookupIpVersionToFamily=t=>{if(ql.isDnsLookupIpVersion(t))return XW[t];throw new Error("Invalid DNS lookup IP version")}});var Fk=I(Ky=>{"use strict";Object.defineProperty(Ky,"__esModule",{value:!0});Ky.isResponseOk=void 0;Ky.isResponseOk=t=>{let{statusCode:e}=t,r=t.request.options.followRedirect?299:399;return e>=200&&e<=r||e===304}});var e8=I(Nk=>{"use strict";Object.defineProperty(Nk,"__esModule",{value:!0});var $W=new Set;Nk.default=t=>{$W.has(t)||($W.add(t),process.emitWarning(`Got: ${t}`,{type:"DeprecationWarning"}))}});var t8=I(Lk=>{"use strict";Object.defineProperty(Lk,"__esModule",{value:!0});var ar=Ca(),oSe=(t,e)=>{if(ar.default.null_(t.encoding))throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");ar.assert.any([ar.default.string,ar.default.undefined],t.encoding),ar.assert.any([ar.default.boolean,ar.default.undefined],t.resolveBodyOnly),ar.assert.any([ar.default.boolean,ar.default.undefined],t.methodRewriting),ar.assert.any([ar.default.boolean,ar.default.undefined],t.isStream),ar.assert.any([ar.default.string,ar.default.undefined],t.responseType),t.responseType===void 0&&(t.responseType="text");let{retry:r}=t;if(e?t.retry=P({},e.retry):t.retry={calculateDelay:i=>i.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:void 0},ar.default.object(r)?(t.retry=P(P({},t.retry),r),t.retry.methods=[...new Set(t.retry.methods.map(i=>i.toUpperCase()))],t.retry.statusCodes=[...new Set(t.retry.statusCodes)],t.retry.errorCodes=[...new Set(t.retry.errorCodes)]):ar.default.number(r)&&(t.retry.limit=r),ar.default.undefined(t.retry.maxRetryAfter)&&(t.retry.maxRetryAfter=Math.min(...[t.timeout.request,t.timeout.connect].filter(ar.default.number))),ar.default.object(t.pagination)){e&&(t.pagination=P(P({},e.pagination),t.pagination));let{pagination:i}=t;if(!ar.default.function_(i.transform))throw new Error("`options.pagination.transform` must be implemented");if(!ar.default.function_(i.shouldContinue))throw new Error("`options.pagination.shouldContinue` must be implemented");if(!ar.default.function_(i.filter))throw new TypeError("`options.pagination.filter` must be implemented");if(!ar.default.function_(i.paginate))throw new Error("`options.pagination.paginate` must be implemented")}return t.responseType==="json"&&t.headers.accept===void 0&&(t.headers.accept="application/json"),t};Lk.default=oSe});var r8=I(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.retryAfterStatusCodes=void 0;Qp.retryAfterStatusCodes=new Set([413,429,503]);var aSe=({attemptCount:t,retryOptions:e,error:r,retryAfter:i})=>{if(t>e.limit)return 0;let n=e.methods.includes(r.options.method),s=e.errorCodes.includes(r.code),o=r.response&&e.statusCodes.includes(r.response.statusCode);if(!n||!s&&!o)return 0;if(r.response){if(i)return e.maxRetryAfter===void 0||i>e.maxRetryAfter?0:i;if(r.response.statusCode===413)return 0}let a=Math.random()*100;return 2**(t-1)*1e3+a};Qp.default=aSe});var vp=I(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.UnsupportedProtocolError=Rt.ReadError=Rt.TimeoutError=Rt.UploadError=Rt.CacheError=Rt.HTTPError=Rt.MaxRedirectsError=Rt.RequestError=Rt.setNonEnumerableProperties=Rt.knownHookEvents=Rt.withoutBody=Rt.kIsNormalizedAlready=void 0;var i8=require("util"),n8=require("stream"),ASe=require("fs"),dA=require("url"),s8=require("http"),Tk=require("http"),lSe=require("https"),cSe=h3(),uSe=y3(),o8=tW(),gSe=sW(),fSe=MW(),hSe=Ly(),ce=Ca(),pSe=GW(),a8=wk(),dSe=bk(),A8=qW(),CSe=WW(),l8=zW(),mSe=_W(),ISe=Rk(),c8=ZW(),ESe=Fk(),CA=e8(),ySe=t8(),wSe=r8(),Mk,Ii=Symbol("request"),Uy=Symbol("response"),Ju=Symbol("responseSize"),Wu=Symbol("downloadedSize"),zu=Symbol("bodySize"),Vu=Symbol("uploadedSize"),Hy=Symbol("serverResponsesPiped"),u8=Symbol("unproxyEvents"),g8=Symbol("isFromCache"),Ok=Symbol("cancelTimeouts"),f8=Symbol("startedReading"),_u=Symbol("stopReading"),Gy=Symbol("triggerRead"),mA=Symbol("body"),bp=Symbol("jobs"),h8=Symbol("originalResponse"),p8=Symbol("retryTimeout");Rt.kIsNormalizedAlready=Symbol("isNormalizedAlready");var BSe=ce.default.string(process.versions.brotli);Rt.withoutBody=new Set(["GET","HEAD"]);Rt.knownHookEvents=["init","beforeRequest","beforeRedirect","beforeError","beforeRetry","afterResponse"];function QSe(t){for(let e in t){let r=t[e];if(!ce.default.string(r)&&!ce.default.number(r)&&!ce.default.boolean(r)&&!ce.default.null_(r)&&!ce.default.undefined(r))throw new TypeError(`The \`searchParams\` value '${String(r)}' must be a string, number, boolean or null`)}}function bSe(t){return ce.default.object(t)&&!("statusCode"in t)}var Kk=new mSe.default,vSe=async t=>new Promise((e,r)=>{let i=n=>{r(n)};t.pending||e(),t.once("error",i),t.once("ready",()=>{t.off("error",i),e()})}),SSe=new Set([300,301,302,303,304,307,308]),xSe=["context","body","json","form"];Rt.setNonEnumerableProperties=(t,e)=>{let r={};for(let i of t)if(!!i)for(let n of xSe)n in i&&(r[n]={writable:!0,configurable:!0,enumerable:!1,value:i[n]});Object.defineProperties(e,r)};var _r=class extends Error{constructor(e,r,i){var n;super(e);if(Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=r.code,i instanceof Uk?(Object.defineProperty(this,"request",{enumerable:!1,value:i}),Object.defineProperty(this,"response",{enumerable:!1,value:i[Uy]}),Object.defineProperty(this,"options",{enumerable:!1,value:i.options})):Object.defineProperty(this,"options",{enumerable:!1,value:i}),this.timings=(n=this.request)===null||n===void 0?void 0:n.timings,ce.default.string(r.stack)&&ce.default.string(this.stack)){let s=this.stack.indexOf(this.message)+this.message.length,o=this.stack.slice(s).split(` `).reverse(),a=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(` @@ -201,9 +201,9 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);p(d)}return} `));for(var X=0;X{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.structuredPatch=__;Bd.createTwoFilesPatch=X_;Bd.createPatch=tMe;var rMe=KB();function jR(t){return sMe(t)||nMe(t)||iMe()}function iMe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function nMe(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function sMe(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e0?l(L.lines.slice(-o.context)):[],u-=f.length,g-=f.length)}(H=f).push.apply(H,jR(R.map(function(X){return(b.added?"+":"-")+X}))),b.added?p+=R.length:h+=R.length}else{if(u)if(R.length<=o.context*2&&B=a.length-2&&R.length<=o.context){var A=/\n$/.test(r),V=/\n$/.test(i),W=R.length==0&&f.length>q.oldLines;!A&&W&&f.splice(q.oldLines,0,"\\ No newline at end of file"),(!A&&!W||!V)&&f.push("\\ No newline at end of file")}c.push(q),u=0,g=0,f=[]}h+=R.length,p+=R.length}},m=0;m{"use strict";Object.defineProperty(YB,"__esModule",{value:!0});YB.arrayEqual=oMe;YB.arrayStartsWith=Z_;function oMe(t,e){return t.length!==e.length?!1:Z_(t,e)}function Z_(t,e){if(e.length>t.length)return!1;for(var r=0;r{"use strict";Object.defineProperty(qB,"__esModule",{value:!0});qB.calcLineCount=eX;qB.merge=aMe;var AMe=YR(),lMe=GB(),qR=$_();function Mg(t){return gMe(t)||uMe(t)||cMe()}function cMe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function uMe(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function gMe(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e{"use strict";Object.defineProperty(zR,"__esModule",{value:!0});zR.convertChangesToDMP=dMe;function dMe(t){for(var e=[],r,i,n=0;n{"use strict";Object.defineProperty(VR,"__esModule",{value:!0});VR.convertChangesToXML=CMe;function CMe(t){for(var e=[],r=0;r"):i.removed&&e.push(""),e.push(mMe(i.value)),i.added?e.push(""):i.removed&&e.push("")}return e.join("")}function mMe(t){var e=t;return e=e.replace(/&/g,"&"),e=e.replace(//g,">"),e=e.replace(/"/g,"""),e}});var CX=I(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});Object.defineProperty(br,"Diff",{enumerable:!0,get:function(){return IMe.default}});Object.defineProperty(br,"diffChars",{enumerable:!0,get:function(){return EMe.diffChars}});Object.defineProperty(br,"diffWords",{enumerable:!0,get:function(){return fX.diffWords}});Object.defineProperty(br,"diffWordsWithSpace",{enumerable:!0,get:function(){return fX.diffWordsWithSpace}});Object.defineProperty(br,"diffLines",{enumerable:!0,get:function(){return hX.diffLines}});Object.defineProperty(br,"diffTrimmedLines",{enumerable:!0,get:function(){return hX.diffTrimmedLines}});Object.defineProperty(br,"diffSentences",{enumerable:!0,get:function(){return yMe.diffSentences}});Object.defineProperty(br,"diffCss",{enumerable:!0,get:function(){return wMe.diffCss}});Object.defineProperty(br,"diffJson",{enumerable:!0,get:function(){return pX.diffJson}});Object.defineProperty(br,"canonicalize",{enumerable:!0,get:function(){return pX.canonicalize}});Object.defineProperty(br,"diffArrays",{enumerable:!0,get:function(){return BMe.diffArrays}});Object.defineProperty(br,"applyPatch",{enumerable:!0,get:function(){return dX.applyPatch}});Object.defineProperty(br,"applyPatches",{enumerable:!0,get:function(){return dX.applyPatches}});Object.defineProperty(br,"parsePatch",{enumerable:!0,get:function(){return QMe.parsePatch}});Object.defineProperty(br,"merge",{enumerable:!0,get:function(){return bMe.merge}});Object.defineProperty(br,"structuredPatch",{enumerable:!0,get:function(){return _R.structuredPatch}});Object.defineProperty(br,"createTwoFilesPatch",{enumerable:!0,get:function(){return _R.createTwoFilesPatch}});Object.defineProperty(br,"createPatch",{enumerable:!0,get:function(){return _R.createPatch}});Object.defineProperty(br,"convertChangesToDMP",{enumerable:!0,get:function(){return vMe.convertChangesToDMP}});Object.defineProperty(br,"convertChangesToXML",{enumerable:!0,get:function(){return SMe.convertChangesToXML}});var IMe=xMe(Na()),EMe=M_(),fX=U_(),hX=KB(),yMe=H_(),wMe=G_(),pX=Y_(),BMe=q_(),dX=V_(),QMe=GB(),bMe=cX(),_R=YR(),vMe=uX(),SMe=gX();function xMe(t){return t&&t.__esModule?t:{default:t}}});var WB=I((agt,mX)=>{var kMe=As(),PMe=Nw(),DMe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,RMe=/^\w*$/;function FMe(t,e){if(kMe(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||PMe(t)?!0:RMe.test(t)||!DMe.test(t)||e!=null&&t in Object(e)}mX.exports=FMe});var Gs=I((Agt,IX)=>{function NMe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}IX.exports=NMe});var zB=I((lgt,EX)=>{var LMe=Ac(),TMe=Gs(),MMe="[object AsyncFunction]",OMe="[object Function]",KMe="[object GeneratorFunction]",UMe="[object Proxy]";function HMe(t){if(!TMe(t))return!1;var e=LMe(t);return e==OMe||e==KMe||e==MMe||e==UMe}EX.exports=HMe});var wX=I((cgt,yX)=>{var GMe=Ks(),jMe=GMe["__core-js_shared__"];yX.exports=jMe});var bX=I((ugt,BX)=>{var XR=wX(),QX=function(){var t=/[^.]+$/.exec(XR&&XR.keys&&XR.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function YMe(t){return!!QX&&QX in t}BX.exports=YMe});var ZR=I((ggt,vX)=>{var qMe=Function.prototype,JMe=qMe.toString;function WMe(t){if(t!=null){try{return JMe.call(t)}catch(e){}try{return t+""}catch(e){}}return""}vX.exports=WMe});var xX=I((fgt,SX)=>{var zMe=zB(),VMe=bX(),_Me=Gs(),XMe=ZR(),ZMe=/[\\^$.*+?()[\]{}|]/g,$Me=/^\[object .+?Constructor\]$/,eOe=Function.prototype,tOe=Object.prototype,rOe=eOe.toString,iOe=tOe.hasOwnProperty,nOe=RegExp("^"+rOe.call(iOe).replace(ZMe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sOe(t){if(!_Me(t)||VMe(t))return!1;var e=zMe(t)?nOe:$Me;return e.test(XMe(t))}SX.exports=sOe});var PX=I((hgt,kX)=>{function oOe(t,e){return t==null?void 0:t[e]}kX.exports=oOe});var UA=I((pgt,DX)=>{var aOe=xX(),AOe=PX();function lOe(t,e){var r=AOe(t,e);return aOe(r)?r:void 0}DX.exports=lOe});var Qd=I((dgt,RX)=>{var cOe=UA(),uOe=cOe(Object,"create");RX.exports=uOe});var LX=I((Cgt,FX)=>{var NX=Qd();function gOe(){this.__data__=NX?NX(null):{},this.size=0}FX.exports=gOe});var MX=I((mgt,TX)=>{function fOe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}TX.exports=fOe});var KX=I((Igt,OX)=>{var hOe=Qd(),pOe="__lodash_hash_undefined__",dOe=Object.prototype,COe=dOe.hasOwnProperty;function mOe(t){var e=this.__data__;if(hOe){var r=e[t];return r===pOe?void 0:r}return COe.call(e,t)?e[t]:void 0}OX.exports=mOe});var HX=I((Egt,UX)=>{var IOe=Qd(),EOe=Object.prototype,yOe=EOe.hasOwnProperty;function wOe(t){var e=this.__data__;return IOe?e[t]!==void 0:yOe.call(e,t)}UX.exports=wOe});var jX=I((ygt,GX)=>{var BOe=Qd(),QOe="__lodash_hash_undefined__";function bOe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=BOe&&e===void 0?QOe:e,this}GX.exports=bOe});var qX=I((wgt,YX)=>{var vOe=LX(),SOe=MX(),xOe=KX(),kOe=HX(),POe=jX();function Og(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{function DOe(){this.__data__=[],this.size=0}JX.exports=DOe});var Kg=I((Qgt,zX)=>{function ROe(t,e){return t===e||t!==t&&e!==e}zX.exports=ROe});var bd=I((bgt,VX)=>{var FOe=Kg();function NOe(t,e){for(var r=t.length;r--;)if(FOe(t[r][0],e))return r;return-1}VX.exports=NOe});var XX=I((vgt,_X)=>{var LOe=bd(),TOe=Array.prototype,MOe=TOe.splice;function OOe(t){var e=this.__data__,r=LOe(e,t);if(r<0)return!1;var i=e.length-1;return r==i?e.pop():MOe.call(e,r,1),--this.size,!0}_X.exports=OOe});var $X=I((Sgt,ZX)=>{var KOe=bd();function UOe(t){var e=this.__data__,r=KOe(e,t);return r<0?void 0:e[r][1]}ZX.exports=UOe});var tZ=I((xgt,eZ)=>{var HOe=bd();function GOe(t){return HOe(this.__data__,t)>-1}eZ.exports=GOe});var iZ=I((kgt,rZ)=>{var jOe=bd();function YOe(t,e){var r=this.__data__,i=jOe(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}rZ.exports=YOe});var vd=I((Pgt,nZ)=>{var qOe=WX(),JOe=XX(),WOe=$X(),zOe=tZ(),VOe=iZ();function Ug(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{var _Oe=UA(),XOe=Ks(),ZOe=_Oe(XOe,"Map");sZ.exports=ZOe});var AZ=I((Rgt,oZ)=>{var aZ=qX(),$Oe=vd(),eKe=VB();function tKe(){this.size=0,this.__data__={hash:new aZ,map:new(eKe||$Oe),string:new aZ}}oZ.exports=tKe});var cZ=I((Fgt,lZ)=>{function rKe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}lZ.exports=rKe});var Sd=I((Ngt,uZ)=>{var iKe=cZ();function nKe(t,e){var r=t.__data__;return iKe(e)?r[typeof e=="string"?"string":"hash"]:r.map}uZ.exports=nKe});var fZ=I((Lgt,gZ)=>{var sKe=Sd();function oKe(t){var e=sKe(this,t).delete(t);return this.size-=e?1:0,e}gZ.exports=oKe});var pZ=I((Tgt,hZ)=>{var aKe=Sd();function AKe(t){return aKe(this,t).get(t)}hZ.exports=AKe});var CZ=I((Mgt,dZ)=>{var lKe=Sd();function cKe(t){return lKe(this,t).has(t)}dZ.exports=cKe});var IZ=I((Ogt,mZ)=>{var uKe=Sd();function gKe(t,e){var r=uKe(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}mZ.exports=gKe});var _B=I((Kgt,EZ)=>{var fKe=AZ(),hKe=fZ(),pKe=pZ(),dKe=CZ(),CKe=IZ();function Hg(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{var wZ=_B(),mKe="Expected a function";function $R(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(mKe);var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var o=t.apply(this,i);return r.cache=s.set(n,o)||s,o};return r.cache=new($R.Cache||wZ),r}$R.Cache=wZ;yZ.exports=$R});var bZ=I((Hgt,QZ)=>{var IKe=BZ(),EKe=500;function yKe(t){var e=IKe(t,function(i){return r.size===EKe&&r.clear(),i}),r=e.cache;return e}QZ.exports=yKe});var SZ=I((Ggt,vZ)=>{var wKe=bZ(),BKe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,QKe=/\\(\\)?/g,bKe=wKe(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(BKe,function(r,i,n,s){e.push(n?s.replace(QKe,"$1"):i||r)}),e});vZ.exports=bKe});var Gg=I((jgt,xZ)=>{var vKe=As(),SKe=WB(),xKe=SZ(),kKe=gg();function PKe(t,e){return vKe(t)?t:SKe(t,e)?[t]:xKe(kKe(t))}xZ.exports=PKe});var Sc=I((Ygt,kZ)=>{var DKe=Nw(),RKe=1/0;function FKe(t){if(typeof t=="string"||DKe(t))return t;var e=t+"";return e=="0"&&1/t==-RKe?"-0":e}kZ.exports=FKe});var xd=I((qgt,PZ)=>{var NKe=Gg(),LKe=Sc();function TKe(t,e){e=NKe(e,t);for(var r=0,i=e.length;t!=null&&r{var MKe=UA(),OKe=function(){try{var t=MKe(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();DZ.exports=OKe});var jg=I((Wgt,RZ)=>{var FZ=eF();function KKe(t,e,r){e=="__proto__"&&FZ?FZ(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}RZ.exports=KKe});var XB=I((zgt,NZ)=>{var UKe=jg(),HKe=Kg(),GKe=Object.prototype,jKe=GKe.hasOwnProperty;function YKe(t,e,r){var i=t[e];(!(jKe.call(t,e)&&HKe(i,r))||r===void 0&&!(e in t))&&UKe(t,e,r)}NZ.exports=YKe});var kd=I((Vgt,LZ)=>{var qKe=9007199254740991,JKe=/^(?:0|[1-9]\d*)$/;function WKe(t,e){var r=typeof t;return e=e==null?qKe:e,!!e&&(r=="number"||r!="symbol"&&JKe.test(t))&&t>-1&&t%1==0&&t{var zKe=XB(),VKe=Gg(),_Ke=kd(),MZ=Gs(),XKe=Sc();function ZKe(t,e,r,i){if(!MZ(t))return t;e=VKe(e,t);for(var n=-1,s=e.length,o=s-1,a=t;a!=null&&++n{var $Ke=xd(),e1e=tF(),t1e=Gg();function r1e(t,e,r){for(var i=-1,n=e.length,s={};++i{function i1e(t,e){return t!=null&&e in Object(t)}UZ.exports=i1e});var jZ=I(($gt,GZ)=>{var n1e=Ac(),s1e=Qo(),o1e="[object Arguments]";function a1e(t){return s1e(t)&&n1e(t)==o1e}GZ.exports=a1e});var Pd=I((eft,YZ)=>{var qZ=jZ(),A1e=Qo(),JZ=Object.prototype,l1e=JZ.hasOwnProperty,c1e=JZ.propertyIsEnumerable,u1e=qZ(function(){return arguments}())?qZ:function(t){return A1e(t)&&l1e.call(t,"callee")&&!c1e.call(t,"callee")};YZ.exports=u1e});var ZB=I((tft,WZ)=>{var g1e=9007199254740991;function f1e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=g1e}WZ.exports=f1e});var rF=I((rft,zZ)=>{var h1e=Gg(),p1e=Pd(),d1e=As(),C1e=kd(),m1e=ZB(),I1e=Sc();function E1e(t,e,r){e=h1e(e,t);for(var i=-1,n=e.length,s=!1;++i{var y1e=HZ(),w1e=rF();function B1e(t,e){return t!=null&&w1e(t,e,y1e)}VZ.exports=B1e});var XZ=I((nft,_Z)=>{var Q1e=KZ(),b1e=iF();function v1e(t,e){return Q1e(t,e,function(r,i){return b1e(t,i)})}_Z.exports=v1e});var $B=I((sft,ZZ)=>{function S1e(t,e){for(var r=-1,i=e.length,n=t.length;++r{var e$=ac(),x1e=Pd(),k1e=As(),t$=e$?e$.isConcatSpreadable:void 0;function P1e(t){return k1e(t)||x1e(t)||!!(t$&&t&&t[t$])}$Z.exports=P1e});var s$=I((aft,i$)=>{var D1e=$B(),R1e=r$();function n$(t,e,r,i,n){var s=-1,o=t.length;for(r||(r=R1e),n||(n=[]);++s0&&r(a)?e>1?n$(a,e-1,r,i,n):D1e(n,a):i||(n[n.length]=a)}return n}i$.exports=n$});var a$=I((Aft,o$)=>{var F1e=s$();function N1e(t){var e=t==null?0:t.length;return e?F1e(t,1):[]}o$.exports=N1e});var l$=I((lft,A$)=>{function L1e(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}A$.exports=L1e});var nF=I((cft,c$)=>{var T1e=l$(),u$=Math.max;function M1e(t,e,r){return e=u$(e===void 0?t.length-1:e,0),function(){for(var i=arguments,n=-1,s=u$(i.length-e,0),o=Array(s);++n{function O1e(t){return function(){return t}}g$.exports=O1e});var e0=I((gft,h$)=>{function K1e(t){return t}h$.exports=K1e});var C$=I((fft,p$)=>{var U1e=f$(),d$=eF(),H1e=e0(),G1e=d$?function(t,e){return d$(t,"toString",{configurable:!0,enumerable:!1,value:U1e(e),writable:!0})}:H1e;p$.exports=G1e});var I$=I((hft,m$)=>{var j1e=800,Y1e=16,q1e=Date.now;function J1e(t){var e=0,r=0;return function(){var i=q1e(),n=Y1e-(i-r);if(r=i,n>0){if(++e>=j1e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}m$.exports=J1e});var sF=I((pft,E$)=>{var W1e=C$(),z1e=I$(),V1e=z1e(W1e);E$.exports=V1e});var w$=I((dft,y$)=>{var _1e=a$(),X1e=nF(),Z1e=sF();function $1e(t){return Z1e(X1e(t,void 0,_1e),t+"")}y$.exports=$1e});var Q$=I((Cft,B$)=>{var eUe=XZ(),tUe=w$(),rUe=tUe(function(t,e){return t==null?{}:eUe(t,e)});B$.exports=rUe});var M$=I((lpt,N$)=>{"use strict";var pF;try{pF=Map}catch(t){}var dF;try{dF=Set}catch(t){}function L$(t,e,r){if(!t||typeof t!="object"||typeof t=="function")return t;if(t.nodeType&&"cloneNode"in t)return t.cloneNode(!0);if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);if(Array.isArray(t))return t.map(T$);if(pF&&t instanceof pF)return new Map(Array.from(t.entries()));if(dF&&t instanceof dF)return new Set(Array.from(t.values()));if(t instanceof Object){e.push(t);var i=Object.create(t);r.push(i);for(var n in t){var s=e.findIndex(function(o){return o===t[n]});i[n]=s>-1?r[s]:L$(t[n],e,r)}return i}return t}function T$(t){return L$(t,[],[])}N$.exports=T$});var Nd=I(CF=>{"use strict";Object.defineProperty(CF,"__esModule",{value:!0});CF.default=uUe;var gUe=Object.prototype.toString,fUe=Error.prototype.toString,hUe=RegExp.prototype.toString,pUe=typeof Symbol!="undefined"?Symbol.prototype.toString:()=>"",dUe=/^Symbol\((.*)\)(.*)$/;function CUe(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function O$(t,e=!1){if(t==null||t===!0||t===!1)return""+t;let r=typeof t;if(r==="number")return CUe(t);if(r==="string")return e?`"${t}"`:t;if(r==="function")return"[Function "+(t.name||"anonymous")+"]";if(r==="symbol")return pUe.call(t).replace(dUe,"Symbol($1)");let i=gUe.call(t).slice(8,-1);return i==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):i==="Error"||t instanceof Error?"["+fUe.call(t)+"]":i==="RegExp"?hUe.call(t):null}function uUe(t,e){let r=O$(t,e);return r!==null?r:JSON.stringify(t,function(i,n){let s=O$(this[i],e);return s!==null?s:n},2)}});var La=I(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.default=ci.array=ci.object=ci.boolean=ci.date=ci.number=ci.string=ci.mixed=void 0;var K$=mUe(Nd());function mUe(t){return t&&t.__esModule?t:{default:t}}var U$={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:r,originalValue:i})=>{let n=i!=null&&i!==r,s=`${t} must be a \`${e}\` type, but the final value was: \`${(0,K$.default)(r,!0)}\``+(n?` (cast from the value \`${(0,K$.default)(i,!0)}\`).`:".");return r===null&&(s+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),s},defined:"${path} must be defined"};ci.mixed=U$;var H$={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"};ci.string=H$;var G$={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"};ci.number=G$;var j$={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"};ci.date=j$;var Y$={isValue:"${path} field must be ${value}"};ci.boolean=Y$;var q$={noUnknown:"${path} field has unspecified keys: ${unknown}"};ci.object=q$;var J$={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};ci.array=J$;var IUe=Object.assign(Object.create(null),{mixed:U$,string:H$,number:G$,date:j$,object:q$,array:J$,boolean:Y$});ci.default=IUe});var z$=I((gpt,W$)=>{var EUe=Object.prototype,yUe=EUe.hasOwnProperty;function wUe(t,e){return t!=null&&yUe.call(t,e)}W$.exports=wUe});var Ld=I((fpt,V$)=>{var BUe=z$(),QUe=rF();function bUe(t,e){return t!=null&&QUe(t,e,BUe)}V$.exports=bUe});var qg=I(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});n0.default=void 0;var vUe=t=>t&&t.__isYupSchema__;n0.default=vUe});var Z$=I(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.default=void 0;var SUe=_$(Ld()),xUe=_$(qg());function _$(t){return t&&t.__esModule?t:{default:t}}var X$=class{constructor(e,r){if(this.refs=e,this.refs=e,typeof r=="function"){this.fn=r;return}if(!(0,SUe.default)(r,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:n,otherwise:s}=r,o=typeof i=="function"?i:(...a)=>a.every(l=>l===i);this.fn=function(...a){let l=a.pop(),c=a.pop(),u=o(...a)?n:s;if(!!u)return typeof u=="function"?u(c):c.concat(u.resolve(l))}}resolve(e,r){let i=this.refs.map(s=>s.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),n=this.fn.apply(e,i.concat(e,r));if(n===void 0||n===e)return e;if(!(0,xUe.default)(n))throw new TypeError("conditions must return a schema object");return n.resolve(r)}},kUe=X$;s0.default=kUe});var IF=I(mF=>{"use strict";Object.defineProperty(mF,"__esModule",{value:!0});mF.default=PUe;function PUe(t){return t==null?[]:[].concat(t)}});var xc=I(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});o0.default=void 0;var DUe=$$(Nd()),RUe=$$(IF());function $$(t){return t&&t.__esModule?t:{default:t}}function EF(){return EF=Object.assign||function(t){for(var e=1;e(0,DUe.default)(r[s])):typeof e=="function"?e(r):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,r,i,n){super();this.name="ValidationError",this.value=r,this.path=i,this.type=n,this.errors=[],this.inner=[],(0,RUe.default)(e).forEach(s=>{Td.isError(s)?(this.errors.push(...s.errors),this.inner=this.inner.concat(s.inner.length?s.inner:s)):this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,Td)}};o0.default=Td});var a0=I(yF=>{"use strict";Object.defineProperty(yF,"__esModule",{value:!0});yF.default=NUe;var wF=LUe(xc());function LUe(t){return t&&t.__esModule?t:{default:t}}var TUe=t=>{let e=!1;return(...r)=>{e||(e=!0,t(...r))}};function NUe(t,e){let{endEarly:r,tests:i,args:n,value:s,errors:o,sort:a,path:l}=t,c=TUe(e),u=i.length,g=[];if(o=o||[],!u)return o.length?c(new wF.default(o,s,l)):c(null,s);for(let f=0;f{function MUe(t){return function(e,r,i){for(var n=-1,s=Object(e),o=i(e),a=o.length;a--;){var l=o[t?a:++n];if(r(s[l],l,s)===!1)break}return e}}eee.exports=MUe});var BF=I((Ept,ree)=>{var OUe=tee(),KUe=OUe();ree.exports=KUe});var nee=I((ypt,iee)=>{function UUe(t,e){for(var r=-1,i=Array(t);++r{function HUe(){return!1}see.exports=HUe});var Od=I((Md,Jg)=>{var GUe=Ks(),jUe=oee(),aee=typeof Md=="object"&&Md&&!Md.nodeType&&Md,Aee=aee&&typeof Jg=="object"&&Jg&&!Jg.nodeType&&Jg,YUe=Aee&&Aee.exports===aee,lee=YUe?GUe.Buffer:void 0,qUe=lee?lee.isBuffer:void 0,JUe=qUe||jUe;Jg.exports=JUe});var uee=I((Bpt,cee)=>{var WUe=Ac(),zUe=ZB(),VUe=Qo(),_Ue="[object Arguments]",XUe="[object Array]",ZUe="[object Boolean]",$Ue="[object Date]",e2e="[object Error]",t2e="[object Function]",r2e="[object Map]",i2e="[object Number]",n2e="[object Object]",s2e="[object RegExp]",o2e="[object Set]",a2e="[object String]",A2e="[object WeakMap]",l2e="[object ArrayBuffer]",c2e="[object DataView]",u2e="[object Float32Array]",g2e="[object Float64Array]",f2e="[object Int8Array]",h2e="[object Int16Array]",p2e="[object Int32Array]",d2e="[object Uint8Array]",C2e="[object Uint8ClampedArray]",m2e="[object Uint16Array]",I2e="[object Uint32Array]",lr={};lr[u2e]=lr[g2e]=lr[f2e]=lr[h2e]=lr[p2e]=lr[d2e]=lr[C2e]=lr[m2e]=lr[I2e]=!0;lr[_Ue]=lr[XUe]=lr[l2e]=lr[ZUe]=lr[c2e]=lr[$Ue]=lr[e2e]=lr[t2e]=lr[r2e]=lr[i2e]=lr[n2e]=lr[s2e]=lr[o2e]=lr[a2e]=lr[A2e]=!1;function E2e(t){return VUe(t)&&zUe(t.length)&&!!lr[WUe(t)]}cee.exports=E2e});var A0=I((Qpt,gee)=>{function y2e(t){return function(e){return t(e)}}gee.exports=y2e});var l0=I((Kd,Wg)=>{var w2e=WP(),fee=typeof Kd=="object"&&Kd&&!Kd.nodeType&&Kd,Ud=fee&&typeof Wg=="object"&&Wg&&!Wg.nodeType&&Wg,B2e=Ud&&Ud.exports===fee,QF=B2e&&w2e.process,Q2e=function(){try{var t=Ud&&Ud.require&&Ud.require("util").types;return t||QF&&QF.binding&&QF.binding("util")}catch(e){}}();Wg.exports=Q2e});var c0=I((bpt,hee)=>{var b2e=uee(),v2e=A0(),pee=l0(),dee=pee&&pee.isTypedArray,S2e=dee?v2e(dee):b2e;hee.exports=S2e});var bF=I((vpt,Cee)=>{var x2e=nee(),k2e=Pd(),P2e=As(),D2e=Od(),R2e=kd(),F2e=c0(),N2e=Object.prototype,L2e=N2e.hasOwnProperty;function T2e(t,e){var r=P2e(t),i=!r&&k2e(t),n=!r&&!i&&D2e(t),s=!r&&!i&&!n&&F2e(t),o=r||i||n||s,a=o?x2e(t.length,String):[],l=a.length;for(var c in t)(e||L2e.call(t,c))&&!(o&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||R2e(c,l)))&&a.push(c);return a}Cee.exports=T2e});var u0=I((Spt,mee)=>{var M2e=Object.prototype;function O2e(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||M2e;return t===r}mee.exports=O2e});var vF=I((xpt,Iee)=>{function K2e(t,e){return function(r){return t(e(r))}}Iee.exports=K2e});var yee=I((kpt,Eee)=>{var U2e=vF(),H2e=U2e(Object.keys,Object);Eee.exports=H2e});var Bee=I((Ppt,wee)=>{var G2e=u0(),j2e=yee(),Y2e=Object.prototype,q2e=Y2e.hasOwnProperty;function J2e(t){if(!G2e(t))return j2e(t);var e=[];for(var r in Object(t))q2e.call(t,r)&&r!="constructor"&&e.push(r);return e}wee.exports=J2e});var Hd=I((Dpt,Qee)=>{var W2e=zB(),z2e=ZB();function V2e(t){return t!=null&&z2e(t.length)&&!W2e(t)}Qee.exports=V2e});var zg=I((Rpt,bee)=>{var _2e=bF(),X2e=Bee(),Z2e=Hd();function $2e(t){return Z2e(t)?_2e(t):X2e(t)}bee.exports=$2e});var SF=I((Fpt,vee)=>{var eHe=BF(),tHe=zg();function rHe(t,e){return t&&eHe(t,e,tHe)}vee.exports=rHe});var xee=I((Npt,See)=>{var iHe=vd();function nHe(){this.__data__=new iHe,this.size=0}See.exports=nHe});var Pee=I((Lpt,kee)=>{function sHe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}kee.exports=sHe});var Ree=I((Tpt,Dee)=>{function oHe(t){return this.__data__.get(t)}Dee.exports=oHe});var Nee=I((Mpt,Fee)=>{function aHe(t){return this.__data__.has(t)}Fee.exports=aHe});var Tee=I((Opt,Lee)=>{var AHe=vd(),lHe=VB(),cHe=_B(),uHe=200;function gHe(t,e){var r=this.__data__;if(r instanceof AHe){var i=r.__data__;if(!lHe||i.length{var fHe=vd(),hHe=xee(),pHe=Pee(),dHe=Ree(),CHe=Nee(),mHe=Tee();function Vg(t){var e=this.__data__=new fHe(t);this.size=e.size}Vg.prototype.clear=hHe;Vg.prototype.delete=pHe;Vg.prototype.get=dHe;Vg.prototype.has=CHe;Vg.prototype.set=mHe;Mee.exports=Vg});var Kee=I((Upt,Oee)=>{var IHe="__lodash_hash_undefined__";function EHe(t){return this.__data__.set(t,IHe),this}Oee.exports=EHe});var Hee=I((Hpt,Uee)=>{function yHe(t){return this.__data__.has(t)}Uee.exports=yHe});var jee=I((Gpt,Gee)=>{var wHe=_B(),BHe=Kee(),QHe=Hee();function g0(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new wHe;++e{function bHe(t,e){for(var r=-1,i=t==null?0:t.length;++r{function vHe(t,e){return t.has(e)}Jee.exports=vHe});var xF=I((qpt,zee)=>{var SHe=jee(),xHe=qee(),kHe=Wee(),PHe=1,DHe=2;function RHe(t,e,r,i,n,s){var o=r&PHe,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(t),u=s.get(e);if(c&&u)return c==e&&u==t;var g=-1,f=!0,h=r&DHe?new SHe:void 0;for(s.set(t,e),s.set(e,t);++g{var FHe=Ks(),NHe=FHe.Uint8Array;Vee.exports=NHe});var Xee=I((Wpt,_ee)=>{function LHe(t){var e=-1,r=Array(t.size);return t.forEach(function(i,n){r[++e]=[n,i]}),r}_ee.exports=LHe});var $ee=I((zpt,Zee)=>{function THe(t){var e=-1,r=Array(t.size);return t.forEach(function(i){r[++e]=i}),r}Zee.exports=THe});var nte=I((Vpt,ete)=>{var tte=ac(),rte=kF(),MHe=Kg(),OHe=xF(),KHe=Xee(),UHe=$ee(),HHe=1,GHe=2,jHe="[object Boolean]",YHe="[object Date]",qHe="[object Error]",JHe="[object Map]",WHe="[object Number]",zHe="[object RegExp]",VHe="[object Set]",_He="[object String]",XHe="[object Symbol]",ZHe="[object ArrayBuffer]",$He="[object DataView]",ite=tte?tte.prototype:void 0,PF=ite?ite.valueOf:void 0;function eGe(t,e,r,i,n,s,o){switch(r){case $He:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ZHe:return!(t.byteLength!=e.byteLength||!s(new rte(t),new rte(e)));case jHe:case YHe:case WHe:return MHe(+t,+e);case qHe:return t.name==e.name&&t.message==e.message;case zHe:case _He:return t==e+"";case JHe:var a=KHe;case VHe:var l=i&HHe;if(a||(a=UHe),t.size!=e.size&&!l)return!1;var c=o.get(t);if(c)return c==e;i|=GHe,o.set(t,e);var u=OHe(a(t),a(e),i,n,s,o);return o.delete(t),u;case XHe:if(PF)return PF.call(t)==PF.call(e)}return!1}ete.exports=eGe});var DF=I((_pt,ste)=>{var tGe=$B(),rGe=As();function iGe(t,e,r){var i=e(t);return rGe(t)?i:tGe(i,r(t))}ste.exports=iGe});var ate=I((Xpt,ote)=>{function nGe(t,e){for(var r=-1,i=t==null?0:t.length,n=0,s=[];++r{function sGe(){return[]}Ate.exports=sGe});var f0=I(($pt,lte)=>{var oGe=ate(),aGe=RF(),AGe=Object.prototype,lGe=AGe.propertyIsEnumerable,cte=Object.getOwnPropertySymbols,cGe=cte?function(t){return t==null?[]:(t=Object(t),oGe(cte(t),function(e){return lGe.call(t,e)}))}:aGe;lte.exports=cGe});var FF=I((edt,ute)=>{var uGe=DF(),gGe=f0(),fGe=zg();function hGe(t){return uGe(t,fGe,gGe)}ute.exports=hGe});var hte=I((tdt,gte)=>{var fte=FF(),pGe=1,dGe=Object.prototype,CGe=dGe.hasOwnProperty;function mGe(t,e,r,i,n,s){var o=r&pGe,a=fte(t),l=a.length,c=fte(e),u=c.length;if(l!=u&&!o)return!1;for(var g=l;g--;){var f=a[g];if(!(o?f in e:CGe.call(e,f)))return!1}var h=s.get(t),p=s.get(e);if(h&&p)return h==e&&p==t;var d=!0;s.set(t,e),s.set(e,t);for(var m=o;++g{var IGe=UA(),EGe=Ks(),yGe=IGe(EGe,"DataView");pte.exports=yGe});var mte=I((idt,Cte)=>{var wGe=UA(),BGe=Ks(),QGe=wGe(BGe,"Promise");Cte.exports=QGe});var Ete=I((ndt,Ite)=>{var bGe=UA(),vGe=Ks(),SGe=bGe(vGe,"Set");Ite.exports=SGe});var wte=I((sdt,yte)=>{var xGe=UA(),kGe=Ks(),PGe=xGe(kGe,"WeakMap");yte.exports=PGe});var jd=I((odt,Bte)=>{var NF=dte(),LF=VB(),TF=mte(),MF=Ete(),OF=wte(),Qte=Ac(),_g=ZR(),bte="[object Map]",DGe="[object Object]",vte="[object Promise]",Ste="[object Set]",xte="[object WeakMap]",kte="[object DataView]",RGe=_g(NF),FGe=_g(LF),NGe=_g(TF),LGe=_g(MF),TGe=_g(OF),kc=Qte;(NF&&kc(new NF(new ArrayBuffer(1)))!=kte||LF&&kc(new LF)!=bte||TF&&kc(TF.resolve())!=vte||MF&&kc(new MF)!=Ste||OF&&kc(new OF)!=xte)&&(kc=function(t){var e=Qte(t),r=e==DGe?t.constructor:void 0,i=r?_g(r):"";if(i)switch(i){case RGe:return kte;case FGe:return bte;case NGe:return vte;case LGe:return Ste;case TGe:return xte}return e});Bte.exports=kc});var Mte=I((adt,Pte)=>{var KF=Gd(),MGe=xF(),OGe=nte(),KGe=hte(),Dte=jd(),Rte=As(),Fte=Od(),UGe=c0(),HGe=1,Nte="[object Arguments]",Lte="[object Array]",h0="[object Object]",GGe=Object.prototype,Tte=GGe.hasOwnProperty;function jGe(t,e,r,i,n,s){var o=Rte(t),a=Rte(e),l=o?Lte:Dte(t),c=a?Lte:Dte(e);l=l==Nte?h0:l,c=c==Nte?h0:c;var u=l==h0,g=c==h0,f=l==c;if(f&&Fte(t)){if(!Fte(e))return!1;o=!0,u=!1}if(f&&!u)return s||(s=new KF),o||UGe(t)?MGe(t,e,r,i,n,s):OGe(t,e,l,r,i,n,s);if(!(r&HGe)){var h=u&&Tte.call(t,"__wrapped__"),p=g&&Tte.call(e,"__wrapped__");if(h||p){var d=h?t.value():t,m=p?e.value():e;return s||(s=new KF),n(d,m,r,i,s)}}return f?(s||(s=new KF),KGe(t,e,r,i,n,s)):!1}Pte.exports=jGe});var UF=I((Adt,Ote)=>{var YGe=Mte(),Kte=Qo();function Ute(t,e,r,i,n){return t===e?!0:t==null||e==null||!Kte(t)&&!Kte(e)?t!==t&&e!==e:YGe(t,e,r,i,Ute,n)}Ote.exports=Ute});var Gte=I((ldt,Hte)=>{var qGe=Gd(),JGe=UF(),WGe=1,zGe=2;function VGe(t,e,r,i){var n=r.length,s=n,o=!i;if(t==null)return!s;for(t=Object(t);n--;){var a=r[n];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++n{var _Ge=Gs();function XGe(t){return t===t&&!_Ge(t)}jte.exports=XGe});var qte=I((udt,Yte)=>{var ZGe=HF(),$Ge=zg();function eje(t){for(var e=$Ge(t),r=e.length;r--;){var i=e[r],n=t[i];e[r]=[i,n,ZGe(n)]}return e}Yte.exports=eje});var GF=I((gdt,Jte)=>{function tje(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}Jte.exports=tje});var zte=I((fdt,Wte)=>{var rje=Gte(),ije=qte(),nje=GF();function sje(t){var e=ije(t);return e.length==1&&e[0][2]?nje(e[0][0],e[0][1]):function(r){return r===t||rje(r,t,e)}}Wte.exports=sje});var p0=I((hdt,Vte)=>{var oje=xd();function aje(t,e,r){var i=t==null?void 0:oje(t,e);return i===void 0?r:i}Vte.exports=aje});var Xte=I((pdt,_te)=>{var Aje=UF(),lje=p0(),cje=iF(),uje=WB(),gje=HF(),fje=GF(),hje=Sc(),pje=1,dje=2;function Cje(t,e){return uje(t)&&gje(e)?fje(hje(t),e):function(r){var i=lje(r,t);return i===void 0&&i===e?cje(r,t):Aje(e,i,pje|dje)}}_te.exports=Cje});var $te=I((ddt,Zte)=>{function mje(t){return function(e){return e==null?void 0:e[t]}}Zte.exports=mje});var tre=I((Cdt,ere)=>{var Ije=xd();function Eje(t){return function(e){return Ije(e,t)}}ere.exports=Eje});var ire=I((mdt,rre)=>{var yje=$te(),wje=tre(),Bje=WB(),Qje=Sc();function bje(t){return Bje(t)?yje(Qje(t)):wje(t)}rre.exports=bje});var jF=I((Idt,nre)=>{var vje=zte(),Sje=Xte(),xje=e0(),kje=As(),Pje=ire();function Dje(t){return typeof t=="function"?t:t==null?xje:typeof t=="object"?kje(t)?Sje(t[0],t[1]):vje(t):Pje(t)}nre.exports=Dje});var YF=I((Edt,sre)=>{var Rje=jg(),Fje=SF(),Nje=jF();function Lje(t,e){var r={};return e=Nje(e,3),Fje(t,function(i,n,s){Rje(r,n,e(i,n,s))}),r}sre.exports=Lje});var Yd=I((ydt,ore)=>{"use strict";function Pc(t){this._maxSize=t,this.clear()}Pc.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Pc.prototype.get=function(t){return this._values[t]};Pc.prototype.set=function(t,e){return this._size>=this._maxSize&&this.clear(),t in this._values||this._size++,this._values[t]=e};var Tje=/[^.^\]^[]+|(?=\[\]|\.\.)/g,are=/^\d+$/,Mje=/^\d/,Oje=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Kje=/^\s*(['"]?)(.*?)(\1)\s*$/,qF=512,Are=new Pc(qF),lre=new Pc(qF),cre=new Pc(qF);ore.exports={Cache:Pc,split:WF,normalizePath:JF,setter:function(t){var e=JF(t);return lre.get(t)||lre.set(t,function(i,n){for(var s=0,o=e.length,a=i;s{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.create=Yje;qd.default=void 0;var qje=Yd(),d0={context:"$",value:"."};function Yje(t,e){return new C0(t,e)}var C0=class{constructor(e,r={}){if(typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===d0.context,this.isValue=this.key[0]===d0.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?d0.context:this.isValue?d0.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&(0,qje.getter)(this.path,!0),this.map=r.map}getValue(e,r,i){let n=this.isContext?i:this.isValue?e:r;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,r){return this.getValue(e,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};qd.default=C0;C0.prototype.__isYupRef=!0});var ure=I(VF=>{"use strict";Object.defineProperty(VF,"__esModule",{value:!0});VF.default=Jje;var Wje=_F(YF()),m0=_F(xc()),zje=_F(Dc());function _F(t){return t&&t.__esModule?t:{default:t}}function I0(){return I0=Object.assign||function(t){for(var e=1;e=0)&&(r[n]=t[n]);return r}function Jje(t){function e(r,i){let{value:n,path:s="",label:o,options:a,originalValue:l,sync:c}=r,u=Vje(r,["value","path","label","options","originalValue","sync"]),{name:g,test:f,params:h,message:p}=t,{parent:d,context:m}=a;function E(L){return zje.default.isRef(L)?L.getValue(n,d,m):L}function B(L={}){let K=(0,Wje.default)(I0({value:n,originalValue:l,label:o,path:L.path||s},h,L.params),E),J=new m0.default(m0.default.formatError(L.message||p,K),n,K.path,L.type||g);return J.params=K,J}let b=I0({path:s,parent:d,type:g,createError:B,resolve:E,options:a,originalValue:l},u);if(!c){try{Promise.resolve(f.call(b,n,b)).then(L=>{m0.default.isError(L)?i(L):L?i(null,L):i(B())})}catch(L){i(L)}return}let R;try{var H;if(R=f.call(b,n,b),typeof((H=R)==null?void 0:H.then)=="function")throw new Error(`Validation test of type: "${b.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(L){i(L);return}m0.default.isError(R)?i(R):R?i(null,R):i(B())}return e.OPTIONS=t,e}});var XF=I(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});Jd.getIn=gre;Jd.default=void 0;var _je=Yd(),Xje=t=>t.substr(0,t.length-1).substr(1);function gre(t,e,r,i=r){let n,s,o;return e?((0,_je.forEach)(e,(a,l,c)=>{let u=l?Xje(a):a;if(t=t.resolve({context:i,parent:n,value:r}),t.innerType){let g=c?parseInt(u,10):0;if(r&&g>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${e}. because there is no value at that index. `);n=r,r=r&&r[g],t=t.innerType}if(!c){if(!t.fields||!t.fields[u])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${t._type}")`);n=r,r=r&&r[u],t=t.fields[u]}s=u,o=l?"["+a+"]":"."+a}),{schema:t,parent:n,parentPath:s}):{parent:n,parentPath:e,schema:t}}var Zje=(t,e,r,i)=>gre(t,e,r,i).schema,$je=Zje;Jd.default=$je});var hre=I(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});E0.default=void 0;var fre=eYe(Dc());function eYe(t){return t&&t.__esModule?t:{default:t}}var y0=class{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){let e=[];for(let r of this.list)e.push(r);for(let[,r]of this.refs)e.push(r.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(e){fre.default.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){fre.default.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}has(e,r){if(this.list.has(e))return!0;let i,n=this.refs.values();for(;i=n.next(),!i.done;)if(r(i.value)===e)return!0;return!1}clone(){let e=new y0;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,r){let i=this.clone();return e.list.forEach(n=>i.add(n)),e.refs.forEach(n=>i.add(n)),r.list.forEach(n=>i.delete(n)),r.refs.forEach(n=>i.delete(n)),i}};E0.default=y0});var Ma=I(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});w0.default=void 0;var pre=Ta(M$()),Xg=La(),tYe=Ta(Z$()),dre=Ta(a0()),B0=Ta(ure()),Cre=Ta(Nd()),rYe=Ta(Dc()),iYe=XF(),nYe=Ta(IF()),mre=Ta(xc()),Ire=Ta(hre());function Ta(t){return t&&t.__esModule?t:{default:t}}function ds(){return ds=Object.assign||function(t){for(var e=1;e{this.typeError(Xg.mixed.notType)}),this.type=(e==null?void 0:e.type)||"mixed",this.spec=ds({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},e==null?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeError=this._typeError,r._whitelistError=this._whitelistError,r._blacklistError=this._blacklistError,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.exclusiveTests=ds({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=(0,pre.default)(ds({},this.spec,e)),r}label(e){var r=this.clone();return r.spec.label=e,r}meta(...e){if(e.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},e[0]),r}withMutation(e){let r=this._mutate;this._mutate=!0;let i=e(this);return this._mutate=r,i}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let r=this,i=e.clone(),n=ds({},r.spec,i.spec);return i.spec=n,i._typeError||(i._typeError=r._typeError),i._whitelistError||(i._whitelistError=r._whitelistError),i._blacklistError||(i._blacklistError=r._blacklistError),i._whitelist=r._whitelist.merge(e._whitelist,e._blacklist),i._blacklist=r._blacklist.merge(e._blacklist,e._whitelist),i.tests=r.tests,i.exclusiveTests=r.exclusiveTests,i.withMutation(s=>{e.tests.forEach(o=>{s.test(o.OPTIONS)})}),i}isType(e){return this.spec.nullable&&e===null?!0:this._typeCheck(e)}resolve(e){let r=this;if(r.conditions.length){let i=r.conditions;r=r.clone(),r.conditions=[],r=i.reduce((n,s)=>s.resolve(n,e),r),r=r.resolve(e)}return r}cast(e,r={}){let i=this.resolve(ds({value:e},r)),n=i._cast(e,r);if(e!==void 0&&r.assert!==!1&&i.isType(n)!==!0){let s=(0,Cre.default)(e),o=(0,Cre.default)(n);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${i._type}". +`}function tMe(t,e,r,i,n,s){return X_(t,t,e,r,i,n,s)}});var $_=I(YB=>{"use strict";Object.defineProperty(YB,"__esModule",{value:!0});YB.arrayEqual=oMe;YB.arrayStartsWith=Z_;function oMe(t,e){return t.length!==e.length?!1:Z_(t,e)}function Z_(t,e){if(e.length>t.length)return!1;for(var r=0;r{"use strict";Object.defineProperty(qB,"__esModule",{value:!0});qB.calcLineCount=eX;qB.merge=aMe;var AMe=YR(),lMe=GB(),qR=$_();function Mg(t){return gMe(t)||uMe(t)||cMe()}function cMe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function uMe(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function gMe(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e{"use strict";Object.defineProperty(zR,"__esModule",{value:!0});zR.convertChangesToDMP=dMe;function dMe(t){for(var e=[],r,i,n=0;n{"use strict";Object.defineProperty(VR,"__esModule",{value:!0});VR.convertChangesToXML=CMe;function CMe(t){for(var e=[],r=0;r"):i.removed&&e.push(""),e.push(mMe(i.value)),i.added?e.push(""):i.removed&&e.push("")}return e.join("")}function mMe(t){var e=t;return e=e.replace(/&/g,"&"),e=e.replace(//g,">"),e=e.replace(/"/g,"""),e}});var CX=I(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});Object.defineProperty(br,"Diff",{enumerable:!0,get:function(){return IMe.default}});Object.defineProperty(br,"diffChars",{enumerable:!0,get:function(){return EMe.diffChars}});Object.defineProperty(br,"diffWords",{enumerable:!0,get:function(){return fX.diffWords}});Object.defineProperty(br,"diffWordsWithSpace",{enumerable:!0,get:function(){return fX.diffWordsWithSpace}});Object.defineProperty(br,"diffLines",{enumerable:!0,get:function(){return hX.diffLines}});Object.defineProperty(br,"diffTrimmedLines",{enumerable:!0,get:function(){return hX.diffTrimmedLines}});Object.defineProperty(br,"diffSentences",{enumerable:!0,get:function(){return yMe.diffSentences}});Object.defineProperty(br,"diffCss",{enumerable:!0,get:function(){return wMe.diffCss}});Object.defineProperty(br,"diffJson",{enumerable:!0,get:function(){return pX.diffJson}});Object.defineProperty(br,"canonicalize",{enumerable:!0,get:function(){return pX.canonicalize}});Object.defineProperty(br,"diffArrays",{enumerable:!0,get:function(){return BMe.diffArrays}});Object.defineProperty(br,"applyPatch",{enumerable:!0,get:function(){return dX.applyPatch}});Object.defineProperty(br,"applyPatches",{enumerable:!0,get:function(){return dX.applyPatches}});Object.defineProperty(br,"parsePatch",{enumerable:!0,get:function(){return QMe.parsePatch}});Object.defineProperty(br,"merge",{enumerable:!0,get:function(){return bMe.merge}});Object.defineProperty(br,"structuredPatch",{enumerable:!0,get:function(){return _R.structuredPatch}});Object.defineProperty(br,"createTwoFilesPatch",{enumerable:!0,get:function(){return _R.createTwoFilesPatch}});Object.defineProperty(br,"createPatch",{enumerable:!0,get:function(){return _R.createPatch}});Object.defineProperty(br,"convertChangesToDMP",{enumerable:!0,get:function(){return vMe.convertChangesToDMP}});Object.defineProperty(br,"convertChangesToXML",{enumerable:!0,get:function(){return SMe.convertChangesToXML}});var IMe=xMe(Na()),EMe=M_(),fX=U_(),hX=KB(),yMe=H_(),wMe=G_(),pX=Y_(),BMe=q_(),dX=V_(),QMe=GB(),bMe=cX(),_R=YR(),vMe=uX(),SMe=gX();function xMe(t){return t&&t.__esModule?t:{default:t}}});var WB=I((agt,mX)=>{var kMe=As(),PMe=Nw(),DMe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,RMe=/^\w*$/;function FMe(t,e){if(kMe(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||PMe(t)?!0:RMe.test(t)||!DMe.test(t)||e!=null&&t in Object(e)}mX.exports=FMe});var Gs=I((Agt,IX)=>{function NMe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}IX.exports=NMe});var zB=I((lgt,EX)=>{var LMe=Ac(),TMe=Gs(),MMe="[object AsyncFunction]",OMe="[object Function]",KMe="[object GeneratorFunction]",UMe="[object Proxy]";function HMe(t){if(!TMe(t))return!1;var e=LMe(t);return e==OMe||e==KMe||e==MMe||e==UMe}EX.exports=HMe});var wX=I((cgt,yX)=>{var GMe=Ks(),jMe=GMe["__core-js_shared__"];yX.exports=jMe});var bX=I((ugt,BX)=>{var XR=wX(),QX=function(){var t=/[^.]+$/.exec(XR&&XR.keys&&XR.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function YMe(t){return!!QX&&QX in t}BX.exports=YMe});var ZR=I((ggt,vX)=>{var qMe=Function.prototype,JMe=qMe.toString;function WMe(t){if(t!=null){try{return JMe.call(t)}catch(e){}try{return t+""}catch(e){}}return""}vX.exports=WMe});var xX=I((fgt,SX)=>{var zMe=zB(),VMe=bX(),_Me=Gs(),XMe=ZR(),ZMe=/[\\^$.*+?()[\]{}|]/g,$Me=/^\[object .+?Constructor\]$/,eOe=Function.prototype,tOe=Object.prototype,rOe=eOe.toString,iOe=tOe.hasOwnProperty,nOe=RegExp("^"+rOe.call(iOe).replace(ZMe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sOe(t){if(!_Me(t)||VMe(t))return!1;var e=zMe(t)?nOe:$Me;return e.test(XMe(t))}SX.exports=sOe});var PX=I((hgt,kX)=>{function oOe(t,e){return t==null?void 0:t[e]}kX.exports=oOe});var UA=I((pgt,DX)=>{var aOe=xX(),AOe=PX();function lOe(t,e){var r=AOe(t,e);return aOe(r)?r:void 0}DX.exports=lOe});var Qd=I((dgt,RX)=>{var cOe=UA(),uOe=cOe(Object,"create");RX.exports=uOe});var LX=I((Cgt,FX)=>{var NX=Qd();function gOe(){this.__data__=NX?NX(null):{},this.size=0}FX.exports=gOe});var MX=I((mgt,TX)=>{function fOe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}TX.exports=fOe});var KX=I((Igt,OX)=>{var hOe=Qd(),pOe="__lodash_hash_undefined__",dOe=Object.prototype,COe=dOe.hasOwnProperty;function mOe(t){var e=this.__data__;if(hOe){var r=e[t];return r===pOe?void 0:r}return COe.call(e,t)?e[t]:void 0}OX.exports=mOe});var HX=I((Egt,UX)=>{var IOe=Qd(),EOe=Object.prototype,yOe=EOe.hasOwnProperty;function wOe(t){var e=this.__data__;return IOe?e[t]!==void 0:yOe.call(e,t)}UX.exports=wOe});var jX=I((ygt,GX)=>{var BOe=Qd(),QOe="__lodash_hash_undefined__";function bOe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=BOe&&e===void 0?QOe:e,this}GX.exports=bOe});var qX=I((wgt,YX)=>{var vOe=LX(),SOe=MX(),xOe=KX(),kOe=HX(),POe=jX();function Og(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{function DOe(){this.__data__=[],this.size=0}JX.exports=DOe});var Kg=I((Qgt,zX)=>{function ROe(t,e){return t===e||t!==t&&e!==e}zX.exports=ROe});var bd=I((bgt,VX)=>{var FOe=Kg();function NOe(t,e){for(var r=t.length;r--;)if(FOe(t[r][0],e))return r;return-1}VX.exports=NOe});var XX=I((vgt,_X)=>{var LOe=bd(),TOe=Array.prototype,MOe=TOe.splice;function OOe(t){var e=this.__data__,r=LOe(e,t);if(r<0)return!1;var i=e.length-1;return r==i?e.pop():MOe.call(e,r,1),--this.size,!0}_X.exports=OOe});var $X=I((Sgt,ZX)=>{var KOe=bd();function UOe(t){var e=this.__data__,r=KOe(e,t);return r<0?void 0:e[r][1]}ZX.exports=UOe});var tZ=I((xgt,eZ)=>{var HOe=bd();function GOe(t){return HOe(this.__data__,t)>-1}eZ.exports=GOe});var iZ=I((kgt,rZ)=>{var jOe=bd();function YOe(t,e){var r=this.__data__,i=jOe(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}rZ.exports=YOe});var vd=I((Pgt,nZ)=>{var qOe=WX(),JOe=XX(),WOe=$X(),zOe=tZ(),VOe=iZ();function Ug(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{var _Oe=UA(),XOe=Ks(),ZOe=_Oe(XOe,"Map");sZ.exports=ZOe});var AZ=I((Rgt,oZ)=>{var aZ=qX(),$Oe=vd(),eKe=VB();function tKe(){this.size=0,this.__data__={hash:new aZ,map:new(eKe||$Oe),string:new aZ}}oZ.exports=tKe});var cZ=I((Fgt,lZ)=>{function rKe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}lZ.exports=rKe});var Sd=I((Ngt,uZ)=>{var iKe=cZ();function nKe(t,e){var r=t.__data__;return iKe(e)?r[typeof e=="string"?"string":"hash"]:r.map}uZ.exports=nKe});var fZ=I((Lgt,gZ)=>{var sKe=Sd();function oKe(t){var e=sKe(this,t).delete(t);return this.size-=e?1:0,e}gZ.exports=oKe});var pZ=I((Tgt,hZ)=>{var aKe=Sd();function AKe(t){return aKe(this,t).get(t)}hZ.exports=AKe});var CZ=I((Mgt,dZ)=>{var lKe=Sd();function cKe(t){return lKe(this,t).has(t)}dZ.exports=cKe});var IZ=I((Ogt,mZ)=>{var uKe=Sd();function gKe(t,e){var r=uKe(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}mZ.exports=gKe});var _B=I((Kgt,EZ)=>{var fKe=AZ(),hKe=fZ(),pKe=pZ(),dKe=CZ(),CKe=IZ();function Hg(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{var wZ=_B(),mKe="Expected a function";function $R(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(mKe);var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var o=t.apply(this,i);return r.cache=s.set(n,o)||s,o};return r.cache=new($R.Cache||wZ),r}$R.Cache=wZ;yZ.exports=$R});var bZ=I((Hgt,QZ)=>{var IKe=BZ(),EKe=500;function yKe(t){var e=IKe(t,function(i){return r.size===EKe&&r.clear(),i}),r=e.cache;return e}QZ.exports=yKe});var SZ=I((Ggt,vZ)=>{var wKe=bZ(),BKe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,QKe=/\\(\\)?/g,bKe=wKe(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(BKe,function(r,i,n,s){e.push(n?s.replace(QKe,"$1"):i||r)}),e});vZ.exports=bKe});var Gg=I((jgt,xZ)=>{var vKe=As(),SKe=WB(),xKe=SZ(),kKe=gg();function PKe(t,e){return vKe(t)?t:SKe(t,e)?[t]:xKe(kKe(t))}xZ.exports=PKe});var Sc=I((Ygt,kZ)=>{var DKe=Nw(),RKe=1/0;function FKe(t){if(typeof t=="string"||DKe(t))return t;var e=t+"";return e=="0"&&1/t==-RKe?"-0":e}kZ.exports=FKe});var xd=I((qgt,PZ)=>{var NKe=Gg(),LKe=Sc();function TKe(t,e){e=NKe(e,t);for(var r=0,i=e.length;t!=null&&r{var MKe=UA(),OKe=function(){try{var t=MKe(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();DZ.exports=OKe});var jg=I((Wgt,RZ)=>{var FZ=eF();function KKe(t,e,r){e=="__proto__"&&FZ?FZ(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}RZ.exports=KKe});var XB=I((zgt,NZ)=>{var UKe=jg(),HKe=Kg(),GKe=Object.prototype,jKe=GKe.hasOwnProperty;function YKe(t,e,r){var i=t[e];(!(jKe.call(t,e)&&HKe(i,r))||r===void 0&&!(e in t))&&UKe(t,e,r)}NZ.exports=YKe});var kd=I((Vgt,LZ)=>{var qKe=9007199254740991,JKe=/^(?:0|[1-9]\d*)$/;function WKe(t,e){var r=typeof t;return e=e==null?qKe:e,!!e&&(r=="number"||r!="symbol"&&JKe.test(t))&&t>-1&&t%1==0&&t{var zKe=XB(),VKe=Gg(),_Ke=kd(),MZ=Gs(),XKe=Sc();function ZKe(t,e,r,i){if(!MZ(t))return t;e=VKe(e,t);for(var n=-1,s=e.length,o=s-1,a=t;a!=null&&++n{var $Ke=xd(),e1e=tF(),t1e=Gg();function r1e(t,e,r){for(var i=-1,n=e.length,s={};++i{function i1e(t,e){return t!=null&&e in Object(t)}UZ.exports=i1e});var jZ=I(($gt,GZ)=>{var n1e=Ac(),s1e=Qo(),o1e="[object Arguments]";function a1e(t){return s1e(t)&&n1e(t)==o1e}GZ.exports=a1e});var Pd=I((eft,YZ)=>{var qZ=jZ(),A1e=Qo(),JZ=Object.prototype,l1e=JZ.hasOwnProperty,c1e=JZ.propertyIsEnumerable,u1e=qZ(function(){return arguments}())?qZ:function(t){return A1e(t)&&l1e.call(t,"callee")&&!c1e.call(t,"callee")};YZ.exports=u1e});var ZB=I((tft,WZ)=>{var g1e=9007199254740991;function f1e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=g1e}WZ.exports=f1e});var rF=I((rft,zZ)=>{var h1e=Gg(),p1e=Pd(),d1e=As(),C1e=kd(),m1e=ZB(),I1e=Sc();function E1e(t,e,r){e=h1e(e,t);for(var i=-1,n=e.length,s=!1;++i{var y1e=HZ(),w1e=rF();function B1e(t,e){return t!=null&&w1e(t,e,y1e)}VZ.exports=B1e});var XZ=I((nft,_Z)=>{var Q1e=KZ(),b1e=iF();function v1e(t,e){return Q1e(t,e,function(r,i){return b1e(t,i)})}_Z.exports=v1e});var $B=I((sft,ZZ)=>{function S1e(t,e){for(var r=-1,i=e.length,n=t.length;++r{var e$=ac(),x1e=Pd(),k1e=As(),t$=e$?e$.isConcatSpreadable:void 0;function P1e(t){return k1e(t)||x1e(t)||!!(t$&&t&&t[t$])}$Z.exports=P1e});var s$=I((aft,i$)=>{var D1e=$B(),R1e=r$();function n$(t,e,r,i,n){var s=-1,o=t.length;for(r||(r=R1e),n||(n=[]);++s0&&r(a)?e>1?n$(a,e-1,r,i,n):D1e(n,a):i||(n[n.length]=a)}return n}i$.exports=n$});var a$=I((Aft,o$)=>{var F1e=s$();function N1e(t){var e=t==null?0:t.length;return e?F1e(t,1):[]}o$.exports=N1e});var l$=I((lft,A$)=>{function L1e(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}A$.exports=L1e});var nF=I((cft,c$)=>{var T1e=l$(),u$=Math.max;function M1e(t,e,r){return e=u$(e===void 0?t.length-1:e,0),function(){for(var i=arguments,n=-1,s=u$(i.length-e,0),o=Array(s);++n{function O1e(t){return function(){return t}}g$.exports=O1e});var e0=I((gft,h$)=>{function K1e(t){return t}h$.exports=K1e});var C$=I((fft,p$)=>{var U1e=f$(),d$=eF(),H1e=e0(),G1e=d$?function(t,e){return d$(t,"toString",{configurable:!0,enumerable:!1,value:U1e(e),writable:!0})}:H1e;p$.exports=G1e});var I$=I((hft,m$)=>{var j1e=800,Y1e=16,q1e=Date.now;function J1e(t){var e=0,r=0;return function(){var i=q1e(),n=Y1e-(i-r);if(r=i,n>0){if(++e>=j1e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}m$.exports=J1e});var sF=I((pft,E$)=>{var W1e=C$(),z1e=I$(),V1e=z1e(W1e);E$.exports=V1e});var w$=I((dft,y$)=>{var _1e=a$(),X1e=nF(),Z1e=sF();function $1e(t){return Z1e(X1e(t,void 0,_1e),t+"")}y$.exports=$1e});var Q$=I((Cft,B$)=>{var eUe=XZ(),tUe=w$(),rUe=tUe(function(t,e){return t==null?{}:eUe(t,e)});B$.exports=rUe});var M$=I((lpt,N$)=>{"use strict";var pF;try{pF=Map}catch(t){}var dF;try{dF=Set}catch(t){}function L$(t,e,r){if(!t||typeof t!="object"||typeof t=="function")return t;if(t.nodeType&&"cloneNode"in t)return t.cloneNode(!0);if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);if(Array.isArray(t))return t.map(T$);if(pF&&t instanceof pF)return new Map(Array.from(t.entries()));if(dF&&t instanceof dF)return new Set(Array.from(t.values()));if(t instanceof Object){e.push(t);var i=Object.create(t);r.push(i);for(var n in t){var s=e.findIndex(function(o){return o===t[n]});i[n]=s>-1?r[s]:L$(t[n],e,r)}return i}return t}function T$(t){return L$(t,[],[])}N$.exports=T$});var Nd=I(CF=>{"use strict";Object.defineProperty(CF,"__esModule",{value:!0});CF.default=uUe;var gUe=Object.prototype.toString,fUe=Error.prototype.toString,hUe=RegExp.prototype.toString,pUe=typeof Symbol!="undefined"?Symbol.prototype.toString:()=>"",dUe=/^Symbol\((.*)\)(.*)$/;function CUe(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function O$(t,e=!1){if(t==null||t===!0||t===!1)return""+t;let r=typeof t;if(r==="number")return CUe(t);if(r==="string")return e?`"${t}"`:t;if(r==="function")return"[Function "+(t.name||"anonymous")+"]";if(r==="symbol")return pUe.call(t).replace(dUe,"Symbol($1)");let i=gUe.call(t).slice(8,-1);return i==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):i==="Error"||t instanceof Error?"["+fUe.call(t)+"]":i==="RegExp"?hUe.call(t):null}function uUe(t,e){let r=O$(t,e);return r!==null?r:JSON.stringify(t,function(i,n){let s=O$(this[i],e);return s!==null?s:n},2)}});var La=I(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.default=ci.array=ci.object=ci.boolean=ci.date=ci.number=ci.string=ci.mixed=void 0;var K$=mUe(Nd());function mUe(t){return t&&t.__esModule?t:{default:t}}var U$={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:r,originalValue:i})=>{let n=i!=null&&i!==r,s=`${t} must be a \`${e}\` type, but the final value was: \`${(0,K$.default)(r,!0)}\``+(n?` (cast from the value \`${(0,K$.default)(i,!0)}\`).`:".");return r===null&&(s+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),s},defined:"${path} must be defined"};ci.mixed=U$;var H$={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"};ci.string=H$;var G$={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"};ci.number=G$;var j$={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"};ci.date=j$;var Y$={isValue:"${path} field must be ${value}"};ci.boolean=Y$;var q$={noUnknown:"${path} field has unspecified keys: ${unknown}"};ci.object=q$;var J$={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};ci.array=J$;var IUe=Object.assign(Object.create(null),{mixed:U$,string:H$,number:G$,date:j$,object:q$,array:J$,boolean:Y$});ci.default=IUe});var z$=I((gpt,W$)=>{var EUe=Object.prototype,yUe=EUe.hasOwnProperty;function wUe(t,e){return t!=null&&yUe.call(t,e)}W$.exports=wUe});var Ld=I((fpt,V$)=>{var BUe=z$(),QUe=rF();function bUe(t,e){return t!=null&&QUe(t,e,BUe)}V$.exports=bUe});var qg=I(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});n0.default=void 0;var vUe=t=>t&&t.__isYupSchema__;n0.default=vUe});var Z$=I(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.default=void 0;var SUe=_$(Ld()),xUe=_$(qg());function _$(t){return t&&t.__esModule?t:{default:t}}var X$=class{constructor(e,r){if(this.refs=e,this.refs=e,typeof r=="function"){this.fn=r;return}if(!(0,SUe.default)(r,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:n,otherwise:s}=r,o=typeof i=="function"?i:(...a)=>a.every(l=>l===i);this.fn=function(...a){let l=a.pop(),c=a.pop(),u=o(...a)?n:s;if(!!u)return typeof u=="function"?u(c):c.concat(u.resolve(l))}}resolve(e,r){let i=this.refs.map(s=>s.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),n=this.fn.apply(e,i.concat(e,r));if(n===void 0||n===e)return e;if(!(0,xUe.default)(n))throw new TypeError("conditions must return a schema object");return n.resolve(r)}},kUe=X$;s0.default=kUe});var IF=I(mF=>{"use strict";Object.defineProperty(mF,"__esModule",{value:!0});mF.default=PUe;function PUe(t){return t==null?[]:[].concat(t)}});var xc=I(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});o0.default=void 0;var DUe=$$(Nd()),RUe=$$(IF());function $$(t){return t&&t.__esModule?t:{default:t}}function EF(){return EF=Object.assign||function(t){for(var e=1;e(0,DUe.default)(r[s])):typeof e=="function"?e(r):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,r,i,n){super();this.name="ValidationError",this.value=r,this.path=i,this.type=n,this.errors=[],this.inner=[],(0,RUe.default)(e).forEach(s=>{Td.isError(s)?(this.errors.push(...s.errors),this.inner=this.inner.concat(s.inner.length?s.inner:s)):this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,Td)}};o0.default=Td});var a0=I(yF=>{"use strict";Object.defineProperty(yF,"__esModule",{value:!0});yF.default=NUe;var wF=LUe(xc());function LUe(t){return t&&t.__esModule?t:{default:t}}var TUe=t=>{let e=!1;return(...r)=>{e||(e=!0,t(...r))}};function NUe(t,e){let{endEarly:r,tests:i,args:n,value:s,errors:o,sort:a,path:l}=t,c=TUe(e),u=i.length,g=[];if(o=o||[],!u)return o.length?c(new wF.default(o,s,l)):c(null,s);for(let f=0;f{function MUe(t){return function(e,r,i){for(var n=-1,s=Object(e),o=i(e),a=o.length;a--;){var l=o[t?a:++n];if(r(s[l],l,s)===!1)break}return e}}eee.exports=MUe});var BF=I((Ept,ree)=>{var OUe=tee(),KUe=OUe();ree.exports=KUe});var nee=I((ypt,iee)=>{function UUe(t,e){for(var r=-1,i=Array(t);++r{function HUe(){return!1}see.exports=HUe});var Od=I((Md,Jg)=>{var GUe=Ks(),jUe=oee(),aee=typeof Md=="object"&&Md&&!Md.nodeType&&Md,Aee=aee&&typeof Jg=="object"&&Jg&&!Jg.nodeType&&Jg,YUe=Aee&&Aee.exports===aee,lee=YUe?GUe.Buffer:void 0,qUe=lee?lee.isBuffer:void 0,JUe=qUe||jUe;Jg.exports=JUe});var uee=I((Bpt,cee)=>{var WUe=Ac(),zUe=ZB(),VUe=Qo(),_Ue="[object Arguments]",XUe="[object Array]",ZUe="[object Boolean]",$Ue="[object Date]",e2e="[object Error]",t2e="[object Function]",r2e="[object Map]",i2e="[object Number]",n2e="[object Object]",s2e="[object RegExp]",o2e="[object Set]",a2e="[object String]",A2e="[object WeakMap]",l2e="[object ArrayBuffer]",c2e="[object DataView]",u2e="[object Float32Array]",g2e="[object Float64Array]",f2e="[object Int8Array]",h2e="[object Int16Array]",p2e="[object Int32Array]",d2e="[object Uint8Array]",C2e="[object Uint8ClampedArray]",m2e="[object Uint16Array]",I2e="[object Uint32Array]",lr={};lr[u2e]=lr[g2e]=lr[f2e]=lr[h2e]=lr[p2e]=lr[d2e]=lr[C2e]=lr[m2e]=lr[I2e]=!0;lr[_Ue]=lr[XUe]=lr[l2e]=lr[ZUe]=lr[c2e]=lr[$Ue]=lr[e2e]=lr[t2e]=lr[r2e]=lr[i2e]=lr[n2e]=lr[s2e]=lr[o2e]=lr[a2e]=lr[A2e]=!1;function E2e(t){return VUe(t)&&zUe(t.length)&&!!lr[WUe(t)]}cee.exports=E2e});var A0=I((Qpt,gee)=>{function y2e(t){return function(e){return t(e)}}gee.exports=y2e});var l0=I((Kd,Wg)=>{var w2e=WP(),fee=typeof Kd=="object"&&Kd&&!Kd.nodeType&&Kd,Ud=fee&&typeof Wg=="object"&&Wg&&!Wg.nodeType&&Wg,B2e=Ud&&Ud.exports===fee,QF=B2e&&w2e.process,Q2e=function(){try{var t=Ud&&Ud.require&&Ud.require("util").types;return t||QF&&QF.binding&&QF.binding("util")}catch(e){}}();Wg.exports=Q2e});var c0=I((bpt,hee)=>{var b2e=uee(),v2e=A0(),pee=l0(),dee=pee&&pee.isTypedArray,S2e=dee?v2e(dee):b2e;hee.exports=S2e});var bF=I((vpt,Cee)=>{var x2e=nee(),k2e=Pd(),P2e=As(),D2e=Od(),R2e=kd(),F2e=c0(),N2e=Object.prototype,L2e=N2e.hasOwnProperty;function T2e(t,e){var r=P2e(t),i=!r&&k2e(t),n=!r&&!i&&D2e(t),s=!r&&!i&&!n&&F2e(t),o=r||i||n||s,a=o?x2e(t.length,String):[],l=a.length;for(var c in t)(e||L2e.call(t,c))&&!(o&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||R2e(c,l)))&&a.push(c);return a}Cee.exports=T2e});var u0=I((Spt,mee)=>{var M2e=Object.prototype;function O2e(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||M2e;return t===r}mee.exports=O2e});var vF=I((xpt,Iee)=>{function K2e(t,e){return function(r){return t(e(r))}}Iee.exports=K2e});var yee=I((kpt,Eee)=>{var U2e=vF(),H2e=U2e(Object.keys,Object);Eee.exports=H2e});var Bee=I((Ppt,wee)=>{var G2e=u0(),j2e=yee(),Y2e=Object.prototype,q2e=Y2e.hasOwnProperty;function J2e(t){if(!G2e(t))return j2e(t);var e=[];for(var r in Object(t))q2e.call(t,r)&&r!="constructor"&&e.push(r);return e}wee.exports=J2e});var Hd=I((Dpt,Qee)=>{var W2e=zB(),z2e=ZB();function V2e(t){return t!=null&&z2e(t.length)&&!W2e(t)}Qee.exports=V2e});var zg=I((Rpt,bee)=>{var _2e=bF(),X2e=Bee(),Z2e=Hd();function $2e(t){return Z2e(t)?_2e(t):X2e(t)}bee.exports=$2e});var SF=I((Fpt,vee)=>{var eHe=BF(),tHe=zg();function rHe(t,e){return t&&eHe(t,e,tHe)}vee.exports=rHe});var xee=I((Npt,See)=>{var iHe=vd();function nHe(){this.__data__=new iHe,this.size=0}See.exports=nHe});var Pee=I((Lpt,kee)=>{function sHe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}kee.exports=sHe});var Ree=I((Tpt,Dee)=>{function oHe(t){return this.__data__.get(t)}Dee.exports=oHe});var Nee=I((Mpt,Fee)=>{function aHe(t){return this.__data__.has(t)}Fee.exports=aHe});var Tee=I((Opt,Lee)=>{var AHe=vd(),lHe=VB(),cHe=_B(),uHe=200;function gHe(t,e){var r=this.__data__;if(r instanceof AHe){var i=r.__data__;if(!lHe||i.length{var fHe=vd(),hHe=xee(),pHe=Pee(),dHe=Ree(),CHe=Nee(),mHe=Tee();function Vg(t){var e=this.__data__=new fHe(t);this.size=e.size}Vg.prototype.clear=hHe;Vg.prototype.delete=pHe;Vg.prototype.get=dHe;Vg.prototype.has=CHe;Vg.prototype.set=mHe;Mee.exports=Vg});var Kee=I((Upt,Oee)=>{var IHe="__lodash_hash_undefined__";function EHe(t){return this.__data__.set(t,IHe),this}Oee.exports=EHe});var Hee=I((Hpt,Uee)=>{function yHe(t){return this.__data__.has(t)}Uee.exports=yHe});var jee=I((Gpt,Gee)=>{var wHe=_B(),BHe=Kee(),QHe=Hee();function g0(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new wHe;++e{function bHe(t,e){for(var r=-1,i=t==null?0:t.length;++r{function vHe(t,e){return t.has(e)}Jee.exports=vHe});var xF=I((qpt,zee)=>{var SHe=jee(),xHe=qee(),kHe=Wee(),PHe=1,DHe=2;function RHe(t,e,r,i,n,s){var o=r&PHe,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(t),u=s.get(e);if(c&&u)return c==e&&u==t;var g=-1,f=!0,h=r&DHe?new SHe:void 0;for(s.set(t,e),s.set(e,t);++g{var FHe=Ks(),NHe=FHe.Uint8Array;Vee.exports=NHe});var Xee=I((Wpt,_ee)=>{function LHe(t){var e=-1,r=Array(t.size);return t.forEach(function(i,n){r[++e]=[n,i]}),r}_ee.exports=LHe});var $ee=I((zpt,Zee)=>{function THe(t){var e=-1,r=Array(t.size);return t.forEach(function(i){r[++e]=i}),r}Zee.exports=THe});var nte=I((Vpt,ete)=>{var tte=ac(),rte=kF(),MHe=Kg(),OHe=xF(),KHe=Xee(),UHe=$ee(),HHe=1,GHe=2,jHe="[object Boolean]",YHe="[object Date]",qHe="[object Error]",JHe="[object Map]",WHe="[object Number]",zHe="[object RegExp]",VHe="[object Set]",_He="[object String]",XHe="[object Symbol]",ZHe="[object ArrayBuffer]",$He="[object DataView]",ite=tte?tte.prototype:void 0,PF=ite?ite.valueOf:void 0;function eGe(t,e,r,i,n,s,o){switch(r){case $He:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ZHe:return!(t.byteLength!=e.byteLength||!s(new rte(t),new rte(e)));case jHe:case YHe:case WHe:return MHe(+t,+e);case qHe:return t.name==e.name&&t.message==e.message;case zHe:case _He:return t==e+"";case JHe:var a=KHe;case VHe:var l=i&HHe;if(a||(a=UHe),t.size!=e.size&&!l)return!1;var c=o.get(t);if(c)return c==e;i|=GHe,o.set(t,e);var u=OHe(a(t),a(e),i,n,s,o);return o.delete(t),u;case XHe:if(PF)return PF.call(t)==PF.call(e)}return!1}ete.exports=eGe});var DF=I((_pt,ste)=>{var tGe=$B(),rGe=As();function iGe(t,e,r){var i=e(t);return rGe(t)?i:tGe(i,r(t))}ste.exports=iGe});var ate=I((Xpt,ote)=>{function nGe(t,e){for(var r=-1,i=t==null?0:t.length,n=0,s=[];++r{function sGe(){return[]}Ate.exports=sGe});var f0=I(($pt,lte)=>{var oGe=ate(),aGe=RF(),AGe=Object.prototype,lGe=AGe.propertyIsEnumerable,cte=Object.getOwnPropertySymbols,cGe=cte?function(t){return t==null?[]:(t=Object(t),oGe(cte(t),function(e){return lGe.call(t,e)}))}:aGe;lte.exports=cGe});var FF=I((edt,ute)=>{var uGe=DF(),gGe=f0(),fGe=zg();function hGe(t){return uGe(t,fGe,gGe)}ute.exports=hGe});var hte=I((tdt,gte)=>{var fte=FF(),pGe=1,dGe=Object.prototype,CGe=dGe.hasOwnProperty;function mGe(t,e,r,i,n,s){var o=r&pGe,a=fte(t),l=a.length,c=fte(e),u=c.length;if(l!=u&&!o)return!1;for(var g=l;g--;){var f=a[g];if(!(o?f in e:CGe.call(e,f)))return!1}var h=s.get(t),p=s.get(e);if(h&&p)return h==e&&p==t;var d=!0;s.set(t,e),s.set(e,t);for(var m=o;++g{var IGe=UA(),EGe=Ks(),yGe=IGe(EGe,"DataView");pte.exports=yGe});var mte=I((idt,Cte)=>{var wGe=UA(),BGe=Ks(),QGe=wGe(BGe,"Promise");Cte.exports=QGe});var Ete=I((ndt,Ite)=>{var bGe=UA(),vGe=Ks(),SGe=bGe(vGe,"Set");Ite.exports=SGe});var wte=I((sdt,yte)=>{var xGe=UA(),kGe=Ks(),PGe=xGe(kGe,"WeakMap");yte.exports=PGe});var jd=I((odt,Bte)=>{var NF=dte(),LF=VB(),TF=mte(),MF=Ete(),OF=wte(),Qte=Ac(),_g=ZR(),bte="[object Map]",DGe="[object Object]",vte="[object Promise]",Ste="[object Set]",xte="[object WeakMap]",kte="[object DataView]",RGe=_g(NF),FGe=_g(LF),NGe=_g(TF),LGe=_g(MF),TGe=_g(OF),kc=Qte;(NF&&kc(new NF(new ArrayBuffer(1)))!=kte||LF&&kc(new LF)!=bte||TF&&kc(TF.resolve())!=vte||MF&&kc(new MF)!=Ste||OF&&kc(new OF)!=xte)&&(kc=function(t){var e=Qte(t),r=e==DGe?t.constructor:void 0,i=r?_g(r):"";if(i)switch(i){case RGe:return kte;case FGe:return bte;case NGe:return vte;case LGe:return Ste;case TGe:return xte}return e});Bte.exports=kc});var Mte=I((adt,Pte)=>{var KF=Gd(),MGe=xF(),OGe=nte(),KGe=hte(),Dte=jd(),Rte=As(),Fte=Od(),UGe=c0(),HGe=1,Nte="[object Arguments]",Lte="[object Array]",h0="[object Object]",GGe=Object.prototype,Tte=GGe.hasOwnProperty;function jGe(t,e,r,i,n,s){var o=Rte(t),a=Rte(e),l=o?Lte:Dte(t),c=a?Lte:Dte(e);l=l==Nte?h0:l,c=c==Nte?h0:c;var u=l==h0,g=c==h0,f=l==c;if(f&&Fte(t)){if(!Fte(e))return!1;o=!0,u=!1}if(f&&!u)return s||(s=new KF),o||UGe(t)?MGe(t,e,r,i,n,s):OGe(t,e,l,r,i,n,s);if(!(r&HGe)){var h=u&&Tte.call(t,"__wrapped__"),p=g&&Tte.call(e,"__wrapped__");if(h||p){var d=h?t.value():t,m=p?e.value():e;return s||(s=new KF),n(d,m,r,i,s)}}return f?(s||(s=new KF),KGe(t,e,r,i,n,s)):!1}Pte.exports=jGe});var UF=I((Adt,Ote)=>{var YGe=Mte(),Kte=Qo();function Ute(t,e,r,i,n){return t===e?!0:t==null||e==null||!Kte(t)&&!Kte(e)?t!==t&&e!==e:YGe(t,e,r,i,Ute,n)}Ote.exports=Ute});var Gte=I((ldt,Hte)=>{var qGe=Gd(),JGe=UF(),WGe=1,zGe=2;function VGe(t,e,r,i){var n=r.length,s=n,o=!i;if(t==null)return!s;for(t=Object(t);n--;){var a=r[n];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++n{var _Ge=Gs();function XGe(t){return t===t&&!_Ge(t)}jte.exports=XGe});var qte=I((udt,Yte)=>{var ZGe=HF(),$Ge=zg();function eje(t){for(var e=$Ge(t),r=e.length;r--;){var i=e[r],n=t[i];e[r]=[i,n,ZGe(n)]}return e}Yte.exports=eje});var GF=I((gdt,Jte)=>{function tje(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}Jte.exports=tje});var zte=I((fdt,Wte)=>{var rje=Gte(),ije=qte(),nje=GF();function sje(t){var e=ije(t);return e.length==1&&e[0][2]?nje(e[0][0],e[0][1]):function(r){return r===t||rje(r,t,e)}}Wte.exports=sje});var p0=I((hdt,Vte)=>{var oje=xd();function aje(t,e,r){var i=t==null?void 0:oje(t,e);return i===void 0?r:i}Vte.exports=aje});var Xte=I((pdt,_te)=>{var Aje=UF(),lje=p0(),cje=iF(),uje=WB(),gje=HF(),fje=GF(),hje=Sc(),pje=1,dje=2;function Cje(t,e){return uje(t)&&gje(e)?fje(hje(t),e):function(r){var i=lje(r,t);return i===void 0&&i===e?cje(r,t):Aje(e,i,pje|dje)}}_te.exports=Cje});var $te=I((ddt,Zte)=>{function mje(t){return function(e){return e==null?void 0:e[t]}}Zte.exports=mje});var tre=I((Cdt,ere)=>{var Ije=xd();function Eje(t){return function(e){return Ije(e,t)}}ere.exports=Eje});var ire=I((mdt,rre)=>{var yje=$te(),wje=tre(),Bje=WB(),Qje=Sc();function bje(t){return Bje(t)?yje(Qje(t)):wje(t)}rre.exports=bje});var jF=I((Idt,nre)=>{var vje=zte(),Sje=Xte(),xje=e0(),kje=As(),Pje=ire();function Dje(t){return typeof t=="function"?t:t==null?xje:typeof t=="object"?kje(t)?Sje(t[0],t[1]):vje(t):Pje(t)}nre.exports=Dje});var YF=I((Edt,sre)=>{var Rje=jg(),Fje=SF(),Nje=jF();function Lje(t,e){var r={};return e=Nje(e,3),Fje(t,function(i,n,s){Rje(r,n,e(i,n,s))}),r}sre.exports=Lje});var Yd=I((ydt,ore)=>{"use strict";function Pc(t){this._maxSize=t,this.clear()}Pc.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Pc.prototype.get=function(t){return this._values[t]};Pc.prototype.set=function(t,e){return this._size>=this._maxSize&&this.clear(),t in this._values||this._size++,this._values[t]=e};var Tje=/[^.^\]^[]+|(?=\[\]|\.\.)/g,are=/^\d+$/,Mje=/^\d/,Oje=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Kje=/^\s*(['"]?)(.*?)(\1)\s*$/,qF=512,Are=new Pc(qF),lre=new Pc(qF),cre=new Pc(qF);ore.exports={Cache:Pc,split:WF,normalizePath:JF,setter:function(t){var e=JF(t);return lre.get(t)||lre.set(t,function(i,n){for(var s=0,o=e.length,a=i;s{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.create=Yje;qd.default=void 0;var qje=Yd(),d0={context:"$",value:"."};function Yje(t,e){return new C0(t,e)}var C0=class{constructor(e,r={}){if(typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===d0.context,this.isValue=this.key[0]===d0.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?d0.context:this.isValue?d0.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&(0,qje.getter)(this.path,!0),this.map=r.map}getValue(e,r,i){let n=this.isContext?i:this.isValue?e:r;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,r){return this.getValue(e,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};qd.default=C0;C0.prototype.__isYupRef=!0});var ure=I(VF=>{"use strict";Object.defineProperty(VF,"__esModule",{value:!0});VF.default=Jje;var Wje=_F(YF()),m0=_F(xc()),zje=_F(Dc());function _F(t){return t&&t.__esModule?t:{default:t}}function I0(){return I0=Object.assign||function(t){for(var e=1;e=0)&&(r[n]=t[n]);return r}function Jje(t){function e(r,i){let{value:n,path:s="",label:o,options:a,originalValue:l,sync:c}=r,u=Vje(r,["value","path","label","options","originalValue","sync"]),{name:g,test:f,params:h,message:p}=t,{parent:d,context:m}=a;function E(L){return zje.default.isRef(L)?L.getValue(n,d,m):L}function B(L={}){let K=(0,Wje.default)(I0({value:n,originalValue:l,label:o,path:L.path||s},h,L.params),E),J=new m0.default(m0.default.formatError(L.message||p,K),n,K.path,L.type||g);return J.params=K,J}let b=I0({path:s,parent:d,type:g,createError:B,resolve:E,options:a,originalValue:l},u);if(!c){try{Promise.resolve(f.call(b,n,b)).then(L=>{m0.default.isError(L)?i(L):L?i(null,L):i(B())})}catch(L){i(L)}return}let R;try{var H;if(R=f.call(b,n,b),typeof((H=R)==null?void 0:H.then)=="function")throw new Error(`Validation test of type: "${b.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(L){i(L);return}m0.default.isError(R)?i(R):R?i(null,R):i(B())}return e.OPTIONS=t,e}});var XF=I(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});Jd.getIn=gre;Jd.default=void 0;var _je=Yd(),Xje=t=>t.substr(0,t.length-1).substr(1);function gre(t,e,r,i=r){let n,s,o;return e?((0,_je.forEach)(e,(a,l,c)=>{let u=l?Xje(a):a;if(t=t.resolve({context:i,parent:n,value:r}),t.innerType){let g=c?parseInt(u,10):0;if(r&&g>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${e}. because there is no value at that index. `);n=r,r=r&&r[g],t=t.innerType}if(!c){if(!t.fields||!t.fields[u])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${t._type}")`);n=r,r=r&&r[u],t=t.fields[u]}s=u,o=l?"["+a+"]":"."+a}),{schema:t,parent:n,parentPath:s}):{parent:n,parentPath:e,schema:t}}var Zje=(t,e,r,i)=>gre(t,e,r,i).schema,$je=Zje;Jd.default=$je});var hre=I(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});E0.default=void 0;var fre=eYe(Dc());function eYe(t){return t&&t.__esModule?t:{default:t}}var y0=class{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){let e=[];for(let r of this.list)e.push(r);for(let[,r]of this.refs)e.push(r.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(e){fre.default.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){fre.default.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}has(e,r){if(this.list.has(e))return!0;let i,n=this.refs.values();for(;i=n.next(),!i.done;)if(r(i.value)===e)return!0;return!1}clone(){let e=new y0;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,r){let i=this.clone();return e.list.forEach(n=>i.add(n)),e.refs.forEach(n=>i.add(n)),r.list.forEach(n=>i.delete(n)),r.refs.forEach(n=>i.delete(n)),i}};E0.default=y0});var Ma=I(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});w0.default=void 0;var pre=Ta(M$()),Xg=La(),tYe=Ta(Z$()),dre=Ta(a0()),B0=Ta(ure()),Cre=Ta(Nd()),rYe=Ta(Dc()),iYe=XF(),nYe=Ta(IF()),mre=Ta(xc()),Ire=Ta(hre());function Ta(t){return t&&t.__esModule?t:{default:t}}function ds(){return ds=Object.assign||function(t){for(var e=1;e{this.typeError(Xg.mixed.notType)}),this.type=(e==null?void 0:e.type)||"mixed",this.spec=ds({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},e==null?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeError=this._typeError,r._whitelistError=this._whitelistError,r._blacklistError=this._blacklistError,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.exclusiveTests=ds({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=(0,pre.default)(ds({},this.spec,e)),r}label(e){var r=this.clone();return r.spec.label=e,r}meta(...e){if(e.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},e[0]),r}withMutation(e){let r=this._mutate;this._mutate=!0;let i=e(this);return this._mutate=r,i}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let r=this,i=e.clone(),n=ds({},r.spec,i.spec);return i.spec=n,i._typeError||(i._typeError=r._typeError),i._whitelistError||(i._whitelistError=r._whitelistError),i._blacklistError||(i._blacklistError=r._blacklistError),i._whitelist=r._whitelist.merge(e._whitelist,e._blacklist),i._blacklist=r._blacklist.merge(e._blacklist,e._whitelist),i.tests=r.tests,i.exclusiveTests=r.exclusiveTests,i.withMutation(s=>{e.tests.forEach(o=>{s.test(o.OPTIONS)})}),i}isType(e){return this.spec.nullable&&e===null?!0:this._typeCheck(e)}resolve(e){let r=this;if(r.conditions.length){let i=r.conditions;r=r.clone(),r.conditions=[],r=i.reduce((n,s)=>s.resolve(n,e),r),r=r.resolve(e)}return r}cast(e,r={}){let i=this.resolve(ds({value:e},r)),n=i._cast(e,r);if(e!==void 0&&r.assert!==!1&&i.isType(n)!==!0){let s=(0,Cre.default)(e),o=(0,Cre.default)(n);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${i._type}". -attempted value: ${s} +attempted value: ${s} `+(o!==s?`result of cast: ${o}`:""))}return n}_cast(e,r){let i=e===void 0?e:this.transforms.reduce((n,s)=>s.call(this,n,e,this),e);return i===void 0&&(i=this.getDefault()),i}_validate(e,r={},i){let{sync:n,path:s,from:o=[],originalValue:a=e,strict:l=this.spec.strict,abortEarly:c=this.spec.abortEarly}=r,u=e;l||(u=this._cast(u,ds({assert:!1},r)));let g={value:u,path:s,options:r,originalValue:a,schema:this,label:this.spec.label,sync:n,from:o},f=[];this._typeError&&f.push(this._typeError),this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),(0,dre.default)({args:g,value:u,path:s,sync:n,tests:f,endEarly:c},h=>{if(h)return void i(h,u);(0,dre.default)({tests:this.tests,args:g,path:s,sync:n,value:u,endEarly:c},i)})}validate(e,r,i){let n=this.resolve(ds({},r,{value:e}));return typeof i=="function"?n._validate(e,r,i):new Promise((s,o)=>n._validate(e,r,(a,l)=>{a?o(a):s(l)}))}validateSync(e,r){let i=this.resolve(ds({},r,{value:e})),n;return i._validate(e,ds({},r,{sync:!0}),(s,o)=>{if(s)throw s;n=o}),n}isValid(e,r){return this.validate(e,r).then(()=>!0,i=>{if(mre.default.isError(i))return!1;throw i})}isValidSync(e,r){try{return this.validateSync(e,r),!0}catch(i){if(mre.default.isError(i))return!1;throw i}}_getDefault(){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this):(0,pre.default)(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){var r=this.clone();return r.spec.strict=e,r}_isPresent(e){return e!=null}defined(e=Xg.mixed.defined){return this.test({message:e,name:"defined",exclusive:!0,test(r){return r!==void 0}})}required(e=Xg.mixed.required){return this.clone({presence:"required"}).withMutation(r=>r.test({message:e,name:"required",exclusive:!0,test(i){return this.schema._isPresent(i)}}))}notRequired(){var e=this.clone({presence:"optional"});return e.tests=e.tests.filter(r=>r.OPTIONS.name!=="required"),e}nullable(e=!0){var r=this.clone({nullable:e!==!1});return r}transform(e){var r=this.clone();return r.transforms.push(e),r}test(...e){let r;if(e.length===1?typeof e[0]=="function"?r={test:e[0]}:r=e[0]:e.length===2?r={name:e[0],test:e[1]}:r={name:e[0],message:e[1],test:e[2]},r.message===void 0&&(r.message=Xg.mixed.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),n=(0,B0.default)(r),s=r.exclusive||r.name&&i.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(i.exclusiveTests[r.name]=!!r.exclusive),i.tests=i.tests.filter(o=>!(o.OPTIONS.name===r.name&&(s||o.OPTIONS.test===n.OPTIONS.test))),i.tests.push(n),i}when(e,r){!Array.isArray(e)&&typeof e!="string"&&(r=e,e=".");let i=this.clone(),n=(0,nYe.default)(e).map(s=>new rYe.default(s));return n.forEach(s=>{s.isSibling&&i.deps.push(s.key)}),i.conditions.push(new tYe.default(n,r)),i}typeError(e){var r=this.clone();return r._typeError=(0,B0.default)({message:e,name:"typeError",test(i){return i!==void 0&&!this.schema.isType(i)?this.createError({params:{type:this.schema._type}}):!0}}),r}oneOf(e,r=Xg.mixed.oneOf){var i=this.clone();return e.forEach(n=>{i._whitelist.add(n),i._blacklist.delete(n)}),i._whitelistError=(0,B0.default)({message:r,name:"oneOf",test(n){if(n===void 0)return!0;let s=this.schema._whitelist;return s.has(n,this.resolve)?!0:this.createError({params:{values:s.toArray().join(", ")}})}}),i}notOneOf(e,r=Xg.mixed.notOneOf){var i=this.clone();return e.forEach(n=>{i._blacklist.add(n),i._whitelist.delete(n)}),i._blacklistError=(0,B0.default)({message:r,name:"notOneOf",test(n){let s=this.schema._blacklist;return s.has(n,this.resolve)?this.createError({params:{values:s.toArray().join(", ")}}):!0}}),i}strip(e=!0){let r=this.clone();return r.spec.strip=e,r}describe(){let e=this.clone(),{label:r,meta:i}=e.spec;return{meta:i,label:r,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(s=>({name:s.OPTIONS.name,params:s.OPTIONS.params})).filter((s,o,a)=>a.findIndex(l=>l.name===s.name)===o)}}};w0.default=Do;Do.prototype.__isYupSchema__=!0;for(let t of["validate","validateSync"])Do.prototype[`${t}At`]=function(e,r,i={}){let{parent:n,parentPath:s,schema:o}=(0,iYe.getIn)(this,e,r,i.context);return o[t](n&&n[s],ds({},i,{parent:n,path:e}))};for(let t of["equals","is"])Do.prototype[t]=Do.prototype.oneOf;for(let t of["not","nope"])Do.prototype[t]=Do.prototype.notOneOf;Do.prototype.optional=Do.prototype.notRequired});var yre=I(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.create=Ere;Wd.default=void 0;var oYe=sYe(Ma());function sYe(t){return t&&t.__esModule?t:{default:t}}var ZF=oYe.default,aYe=ZF;Wd.default=aYe;function Ere(){return new ZF}Ere.prototype=ZF.prototype});var Zg=I(Q0=>{"use strict";Object.defineProperty(Q0,"__esModule",{value:!0});Q0.default=void 0;var AYe=t=>t==null;Q0.default=AYe});var vre=I(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.create=wre;zd.default=void 0;var lYe=Bre(Ma()),Qre=La(),bre=Bre(Zg());function Bre(t){return t&&t.__esModule?t:{default:t}}function wre(){return new b0}var b0=class extends lYe.default{constructor(){super({type:"boolean"});this.withMutation(()=>{this.transform(function(e){if(!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}_typeCheck(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}isTrue(e=Qre.boolean.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return(0,bre.default)(r)||r===!0}})}isFalse(e=Qre.boolean.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return(0,bre.default)(r)||r===!1}})}};zd.default=b0;wre.prototype=b0.prototype});var kre=I(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.create=Sre;Vd.default=void 0;var Ro=La(),Oa=xre(Zg()),cYe=xre(Ma());function xre(t){return t&&t.__esModule?t:{default:t}}var uYe=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,gYe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,fYe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,hYe=t=>(0,Oa.default)(t)||t===t.trim(),pYe={}.toString();function Sre(){return new v0}var v0=class extends cYe.default{constructor(){super({type:"string"});this.withMutation(()=>{this.transform(function(e){if(this.isType(e)||Array.isArray(e))return e;let r=e!=null&&e.toString?e.toString():e;return r===pYe?e:r})})}_typeCheck(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}_isPresent(e){return super._isPresent(e)&&!!e.length}length(e,r=Ro.string.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},test(i){return(0,Oa.default)(i)||i.length===this.resolve(e)}})}min(e,r=Ro.string.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},test(i){return(0,Oa.default)(i)||i.length>=this.resolve(e)}})}max(e,r=Ro.string.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:e},test(i){return(0,Oa.default)(i)||i.length<=this.resolve(e)}})}matches(e,r){let i=!1,n,s;return r&&(typeof r=="object"?{excludeEmptyString:i=!1,message:n,name:s}=r:n=r),this.test({name:s||"matches",message:n||Ro.string.matches,params:{regex:e},test:o=>(0,Oa.default)(o)||o===""&&i||o.search(e)!==-1})}email(e=Ro.string.email){return this.matches(uYe,{name:"email",message:e,excludeEmptyString:!0})}url(e=Ro.string.url){return this.matches(gYe,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Ro.string.uuid){return this.matches(fYe,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=Ro.string.trim){return this.transform(r=>r!=null?r.trim():r).test({message:e,name:"trim",test:hYe})}lowercase(e=Ro.string.lowercase){return this.transform(r=>(0,Oa.default)(r)?r:r.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,test:r=>(0,Oa.default)(r)||r===r.toLowerCase()})}uppercase(e=Ro.string.uppercase){return this.transform(r=>(0,Oa.default)(r)?r:r.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,test:r=>(0,Oa.default)(r)||r===r.toUpperCase()})}};Vd.default=v0;Sre.prototype=v0.prototype});var Rre=I(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.create=Pre;_d.default=void 0;var Rc=La(),Fc=Dre(Zg()),dYe=Dre(Ma());function Dre(t){return t&&t.__esModule?t:{default:t}}var CYe=t=>t!=+t;function Pre(){return new S0}var S0=class extends dYe.default{constructor(){super({type:"number"});this.withMutation(()=>{this.transform(function(e){let r=e;if(typeof r=="string"){if(r=r.replace(/\s/g,""),r==="")return NaN;r=+r}return this.isType(r)?r:parseFloat(r)})})}_typeCheck(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!CYe(e)}min(e,r=Rc.number.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},test(i){return(0,Fc.default)(i)||i>=this.resolve(e)}})}max(e,r=Rc.number.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:e},test(i){return(0,Fc.default)(i)||i<=this.resolve(e)}})}lessThan(e,r=Rc.number.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:e},test(i){return(0,Fc.default)(i)||ithis.resolve(e)}})}positive(e=Rc.number.positive){return this.moreThan(0,e)}negative(e=Rc.number.negative){return this.lessThan(0,e)}integer(e=Rc.number.integer){return this.test({name:"integer",message:e,test:r=>(0,Fc.default)(r)||Number.isInteger(r)})}truncate(){return this.transform(e=>(0,Fc.default)(e)?e:e|0)}round(e){var r,i=["ceil","floor","round","trunc"];if(e=((r=e)==null?void 0:r.toLowerCase())||"round",e==="trunc")return this.truncate();if(i.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+i.join(", "));return this.transform(n=>(0,Fc.default)(n)?n:Math[e](n))}};_d.default=S0;Pre.prototype=S0.prototype});var Fre=I($F=>{"use strict";Object.defineProperty($F,"__esModule",{value:!0});$F.default=mYe;var IYe=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function mYe(t){var e=[1,4,5,6,7,10,11],r=0,i,n;if(n=IYe.exec(t)){for(var s=0,o;o=e[s];++s)n[o]=+n[o]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,(n[8]===void 0||n[8]==="")&&(n[9]===void 0||n[9]==="")?i=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7]):(n[8]!=="Z"&&n[9]!==void 0&&(r=n[10]*60+n[11],n[9]==="+"&&(r=0-r)),i=Date.UTC(n[1],n[2],n[3],n[4],n[5]+r,n[6],n[7]))}else i=Date.parse?Date.parse(t):NaN;return i}});var Tre=I(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.create=eN;Xd.default=void 0;var EYe=x0(Fre()),Nre=La(),Lre=x0(Zg()),yYe=x0(Dc()),wYe=x0(Ma());function x0(t){return t&&t.__esModule?t:{default:t}}var tN=new Date(""),BYe=t=>Object.prototype.toString.call(t)==="[object Date]";function eN(){return new Zd}var Zd=class extends wYe.default{constructor(){super({type:"date"});this.withMutation(()=>{this.transform(function(e){return this.isType(e)?e:(e=(0,EYe.default)(e),isNaN(e)?tN:new Date(e))})})}_typeCheck(e){return BYe(e)&&!isNaN(e.getTime())}prepareParam(e,r){let i;if(yYe.default.isRef(e))i=e;else{let n=this.cast(e);if(!this._typeCheck(n))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);i=n}return i}min(e,r=Nre.date.min){let i=this.prepareParam(e,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:e},test(n){return(0,Lre.default)(n)||n>=this.resolve(i)}})}max(e,r=Nre.date.max){var i=this.prepareParam(e,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:e},test(n){return(0,Lre.default)(n)||n<=this.resolve(i)}})}};Xd.default=Zd;Zd.INVALID_DATE=tN;eN.prototype=Zd.prototype;eN.INVALID_DATE=tN});var Ore=I((Ndt,Mre)=>{function QYe(t,e,r,i){var n=-1,s=t==null?0:t.length;for(i&&s&&(r=t[++n]);++n{function bYe(t){return function(e){return t==null?void 0:t[e]}}Kre.exports=bYe});var Gre=I((Tdt,Hre)=>{var vYe=Ure(),SYe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},xYe=vYe(SYe);Hre.exports=xYe});var Yre=I((Mdt,jre)=>{var kYe=Gre(),PYe=gg(),DYe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,RYe="\\u0300-\\u036f",FYe="\\ufe20-\\ufe2f",NYe="\\u20d0-\\u20ff",LYe=RYe+FYe+NYe,TYe="["+LYe+"]",MYe=RegExp(TYe,"g");function OYe(t){return t=PYe(t),t&&t.replace(DYe,kYe).replace(MYe,"")}jre.exports=OYe});var Jre=I((Odt,qre)=>{var KYe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function UYe(t){return t.match(KYe)||[]}qre.exports=UYe});var zre=I((Kdt,Wre)=>{var HYe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function GYe(t){return HYe.test(t)}Wre.exports=GYe});var fie=I((Udt,Vre)=>{var _re="\\ud800-\\udfff",jYe="\\u0300-\\u036f",YYe="\\ufe20-\\ufe2f",qYe="\\u20d0-\\u20ff",JYe=jYe+YYe+qYe,Xre="\\u2700-\\u27bf",Zre="a-z\\xdf-\\xf6\\xf8-\\xff",WYe="\\xac\\xb1\\xd7\\xf7",zYe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",VYe="\\u2000-\\u206f",_Ye=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$re="A-Z\\xc0-\\xd6\\xd8-\\xde",XYe="\\ufe0e\\ufe0f",eie=WYe+zYe+VYe+_Ye,tie="['\u2019]",rie="["+eie+"]",ZYe="["+JYe+"]",iie="\\d+",$Ye="["+Xre+"]",nie="["+Zre+"]",sie="[^"+_re+eie+iie+Xre+Zre+$re+"]",eqe="\\ud83c[\\udffb-\\udfff]",tqe="(?:"+ZYe+"|"+eqe+")",rqe="[^"+_re+"]",oie="(?:\\ud83c[\\udde6-\\uddff]){2}",aie="[\\ud800-\\udbff][\\udc00-\\udfff]",$g="["+$re+"]",iqe="\\u200d",Aie="(?:"+nie+"|"+sie+")",nqe="(?:"+$g+"|"+sie+")",lie="(?:"+tie+"(?:d|ll|m|re|s|t|ve))?",cie="(?:"+tie+"(?:D|LL|M|RE|S|T|VE))?",uie=tqe+"?",gie="["+XYe+"]?",sqe="(?:"+iqe+"(?:"+[rqe,oie,aie].join("|")+")"+gie+uie+")*",oqe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",aqe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Aqe=gie+uie+sqe,lqe="(?:"+[$Ye,oie,aie].join("|")+")"+Aqe,cqe=RegExp([$g+"?"+nie+"+"+lie+"(?="+[rie,$g,"$"].join("|")+")",nqe+"+"+cie+"(?="+[rie,$g+Aie,"$"].join("|")+")",$g+"?"+Aie+"+"+lie,$g+"+"+cie,aqe,oqe,iie,lqe].join("|"),"g");function uqe(t){return t.match(cqe)||[]}Vre.exports=uqe});var pie=I((Hdt,hie)=>{var gqe=Jre(),fqe=zre(),hqe=gg(),pqe=fie();function dqe(t,e,r){return t=hqe(t),e=r?void 0:e,e===void 0?fqe(t)?pqe(t):gqe(t):t.match(e)||[]}hie.exports=dqe});var rN=I((Gdt,die)=>{var Cqe=Ore(),mqe=Yre(),Iqe=pie(),Eqe="['\u2019]",yqe=RegExp(Eqe,"g");function wqe(t){return function(e){return Cqe(Iqe(mqe(e).replace(yqe,"")),t,"")}}die.exports=wqe});var mie=I((jdt,Cie)=>{var Bqe=rN(),Qqe=Bqe(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()});Cie.exports=Qqe});var Eie=I((Ydt,Iie)=>{var bqe=ZP(),vqe=rN(),Sqe=vqe(function(t,e,r){return e=e.toLowerCase(),t+(r?bqe(e):e)});Iie.exports=Sqe});var wie=I((qdt,yie)=>{var xqe=jg(),kqe=SF(),Pqe=jF();function Dqe(t,e){var r={};return e=Pqe(e,3),kqe(t,function(i,n,s){xqe(r,e(i,n,s),i)}),r}yie.exports=Dqe});var Qie=I((Jdt,iN)=>{iN.exports=function(t){return Bie(Rqe(t),t)};iN.exports.array=Bie;function Bie(t,e){var r=t.length,i=new Array(r),n={},s=r,o=Fqe(e),a=Nqe(t);for(e.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)n[s]||l(t[s],s,new Set);return i;function l(c,u,g){if(g.has(c)){var f;try{f=", node was:"+JSON.stringify(c)}catch(d){f=""}throw new Error("Cyclic dependency"+f)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!n[u]){n[u]=!0;var h=o.get(c)||new Set;if(h=Array.from(h),u=h.length){g.add(c);do{var p=h[--u];l(p,a.get(p),g)}while(u);g.delete(c)}i[--r]=c}}}function Rqe(t){for(var e=new Set,r=0,i=t.length;r{"use strict";Object.defineProperty(nN,"__esModule",{value:!0});nN.default=Lqe;var Tqe=k0(Ld()),Mqe=k0(Qie()),Oqe=Yd(),Kqe=k0(Dc()),Uqe=k0(qg());function k0(t){return t&&t.__esModule?t:{default:t}}function Lqe(t,e=[]){let r=[],i=[];function n(s,o){var a=(0,Oqe.split)(s)[0];~i.indexOf(a)||i.push(a),~e.indexOf(`${o}-${a}`)||r.push([o,a])}for(let s in t)if((0,Tqe.default)(t,s)){let o=t[s];~i.indexOf(s)||i.push(s),Kqe.default.isRef(o)&&o.isSibling?n(o.path,s):(0,Uqe.default)(o)&&"deps"in o&&o.deps.forEach(a=>n(a,s))}return Mqe.default.array(i,r).reverse()}});var Sie=I(sN=>{"use strict";Object.defineProperty(sN,"__esModule",{value:!0});sN.default=Hqe;function vie(t,e){let r=Infinity;return t.some((i,n)=>{var s;if(((s=e.path)==null?void 0:s.indexOf(i))!==-1)return r=n,!0}),r}function Hqe(t){return(e,r)=>vie(t,e)-vie(t,r)}});var Nie=I($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.create=xie;$d.default=void 0;var kie=Fo(Ld()),Pie=Fo(mie()),Gqe=Fo(Eie()),jqe=Fo(wie()),Yqe=Fo(YF()),qqe=Yd(),Die=La(),Jqe=Fo(bie()),Rie=Fo(Sie()),Wqe=Fo(a0()),zqe=Fo(xc()),oN=Fo(Ma());function Fo(t){return t&&t.__esModule?t:{default:t}}function ef(){return ef=Object.assign||function(t){for(var e=1;eObject.prototype.toString.call(t)==="[object Object]";function Vqe(t,e){let r=Object.keys(t.fields);return Object.keys(e).filter(i=>r.indexOf(i)===-1)}var _qe=(0,Rie.default)([]),P0=class extends oN.default{constructor(e){super({type:"object"});this.fields=Object.create(null),this._sortErrors=_qe,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(i){if(typeof i=="string")try{i=JSON.parse(i)}catch(n){i=null}return this.isType(i)?i:null}),e&&this.shape(e)})}_typeCheck(e){return Fie(e)||typeof e=="function"}_cast(e,r={}){var i;let n=super._cast(e,r);if(n===void 0)return this.getDefault();if(!this._typeCheck(n))return n;let s=this.fields,o=(i=r.stripUnknown)!=null?i:this.spec.noUnknown,a=this._nodes.concat(Object.keys(n).filter(g=>this._nodes.indexOf(g)===-1)),l={},c=ef({},r,{parent:l,__validating:r.__validating||!1}),u=!1;for(let g of a){let f=s[g],h=(0,kie.default)(n,g);if(f){let p,d=n[g];c.path=(r.path?`${r.path}.`:"")+g,f=f.resolve({value:d,context:r.context,parent:l});let m="spec"in f?f.spec:void 0,E=m==null?void 0:m.strict;if(m==null?void 0:m.strip){u=u||g in n;continue}p=!r.__validating||!E?f.cast(n[g],c):n[g],p!==void 0&&(l[g]=p)}else h&&!o&&(l[g]=n[g]);l[g]!==n[g]&&(u=!0)}return u?l:n}_validate(e,r={},i){let n=[],{sync:s,from:o=[],originalValue:a=e,abortEarly:l=this.spec.abortEarly,recursive:c=this.spec.recursive}=r;o=[{schema:this,value:a},...o],r.__validating=!0,r.originalValue=a,r.from=o,super._validate(e,r,(u,g)=>{if(u){if(!zqe.default.isError(u)||l)return void i(u,g);n.push(u)}if(!c||!Fie(g)){i(n[0]||null,g);return}a=a||g;let f=this._nodes.map(h=>(p,d)=>{let m=h.indexOf(".")===-1?(r.path?`${r.path}.`:"")+h:`${r.path||""}["${h}"]`,E=this.fields[h];if(E&&"validate"in E){E.validate(g[h],ef({},r,{path:m,from:o,strict:!0,parent:g,originalValue:a[h]}),d);return}d(null)});(0,Wqe.default)({sync:s,tests:f,value:g,errors:n,endEarly:l,sort:this._sortErrors,path:r.path},i)})}clone(e){let r=super.clone(e);return r.fields=ef({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(e){let r=super.concat(e),i=r.fields;for(let[n,s]of Object.entries(this.fields)){let o=i[n];o===void 0?i[n]=s:o instanceof oN.default&&s instanceof oN.default&&(i[n]=s.concat(o))}return r.withMutation(()=>r.shape(i))}getDefaultFromShape(){let e={};return this._nodes.forEach(r=>{let i=this.fields[r];e[r]="default"in i?i.getDefault():void 0}),e}_getDefault(){if("default"in this.spec)return super._getDefault();if(!!this._nodes.length)return this.getDefaultFromShape()}shape(e,r=[]){let i=this.clone(),n=Object.assign(i.fields,e);if(i.fields=n,i._sortErrors=(0,Rie.default)(Object.keys(n)),r.length){Array.isArray(r[0])||(r=[r]);let s=r.map(([o,a])=>`${o}-${a}`);i._excludedEdges=i._excludedEdges.concat(s)}return i._nodes=(0,Jqe.default)(n,i._excludedEdges),i}pick(e){let r={};for(let i of e)this.fields[i]&&(r[i]=this.fields[i]);return this.clone().withMutation(i=>(i.fields={},i.shape(r)))}omit(e){let r=this.clone(),i=r.fields;r.fields={};for(let n of e)delete i[n];return r.withMutation(()=>r.shape(i))}from(e,r,i){let n=(0,qqe.getter)(e,!0);return this.transform(s=>{if(s==null)return s;let o=s;return(0,kie.default)(s,e)&&(o=ef({},s),i||delete o[e],o[r]=n(s)),o})}noUnknown(e=!0,r=Die.object.noUnknown){typeof e=="string"&&(r=e,e=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:r,test(n){if(n==null)return!0;let s=Vqe(this.schema,n);return!e||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return i.spec.noUnknown=e,i}unknown(e=!0,r=Die.object.noUnknown){return this.noUnknown(!e,r)}transformKeys(e){return this.transform(r=>r&&(0,jqe.default)(r,(i,n)=>e(n)))}camelCase(){return this.transformKeys(Gqe.default)}snakeCase(){return this.transformKeys(Pie.default)}constantCase(){return this.transformKeys(e=>(0,Pie.default)(e).toUpperCase())}describe(){let e=super.describe();return e.fields=(0,Yqe.default)(this.fields,r=>r.describe()),e}};$d.default=P0;function xie(t){return new P0(t)}xie.prototype=P0.prototype});var Tie=I(eC=>{"use strict";Object.defineProperty(eC,"__esModule",{value:!0});eC.create=Lie;eC.default=void 0;var aN=tf(Zg()),Xqe=tf(qg()),Zqe=tf(Nd()),AN=La(),$qe=tf(a0()),eJe=tf(xc()),tJe=tf(Ma());function tf(t){return t&&t.__esModule?t:{default:t}}function D0(){return D0=Object.assign||function(t){for(var e=1;e{this.transform(function(r){if(typeof r=="string")try{r=JSON.parse(r)}catch(i){r=null}return this.isType(r)?r:null})})}_typeCheck(e){return Array.isArray(e)}get _subType(){return this.innerType}_cast(e,r){let i=super._cast(e,r);if(!this._typeCheck(i)||!this.innerType)return i;let n=!1,s=i.map((o,a)=>{let l=this.innerType.cast(o,D0({},r,{path:`${r.path||""}[${a}]`}));return l!==o&&(n=!0),l});return n?s:i}_validate(e,r={},i){var n,s;let o=[],a=r.sync,l=r.path,c=this.innerType,u=(n=r.abortEarly)!=null?n:this.spec.abortEarly,g=(s=r.recursive)!=null?s:this.spec.recursive,f=r.originalValue!=null?r.originalValue:e;super._validate(e,r,(h,p)=>{if(h){if(!eJe.default.isError(h)||u)return void i(h,p);o.push(h)}if(!g||!c||!this._typeCheck(p)){i(o[0]||null,p);return}f=f||p;let d=new Array(p.length);for(let m=0;mc.validate(E,b,H)}(0,$qe.default)({sync:a,path:l,value:p,errors:o,endEarly:u,tests:d},i)})}clone(e){let r=super.clone(e);return r.innerType=this.innerType,r}concat(e){let r=super.concat(e);return r.innerType=this.innerType,e.innerType&&(r.innerType=r.innerType?r.innerType.concat(e.innerType):e.innerType),r}of(e){let r=this.clone();if(!(0,Xqe.default)(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+(0,Zqe.default)(e));return r.innerType=e,r}length(e,r=AN.array.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},test(i){return(0,aN.default)(i)||i.length===this.resolve(e)}})}min(e,r){return r=r||AN.array.min,this.test({message:r,name:"min",exclusive:!0,params:{min:e},test(i){return(0,aN.default)(i)||i.length>=this.resolve(e)}})}max(e,r){return r=r||AN.array.max,this.test({message:r,name:"max",exclusive:!0,params:{max:e},test(i){return(0,aN.default)(i)||i.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,r)=>this._typeCheck(e)?e:r==null?[]:[].concat(r))}compact(e){let r=e?(i,n,s)=>!e(i,n,s):i=>!!i;return this.transform(i=>i!=null?i.filter(r):i)}describe(){let e=super.describe();return this.innerType&&(e.innerType=this.innerType.describe()),e}nullable(e=!0){return super.nullable(e)}defined(){return super.defined()}required(e){return super.required(e)}};eC.default=R0;Lie.prototype=R0.prototype});var Mie=I(tC=>{"use strict";Object.defineProperty(tC,"__esModule",{value:!0});tC.create=rJe;tC.default=void 0;var nJe=iJe(qg());function iJe(t){return t&&t.__esModule?t:{default:t}}function rJe(t){return new lN(t)}var lN=class{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this._resolve=(r,i={})=>{let n=this.builder(r,i);if(!(0,nJe.default)(n))throw new TypeError("lazy() functions must return a valid schema");return n.resolve(i)},this.builder=e}resolve(e){return this._resolve(e.value,e)}cast(e,r){return this._resolve(e,r).cast(e,r)}validate(e,r,i){return this._resolve(e,r).validate(e,r,i)}validateSync(e,r){return this._resolve(e,r).validateSync(e,r)}validateAt(e,r,i){return this._resolve(r,i).validateAt(e,r,i)}validateSyncAt(e,r,i){return this._resolve(r,i).validateSyncAt(e,r,i)}describe(){return null}isValid(e,r){return this._resolve(e,r).isValid(e,r)}isValidSync(e,r){return this._resolve(e,r).isValidSync(e,r)}},sJe=lN;tC.default=sJe});var Oie=I(cN=>{"use strict";Object.defineProperty(cN,"__esModule",{value:!0});cN.default=oJe;var AJe=aJe(La());function aJe(t){return t&&t.__esModule?t:{default:t}}function oJe(t){Object.keys(t).forEach(e=>{Object.keys(t[e]).forEach(r=>{AJe.default[e][r]=t[e][r]})})}});var gN=I(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.addMethod=lJe;Object.defineProperty(cr,"MixedSchema",{enumerable:!0,get:function(){return Kie.default}});Object.defineProperty(cr,"mixed",{enumerable:!0,get:function(){return Kie.create}});Object.defineProperty(cr,"BooleanSchema",{enumerable:!0,get:function(){return uN.default}});Object.defineProperty(cr,"bool",{enumerable:!0,get:function(){return uN.create}});Object.defineProperty(cr,"boolean",{enumerable:!0,get:function(){return uN.create}});Object.defineProperty(cr,"StringSchema",{enumerable:!0,get:function(){return Uie.default}});Object.defineProperty(cr,"string",{enumerable:!0,get:function(){return Uie.create}});Object.defineProperty(cr,"NumberSchema",{enumerable:!0,get:function(){return Hie.default}});Object.defineProperty(cr,"number",{enumerable:!0,get:function(){return Hie.create}});Object.defineProperty(cr,"DateSchema",{enumerable:!0,get:function(){return Gie.default}});Object.defineProperty(cr,"date",{enumerable:!0,get:function(){return Gie.create}});Object.defineProperty(cr,"ObjectSchema",{enumerable:!0,get:function(){return jie.default}});Object.defineProperty(cr,"object",{enumerable:!0,get:function(){return jie.create}});Object.defineProperty(cr,"ArraySchema",{enumerable:!0,get:function(){return Yie.default}});Object.defineProperty(cr,"array",{enumerable:!0,get:function(){return Yie.create}});Object.defineProperty(cr,"ref",{enumerable:!0,get:function(){return cJe.create}});Object.defineProperty(cr,"lazy",{enumerable:!0,get:function(){return uJe.create}});Object.defineProperty(cr,"ValidationError",{enumerable:!0,get:function(){return gJe.default}});Object.defineProperty(cr,"reach",{enumerable:!0,get:function(){return fJe.default}});Object.defineProperty(cr,"isSchema",{enumerable:!0,get:function(){return qie.default}});Object.defineProperty(cr,"setLocale",{enumerable:!0,get:function(){return hJe.default}});Object.defineProperty(cr,"BaseSchema",{enumerable:!0,get:function(){return pJe.default}});var Kie=Nc(yre()),uN=Nc(vre()),Uie=Nc(kre()),Hie=Nc(Rre()),Gie=Nc(Tre()),jie=Nc(Nie()),Yie=Nc(Tie()),cJe=Dc(),uJe=Mie(),gJe=rC(xc()),fJe=rC(XF()),qie=rC(qg()),hJe=rC(Oie()),pJe=rC(Ma());function rC(t){return t&&t.__esModule?t:{default:t}}function Jie(){if(typeof WeakMap!="function")return null;var t=new WeakMap;return Jie=function(){return t},t}function Nc(t){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var e=Jie();if(e&&e.has(t))return e.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var s=i?Object.getOwnPropertyDescriptor(t,n):null;s&&(s.get||s.set)?Object.defineProperty(r,n,s):r[n]=t[n]}return r.default=t,e&&e.set(t,r),r}function lJe(t,e,r){if(!t||!(0,qie.default)(t.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof e!="string")throw new TypeError("A Method name must be provided");if(typeof r!="function")throw new TypeError("Method function must be provided");t.prototype[e]=r}});var Xie=I((gCt,nC)=>{"use strict";var mJe=process.env.TERM_PROGRAM==="Hyper",IJe=process.platform==="win32",zie=process.platform==="linux",fN={ballotDisabled:"\u2612",ballotOff:"\u2610",ballotOn:"\u2611",bullet:"\u2022",bulletWhite:"\u25E6",fullBlock:"\u2588",heart:"\u2764",identicalTo:"\u2261",line:"\u2500",mark:"\u203B",middot:"\xB7",minus:"\uFF0D",multiplication:"\xD7",obelus:"\xF7",pencilDownRight:"\u270E",pencilRight:"\u270F",pencilUpRight:"\u2710",percent:"%",pilcrow2:"\u2761",pilcrow:"\xB6",plusMinus:"\xB1",section:"\xA7",starsOff:"\u2606",starsOn:"\u2605",upDownArrow:"\u2195"},Vie=Object.assign({},fN,{check:"\u221A",cross:"\xD7",ellipsisLarge:"...",ellipsis:"...",info:"i",question:"?",questionSmall:"?",pointer:">",pointerSmall:"\xBB",radioOff:"( )",radioOn:"(*)",warning:"\u203C"}),_ie=Object.assign({},fN,{ballotCross:"\u2718",check:"\u2714",cross:"\u2716",ellipsisLarge:"\u22EF",ellipsis:"\u2026",info:"\u2139",question:"?",questionFull:"\uFF1F",questionSmall:"\uFE56",pointer:zie?"\u25B8":"\u276F",pointerSmall:zie?"\u2023":"\u203A",radioOff:"\u25EF",radioOn:"\u25C9",warning:"\u26A0"});nC.exports=IJe&&!mJe?Vie:_ie;Reflect.defineProperty(nC.exports,"common",{enumerable:!1,value:fN});Reflect.defineProperty(nC.exports,"windows",{enumerable:!1,value:Vie});Reflect.defineProperty(nC.exports,"other",{enumerable:!1,value:_ie})});var js=I((fCt,hN)=>{"use strict";var EJe=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),yJe=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,Zie=()=>{let t={enabled:!0,visible:!0,styles:{},keys:{}};"FORCE_COLOR"in process.env&&(t.enabled=process.env.FORCE_COLOR!=="0");let e=s=>{let o=s.open=`[${s.codes[0]}m`,a=s.close=`[${s.codes[1]}m`,l=s.regex=new RegExp(`\\u001b\\[${s.codes[1]}m`,"g");return s.wrap=(c,u)=>{c.includes(a)&&(c=c.replace(l,a+o));let g=o+c+a;return u?g.replace(/\r*\n/g,`${a}$&${o}`):g},s},r=(s,o,a)=>typeof s=="function"?s(o):s.wrap(o,a),i=(s,o)=>{if(s===""||s==null)return"";if(t.enabled===!1)return s;if(t.visible===!1)return"";let a=""+s,l=a.includes(` `),c=o.length;for(c>0&&o.includes("unstyle")&&(o=[...new Set(["unstyle",...o])].reverse());c-- >0;)a=r(t.styles[o[c]],a,l);return a},n=(s,o,a)=>{t.styles[s]=e({name:s,codes:o}),(t.keys[a]||(t.keys[a]=[])).push(s),Reflect.defineProperty(t,s,{configurable:!0,enumerable:!0,set(c){t.alias(s,c)},get(){let c=u=>i(u,c.stack);return Reflect.setPrototypeOf(c,t),c.stack=this.stack?this.stack.concat(s):[s],c}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=yJe,t.hasColor=t.hasAnsi=s=>(t.ansiRegex.lastIndex=0,typeof s=="string"&&s!==""&&t.ansiRegex.test(s)),t.alias=(s,o)=>{let a=typeof o=="string"?t[o]:o;if(typeof a!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");a.stack||(Reflect.defineProperty(a,"name",{value:s}),t.styles[s]=a,a.stack=[s]),Reflect.defineProperty(t,s,{configurable:!0,enumerable:!0,set(l){t.alias(s,l)},get(){let l=c=>i(c,l.stack);return Reflect.setPrototypeOf(l,t),l.stack=this.stack?this.stack.concat(a.stack):a.stack,l}})},t.theme=s=>{if(!EJe(s))throw new TypeError("Expected theme to be an object");for(let o of Object.keys(s))t.alias(o,s[o]);return t},t.alias("unstyle",s=>typeof s=="string"&&s!==""?(t.ansiRegex.lastIndex=0,s.replace(t.ansiRegex,"")):""),t.alias("noop",s=>s),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=Xie(),t.define=n,t};hN.exports=Zie();hN.exports.create=Zie});var Mi=I(bt=>{"use strict";var wJe=Object.prototype.toString,Cs=js(),$ie=!1,pN=[],ene={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};bt.longest=(t,e)=>t.reduce((r,i)=>Math.max(r,e?i[e].length:i.length),0);bt.hasColor=t=>!!t&&Cs.hasColor(t);var N0=bt.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);bt.nativeType=t=>wJe.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"");bt.isAsyncFn=t=>bt.nativeType(t)==="asyncfunction";bt.isPrimitive=t=>t!=null&&typeof t!="object"&&typeof t!="function";bt.resolve=(t,e,...r)=>typeof e=="function"?e.call(t,...r):e;bt.scrollDown=(t=[])=>[...t.slice(1),t[0]];bt.scrollUp=(t=[])=>[t.pop(),...t];bt.reorder=(t=[])=>{let e=t.slice();return e.sort((r,i)=>r.index>i.index?1:r.index{let i=t.length,n=r===i?0:r<0?i-1:r,s=t[e];t[e]=t[n],t[n]=s};bt.width=(t,e=80)=>{let r=t&&t.columns?t.columns:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[0]),process.platform==="win32"?r-1:r};bt.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[1]),r};bt.wordWrap=(t,e={})=>{if(!t)return t;typeof e=="number"&&(e={width:e});let{indent:r="",newline:i=` `+r,width:n=80}=e;n-=((i+r).match(/[^\S\n]/g)||[]).length;let o=`.{1,${n}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,a=t.trim(),l=new RegExp(o,"g"),c=a.match(l)||[];return c=c.map(u=>u.replace(/\n$/,"")),e.padEnd&&(c=c.map(u=>u.padEnd(n," "))),e.padStart&&(c=c.map(u=>u.padStart(n," "))),r+c.join(i)};bt.unmute=t=>{let e=t.stack.find(i=>Cs.keys.color.includes(i));return e?Cs[e]:t.stack.find(i=>i.slice(2)==="bg")?Cs[e.slice(2)]:i=>i};bt.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"";bt.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>Cs.keys.color.includes(i));if(e){let i=Cs["bg"+bt.pascal(e)];return i?i.black:t}let r=t.stack.find(i=>i.slice(0,2)==="bg");return r?Cs[r.slice(2).toLowerCase()]||t:Cs.none};bt.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>Cs.keys.color.includes(i)),r=t.stack.find(i=>i.slice(0,2)==="bg");if(e&&!r)return Cs[ene[e]||e];if(r){let i=r.slice(2).toLowerCase(),n=ene[i];return n&&Cs["bg"+bt.pascal(n)]||t}return Cs.none};bt.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),i=e>=12?"pm":"am";e=e%12;let n=e===0?12:e,s=r<10?"0"+r:r;return n+":"+s+" "+i};bt.set=(t={},e="",r)=>e.split(".").reduce((i,n,s,o)=>{let a=o.length-1>s?i[n]||{}:r;return!bt.isObject(a)&&s{let i=t[e]==null?e.split(".").reduce((n,s)=>n&&n[s],t):t[e];return i==null?r:i};bt.mixin=(t,e)=>{if(!N0(t))return e;if(!N0(e))return t;for(let r of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i.hasOwnProperty("value"))if(t.hasOwnProperty(r)&&N0(i.value)){let n=Object.getOwnPropertyDescriptor(t,r);N0(n.value)?t[r]=bt.merge({},t[r],e[r]):Reflect.defineProperty(t,r,i)}else Reflect.defineProperty(t,r,i);else Reflect.defineProperty(t,r,i)}return t};bt.merge=(...t)=>{let e={};for(let r of t)bt.mixin(e,r);return e};bt.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let i of Object.keys(r)){let n=r[i];typeof n=="function"?bt.define(t,i,n.bind(e)):bt.define(t,i,n)}};bt.onExit=t=>{let e=(r,i)=>{$ie||($ie=!0,pN.forEach(n=>n()),r===!0&&process.exit(128+i))};pN.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),pN.push(t)};bt.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};bt.defineExport=(t,e,r)=>{let i;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(n){i=n},get(){return i?i():r()}})}});var tne=I(nf=>{"use strict";nf.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};nf.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};nf.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};nf.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};nf.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var nne=I((dCt,rne)=>{"use strict";var ine=require("readline"),BJe=tne(),QJe=/^(?:\x1b)([a-zA-Z0-9])$/,bJe=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,vJe={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};function SJe(t){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(t)}function xJe(t){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(t)}var L0=(t="",e={})=>{let r,i=P({name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:t,raw:t},e);if(Buffer.isBuffer(t)?t[0]>127&&t[1]===void 0?(t[0]-=128,t=""+String(t)):t=String(t):t!==void 0&&typeof t!="string"?t=String(t):t||(t=i.sequence||""),i.sequence=i.sequence||t||i.name,t==="\r")i.raw=void 0,i.name="return";else if(t===` @@ -314,7 +314,7 @@ ${r.nodePath?`$env:NODE_PATH=$env_node_path `)}async preserveTimePromise(e,r){let i=await this.lstatPromise(e),n=await r();typeof n!="undefined"&&(e=n),this.lutimesPromise?await this.lutimesPromise(e,i.atime,i.mtime):i.isSymbolicLink()||await this.utimesPromise(e,i.atime,i.mtime)}async preserveTimeSync(e,r){let i=this.lstatSync(e),n=r();typeof n!="undefined"&&(e=n),this.lutimesSync?this.lutimesSync(e,i.atime,i.mtime):i.isSymbolicLink()||this.utimesSync(e,i.atime,i.mtime)}},gl=class extends eA{constructor(){super(v)}};function rhe(t){let e=t.match(/\r?\n/g);if(e===null)return EO.EOL;let r=e.filter(n=>n===`\r `).length,i=e.length-r;return r>i?`\r `:` -`}function ul(t,e){return e.replace(/\r?\n/g,rhe(t))}var $c=ie(require("fs")),cb=ie(require("stream")),QO=ie(require("util")),ub=ie(require("zlib"));var yO=ie(require("fs"));var Wt=class extends gl{constructor(e=yO.default){super();this.realFs=e,typeof this.realFs.lutimes!="undefined"&&(this.lutimesPromise=this.lutimesPromiseImpl,this.lutimesSync=this.lutimesSyncImpl)}getExtractHint(){return!1}getRealPath(){return Se.root}resolve(e){return v.resolve(e)}async openPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.open(M.fromPortablePath(e),r,i,this.makeCallback(n,s))})}openSync(e,r,i){return this.realFs.openSync(M.fromPortablePath(e),r,i)}async opendirPromise(e,r){return await new Promise((i,n)=>{typeof r!="undefined"?this.realFs.opendir(M.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.opendir(M.fromPortablePath(e),this.makeCallback(i,n))}).then(i=>Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0}))}opendirSync(e,r){let i=typeof r!="undefined"?this.realFs.opendirSync(M.fromPortablePath(e),r):this.realFs.opendirSync(M.fromPortablePath(e));return Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0})}async readPromise(e,r,i=0,n=0,s=-1){return await new Promise((o,a)=>{this.realFs.read(e,r,i,n,s,(l,c)=>{l?a(l):o(c)})})}readSync(e,r,i,n,s){return this.realFs.readSync(e,r,i,n,s)}async writePromise(e,r,i,n,s){return await new Promise((o,a)=>typeof r=="string"?this.realFs.write(e,r,i,this.makeCallback(o,a)):this.realFs.write(e,r,i,n,s,this.makeCallback(o,a)))}writeSync(e,r,i,n,s){return typeof r=="string"?this.realFs.writeSync(e,r,i):this.realFs.writeSync(e,r,i,n,s)}async closePromise(e){await new Promise((r,i)=>{this.realFs.close(e,this.makeCallback(r,i))})}closeSync(e){this.realFs.closeSync(e)}createReadStream(e,r){let i=e!==null?M.fromPortablePath(e):e;return this.realFs.createReadStream(i,r)}createWriteStream(e,r){let i=e!==null?M.fromPortablePath(e):e;return this.realFs.createWriteStream(i,r)}async realpathPromise(e){return await new Promise((r,i)=>{this.realFs.realpath(M.fromPortablePath(e),{},this.makeCallback(r,i))}).then(r=>M.toPortablePath(r))}realpathSync(e){return M.toPortablePath(this.realFs.realpathSync(M.fromPortablePath(e),{}))}async existsPromise(e){return await new Promise(r=>{this.realFs.exists(M.fromPortablePath(e),r)})}accessSync(e,r){return this.realFs.accessSync(M.fromPortablePath(e),r)}async accessPromise(e,r){return await new Promise((i,n)=>{this.realFs.access(M.fromPortablePath(e),r,this.makeCallback(i,n))})}existsSync(e){return this.realFs.existsSync(M.fromPortablePath(e))}async statPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.stat(M.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.stat(M.fromPortablePath(e),this.makeCallback(i,n))})}statSync(e,r){return r?this.realFs.statSync(M.fromPortablePath(e),r):this.realFs.statSync(M.fromPortablePath(e))}async fstatPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.fstat(e,r,this.makeCallback(i,n)):this.realFs.fstat(e,this.makeCallback(i,n))})}fstatSync(e,r){return r?this.realFs.fstatSync(e,r):this.realFs.fstatSync(e)}async lstatPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.lstat(M.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.lstat(M.fromPortablePath(e),this.makeCallback(i,n))})}lstatSync(e,r){return r?this.realFs.lstatSync(M.fromPortablePath(e),r):this.realFs.lstatSync(M.fromPortablePath(e))}async chmodPromise(e,r){return await new Promise((i,n)=>{this.realFs.chmod(M.fromPortablePath(e),r,this.makeCallback(i,n))})}chmodSync(e,r){return this.realFs.chmodSync(M.fromPortablePath(e),r)}async chownPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.chown(M.fromPortablePath(e),r,i,this.makeCallback(n,s))})}chownSync(e,r,i){return this.realFs.chownSync(M.fromPortablePath(e),r,i)}async renamePromise(e,r){return await new Promise((i,n)=>{this.realFs.rename(M.fromPortablePath(e),M.fromPortablePath(r),this.makeCallback(i,n))})}renameSync(e,r){return this.realFs.renameSync(M.fromPortablePath(e),M.fromPortablePath(r))}async copyFilePromise(e,r,i=0){return await new Promise((n,s)=>{this.realFs.copyFile(M.fromPortablePath(e),M.fromPortablePath(r),i,this.makeCallback(n,s))})}copyFileSync(e,r,i=0){return this.realFs.copyFileSync(M.fromPortablePath(e),M.fromPortablePath(r),i)}async appendFilePromise(e,r,i){return await new Promise((n,s)=>{let o=typeof e=="string"?M.fromPortablePath(e):e;i?this.realFs.appendFile(o,r,i,this.makeCallback(n,s)):this.realFs.appendFile(o,r,this.makeCallback(n,s))})}appendFileSync(e,r,i){let n=typeof e=="string"?M.fromPortablePath(e):e;i?this.realFs.appendFileSync(n,r,i):this.realFs.appendFileSync(n,r)}async writeFilePromise(e,r,i){return await new Promise((n,s)=>{let o=typeof e=="string"?M.fromPortablePath(e):e;i?this.realFs.writeFile(o,r,i,this.makeCallback(n,s)):this.realFs.writeFile(o,r,this.makeCallback(n,s))})}writeFileSync(e,r,i){let n=typeof e=="string"?M.fromPortablePath(e):e;i?this.realFs.writeFileSync(n,r,i):this.realFs.writeFileSync(n,r)}async unlinkPromise(e){return await new Promise((r,i)=>{this.realFs.unlink(M.fromPortablePath(e),this.makeCallback(r,i))})}unlinkSync(e){return this.realFs.unlinkSync(M.fromPortablePath(e))}async utimesPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.utimes(M.fromPortablePath(e),r,i,this.makeCallback(n,s))})}utimesSync(e,r,i){this.realFs.utimesSync(M.fromPortablePath(e),r,i)}async lutimesPromiseImpl(e,r,i){let n=this.realFs.lutimes;if(typeof n=="undefined")throw th("unavailable Node binding",`lutimes '${e}'`);return await new Promise((s,o)=>{n.call(this.realFs,M.fromPortablePath(e),r,i,this.makeCallback(s,o))})}lutimesSyncImpl(e,r,i){let n=this.realFs.lutimesSync;if(typeof n=="undefined")throw th("unavailable Node binding",`lutimes '${e}'`);n.call(this.realFs,M.fromPortablePath(e),r,i)}async mkdirPromise(e,r){return await new Promise((i,n)=>{this.realFs.mkdir(M.fromPortablePath(e),r,this.makeCallback(i,n))})}mkdirSync(e,r){return this.realFs.mkdirSync(M.fromPortablePath(e),r)}async rmdirPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.rmdir(M.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.rmdir(M.fromPortablePath(e),this.makeCallback(i,n))})}rmdirSync(e,r){return this.realFs.rmdirSync(M.fromPortablePath(e),r)}async linkPromise(e,r){return await new Promise((i,n)=>{this.realFs.link(M.fromPortablePath(e),M.fromPortablePath(r),this.makeCallback(i,n))})}linkSync(e,r){return this.realFs.linkSync(M.fromPortablePath(e),M.fromPortablePath(r))}async symlinkPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.symlink(M.fromPortablePath(e.replace(/\/+$/,"")),M.fromPortablePath(r),i,this.makeCallback(n,s))})}symlinkSync(e,r,i){return this.realFs.symlinkSync(M.fromPortablePath(e.replace(/\/+$/,"")),M.fromPortablePath(r),i)}async readFilePromise(e,r){return await new Promise((i,n)=>{let s=typeof e=="string"?M.fromPortablePath(e):e;this.realFs.readFile(s,r,this.makeCallback(i,n))})}readFileSync(e,r){let i=typeof e=="string"?M.fromPortablePath(e):e;return this.realFs.readFileSync(i,r)}async readdirPromise(e,r){return await new Promise((i,n)=>{(r==null?void 0:r.withFileTypes)?this.realFs.readdir(M.fromPortablePath(e),{withFileTypes:!0},this.makeCallback(i,n)):this.realFs.readdir(M.fromPortablePath(e),this.makeCallback(s=>i(s),n))})}readdirSync(e,r){return(r==null?void 0:r.withFileTypes)?this.realFs.readdirSync(M.fromPortablePath(e),{withFileTypes:!0}):this.realFs.readdirSync(M.fromPortablePath(e))}async readlinkPromise(e){return await new Promise((r,i)=>{this.realFs.readlink(M.fromPortablePath(e),this.makeCallback(r,i))}).then(r=>M.toPortablePath(r))}readlinkSync(e){return M.toPortablePath(this.realFs.readlinkSync(M.fromPortablePath(e)))}async truncatePromise(e,r){return await new Promise((i,n)=>{this.realFs.truncate(M.fromPortablePath(e),r,this.makeCallback(i,n))})}truncateSync(e,r){return this.realFs.truncateSync(M.fromPortablePath(e),r)}watch(e,r,i){return this.realFs.watch(M.fromPortablePath(e),r,i)}watchFile(e,r,i){return this.realFs.watchFile(M.fromPortablePath(e),r,i)}unwatchFile(e,r){return this.realFs.unwatchFile(M.fromPortablePath(e),r)}makeCallback(e,r){return(i,n)=>{i?r(i):e(n)}}};var wO=ie(require("events"));var fl;(function(r){r.Change="change",r.Stop="stop"})(fl||(fl={}));var hl;(function(i){i.Ready="ready",i.Running="running",i.Stopped="stopped"})(hl||(hl={}));function BO(t,e){if(t!==e)throw new Error(`Invalid StatWatcher status: expected '${e}', got '${t}'`)}var ih=class extends wO.EventEmitter{constructor(e,r,{bigint:i=!1}={}){super();this.status=hl.Ready;this.changeListeners=new Map;this.startTimeout=null;this.fakeFs=e,this.path=r,this.bigint=i,this.lastStats=this.stat()}static create(e,r,i){let n=new ih(e,r,i);return n.start(),n}start(){BO(this.status,hl.Ready),this.status=hl.Running,this.startTimeout=setTimeout(()=>{this.startTimeout=null,this.fakeFs.existsSync(this.path)||this.emit(fl.Change,this.lastStats,this.lastStats)},3)}stop(){BO(this.status,hl.Running),this.status=hl.Stopped,this.startTimeout!==null&&(clearTimeout(this.startTimeout),this.startTimeout=null),this.emit(fl.Stop)}stat(){try{return this.fakeFs.statSync(this.path,{bigint:this.bigint})}catch(e){let r=this.bigint?new Xf:new Za;return pI(r)}}makeInterval(e){let r=setInterval(()=>{let i=this.stat(),n=this.lastStats;nb(i,n)||(this.lastStats=i,this.emit(fl.Change,i,n))},e.interval);return e.persistent?r:r.unref()}registerChangeListener(e,r){this.addListener(fl.Change,e),this.changeListeners.set(e,this.makeInterval(r))}unregisterChangeListener(e){this.removeListener(fl.Change,e);let r=this.changeListeners.get(e);typeof r!="undefined"&&clearInterval(r),this.changeListeners.delete(e)}unregisterAllChangeListeners(){for(let e of this.changeListeners.keys())this.unregisterChangeListener(e)}hasChangeListeners(){return this.changeListeners.size>0}ref(){for(let e of this.changeListeners.values())e.ref();return this}unref(){for(let e of this.changeListeners.values())e.unref();return this}};var BI=new WeakMap;function QI(t,e,r,i){let n,s,o,a;switch(typeof r){case"function":n=!1,s=!0,o=5007,a=r;break;default:({bigint:n=!1,persistent:s=!0,interval:o=5007}=r),a=i;break}let l=BI.get(t);typeof l=="undefined"&&BI.set(t,l=new Map);let c=l.get(e);return typeof c=="undefined"&&(c=ih.create(t,e,{bigint:n}),l.set(e,c)),c.registerChangeListener(a,{persistent:s,interval:o}),c}function nh(t,e,r){let i=BI.get(t);if(typeof i=="undefined")return;let n=i.get(e);typeof n!="undefined"&&(typeof r=="undefined"?n.unregisterAllChangeListeners():n.unregisterChangeListener(r),n.hasChangeListeners()||(n.stop(),i.delete(e)))}function sh(t){let e=BI.get(t);if(typeof e!="undefined")for(let r of e.keys())nh(t,r)}var pl="mixed";function ihe(t){if(typeof t=="string"&&String(+t)===t)return+t;if(Number.isFinite(t))return t<0?Date.now()/1e3:t;if((0,QO.isDate)(t))return t.getTime()/1e3;throw new Error("Invalid time")}function bO(){return Buffer.from([80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}var Jr=class extends gl{constructor(e,r){super();this.lzSource=null;this.listings=new Map;this.entries=new Map;this.fileSources=new Map;this.fds=new Map;this.nextFd=0;this.ready=!1;this.readOnly=!1;this.libzip=r.libzip;let i=r;if(this.level=typeof i.level!="undefined"?i.level:pl,e!=null||(e=bO()),typeof e=="string"){let{baseFs:o=new Wt}=i;this.baseFs=o,this.path=e}else this.path=null,this.baseFs=null;if(r.stats)this.stats=r.stats;else if(typeof e=="string")try{this.stats=this.baseFs.statSync(e)}catch(o){if(o.code==="ENOENT"&&i.create)this.stats=Zf();else throw o}else this.stats=Zf();let n=this.libzip.malloc(4);try{let o=0;if(typeof e=="string"&&i.create&&(o|=this.libzip.ZIP_CREATE|this.libzip.ZIP_TRUNCATE),r.readOnly&&(o|=this.libzip.ZIP_RDONLY,this.readOnly=!0),typeof e=="string")this.zip=this.libzip.open(M.fromPortablePath(e),o,n);else{let a=this.allocateUnattachedSource(e);try{this.zip=this.libzip.openFromSource(a,o,n),this.lzSource=a}catch(l){throw this.libzip.source.free(a),l}}if(this.zip===0){let a=this.libzip.struct.errorS();throw this.libzip.error.initWithCode(a,this.libzip.getValue(n,"i32")),this.makeLibzipError(a)}}finally{this.libzip.free(n)}this.listings.set(Se.root,new Set);let s=this.libzip.getNumEntries(this.zip,0);for(let o=0;oe)throw new Error("Overread");let n=this.libzip.HEAPU8.subarray(r,r+e);return Buffer.from(n)}finally{this.libzip.free(r)}}finally{this.libzip.source.close(this.lzSource),this.libzip.source.free(this.lzSource),this.ready=!1}}prepareClose(){if(!this.ready)throw EI("archive closed, close");sh(this)}saveAndClose(){if(!this.path||!this.baseFs)throw new Error("ZipFS cannot be saved and must be discarded when loaded from a buffer");if(this.prepareClose(),this.readOnly){this.discardAndClose();return}let e=this.baseFs.existsSync(this.path)||this.stats.mode===_f?void 0:this.stats.mode;if(this.entries.size===0)this.discardAndClose(),this.baseFs.writeFileSync(this.path,bO(),{mode:e});else{if(this.libzip.close(this.zip)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));typeof e!="undefined"&&this.baseFs.chmodSync(this.path,e)}this.ready=!1}discardAndClose(){this.prepareClose(),this.libzip.discard(this.zip),this.ready=!1}resolve(e){return v.resolve(Se.root,e)}async openPromise(e,r,i){return this.openSync(e,r,i)}openSync(e,r,i){let n=this.nextFd++;return this.fds.set(n,{cursor:0,p:e}),n}hasOpenFileHandles(){return!!this.fds.size}async opendirPromise(e,r){return this.opendirSync(e,r)}opendirSync(e,r={}){let i=this.resolveFilename(`opendir '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`opendir '${e}'`);let n=this.listings.get(i);if(!n)throw eo(`opendir '${e}'`);let s=[...n],o=this.openSync(i,"r");return wI(this,i,s,{onClose:()=>{this.closeSync(o)}})}async readPromise(e,r,i,n,s){return this.readSync(e,r,i,n,s)}readSync(e,r,i=0,n=r.byteLength,s=-1){let o=this.fds.get(e);if(typeof o=="undefined")throw Hi("read");let a;s===-1||s===null?a=o.cursor:a=s;let l=this.readFileSync(o.p);l.copy(r,i,a,a+n);let c=Math.max(0,Math.min(l.length-a,n));return(s===-1||s===null)&&(o.cursor+=c),c}async writePromise(e,r,i,n,s){return typeof r=="string"?this.writeSync(e,r,s):this.writeSync(e,r,i,n,s)}writeSync(e,r,i,n,s){throw typeof this.fds.get(e)=="undefined"?Hi("read"):new Error("Unimplemented")}async closePromise(e){return this.closeSync(e)}closeSync(e){if(typeof this.fds.get(e)=="undefined")throw Hi("read");this.fds.delete(e)}createReadStream(e,{encoding:r}={}){if(e===null)throw new Error("Unimplemented");let i=this.openSync(e,"r"),n=Object.assign(new cb.PassThrough({emitClose:!0,autoDestroy:!0,destroy:(o,a)=>{clearImmediate(s),this.closeSync(i),a(o)}}),{close(){n.destroy()},bytesRead:0,path:e}),s=setImmediate(async()=>{try{let o=await this.readFilePromise(e,r);n.bytesRead=o.length,n.end(o)}catch(o){n.destroy(o)}});return n}createWriteStream(e,{encoding:r}={}){if(this.readOnly)throw ln(`open '${e}'`);if(e===null)throw new Error("Unimplemented");let i=[],n=this.openSync(e,"w"),s=Object.assign(new cb.PassThrough({autoDestroy:!0,emitClose:!0,destroy:(o,a)=>{try{o?a(o):(this.writeFileSync(e,Buffer.concat(i),r),a(null))}catch(l){a(l)}finally{this.closeSync(n)}}}),{bytesWritten:0,path:e,close(){s.destroy()}});return s.on("data",o=>{let a=Buffer.from(o);s.bytesWritten+=a.length,i.push(a)}),s}async realpathPromise(e){return this.realpathSync(e)}realpathSync(e){let r=this.resolveFilename(`lstat '${e}'`,e);if(!this.entries.has(r)&&!this.listings.has(r))throw bs(`lstat '${e}'`);return r}async existsPromise(e){return this.existsSync(e)}existsSync(e){if(!this.ready)throw EI(`archive closed, existsSync '${e}'`);if(this.symlinkCount===0){let i=v.resolve(Se.root,e);return this.entries.has(i)||this.listings.has(i)}let r;try{r=this.resolveFilename(`stat '${e}'`,e)}catch(i){return!1}return this.entries.has(r)||this.listings.has(r)}async accessPromise(e,r){return this.accessSync(e,r)}accessSync(e,r=$c.constants.F_OK){let i=this.resolveFilename(`access '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`access '${e}'`);if(this.readOnly&&r&$c.constants.W_OK)throw ln(`access '${e}'`)}async statPromise(e,r){return this.statSync(e,r)}statSync(e,r){let i=this.resolveFilename(`stat '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`stat '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(i))throw eo(`stat '${e}'`);return this.statImpl(`stat '${e}'`,i,r)}async fstatPromise(e,r){return this.fstatSync(e,r)}fstatSync(e,r){let i=this.fds.get(e);if(typeof i=="undefined")throw Hi("fstatSync");let{p:n}=i,s=this.resolveFilename(`stat '${n}'`,n);if(!this.entries.has(s)&&!this.listings.has(s))throw bs(`stat '${n}'`);if(n[n.length-1]==="/"&&!this.listings.has(s))throw eo(`stat '${n}'`);return this.statImpl(`fstat '${n}'`,s,r)}async lstatPromise(e,r){return this.lstatSync(e,r)}lstatSync(e,r){let i=this.resolveFilename(`lstat '${e}'`,e,!1);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`lstat '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(i))throw eo(`lstat '${e}'`);return this.statImpl(`lstat '${e}'`,i,r)}statImpl(e,r,i={}){let n=this.entries.get(r);if(typeof n!="undefined"){let s=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,n,0,0,s)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let a=this.stats.uid,l=this.stats.gid,c=this.libzip.struct.statSize(s)>>>0,u=512,g=Math.ceil(c/u),f=(this.libzip.struct.statMtime(s)>>>0)*1e3,h=f,p=f,d=f,m=new Date(h),E=new Date(p),B=new Date(d),b=new Date(f),R=this.listings.has(r)?zo:this.isSymbolicLink(n)?_o:Vo,H=R===zo?493:420,L=R|this.getUnixMode(n,H)&511,K=this.libzip.struct.statCrc(s),J=Object.assign(new Za,{uid:a,gid:l,size:c,blksize:u,blocks:g,atime:m,birthtime:E,ctime:B,mtime:b,atimeMs:h,birthtimeMs:p,ctimeMs:d,mtimeMs:f,mode:L,crc:K});return i.bigint===!0?dI(J):J}if(this.listings.has(r)){let s=this.stats.uid,o=this.stats.gid,a=0,l=512,c=0,u=this.stats.mtimeMs,g=this.stats.mtimeMs,f=this.stats.mtimeMs,h=this.stats.mtimeMs,p=new Date(u),d=new Date(g),m=new Date(f),E=new Date(h),B=zo|493,b=0,R=Object.assign(new Za,{uid:s,gid:o,size:a,blksize:l,blocks:c,atime:p,birthtime:d,ctime:m,mtime:E,atimeMs:u,birthtimeMs:g,ctimeMs:f,mtimeMs:h,mode:B,crc:b});return i.bigint===!0?dI(R):R}throw new Error("Unreachable")}getUnixMode(e,r){if(this.libzip.file.getExternalAttributes(this.zip,e,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.libzip.getValue(this.libzip.uint08S,"i8")>>>0!==this.libzip.ZIP_OPSYS_UNIX?r:this.libzip.getValue(this.libzip.uint32S,"i32")>>>16}registerListing(e){let r=this.listings.get(e);if(r)return r;let i=this.registerListing(v.dirname(e));return r=new Set,i.add(v.basename(e)),this.listings.set(e,r),r}registerEntry(e,r){this.registerListing(v.dirname(e)).add(v.basename(e)),this.entries.set(e,r)}unregisterListing(e){this.listings.delete(e);let r=this.listings.get(v.dirname(e));r==null||r.delete(v.basename(e))}unregisterEntry(e){this.unregisterListing(e);let r=this.entries.get(e);this.entries.delete(e),typeof r!="undefined"&&(this.fileSources.delete(r),this.isSymbolicLink(r)&&this.symlinkCount--)}deleteEntry(e,r){if(this.unregisterEntry(e),this.libzip.delete(this.zip,r)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}resolveFilename(e,r,i=!0){if(!this.ready)throw EI(`archive closed, ${e}`);let n=v.resolve(Se.root,r);if(n==="/")return Se.root;let s=this.entries.get(n);if(i&&s!==void 0)if(this.symlinkCount!==0&&this.isSymbolicLink(s)){let o=this.getFileSource(s).toString();return this.resolveFilename(e,v.resolve(v.dirname(n),o),!0)}else return n;for(;;){let o=this.resolveFilename(e,v.dirname(n),!0),a=this.listings.has(o),l=this.entries.has(o);if(!a&&!l)throw bs(e);if(!a)throw eo(e);if(n=v.resolve(o,v.basename(n)),!i||this.symlinkCount===0)break;let c=this.libzip.name.locate(this.zip,n.slice(1));if(c===-1)break;if(this.isSymbolicLink(c)){let u=this.getFileSource(c).toString();n=v.resolve(v.dirname(n),u)}else break}return n}allocateBuffer(e){Buffer.isBuffer(e)||(e=Buffer.from(e));let r=this.libzip.malloc(e.byteLength);if(!r)throw new Error("Couldn't allocate enough memory");return new Uint8Array(this.libzip.HEAPU8.buffer,r,e.byteLength).set(e),{buffer:r,byteLength:e.byteLength}}allocateUnattachedSource(e){let r=this.libzip.struct.errorS(),{buffer:i,byteLength:n}=this.allocateBuffer(e),s=this.libzip.source.fromUnattachedBuffer(i,n,0,!0,r);if(s===0)throw this.libzip.free(r),this.makeLibzipError(r);return s}allocateSource(e){let{buffer:r,byteLength:i}=this.allocateBuffer(e),n=this.libzip.source.fromBuffer(this.zip,r,i,0,!0);if(n===0)throw this.libzip.free(r),this.makeLibzipError(this.libzip.getError(this.zip));return n}setFileSource(e,r){let i=Buffer.isBuffer(r)?r:Buffer.from(r),n=v.relative(Se.root,e),s=this.allocateSource(r);try{let o=this.libzip.file.add(this.zip,n,s,this.libzip.ZIP_FL_OVERWRITE);if(o===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));if(this.level!=="mixed"){let a;if(this.level===0?a=this.libzip.ZIP_CM_STORE:a=this.libzip.ZIP_CM_DEFLATE,this.libzip.file.setCompression(this.zip,o,0,a,this.level)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}return this.fileSources.set(o,i),o}catch(o){throw this.libzip.source.free(s),o}}isSymbolicLink(e){if(this.symlinkCount===0)return!1;if(this.libzip.file.getExternalAttributes(this.zip,e,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.libzip.getValue(this.libzip.uint08S,"i8")>>>0!==this.libzip.ZIP_OPSYS_UNIX?!1:(this.libzip.getValue(this.libzip.uint32S,"i32")>>>16&kn)===_o}getFileSource(e,r={asyncDecompress:!1}){let i=this.fileSources.get(e);if(typeof i!="undefined")return i;let n=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,e,0,0,n)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let o=this.libzip.struct.statCompSize(n),a=this.libzip.struct.statCompMethod(n),l=this.libzip.malloc(o);try{let c=this.libzip.fopenIndex(this.zip,e,0,this.libzip.ZIP_FL_COMPRESSED);if(c===0)throw this.makeLibzipError(this.libzip.getError(this.zip));try{let u=this.libzip.fread(c,l,o,0);if(u===-1)throw this.makeLibzipError(this.libzip.file.getError(c));if(uo)throw new Error("Overread");let g=this.libzip.HEAPU8.subarray(l,l+o),f=Buffer.from(g);if(a===0)return this.fileSources.set(e,f),f;if(r.asyncDecompress)return new Promise((h,p)=>{ub.default.inflateRaw(f,(d,m)=>{d?p(d):(this.fileSources.set(e,m),h(m))})});{let h=ub.default.inflateRawSync(f);return this.fileSources.set(e,h),h}}finally{this.libzip.fclose(c)}}finally{this.libzip.free(l)}}async chmodPromise(e,r){return this.chmodSync(e,r)}chmodSync(e,r){if(this.readOnly)throw ln(`chmod '${e}'`);r&=493;let i=this.resolveFilename(`chmod '${e}'`,e,!1),n=this.entries.get(i);if(typeof n=="undefined")throw new Error(`Assertion failed: The entry should have been registered (${i})`);let o=this.getUnixMode(n,Vo|0)&~511|r;if(this.libzip.file.setExternalAttributes(this.zip,n,0,0,this.libzip.ZIP_OPSYS_UNIX,o<<16)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}async chownPromise(e,r,i){return this.chownSync(e,r,i)}chownSync(e,r,i){throw new Error("Unimplemented")}async renamePromise(e,r){return this.renameSync(e,r)}renameSync(e,r){throw new Error("Unimplemented")}async copyFilePromise(e,r,i){let{indexSource:n,indexDest:s,resolvedDestP:o}=this.prepareCopyFile(e,r,i),a=await this.getFileSource(n,{asyncDecompress:!0}),l=this.setFileSource(o,a);l!==s&&this.registerEntry(o,l)}copyFileSync(e,r,i=0){let{indexSource:n,indexDest:s,resolvedDestP:o}=this.prepareCopyFile(e,r,i),a=this.getFileSource(n),l=this.setFileSource(o,a);l!==s&&this.registerEntry(o,l)}prepareCopyFile(e,r,i=0){if(this.readOnly)throw ln(`copyfile '${e} -> '${r}'`);if((i&$c.constants.COPYFILE_FICLONE_FORCE)!=0)throw th("unsupported clone operation",`copyfile '${e}' -> ${r}'`);let n=this.resolveFilename(`copyfile '${e} -> ${r}'`,e),s=this.entries.get(n);if(typeof s=="undefined")throw $a(`copyfile '${e}' -> '${r}'`);let o=this.resolveFilename(`copyfile '${e}' -> ${r}'`,r),a=this.entries.get(o);if((i&($c.constants.COPYFILE_EXCL|$c.constants.COPYFILE_FICLONE_FORCE))!=0&&typeof a!="undefined")throw yI(`copyfile '${e}' -> '${r}'`);return{indexSource:s,resolvedDestP:o,indexDest:a}}async appendFilePromise(e,r,i){if(this.readOnly)throw ln(`open '${e}'`);return typeof i=="undefined"?i={flag:"a"}:typeof i=="string"?i={flag:"a",encoding:i}:typeof i.flag=="undefined"&&(i=P({flag:"a"},i)),this.writeFilePromise(e,r,i)}appendFileSync(e,r,i={}){if(this.readOnly)throw ln(`open '${e}'`);return typeof i=="undefined"?i={flag:"a"}:typeof i=="string"?i={flag:"a",encoding:i}:typeof i.flag=="undefined"&&(i=P({flag:"a"},i)),this.writeFileSync(e,r,i)}fdToPath(e,r){var n;let i=(n=this.fds.get(e))==null?void 0:n.p;if(typeof i=="undefined")throw Hi(r);return i}async writeFilePromise(e,r,i){let{encoding:n,mode:s,index:o,resolvedP:a}=this.prepareWriteFile(e,i);o!==void 0&&typeof i=="object"&&i.flag&&i.flag.includes("a")&&(r=Buffer.concat([await this.getFileSource(o,{asyncDecompress:!0}),Buffer.from(r)])),n!==null&&(r=r.toString(n));let l=this.setFileSource(a,r);l!==o&&this.registerEntry(a,l),s!==null&&await this.chmodPromise(a,s)}writeFileSync(e,r,i){let{encoding:n,mode:s,index:o,resolvedP:a}=this.prepareWriteFile(e,i);o!==void 0&&typeof i=="object"&&i.flag&&i.flag.includes("a")&&(r=Buffer.concat([this.getFileSource(o),Buffer.from(r)])),n!==null&&(r=r.toString(n));let l=this.setFileSource(a,r);l!==o&&this.registerEntry(a,l),s!==null&&this.chmodSync(a,s)}prepareWriteFile(e,r){if(typeof e=="number"&&(e=this.fdToPath(e,"read")),this.readOnly)throw ln(`open '${e}'`);let i=this.resolveFilename(`open '${e}'`,e);if(this.listings.has(i))throw rh(`open '${e}'`);let n=null,s=null;typeof r=="string"?n=r:typeof r=="object"&&({encoding:n=null,mode:s=null}=r);let o=this.entries.get(i);return{encoding:n,mode:s,resolvedP:i,index:o}}async unlinkPromise(e){return this.unlinkSync(e)}unlinkSync(e){if(this.readOnly)throw ln(`unlink '${e}'`);let r=this.resolveFilename(`unlink '${e}'`,e);if(this.listings.has(r))throw rh(`unlink '${e}'`);let i=this.entries.get(r);if(typeof i=="undefined")throw $a(`unlink '${e}'`);this.deleteEntry(r,i)}async utimesPromise(e,r,i){return this.utimesSync(e,r,i)}utimesSync(e,r,i){if(this.readOnly)throw ln(`utimes '${e}'`);let n=this.resolveFilename(`utimes '${e}'`,e);this.utimesImpl(n,i)}async lutimesPromise(e,r,i){return this.lutimesSync(e,r,i)}lutimesSync(e,r,i){if(this.readOnly)throw ln(`lutimes '${e}'`);let n=this.resolveFilename(`utimes '${e}'`,e,!1);this.utimesImpl(n,i)}utimesImpl(e,r){this.listings.has(e)&&(this.entries.has(e)||this.hydrateDirectory(e));let i=this.entries.get(e);if(i===void 0)throw new Error("Unreachable");if(this.libzip.file.setMtime(this.zip,i,0,ihe(r),0)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}async mkdirPromise(e,r){return this.mkdirSync(e,r)}mkdirSync(e,{mode:r=493,recursive:i=!1}={}){if(i){this.mkdirpSync(e,{chmod:r});return}if(this.readOnly)throw ln(`mkdir '${e}'`);let n=this.resolveFilename(`mkdir '${e}'`,e);if(this.entries.has(n)||this.listings.has(n))throw yI(`mkdir '${e}'`);this.hydrateDirectory(n),this.chmodSync(n,r)}async rmdirPromise(e,r){return this.rmdirSync(e,r)}rmdirSync(e,{recursive:r=!1}={}){if(this.readOnly)throw ln(`rmdir '${e}'`);if(r){this.removeSync(e);return}let i=this.resolveFilename(`rmdir '${e}'`,e),n=this.listings.get(i);if(!n)throw eo(`rmdir '${e}'`);if(n.size>0)throw dO(`rmdir '${e}'`);let s=this.entries.get(i);if(typeof s=="undefined")throw $a(`rmdir '${e}'`);this.deleteEntry(e,s)}hydrateDirectory(e){let r=this.libzip.dir.add(this.zip,v.relative(Se.root,e));if(r===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.registerListing(e),this.registerEntry(e,r),r}async linkPromise(e,r){return this.linkSync(e,r)}linkSync(e,r){throw CO(`link '${e}' -> '${r}'`)}async symlinkPromise(e,r){return this.symlinkSync(e,r)}symlinkSync(e,r){if(this.readOnly)throw ln(`symlink '${e}' -> '${r}'`);let i=this.resolveFilename(`symlink '${e}' -> '${r}'`,r);if(this.listings.has(i))throw rh(`symlink '${e}' -> '${r}'`);if(this.entries.has(i))throw yI(`symlink '${e}' -> '${r}'`);let n=this.setFileSource(i,e);if(this.registerEntry(i,n),this.libzip.file.setExternalAttributes(this.zip,n,0,0,this.libzip.ZIP_OPSYS_UNIX,(_o|511)<<16)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));this.symlinkCount+=1}async readFilePromise(e,r){typeof r=="object"&&(r=r?r.encoding:void 0);let i=await this.readFileBuffer(e,{asyncDecompress:!0});return r?i.toString(r):i}readFileSync(e,r){typeof r=="object"&&(r=r?r.encoding:void 0);let i=this.readFileBuffer(e);return r?i.toString(r):i}readFileBuffer(e,r={asyncDecompress:!1}){typeof e=="number"&&(e=this.fdToPath(e,"read"));let i=this.resolveFilename(`open '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`open '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(i))throw eo(`open '${e}'`);if(this.listings.has(i))throw rh("read");let n=this.entries.get(i);if(n===void 0)throw new Error("Unreachable");return this.getFileSource(n,r)}async readdirPromise(e,r){return this.readdirSync(e,r)}readdirSync(e,r){let i=this.resolveFilename(`scandir '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`scandir '${e}'`);let n=this.listings.get(i);if(!n)throw eo(`scandir '${e}'`);let s=[...n];return(r==null?void 0:r.withFileTypes)?s.map(o=>Object.assign(this.statImpl("lstat",v.join(e,o)),{name:o})):s}async readlinkPromise(e){let r=this.prepareReadlink(e);return(await this.getFileSource(r,{asyncDecompress:!0})).toString()}readlinkSync(e){let r=this.prepareReadlink(e);return this.getFileSource(r).toString()}prepareReadlink(e){let r=this.resolveFilename(`readlink '${e}'`,e,!1);if(!this.entries.has(r)&&!this.listings.has(r))throw bs(`readlink '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(r))throw eo(`open '${e}'`);if(this.listings.has(r))throw $a(`readlink '${e}'`);let i=this.entries.get(r);if(i===void 0)throw new Error("Unreachable");if(!this.isSymbolicLink(i))throw $a(`readlink '${e}'`);return i}async truncatePromise(e,r=0){let i=this.resolveFilename(`open '${e}'`,e),n=this.entries.get(i);if(typeof n=="undefined")throw $a(`open '${e}'`);let s=await this.getFileSource(n,{asyncDecompress:!0}),o=Buffer.alloc(r,0);return s.copy(o),await this.writeFilePromise(e,o)}truncateSync(e,r=0){let i=this.resolveFilename(`open '${e}'`,e),n=this.entries.get(i);if(typeof n=="undefined")throw $a(`open '${e}'`);let s=this.getFileSource(n),o=Buffer.alloc(r,0);return s.copy(o),this.writeFileSync(e,o)}watch(e,r,i){let n;switch(typeof r){case"function":case"string":case"undefined":n=!0;break;default:({persistent:n=!0}=r);break}if(!n)return{on:()=>{},close:()=>{}};let s=setInterval(()=>{},24*60*60*1e3);return{on:()=>{},close:()=>{clearInterval(s)}}}watchFile(e,r,i){let n=v.resolve(Se.root,e);return QI(this,n,r,i)}unwatchFile(e,r){let i=v.resolve(Se.root,e);return nh(this,i,r)}};var fi=class extends eA{getExtractHint(e){return this.baseFs.getExtractHint(e)}resolve(e){return this.mapFromBase(this.baseFs.resolve(this.mapToBase(e)))}getRealPath(){return this.mapFromBase(this.baseFs.getRealPath())}async openPromise(e,r,i){return this.baseFs.openPromise(this.mapToBase(e),r,i)}openSync(e,r,i){return this.baseFs.openSync(this.mapToBase(e),r,i)}async opendirPromise(e,r){return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(e),r),{path:e})}opendirSync(e,r){return Object.assign(this.baseFs.opendirSync(this.mapToBase(e),r),{path:e})}async readPromise(e,r,i,n,s){return await this.baseFs.readPromise(e,r,i,n,s)}readSync(e,r,i,n,s){return this.baseFs.readSync(e,r,i,n,s)}async writePromise(e,r,i,n,s){return typeof r=="string"?await this.baseFs.writePromise(e,r,i):await this.baseFs.writePromise(e,r,i,n,s)}writeSync(e,r,i,n,s){return typeof r=="string"?this.baseFs.writeSync(e,r,i):this.baseFs.writeSync(e,r,i,n,s)}async closePromise(e){return this.baseFs.closePromise(e)}closeSync(e){this.baseFs.closeSync(e)}createReadStream(e,r){return this.baseFs.createReadStream(e!==null?this.mapToBase(e):e,r)}createWriteStream(e,r){return this.baseFs.createWriteStream(e!==null?this.mapToBase(e):e,r)}async realpathPromise(e){return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(e)))}realpathSync(e){return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(e)))}async existsPromise(e){return this.baseFs.existsPromise(this.mapToBase(e))}existsSync(e){return this.baseFs.existsSync(this.mapToBase(e))}accessSync(e,r){return this.baseFs.accessSync(this.mapToBase(e),r)}async accessPromise(e,r){return this.baseFs.accessPromise(this.mapToBase(e),r)}async statPromise(e,r){return this.baseFs.statPromise(this.mapToBase(e),r)}statSync(e,r){return this.baseFs.statSync(this.mapToBase(e),r)}async fstatPromise(e,r){return this.baseFs.fstatPromise(e,r)}fstatSync(e,r){return this.baseFs.fstatSync(e,r)}async lstatPromise(e,r){return this.baseFs.lstatPromise(this.mapToBase(e),r)}lstatSync(e,r){return this.baseFs.lstatSync(this.mapToBase(e),r)}async chmodPromise(e,r){return this.baseFs.chmodPromise(this.mapToBase(e),r)}chmodSync(e,r){return this.baseFs.chmodSync(this.mapToBase(e),r)}async chownPromise(e,r,i){return this.baseFs.chownPromise(this.mapToBase(e),r,i)}chownSync(e,r,i){return this.baseFs.chownSync(this.mapToBase(e),r,i)}async renamePromise(e,r){return this.baseFs.renamePromise(this.mapToBase(e),this.mapToBase(r))}renameSync(e,r){return this.baseFs.renameSync(this.mapToBase(e),this.mapToBase(r))}async copyFilePromise(e,r,i=0){return this.baseFs.copyFilePromise(this.mapToBase(e),this.mapToBase(r),i)}copyFileSync(e,r,i=0){return this.baseFs.copyFileSync(this.mapToBase(e),this.mapToBase(r),i)}async appendFilePromise(e,r,i){return this.baseFs.appendFilePromise(this.fsMapToBase(e),r,i)}appendFileSync(e,r,i){return this.baseFs.appendFileSync(this.fsMapToBase(e),r,i)}async writeFilePromise(e,r,i){return this.baseFs.writeFilePromise(this.fsMapToBase(e),r,i)}writeFileSync(e,r,i){return this.baseFs.writeFileSync(this.fsMapToBase(e),r,i)}async unlinkPromise(e){return this.baseFs.unlinkPromise(this.mapToBase(e))}unlinkSync(e){return this.baseFs.unlinkSync(this.mapToBase(e))}async utimesPromise(e,r,i){return this.baseFs.utimesPromise(this.mapToBase(e),r,i)}utimesSync(e,r,i){return this.baseFs.utimesSync(this.mapToBase(e),r,i)}async mkdirPromise(e,r){return this.baseFs.mkdirPromise(this.mapToBase(e),r)}mkdirSync(e,r){return this.baseFs.mkdirSync(this.mapToBase(e),r)}async rmdirPromise(e,r){return this.baseFs.rmdirPromise(this.mapToBase(e),r)}rmdirSync(e,r){return this.baseFs.rmdirSync(this.mapToBase(e),r)}async linkPromise(e,r){return this.baseFs.linkPromise(this.mapToBase(e),this.mapToBase(r))}linkSync(e,r){return this.baseFs.linkSync(this.mapToBase(e),this.mapToBase(r))}async symlinkPromise(e,r,i){let n=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkPromise(this.mapToBase(e),n,i);let s=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),o=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(n),s);return this.baseFs.symlinkPromise(o,n,i)}symlinkSync(e,r,i){let n=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkSync(this.mapToBase(e),n,i);let s=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),o=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(n),s);return this.baseFs.symlinkSync(o,n,i)}async readFilePromise(e,r){return r==="utf8"?this.baseFs.readFilePromise(this.fsMapToBase(e),r):this.baseFs.readFilePromise(this.fsMapToBase(e),r)}readFileSync(e,r){return r==="utf8"?this.baseFs.readFileSync(this.fsMapToBase(e),r):this.baseFs.readFileSync(this.fsMapToBase(e),r)}async readdirPromise(e,r){return this.baseFs.readdirPromise(this.mapToBase(e),r)}readdirSync(e,r){return this.baseFs.readdirSync(this.mapToBase(e),r)}async readlinkPromise(e){return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(e)))}readlinkSync(e){return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(e)))}async truncatePromise(e,r){return this.baseFs.truncatePromise(this.mapToBase(e),r)}truncateSync(e,r){return this.baseFs.truncateSync(this.mapToBase(e),r)}watch(e,r,i){return this.baseFs.watch(this.mapToBase(e),r,i)}watchFile(e,r,i){return this.baseFs.watchFile(this.mapToBase(e),r,i)}unwatchFile(e,r){return this.baseFs.unwatchFile(this.mapToBase(e),r)}fsMapToBase(e){return typeof e=="number"?e:this.mapToBase(e)}};var Xo=class extends fi{constructor(e,{baseFs:r,pathUtils:i}){super(i);this.target=e,this.baseFs=r}getRealPath(){return this.target}getBaseFs(){return this.baseFs}mapFromBase(e){return e}mapToBase(e){return e}};var Ft=class extends fi{constructor(e,{baseFs:r=new Wt}={}){super(v);this.target=this.pathUtils.normalize(e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.target)}resolve(e){return this.pathUtils.isAbsolute(e)?v.normalize(e):this.baseFs.resolve(v.join(this.target,e))}mapFromBase(e){return e}mapToBase(e){return this.pathUtils.isAbsolute(e)?e:this.pathUtils.join(this.target,e)}};var vO=Se.root,Zo=class extends fi{constructor(e,{baseFs:r=new Wt}={}){super(v);this.target=this.pathUtils.resolve(Se.root,e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.pathUtils.relative(Se.root,this.target))}getTarget(){return this.target}getBaseFs(){return this.baseFs}mapToBase(e){let r=this.pathUtils.normalize(e);if(this.pathUtils.isAbsolute(e))return this.pathUtils.resolve(this.target,this.pathUtils.relative(vO,e));if(r.match(/^\.\.\/?/))throw new Error(`Resolving this path (${e}) would escape the jail`);return this.pathUtils.resolve(this.target,e)}mapFromBase(e){return this.pathUtils.resolve(vO,this.pathUtils.relative(this.target,e))}};var oh=class extends fi{constructor(e,r){super(r);this.instance=null;this.factory=e}get baseFs(){return this.instance||(this.instance=this.factory()),this.instance}set baseFs(e){this.instance=e}mapFromBase(e){return e}mapToBase(e){return e}};var ze=()=>Object.assign(new Error("ENOSYS: unsupported filesystem access"),{code:"ENOSYS"}),gb=class extends eA{constructor(){super(v)}getExtractHint(){throw ze()}getRealPath(){throw ze()}resolve(){throw ze()}async openPromise(){throw ze()}openSync(){throw ze()}async opendirPromise(){throw ze()}opendirSync(){throw ze()}async readPromise(){throw ze()}readSync(){throw ze()}async writePromise(){throw ze()}writeSync(){throw ze()}async closePromise(){throw ze()}closeSync(){throw ze()}createWriteStream(){throw ze()}createReadStream(){throw ze()}async realpathPromise(){throw ze()}realpathSync(){throw ze()}async readdirPromise(){throw ze()}readdirSync(){throw ze()}async existsPromise(e){throw ze()}existsSync(e){throw ze()}async accessPromise(){throw ze()}accessSync(){throw ze()}async statPromise(){throw ze()}statSync(){throw ze()}async fstatPromise(e){throw ze()}fstatSync(e){throw ze()}async lstatPromise(e){throw ze()}lstatSync(e){throw ze()}async chmodPromise(){throw ze()}chmodSync(){throw ze()}async chownPromise(){throw ze()}chownSync(){throw ze()}async mkdirPromise(){throw ze()}mkdirSync(){throw ze()}async rmdirPromise(){throw ze()}rmdirSync(){throw ze()}async linkPromise(){throw ze()}linkSync(){throw ze()}async symlinkPromise(){throw ze()}symlinkSync(){throw ze()}async renamePromise(){throw ze()}renameSync(){throw ze()}async copyFilePromise(){throw ze()}copyFileSync(){throw ze()}async appendFilePromise(){throw ze()}appendFileSync(){throw ze()}async writeFilePromise(){throw ze()}writeFileSync(){throw ze()}async unlinkPromise(){throw ze()}unlinkSync(){throw ze()}async utimesPromise(){throw ze()}utimesSync(){throw ze()}async readFilePromise(){throw ze()}readFileSync(){throw ze()}async readlinkPromise(){throw ze()}readlinkSync(){throw ze()}async truncatePromise(){throw ze()}truncateSync(){throw ze()}watch(){throw ze()}watchFile(){throw ze()}unwatchFile(){throw ze()}},bI=gb;bI.instance=new gb;var ah=class extends fi{constructor(e){super(M);this.baseFs=e}mapFromBase(e){return M.fromPortablePath(e)}mapToBase(e){return M.toPortablePath(e)}};var nhe=/^[0-9]+$/,fb=/^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/,she=/^([^/]+-)?[a-f0-9]+$/,Pr=class extends fi{static makeVirtualPath(e,r,i){if(v.basename(e)!=="__virtual__")throw new Error('Assertion failed: Virtual folders must be named "__virtual__"');if(!v.basename(r).match(she))throw new Error("Assertion failed: Virtual components must be ended by an hexadecimal hash");let s=v.relative(v.dirname(e),i).split("/"),o=0;for(;o{let r=t.indexOf(e);if(r<=0)return null;let i=r;for(;r>=0&&(i=r+e.length,t[i]!==v.sep);){if(t[r-1]===v.sep)return null;r=t.indexOf(e,i)}return t.length>i&&t[i]!==v.sep?null:t.slice(0,i)},Jn=class extends gl{constructor({libzip:e,baseFs:r=new Wt,filter:i=null,maxOpenFiles:n=Infinity,readOnlyArchives:s=!1,useCache:o=!0,maxAge:a=5e3,fileExtensions:l=null}){super();this.fdMap=new Map;this.nextFd=3;this.isZip=new Set;this.notZip=new Set;this.realPaths=new Map;this.limitOpenFilesTimeout=null;this.libzipFactory=typeof e!="function"?()=>e:e,this.baseFs=r,this.zipInstances=o?new Map:null,this.filter=i,this.maxOpenFiles=n,this.readOnlyArchives=s,this.maxAge=a,this.fileExtensions=l}static async openPromise(e,r){let i=new Jn(r);try{return await e(i)}finally{i.saveAndClose()}}get libzip(){return typeof this.libzipInstance=="undefined"&&(this.libzipInstance=this.libzipFactory()),this.libzipInstance}getExtractHint(e){return this.baseFs.getExtractHint(e)}getRealPath(){return this.baseFs.getRealPath()}saveAndClose(){if(sh(this),this.zipInstances)for(let[e,{zipFs:r}]of this.zipInstances.entries())r.saveAndClose(),this.zipInstances.delete(e)}discardAndClose(){if(sh(this),this.zipInstances)for(let[e,{zipFs:r}]of this.zipInstances.entries())r.discardAndClose(),this.zipInstances.delete(e)}resolve(e){return this.baseFs.resolve(e)}remapFd(e,r){let i=this.nextFd++|$o;return this.fdMap.set(i,[e,r]),i}async openPromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.openPromise(e,r,i),async(n,{subPath:s})=>this.remapFd(n,await n.openPromise(s,r,i)))}openSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.openSync(e,r,i),(n,{subPath:s})=>this.remapFd(n,n.openSync(s,r,i)))}async opendirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.opendirPromise(e,r),async(i,{subPath:n})=>await i.opendirPromise(n,r),{requireSubpath:!1})}opendirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.opendirSync(e,r),(i,{subPath:n})=>i.opendirSync(n,r),{requireSubpath:!1})}async readPromise(e,r,i,n,s){if((e&$o)==0)return await this.baseFs.readPromise(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Hi("read");let[a,l]=o;return await a.readPromise(l,r,i,n,s)}readSync(e,r,i,n,s){if((e&$o)==0)return this.baseFs.readSync(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Hi("readSync");let[a,l]=o;return a.readSync(l,r,i,n,s)}async writePromise(e,r,i,n,s){if((e&$o)==0)return typeof r=="string"?await this.baseFs.writePromise(e,r,i):await this.baseFs.writePromise(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Hi("write");let[a,l]=o;return typeof r=="string"?await a.writePromise(l,r,i):await a.writePromise(l,r,i,n,s)}writeSync(e,r,i,n,s){if((e&$o)==0)return typeof r=="string"?this.baseFs.writeSync(e,r,i):this.baseFs.writeSync(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Hi("writeSync");let[a,l]=o;return typeof r=="string"?a.writeSync(l,r,i):a.writeSync(l,r,i,n,s)}async closePromise(e){if((e&$o)==0)return await this.baseFs.closePromise(e);let r=this.fdMap.get(e);if(typeof r=="undefined")throw Hi("close");this.fdMap.delete(e);let[i,n]=r;return await i.closePromise(n)}closeSync(e){if((e&$o)==0)return this.baseFs.closeSync(e);let r=this.fdMap.get(e);if(typeof r=="undefined")throw Hi("closeSync");this.fdMap.delete(e);let[i,n]=r;return i.closeSync(n)}createReadStream(e,r){return e===null?this.baseFs.createReadStream(e,r):this.makeCallSync(e,()=>this.baseFs.createReadStream(e,r),(i,{subPath:n})=>i.createReadStream(n,r))}createWriteStream(e,r){return e===null?this.baseFs.createWriteStream(e,r):this.makeCallSync(e,()=>this.baseFs.createWriteStream(e,r),(i,{subPath:n})=>i.createWriteStream(n,r))}async realpathPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.realpathPromise(e),async(r,{archivePath:i,subPath:n})=>{let s=this.realPaths.get(i);return typeof s=="undefined"&&(s=await this.baseFs.realpathPromise(i),this.realPaths.set(i,s)),this.pathUtils.join(s,this.pathUtils.relative(Se.root,await r.realpathPromise(n)))})}realpathSync(e){return this.makeCallSync(e,()=>this.baseFs.realpathSync(e),(r,{archivePath:i,subPath:n})=>{let s=this.realPaths.get(i);return typeof s=="undefined"&&(s=this.baseFs.realpathSync(i),this.realPaths.set(i,s)),this.pathUtils.join(s,this.pathUtils.relative(Se.root,r.realpathSync(n)))})}async existsPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.existsPromise(e),async(r,{subPath:i})=>await r.existsPromise(i))}existsSync(e){return this.makeCallSync(e,()=>this.baseFs.existsSync(e),(r,{subPath:i})=>r.existsSync(i))}async accessPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.accessPromise(e,r),async(i,{subPath:n})=>await i.accessPromise(n,r))}accessSync(e,r){return this.makeCallSync(e,()=>this.baseFs.accessSync(e,r),(i,{subPath:n})=>i.accessSync(n,r))}async statPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.statPromise(e,r),async(i,{subPath:n})=>await i.statPromise(n,r))}statSync(e,r){return this.makeCallSync(e,()=>this.baseFs.statSync(e,r),(i,{subPath:n})=>i.statSync(n,r))}async fstatPromise(e,r){if((e&$o)==0)return this.baseFs.fstatPromise(e,r);let i=this.fdMap.get(e);if(typeof i=="undefined")throw Hi("fstat");let[n,s]=i;return n.fstatPromise(s,r)}fstatSync(e,r){if((e&$o)==0)return this.baseFs.fstatSync(e,r);let i=this.fdMap.get(e);if(typeof i=="undefined")throw Hi("fstatSync");let[n,s]=i;return n.fstatSync(s,r)}async lstatPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.lstatPromise(e,r),async(i,{subPath:n})=>await i.lstatPromise(n,r))}lstatSync(e,r){return this.makeCallSync(e,()=>this.baseFs.lstatSync(e,r),(i,{subPath:n})=>i.lstatSync(n,r))}async chmodPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.chmodPromise(e,r),async(i,{subPath:n})=>await i.chmodPromise(n,r))}chmodSync(e,r){return this.makeCallSync(e,()=>this.baseFs.chmodSync(e,r),(i,{subPath:n})=>i.chmodSync(n,r))}async chownPromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.chownPromise(e,r,i),async(n,{subPath:s})=>await n.chownPromise(s,r,i))}chownSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.chownSync(e,r,i),(n,{subPath:s})=>n.chownSync(s,r,i))}async renamePromise(e,r){return await this.makeCallPromise(e,async()=>await this.makeCallPromise(r,async()=>await this.baseFs.renamePromise(e,r),async()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})}),async(i,{subPath:n})=>await this.makeCallPromise(r,async()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})},async(s,{subPath:o})=>{if(i!==s)throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"});return await i.renamePromise(n,o)}))}renameSync(e,r){return this.makeCallSync(e,()=>this.makeCallSync(r,()=>this.baseFs.renameSync(e,r),()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})}),(i,{subPath:n})=>this.makeCallSync(r,()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})},(s,{subPath:o})=>{if(i!==s)throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"});return i.renameSync(n,o)}))}async copyFilePromise(e,r,i=0){let n=async(s,o,a,l)=>{if((i&Ah.constants.COPYFILE_FICLONE_FORCE)!=0)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${o}' -> ${l}'`),{code:"EXDEV"});if(i&Ah.constants.COPYFILE_EXCL&&await this.existsPromise(o))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${o}' -> '${l}'`),{code:"EEXIST"});let c;try{c=await s.readFilePromise(o)}catch(u){throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${o}' -> '${l}'`),{code:"EINVAL"})}await a.writeFilePromise(l,c)};return await this.makeCallPromise(e,async()=>await this.makeCallPromise(r,async()=>await this.baseFs.copyFilePromise(e,r,i),async(s,{subPath:o})=>await n(this.baseFs,e,s,o)),async(s,{subPath:o})=>await this.makeCallPromise(r,async()=>await n(s,o,this.baseFs,r),async(a,{subPath:l})=>s!==a?await n(s,o,a,l):await s.copyFilePromise(o,l,i)))}copyFileSync(e,r,i=0){let n=(s,o,a,l)=>{if((i&Ah.constants.COPYFILE_FICLONE_FORCE)!=0)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${o}' -> ${l}'`),{code:"EXDEV"});if(i&Ah.constants.COPYFILE_EXCL&&this.existsSync(o))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${o}' -> '${l}'`),{code:"EEXIST"});let c;try{c=s.readFileSync(o)}catch(u){throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${o}' -> '${l}'`),{code:"EINVAL"})}a.writeFileSync(l,c)};return this.makeCallSync(e,()=>this.makeCallSync(r,()=>this.baseFs.copyFileSync(e,r,i),(s,{subPath:o})=>n(this.baseFs,e,s,o)),(s,{subPath:o})=>this.makeCallSync(r,()=>n(s,o,this.baseFs,r),(a,{subPath:l})=>s!==a?n(s,o,a,l):s.copyFileSync(o,l,i)))}async appendFilePromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.appendFilePromise(e,r,i),async(n,{subPath:s})=>await n.appendFilePromise(s,r,i))}appendFileSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.appendFileSync(e,r,i),(n,{subPath:s})=>n.appendFileSync(s,r,i))}async writeFilePromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.writeFilePromise(e,r,i),async(n,{subPath:s})=>await n.writeFilePromise(s,r,i))}writeFileSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.writeFileSync(e,r,i),(n,{subPath:s})=>n.writeFileSync(s,r,i))}async unlinkPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.unlinkPromise(e),async(r,{subPath:i})=>await r.unlinkPromise(i))}unlinkSync(e){return this.makeCallSync(e,()=>this.baseFs.unlinkSync(e),(r,{subPath:i})=>r.unlinkSync(i))}async utimesPromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.utimesPromise(e,r,i),async(n,{subPath:s})=>await n.utimesPromise(s,r,i))}utimesSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.utimesSync(e,r,i),(n,{subPath:s})=>n.utimesSync(s,r,i))}async mkdirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.mkdirPromise(e,r),async(i,{subPath:n})=>await i.mkdirPromise(n,r))}mkdirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.mkdirSync(e,r),(i,{subPath:n})=>i.mkdirSync(n,r))}async rmdirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.rmdirPromise(e,r),async(i,{subPath:n})=>await i.rmdirPromise(n,r))}rmdirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.rmdirSync(e,r),(i,{subPath:n})=>i.rmdirSync(n,r))}async linkPromise(e,r){return await this.makeCallPromise(r,async()=>await this.baseFs.linkPromise(e,r),async(i,{subPath:n})=>await i.linkPromise(e,n))}linkSync(e,r){return this.makeCallSync(r,()=>this.baseFs.linkSync(e,r),(i,{subPath:n})=>i.linkSync(e,n))}async symlinkPromise(e,r,i){return await this.makeCallPromise(r,async()=>await this.baseFs.symlinkPromise(e,r,i),async(n,{subPath:s})=>await n.symlinkPromise(e,s))}symlinkSync(e,r,i){return this.makeCallSync(r,()=>this.baseFs.symlinkSync(e,r,i),(n,{subPath:s})=>n.symlinkSync(e,s))}async readFilePromise(e,r){return this.makeCallPromise(e,async()=>{switch(r){case"utf8":return await this.baseFs.readFilePromise(e,r);default:return await this.baseFs.readFilePromise(e,r)}},async(i,{subPath:n})=>await i.readFilePromise(n,r))}readFileSync(e,r){return this.makeCallSync(e,()=>{switch(r){case"utf8":return this.baseFs.readFileSync(e,r);default:return this.baseFs.readFileSync(e,r)}},(i,{subPath:n})=>i.readFileSync(n,r))}async readdirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.readdirPromise(e,r),async(i,{subPath:n})=>await i.readdirPromise(n,r),{requireSubpath:!1})}readdirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.readdirSync(e,r),(i,{subPath:n})=>i.readdirSync(n,r),{requireSubpath:!1})}async readlinkPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.readlinkPromise(e),async(r,{subPath:i})=>await r.readlinkPromise(i))}readlinkSync(e){return this.makeCallSync(e,()=>this.baseFs.readlinkSync(e),(r,{subPath:i})=>r.readlinkSync(i))}async truncatePromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.truncatePromise(e,r),async(i,{subPath:n})=>await i.truncatePromise(n,r))}truncateSync(e,r){return this.makeCallSync(e,()=>this.baseFs.truncateSync(e,r),(i,{subPath:n})=>i.truncateSync(n,r))}watch(e,r,i){return this.makeCallSync(e,()=>this.baseFs.watch(e,r,i),(n,{subPath:s})=>n.watch(s,r,i))}watchFile(e,r,i){return this.makeCallSync(e,()=>this.baseFs.watchFile(e,r,i),()=>QI(this,e,r,i))}unwatchFile(e,r){return this.makeCallSync(e,()=>this.baseFs.unwatchFile(e,r),()=>nh(this,e,r))}async makeCallPromise(e,r,i,{requireSubpath:n=!0}={}){if(typeof e!="string")return await r();let s=this.resolve(e),o=this.findZip(s);return o?n&&o.subPath==="/"?await r():await this.getZipPromise(o.archivePath,async a=>await i(a,o)):await r()}makeCallSync(e,r,i,{requireSubpath:n=!0}={}){if(typeof e!="string")return r();let s=this.resolve(e),o=this.findZip(s);return!o||n&&o.subPath==="/"?r():this.getZipSync(o.archivePath,a=>i(a,o))}findZip(e){if(this.filter&&!this.filter.test(e))return null;let r="";for(;;){let i=e.substr(r.length),n;if(!this.fileExtensions)n=SO(i,".zip");else for(let s of this.fileExtensions)if(n=SO(i,s),n)break;if(!n)return null;if(r=this.pathUtils.join(r,n),this.isZip.has(r)===!1){if(this.notZip.has(r))continue;try{if(!this.baseFs.lstatSync(r).isFile()){this.notZip.add(r);continue}}catch{return null}this.isZip.add(r)}return{archivePath:r,subPath:this.pathUtils.join(Se.root,e.substr(r.length))}}}limitOpenFiles(e){if(this.zipInstances===null)return;let r=Date.now(),i=r+this.maxAge,n=e===null?0:this.zipInstances.size-e;for(let[s,{zipFs:o,expiresAt:a,refCount:l}]of this.zipInstances.entries())if(!(l!==0||o.hasOpenFileHandles())){if(r>=a){o.saveAndClose(),this.zipInstances.delete(s),n-=1;continue}else if(e===null||n<=0){i=a;break}o.saveAndClose(),this.zipInstances.delete(s),n-=1}this.limitOpenFilesTimeout===null&&(e===null&&this.zipInstances.size>0||e!==null)&&(this.limitOpenFilesTimeout=setTimeout(()=>{this.limitOpenFilesTimeout=null,this.limitOpenFiles(null)},i-r).unref())}async getZipPromise(e,r){let i=async()=>({baseFs:this.baseFs,libzip:this.libzip,readOnly:this.readOnlyArchives,stats:await this.baseFs.statPromise(e)});if(this.zipInstances){let n=this.zipInstances.get(e);if(!n){let s=await i();n=this.zipInstances.get(e),n||(n={zipFs:new Jr(e,s),expiresAt:0,refCount:0})}this.zipInstances.delete(e),this.limitOpenFiles(this.maxOpenFiles-1),this.zipInstances.set(e,n),n.expiresAt=Date.now()+this.maxAge,n.refCount+=1;try{return await r(n.zipFs)}finally{n.refCount-=1}}else{let n=new Jr(e,await i());try{return await r(n)}finally{n.saveAndClose()}}}getZipSync(e,r){let i=()=>({baseFs:this.baseFs,libzip:this.libzip,readOnly:this.readOnlyArchives,stats:this.baseFs.statSync(e)});if(this.zipInstances){let n=this.zipInstances.get(e);return n||(n={zipFs:new Jr(e,i()),expiresAt:0,refCount:0}),this.zipInstances.delete(e),this.limitOpenFiles(this.maxOpenFiles-1),this.zipInstances.set(e,n),n.expiresAt=Date.now()+this.maxAge,r(n.zipFs)}else{let n=new Jr(e,i());try{return r(n)}finally{n.saveAndClose()}}}};var lh=ie(require("util"));var vI=ie(require("url"));var hb=class extends fi{constructor(e){super(M);this.baseFs=e}mapFromBase(e){return e}mapToBase(e){return e instanceof vI.URL?(0,vI.fileURLToPath)(e):e}};var ohe=new Set(["accessSync","appendFileSync","createReadStream","createWriteStream","chmodSync","chownSync","closeSync","copyFileSync","linkSync","lstatSync","fstatSync","lutimesSync","mkdirSync","openSync","opendirSync","readSync","readlinkSync","readFileSync","readdirSync","readlinkSync","realpathSync","renameSync","rmdirSync","statSync","symlinkSync","truncateSync","unlinkSync","unwatchFile","utimesSync","watch","watchFile","writeFileSync","writeSync"]),xO=new Set(["accessPromise","appendFilePromise","chmodPromise","chownPromise","closePromise","copyFilePromise","linkPromise","fstatPromise","lstatPromise","lutimesPromise","mkdirPromise","openPromise","opendirPromise","readdirPromise","realpathPromise","readFilePromise","readdirPromise","readlinkPromise","renamePromise","rmdirPromise","statPromise","symlinkPromise","truncatePromise","unlinkPromise","utimesPromise","writeFilePromise","writeSync"]),ahe=new Set(["appendFilePromise","chmodPromise","chownPromise","closePromise","readPromise","readFilePromise","statPromise","truncatePromise","utimesPromise","writePromise","writeFilePromise"]);function pb(t,e){e=new hb(e);let r=(i,n,s)=>{let o=i[n];i[n]=s,typeof(o==null?void 0:o[lh.promisify.custom])!="undefined"&&(s[lh.promisify.custom]=o[lh.promisify.custom])};{r(t,"exists",(i,...n)=>{let o=typeof n[n.length-1]=="function"?n.pop():()=>{};process.nextTick(()=>{e.existsPromise(i).then(a=>{o(a)},()=>{o(!1)})})}),r(t,"read",(i,n,...s)=>{let a=typeof s[s.length-1]=="function"?s.pop():()=>{};process.nextTick(()=>{e.readPromise(i,n,...s).then(l=>{a(null,l,n)},l=>{a(l,0,n)})})});for(let i of xO){let n=i.replace(/Promise$/,"");if(typeof t[n]=="undefined")continue;let s=e[i];if(typeof s=="undefined")continue;r(t,n,(...a)=>{let c=typeof a[a.length-1]=="function"?a.pop():()=>{};process.nextTick(()=>{s.apply(e,a).then(u=>{c(null,u)},u=>{c(u)})})})}t.realpath.native=t.realpath}{r(t,"existsSync",i=>{try{return e.existsSync(i)}catch(n){return!1}});for(let i of ohe){let n=i;if(typeof t[n]=="undefined")continue;let s=e[i];typeof s!="undefined"&&r(t,n,s.bind(e))}t.realpathSync.native=t.realpathSync}{let i=process.emitWarning;process.emitWarning=()=>{};let n;try{n=t.promises}finally{process.emitWarning=i}if(typeof n!="undefined"){for(let o of xO){let a=o.replace(/Promise$/,"");if(typeof n[a]=="undefined")continue;let l=e[o];typeof l!="undefined"&&o!=="open"&&r(n,a,l.bind(e))}class s{constructor(a){this.fd=a}}for(let o of ahe){let a=o.replace(/Promise$/,""),l=e[o];typeof l!="undefined"&&r(s.prototype,a,function(...c){return l.call(e,this.fd,...c)})}r(n,"open",async(...o)=>{let a=await e.openPromise(...o);return new s(a)})}}t.read[lh.promisify.custom]=async(i,n,...s)=>({bytesRead:await e.readPromise(i,n,...s),buffer:n})}function SI(t,e){let r=Object.create(t);return pb(r,e),r}var kO=ie(require("os"));function PO(t){let e=M.toPortablePath(kO.default.tmpdir()),r=Math.ceil(Math.random()*4294967296).toString(16).padStart(8,"0");return v.join(e,`${t}${r}`)}var vs=new Set,DO=!1;function RO(){DO||(DO=!0,process.once("exit",()=>{T.rmtempSync()}))}var T=Object.assign(new Wt,{detachTemp(t){vs.delete(t)},mktempSync(t){for(RO();;){let e=PO("xfs-");try{this.mkdirSync(e)}catch(i){if(i.code==="EEXIST")continue;throw i}let r=this.realpathSync(e);if(vs.add(r),typeof t!="undefined")try{return t(r)}finally{if(vs.has(r)){vs.delete(r);try{this.removeSync(r)}catch{}}}else return r}},async mktempPromise(t){for(RO();;){let e=PO("xfs-");try{await this.mkdirPromise(e)}catch(i){if(i.code==="EEXIST")continue;throw i}let r=await this.realpathPromise(e);if(vs.add(r),typeof t!="undefined")try{return await t(r)}finally{if(vs.has(r)){vs.delete(r);try{await this.removePromise(r)}catch{}}}else return r}},async rmtempPromise(){await Promise.all(Array.from(vs.values()).map(async t=>{try{await T.removePromise(t,{maxRetries:0}),vs.delete(t)}catch{}}))},rmtempSync(){for(let t of vs)try{T.removeSync(t),vs.delete(t)}catch{}}});var vb=ie(bb()),Pn;(function(i){i[i.Never=0]="Never",i[i.ErrorCode=1]="ErrorCode",i[i.Always=2]="Always"})(Pn||(Pn={}));function dl(t){return t!==null&&typeof t.fd=="number"}var Cl=new Set;function Sb(){}function xb(){for(let t of Cl)t.kill()}async function to(t,e,{cwd:r,env:i=process.env,strict:n=!1,stdin:s=null,stdout:o,stderr:a,end:l=2}){let c=["pipe","pipe","pipe"];s===null?c[0]="ignore":dl(s)&&(c[0]=s),dl(o)&&(c[1]=o),dl(a)&&(c[2]=a);let u=(0,vb.default)(t,e,{cwd:M.fromPortablePath(r),env:_(P({},i),{PWD:M.fromPortablePath(r)}),stdio:c});Cl.add(u),Cl.size===1&&(process.on("SIGINT",Sb),process.on("SIGTERM",xb)),!dl(s)&&s!==null&&s.pipe(u.stdin),dl(o)||u.stdout.pipe(o,{end:!1}),dl(a)||u.stderr.pipe(a,{end:!1});let g=()=>{for(let f of new Set([o,a]))dl(f)||f.end()};return new Promise((f,h)=>{u.on("error",p=>{Cl.delete(u),Cl.size===0&&(process.off("SIGINT",Sb),process.off("SIGTERM",xb)),(l===2||l===1)&&g(),h(p)}),u.on("close",(p,d)=>{Cl.delete(u),Cl.size===0&&(process.off("SIGINT",Sb),process.off("SIGTERM",xb)),(l===2||l===1&&p>0)&&g(),p===0||!n?f({code:kb(p,d)}):h(p!==null?new Error(`Child "${t}" exited with exit code ${p}`):new Error(`Child "${t}" exited with signal ${d}`))})})}async function Nhe(t,e,{cwd:r,env:i=process.env,encoding:n="utf8",strict:s=!1}){let o=["ignore","pipe","pipe"],a=[],l=[],c=M.fromPortablePath(r);typeof i.PWD!="undefined"&&(i=_(P({},i),{PWD:c}));let u=(0,vb.default)(t,e,{cwd:c,env:i,stdio:o});return u.stdout.on("data",g=>{a.push(g)}),u.stderr.on("data",g=>{l.push(g)}),await new Promise((g,f)=>{u.on("error",()=>{f()}),u.on("close",(h,p)=>{let d=n==="buffer"?Buffer.concat(a):Buffer.concat(a).toString(n),m=n==="buffer"?Buffer.concat(l):Buffer.concat(l).toString(n);h===0||!s?g({code:kb(h,p),stdout:d,stderr:m}):f(Object.assign(new Error(`Child "${t}" exited with exit code ${h} +`}function ul(t,e){return e.replace(/\r?\n/g,rhe(t))}var $c=ie(require("fs")),cb=ie(require("stream")),QO=ie(require("util")),ub=ie(require("zlib"));var yO=ie(require("fs"));var Wt=class extends gl{constructor(e=yO.default){super();this.realFs=e,typeof this.realFs.lutimes!="undefined"&&(this.lutimesPromise=this.lutimesPromiseImpl,this.lutimesSync=this.lutimesSyncImpl)}getExtractHint(){return!1}getRealPath(){return Se.root}resolve(e){return v.resolve(e)}async openPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.open(M.fromPortablePath(e),r,i,this.makeCallback(n,s))})}openSync(e,r,i){return this.realFs.openSync(M.fromPortablePath(e),r,i)}async opendirPromise(e,r){return await new Promise((i,n)=>{typeof r!="undefined"?this.realFs.opendir(M.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.opendir(M.fromPortablePath(e),this.makeCallback(i,n))}).then(i=>Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0}))}opendirSync(e,r){let i=typeof r!="undefined"?this.realFs.opendirSync(M.fromPortablePath(e),r):this.realFs.opendirSync(M.fromPortablePath(e));return Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0})}async readPromise(e,r,i=0,n=0,s=-1){return await new Promise((o,a)=>{this.realFs.read(e,r,i,n,s,(l,c)=>{l?a(l):o(c)})})}readSync(e,r,i,n,s){return this.realFs.readSync(e,r,i,n,s)}async writePromise(e,r,i,n,s){return await new Promise((o,a)=>typeof r=="string"?this.realFs.write(e,r,i,this.makeCallback(o,a)):this.realFs.write(e,r,i,n,s,this.makeCallback(o,a)))}writeSync(e,r,i,n,s){return typeof r=="string"?this.realFs.writeSync(e,r,i):this.realFs.writeSync(e,r,i,n,s)}async closePromise(e){await new Promise((r,i)=>{this.realFs.close(e,this.makeCallback(r,i))})}closeSync(e){this.realFs.closeSync(e)}createReadStream(e,r){let i=e!==null?M.fromPortablePath(e):e;return this.realFs.createReadStream(i,r)}createWriteStream(e,r){let i=e!==null?M.fromPortablePath(e):e;return this.realFs.createWriteStream(i,r)}async realpathPromise(e){return await new Promise((r,i)=>{this.realFs.realpath(M.fromPortablePath(e),{},this.makeCallback(r,i))}).then(r=>M.toPortablePath(r))}realpathSync(e){return M.toPortablePath(this.realFs.realpathSync(M.fromPortablePath(e),{}))}async existsPromise(e){return await new Promise(r=>{this.realFs.exists(M.fromPortablePath(e),r)})}accessSync(e,r){return this.realFs.accessSync(M.fromPortablePath(e),r)}async accessPromise(e,r){return await new Promise((i,n)=>{this.realFs.access(M.fromPortablePath(e),r,this.makeCallback(i,n))})}existsSync(e){return this.realFs.existsSync(M.fromPortablePath(e))}async statPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.stat(M.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.stat(M.fromPortablePath(e),this.makeCallback(i,n))})}statSync(e,r){return r?this.realFs.statSync(M.fromPortablePath(e),r):this.realFs.statSync(M.fromPortablePath(e))}async fstatPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.fstat(e,r,this.makeCallback(i,n)):this.realFs.fstat(e,this.makeCallback(i,n))})}fstatSync(e,r){return r?this.realFs.fstatSync(e,r):this.realFs.fstatSync(e)}async lstatPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.lstat(M.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.lstat(M.fromPortablePath(e),this.makeCallback(i,n))})}lstatSync(e,r){return r?this.realFs.lstatSync(M.fromPortablePath(e),r):this.realFs.lstatSync(M.fromPortablePath(e))}async chmodPromise(e,r){return await new Promise((i,n)=>{this.realFs.chmod(M.fromPortablePath(e),r,this.makeCallback(i,n))})}chmodSync(e,r){return this.realFs.chmodSync(M.fromPortablePath(e),r)}async chownPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.chown(M.fromPortablePath(e),r,i,this.makeCallback(n,s))})}chownSync(e,r,i){return this.realFs.chownSync(M.fromPortablePath(e),r,i)}async renamePromise(e,r){return await new Promise((i,n)=>{this.realFs.rename(M.fromPortablePath(e),M.fromPortablePath(r),this.makeCallback(i,n))})}renameSync(e,r){return this.realFs.renameSync(M.fromPortablePath(e),M.fromPortablePath(r))}async copyFilePromise(e,r,i=0){return await new Promise((n,s)=>{this.realFs.copyFile(M.fromPortablePath(e),M.fromPortablePath(r),i,this.makeCallback(n,s))})}copyFileSync(e,r,i=0){return this.realFs.copyFileSync(M.fromPortablePath(e),M.fromPortablePath(r),i)}async appendFilePromise(e,r,i){return await new Promise((n,s)=>{let o=typeof e=="string"?M.fromPortablePath(e):e;i?this.realFs.appendFile(o,r,i,this.makeCallback(n,s)):this.realFs.appendFile(o,r,this.makeCallback(n,s))})}appendFileSync(e,r,i){let n=typeof e=="string"?M.fromPortablePath(e):e;i?this.realFs.appendFileSync(n,r,i):this.realFs.appendFileSync(n,r)}async writeFilePromise(e,r,i){return await new Promise((n,s)=>{let o=typeof e=="string"?M.fromPortablePath(e):e;i?this.realFs.writeFile(o,r,i,this.makeCallback(n,s)):this.realFs.writeFile(o,r,this.makeCallback(n,s))})}writeFileSync(e,r,i){let n=typeof e=="string"?M.fromPortablePath(e):e;i?this.realFs.writeFileSync(n,r,i):this.realFs.writeFileSync(n,r)}async unlinkPromise(e){return await new Promise((r,i)=>{this.realFs.unlink(M.fromPortablePath(e),this.makeCallback(r,i))})}unlinkSync(e){return this.realFs.unlinkSync(M.fromPortablePath(e))}async utimesPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.utimes(M.fromPortablePath(e),r,i,this.makeCallback(n,s))})}utimesSync(e,r,i){this.realFs.utimesSync(M.fromPortablePath(e),r,i)}async lutimesPromiseImpl(e,r,i){let n=this.realFs.lutimes;if(typeof n=="undefined")throw th("unavailable Node binding",`lutimes '${e}'`);return await new Promise((s,o)=>{n.call(this.realFs,M.fromPortablePath(e),r,i,this.makeCallback(s,o))})}lutimesSyncImpl(e,r,i){let n=this.realFs.lutimesSync;if(typeof n=="undefined")throw th("unavailable Node binding",`lutimes '${e}'`);n.call(this.realFs,M.fromPortablePath(e),r,i)}async mkdirPromise(e,r){return await new Promise((i,n)=>{this.realFs.mkdir(M.fromPortablePath(e),r,this.makeCallback(i,n))})}mkdirSync(e,r){return this.realFs.mkdirSync(M.fromPortablePath(e),r)}async rmdirPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.rmdir(M.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.rmdir(M.fromPortablePath(e),this.makeCallback(i,n))})}rmdirSync(e,r){return this.realFs.rmdirSync(M.fromPortablePath(e),r)}async linkPromise(e,r){return await new Promise((i,n)=>{this.realFs.link(M.fromPortablePath(e),M.fromPortablePath(r),this.makeCallback(i,n))})}linkSync(e,r){return this.realFs.linkSync(M.fromPortablePath(e),M.fromPortablePath(r))}async symlinkPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.symlink(M.fromPortablePath(e.replace(/\/+$/,"")),M.fromPortablePath(r),i,this.makeCallback(n,s))})}symlinkSync(e,r,i){return this.realFs.symlinkSync(M.fromPortablePath(e.replace(/\/+$/,"")),M.fromPortablePath(r),i)}async readFilePromise(e,r){return await new Promise((i,n)=>{let s=typeof e=="string"?M.fromPortablePath(e):e;this.realFs.readFile(s,r,this.makeCallback(i,n))})}readFileSync(e,r){let i=typeof e=="string"?M.fromPortablePath(e):e;return this.realFs.readFileSync(i,r)}async readdirPromise(e,r){return await new Promise((i,n)=>{(r==null?void 0:r.withFileTypes)?this.realFs.readdir(M.fromPortablePath(e),{withFileTypes:!0},this.makeCallback(i,n)):this.realFs.readdir(M.fromPortablePath(e),this.makeCallback(s=>i(s),n))})}readdirSync(e,r){return(r==null?void 0:r.withFileTypes)?this.realFs.readdirSync(M.fromPortablePath(e),{withFileTypes:!0}):this.realFs.readdirSync(M.fromPortablePath(e))}async readlinkPromise(e){return await new Promise((r,i)=>{this.realFs.readlink(M.fromPortablePath(e),this.makeCallback(r,i))}).then(r=>M.toPortablePath(r))}readlinkSync(e){return M.toPortablePath(this.realFs.readlinkSync(M.fromPortablePath(e)))}async truncatePromise(e,r){return await new Promise((i,n)=>{this.realFs.truncate(M.fromPortablePath(e),r,this.makeCallback(i,n))})}truncateSync(e,r){return this.realFs.truncateSync(M.fromPortablePath(e),r)}watch(e,r,i){return this.realFs.watch(M.fromPortablePath(e),r,i)}watchFile(e,r,i){return this.realFs.watchFile(M.fromPortablePath(e),r,i)}unwatchFile(e,r){return this.realFs.unwatchFile(M.fromPortablePath(e),r)}makeCallback(e,r){return(i,n)=>{i?r(i):e(n)}}};var wO=ie(require("events"));var fl;(function(r){r.Change="change",r.Stop="stop"})(fl||(fl={}));var hl;(function(i){i.Ready="ready",i.Running="running",i.Stopped="stopped"})(hl||(hl={}));function BO(t,e){if(t!==e)throw new Error(`Invalid StatWatcher status: expected '${e}', got '${t}'`)}var ih=class extends wO.EventEmitter{constructor(e,r,{bigint:i=!1}={}){super();this.status=hl.Ready;this.changeListeners=new Map;this.startTimeout=null;this.fakeFs=e,this.path=r,this.bigint=i,this.lastStats=this.stat()}static create(e,r,i){let n=new ih(e,r,i);return n.start(),n}start(){BO(this.status,hl.Ready),this.status=hl.Running,this.startTimeout=setTimeout(()=>{this.startTimeout=null,this.fakeFs.existsSync(this.path)||this.emit(fl.Change,this.lastStats,this.lastStats)},3)}stop(){BO(this.status,hl.Running),this.status=hl.Stopped,this.startTimeout!==null&&(clearTimeout(this.startTimeout),this.startTimeout=null),this.emit(fl.Stop)}stat(){try{return this.fakeFs.statSync(this.path,{bigint:this.bigint})}catch(e){let r=this.bigint?new Xf:new Za;return pI(r)}}makeInterval(e){let r=setInterval(()=>{let i=this.stat(),n=this.lastStats;nb(i,n)||(this.lastStats=i,this.emit(fl.Change,i,n))},e.interval);return e.persistent?r:r.unref()}registerChangeListener(e,r){this.addListener(fl.Change,e),this.changeListeners.set(e,this.makeInterval(r))}unregisterChangeListener(e){this.removeListener(fl.Change,e);let r=this.changeListeners.get(e);typeof r!="undefined"&&clearInterval(r),this.changeListeners.delete(e)}unregisterAllChangeListeners(){for(let e of this.changeListeners.keys())this.unregisterChangeListener(e)}hasChangeListeners(){return this.changeListeners.size>0}ref(){for(let e of this.changeListeners.values())e.ref();return this}unref(){for(let e of this.changeListeners.values())e.unref();return this}};var BI=new WeakMap;function QI(t,e,r,i){let n,s,o,a;switch(typeof r){case"function":n=!1,s=!0,o=5007,a=r;break;default:({bigint:n=!1,persistent:s=!0,interval:o=5007}=r),a=i;break}let l=BI.get(t);typeof l=="undefined"&&BI.set(t,l=new Map);let c=l.get(e);return typeof c=="undefined"&&(c=ih.create(t,e,{bigint:n}),l.set(e,c)),c.registerChangeListener(a,{persistent:s,interval:o}),c}function nh(t,e,r){let i=BI.get(t);if(typeof i=="undefined")return;let n=i.get(e);typeof n!="undefined"&&(typeof r=="undefined"?n.unregisterAllChangeListeners():n.unregisterChangeListener(r),n.hasChangeListeners()||(n.stop(),i.delete(e)))}function sh(t){let e=BI.get(t);if(typeof e!="undefined")for(let r of e.keys())nh(t,r)}var pl="mixed";function ihe(t){if(typeof t=="string"&&String(+t)===t)return+t;if(Number.isFinite(t))return t<0?Date.now()/1e3:t;if((0,QO.isDate)(t))return t.getTime()/1e3;throw new Error("Invalid time")}function bO(){return Buffer.from([80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}var Jr=class extends gl{constructor(e,r){super();this.lzSource=null;this.listings=new Map;this.entries=new Map;this.fileSources=new Map;this.fds=new Map;this.nextFd=0;this.ready=!1;this.readOnly=!1;this.libzip=r.libzip;let i=r;if(this.level=typeof i.level!="undefined"?i.level:pl,e!=null||(e=bO()),typeof e=="string"){let{baseFs:o=new Wt}=i;this.baseFs=o,this.path=e}else this.path=null,this.baseFs=null;if(r.stats)this.stats=r.stats;else if(typeof e=="string")try{this.stats=this.baseFs.statSync(e)}catch(o){if(o.code==="ENOENT"&&i.create)this.stats=Zf();else throw o}else this.stats=Zf();let n=this.libzip.malloc(4);try{let o=0;if(typeof e=="string"&&i.create&&(o|=this.libzip.ZIP_CREATE|this.libzip.ZIP_TRUNCATE),r.readOnly&&(o|=this.libzip.ZIP_RDONLY,this.readOnly=!0),typeof e=="string")this.zip=this.libzip.open(M.fromPortablePath(e),o,n);else{let a=this.allocateUnattachedSource(e);try{this.zip=this.libzip.openFromSource(a,o,n),this.lzSource=a}catch(l){throw this.libzip.source.free(a),l}}if(this.zip===0){let a=this.libzip.struct.errorS();throw this.libzip.error.initWithCode(a,this.libzip.getValue(n,"i32")),this.makeLibzipError(a)}}finally{this.libzip.free(n)}this.listings.set(Se.root,new Set);let s=this.libzip.getNumEntries(this.zip,0);for(let o=0;oe)throw new Error("Overread");let n=this.libzip.HEAPU8.subarray(r,r+e);return Buffer.from(n)}finally{this.libzip.free(r)}}finally{this.libzip.source.close(this.lzSource),this.libzip.source.free(this.lzSource),this.ready=!1}}prepareClose(){if(!this.ready)throw EI("archive closed, close");sh(this)}saveAndClose(){if(!this.path||!this.baseFs)throw new Error("ZipFS cannot be saved and must be discarded when loaded from a buffer");if(this.prepareClose(),this.readOnly){this.discardAndClose();return}let e=this.baseFs.existsSync(this.path)||this.stats.mode===_f?void 0:this.stats.mode;if(this.entries.size===0)this.discardAndClose(),this.baseFs.writeFileSync(this.path,bO(),{mode:e});else{if(this.libzip.close(this.zip)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));typeof e!="undefined"&&this.baseFs.chmodSync(this.path,e)}this.ready=!1}discardAndClose(){this.prepareClose(),this.libzip.discard(this.zip),this.ready=!1}resolve(e){return v.resolve(Se.root,e)}async openPromise(e,r,i){return this.openSync(e,r,i)}openSync(e,r,i){let n=this.nextFd++;return this.fds.set(n,{cursor:0,p:e}),n}hasOpenFileHandles(){return!!this.fds.size}async opendirPromise(e,r){return this.opendirSync(e,r)}opendirSync(e,r={}){let i=this.resolveFilename(`opendir '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`opendir '${e}'`);let n=this.listings.get(i);if(!n)throw eo(`opendir '${e}'`);let s=[...n],o=this.openSync(i,"r");return wI(this,i,s,{onClose:()=>{this.closeSync(o)}})}async readPromise(e,r,i,n,s){return this.readSync(e,r,i,n,s)}readSync(e,r,i=0,n=r.byteLength,s=-1){let o=this.fds.get(e);if(typeof o=="undefined")throw Hi("read");let a;s===-1||s===null?a=o.cursor:a=s;let l=this.readFileSync(o.p);l.copy(r,i,a,a+n);let c=Math.max(0,Math.min(l.length-a,n));return(s===-1||s===null)&&(o.cursor+=c),c}async writePromise(e,r,i,n,s){return typeof r=="string"?this.writeSync(e,r,s):this.writeSync(e,r,i,n,s)}writeSync(e,r,i,n,s){throw typeof this.fds.get(e)=="undefined"?Hi("read"):new Error("Unimplemented")}async closePromise(e){return this.closeSync(e)}closeSync(e){if(typeof this.fds.get(e)=="undefined")throw Hi("read");this.fds.delete(e)}createReadStream(e,{encoding:r}={}){if(e===null)throw new Error("Unimplemented");let i=this.openSync(e,"r"),n=Object.assign(new cb.PassThrough({emitClose:!0,autoDestroy:!0,destroy:(o,a)=>{clearImmediate(s),this.closeSync(i),a(o)}}),{close(){n.destroy()},bytesRead:0,path:e}),s=setImmediate(async()=>{try{let o=await this.readFilePromise(e,r);n.bytesRead=o.length,n.end(o)}catch(o){n.destroy(o)}});return n}createWriteStream(e,{encoding:r}={}){if(this.readOnly)throw ln(`open '${e}'`);if(e===null)throw new Error("Unimplemented");let i=[],n=this.openSync(e,"w"),s=Object.assign(new cb.PassThrough({autoDestroy:!0,emitClose:!0,destroy:(o,a)=>{try{o?a(o):(this.writeFileSync(e,Buffer.concat(i),r),a(null))}catch(l){a(l)}finally{this.closeSync(n)}}}),{bytesWritten:0,path:e,close(){s.destroy()}});return s.on("data",o=>{let a=Buffer.from(o);s.bytesWritten+=a.length,i.push(a)}),s}async realpathPromise(e){return this.realpathSync(e)}realpathSync(e){let r=this.resolveFilename(`lstat '${e}'`,e);if(!this.entries.has(r)&&!this.listings.has(r))throw bs(`lstat '${e}'`);return r}async existsPromise(e){return this.existsSync(e)}existsSync(e){if(!this.ready)throw EI(`archive closed, existsSync '${e}'`);if(this.symlinkCount===0){let i=v.resolve(Se.root,e);return this.entries.has(i)||this.listings.has(i)}let r;try{r=this.resolveFilename(`stat '${e}'`,e)}catch(i){return!1}return this.entries.has(r)||this.listings.has(r)}async accessPromise(e,r){return this.accessSync(e,r)}accessSync(e,r=$c.constants.F_OK){let i=this.resolveFilename(`access '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`access '${e}'`);if(this.readOnly&&r&$c.constants.W_OK)throw ln(`access '${e}'`)}async statPromise(e,r){return this.statSync(e,r)}statSync(e,r){let i=this.resolveFilename(`stat '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`stat '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(i))throw eo(`stat '${e}'`);return this.statImpl(`stat '${e}'`,i,r)}async fstatPromise(e,r){return this.fstatSync(e,r)}fstatSync(e,r){let i=this.fds.get(e);if(typeof i=="undefined")throw Hi("fstatSync");let{p:n}=i,s=this.resolveFilename(`stat '${n}'`,n);if(!this.entries.has(s)&&!this.listings.has(s))throw bs(`stat '${n}'`);if(n[n.length-1]==="/"&&!this.listings.has(s))throw eo(`stat '${n}'`);return this.statImpl(`fstat '${n}'`,s,r)}async lstatPromise(e,r){return this.lstatSync(e,r)}lstatSync(e,r){let i=this.resolveFilename(`lstat '${e}'`,e,!1);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`lstat '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(i))throw eo(`lstat '${e}'`);return this.statImpl(`lstat '${e}'`,i,r)}statImpl(e,r,i={}){let n=this.entries.get(r);if(typeof n!="undefined"){let s=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,n,0,0,s)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let a=this.stats.uid,l=this.stats.gid,c=this.libzip.struct.statSize(s)>>>0,u=512,g=Math.ceil(c/u),f=(this.libzip.struct.statMtime(s)>>>0)*1e3,h=f,p=f,d=f,m=new Date(h),E=new Date(p),B=new Date(d),b=new Date(f),R=this.listings.has(r)?zo:this.isSymbolicLink(n)?_o:Vo,H=R===zo?493:420,L=R|this.getUnixMode(n,H)&511,K=this.libzip.struct.statCrc(s),J=Object.assign(new Za,{uid:a,gid:l,size:c,blksize:u,blocks:g,atime:m,birthtime:E,ctime:B,mtime:b,atimeMs:h,birthtimeMs:p,ctimeMs:d,mtimeMs:f,mode:L,crc:K});return i.bigint===!0?dI(J):J}if(this.listings.has(r)){let s=this.stats.uid,o=this.stats.gid,a=0,l=512,c=0,u=this.stats.mtimeMs,g=this.stats.mtimeMs,f=this.stats.mtimeMs,h=this.stats.mtimeMs,p=new Date(u),d=new Date(g),m=new Date(f),E=new Date(h),B=zo|493,b=0,R=Object.assign(new Za,{uid:s,gid:o,size:a,blksize:l,blocks:c,atime:p,birthtime:d,ctime:m,mtime:E,atimeMs:u,birthtimeMs:g,ctimeMs:f,mtimeMs:h,mode:B,crc:b});return i.bigint===!0?dI(R):R}throw new Error("Unreachable")}getUnixMode(e,r){if(this.libzip.file.getExternalAttributes(this.zip,e,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.libzip.getValue(this.libzip.uint08S,"i8")>>>0!==this.libzip.ZIP_OPSYS_UNIX?r:this.libzip.getValue(this.libzip.uint32S,"i32")>>>16}registerListing(e){let r=this.listings.get(e);if(r)return r;let i=this.registerListing(v.dirname(e));return r=new Set,i.add(v.basename(e)),this.listings.set(e,r),r}registerEntry(e,r){this.registerListing(v.dirname(e)).add(v.basename(e)),this.entries.set(e,r)}unregisterListing(e){this.listings.delete(e);let r=this.listings.get(v.dirname(e));r==null||r.delete(v.basename(e))}unregisterEntry(e){this.unregisterListing(e);let r=this.entries.get(e);this.entries.delete(e),typeof r!="undefined"&&(this.fileSources.delete(r),this.isSymbolicLink(r)&&this.symlinkCount--)}deleteEntry(e,r){if(this.unregisterEntry(e),this.libzip.delete(this.zip,r)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}resolveFilename(e,r,i=!0){if(!this.ready)throw EI(`archive closed, ${e}`);let n=v.resolve(Se.root,r);if(n==="/")return Se.root;let s=this.entries.get(n);if(i&&s!==void 0)if(this.symlinkCount!==0&&this.isSymbolicLink(s)){let o=this.getFileSource(s).toString();return this.resolveFilename(e,v.resolve(v.dirname(n),o),!0)}else return n;for(;;){let o=this.resolveFilename(e,v.dirname(n),!0),a=this.listings.has(o),l=this.entries.has(o);if(!a&&!l)throw bs(e);if(!a)throw eo(e);if(n=v.resolve(o,v.basename(n)),!i||this.symlinkCount===0)break;let c=this.libzip.name.locate(this.zip,n.slice(1));if(c===-1)break;if(this.isSymbolicLink(c)){let u=this.getFileSource(c).toString();n=v.resolve(v.dirname(n),u)}else break}return n}allocateBuffer(e){Buffer.isBuffer(e)||(e=Buffer.from(e));let r=this.libzip.malloc(e.byteLength);if(!r)throw new Error("Couldn't allocate enough memory");return new Uint8Array(this.libzip.HEAPU8.buffer,r,e.byteLength).set(e),{buffer:r,byteLength:e.byteLength}}allocateUnattachedSource(e){let r=this.libzip.struct.errorS(),{buffer:i,byteLength:n}=this.allocateBuffer(e),s=this.libzip.source.fromUnattachedBuffer(i,n,0,!0,r);if(s===0)throw this.libzip.free(r),this.makeLibzipError(r);return s}allocateSource(e){let{buffer:r,byteLength:i}=this.allocateBuffer(e),n=this.libzip.source.fromBuffer(this.zip,r,i,0,!0);if(n===0)throw this.libzip.free(r),this.makeLibzipError(this.libzip.getError(this.zip));return n}setFileSource(e,r){let i=Buffer.isBuffer(r)?r:Buffer.from(r),n=v.relative(Se.root,e),s=this.allocateSource(r);try{let o=this.libzip.file.add(this.zip,n,s,this.libzip.ZIP_FL_OVERWRITE);if(o===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));if(this.level!=="mixed"){let a;if(this.level===0?a=this.libzip.ZIP_CM_STORE:a=this.libzip.ZIP_CM_DEFLATE,this.libzip.file.setCompression(this.zip,o,0,a,this.level)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}return this.fileSources.set(o,i),o}catch(o){throw this.libzip.source.free(s),o}}isSymbolicLink(e){if(this.symlinkCount===0)return!1;if(this.libzip.file.getExternalAttributes(this.zip,e,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.libzip.getValue(this.libzip.uint08S,"i8")>>>0!==this.libzip.ZIP_OPSYS_UNIX?!1:(this.libzip.getValue(this.libzip.uint32S,"i32")>>>16&kn)===_o}getFileSource(e,r={asyncDecompress:!1}){let i=this.fileSources.get(e);if(typeof i!="undefined")return i;let n=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,e,0,0,n)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let o=this.libzip.struct.statCompSize(n),a=this.libzip.struct.statCompMethod(n),l=this.libzip.malloc(o);try{let c=this.libzip.fopenIndex(this.zip,e,0,this.libzip.ZIP_FL_COMPRESSED);if(c===0)throw this.makeLibzipError(this.libzip.getError(this.zip));try{let u=this.libzip.fread(c,l,o,0);if(u===-1)throw this.makeLibzipError(this.libzip.file.getError(c));if(uo)throw new Error("Overread");let g=this.libzip.HEAPU8.subarray(l,l+o),f=Buffer.from(g);if(a===0)return this.fileSources.set(e,f),f;if(r.asyncDecompress)return new Promise((h,p)=>{ub.default.inflateRaw(f,(d,m)=>{d?p(d):(this.fileSources.set(e,m),h(m))})});{let h=ub.default.inflateRawSync(f);return this.fileSources.set(e,h),h}}finally{this.libzip.fclose(c)}}finally{this.libzip.free(l)}}async chmodPromise(e,r){return this.chmodSync(e,r)}chmodSync(e,r){if(this.readOnly)throw ln(`chmod '${e}'`);r&=493;let i=this.resolveFilename(`chmod '${e}'`,e,!1),n=this.entries.get(i);if(typeof n=="undefined")throw new Error(`Assertion failed: The entry should have been registered (${i})`);let o=this.getUnixMode(n,Vo|0)&~511|r;if(this.libzip.file.setExternalAttributes(this.zip,n,0,0,this.libzip.ZIP_OPSYS_UNIX,o<<16)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}async chownPromise(e,r,i){return this.chownSync(e,r,i)}chownSync(e,r,i){throw new Error("Unimplemented")}async renamePromise(e,r){return this.renameSync(e,r)}renameSync(e,r){throw new Error("Unimplemented")}async copyFilePromise(e,r,i){let{indexSource:n,indexDest:s,resolvedDestP:o}=this.prepareCopyFile(e,r,i),a=await this.getFileSource(n,{asyncDecompress:!0}),l=this.setFileSource(o,a);l!==s&&this.registerEntry(o,l)}copyFileSync(e,r,i=0){let{indexSource:n,indexDest:s,resolvedDestP:o}=this.prepareCopyFile(e,r,i),a=this.getFileSource(n),l=this.setFileSource(o,a);l!==s&&this.registerEntry(o,l)}prepareCopyFile(e,r,i=0){if(this.readOnly)throw ln(`copyfile '${e} -> '${r}'`);if((i&$c.constants.COPYFILE_FICLONE_FORCE)!=0)throw th("unsupported clone operation",`copyfile '${e}' -> ${r}'`);let n=this.resolveFilename(`copyfile '${e} -> ${r}'`,e),s=this.entries.get(n);if(typeof s=="undefined")throw $a(`copyfile '${e}' -> '${r}'`);let o=this.resolveFilename(`copyfile '${e}' -> ${r}'`,r),a=this.entries.get(o);if((i&($c.constants.COPYFILE_EXCL|$c.constants.COPYFILE_FICLONE_FORCE))!=0&&typeof a!="undefined")throw yI(`copyfile '${e}' -> '${r}'`);return{indexSource:s,resolvedDestP:o,indexDest:a}}async appendFilePromise(e,r,i){if(this.readOnly)throw ln(`open '${e}'`);return typeof i=="undefined"?i={flag:"a"}:typeof i=="string"?i={flag:"a",encoding:i}:typeof i.flag=="undefined"&&(i=P({flag:"a"},i)),this.writeFilePromise(e,r,i)}appendFileSync(e,r,i={}){if(this.readOnly)throw ln(`open '${e}'`);return typeof i=="undefined"?i={flag:"a"}:typeof i=="string"?i={flag:"a",encoding:i}:typeof i.flag=="undefined"&&(i=P({flag:"a"},i)),this.writeFileSync(e,r,i)}fdToPath(e,r){var n;let i=(n=this.fds.get(e))==null?void 0:n.p;if(typeof i=="undefined")throw Hi(r);return i}async writeFilePromise(e,r,i){let{encoding:n,mode:s,index:o,resolvedP:a}=this.prepareWriteFile(e,i);o!==void 0&&typeof i=="object"&&i.flag&&i.flag.includes("a")&&(r=Buffer.concat([await this.getFileSource(o,{asyncDecompress:!0}),Buffer.from(r)])),n!==null&&(r=r.toString(n));let l=this.setFileSource(a,r);l!==o&&this.registerEntry(a,l),s!==null&&await this.chmodPromise(a,s)}writeFileSync(e,r,i){let{encoding:n,mode:s,index:o,resolvedP:a}=this.prepareWriteFile(e,i);o!==void 0&&typeof i=="object"&&i.flag&&i.flag.includes("a")&&(r=Buffer.concat([this.getFileSource(o),Buffer.from(r)])),n!==null&&(r=r.toString(n));let l=this.setFileSource(a,r);l!==o&&this.registerEntry(a,l),s!==null&&this.chmodSync(a,s)}prepareWriteFile(e,r){if(typeof e=="number"&&(e=this.fdToPath(e,"read")),this.readOnly)throw ln(`open '${e}'`);let i=this.resolveFilename(`open '${e}'`,e);if(this.listings.has(i))throw rh(`open '${e}'`);let n=null,s=null;typeof r=="string"?n=r:typeof r=="object"&&({encoding:n=null,mode:s=null}=r);let o=this.entries.get(i);return{encoding:n,mode:s,resolvedP:i,index:o}}async unlinkPromise(e){return this.unlinkSync(e)}unlinkSync(e){if(this.readOnly)throw ln(`unlink '${e}'`);let r=this.resolveFilename(`unlink '${e}'`,e);if(this.listings.has(r))throw rh(`unlink '${e}'`);let i=this.entries.get(r);if(typeof i=="undefined")throw $a(`unlink '${e}'`);this.deleteEntry(r,i)}async utimesPromise(e,r,i){return this.utimesSync(e,r,i)}utimesSync(e,r,i){if(this.readOnly)throw ln(`utimes '${e}'`);let n=this.resolveFilename(`utimes '${e}'`,e);this.utimesImpl(n,i)}async lutimesPromise(e,r,i){return this.lutimesSync(e,r,i)}lutimesSync(e,r,i){if(this.readOnly)throw ln(`lutimes '${e}'`);let n=this.resolveFilename(`utimes '${e}'`,e,!1);this.utimesImpl(n,i)}utimesImpl(e,r){this.listings.has(e)&&(this.entries.has(e)||this.hydrateDirectory(e));let i=this.entries.get(e);if(i===void 0)throw new Error("Unreachable");if(this.libzip.file.setMtime(this.zip,i,0,ihe(r),0)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}async mkdirPromise(e,r){return this.mkdirSync(e,r)}mkdirSync(e,{mode:r=493,recursive:i=!1}={}){if(i){this.mkdirpSync(e,{chmod:r});return}if(this.readOnly)throw ln(`mkdir '${e}'`);let n=this.resolveFilename(`mkdir '${e}'`,e);if(this.entries.has(n)||this.listings.has(n))throw yI(`mkdir '${e}'`);this.hydrateDirectory(n),this.chmodSync(n,r)}async rmdirPromise(e,r){return this.rmdirSync(e,r)}rmdirSync(e,{recursive:r=!1}={}){if(this.readOnly)throw ln(`rmdir '${e}'`);if(r){this.removeSync(e);return}let i=this.resolveFilename(`rmdir '${e}'`,e),n=this.listings.get(i);if(!n)throw eo(`rmdir '${e}'`);if(n.size>0)throw dO(`rmdir '${e}'`);let s=this.entries.get(i);if(typeof s=="undefined")throw $a(`rmdir '${e}'`);this.deleteEntry(e,s)}hydrateDirectory(e){let r=this.libzip.dir.add(this.zip,v.relative(Se.root,e));if(r===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.registerListing(e),this.registerEntry(e,r),r}async linkPromise(e,r){return this.linkSync(e,r)}linkSync(e,r){throw CO(`link '${e}' -> '${r}'`)}async symlinkPromise(e,r){return this.symlinkSync(e,r)}symlinkSync(e,r){if(this.readOnly)throw ln(`symlink '${e}' -> '${r}'`);let i=this.resolveFilename(`symlink '${e}' -> '${r}'`,r);if(this.listings.has(i))throw rh(`symlink '${e}' -> '${r}'`);if(this.entries.has(i))throw yI(`symlink '${e}' -> '${r}'`);let n=this.setFileSource(i,e);if(this.registerEntry(i,n),this.libzip.file.setExternalAttributes(this.zip,n,0,0,this.libzip.ZIP_OPSYS_UNIX,(_o|511)<<16)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));this.symlinkCount+=1}async readFilePromise(e,r){typeof r=="object"&&(r=r?r.encoding:void 0);let i=await this.readFileBuffer(e,{asyncDecompress:!0});return r?i.toString(r):i}readFileSync(e,r){typeof r=="object"&&(r=r?r.encoding:void 0);let i=this.readFileBuffer(e);return r?i.toString(r):i}readFileBuffer(e,r={asyncDecompress:!1}){typeof e=="number"&&(e=this.fdToPath(e,"read"));let i=this.resolveFilename(`open '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`open '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(i))throw eo(`open '${e}'`);if(this.listings.has(i))throw rh("read");let n=this.entries.get(i);if(n===void 0)throw new Error("Unreachable");return this.getFileSource(n,r)}async readdirPromise(e,r){return this.readdirSync(e,r)}readdirSync(e,r){let i=this.resolveFilename(`scandir '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw bs(`scandir '${e}'`);let n=this.listings.get(i);if(!n)throw eo(`scandir '${e}'`);let s=[...n];return(r==null?void 0:r.withFileTypes)?s.map(o=>Object.assign(this.statImpl("lstat",v.join(e,o)),{name:o})):s}async readlinkPromise(e){let r=this.prepareReadlink(e);return(await this.getFileSource(r,{asyncDecompress:!0})).toString()}readlinkSync(e){let r=this.prepareReadlink(e);return this.getFileSource(r).toString()}prepareReadlink(e){let r=this.resolveFilename(`readlink '${e}'`,e,!1);if(!this.entries.has(r)&&!this.listings.has(r))throw bs(`readlink '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(r))throw eo(`open '${e}'`);if(this.listings.has(r))throw $a(`readlink '${e}'`);let i=this.entries.get(r);if(i===void 0)throw new Error("Unreachable");if(!this.isSymbolicLink(i))throw $a(`readlink '${e}'`);return i}async truncatePromise(e,r=0){let i=this.resolveFilename(`open '${e}'`,e),n=this.entries.get(i);if(typeof n=="undefined")throw $a(`open '${e}'`);let s=await this.getFileSource(n,{asyncDecompress:!0}),o=Buffer.alloc(r,0);return s.copy(o),await this.writeFilePromise(e,o)}truncateSync(e,r=0){let i=this.resolveFilename(`open '${e}'`,e),n=this.entries.get(i);if(typeof n=="undefined")throw $a(`open '${e}'`);let s=this.getFileSource(n),o=Buffer.alloc(r,0);return s.copy(o),this.writeFileSync(e,o)}watch(e,r,i){let n;switch(typeof r){case"function":case"string":case"undefined":n=!0;break;default:({persistent:n=!0}=r);break}if(!n)return{on:()=>{},close:()=>{}};let s=setInterval(()=>{},24*60*60*1e3);return{on:()=>{},close:()=>{clearInterval(s)}}}watchFile(e,r,i){let n=v.resolve(Se.root,e);return QI(this,n,r,i)}unwatchFile(e,r){let i=v.resolve(Se.root,e);return nh(this,i,r)}};var fi=class extends eA{getExtractHint(e){return this.baseFs.getExtractHint(e)}resolve(e){return this.mapFromBase(this.baseFs.resolve(this.mapToBase(e)))}getRealPath(){return this.mapFromBase(this.baseFs.getRealPath())}async openPromise(e,r,i){return this.baseFs.openPromise(this.mapToBase(e),r,i)}openSync(e,r,i){return this.baseFs.openSync(this.mapToBase(e),r,i)}async opendirPromise(e,r){return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(e),r),{path:e})}opendirSync(e,r){return Object.assign(this.baseFs.opendirSync(this.mapToBase(e),r),{path:e})}async readPromise(e,r,i,n,s){return await this.baseFs.readPromise(e,r,i,n,s)}readSync(e,r,i,n,s){return this.baseFs.readSync(e,r,i,n,s)}async writePromise(e,r,i,n,s){return typeof r=="string"?await this.baseFs.writePromise(e,r,i):await this.baseFs.writePromise(e,r,i,n,s)}writeSync(e,r,i,n,s){return typeof r=="string"?this.baseFs.writeSync(e,r,i):this.baseFs.writeSync(e,r,i,n,s)}async closePromise(e){return this.baseFs.closePromise(e)}closeSync(e){this.baseFs.closeSync(e)}createReadStream(e,r){return this.baseFs.createReadStream(e!==null?this.mapToBase(e):e,r)}createWriteStream(e,r){return this.baseFs.createWriteStream(e!==null?this.mapToBase(e):e,r)}async realpathPromise(e){return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(e)))}realpathSync(e){return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(e)))}async existsPromise(e){return this.baseFs.existsPromise(this.mapToBase(e))}existsSync(e){return this.baseFs.existsSync(this.mapToBase(e))}accessSync(e,r){return this.baseFs.accessSync(this.mapToBase(e),r)}async accessPromise(e,r){return this.baseFs.accessPromise(this.mapToBase(e),r)}async statPromise(e,r){return this.baseFs.statPromise(this.mapToBase(e),r)}statSync(e,r){return this.baseFs.statSync(this.mapToBase(e),r)}async fstatPromise(e,r){return this.baseFs.fstatPromise(e,r)}fstatSync(e,r){return this.baseFs.fstatSync(e,r)}async lstatPromise(e,r){return this.baseFs.lstatPromise(this.mapToBase(e),r)}lstatSync(e,r){return this.baseFs.lstatSync(this.mapToBase(e),r)}async chmodPromise(e,r){return this.baseFs.chmodPromise(this.mapToBase(e),r)}chmodSync(e,r){return this.baseFs.chmodSync(this.mapToBase(e),r)}async chownPromise(e,r,i){return this.baseFs.chownPromise(this.mapToBase(e),r,i)}chownSync(e,r,i){return this.baseFs.chownSync(this.mapToBase(e),r,i)}async renamePromise(e,r){return this.baseFs.renamePromise(this.mapToBase(e),this.mapToBase(r))}renameSync(e,r){return this.baseFs.renameSync(this.mapToBase(e),this.mapToBase(r))}async copyFilePromise(e,r,i=0){return this.baseFs.copyFilePromise(this.mapToBase(e),this.mapToBase(r),i)}copyFileSync(e,r,i=0){return this.baseFs.copyFileSync(this.mapToBase(e),this.mapToBase(r),i)}async appendFilePromise(e,r,i){return this.baseFs.appendFilePromise(this.fsMapToBase(e),r,i)}appendFileSync(e,r,i){return this.baseFs.appendFileSync(this.fsMapToBase(e),r,i)}async writeFilePromise(e,r,i){return this.baseFs.writeFilePromise(this.fsMapToBase(e),r,i)}writeFileSync(e,r,i){return this.baseFs.writeFileSync(this.fsMapToBase(e),r,i)}async unlinkPromise(e){return this.baseFs.unlinkPromise(this.mapToBase(e))}unlinkSync(e){return this.baseFs.unlinkSync(this.mapToBase(e))}async utimesPromise(e,r,i){return this.baseFs.utimesPromise(this.mapToBase(e),r,i)}utimesSync(e,r,i){return this.baseFs.utimesSync(this.mapToBase(e),r,i)}async mkdirPromise(e,r){return this.baseFs.mkdirPromise(this.mapToBase(e),r)}mkdirSync(e,r){return this.baseFs.mkdirSync(this.mapToBase(e),r)}async rmdirPromise(e,r){return this.baseFs.rmdirPromise(this.mapToBase(e),r)}rmdirSync(e,r){return this.baseFs.rmdirSync(this.mapToBase(e),r)}async linkPromise(e,r){return this.baseFs.linkPromise(this.mapToBase(e),this.mapToBase(r))}linkSync(e,r){return this.baseFs.linkSync(this.mapToBase(e),this.mapToBase(r))}async symlinkPromise(e,r,i){let n=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkPromise(this.mapToBase(e),n,i);let s=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),o=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(n),s);return this.baseFs.symlinkPromise(o,n,i)}symlinkSync(e,r,i){let n=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkSync(this.mapToBase(e),n,i);let s=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),o=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(n),s);return this.baseFs.symlinkSync(o,n,i)}async readFilePromise(e,r){return r==="utf8"?this.baseFs.readFilePromise(this.fsMapToBase(e),r):this.baseFs.readFilePromise(this.fsMapToBase(e),r)}readFileSync(e,r){return r==="utf8"?this.baseFs.readFileSync(this.fsMapToBase(e),r):this.baseFs.readFileSync(this.fsMapToBase(e),r)}async readdirPromise(e,r){return this.baseFs.readdirPromise(this.mapToBase(e),r)}readdirSync(e,r){return this.baseFs.readdirSync(this.mapToBase(e),r)}async readlinkPromise(e){return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(e)))}readlinkSync(e){return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(e)))}async truncatePromise(e,r){return this.baseFs.truncatePromise(this.mapToBase(e),r)}truncateSync(e,r){return this.baseFs.truncateSync(this.mapToBase(e),r)}watch(e,r,i){return this.baseFs.watch(this.mapToBase(e),r,i)}watchFile(e,r,i){return this.baseFs.watchFile(this.mapToBase(e),r,i)}unwatchFile(e,r){return this.baseFs.unwatchFile(this.mapToBase(e),r)}fsMapToBase(e){return typeof e=="number"?e:this.mapToBase(e)}};var Xo=class extends fi{constructor(e,{baseFs:r,pathUtils:i}){super(i);this.target=e,this.baseFs=r}getRealPath(){return this.target}getBaseFs(){return this.baseFs}mapFromBase(e){return e}mapToBase(e){return e}};var Ft=class extends fi{constructor(e,{baseFs:r=new Wt}={}){super(v);this.target=this.pathUtils.normalize(e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.target)}resolve(e){return this.pathUtils.isAbsolute(e)?v.normalize(e):this.baseFs.resolve(v.join(this.target,e))}mapFromBase(e){return e}mapToBase(e){return this.pathUtils.isAbsolute(e)?e:this.pathUtils.join(this.target,e)}};var vO=Se.root,Zo=class extends fi{constructor(e,{baseFs:r=new Wt}={}){super(v);this.target=this.pathUtils.resolve(Se.root,e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.pathUtils.relative(Se.root,this.target))}getTarget(){return this.target}getBaseFs(){return this.baseFs}mapToBase(e){let r=this.pathUtils.normalize(e);if(this.pathUtils.isAbsolute(e))return this.pathUtils.resolve(this.target,this.pathUtils.relative(vO,e));if(r.match(/^\.\.\/?/))throw new Error(`Resolving this path (${e}) would escape the jail`);return this.pathUtils.resolve(this.target,e)}mapFromBase(e){return this.pathUtils.resolve(vO,this.pathUtils.relative(this.target,e))}};var oh=class extends fi{constructor(e,r){super(r);this.graph=null;this.factory=e}get baseFs(){return this.instance||(this.instance=this.factory()),this.instance}set baseFs(e){this.instance=e}mapFromBase(e){return e}mapToBase(e){return e}};var ze=()=>Object.assign(new Error("ENOSYS: unsupported filesystem access"),{code:"ENOSYS"}),gb=class extends eA{constructor(){super(v)}getExtractHint(){throw ze()}getRealPath(){throw ze()}resolve(){throw ze()}async openPromise(){throw ze()}openSync(){throw ze()}async opendirPromise(){throw ze()}opendirSync(){throw ze()}async readPromise(){throw ze()}readSync(){throw ze()}async writePromise(){throw ze()}writeSync(){throw ze()}async closePromise(){throw ze()}closeSync(){throw ze()}createWriteStream(){throw ze()}createReadStream(){throw ze()}async realpathPromise(){throw ze()}realpathSync(){throw ze()}async readdirPromise(){throw ze()}readdirSync(){throw ze()}async existsPromise(e){throw ze()}existsSync(e){throw ze()}async accessPromise(){throw ze()}accessSync(){throw ze()}async statPromise(){throw ze()}statSync(){throw ze()}async fstatPromise(e){throw ze()}fstatSync(e){throw ze()}async lstatPromise(e){throw ze()}lstatSync(e){throw ze()}async chmodPromise(){throw ze()}chmodSync(){throw ze()}async chownPromise(){throw ze()}chownSync(){throw ze()}async mkdirPromise(){throw ze()}mkdirSync(){throw ze()}async rmdirPromise(){throw ze()}rmdirSync(){throw ze()}async linkPromise(){throw ze()}linkSync(){throw ze()}async symlinkPromise(){throw ze()}symlinkSync(){throw ze()}async renamePromise(){throw ze()}renameSync(){throw ze()}async copyFilePromise(){throw ze()}copyFileSync(){throw ze()}async appendFilePromise(){throw ze()}appendFileSync(){throw ze()}async writeFilePromise(){throw ze()}writeFileSync(){throw ze()}async unlinkPromise(){throw ze()}unlinkSync(){throw ze()}async utimesPromise(){throw ze()}utimesSync(){throw ze()}async readFilePromise(){throw ze()}readFileSync(){throw ze()}async readlinkPromise(){throw ze()}readlinkSync(){throw ze()}async truncatePromise(){throw ze()}truncateSync(){throw ze()}watch(){throw ze()}watchFile(){throw ze()}unwatchFile(){throw ze()}},bI=gb;bI.instance=new gb;var ah=class extends fi{constructor(e){super(M);this.baseFs=e}mapFromBase(e){return M.fromPortablePath(e)}mapToBase(e){return M.toPortablePath(e)}};var nhe=/^[0-9]+$/,fb=/^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/,she=/^([^/]+-)?[a-f0-9]+$/,Pr=class extends fi{static makeVirtualPath(e,r,i){if(v.basename(e)!=="__virtual__")throw new Error('Assertion failed: Virtual folders must be named "__virtual__"');if(!v.basename(r).match(she))throw new Error("Assertion failed: Virtual components must be ended by an hexadecimal hash");let s=v.relative(v.dirname(e),i).split("/"),o=0;for(;o{let r=t.indexOf(e);if(r<=0)return null;let i=r;for(;r>=0&&(i=r+e.length,t[i]!==v.sep);){if(t[r-1]===v.sep)return null;r=t.indexOf(e,i)}return t.length>i&&t[i]!==v.sep?null:t.slice(0,i)},Jn=class extends gl{constructor({libzip:e,baseFs:r=new Wt,filter:i=null,maxOpenFiles:n=Infinity,readOnlyArchives:s=!1,useCache:o=!0,maxAge:a=5e3,fileExtensions:l=null}){super();this.fdMap=new Map;this.nextFd=3;this.isZip=new Set;this.notZip=new Set;this.realPaths=new Map;this.limitOpenFilesTimeout=null;this.libzipFactory=typeof e!="function"?()=>e:e,this.baseFs=r,this.zipInstances=o?new Map:null,this.filter=i,this.maxOpenFiles=n,this.readOnlyArchives=s,this.maxAge=a,this.fileExtensions=l}static async openPromise(e,r){let i=new Jn(r);try{return await e(i)}finally{i.saveAndClose()}}get libzip(){return typeof this.libzipInstance=="undefined"&&(this.libzipInstance=this.libzipFactory()),this.libzipInstance}getExtractHint(e){return this.baseFs.getExtractHint(e)}getRealPath(){return this.baseFs.getRealPath()}saveAndClose(){if(sh(this),this.zipInstances)for(let[e,{zipFs:r}]of this.zipInstances.entries())r.saveAndClose(),this.zipInstances.delete(e)}discardAndClose(){if(sh(this),this.zipInstances)for(let[e,{zipFs:r}]of this.zipInstances.entries())r.discardAndClose(),this.zipInstances.delete(e)}resolve(e){return this.baseFs.resolve(e)}remapFd(e,r){let i=this.nextFd++|$o;return this.fdMap.set(i,[e,r]),i}async openPromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.openPromise(e,r,i),async(n,{subPath:s})=>this.remapFd(n,await n.openPromise(s,r,i)))}openSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.openSync(e,r,i),(n,{subPath:s})=>this.remapFd(n,n.openSync(s,r,i)))}async opendirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.opendirPromise(e,r),async(i,{subPath:n})=>await i.opendirPromise(n,r),{requireSubpath:!1})}opendirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.opendirSync(e,r),(i,{subPath:n})=>i.opendirSync(n,r),{requireSubpath:!1})}async readPromise(e,r,i,n,s){if((e&$o)==0)return await this.baseFs.readPromise(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Hi("read");let[a,l]=o;return await a.readPromise(l,r,i,n,s)}readSync(e,r,i,n,s){if((e&$o)==0)return this.baseFs.readSync(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Hi("readSync");let[a,l]=o;return a.readSync(l,r,i,n,s)}async writePromise(e,r,i,n,s){if((e&$o)==0)return typeof r=="string"?await this.baseFs.writePromise(e,r,i):await this.baseFs.writePromise(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Hi("write");let[a,l]=o;return typeof r=="string"?await a.writePromise(l,r,i):await a.writePromise(l,r,i,n,s)}writeSync(e,r,i,n,s){if((e&$o)==0)return typeof r=="string"?this.baseFs.writeSync(e,r,i):this.baseFs.writeSync(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Hi("writeSync");let[a,l]=o;return typeof r=="string"?a.writeSync(l,r,i):a.writeSync(l,r,i,n,s)}async closePromise(e){if((e&$o)==0)return await this.baseFs.closePromise(e);let r=this.fdMap.get(e);if(typeof r=="undefined")throw Hi("close");this.fdMap.delete(e);let[i,n]=r;return await i.closePromise(n)}closeSync(e){if((e&$o)==0)return this.baseFs.closeSync(e);let r=this.fdMap.get(e);if(typeof r=="undefined")throw Hi("closeSync");this.fdMap.delete(e);let[i,n]=r;return i.closeSync(n)}createReadStream(e,r){return e===null?this.baseFs.createReadStream(e,r):this.makeCallSync(e,()=>this.baseFs.createReadStream(e,r),(i,{subPath:n})=>i.createReadStream(n,r))}createWriteStream(e,r){return e===null?this.baseFs.createWriteStream(e,r):this.makeCallSync(e,()=>this.baseFs.createWriteStream(e,r),(i,{subPath:n})=>i.createWriteStream(n,r))}async realpathPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.realpathPromise(e),async(r,{archivePath:i,subPath:n})=>{let s=this.realPaths.get(i);return typeof s=="undefined"&&(s=await this.baseFs.realpathPromise(i),this.realPaths.set(i,s)),this.pathUtils.join(s,this.pathUtils.relative(Se.root,await r.realpathPromise(n)))})}realpathSync(e){return this.makeCallSync(e,()=>this.baseFs.realpathSync(e),(r,{archivePath:i,subPath:n})=>{let s=this.realPaths.get(i);return typeof s=="undefined"&&(s=this.baseFs.realpathSync(i),this.realPaths.set(i,s)),this.pathUtils.join(s,this.pathUtils.relative(Se.root,r.realpathSync(n)))})}async existsPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.existsPromise(e),async(r,{subPath:i})=>await r.existsPromise(i))}existsSync(e){return this.makeCallSync(e,()=>this.baseFs.existsSync(e),(r,{subPath:i})=>r.existsSync(i))}async accessPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.accessPromise(e,r),async(i,{subPath:n})=>await i.accessPromise(n,r))}accessSync(e,r){return this.makeCallSync(e,()=>this.baseFs.accessSync(e,r),(i,{subPath:n})=>i.accessSync(n,r))}async statPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.statPromise(e,r),async(i,{subPath:n})=>await i.statPromise(n,r))}statSync(e,r){return this.makeCallSync(e,()=>this.baseFs.statSync(e,r),(i,{subPath:n})=>i.statSync(n,r))}async fstatPromise(e,r){if((e&$o)==0)return this.baseFs.fstatPromise(e,r);let i=this.fdMap.get(e);if(typeof i=="undefined")throw Hi("fstat");let[n,s]=i;return n.fstatPromise(s,r)}fstatSync(e,r){if((e&$o)==0)return this.baseFs.fstatSync(e,r);let i=this.fdMap.get(e);if(typeof i=="undefined")throw Hi("fstatSync");let[n,s]=i;return n.fstatSync(s,r)}async lstatPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.lstatPromise(e,r),async(i,{subPath:n})=>await i.lstatPromise(n,r))}lstatSync(e,r){return this.makeCallSync(e,()=>this.baseFs.lstatSync(e,r),(i,{subPath:n})=>i.lstatSync(n,r))}async chmodPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.chmodPromise(e,r),async(i,{subPath:n})=>await i.chmodPromise(n,r))}chmodSync(e,r){return this.makeCallSync(e,()=>this.baseFs.chmodSync(e,r),(i,{subPath:n})=>i.chmodSync(n,r))}async chownPromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.chownPromise(e,r,i),async(n,{subPath:s})=>await n.chownPromise(s,r,i))}chownSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.chownSync(e,r,i),(n,{subPath:s})=>n.chownSync(s,r,i))}async renamePromise(e,r){return await this.makeCallPromise(e,async()=>await this.makeCallPromise(r,async()=>await this.baseFs.renamePromise(e,r),async()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})}),async(i,{subPath:n})=>await this.makeCallPromise(r,async()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})},async(s,{subPath:o})=>{if(i!==s)throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"});return await i.renamePromise(n,o)}))}renameSync(e,r){return this.makeCallSync(e,()=>this.makeCallSync(r,()=>this.baseFs.renameSync(e,r),()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})}),(i,{subPath:n})=>this.makeCallSync(r,()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})},(s,{subPath:o})=>{if(i!==s)throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"});return i.renameSync(n,o)}))}async copyFilePromise(e,r,i=0){let n=async(s,o,a,l)=>{if((i&Ah.constants.COPYFILE_FICLONE_FORCE)!=0)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${o}' -> ${l}'`),{code:"EXDEV"});if(i&Ah.constants.COPYFILE_EXCL&&await this.existsPromise(o))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${o}' -> '${l}'`),{code:"EEXIST"});let c;try{c=await s.readFilePromise(o)}catch(u){throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${o}' -> '${l}'`),{code:"EINVAL"})}await a.writeFilePromise(l,c)};return await this.makeCallPromise(e,async()=>await this.makeCallPromise(r,async()=>await this.baseFs.copyFilePromise(e,r,i),async(s,{subPath:o})=>await n(this.baseFs,e,s,o)),async(s,{subPath:o})=>await this.makeCallPromise(r,async()=>await n(s,o,this.baseFs,r),async(a,{subPath:l})=>s!==a?await n(s,o,a,l):await s.copyFilePromise(o,l,i)))}copyFileSync(e,r,i=0){let n=(s,o,a,l)=>{if((i&Ah.constants.COPYFILE_FICLONE_FORCE)!=0)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${o}' -> ${l}'`),{code:"EXDEV"});if(i&Ah.constants.COPYFILE_EXCL&&this.existsSync(o))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${o}' -> '${l}'`),{code:"EEXIST"});let c;try{c=s.readFileSync(o)}catch(u){throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${o}' -> '${l}'`),{code:"EINVAL"})}a.writeFileSync(l,c)};return this.makeCallSync(e,()=>this.makeCallSync(r,()=>this.baseFs.copyFileSync(e,r,i),(s,{subPath:o})=>n(this.baseFs,e,s,o)),(s,{subPath:o})=>this.makeCallSync(r,()=>n(s,o,this.baseFs,r),(a,{subPath:l})=>s!==a?n(s,o,a,l):s.copyFileSync(o,l,i)))}async appendFilePromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.appendFilePromise(e,r,i),async(n,{subPath:s})=>await n.appendFilePromise(s,r,i))}appendFileSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.appendFileSync(e,r,i),(n,{subPath:s})=>n.appendFileSync(s,r,i))}async writeFilePromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.writeFilePromise(e,r,i),async(n,{subPath:s})=>await n.writeFilePromise(s,r,i))}writeFileSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.writeFileSync(e,r,i),(n,{subPath:s})=>n.writeFileSync(s,r,i))}async unlinkPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.unlinkPromise(e),async(r,{subPath:i})=>await r.unlinkPromise(i))}unlinkSync(e){return this.makeCallSync(e,()=>this.baseFs.unlinkSync(e),(r,{subPath:i})=>r.unlinkSync(i))}async utimesPromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.utimesPromise(e,r,i),async(n,{subPath:s})=>await n.utimesPromise(s,r,i))}utimesSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.utimesSync(e,r,i),(n,{subPath:s})=>n.utimesSync(s,r,i))}async mkdirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.mkdirPromise(e,r),async(i,{subPath:n})=>await i.mkdirPromise(n,r))}mkdirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.mkdirSync(e,r),(i,{subPath:n})=>i.mkdirSync(n,r))}async rmdirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.rmdirPromise(e,r),async(i,{subPath:n})=>await i.rmdirPromise(n,r))}rmdirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.rmdirSync(e,r),(i,{subPath:n})=>i.rmdirSync(n,r))}async linkPromise(e,r){return await this.makeCallPromise(r,async()=>await this.baseFs.linkPromise(e,r),async(i,{subPath:n})=>await i.linkPromise(e,n))}linkSync(e,r){return this.makeCallSync(r,()=>this.baseFs.linkSync(e,r),(i,{subPath:n})=>i.linkSync(e,n))}async symlinkPromise(e,r,i){return await this.makeCallPromise(r,async()=>await this.baseFs.symlinkPromise(e,r,i),async(n,{subPath:s})=>await n.symlinkPromise(e,s))}symlinkSync(e,r,i){return this.makeCallSync(r,()=>this.baseFs.symlinkSync(e,r,i),(n,{subPath:s})=>n.symlinkSync(e,s))}async readFilePromise(e,r){return this.makeCallPromise(e,async()=>{switch(r){case"utf8":return await this.baseFs.readFilePromise(e,r);default:return await this.baseFs.readFilePromise(e,r)}},async(i,{subPath:n})=>await i.readFilePromise(n,r))}readFileSync(e,r){return this.makeCallSync(e,()=>{switch(r){case"utf8":return this.baseFs.readFileSync(e,r);default:return this.baseFs.readFileSync(e,r)}},(i,{subPath:n})=>i.readFileSync(n,r))}async readdirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.readdirPromise(e,r),async(i,{subPath:n})=>await i.readdirPromise(n,r),{requireSubpath:!1})}readdirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.readdirSync(e,r),(i,{subPath:n})=>i.readdirSync(n,r),{requireSubpath:!1})}async readlinkPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.readlinkPromise(e),async(r,{subPath:i})=>await r.readlinkPromise(i))}readlinkSync(e){return this.makeCallSync(e,()=>this.baseFs.readlinkSync(e),(r,{subPath:i})=>r.readlinkSync(i))}async truncatePromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.truncatePromise(e,r),async(i,{subPath:n})=>await i.truncatePromise(n,r))}truncateSync(e,r){return this.makeCallSync(e,()=>this.baseFs.truncateSync(e,r),(i,{subPath:n})=>i.truncateSync(n,r))}watch(e,r,i){return this.makeCallSync(e,()=>this.baseFs.watch(e,r,i),(n,{subPath:s})=>n.watch(s,r,i))}watchFile(e,r,i){return this.makeCallSync(e,()=>this.baseFs.watchFile(e,r,i),()=>QI(this,e,r,i))}unwatchFile(e,r){return this.makeCallSync(e,()=>this.baseFs.unwatchFile(e,r),()=>nh(this,e,r))}async makeCallPromise(e,r,i,{requireSubpath:n=!0}={}){if(typeof e!="string")return await r();let s=this.resolve(e),o=this.findZip(s);return o?n&&o.subPath==="/"?await r():await this.getZipPromise(o.archivePath,async a=>await i(a,o)):await r()}makeCallSync(e,r,i,{requireSubpath:n=!0}={}){if(typeof e!="string")return r();let s=this.resolve(e),o=this.findZip(s);return!o||n&&o.subPath==="/"?r():this.getZipSync(o.archivePath,a=>i(a,o))}findZip(e){if(this.filter&&!this.filter.test(e))return null;let r="";for(;;){let i=e.substr(r.length),n;if(!this.fileExtensions)n=SO(i,".zip");else for(let s of this.fileExtensions)if(n=SO(i,s),n)break;if(!n)return null;if(r=this.pathUtils.join(r,n),this.isZip.has(r)===!1){if(this.notZip.has(r))continue;try{if(!this.baseFs.lstatSync(r).isFile()){this.notZip.add(r);continue}}catch{return null}this.isZip.add(r)}return{archivePath:r,subPath:this.pathUtils.join(Se.root,e.substr(r.length))}}}limitOpenFiles(e){if(this.zipInstances===null)return;let r=Date.now(),i=r+this.maxAge,n=e===null?0:this.zipInstances.size-e;for(let[s,{zipFs:o,expiresAt:a,refCount:l}]of this.zipInstances.entries())if(!(l!==0||o.hasOpenFileHandles())){if(r>=a){o.saveAndClose(),this.zipInstances.delete(s),n-=1;continue}else if(e===null||n<=0){i=a;break}o.saveAndClose(),this.zipInstances.delete(s),n-=1}this.limitOpenFilesTimeout===null&&(e===null&&this.zipInstances.size>0||e!==null)&&(this.limitOpenFilesTimeout=setTimeout(()=>{this.limitOpenFilesTimeout=null,this.limitOpenFiles(null)},i-r).unref())}async getZipPromise(e,r){let i=async()=>({baseFs:this.baseFs,libzip:this.libzip,readOnly:this.readOnlyArchives,stats:await this.baseFs.statPromise(e)});if(this.zipInstances){let n=this.zipInstances.get(e);if(!n){let s=await i();n=this.zipInstances.get(e),n||(n={zipFs:new Jr(e,s),expiresAt:0,refCount:0})}this.zipInstances.delete(e),this.limitOpenFiles(this.maxOpenFiles-1),this.zipInstances.set(e,n),n.expiresAt=Date.now()+this.maxAge,n.refCount+=1;try{return await r(n.zipFs)}finally{n.refCount-=1}}else{let n=new Jr(e,await i());try{return await r(n)}finally{n.saveAndClose()}}}getZipSync(e,r){let i=()=>({baseFs:this.baseFs,libzip:this.libzip,readOnly:this.readOnlyArchives,stats:this.baseFs.statSync(e)});if(this.zipInstances){let n=this.zipInstances.get(e);return n||(n={zipFs:new Jr(e,i()),expiresAt:0,refCount:0}),this.zipInstances.delete(e),this.limitOpenFiles(this.maxOpenFiles-1),this.zipInstances.set(e,n),n.expiresAt=Date.now()+this.maxAge,r(n.zipFs)}else{let n=new Jr(e,i());try{return r(n)}finally{n.saveAndClose()}}}};var lh=ie(require("util"));var vI=ie(require("url"));var hb=class extends fi{constructor(e){super(M);this.baseFs=e}mapFromBase(e){return e}mapToBase(e){return e instanceof vI.URL?(0,vI.fileURLToPath)(e):e}};var ohe=new Set(["accessSync","appendFileSync","createReadStream","createWriteStream","chmodSync","chownSync","closeSync","copyFileSync","linkSync","lstatSync","fstatSync","lutimesSync","mkdirSync","openSync","opendirSync","readSync","readlinkSync","readFileSync","readdirSync","readlinkSync","realpathSync","renameSync","rmdirSync","statSync","symlinkSync","truncateSync","unlinkSync","unwatchFile","utimesSync","watch","watchFile","writeFileSync","writeSync"]),xO=new Set(["accessPromise","appendFilePromise","chmodPromise","chownPromise","closePromise","copyFilePromise","linkPromise","fstatPromise","lstatPromise","lutimesPromise","mkdirPromise","openPromise","opendirPromise","readdirPromise","realpathPromise","readFilePromise","readdirPromise","readlinkPromise","renamePromise","rmdirPromise","statPromise","symlinkPromise","truncatePromise","unlinkPromise","utimesPromise","writeFilePromise","writeSync"]),ahe=new Set(["appendFilePromise","chmodPromise","chownPromise","closePromise","readPromise","readFilePromise","statPromise","truncatePromise","utimesPromise","writePromise","writeFilePromise"]);function pb(t,e){e=new hb(e);let r=(i,n,s)=>{let o=i[n];i[n]=s,typeof(o==null?void 0:o[lh.promisify.custom])!="undefined"&&(s[lh.promisify.custom]=o[lh.promisify.custom])};{r(t,"exists",(i,...n)=>{let o=typeof n[n.length-1]=="function"?n.pop():()=>{};process.nextTick(()=>{e.existsPromise(i).then(a=>{o(a)},()=>{o(!1)})})}),r(t,"read",(i,n,...s)=>{let a=typeof s[s.length-1]=="function"?s.pop():()=>{};process.nextTick(()=>{e.readPromise(i,n,...s).then(l=>{a(null,l,n)},l=>{a(l,0,n)})})});for(let i of xO){let n=i.replace(/Promise$/,"");if(typeof t[n]=="undefined")continue;let s=e[i];if(typeof s=="undefined")continue;r(t,n,(...a)=>{let c=typeof a[a.length-1]=="function"?a.pop():()=>{};process.nextTick(()=>{s.apply(e,a).then(u=>{c(null,u)},u=>{c(u)})})})}t.realpath.native=t.realpath}{r(t,"existsSync",i=>{try{return e.existsSync(i)}catch(n){return!1}});for(let i of ohe){let n=i;if(typeof t[n]=="undefined")continue;let s=e[i];typeof s!="undefined"&&r(t,n,s.bind(e))}t.realpathSync.native=t.realpathSync}{let i=process.emitWarning;process.emitWarning=()=>{};let n;try{n=t.promises}finally{process.emitWarning=i}if(typeof n!="undefined"){for(let o of xO){let a=o.replace(/Promise$/,"");if(typeof n[a]=="undefined")continue;let l=e[o];typeof l!="undefined"&&o!=="open"&&r(n,a,l.bind(e))}class s{constructor(a){this.fd=a}}for(let o of ahe){let a=o.replace(/Promise$/,""),l=e[o];typeof l!="undefined"&&r(s.prototype,a,function(...c){return l.call(e,this.fd,...c)})}r(n,"open",async(...o)=>{let a=await e.openPromise(...o);return new s(a)})}}t.read[lh.promisify.custom]=async(i,n,...s)=>({bytesRead:await e.readPromise(i,n,...s),buffer:n})}function SI(t,e){let r=Object.create(t);return pb(r,e),r}var kO=ie(require("os"));function PO(t){let e=M.toPortablePath(kO.default.tmpdir()),r=Math.ceil(Math.random()*4294967296).toString(16).padStart(8,"0");return v.join(e,`${t}${r}`)}var vs=new Set,DO=!1;function RO(){DO||(DO=!0,process.once("exit",()=>{T.rmtempSync()}))}var T=Object.assign(new Wt,{detachTemp(t){vs.delete(t)},mktempSync(t){for(RO();;){let e=PO("xfs-");try{this.mkdirSync(e)}catch(i){if(i.code==="EEXIST")continue;throw i}let r=this.realpathSync(e);if(vs.add(r),typeof t!="undefined")try{return t(r)}finally{if(vs.has(r)){vs.delete(r);try{this.removeSync(r)}catch{}}}else return r}},async mktempPromise(t){for(RO();;){let e=PO("xfs-");try{await this.mkdirPromise(e)}catch(i){if(i.code==="EEXIST")continue;throw i}let r=await this.realpathPromise(e);if(vs.add(r),typeof t!="undefined")try{return await t(r)}finally{if(vs.has(r)){vs.delete(r);try{await this.removePromise(r)}catch{}}}else return r}},async rmtempPromise(){await Promise.all(Array.from(vs.values()).map(async t=>{try{await T.removePromise(t,{maxRetries:0}),vs.delete(t)}catch{}}))},rmtempSync(){for(let t of vs)try{T.removeSync(t),vs.delete(t)}catch{}}});var vb=ie(bb()),Pn;(function(i){i[i.Never=0]="Never",i[i.ErrorCode=1]="ErrorCode",i[i.Always=2]="Always"})(Pn||(Pn={}));function dl(t){return t!==null&&typeof t.fd=="number"}var Cl=new Set;function Sb(){}function xb(){for(let t of Cl)t.kill()}async function to(t,e,{cwd:r,env:i=process.env,strict:n=!1,stdin:s=null,stdout:o,stderr:a,end:l=2}){let c=["pipe","pipe","pipe"];s===null?c[0]="ignore":dl(s)&&(c[0]=s),dl(o)&&(c[1]=o),dl(a)&&(c[2]=a);let u=(0,vb.default)(t,e,{cwd:M.fromPortablePath(r),env:_(P({},i),{PWD:M.fromPortablePath(r)}),stdio:c});Cl.add(u),Cl.size===1&&(process.on("SIGINT",Sb),process.on("SIGTERM",xb)),!dl(s)&&s!==null&&s.pipe(u.stdin),dl(o)||u.stdout.pipe(o,{end:!1}),dl(a)||u.stderr.pipe(a,{end:!1});let g=()=>{for(let f of new Set([o,a]))dl(f)||f.end()};return new Promise((f,h)=>{u.on("error",p=>{Cl.delete(u),Cl.size===0&&(process.off("SIGINT",Sb),process.off("SIGTERM",xb)),(l===2||l===1)&&g(),h(p)}),u.on("close",(p,d)=>{Cl.delete(u),Cl.size===0&&(process.off("SIGINT",Sb),process.off("SIGTERM",xb)),(l===2||l===1&&p>0)&&g(),p===0||!n?f({code:kb(p,d)}):h(p!==null?new Error(`Child "${t}" exited with exit code ${p}`):new Error(`Child "${t}" exited with signal ${d}`))})})}async function Nhe(t,e,{cwd:r,env:i=process.env,encoding:n="utf8",strict:s=!1}){let o=["ignore","pipe","pipe"],a=[],l=[],c=M.fromPortablePath(r);typeof i.PWD!="undefined"&&(i=_(P({},i),{PWD:c}));let u=(0,vb.default)(t,e,{cwd:c,env:i,stdio:o});return u.stdout.on("data",g=>{a.push(g)}),u.stderr.on("data",g=>{l.push(g)}),await new Promise((g,f)=>{u.on("error",()=>{f()}),u.on("close",(h,p)=>{let d=n==="buffer"?Buffer.concat(a):Buffer.concat(a).toString(n),m=n==="buffer"?Buffer.concat(l):Buffer.concat(l).toString(n);h===0||!s?g({code:kb(h,p),stdout:d,stderr:m}):f(Object.assign(new Error(`Child "${t}" exited with exit code ${h} ${m}`),{code:kb(h,p),stdout:d,stderr:m}))})})}var Lhe=new Map([["SIGINT",2],["SIGQUIT",3],["SIGKILL",9],["SIGTERM",15]]);function kb(t,e){let r=Lhe.get(e);return typeof r!="undefined"?128+r:t!=null?t:1}var Pb={};it(Pb,{getDefaultGlobalFolder:()=>Rb,getHomeFolder:()=>uh,isFolderInside:()=>Fb});var Db=ie(require("os"));function Rb(){if(process.platform==="win32"){let t=M.toPortablePath(process.env.LOCALAPPDATA||M.join((0,Db.homedir)(),"AppData","Local"));return v.resolve(t,"Yarn/Berry")}if(process.env.XDG_DATA_HOME){let t=M.toPortablePath(process.env.XDG_DATA_HOME);return v.resolve(t,"yarn/berry")}return v.resolve(uh(),".yarn/berry")}function uh(){return M.toPortablePath((0,Db.homedir)()||"/usr/local/share")}function Fb(t,e){let r=v.relative(e,t);return r&&!r.startsWith("..")&&!v.isAbsolute(r)}var ue={};it(ue,{LogLevel:()=>Ts,Style:()=>Gl,Type:()=>Le,addLogFilterSupport:()=>Cp,applyColor:()=>On,applyHyperlink:()=>Ku,applyStyle:()=>Py,json:()=>Uu,mark:()=>xx,pretty:()=>Ve,prettyField:()=>Yl,prettyList:()=>Kx,supportsColor:()=>xy,supportsHyperlinks:()=>Mx,tuple:()=>jl});var pp=ie(jb()),dp=ie(ml()),o3=ie(Nn()),a3=ie(gU());var z;(function(te){te[te.UNNAMED=0]="UNNAMED",te[te.EXCEPTION=1]="EXCEPTION",te[te.MISSING_PEER_DEPENDENCY=2]="MISSING_PEER_DEPENDENCY",te[te.CYCLIC_DEPENDENCIES=3]="CYCLIC_DEPENDENCIES",te[te.DISABLED_BUILD_SCRIPTS=4]="DISABLED_BUILD_SCRIPTS",te[te.BUILD_DISABLED=5]="BUILD_DISABLED",te[te.SOFT_LINK_BUILD=6]="SOFT_LINK_BUILD",te[te.MUST_BUILD=7]="MUST_BUILD",te[te.MUST_REBUILD=8]="MUST_REBUILD",te[te.BUILD_FAILED=9]="BUILD_FAILED",te[te.RESOLVER_NOT_FOUND=10]="RESOLVER_NOT_FOUND",te[te.FETCHER_NOT_FOUND=11]="FETCHER_NOT_FOUND",te[te.LINKER_NOT_FOUND=12]="LINKER_NOT_FOUND",te[te.FETCH_NOT_CACHED=13]="FETCH_NOT_CACHED",te[te.YARN_IMPORT_FAILED=14]="YARN_IMPORT_FAILED",te[te.REMOTE_INVALID=15]="REMOTE_INVALID",te[te.REMOTE_NOT_FOUND=16]="REMOTE_NOT_FOUND",te[te.RESOLUTION_PACK=17]="RESOLUTION_PACK",te[te.CACHE_CHECKSUM_MISMATCH=18]="CACHE_CHECKSUM_MISMATCH",te[te.UNUSED_CACHE_ENTRY=19]="UNUSED_CACHE_ENTRY",te[te.MISSING_LOCKFILE_ENTRY=20]="MISSING_LOCKFILE_ENTRY",te[te.WORKSPACE_NOT_FOUND=21]="WORKSPACE_NOT_FOUND",te[te.TOO_MANY_MATCHING_WORKSPACES=22]="TOO_MANY_MATCHING_WORKSPACES",te[te.CONSTRAINTS_MISSING_DEPENDENCY=23]="CONSTRAINTS_MISSING_DEPENDENCY",te[te.CONSTRAINTS_INCOMPATIBLE_DEPENDENCY=24]="CONSTRAINTS_INCOMPATIBLE_DEPENDENCY",te[te.CONSTRAINTS_EXTRANEOUS_DEPENDENCY=25]="CONSTRAINTS_EXTRANEOUS_DEPENDENCY",te[te.CONSTRAINTS_INVALID_DEPENDENCY=26]="CONSTRAINTS_INVALID_DEPENDENCY",te[te.CANT_SUGGEST_RESOLUTIONS=27]="CANT_SUGGEST_RESOLUTIONS",te[te.FROZEN_LOCKFILE_EXCEPTION=28]="FROZEN_LOCKFILE_EXCEPTION",te[te.CROSS_DRIVE_VIRTUAL_LOCAL=29]="CROSS_DRIVE_VIRTUAL_LOCAL",te[te.FETCH_FAILED=30]="FETCH_FAILED",te[te.DANGEROUS_NODE_MODULES=31]="DANGEROUS_NODE_MODULES",te[te.NODE_GYP_INJECTED=32]="NODE_GYP_INJECTED",te[te.AUTHENTICATION_NOT_FOUND=33]="AUTHENTICATION_NOT_FOUND",te[te.INVALID_CONFIGURATION_KEY=34]="INVALID_CONFIGURATION_KEY",te[te.NETWORK_ERROR=35]="NETWORK_ERROR",te[te.LIFECYCLE_SCRIPT=36]="LIFECYCLE_SCRIPT",te[te.CONSTRAINTS_MISSING_FIELD=37]="CONSTRAINTS_MISSING_FIELD",te[te.CONSTRAINTS_INCOMPATIBLE_FIELD=38]="CONSTRAINTS_INCOMPATIBLE_FIELD",te[te.CONSTRAINTS_EXTRANEOUS_FIELD=39]="CONSTRAINTS_EXTRANEOUS_FIELD",te[te.CONSTRAINTS_INVALID_FIELD=40]="CONSTRAINTS_INVALID_FIELD",te[te.AUTHENTICATION_INVALID=41]="AUTHENTICATION_INVALID",te[te.PROLOG_UNKNOWN_ERROR=42]="PROLOG_UNKNOWN_ERROR",te[te.PROLOG_SYNTAX_ERROR=43]="PROLOG_SYNTAX_ERROR",te[te.PROLOG_EXISTENCE_ERROR=44]="PROLOG_EXISTENCE_ERROR",te[te.STACK_OVERFLOW_RESOLUTION=45]="STACK_OVERFLOW_RESOLUTION",te[te.AUTOMERGE_FAILED_TO_PARSE=46]="AUTOMERGE_FAILED_TO_PARSE",te[te.AUTOMERGE_IMMUTABLE=47]="AUTOMERGE_IMMUTABLE",te[te.AUTOMERGE_SUCCESS=48]="AUTOMERGE_SUCCESS",te[te.AUTOMERGE_REQUIRED=49]="AUTOMERGE_REQUIRED",te[te.DEPRECATED_CLI_SETTINGS=50]="DEPRECATED_CLI_SETTINGS",te[te.PLUGIN_NAME_NOT_FOUND=51]="PLUGIN_NAME_NOT_FOUND",te[te.INVALID_PLUGIN_REFERENCE=52]="INVALID_PLUGIN_REFERENCE",te[te.CONSTRAINTS_AMBIGUITY=53]="CONSTRAINTS_AMBIGUITY",te[te.CACHE_OUTSIDE_PROJECT=54]="CACHE_OUTSIDE_PROJECT",te[te.IMMUTABLE_INSTALL=55]="IMMUTABLE_INSTALL",te[te.IMMUTABLE_CACHE=56]="IMMUTABLE_CACHE",te[te.INVALID_MANIFEST=57]="INVALID_MANIFEST",te[te.PACKAGE_PREPARATION_FAILED=58]="PACKAGE_PREPARATION_FAILED",te[te.INVALID_RANGE_PEER_DEPENDENCY=59]="INVALID_RANGE_PEER_DEPENDENCY",te[te.INCOMPATIBLE_PEER_DEPENDENCY=60]="INCOMPATIBLE_PEER_DEPENDENCY",te[te.DEPRECATED_PACKAGE=61]="DEPRECATED_PACKAGE",te[te.INCOMPATIBLE_OS=62]="INCOMPATIBLE_OS",te[te.INCOMPATIBLE_CPU=63]="INCOMPATIBLE_CPU",te[te.FROZEN_ARTIFACT_EXCEPTION=64]="FROZEN_ARTIFACT_EXCEPTION",te[te.TELEMETRY_NOTICE=65]="TELEMETRY_NOTICE",te[te.PATCH_HUNK_FAILED=66]="PATCH_HUNK_FAILED",te[te.INVALID_CONFIGURATION_VALUE=67]="INVALID_CONFIGURATION_VALUE",te[te.UNUSED_PACKAGE_EXTENSION=68]="UNUSED_PACKAGE_EXTENSION",te[te.REDUNDANT_PACKAGE_EXTENSION=69]="REDUNDANT_PACKAGE_EXTENSION",te[te.AUTO_NM_SUCCESS=70]="AUTO_NM_SUCCESS",te[te.NM_CANT_INSTALL_EXTERNAL_SOFT_LINK=71]="NM_CANT_INSTALL_EXTERNAL_SOFT_LINK",te[te.NM_PRESERVE_SYMLINKS_REQUIRED=72]="NM_PRESERVE_SYMLINKS_REQUIRED",te[te.UPDATE_LOCKFILE_ONLY_SKIP_LINK=73]="UPDATE_LOCKFILE_ONLY_SKIP_LINK",te[te.NM_HARDLINKS_MODE_DOWNGRADED=74]="NM_HARDLINKS_MODE_DOWNGRADED",te[te.PROLOG_INSTANTIATION_ERROR=75]="PROLOG_INSTANTIATION_ERROR",te[te.INCOMPATIBLE_ARCHITECTURE=76]="INCOMPATIBLE_ARCHITECTURE",te[te.GHOST_ARCHITECTURE=77]="GHOST_ARCHITECTURE"})(z||(z={}));function KI(t){return`YN${t.toString(10).padStart(4,"0")}`}var de={};it(de,{BufferStream:()=>OH,CachingStrategy:()=>Dl,DefaultStream:()=>KH,assertNever:()=>Lv,bufferStream:()=>Cu,buildIgnorePattern:()=>DIe,convertMapsToIndexableObjects:()=>aE,dynamicRequire:()=>mu,escapeRegExp:()=>SIe,getArrayWithDefault:()=>hu,getFactoryWithDefault:()=>na,getMapWithDefault:()=>pu,getSetWithDefault:()=>Pl,isIndexableObject:()=>Tv,isPathLike:()=>RIe,isTaggedYarnVersion:()=>vIe,mapAndFilter:()=>kl,mapAndFind:()=>MH,overrideType:()=>Nv,parseBoolean:()=>Hh,parseOptionalBoolean:()=>jH,prettifyAsyncErrors:()=>du,prettifySyncErrors:()=>Mv,releaseAfterUseAsync:()=>kIe,replaceEnvVariables:()=>Ov,sortMap:()=>gn,tryParseOptionalBoolean:()=>Kv,validateEnum:()=>xIe});var vh={};it(vh,{Builtins:()=>Ev,Cli:()=>oo,Command:()=>ye,Option:()=>Y,UsageError:()=>me});var yl=0,Ih=1,Gi=2,sv="",hi="\0",Au=-1,ov=/^(-h|--help)(?:=([0-9]+))?$/,UI=/^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/,fU=/^-[a-zA-Z]{2,}$/,av=/^([^=]+)=([\s\S]*)$/,Av=process.env.DEBUG_CLI==="1";var me=class extends Error{constructor(e){super(e);this.clipanion={type:"usage"},this.name="UsageError"}},Eh=class extends Error{constructor(e,r){super();if(this.input=e,this.candidates=r,this.clipanion={type:"none"},this.name="UnknownSyntaxError",this.candidates.length===0)this.message="Command not found, but we're not sure what's the alternative.";else if(this.candidates.every(i=>i.reason!==null&&i.reason===r[0].reason)){let[{reason:i}]=this.candidates;this.message=`${i} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aa6682b07c..f6fadd31aac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,17 +8,46 @@ ownCloud admins and users. Summary ------- +* Bugfix - Context menu misplaced when triggered by keyboard navigation: [#7230](https://github.com/owncloud/web/pull/7230) +* Bugfix - Prevent error when pasting with empty clipboard: [#7214](https://github.com/owncloud/web/pull/7214) * Bugfix - Re-introduce dynamic app name in document title: [#7173](https://github.com/owncloud/web/pull/7173) * Bugfix - External apps fixes: [#7166](https://github.com/owncloud/web/pull/7166) +* Bugfix - Logout deleted user on page reload: [#4677](https://github.com/owncloud/web/issues/4677) +* Bugfix - Filename hovers over the image in the preview app: [#7216](https://github.com/owncloud/web/pull/7216) +* Bugfix - Shared with others page apps not working with oc10 as backend: [#7228](https://github.com/owncloud/web/pull/7228) +* Bugfix - Create space and access user management permission: [#7197](https://github.com/owncloud/web/pull/7197) * Bugfix - Space sidebar sharing indicators: [#6921](https://github.com/owncloud/web/pull/6921) +* Bugfix - Access token renewal: [#7030](https://github.com/owncloud/web/issues/7030) +* Enhancement - Add app top bar component: [#7217](https://github.com/owncloud/web/pull/7217) +* Enhancement - Loading context blocks application bootstrap: [#7030](https://github.com/owncloud/web/issues/7030) +* Enhancement - Add change own password dialog to the account info page: [#7206](https://github.com/owncloud/web/pull/7206) +* Enhancement - Re-sharing for ocis: [#7086](https://github.com/owncloud/web/pull/7086) +* Enhancement - Added a toolbar to pdf-viewer app: [#7201](https://github.com/owncloud/web/pull/7201) * Enhancement - Reposition notifications: [#7139](https://github.com/owncloud/web/pull/7139) +* Enhancement - Resolve bookmarked public links with password protection: [#7030](https://github.com/owncloud/web/issues/7030) * Enhancement - Improve performance of share indicators: [#7038](https://github.com/owncloud/web/issues/7038) +* Enhancement - Option to block file extensions from text-editor app: [#6661](https://github.com/owncloud/web/issues/6661) * Enhancement - Update ODS to v14.0.0-alpha.2: [#7139](https://github.com/owncloud/web/pull/7139) * Enhancement - Introduce group assignments: [#7176](https://github.com/owncloud/web/pull/7176) Details ------- +* Bugfix - Context menu misplaced when triggered by keyboard navigation: [#7230](https://github.com/owncloud/web/pull/7230) + + We've fixed a bug where triggering the context menu by keyboard navigation misplaced the menu + and made it inaccessible. + + https://github.com/owncloud/web/issues/7187 + https://github.com/owncloud/web/pull/7230 + +* Bugfix - Prevent error when pasting with empty clipboard: [#7214](https://github.com/owncloud/web/pull/7214) + + We've fixed a bug where an error was thrown when pasting with empty clipboard + + https://github.com/owncloud/web/issues/7146 + https://github.com/owncloud/web/pull/7214 + * Bugfix - Re-introduce dynamic app name in document title: [#7173](https://github.com/owncloud/web/pull/7173) The `external` app was missing the dynamic app name after some recent refactoring. It has been @@ -34,6 +63,43 @@ Details https://github.com/owncloud/web/pull/7166 https://github.com/owncloud/web/pull/7173 +* Bugfix - Logout deleted user on page reload: [#4677](https://github.com/owncloud/web/issues/4677) + + A user that gets disabled or deleted in the backend now sees an authentication error page upon + page reload. From there they can now properly reach the login page to log in again via a different + user (or leave the page entirely). + + https://github.com/owncloud/web/issues/4677 + https://github.com/owncloud/web/issues/4564 + https://github.com/owncloud/web/issues/4795 + https://github.com/owncloud/web/pull/7072 + +* Bugfix - Filename hovers over the image in the preview app: [#7216](https://github.com/owncloud/web/pull/7216) + + We've fixed a bug where the filename hovers over the image content in the preview app and the + bottom toolbar is not accurate centered. Therefore we have introduced a new top bar, where the + filename will be shown and the download and the close button will be displayed. + + https://github.com/owncloud/web/issues/6300 + https://github.com/owncloud/web/pull/7216 + +* Bugfix - Shared with others page apps not working with oc10 as backend: [#7228](https://github.com/owncloud/web/pull/7228) + + We've fixed a bug where apps like preview, pdf-viewer or text-editor weren't working while + browsing the shared with others page with oc10 as backend. + + https://github.com/owncloud/web/issues/7049 + https://github.com/owncloud/web/pull/7228 + +* Bugfix - Create space and access user management permission: [#7197](https://github.com/owncloud/web/pull/7197) + + We've fixed a bug, where users with insufficient permissions could access the user management + and were able to see the "New Space" button in the space overview. + + https://github.com/owncloud/web/issues/7181 + https://github.com/owncloud/web/issues/7079 + https://github.com/owncloud/web/pull/7197 + * Bugfix - Space sidebar sharing indicators: [#6921](https://github.com/owncloud/web/pull/6921) We have fixed the way the sharing indicators for space members and link shares were displayed in @@ -43,6 +109,73 @@ Details https://github.com/owncloud/web/issues/6917 https://github.com/owncloud/web/pull/6921 +* Bugfix - Access token renewal: [#7030](https://github.com/owncloud/web/issues/7030) + + Access token renewals had some flaws which have been fixed as follows: - OAuth2: access token + renewal was not working at all, fixed by switching to authorization code flow with PKCE + extension and by migrating from the unmaintained `oidc-client` library to + `oidc-client-ts`. - OpenID Connect: when `offline_access` scope was not requested each + token renewal caused a redirect to `/`, which was due to a faulty token update implementation + and is fixed. + + WARNING: With a setup of ownCloud 10.x.x + oauth2-app older than v0.5.3 this bugfix is a + breaking change. There was a bug in the oauth2-app that required to add the `clientSecret` in + the `auth` section of the `config.json` file (although code flow with PKCE doesn't need it). To + mitigate this, please add the `clientSecret` for your `clientId` to the `config.json` file. + If the oauth2-app v0.5.3 or newer is used that's not needed. + + https://github.com/owncloud/web/issues/7030 + https://github.com/owncloud/web/pull/7072 + https://github.com/owncloud/web/pull/7242 + +* Enhancement - Add app top bar component: [#7217](https://github.com/owncloud/web/pull/7217) + + We've added a app top bar component for consistency, which will be used by the apps: preview, + text-editor and pdf-viewer. + + https://github.com/owncloud/web/pull/7217 + +* Enhancement - Loading context blocks application bootstrap: [#7030](https://github.com/owncloud/web/issues/7030) + + The bootstrap architecture has been improved to ensure that the respective context (user or + public link) is fully resolved before applications can finalize their boot process and switch + over to rendering their content. This means that application developers can rely on user data / + public link data being loaded (including e.g. capabilities) when the web runtime triggers the + boot processes and rendering of applications. + + https://github.com/owncloud/web/issues/7030 + https://github.com/owncloud/web/pull/7072 + +* Enhancement - Add change own password dialog to the account info page: [#7206](https://github.com/owncloud/web/pull/7206) + + We have added a new change own password dialog to the account info page, so the user has the + possibility to change their own password. + + https://github.com/owncloud/web/issues/7183 + https://github.com/owncloud/web/pull/7206 + +* Enhancement - Re-sharing for ocis: [#7086](https://github.com/owncloud/web/pull/7086) + + We've enhanced web to be able to re-share resources when using an ownCloud infinite scale + backend. It now works for project and personal spaces as well as the sharing jail. Besides that + we also send roles, space-ref and path as separate values to the sharing api which simplifies + the usage of it. + + https://github.com/owncloud/web/issues/6894 + https://github.com/owncloud/web/issues/7225 + https://github.com/owncloud/web/pull/7086 + https://github.com/owncloud/web/pull/7243 + +* Enhancement - Added a toolbar to pdf-viewer app: [#7201](https://github.com/owncloud/web/pull/7201) + + We've added a toolbar to the pdf-viewer app, where the user can see the name of the opened pdf file + and also close the app. + + https://github.com/owncloud/web/issues/7198 + https://github.com/owncloud/web/issues/7205 + https://github.com/owncloud/web/pull/7201 + https://github.com/owncloud/web/pull/7207 + * Enhancement - Reposition notifications: [#7139](https://github.com/owncloud/web/pull/7139) We've repositioned the notifications to no longer block the searchbar - they are now in the @@ -52,6 +185,17 @@ Details https://github.com/owncloud/web/issues/7082 https://github.com/owncloud/web/pull/7139 +* Enhancement - Resolve bookmarked public links with password protection: [#7030](https://github.com/owncloud/web/issues/7030) + + Bookmarks to a public link (e.g. when user navigated into a subfolder and then created a + bookmark) or to an app that was opened from a public link (e.g. photo opened in preview app) now + properly resolve the public link context before loading the bookmarked content. This + includes a roundtrip to the password input prompt for password protected public link, e.g. + when a password was set in the first place, has been changed in the meantime, etc. + + https://github.com/owncloud/web/issues/7030 + https://github.com/owncloud/web/pull/7072 + * Enhancement - Improve performance of share indicators: [#7038](https://github.com/owncloud/web/issues/7038) We've improved the performance of share indicators when loading resource tables as well as @@ -60,6 +204,15 @@ Details https://github.com/owncloud/web/issues/7038 https://github.com/owncloud/web/pull/7188 +* Enhancement - Option to block file extensions from text-editor app: [#6661](https://github.com/owncloud/web/issues/6661) + + We've added support to block certain file extensions from the text-editor app with additional + config. See + https://owncloud.dev/clients/web/deployments/oc10-app/#additional-configuration-for-certain-core-apps + + https://github.com/owncloud/web/issues/6661 + https://github.com/owncloud/web/pull/7174 + * Enhancement - Update ODS to v14.0.0-alpha.2: [#7139](https://github.com/owncloud/web/pull/7139) We updated the ownCloud Design System to version 14.0.0-alpha.2. Please refer to the full diff --git a/changelog/unreleased/bugfix-context-menu-misplaced-triggered-by-keyboard-navigation b/changelog/unreleased/bugfix-context-menu-misplaced-triggered-by-keyboard-navigation new file mode 100644 index 00000000000..61d3e0a52e5 --- /dev/null +++ b/changelog/unreleased/bugfix-context-menu-misplaced-triggered-by-keyboard-navigation @@ -0,0 +1,6 @@ +Bugfix: Context menu misplaced when triggered by keyboard navigation + +We've fixed a bug where triggering the context menu by keyboard navigation misplaced the menu and made it inaccessible. + +https://github.com/owncloud/web/pull/7230 +https://github.com/owncloud/web/issues/7187 diff --git a/changelog/unreleased/bugfix-error-when-pasting-empty-clipboard b/changelog/unreleased/bugfix-error-when-pasting-empty-clipboard new file mode 100644 index 00000000000..3346fdde53e --- /dev/null +++ b/changelog/unreleased/bugfix-error-when-pasting-empty-clipboard @@ -0,0 +1,6 @@ +Bugfix: Prevent error when pasting with empty clipboard + +We've fixed a bug where an error was thrown when pasting with empty clipboard + +https://github.com/owncloud/web/pull/7214 +https://github.com/owncloud/web/issues/7146 diff --git a/changelog/unreleased/bugfix-logout-deleted-user b/changelog/unreleased/bugfix-logout-deleted-user new file mode 100644 index 00000000000..a34227ae0a5 --- /dev/null +++ b/changelog/unreleased/bugfix-logout-deleted-user @@ -0,0 +1,9 @@ +Bugfix: Logout deleted user on page reload + +A user that gets disabled or deleted in the backend now sees an authentication error page upon page reload. +From there they can now properly reach the login page to log in again via a different user (or leave the page entirely). + +https://github.com/owncloud/web/issues/4677 +https://github.com/owncloud/web/issues/4564 +https://github.com/owncloud/web/issues/4795 +https://github.com/owncloud/web/pull/7072 diff --git a/changelog/unreleased/bugfix-preview-app-filename-hovers-over-image b/changelog/unreleased/bugfix-preview-app-filename-hovers-over-image new file mode 100644 index 00000000000..5c52913619c --- /dev/null +++ b/changelog/unreleased/bugfix-preview-app-filename-hovers-over-image @@ -0,0 +1,9 @@ +Bugfix: Filename hovers over the image in the preview app + +We've fixed a bug where the filename hovers over the image content in the preview app and the bottom toolbar is not +accurate centered. +Therefore we have introduced a new top bar, where the filename will be shown +and the download and the close button will be displayed. + +https://github.com/owncloud/web/pull/7216 +https://github.com/owncloud/web/issues/6300 diff --git a/changelog/unreleased/bugfix-shared-with-others-page-apps-not-working-oc10 b/changelog/unreleased/bugfix-shared-with-others-page-apps-not-working-oc10 new file mode 100644 index 00000000000..814dcaac2cd --- /dev/null +++ b/changelog/unreleased/bugfix-shared-with-others-page-apps-not-working-oc10 @@ -0,0 +1,7 @@ +Bugfix: Shared with others page apps not working with oc10 as backend + +We've fixed a bug where apps like preview, pdf-viewer or text-editor weren't working while browsing +the shared with others page with oc10 as backend. + +https://github.com/owncloud/web/pull/7228 +https://github.com/owncloud/web/issues/7049 diff --git a/changelog/unreleased/bugfix-space-and-user-management-permissions b/changelog/unreleased/bugfix-space-and-user-management-permissions new file mode 100644 index 00000000000..bd8e1552474 --- /dev/null +++ b/changelog/unreleased/bugfix-space-and-user-management-permissions @@ -0,0 +1,8 @@ +Bugfix: Create space and access user management permission + +We've fixed a bug, where users with insufficient permissions could access the user management and were able to see +the "New Space" button in the space overview. + +https://github.com/owncloud/web/pull/7197 +https://github.com/owncloud/web/issues/7181 +https://github.com/owncloud/web/issues/7079 diff --git a/changelog/unreleased/bugfix-token-renewal b/changelog/unreleased/bugfix-token-renewal new file mode 100644 index 00000000000..9dc49ff5f0e --- /dev/null +++ b/changelog/unreleased/bugfix-token-renewal @@ -0,0 +1,14 @@ +Bugfix: Access token renewal + +Access token renewals had some flaws which have been fixed as follows: +- OAuth2: access token renewal was not working at all, fixed by switching to authorization code flow with PKCE extension and by migrating from the unmaintained `oidc-client` library to `oidc-client-ts`. +- OpenID Connect: when `offline_access` scope was not requested each token renewal caused a redirect to `/`, which was due to a faulty token update implementation and is fixed. + +WARNING: With a setup of ownCloud 10.x.x + oauth2-app older than v0.5.3 this bugfix is a breaking change. +There was a bug in the oauth2-app that required to add the `clientSecret` in the `auth` section of the `config.json` file (although code flow with PKCE doesn't need it). +To mitigate this, please add the `clientSecret` for your `clientId` to the `config.json` file. If the oauth2-app v0.5.3 or newer is +used that's not needed. + +https://github.com/owncloud/web/issues/7030 +https://github.com/owncloud/web/pull/7072 +https://github.com/owncloud/web/pull/7242 diff --git a/changelog/unreleased/enhancement-add-app-top-bar-component b/changelog/unreleased/enhancement-add-app-top-bar-component new file mode 100644 index 00000000000..7f5e0263cb6 --- /dev/null +++ b/changelog/unreleased/enhancement-add-app-top-bar-component @@ -0,0 +1,6 @@ +Enhancement: Add app top bar component + +We've added a app top bar component for consistency, +which will be used by the apps: preview, text-editor and pdf-viewer. + +https://github.com/owncloud/web/pull/7217 diff --git a/changelog/unreleased/enhancement-blocking-application-bootstrap b/changelog/unreleased/enhancement-blocking-application-bootstrap new file mode 100644 index 00000000000..f8dd043e2a9 --- /dev/null +++ b/changelog/unreleased/enhancement-blocking-application-bootstrap @@ -0,0 +1,9 @@ +Enhancement: Loading context blocks application bootstrap + +The bootstrap architecture has been improved to ensure that the respective context (user or public link) +is fully resolved before applications can finalize their boot process and switch over to rendering their content. +This means that application developers can rely on user data / public link data being loaded (including +e.g. capabilities) when the web runtime triggers the boot processes and rendering of applications. + +https://github.com/owncloud/web/issues/7030 +https://github.com/owncloud/web/pull/7072 diff --git a/changelog/unreleased/enhancement-change-own-password b/changelog/unreleased/enhancement-change-own-password new file mode 100644 index 00000000000..bfcd56da2f8 --- /dev/null +++ b/changelog/unreleased/enhancement-change-own-password @@ -0,0 +1,7 @@ +Enhancement: Add change own password dialog to the account info page + +We have added a new change own password dialog to the account info page, +so the user has the possibility to change their own password. + +https://github.com/owncloud/web/pull/7206 +https://github.com/owncloud/web/issues/7183 diff --git a/changelog/unreleased/enhancement-ocis-resharing b/changelog/unreleased/enhancement-ocis-resharing new file mode 100644 index 00000000000..f192cd13ab1 --- /dev/null +++ b/changelog/unreleased/enhancement-ocis-resharing @@ -0,0 +1,9 @@ +Enhancement: Re-sharing for ocis + +We've enhanced web to be able to re-share resources when using an ownCloud infinite scale backend. It now works for project and personal spaces as well as the sharing jail. +Besides that we also send roles, space-ref and path as separate values to the sharing api which simplifies the usage of it. + +https://github.com/owncloud/web/pull/7086 +https://github.com/owncloud/web/issues/6894 +https://github.com/owncloud/web/pull/7243 +https://github.com/owncloud/web/issues/7225 diff --git a/changelog/unreleased/enhancement-pdf-viewer-app-toolbar b/changelog/unreleased/enhancement-pdf-viewer-app-toolbar new file mode 100644 index 00000000000..fb69a375fad --- /dev/null +++ b/changelog/unreleased/enhancement-pdf-viewer-app-toolbar @@ -0,0 +1,9 @@ +Enhancement: Added a toolbar to pdf-viewer app + +We've added a toolbar to the pdf-viewer app, +where the user can see the name of the opened pdf file and also close the app. + +https://github.com/owncloud/web/pull/7201 +https://github.com/owncloud/web/pull/7207 +https://github.com/owncloud/web/issues/7198 +https://github.com/owncloud/web/issues/7205 diff --git a/changelog/unreleased/enhancement-resolve-bookmarked-public-links-with-password b/changelog/unreleased/enhancement-resolve-bookmarked-public-links-with-password new file mode 100644 index 00000000000..d5999c88de0 --- /dev/null +++ b/changelog/unreleased/enhancement-resolve-bookmarked-public-links-with-password @@ -0,0 +1,10 @@ +Enhancement: Resolve bookmarked public links with password protection + +Bookmarks to a public link (e.g. when user navigated into a subfolder and then created a bookmark) or +to an app that was opened from a public link (e.g. photo opened in preview app) now properly resolve +the public link context before loading the bookmarked content. This includes a roundtrip to the +password input prompt for password protected public link, e.g. when a password was set in the first +place, has been changed in the meantime, etc. + +https://github.com/owncloud/web/issues/7030 +https://github.com/owncloud/web/pull/7072 diff --git a/changelog/unreleased/enhancement-text-editor-block-file-extensions b/changelog/unreleased/enhancement-text-editor-block-file-extensions new file mode 100644 index 00000000000..34d08641d93 --- /dev/null +++ b/changelog/unreleased/enhancement-text-editor-block-file-extensions @@ -0,0 +1,6 @@ +Enhancement: Option to block file extensions from text-editor app + +We've added support to block certain file extensions from the text-editor app with additional config. See https://owncloud.dev/clients/web/deployments/oc10-app/#additional-configuration-for-certain-core-apps + +https://github.com/owncloud/web/issues/6661 +https://github.com/owncloud/web/pull/7174 diff --git a/dev/docker/oc10.web.config.json b/dev/docker/oc10.web.config.json index 679cd74b35d..51471508d73 100644 --- a/dev/docker/oc10.web.config.json +++ b/dev/docker/oc10.web.config.json @@ -2,6 +2,7 @@ "server": "http://host.docker.internal:8080", "auth": { "clientId": "M8W5mo3wQV3VHWYsaYpWhkr8dwa949i4GljCkedHhl7GWqmHMkxSeJgK2PcS0jt5", + "clientSecret": "sqvPYXK94tMsEEVOYORxg8Ufesi2kC4WpJJSYb0Kj1DSAYl6u2XvJZjc3VcitjDv", "url": "http://host.docker.internal:8080/index.php/apps/oauth2/api/v1/token", "authUrl": "http://host.docker.internal:8080/index.php/apps/oauth2/authorize", "logoutUrl": "http://host.docker.internal:8080/index.php/logout" diff --git a/docker-compose.yml b/docker-compose.yml index 084670fa021..d0dc73eb9ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,6 +17,9 @@ services: OCIS_JWT_SECRET: "${OCIS_JWT_SECRET:-some-ocis-jwt-secret}" OCIS_MACHINE_AUTH_API_KEY: "${OCIS_MACHINE_AUTH_API_KEY:-some-ocis-machine-auth-api-key}" + # FRONTEND + FRONTEND_ENABLE_RESHARING: "true" + # WEB WEB_UI_CONFIG: ${WEB_UI_CONFIG:-/web/config.json} WEB_ASSET_PATH: ${WEB_ASSET_PATH:-/web/dist} @@ -32,7 +35,7 @@ services: IDP_LDAP_BIND_PASSWORD: "${IDP_LDAP_BIND_PASSWORD:-some-ldap-idp-password}" IDP_IDENTIFIER_REGISTRATION_CONF: ${IDP_IDENTIFIER_REGISTRATION_CONF:-/web/identifier-registration.yml} - # Storage + # STORAGE STORAGE_HOME_DRIVER: ${STORAGE_HOME_DRIVER:-ocis} STORAGE_USERS_DRIVER: ${STORAGE_USERS_DRIVER:-ocis} STORAGE_TRANSFER_SECRET: "${STORAGE_TRANSFER_SECRET:-some-ocis-transfer-secret}" @@ -43,6 +46,7 @@ services: AUTH_BASIC_LDAP_BIND_PASSWORD: "${AUTH_BASIC_LDAP_BIND_PASSWORD:-some-ldap-reva-password}" GRAPH_LDAP_BIND_PASSWORD: "${GRAPH_LDAP_BIND_PASSWORD:-some-ldap-idm-password}" + # PROXY PROXY_ENABLE_BASIC_AUTH: "${PROXY_ENABLE_BASIC_AUTH:-true}" volumes: - ./dev/docker/ocis.entrypoint.sh:/usr/bin/entrypoint diff --git a/docs/deployments/oc10-app.md b/docs/deployments/oc10-app.md index eb5b4cd67eb..eaa07419331 100644 --- a/docs/deployments/oc10-app.md +++ b/docs/deployments/oc10-app.md @@ -9,11 +9,11 @@ geekdocFilePath: oc10-app.md {{< toc >}} -The ownCloud Web is being deployed as an app to [ownCloud marketplace](https://marketplace.owncloud.com/) to enable easy early integration into existing ownCloud 10 instances. +ownCloud Web is being deployed as an app to [ownCloud marketplace](https://marketplace.owncloud.com/) to enable easy integration into existing ownCloud 10 instances. After completing this setup, ownCloud Web will be available on `https:///index.php/apps/web`. ## Prerequisites -- Running [ownCloud 10 server](https://owncloud.com/download-server/) with version 10.6 +- Running [ownCloud 10 server](https://owncloud.com/download-server/) with version 10.8 - Installed [oauth2 app](https://marketplace.owncloud.com/apps/oauth2) - Command line access to your server @@ -33,7 +33,7 @@ You can mark the ownCloud web client as `trusted` by clicking the respective che {{< /hint >}} {{< hint >}} -If you use OpenID Connect you instead need to add a new client for ownCloud Web to your identity provider. +If you use OpenID Connect you need to add a new client for ownCloud Web to your identity provider instead. {{< /hint >}} ## Configure ownCloud 10 @@ -72,7 +72,8 @@ There are a few config values which need to be set in order for ownCloud Web to "auth": { "clientId": "", "url": "https:///index.php/apps/oauth2/api/v1/token", - "authUrl": "https:///index.php/apps/oauth2/authorize" + "authUrl": "https:///index.php/apps/oauth2/authorize", + "logoutUrl": "https:///index.php/logout" }, "apps" : [ "files", @@ -241,13 +242,37 @@ In case the backend has additional preview providers configured there is no mech "mimeTypes": ["image/tiff", "image/webp"] } } - ], + ] ``` If you already have an `"external_apps"` section, just add the preview app to the list. Please adjust the `"mimeTypes"` list according to your additional preview providers. See https://github.com/owncloud/files_mediaviewer#supporting-more-media-types for advise on how to add preview providers to the backend. +### Text-Editor app +The `text-editor` app provides a list of file extensions that the app is associated with, both for opening files and for creating new files. +By default, only `.txt` and `.md` files appear in the file creation menu and offer the text-editor as default app on a left mouse click +in the file list. For other file types the text-editor app only appears in the right mouse click context menu. In case you want to change this +default set of primary file extensions for the text-editor you can overwrite it as follows: +1. Remove the `"text-editor"` string from the `"apps"` section in your `config.json` file +2. Add the following config to your `config.json` file: +```json +"external_apps": [ + { + "id": "text-editor", + "path": "web-app-text-editor", + "config": { + "primaryExtensions": ["txt", "yaml"] + } + } + ] +``` +With the above example config the text editor will offer creation of new files for `.txt` and `.yaml` files instead of `.txt` and `.md` files. +Also, a left mouse click on any `.txt` or `.yaml` file will open the respective file in the text-editor app. In this example, `.md` files would +not be opened in the text-editor by default anymore, but the text-editor will would appear in the context menu for the file as alternative app. + +If you already have an `"external_apps"` section, just add the preview app to the list. Please adjust the `"mimeTypes"` list according to your additional preview providers. See https://github.com/owncloud/files_mediaviewer#supporting-more-media-types for advise on how to add preview providers to the backend. + {{< hint info >}} -The reason why the `preview` app needs to be ported from the `apps` section to the `external_apps` section is that only the `external_apps` support additional configuration. There are plans to change the configuration of apps to give you a coherent admin experience in that regard. +The reason why the app needs to be ported from the `apps` section to the `external_apps` section is that only the `external_apps` support additional configuration. There are plans to change the configuration of apps to give you a coherent admin experience in that regard. {{< /hint >}} ## Accessing ownCloud Web diff --git a/docs/testing/acceptance-tests-all.md b/docs/testing/acceptance-tests-all.md index 53549b07bac..2cab445065d 100644 --- a/docs/testing/acceptance-tests-all.md +++ b/docs/testing/acceptance-tests-all.md @@ -92,32 +92,6 @@ see [available settings](#available-settings-to-be-set-by-environment-variables) - run `yarn test:acceptance:ocis ` - If you are a mac user, run `STORAGE_HOME_DATA_SERVER_URL='http://host.docker.internal:9155/data' STORAGE_DATAGATEWAY_PUBLIC_URL='https://host.docker.internal:9200/data' STORAGE_USERS_DATA_SERVER_URL='http://host.docker.internal:9158/data' STORAGE_FRONTEND_PUBLIC_URL='https://host.docker.internal:9200' PROXY_ENABLE_BASIC_AUTH=true PROXY_OIDC_ISSUER='https://host.docker.internal:9200' IDP_INSECURE='true' IDP_IDENTIFIER_REGISTRATION_CONF='./mac-identifier-registration.yml' IDP_ISS='https://host.docker.internal:9200' IDP_TLS='true' yarn test:acceptance:ocis ` -### Visual Regression Testing - -The test suite consists of snapshots of UI components which can be compared for visual regression testing when running the acceptance tests. These comparisons are done in the existing scenarios. You can check the existing snapshots of the components in the directory `/tests/vrt/baseline`. - -#### Running the visual regression tests - -When you run the acceptance tests as usual, all the visual regression comparisons are skipped. To run the acceptance test suite with the visual comparison enabled you need to set the env variable, `VISUAL_TEST` to `true` - -eg. -``` -VISUAL_TEST=true yarn test:acceptance:oc10 -``` - -#### Updating the snapshots - -If there is some change in the components, and you want to update the snapshots of the components you can run the tests with `UPDATE_VRT_SCREENSHOTS` set to `true`. When this env variable is set, the testrunner will ignore if the visual comparison fails and updates the baseline images with the latest images if the comparison fails. - -eg. -``` -VISUAL_TEST=true UPDATE_VRT_SCREENSHOTS=true yarn test:acceptance:oc10 -``` - -**note** Visual regression testing may not be completely reliable every time as small changes such as window size and screen resolution may affect the result. For better results it is recommended that you run the tests using the `selenium/standalone-chrome-debug` image of selenium and window size of `1280x1024` - -see [available settings](#available-settings-to-be-set-by-environment-variables) for further setup if needed - ## Available settings to be set by environment variables These values can be set using the environment variables to configure `yarn test:acceptance:oc10` and `yarn test:acceptance:ocis` to match your local test environment. @@ -138,8 +112,6 @@ These values can be set using the environment variables to configure `yarn test: | `OCIS_REVA_DATA_ROOT` | Data directory of oCIS | /var/tmp/reva | | `TESTING_DATA_DIR` | Testing data directory for new users | - | | `WEB_UI_CONFIG` | Path for the web config file (usually in the dist folder) | - | -| `VISUAL_TEST` | Run the visual regression comparison while running the acceptance tests | - | -| `UPDATE_VRT_SCREENSHOTS` | Update the baseline snapshots with the latest images for visual regression tests | - | | `MIDDLEWARE_HOST` | Middleware host URL | http://host.docker.internal:3000 | ## Tips diff --git a/packages/web-app-draw-io/l10n/translations.json b/packages/web-app-draw-io/l10n/translations.json index 3b39bfdbae6..efe2307f4df 100644 --- a/packages/web-app-draw-io/l10n/translations.json +++ b/packages/web-app-draw-io/l10n/translations.json @@ -1 +1 @@ -{"cs":{},"de":{"Couldn't save. Error when contacting the server":"Speicher nicht möglich. Fehler beim Kontaktieren des Servers","Diagram imported":"Diagramm importiert","Draw.io document":"Draw.io-Datei","Draw.io editor":"Draw.io Editor","File saved!":"Datei gespeichert!","Loading media":"Lade Daten","Saving error. You're not authorized to save this file":"Speicherfehler. Keine ausreichenden Berechtigungen, um die Datei zu speichern","The diagram could not be loaded…":"Das Diagramm konnte nicht geladen werden...","The diagram will open as a new .drawio file: %{file}":"Das Diagramm wird als neue .drawio Datei geöffnet: %{file}","This file was updated outside this window. Please refresh the page. All changes will be lost, so download a copy first.":"Die Datei wurde außerhalb dieses Fensters aktualisiert. Bitte lade die Seite neu. Alle Änderungen gehen dabei verloren, bitte lade erst eine Kopie herunter."},"es":{"Diagram imported":"Diagrama importado","Draw.io editor":"Editor Draw.io","Loading media":"Cargando medios","The diagram could not be loaded…":"El diagrama no puede cargarse ..."},"fr":{"Diagram imported":"Diagramme importé","Draw.io editor":"Éditeur Draw.io","Loading media":"Chargement du media","The diagram could not be loaded…":"Le diagramme ne peut pas être chargé..."},"gl":{},"it":{"Diagram imported":"Diagramma importato","Draw.io document":"Documento Draw.io","Draw.io editor":"Editor Draw.io","File saved!":"File salvato!","Loading media":"Caricamento media","Saving error. You're not authorized to save this file":"Errore di salvataggio. L'utente non è autorizzato a salvare questo file","The diagram could not be loaded…":"Non è stato possibile caricare il diagramma...","The diagram will open as a new .drawio file: %{file}":"Il diagramma verrà aperto come nuovo file .drawio: %{file}"}} \ No newline at end of file +{"cs":{},"de":{"Couldn't save. Error when contacting the server":"Speicher nicht möglich. Fehler beim Kontaktieren des Servers","Diagram imported":"Diagramm importiert","Draw.io document":"Draw.io-Datei","Draw.io editor":"Draw.io Editor","File saved!":"Datei gespeichert!","Loading media":"Lade Daten","Saving error. You're not authorized to save this file":"Speicherfehler. Keine ausreichenden Berechtigungen, um die Datei zu speichern","The diagram will open as a new .drawio file: %{file}":"Das Diagramm wird als neue .drawio Datei geöffnet: %{file}","This file was updated outside this window. Please refresh the page. All changes will be lost, so download a copy first.":"Die Datei wurde außerhalb dieses Fensters aktualisiert. Bitte lade die Seite neu. Alle Änderungen gehen dabei verloren, bitte lade erst eine Kopie herunter."},"es":{"Diagram imported":"Diagrama importado","Draw.io editor":"Editor Draw.io","Loading media":"Cargando medios"},"fr":{"Diagram imported":"Diagramme importé","Draw.io editor":"Éditeur Draw.io","Loading media":"Chargement du media"},"gl":{},"it":{"Diagram imported":"Diagramma importato","Draw.io document":"Documento Draw.io","Draw.io editor":"Editor Draw.io","File saved!":"File salvato!","Loading media":"Caricamento media","Saving error. You're not authorized to save this file":"Errore di salvataggio. L'utente non è autorizzato a salvare questo file","The diagram will open as a new .drawio file: %{file}":"Il diagramma verrà aperto come nuovo file .drawio: %{file}"}} \ No newline at end of file diff --git a/packages/web-app-draw-io/src/App.vue b/packages/web-app-draw-io/src/App.vue index 5267b47a4f1..0e36462cebf 100644 --- a/packages/web-app-draw-io/src/App.vue +++ b/packages/web-app-draw-io/src/App.vue @@ -14,7 +14,7 @@ diff --git a/packages/web-app-external/src/index.js b/packages/web-app-external/src/index.js index 1632b50974b..0f2e20cf558 100644 --- a/packages/web-app-external/src/index.js +++ b/packages/web-app-external/src/index.js @@ -24,7 +24,7 @@ export default { routes, store, translations, - userReady({ store }) { + ready({ store }) { store.dispatch('External/fetchMimeTypes') } } diff --git a/packages/web-app-external/tests/unit/__snapshots__/app.spec.js.snap b/packages/web-app-external/tests/unit/__snapshots__/app.spec.ts.snap similarity index 100% rename from packages/web-app-external/tests/unit/__snapshots__/app.spec.js.snap rename to packages/web-app-external/tests/unit/__snapshots__/app.spec.ts.snap diff --git a/packages/web-app-external/tests/unit/app.spec.js b/packages/web-app-external/tests/unit/app.spec.ts similarity index 88% rename from packages/web-app-external/tests/unit/app.spec.js rename to packages/web-app-external/tests/unit/app.spec.ts index 0bb4d3e204a..39cf553c1c8 100644 --- a/packages/web-app-external/tests/unit/app.spec.js +++ b/packages/web-app-external/tests/unit/app.spec.ts @@ -36,7 +36,6 @@ const mockFileInfo = jest.fn(() => ({ const storeOptions = { getters: { - getToken: jest.fn(() => 'GFwHKXdsMgoFwt'), configuration: jest.fn(() => ({ server: 'http://example.com/', currentTheme: { @@ -45,7 +44,6 @@ const storeOptions = { } } })), - userReady: () => true, capabilities: jest.fn(() => ({ files: { app_providers: [ @@ -70,6 +68,18 @@ const storeOptions = { mutations: { SET_MIME_TYPES: jest.fn() } + }, + runtime: { + namespaced: true, + modules: { + auth: { + namespaced: true, + getters: { + accessToken: jest.fn(() => 'GFwHKXdsMgoFwt'), + isUserContextReady: jest.fn(() => true) + } + } + } } } } @@ -92,6 +102,7 @@ const providerSuccessResponseGet = { describe('The app provider extension', () => { beforeEach(() => { + // eslint-disable-next-line @typescript-eslint/no-empty-function jest.spyOn(console, 'error').mockImplementation(() => {}) }) @@ -100,13 +111,16 @@ describe('The app provider extension', () => { }) it('should show a loading spinner while loading', async () => { - const makeRequest = jest.fn(() => - setTimeout(() => { - Promise.resolve({ - ok: true, - status: 200 + const makeRequest = jest.fn( + () => + new Promise((resolve, reject) => { + setTimeout(() => { + resolve({ + ok: true, + status: 200 + }) + }, 500) }) - }, 500) ) const wrapper = createShallowMountWrapper(makeRequest) await wrapper.vm.$nextTick() diff --git a/packages/web-app-files/src/App.vue b/packages/web-app-files/src/App.vue index 19165eb2cd8..4fe9e47ed29 100644 --- a/packages/web-app-files/src/App.vue +++ b/packages/web-app-files/src/App.vue @@ -23,12 +23,19 @@ import Mixins from './mixins' import { mapActions, mapState } from 'vuex' import SideBar from './components/SideBar/SideBar.vue' import { defineComponent } from '@vue/composition-api' +import { usePublicLinkPassword, useStore } from 'web-pkg/src/composables' export default defineComponent({ components: { SideBar }, mixins: [Mixins], + setup() { + const store = useStore() + return { + publicLinkPassword: usePublicLinkPassword({ store }) + } + }, computed: { ...mapState('Files/sidebar', { sidebarClosed: 'closed', diff --git a/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue b/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue index eb27cf283d4..3a047c5cea9 100644 --- a/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue +++ b/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue @@ -119,7 +119,13 @@ import MixinFileActions, { EDITOR_MODE_CREATE } from '../../mixins/fileActions' import { buildResource, buildWebDavFilesPath, buildWebDavSpacesPath } from '../../helpers/resources' import { isLocationPublicActive, isLocationSpacesActive } from '../../router' import { useActiveLocation } from '../../composables' -import { useRequest, useCapabilityShareJailEnabled } from 'web-pkg/src/composables' +import { + useRequest, + useCapabilityShareJailEnabled, + useStore, + usePublicLinkPassword, + useUserContext +} from 'web-pkg/src/composables' import { DavProperties, DavProperty } from 'web-pkg/src/constants' @@ -138,6 +144,7 @@ export default defineComponent({ setup() { const instance = getCurrentInstance().proxy const uppyService = instance.$uppyService + const store = useStore() onMounted(() => { const filesSelectedSub = uppyService.subscribe('filesSelected', instance.onFilesSelected) @@ -162,13 +169,15 @@ export default defineComponent({ uppyService }), ...useUploadHelpers(), + ...useRequest(), isPersonalLocation: useActiveLocation(isLocationSpacesActive, 'files-spaces-personal'), isPublicLocation: useActiveLocation(isLocationPublicActive, 'files-public-files'), isSpacesProjectsLocation: useActiveLocation(isLocationSpacesActive, 'files-spaces-projects'), isSpacesProjectLocation: useActiveLocation(isLocationSpacesActive, 'files-spaces-project'), isSpacesShareLocation: useActiveLocation(isLocationSpacesActive, 'files-spaces-share'), hasShareJail: useCapabilityShareJailEnabled(), - ...useRequest() + publicLinkPassword: usePublicLinkPassword({ store }), + isUserContext: useUserContext({ store }) } }, data: () => ({ @@ -177,14 +186,8 @@ export default defineComponent({ fileFolderCreationLoading: false }), computed: { - ...mapGetters(['getToken', 'capabilities', 'configuration', 'newFileHandlers', 'user']), - ...mapGetters('Files', [ - 'files', - 'currentFolder', - 'publicLinkPassword', - 'spaces', - 'selectedFiles' - ]), + ...mapGetters(['capabilities', 'configuration', 'newFileHandlers', 'user']), + ...mapGetters('Files', ['files', 'currentFolder', 'spaces', 'selectedFiles']), ...mapState('Files', ['areFileExtensionsShown']), mimetypesAllowedForCreation() { @@ -748,8 +751,7 @@ export default defineComponent({ conflicts.length ) - const isVersioningEnabled = - !this.publicPage() && this.capabilities.files && this.capabilities.files.versioning + const isVersioningEnabled = this.isUserContext && this.capabilities?.files?.versioning let translatedMsg if (isVersioningEnabled) { diff --git a/packages/web-app-files/src/components/AppBar/CreateSpace.vue b/packages/web-app-files/src/components/AppBar/CreateSpace.vue index 21e2173a96e..6922a31aceb 100644 --- a/packages/web-app-files/src/components/AppBar/CreateSpace.vue +++ b/packages/web-app-files/src/components/AppBar/CreateSpace.vue @@ -14,25 +14,18 @@ - diff --git a/packages/web-app-files/src/components/FilesList/ResourceTable.vue b/packages/web-app-files/src/components/FilesList/ResourceTable.vue index 0316e2f6383..d4e489acc70 100644 --- a/packages/web-app-files/src/components/FilesList/ResourceTable.vue +++ b/packages/web-app-files/src/components/FilesList/ResourceTable.vue @@ -136,6 +136,7 @@ ({ width: 0, height: 0, - top: event.clientY, - bottom: event.clientY, - left: event.clientX, - right: event.clientX + top: event.pointerType === 'mouse' ? event.clientY : contextMenuButtonPos.top, + bottom: event.pointerType === 'mouse' ? event.clientY : contextMenuButtonPos.bottom, + left: event.pointerType === 'mouse' ? event.clientX : contextMenuButtonPos.x, + right: event.pointerType === 'mouse' ? event.clientX : contextMenuButtonPos.x }) }) + dropdown.show() }, rowMounted(resource, component) { diff --git a/packages/web-app-files/src/components/Search/Preview.vue b/packages/web-app-files/src/components/Search/Preview.vue index 73e70d387d5..2989c7bf57c 100644 --- a/packages/web-app-files/src/components/Search/Preview.vue +++ b/packages/web-app-files/src/components/Search/Preview.vue @@ -22,7 +22,7 @@ import Vue from 'vue' import { mapGetters, mapState } from 'vuex' import { createLocationSpaces } from '../../router' import path from 'path' -import { useCapabilityShareJailEnabled, useStore } from 'web-pkg/src/composables' +import { useAccessToken, useCapabilityShareJailEnabled, useStore } from 'web-pkg/src/composables' const visibilityObserver = new VisibilityObserver() @@ -49,7 +49,8 @@ export default { resourceTargetLocation: createLocationSpaces('files-spaces-personal', { params: { storageId: store.getters.user.id } }), - resourceTargetLocationSpace: createLocationSpaces('files-spaces-project') + resourceTargetLocationSpace: createLocationSpaces('files-spaces-project'), + accessToken: useAccessToken({ store }) } }, data() { @@ -58,7 +59,7 @@ export default { } }, computed: { - ...mapGetters(['configuration', 'user', 'getToken']), + ...mapGetters(['configuration', 'user']), ...mapState('Files', ['spaces']), matchingSpace() { @@ -96,7 +97,7 @@ export default { dimensions: ImageDimension.Thumbnail, server: this.configuration.server, userId: this.user.id, - token: this.getToken + token: this.accessToken }, true ) diff --git a/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue b/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue index a82e561adc2..98df6977a44 100644 --- a/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue +++ b/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue @@ -148,12 +148,19 @@ import { ImageDimension } from '../../../constants' import { loadPreview } from '../../../helpers/resource' import upperFirst from 'lodash-es/upperFirst' import path from 'path' -import { createLocationSpaces, isAuthenticatedRoute, isLocationSpacesActive } from '../../../router' +import { createLocationSpaces, isLocationSpacesActive } from '../../../router' import { ShareTypes } from '../../../helpers/share' -import { useRouteParam, useRouter } from 'web-pkg/src/composables' +import { + useAccessToken, + usePublicLinkContext, + useRouteParam, + useRouter, + useStore +} from 'web-pkg/src/composables' import { getIndicators } from '../../../helpers/statusIndicators' import copyToClipboard from 'copy-to-clipboard' import { encodePath } from 'web-pkg/src/utils' +import { isUserContext } from 'web-runtime/src/router' export default defineComponent({ name: 'FileDetails', @@ -163,6 +170,7 @@ export default defineComponent({ setup() { const sharedParentDir = ref('') const router = useRouter() + const store = useStore() const currentStorageId = useRouteParam('storageId') const sharedParentRoute = computed(() => { @@ -180,7 +188,8 @@ export default defineComponent({ return { sharedParentDir, sharedParentRoute, - currentStorageId + isPublicLinkContext: usePublicLinkContext({ store }), + accessToken: useAccessToken({ store }) } }, @@ -197,7 +206,7 @@ export default defineComponent({ }), computed: { ...mapGetters('Files', ['versions', 'sharesTree', 'sharesTreeLoading']), - ...mapGetters(['user', 'getToken', 'configuration']), + ...mapGetters(['user', 'configuration']), file() { return this.displayedItem.value @@ -251,7 +260,7 @@ export default defineComponent({ ) }, showShares() { - return this.hasAnyShares && isAuthenticatedRoute(this.$route) + return this.hasAnyShares && isUserContext(this.$router, this.$route) }, detailSharingInformation() { const isFolder = this.file.type === 'folder' @@ -307,7 +316,7 @@ export default defineComponent({ if (this.file.type === 'folder') { return } - return this.versions.length > 0 && isAuthenticatedRoute(this.$route) + return this.versions.length > 0 && isUserContext(this.$router, this.$route) }, versionsLabel() { return this.$gettext('Versions') @@ -374,11 +383,11 @@ export default defineComponent({ await new Promise((resolve) => setTimeout(resolve, 500)) return loadPreview({ resource: this.file, - isPublic: !isAuthenticatedRoute(this.$route), + isPublic: this.isPublicLinkContext, dimensions: ImageDimension.Preview, server: this.configuration.server, userId: this.user.id, - token: this.getToken + token: this.accessToken }) }, lazy: true, @@ -393,7 +402,7 @@ export default defineComponent({ client: this.$client, path: this.file.path, $gettext: this.$gettext, - ...(this.currentStorageId && { storageId: this.currentStorageId }) + storageId: this.file.fileId }) this.shareIndicators = getIndicators(this.file, this.sharesTree) }, @@ -423,7 +432,7 @@ export default defineComponent({ async loadData() { this.loading = true const calls = [] - if (this.file.type === 'file' && isAuthenticatedRoute(this.$route)) { + if (this.file.type === 'file' && isUserContext(this.$router, this.$route)) { calls.push(this.loadVersions({ client: this.$client, fileId: this.file.id })) } await Promise.all(calls.map((p) => p.catch((e) => e))) diff --git a/packages/web-app-files/src/components/SideBar/Details/SpaceDetails.vue b/packages/web-app-files/src/components/SideBar/Details/SpaceDetails.vue index 1a422faa4ec..da421f963c7 100644 --- a/packages/web-app-files/src/components/SideBar/Details/SpaceDetails.vue +++ b/packages/web-app-files/src/components/SideBar/Details/SpaceDetails.vue @@ -64,15 +64,16 @@ diff --git a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/RecipientContainer.vue b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/RecipientContainer.vue index c0194fa9b34..9a22bc68220 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/RecipientContainer.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/RecipientContainer.vue @@ -21,6 +21,7 @@ import { mapGetters } from 'vuex' import { avatarUrl } from '../../../../../helpers/user' import { ShareTypes } from '../../../../../helpers/share' +import { useAccessToken, useStore } from 'web-pkg/src/composables' export default { props: { @@ -35,6 +36,14 @@ export default { } }, + setup() { + const store = useStore() + const accessToken = useAccessToken({ store }) + return { + accessToken + } + }, + data() { return { formattedRecipient: { @@ -49,7 +58,7 @@ export default { }, computed: { - ...mapGetters(['configuration', 'getToken', 'capabilities']), + ...mapGetters(['configuration', 'capabilities']), btnDeselectRecipientLabel() { const translated = this.$gettext('Deselect %{name}') @@ -65,7 +74,7 @@ export default { clientService: this.$clientService, server: this.configuration.server, username: this.recipient.value.shareWith, - token: this.getToken + token: this.accessToken }) } catch (error) { console.error(error) diff --git a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue index 1e6c4636827..3baa191299d 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue @@ -97,7 +97,7 @@ - diff --git a/packages/web-app-files/src/views/shares/SharedResource.vue b/packages/web-app-files/src/views/shares/SharedResource.vue index 2a9f78566ee..d0ecc8b84d2 100644 --- a/packages/web-app-files/src/views/shares/SharedResource.vue +++ b/packages/web-app-files/src/views/shares/SharedResource.vue @@ -236,8 +236,7 @@ export default defineComponent({ this.$gettext, this.$gettextInterpolate, this.$ngettext, - this.$route.name, - this.publicLinkPassword + this.$route.name ) for (const resource of movedResources) { this.REMOVE_FILE(resource) diff --git a/packages/web-app-files/src/views/shares/SharedWithMe.vue b/packages/web-app-files/src/views/shares/SharedWithMe.vue index e9ac26b0373..62f3cee9541 100644 --- a/packages/web-app-files/src/views/shares/SharedWithMe.vue +++ b/packages/web-app-files/src/views/shares/SharedWithMe.vue @@ -298,7 +298,7 @@ export default defineComponent({ computed: { ...mapGetters('Files', ['selectedFiles']), - ...mapGetters(['configuration', 'getToken']), + ...mapGetters(['configuration']), ...mapState('Files/sidebar', { sidebarClosed: 'closed' }), // pending shares diff --git a/packages/web-app-files/src/views/shares/SharedWithOthers.vue b/packages/web-app-files/src/views/shares/SharedWithOthers.vue index cb0b63fdf53..950b5750e5c 100644 --- a/packages/web-app-files/src/views/shares/SharedWithOthers.vue +++ b/packages/web-app-files/src/views/shares/SharedWithOthers.vue @@ -104,7 +104,7 @@ export default defineComponent({ ...mapState(['app']), ...mapState('Files', ['files']), ...mapGetters('Files', ['highlightedFile', 'totalFilesCount']), - ...mapGetters(['configuration', 'getToken', 'user']), + ...mapGetters(['configuration', 'user']), ...mapState('Files/sidebar', { sidebarClosed: 'closed' }), isEmpty() { diff --git a/packages/web-app-files/src/views/spaces/Project.vue b/packages/web-app-files/src/views/spaces/Project.vue index 438d4b08f3d..ac83ceef129 100644 --- a/packages/web-app-files/src/views/spaces/Project.vue +++ b/packages/web-app-files/src/views/spaces/Project.vue @@ -148,6 +148,7 @@ import { VisibilityObserver } from 'web-pkg/src/observer' import Mixins from '../../mixins' import SpaceContextActions from '../../components/Spaces/SpaceContextActions.vue' import { useResourcesViewDefaults } from '../../composables' +import { useAccessToken, useStore } from 'web-pkg/src/composables' import KeyboardActions from '../../components/FilesList/KeyboardActions.vue' const visibilityObserver = new VisibilityObserver() @@ -173,12 +174,14 @@ export default defineComponent({ } }, setup() { + const store = useStore() const space = ref({}) return { ...useResourcesViewDefaults(), resourceTargetLocation: createLocationSpaces('files-spaces-project'), - space + space, + accessToken: useAccessToken({ store }) } }, data: function () { @@ -197,10 +200,9 @@ export default defineComponent({ 'highlightedFile', 'currentFolder', 'totalFilesCount', - 'totalFilesSize', - 'publicLinkPassword' + 'totalFilesSize' ]), - ...mapGetters(['user', 'getToken', 'configuration']), + ...mapGetters(['user', 'configuration']), breadcrumbs() { return concatBreadcrumbs( @@ -289,7 +291,7 @@ export default defineComponent({ dimensions: ImageDimension.Preview, server: this.configuration.server, userId: this.user.id, - token: this.getToken + token: this.accessToken }).then((imageBlob) => { this.imageContent = imageBlob }) @@ -381,8 +383,7 @@ export default defineComponent({ this.$gettext, this.$gettextInterpolate, this.$ngettext, - this.$route.name, - this.publicLinkPassword + this.$route.name ) for (const resource of movedResources) { this.REMOVE_FILE(resource) diff --git a/packages/web-app-files/src/views/spaces/Projects.vue b/packages/web-app-files/src/views/spaces/Projects.vue index 803f5fef6c8..f97179c5809 100644 --- a/packages/web-app-files/src/views/spaces/Projects.vue +++ b/packages/web-app-files/src/views/spaces/Projects.vue @@ -8,7 +8,7 @@ :show-actions-on-selection="true" > - diff --git a/packages/web-pkg/src/composables/appDefaults/useAppDefaults.ts b/packages/web-pkg/src/composables/appDefaults/useAppDefaults.ts index 92dcdade0e4..322b68af9e5 100644 --- a/packages/web-pkg/src/composables/appDefaults/useAppDefaults.ts +++ b/packages/web-pkg/src/composables/appDefaults/useAppDefaults.ts @@ -45,7 +45,7 @@ export function useAppDefaults(options: AppDefaultsOptions): AppDefaultsResult { const clientService = options.clientService ?? useClientService() const applicationId = options.applicationId - const isPublicLinkContext = usePublicLinkContext({ currentRoute }) + const isPublicLinkContext = usePublicLinkContext({ store }) const publicLinkPassword = usePublicLinkPassword({ store }) const currentFileContext = computed((): FileContext => { @@ -77,7 +77,13 @@ export function useAppDefaults(options: AppDefaultsOptions): AppDefaultsResult { isPublicLinkContext, publicLinkPassword }), - ...useAppFolderHandling({ clientService, store, isPublicLinkContext, publicLinkPassword }), + ...useAppFolderHandling({ + clientService, + store, + currentRoute, + isPublicLinkContext, + publicLinkPassword + }), ...useRequest({ clientService, store, currentRoute: unref(currentRoute) }) } } diff --git a/packages/web-pkg/src/composables/appDefaults/useAppFolderHandling.ts b/packages/web-pkg/src/composables/appDefaults/useAppFolderHandling.ts index 6ce2c456124..33084a39fab 100644 --- a/packages/web-pkg/src/composables/appDefaults/useAppFolderHandling.ts +++ b/packages/web-pkg/src/composables/appDefaults/useAppFolderHandling.ts @@ -10,9 +10,12 @@ import { buildResource } from '../../../../web-app-files/src/helpers/resources' import { Resource } from '../../../../web-app-files/src/helpers/resource' import { FileContext } from './types' +import { authService } from 'web-runtime/src/services/auth' +import { Route } from 'vue-router' interface AppFolderHandlingOptions { store: Store + currentRoute: Ref clientService?: ClientService isPublicLinkContext: MaybeRef publicLinkPassword: MaybeRef @@ -27,6 +30,7 @@ export interface AppFolderHandlingResult { export function useAppFolderHandling({ store, + currentRoute, clientService: { owncloudSdk: client }, isPublicLinkContext, publicLinkPassword @@ -59,6 +63,9 @@ export function useAppFolderHandling({ files: resources.slice(1) }) } catch (error) { + if (error.statusCode === 401) { + return authService.handleAuthError(unref(currentRoute)) + } store.commit('Files/SET_CURRENT_FOLDER', null) console.error(error) } diff --git a/packages/web-pkg/src/composables/authContext/index.ts b/packages/web-pkg/src/composables/authContext/index.ts index df52ed2e6be..b2b2b646118 100644 --- a/packages/web-pkg/src/composables/authContext/index.ts +++ b/packages/web-pkg/src/composables/authContext/index.ts @@ -1,5 +1,6 @@ export * from './useAccessToken' export * from './usePublicLinkContext' export * from './usePublicLinkPassword' -export * from './usePublicToken' +export * from './usePublicLinkToken' export * from './useRequest' +export * from './useUserContext' diff --git a/packages/web-pkg/src/composables/authContext/useAccessToken.ts b/packages/web-pkg/src/composables/authContext/useAccessToken.ts index cfb68b0ffc9..88cf0f1dc89 100644 --- a/packages/web-pkg/src/composables/authContext/useAccessToken.ts +++ b/packages/web-pkg/src/composables/authContext/useAccessToken.ts @@ -7,6 +7,6 @@ interface AccessTokenOptions { export const useAccessToken = ({ store }: AccessTokenOptions) => { return computed(() => { - return store.getters.getToken + return store.getters['runtime/auth/accessToken'] }) } diff --git a/packages/web-pkg/src/composables/authContext/usePublicLinkContext.ts b/packages/web-pkg/src/composables/authContext/usePublicLinkContext.ts index 551ad72b35c..94958f54b75 100644 --- a/packages/web-pkg/src/composables/authContext/usePublicLinkContext.ts +++ b/packages/web-pkg/src/composables/authContext/usePublicLinkContext.ts @@ -1,16 +1,12 @@ -import { Route } from 'vue-router' -import { computed, unref } from '@vue/composition-api' -import { contextRouteNameKey } from '../appDefaults/useAppNavigation' -import { MaybeRef } from '../../utils' -import { useRoute } from '../router' +import { computed } from '@vue/composition-api' +import { Store } from 'vuex' -interface PublicLinkTokenOptions { - currentRoute?: MaybeRef +interface PublicLinkContextOptions { + store: Store } -export const usePublicLinkContext = (options: PublicLinkTokenOptions) => { - const currentRoute = options.currentRoute || useRoute() +export const usePublicLinkContext = ({ store }: PublicLinkContextOptions) => { return computed(() => { - return unref(currentRoute).query[contextRouteNameKey] === 'files-public-files' + return store.getters['runtime/auth/isPublicLinkContextReady'] }) } diff --git a/packages/web-pkg/src/composables/authContext/usePublicLinkPassword.ts b/packages/web-pkg/src/composables/authContext/usePublicLinkPassword.ts index 3855d659bc4..67ee68ff28d 100644 --- a/packages/web-pkg/src/composables/authContext/usePublicLinkPassword.ts +++ b/packages/web-pkg/src/composables/authContext/usePublicLinkPassword.ts @@ -7,6 +7,6 @@ interface PublicLinkPasswordOptions { export const usePublicLinkPassword = ({ store }: PublicLinkPasswordOptions) => { return computed(() => { - return store.getters['Files/publicLinkPassword'] + return store.getters['runtime/auth/publicLinkPassword'] }) } diff --git a/packages/web-pkg/src/composables/authContext/usePublicLinkToken.ts b/packages/web-pkg/src/composables/authContext/usePublicLinkToken.ts new file mode 100644 index 00000000000..bddfdf15eea --- /dev/null +++ b/packages/web-pkg/src/composables/authContext/usePublicLinkToken.ts @@ -0,0 +1,12 @@ +import { computed } from '@vue/composition-api' +import { Store } from 'vuex' + +interface PublicLinkTokenOptions { + store: Store +} + +export const usePublicLinkToken = ({ store }: PublicLinkTokenOptions) => { + return computed(() => { + return store.getters['runtime/auth/publicLinkToken'] + }) +} diff --git a/packages/web-pkg/src/composables/authContext/usePublicToken.ts b/packages/web-pkg/src/composables/authContext/usePublicToken.ts deleted file mode 100644 index ea804cab491..00000000000 --- a/packages/web-pkg/src/composables/authContext/usePublicToken.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Route } from 'vue-router' -import { computed, unref } from '@vue/composition-api' -import { MaybeRef } from '../../utils' - -interface PublicLinkTokenOptions { - currentRoute: MaybeRef -} - -export const usePublicLinkToken = ({ currentRoute }: PublicLinkTokenOptions) => { - return computed(() => { - return (unref(currentRoute).params.item || unref(currentRoute).params.filePath || '').split( - '/' - )[0] - }) -} diff --git a/packages/web-pkg/src/composables/authContext/useRequest.ts b/packages/web-pkg/src/composables/authContext/useRequest.ts index 2b581f8a7fd..f35fce00727 100644 --- a/packages/web-pkg/src/composables/authContext/useRequest.ts +++ b/packages/web-pkg/src/composables/authContext/useRequest.ts @@ -6,9 +6,10 @@ import type { Method, AxiosRequestConfig, AxiosResponse } from 'axios' import { ClientService } from '../../services' import { useAccessToken, usePublicLinkPassword, usePublicLinkToken, usePublicLinkContext } from './' import { useStore } from '../store' -import { useRoute } from '../router' +import Router from 'vue-router' interface RequestOptions { + router?: Router store?: Store clientService?: ClientService currentRoute?: Route @@ -21,12 +22,11 @@ export interface RequestResult { export function useRequest(options: RequestOptions = {}): RequestResult { const clientService = options.clientService ?? useClientService() const store = options.store ?? useStore() - const currentRoute = options.currentRoute ?? useRoute() - const isPublicLinkContext = usePublicLinkContext({ currentRoute }) + const isPublicLinkContext = usePublicLinkContext({ store }) const publicLinkPassword = usePublicLinkPassword({ store }) const accessToken = useAccessToken({ store }) - const publicToken = usePublicLinkToken({ currentRoute }) + const publicToken = usePublicLinkToken({ store }) const makeRequest = ( method: Method, diff --git a/packages/web-pkg/src/composables/authContext/useUserContext.ts b/packages/web-pkg/src/composables/authContext/useUserContext.ts new file mode 100644 index 00000000000..70fe8860e13 --- /dev/null +++ b/packages/web-pkg/src/composables/authContext/useUserContext.ts @@ -0,0 +1,12 @@ +import { computed } from '@vue/composition-api' +import { Store } from 'vuex' + +interface UserContextOptions { + store: Store +} + +export const useUserContext = ({ store }: UserContextOptions) => { + return computed(() => { + return store.getters['runtime/auth/isUserContextReady'] + }) +} diff --git a/packages/web-pkg/src/configuration/index.ts b/packages/web-pkg/src/configuration/index.ts new file mode 100644 index 00000000000..3a2f915097a --- /dev/null +++ b/packages/web-pkg/src/configuration/index.ts @@ -0,0 +1,2 @@ +export * from './manager' +export * from './types' diff --git a/packages/web-pkg/src/configuration/manager.ts b/packages/web-pkg/src/configuration/manager.ts new file mode 100644 index 00000000000..7cde9ee28be --- /dev/null +++ b/packages/web-pkg/src/configuration/manager.ts @@ -0,0 +1,49 @@ +import { OAuth2Configuration, OIDCConfiguration, RuntimeConfiguration } from './types' +import isNil from 'lodash-es/isNil' + +export interface RawConfig { + server: string + auth?: any + openIdConnect?: any +} + +export class ConfigurationManager { + private runtimeConfiguration: RuntimeConfiguration + private oAuth2Configuration: OAuth2Configuration + private oidcConfiguration: OIDCConfiguration + + public initialize(rawConfig: RawConfig): void { + this.runtimeConfiguration = { serverUrl: '' } + this.serverUrl = rawConfig.server + this.oAuth2Configuration = rawConfig.auth ? (rawConfig.auth as OAuth2Configuration) : null + this.oidcConfiguration = rawConfig.openIdConnect + ? (rawConfig.openIdConnect as OIDCConfiguration) + : null + } + + set serverUrl(url: string) { + this.runtimeConfiguration.serverUrl = (url || window.location.origin).replace(/\/+$/, '') + '/' + } + + get serverUrl(): string { + return this.runtimeConfiguration.serverUrl + } + + get isOAuth2(): boolean { + return !isNil(this.oAuth2Configuration) + } + + get oAuth2(): OAuth2Configuration { + return this.oAuth2Configuration + } + + get isOIDC(): boolean { + return !isNil(this.oidcConfiguration) + } + + get oidc(): OIDCConfiguration { + return this.oidcConfiguration + } +} + +export const configurationManager = new ConfigurationManager() diff --git a/packages/web-pkg/src/configuration/types.ts b/packages/web-pkg/src/configuration/types.ts new file mode 100644 index 00000000000..6e23d6a870b --- /dev/null +++ b/packages/web-pkg/src/configuration/types.ts @@ -0,0 +1,22 @@ +export interface RuntimeConfiguration { + serverUrl: string +} + +export interface OAuth2Configuration { + clientId: string + clientSecret?: string + url: string + authUrl: string + logoutUrl?: string +} + +export interface OIDCConfiguration { + // eslint-disable-next-line camelcase + metadata_url: string + authority: string + // eslint-disable-next-line camelcase + client_id: string + // eslint-disable-next-line camelcase + response_type: string + scope: string +} diff --git a/packages/web-pkg/src/constants/index.ts b/packages/web-pkg/src/constants/index.ts index f2aa0d32a45..f6e6a4327aa 100644 --- a/packages/web-pkg/src/constants/index.ts +++ b/packages/web-pkg/src/constants/index.ts @@ -1 +1,2 @@ export * from './dav' +export * from './share' diff --git a/packages/web-pkg/src/constants/share.ts b/packages/web-pkg/src/constants/share.ts new file mode 100644 index 00000000000..6112e867c02 --- /dev/null +++ b/packages/web-pkg/src/constants/share.ts @@ -0,0 +1,7 @@ +export abstract class SharePermissionBit { + static readonly Read: number = 1 + static readonly Update: number = 2 + static readonly Create: number = 4 + static readonly Delete: number = 8 + static readonly Share: number = 16 +} diff --git a/packages/web-pkg/src/services/client.ts b/packages/web-pkg/src/services/client.ts deleted file mode 100644 index dfb5160bb73..00000000000 --- a/packages/web-pkg/src/services/client.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { HttpClient } from '../http' -import { client, Graph } from 'web-client' - -export type OwnCloudSdk = any - -export class ClientService { - private httpAuthenticatedClient: { - token: string - instance: HttpClient - } - - private httpUnAuthenticatedClient: HttpClient - - private graphAuthenticatedClient: { - token: string - instance: Graph - } - - private owncloudSdkClient: OwnCloudSdk - - public httpAuthenticated(token: string): HttpClient { - if (!this.httpAuthenticatedClient || this.httpAuthenticatedClient.token !== token) { - this.httpAuthenticatedClient = { - token, - instance: new HttpClient({ - headers: { - Authorization: 'Bearer ' + token, - 'X-Requested-With': 'XMLHttpRequest' - } - }) - } - } - - return this.httpAuthenticatedClient.instance - } - - public graphAuthenticated(serverUrl: string, token: string): Graph { - if (!this.graphAuthenticatedClient || this.graphAuthenticatedClient.token !== token) { - const { graph } = client(serverUrl, token) - this.graphAuthenticatedClient = { - token, - instance: graph - } - } - - return this.graphAuthenticatedClient.instance - } - - public get httpUnAuthenticated(): HttpClient { - if (!this.httpUnAuthenticatedClient) { - this.httpUnAuthenticatedClient = new HttpClient({ - headers: { - 'X-Requested-With': 'XMLHttpRequest' - } - }) - } - - return this.httpUnAuthenticatedClient - } - - public get owncloudSdk(): OwnCloudSdk { - return this.owncloudSdkClient - } - - public set owncloudSdk(owncloudSdk: OwnCloudSdk) { - this.owncloudSdkClient = owncloudSdk - } -} - -export const clientService = new ClientService() diff --git a/packages/web-pkg/src/services/client/auth.ts b/packages/web-pkg/src/services/client/auth.ts new file mode 100644 index 00000000000..081d0559bb8 --- /dev/null +++ b/packages/web-pkg/src/services/client/auth.ts @@ -0,0 +1,30 @@ +export interface AuthParameters { + accessToken?: string + publicLinkToken?: string + publicLinkPassword?: string +} + +export class Auth { + accessToken?: string + publicLinkToken?: string + publicLinkPassword?: string + + constructor(params: AuthParameters = {}) { + this.accessToken = params.accessToken + this.publicLinkToken = params.publicLinkToken + this.publicLinkPassword = params.publicLinkPassword + } + + getHeaders(): any { + return { + ...(this.publicLinkToken && { 'public-token': this.publicLinkToken }), + ...(this.publicLinkPassword && { + Authorization: + 'Basic ' + Buffer.from(['public', this.publicLinkPassword].join(':')).toString('base64') + }), + ...(this.accessToken && { + Authorization: 'Bearer ' + this.accessToken + }) + } + } +} diff --git a/packages/web-pkg/src/services/client/client.ts b/packages/web-pkg/src/services/client/client.ts new file mode 100644 index 00000000000..c8ae0c89ac7 --- /dev/null +++ b/packages/web-pkg/src/services/client/client.ts @@ -0,0 +1,121 @@ +import { HttpClient } from '../../http' +import { client, Graph, OCS } from 'web-client' +import { Auth, AuthParameters } from './auth' +import axios, { AxiosInstance } from 'axios' +import { v4 as uuidV4 } from 'uuid' + +export type OwnCloudSdk = any +interface OcClient { + token: string + graph: Graph + ocs: OCS +} + +const createAxiosInstance = (authParams: AuthParameters): AxiosInstance => { + const auth = new Auth(authParams) + const axiosClient = axios.create({ + headers: auth.getHeaders() + }) + axiosClient.interceptors.request.use((config) => { + config.headers['X-Request-ID'] = uuidV4() + config.headers['X-Requested-With'] = 'XMLHttpRequest' + config.headers['Content-Type'] = 'application/x-www-form-urlencoded' + return config + }) + return axiosClient +} + +export class ClientService { + private httpAuthenticatedClient: { + token: string + instance: HttpClient + } + + private httpUnAuthenticatedClient: HttpClient + + private ocUserContextClient: OcClient + private ocPublicLinkContextClient: OcClient + + private owncloudSdkClient: OwnCloudSdk + + public httpAuthenticated(token: string): HttpClient { + if (!this.httpAuthenticatedClient || this.httpAuthenticatedClient.token !== token) { + this.httpAuthenticatedClient = { + token, + instance: new HttpClient({ + headers: { + Authorization: 'Bearer ' + token, + 'X-Requested-With': 'XMLHttpRequest' + } + }) + } + } + + return this.httpAuthenticatedClient.instance + } + + public graphAuthenticated(serverUrl: string, token: string): Graph { + this.initOcUserContextClient(serverUrl, token) + return this.ocUserContextClient.graph + } + + public ocsUserContext(serverUrl: string, token: string): OCS { + this.initOcUserContextClient(serverUrl, token) + return this.ocUserContextClient.ocs + } + + private initOcUserContextClient(serverUrl: string, token: string) { + if (!this.ocUserContextClient || this.ocUserContextClient.token !== token) { + const { graph, ocs } = client(serverUrl, createAxiosInstance({ accessToken: token })) + this.ocUserContextClient = { + token, + graph, + ocs + } + } + } + + public ocsPublicLinkContext(serverUrl: string, token: string, password?: string): OCS { + this.initOcPublicLinkContextClient(serverUrl, token, password) + return this.ocPublicLinkContextClient.ocs + } + + private initOcPublicLinkContextClient(serverUrl: string, token: string, password?: string) { + if (!this.ocPublicLinkContextClient || this.ocPublicLinkContextClient.token !== token) { + const { graph, ocs } = client( + serverUrl, + createAxiosInstance({ + publicLinkToken: token, + publicLinkPassword: password + }) + ) + this.ocPublicLinkContextClient = { + token, + graph, + ocs + } + } + } + + public get httpUnAuthenticated(): HttpClient { + if (!this.httpUnAuthenticatedClient) { + this.httpUnAuthenticatedClient = new HttpClient({ + headers: { + 'X-Requested-With': 'XMLHttpRequest' + } + }) + } + + return this.httpUnAuthenticatedClient + } + + public get owncloudSdk(): OwnCloudSdk { + return this.owncloudSdkClient + } + + public set owncloudSdk(owncloudSdk: OwnCloudSdk) { + this.owncloudSdkClient = owncloudSdk + } +} + +export const clientService = new ClientService() diff --git a/packages/web-pkg/src/services/client/index.ts b/packages/web-pkg/src/services/client/index.ts new file mode 100644 index 00000000000..ac0c7038c16 --- /dev/null +++ b/packages/web-pkg/src/services/client/index.ts @@ -0,0 +1,2 @@ +export * from './auth' +export * from './client' diff --git a/packages/web-pkg/src/services/index.ts b/packages/web-pkg/src/services/index.ts index 83dae7638cc..2f14e295909 100644 --- a/packages/web-pkg/src/services/index.ts +++ b/packages/web-pkg/src/services/index.ts @@ -1 +1,2 @@ export * from './client' +export * from './permissionManager' diff --git a/packages/web-pkg/src/services/permissionManager.ts b/packages/web-pkg/src/services/permissionManager.ts new file mode 100644 index 00000000000..b7c449a10d9 --- /dev/null +++ b/packages/web-pkg/src/services/permissionManager.ts @@ -0,0 +1,27 @@ +import { Store } from 'vuex' +interface Role { + name: 'admin' | 'spaceadmin' | 'user' | 'guest' +} +interface User { + role: Role +} + +export class PermissionManager { + private readonly store: Store + + constructor(store: Store) { + this.store = store + } + + public hasUserManagement() { + return this.user.role?.name === 'admin' + } + + public hasSpaceManagement() { + return ['admin', 'spaceadmin'].includes(this.user.role?.name) + } + + get user(): User { + return this.store.getters.user + } +} diff --git a/packages/web-pkg/tests/unit/services/permissionManager.spec.ts b/packages/web-pkg/tests/unit/services/permissionManager.spec.ts new file mode 100644 index 00000000000..6dd3a8aecfa --- /dev/null +++ b/packages/web-pkg/tests/unit/services/permissionManager.spec.ts @@ -0,0 +1,34 @@ +import { PermissionManager } from '../../../src/services' + +beforeEach(jest.resetAllMocks) + +describe('permissionManager', () => { + describe('method "hasUserManagement"', () => { + it('should be true if user has sufficient rights', () => { + const permissionManager = new PermissionManager({ + getters: { user: { role: { name: 'admin' } } } + } as any) + expect(permissionManager.hasUserManagement()).toBeTruthy() + }) + it('should be false if user has insufficient rights', () => { + const permissionManager = new PermissionManager({ + getters: { user: { role: { name: 'user' } } } + } as any) + expect(permissionManager.hasUserManagement()).toBeFalsy() + }) + }) + describe('method "hasSpaceManagement"', () => { + it('should be true if user has sufficient rights', () => { + const permissionManager = new PermissionManager({ + getters: { user: { role: { name: 'admin' } } } + } as any) + expect(permissionManager.hasSpaceManagement()).toBeTruthy() + }) + it('should be false if user has insufficient rights', () => { + const permissionManager = new PermissionManager({ + getters: { user: { role: { name: 'user' } } } + } as any) + expect(permissionManager.hasSpaceManagement()).toBeFalsy() + }) + }) +}) diff --git a/packages/web-runtime/l10n/translations.json b/packages/web-runtime/l10n/translations.json index b5c10e6a390..cbd0026a097 100644 --- a/packages/web-runtime/l10n/translations.json +++ b/packages/web-runtime/l10n/translations.json @@ -1 +1 @@ -{"cs":{"Account":"Účet","Account Information":"Informace o účtu","Application Switcher":"Přepínač Aplikací","Authentication failed":"Ověření selhalo","documentation":"dokumentace","Download failed":"Stahování selhalo","Edit":"Upravit","File could not be located":"Soubor se nepodařilo najít","For help visit our":"Pro pomoc navštivte naše","If you like to login with a different user please proceed to exit.":"Pokud se chcete přihlásit jako jiný uživatel, pokračujte prosím odhlášením.","Log out":"Odhlásit","Login":"Přihlásit","Login Error":"Chyba přihlášení","No email has been set up":"Žádná emailová adresa nebyla nastavena","Notifications":"Oznámení","Please click the button below to authenticate and get access to your data.":"Stiskněte prosím tlačítko dole pro udělení oprávnění a zpřístupněte tak svá data.","Please contact the administrator if this error persists.":"Pokud tato chyba přetrvává, kontaktujte administrátora.","Please contact your administrator if you think this message shows up in error.":"Pokud si myslíte, že se tato zpráva zobrazuje omylem, kontaktujte svého administrátora.","Public link":"Veřejný odkaz","Upload complete":"Nahrávání dokončeno","Upload failed":"Nahrávání selhalo","Welcome to %{productName}":"Vítejte v %{productName}","You are not part of any group":"Nejste členem žádné skupiny"},"de":{"{{ app.title }}":"{{ app.title }}","%{ errors } of %{ uploads } item failed":["%{ errors } von %{ uploads } Datei fehlgeschlagen","%{ errors } von %{ uploads } Dateien fehlgeschlagen"],"%{ filesInProgressCount } item uploading...":["%{ filesInProgressCount } Datei wird hochgeladen...","%{ filesInProgressCount } Dateien werden hochgeladen..."],"%{ roundedRemainingHours } hour left":["%{ roundedRemainingHours } Stunde verbleibend","%{ roundedRemainingHours } Stunden verbleibend"],"%{ roundedRemainingMinutes } minute left":["%{ roundedRemainingMinutes } Minute verbleibend","%{ roundedRemainingMinutes } Minuten verbleibend"],"%{ successfulUploads } item uploaded":["%{ successfulUploads } Datei hochgeladen","%{ successfulUploads } Dateien hochgeladen"],"%{used} of %{total} used":"%{used} von %{total} benutzt","%{used} used":"%{used} verwendet","Attention: this will log you out from all applications you are running in\n this browser with your current user.":"Achtung: Sie werden automatischen aus allen Anwendungen ausgeloggt.","Access denied":"Zugriff verweigert","Account":"Konto","Account Information":"Kontoinformationen","Account menu":"Benutzer-Menü","All files and folders":"Alle Dateien","Also, make sure to check the browser console for more information.":"Bitte prüfen Sie auch die Browser-Konsole für weitere Informationen.","Application Switcher":"Apps-Menü","Authentication failed":"Authentifizierung fehlgeschlagen","Calculating estimated time...":"Verbleibende Zeit wird berechnet...","Cancel upload":"Hochladen abbrechen","chat":"chat","Click to switch theme":"Klicken, um das Farbschema zu wechseln","Close":"Schließen","Currently used theme":"Aktuell verwendetes Farbschema","Dark mode":"Dunkler Modus","Display name":"Anzeigename","documentation":"Dokumentation","Download failed":"Fehler beim Herunterladen","Edit":"Bearbeiten","Email":"E-Mail","Few seconds left":"Wenige Sekunden verbleibend","File could not be located":"Datei konnte nicht gefunden werden","For help visit our":"Für Hilfe besuche unsere","Group memberships":"Gruppenzugehörigkeiten","Hide details":"Details verbergen","If you like to login with a different user please proceed to exit.":"Wenn Sie sich mit einem anderen Benutzer anmelden möchten, gehen Sie bitte zu exit.","Internet Explorer (your current browser) is not officially supported. For security reasons, please switch to another browser.":"Internet Explorer (der aktuell verwendeter Browser) wird offiziell nicht unterstützt. Bitte verwende aus Sicherheitsgründen einen anderen Browser.","Light mode":"Heller Modus","Loading":"Lade ...","Loading group membership information":"Gruppenmitgliedschafts-Information wird geladen","Log out":"Abmelden","Logging you in":"Sie werden eingeloggt","Login":"Login","Login Error":"Fehler beim Login","Main navigation":"Hauptnavigation","Missing or invalid config":"Fehlende oder falsche Konfiguration","msg":"Nachricht","Navigate to %{ pageName } page":"Zur %{ pageName } Seite navigieren","Navigate to personal files page":"Zur persönlichen Ablage navigieren","Navigated to %{ pageTitle }":"Zur Seite %{ pageTitle } navigiert","No email has been set up":"Es wurde noch keine E-Mail eingerichtet","Notifications":"Benachrichtigungen","Oidc callback":"Oidc Callback","Oidc redirect":"Oidc Weiterleitung","or join our":"oder machen Sie mit bei ","ownCloud feedback survey":"ownCloud Feedbackumfrage","Pause upload":"Hochladen anhalten","Personal":"Persönlich","Personal storage":"Persönlicher Speicherplatz","Personal storage (%{percentage}% used)":"Persönlicher Speicher (%{percentage}% benutzt)","Please check if the file config.json exists and is correct.":"Bitte prüfen Sie ob die config.json Konfigurationsdatei existiert und valide ist.","Please click the button below to authenticate and get access to your data.":"Klicken Sie auf die Schaltfläche unten, um sich zu authentifizieren und auf Ihre Daten zuzugreifen.","Please contact the administrator if this error persists.":"Bitte kontaktieren Sie den Administrator, wenn dieser Fehler weiterhin besteht.","Please contact your administrator if you think this message shows up in error.":"Falls diese Meldung fehlerhaft erscheint, bitte die Systemverwaltung kontaktieren.","Please wait, you are being redirected.":"Bitte warten, Sie werden weitergeleitet","Preparing upload...":"Hochladen wird vorbereitet...","Private link":"Privater Link","Provide your feedback: We'd like to improve the web design and would be happy to hear your feedback. Thank you! Your ownCloud team.":"Gib uns Feedback: Wir würden unser Webdesign gerne verbessern und freuen uns über deine Rückmeldung. Vielen Dank! Dein ownCloud Team.","Public link":"Öffentlicher Link","Resume upload":"Mit Hochladen fortfahren","Retry all failed uploads":"Alle fehlgeschlagenen Downloads erneut starten","Show details":"Details anzeigen","Sidebar navigation menu":"Navigation in der Seitenleiste","Skip to main":"Zum Hauptinhalt springen","this":"dies","Toggle sidebar":"Seitenleiste ein-/ausklappen","Top bar":"Kopfleiste","Upload cancelled":"Hochladen abgebrochen","Upload complete":"Hochladen abgeschlossen","Upload failed":"Hochladen fehlgeschlagen","User ID":"Nutzer ID","User Menu":"Benutzermenü","Username":"Nutzername","Welcome to %{productName}":"Willkommen zu %{productName}","You are not part of any group":"Sie gehören keiner Gruppe an.","Your user session is invalid or has expired.":"Ihre Sitzung ist ungültig oder abgelaufen."},"es":{"{{ app.title }}":"{{ app.title }}","%{used} of %{total} used":"usados %{used} de %{total} ","Attention: this will log you out from all applications you are running in\n this browser with your current user.":"Atención: esto cerrará la sesión de todas las aplicaciones que está ejecutando en\neste navegador con el usuario actual.","Access denied":"Acceso denegado","Account":"Cuenta","Account Information":"Información de cuenta","Account menu":"Menú de la cuenta","Also, make sure to check the browser console for more information.":"También, asegúrese de revisar la consola del navegador para más información. ","Application Switcher":"Cambio de aplicación","Authentication failed":"Fallo de autenticación","chat":"chat","Click to switch theme":"Haga click aquí para cambiar tema","Close":"Cerrar","Currently used theme":"Tema en uso actualmente","Dark mode":"Modo nocturno","Display name":"Nombre a mostrar","documentation":"documentación","Download failed":"Descarga fallida","Edit":"Editar","Email":"Correo electrónico","File could not be located":"No se ha podido encontrar el archivo","For help visit our":"Para ayuda visite nuestra","Group memberships":"Membresía de grupo","If you like to login with a different user please proceed to exit.":"Si deseas entrar con un nombre de usuario distinto por favor procede a salir.","Internet Explorer (your current browser) is not officially supported. For security reasons, please switch to another browser.":"Internet Explorer (su navegador actual) no esta soportado oficialmente. Por razones de seguridad, por favor cambie a otro navegador.","Loading":"Cargando","Loading group membership information":"Cargando información de membresía del grupo","Log out":"Salir","Logging you in":"Accediendo","Login":"Iniciar sesión","Login Error":"Error de inicio de sesión","Main navigation":"Navegación principal","Missing or invalid config":"Configuración faltante o inválida","msg":"msg","No email has been set up":"No se ha establecido ningún correo electrónico","Notifications":"Notificaciones","ownCloud feedback survey":"encuesta de ownCloud","Personal storage (%{percentage}% used)":"Almacenamiento personal (%{percentage}% usado)","Please check if the file config.json exists and is correct.":"Por favor revise que el archivo config.json existe y es correcto.","Please click the button below to authenticate and get access to your data.":"Pulse el botón para autenticarse y ganar acceso a sus datos.","Please contact the administrator if this error persists.":"Contacta con el administrador si el error persiste","Please contact your administrator if you think this message shows up in error.":"Póngase en contacto con su administrador si cree que este mensaje aparece por error.","Please wait, you are being redirected.":"Por favor espere. Lo estamos redireccionando.","Private link":"Enlace privado","Provide your feedback: We'd like to improve the web design and would be happy to hear your feedback. Thank you! Your ownCloud team.":"Denos su opinión. Queremos mejorar el diseño web y estaríamos felices de escuchar su opinión. ¡Gracias! Tu equipo de ownCloud.","Public link":"Enlace público","Sidebar navigation menu":"Menu lateral de navegación","Skip to main":"Volver al inicio","this":"esto","Toggle sidebar":"Cambiar barra lateral","Top bar":"Barra superior","Upload complete":"Subida completa","Upload failed":"Subida fallida","User ID":"ID del usuario","User Menu":"Menú del usuario","Username":"Usuario","Welcome to %{productName}":"Bienvenido a %{productName} ","You are not part of any group":"No eres parte de ningún grupo","Your user session is invalid or has expired.":"Su session es inválida o ha expirado."},"fr":{"Attention: this will log you out from all applications you are running in\n this browser with your current user.":"Attention :ceci va vous connecter sur toutes les applications qui sont actuelement ouvertes dans\n votre nagivateur avec l'utilisateur actuel.","Access denied":"Accès refusé","Account":"Compte","Account Information":"Informations de compte","Account menu":"Menu du compte","Also, make sure to check the browser console for more information.":"Aussi, vérifiez la console de votre navigateur pour plus d'informations.","Application Switcher":" Changeur d'applications","Authentication failed":"Error d'authentification","chat":"chat","Close":"Fermer","Display name":"Afficher le nom","documentation":"documentation","Download failed":"Echec de téléchargement","Edit":"Editer","Email":"Email","File could not be located":"Le fichier n'a pas été trouvé","For help visit our":"Pour de l'aide visiter notre ","Group memberships":"Membres du groupe","If you like to login with a different user please proceed to exit.":"Pour vous connecter avec un utilisateur différent, veuillez procéder à la sortie.","Loading":"Chargement","Log out":"Se déconnecter","Login":"Se connecter","Login Error":"Erreur de connection","Main navigation":"Navigation principale","Missing or invalid config":"Configuration manqante ou incorrecte","msg":"msg","Navigated to %{ pageTitle }":"Aller vers %{ pageTitle }","No email has been set up":"Pas d'adresse e-mail configurée","Notifications":"Notifications","or join our":"ou rejoigner notre","ownCloud feedback survey":"Enquête d'opinion sur ownCloud","Please check if the file config.json exists and is correct.":"S'il vous plait, vérifiez que le fichier config.json existe et qu'il est correcte","Please click the button below to authenticate and get access to your data.":"Veuillez cliquer le button ci-dessous pour vous authentifier et obtenir accès à vos données.","Please contact the administrator if this error persists.":"Veuillez contacter l'administrateur si cette erreur persiste.","Please contact your administrator if you think this message shows up in error.":"Veuillez contacter l'administrateur si vous pensez que ce message apparaît par erreur.","Private link":"Lien privé","Provide your feedback: We'd like to improve the web design and would be happy to hear your feedback. Thank you! Your ownCloud team.":"Donner votre retour : nous aimerions améliorer le design du site web et nous serions heureux d'avoir votre retour. Merci ! Votre équipe ownCloud.","Public link":"Lien public","Sidebar navigation menu":"manu de navigation du panneau latéral","Skip to main":"Passer le principal","this":"ceci","Upload complete":"Upload terminé","Upload failed":"Upload a échoué","User ID":"ID utilisateur","User Menu":"Menu utilisateur","Username":"Nom d'utilisateur","Welcome to %{productName}":"Bienvenue sur %{productName}","You are not part of any group":"Vous n'êtes membre d'aucun groupe","Your user session is invalid or has expired.":"Votre session utilisateur est invalide ou a expirée."},"gl":{"Account":"Conta","Account Information":"Información da conta","Application Switcher":"Cambiador de aplicacións","Authentication failed":"Produciuse un fallo de autenticación","documentation":"documentación","Download failed":"Produciuse un fallo na descarga","Edit":"Editar","File could not be located":"Non foi posíbel localizar o ficheiro","For help visit our":"Para obter axuda visite o noso","If you like to login with a different user please proceed to exit.":"Se quere iniciar sesión cun usuario diferente, proceda a saír.","Loading":"Cargando","Log out":"Saír","Login":"Acceso","Login Error":"Produciuse un erro de acceso","msg":"msx","No email has been set up":"Non se configurou ningún correo-e","Notifications":"Notificacións","Please click the button below to authenticate and get access to your data.":"Prema no botón de embaixo para autenticarse e obter acceso aos seus datos.","Please contact the administrator if this error persists.":"Póñase en contacto co seu administrador se persiste o erro.","Please contact your administrator if you think this message shows up in error.":"Póñase en contacto co seu administrador se cre que esta mensaxe aparece por erro.","Public link":"Ligazón pública","this":"este","Upload complete":"Envío completado","Upload failed":"Produciuse un fallo no envío","Welcome to %{productName}":"Benvido a %{productName}","You are not part of any group":"Vostede non forma parte de ningún grupo"},"it":{"Access denied":"Accesso negato","Account":"Utente","Account Information":"Informazioni utente","Account menu":"Menu utente","Authentication failed":"Autenticazione fallita","chat":"chat","Click to switch theme":"Clicca per cambiare tema","Currently used theme":"Tema in uso","Dark mode":"Modalità scura","Display name":"Mostra nome","documentation":"documentazione","Download failed":"Download fallito","Edit":"Modifica","Email":"Email","File could not be located":"File non trovato","For help visit our":"Per aiuto visita","If you like to login with a different user please proceed to exit.":"Se si vuole autenticarsi con un altro utente procedere all' uscita.","Internet Explorer (your current browser) is not officially supported. For security reasons, please switch to another browser.":"Internet Explorer (il suo browser corrente) non è ufficialmente supportato. Per ragioni di sicurezza si prega di cambiare browser.","Light mode":"Modalità chiara","Loading":"Caricamento","Log out":"Esci","Login":"Login","Login Error":"Errore di login","Main navigation":"Navigazione principale","Missing or invalid config":"Configurazione mancante o invalida","Navigate to %{ pageName } page":"Vai a pagina %{ pageName }","No email has been set up":"Non è stata impostata nessuna email","Notifications":"Notifiche","or join our":"o unisciti a","ownCloud feedback survey":"Sondaggio ownCloud","Personal storage (%{percentage}% used)":"Spazio personale (utilizzato al %{percentage}%)","Please check if the file config.json exists and is correct.":"Controlla se il file config.json esiste ed è corretto","Please click the button below to authenticate and get access to your data.":"Clicca il pulsante sotto per autenticarti e accedere ai tuoi dati","Please contact the administrator if this error persists.":"Contatta l'amministratore se l'errore persiste","Please contact your administrator if you think this message shows up in error.":"Contatta l'amministratore se pensi che questo messaggio compaia per errore","Please wait, you are being redirected.":"Reindirizzamento in corso, attendere prego.","Private link":"Link privato","Public link":"Link pubblico","User ID":"ID utente","User Menu":"Menu utente","Username":"Nome utente","You are not part of any group":"Non sei parte di alcun gruppo","Your user session is invalid or has expired.":"La tua sessione è invalida o scaduta"}} \ No newline at end of file +{"cs":{"Account":"Účet","Account Information":"Informace o účtu","Application Switcher":"Přepínač Aplikací","Authentication failed":"Ověření selhalo","Cancel":"Zrušit","Confirm":"Potvrdit","documentation":"dokumentace","Download failed":"Stahování selhalo","Edit":"Upravit","File could not be located":"Soubor se nepodařilo najít","For help visit our":"Pro pomoc navštivte naše","If you like to login with a different user please proceed to exit.":"Pokud se chcete přihlásit jako jiný uživatel, pokračujte prosím odhlášením.","Log out":"Odhlásit","Login":"Přihlásit","Login Error":"Chyba přihlášení","No email has been set up":"Žádná emailová adresa nebyla nastavena","Notifications":"Oznámení","Please click the button below to authenticate and get access to your data.":"Stiskněte prosím tlačítko dole pro udělení oprávnění a zpřístupněte tak svá data.","Please contact the administrator if this error persists.":"Pokud tato chyba přetrvává, kontaktujte administrátora.","Please contact your administrator if you think this message shows up in error.":"Pokud si myslíte, že se tato zpráva zobrazuje omylem, kontaktujte svého administrátora.","Public link":"Veřejný odkaz","Upload complete":"Nahrávání dokončeno","Upload failed":"Nahrávání selhalo","Welcome to %{productName}":"Vítejte v %{productName}","You are not part of any group":"Nejste členem žádné skupiny"},"de":{"{{ app.title }}":"{{ app.title }}","%{ errors } of %{ uploads } item failed":["%{ errors } von %{ uploads } Datei fehlgeschlagen","%{ errors } von %{ uploads } Dateien fehlgeschlagen"],"%{ filesInProgressCount } item uploading...":["%{ filesInProgressCount } Datei wird hochgeladen...","%{ filesInProgressCount } Dateien werden hochgeladen..."],"%{ roundedRemainingHours } hour left":["%{ roundedRemainingHours } Stunde verbleibend","%{ roundedRemainingHours } Stunden verbleibend"],"%{ roundedRemainingMinutes } minute left":["%{ roundedRemainingMinutes } Minute verbleibend","%{ roundedRemainingMinutes } Minuten verbleibend"],"%{ successfulUploads } item uploaded":["%{ successfulUploads } Datei hochgeladen","%{ successfulUploads } Dateien hochgeladen"],"%{used} of %{total} used":"%{used} von %{total} benutzt","%{used} used":"%{used} verwendet","Attention: this will log you out from all applications you are running in\n this browser with your current user.":"Achtung: Sie werden automatischen aus allen Anwendungen ausgeloggt.","Access denied":"Zugriff verweigert","Account":"Konto","Account Information":"Kontoinformationen","Account menu":"Benutzer-Menü","All files and folders":"Alle Dateien","Also, make sure to check the browser console for more information.":"Bitte prüfen Sie auch die Browser-Konsole für weitere Informationen.","Application Switcher":"Apps-Menü","Authentication failed":"Authentifizierung fehlgeschlagen","Calculating estimated time...":"Verbleibende Zeit wird berechnet...","Cancel":"Abbrechen","Cancel upload":"Hochladen abbrechen","chat":"chat","Click to switch theme":"Klicken, um das Farbschema zu wechseln","Close":"Schließen","Confirm":"Bestätigen","Currently used theme":"Aktuell verwendetes Farbschema","Dark mode":"Dunkler Modus","Display name":"Anzeigename","documentation":"Dokumentation","Download failed":"Fehler beim Herunterladen","Edit":"Bearbeiten","Email":"E-Mail","Few seconds left":"Wenige Sekunden verbleibend","File could not be located":"Datei konnte nicht gefunden werden","For help visit our":"Für Hilfe besuche unsere","Group memberships":"Gruppenzugehörigkeiten","Hide details":"Details verbergen","If you like to login with a different user please proceed to exit.":"Wenn Sie sich mit einem anderen Benutzer anmelden möchten, gehen Sie bitte zu exit.","Internet Explorer (your current browser) is not officially supported. For security reasons, please switch to another browser.":"Internet Explorer (der aktuell verwendeter Browser) wird offiziell nicht unterstützt. Bitte verwende aus Sicherheitsgründen einen anderen Browser.","Light mode":"Heller Modus","Loading":"Lade ...","Loading group membership information":"Gruppenmitgliedschafts-Information wird geladen","Log out":"Abmelden","Logging you in":"Sie werden eingeloggt","Login":"Login","Login Error":"Fehler beim Login","Main navigation":"Hauptnavigation","Missing or invalid config":"Fehlende oder falsche Konfiguration","msg":"Nachricht","Navigate to %{ pageName } page":"Zur %{ pageName } Seite navigieren","Navigate to personal files page":"Zur persönlichen Ablage navigieren","Navigated to %{ pageTitle }":"Zur Seite %{ pageTitle } navigiert","No email has been set up":"Es wurde noch keine E-Mail eingerichtet","Notifications":"Benachrichtigungen","Oidc callback":"Oidc Callback","Oidc redirect":"Oidc Weiterleitung","or join our":"oder machen Sie mit bei ","ownCloud feedback survey":"ownCloud Feedbackumfrage","Pause upload":"Hochladen anhalten","Personal":"Persönlich","Personal storage":"Persönlicher Speicherplatz","Personal storage (%{percentage}% used)":"Persönlicher Speicher (%{percentage}% benutzt)","Please check if the file config.json exists and is correct.":"Bitte prüfen Sie ob die config.json Konfigurationsdatei existiert und valide ist.","Please click the button below to authenticate and get access to your data.":"Klicken Sie auf die Schaltfläche unten, um sich zu authentifizieren und auf Ihre Daten zuzugreifen.","Please contact the administrator if this error persists.":"Bitte kontaktieren Sie den Administrator, wenn dieser Fehler weiterhin besteht.","Please contact your administrator if you think this message shows up in error.":"Falls diese Meldung fehlerhaft erscheint, bitte die Systemverwaltung kontaktieren.","Please wait, you are being redirected.":"Bitte warten, Sie werden weitergeleitet","Preparing upload...":"Hochladen wird vorbereitet...","Private link":"Privater Link","Provide your feedback: We'd like to improve the web design and would be happy to hear your feedback. Thank you! Your ownCloud team.":"Gib uns Feedback: Wir würden unser Webdesign gerne verbessern und freuen uns über deine Rückmeldung. Vielen Dank! Dein ownCloud Team.","Public link":"Öffentlicher Link","Resume upload":"Mit Hochladen fortfahren","Retry all failed uploads":"Alle fehlgeschlagenen Downloads erneut starten","Show details":"Details anzeigen","Sidebar navigation menu":"Navigation in der Seitenleiste","Skip to main":"Zum Hauptinhalt springen","this":"dies","Toggle sidebar":"Seitenleiste ein-/ausklappen","Top bar":"Kopfleiste","Upload cancelled":"Hochladen abgebrochen","Upload complete":"Hochladen abgeschlossen","Upload failed":"Hochladen fehlgeschlagen","User ID":"Nutzer ID","User Menu":"Benutzermenü","Username":"Nutzername","Welcome to %{productName}":"Willkommen zu %{productName}","You are not part of any group":"Sie gehören keiner Gruppe an.","Your user session is invalid or has expired.":"Ihre Sitzung ist ungültig oder abgelaufen."},"es":{"{{ app.title }}":"{{ app.title }}","%{used} of %{total} used":"usados %{used} de %{total} ","Attention: this will log you out from all applications you are running in\n this browser with your current user.":"Atención: esto cerrará la sesión de todas las aplicaciones que está ejecutando en\neste navegador con el usuario actual.","Access denied":"Acceso denegado","Account":"Cuenta","Account Information":"Información de cuenta","Account menu":"Menú de la cuenta","Also, make sure to check the browser console for more information.":"También, asegúrese de revisar la consola del navegador para más información. ","Application Switcher":"Cambio de aplicación","Authentication failed":"Fallo de autenticación","Cancel":"Cancelar","chat":"chat","Click to switch theme":"Haga click aquí para cambiar tema","Close":"Cerrar","Currently used theme":"Tema en uso actualmente","Dark mode":"Modo nocturno","Display name":"Nombre a mostrar","documentation":"documentación","Download failed":"Descarga fallida","Edit":"Editar","Email":"Correo electrónico","File could not be located":"No se ha podido encontrar el archivo","For help visit our":"Para ayuda visite nuestra","Group memberships":"Membresía de grupo","If you like to login with a different user please proceed to exit.":"Si deseas entrar con un nombre de usuario distinto por favor procede a salir.","Internet Explorer (your current browser) is not officially supported. For security reasons, please switch to another browser.":"Internet Explorer (su navegador actual) no esta soportado oficialmente. Por razones de seguridad, por favor cambie a otro navegador.","Loading":"Cargando","Loading group membership information":"Cargando información de membresía del grupo","Log out":"Salir","Logging you in":"Accediendo","Login":"Iniciar sesión","Login Error":"Error de inicio de sesión","Main navigation":"Navegación principal","Missing or invalid config":"Configuración faltante o inválida","msg":"msg","No email has been set up":"No se ha establecido ningún correo electrónico","Notifications":"Notificaciones","ownCloud feedback survey":"encuesta de ownCloud","Personal storage (%{percentage}% used)":"Almacenamiento personal (%{percentage}% usado)","Please check if the file config.json exists and is correct.":"Por favor revise que el archivo config.json existe y es correcto.","Please click the button below to authenticate and get access to your data.":"Pulse el botón para autenticarse y ganar acceso a sus datos.","Please contact the administrator if this error persists.":"Contacta con el administrador si el error persiste","Please contact your administrator if you think this message shows up in error.":"Póngase en contacto con su administrador si cree que este mensaje aparece por error.","Please wait, you are being redirected.":"Por favor espere. Lo estamos redireccionando.","Private link":"Enlace privado","Provide your feedback: We'd like to improve the web design and would be happy to hear your feedback. Thank you! Your ownCloud team.":"Denos su opinión. Queremos mejorar el diseño web y estaríamos felices de escuchar su opinión. ¡Gracias! Tu equipo de ownCloud.","Public link":"Enlace público","Sidebar navigation menu":"Menu lateral de navegación","Skip to main":"Volver al inicio","this":"esto","Toggle sidebar":"Cambiar barra lateral","Top bar":"Barra superior","Upload complete":"Subida completa","Upload failed":"Subida fallida","User ID":"ID del usuario","User Menu":"Menú del usuario","Username":"Usuario","Welcome to %{productName}":"Bienvenido a %{productName} ","You are not part of any group":"No eres parte de ningún grupo","Your user session is invalid or has expired.":"Su session es inválida o ha expirado."},"fr":{"Attention: this will log you out from all applications you are running in\n this browser with your current user.":"Attention :ceci va vous connecter sur toutes les applications qui sont actuelement ouvertes dans\n votre nagivateur avec l'utilisateur actuel.","Access denied":"Accès refusé","Account":"Compte","Account Information":"Informations de compte","Account menu":"Menu du compte","Also, make sure to check the browser console for more information.":"Aussi, vérifiez la console de votre navigateur pour plus d'informations.","Application Switcher":" Changeur d'applications","Authentication failed":"Error d'authentification","Cancel":"Annuler","chat":"chat","Close":"Fermer","Confirm":"Confirmer","Display name":"Afficher le nom","documentation":"documentation","Download failed":"Echec de téléchargement","Edit":"Editer","Email":"Email","File could not be located":"Le fichier n'a pas été trouvé","For help visit our":"Pour de l'aide visiter notre ","Group memberships":"Membres du groupe","If you like to login with a different user please proceed to exit.":"Pour vous connecter avec un utilisateur différent, veuillez procéder à la sortie.","Loading":"Chargement","Log out":"Se déconnecter","Login":"Se connecter","Login Error":"Erreur de connection","Main navigation":"Navigation principale","Missing or invalid config":"Configuration manqante ou incorrecte","msg":"msg","Navigated to %{ pageTitle }":"Aller vers %{ pageTitle }","No email has been set up":"Pas d'adresse e-mail configurée","Notifications":"Notifications","or join our":"ou rejoigner notre","ownCloud feedback survey":"Enquête d'opinion sur ownCloud","Please check if the file config.json exists and is correct.":"S'il vous plait, vérifiez que le fichier config.json existe et qu'il est correcte","Please click the button below to authenticate and get access to your data.":"Veuillez cliquer le button ci-dessous pour vous authentifier et obtenir accès à vos données.","Please contact the administrator if this error persists.":"Veuillez contacter l'administrateur si cette erreur persiste.","Please contact your administrator if you think this message shows up in error.":"Veuillez contacter l'administrateur si vous pensez que ce message apparaît par erreur.","Private link":"Lien privé","Provide your feedback: We'd like to improve the web design and would be happy to hear your feedback. Thank you! Your ownCloud team.":"Donner votre retour : nous aimerions améliorer le design du site web et nous serions heureux d'avoir votre retour. Merci ! Votre équipe ownCloud.","Public link":"Lien public","Sidebar navigation menu":"manu de navigation du panneau latéral","Skip to main":"Passer le principal","this":"ceci","Upload complete":"Upload terminé","Upload failed":"Upload a échoué","User ID":"ID utilisateur","User Menu":"Menu utilisateur","Username":"Nom d'utilisateur","Welcome to %{productName}":"Bienvenue sur %{productName}","You are not part of any group":"Vous n'êtes membre d'aucun groupe","Your user session is invalid or has expired.":"Votre session utilisateur est invalide ou a expirée."},"gl":{"Account":"Conta","Account Information":"Información da conta","Application Switcher":"Cambiador de aplicacións","Authentication failed":"Produciuse un fallo de autenticación","Cancel":"Cancelar","Confirm":"Confirmar","documentation":"documentación","Download failed":"Produciuse un fallo na descarga","Edit":"Editar","File could not be located":"Non foi posíbel localizar o ficheiro","For help visit our":"Para obter axuda visite o noso","If you like to login with a different user please proceed to exit.":"Se quere iniciar sesión cun usuario diferente, proceda a saír.","Loading":"Cargando","Log out":"Saír","Login":"Acceso","Login Error":"Produciuse un erro de acceso","msg":"msx","No email has been set up":"Non se configurou ningún correo-e","Notifications":"Notificacións","Please click the button below to authenticate and get access to your data.":"Prema no botón de embaixo para autenticarse e obter acceso aos seus datos.","Please contact the administrator if this error persists.":"Póñase en contacto co seu administrador se persiste o erro.","Please contact your administrator if you think this message shows up in error.":"Póñase en contacto co seu administrador se cre que esta mensaxe aparece por erro.","Public link":"Ligazón pública","this":"este","Upload complete":"Envío completado","Upload failed":"Produciuse un fallo no envío","Welcome to %{productName}":"Benvido a %{productName}","You are not part of any group":"Vostede non forma parte de ningún grupo"},"it":{"Access denied":"Accesso negato","Account":"Utente","Account Information":"Informazioni utente","Account menu":"Menu utente","Authentication failed":"Autenticazione fallita","chat":"chat","Click to switch theme":"Clicca per cambiare tema","Currently used theme":"Tema in uso","Dark mode":"Modalità scura","Display name":"Mostra nome","documentation":"documentazione","Download failed":"Download fallito","Edit":"Modifica","Email":"Email","File could not be located":"File non trovato","For help visit our":"Per aiuto visita","If you like to login with a different user please proceed to exit.":"Se si vuole autenticarsi con un altro utente procedere all' uscita.","Internet Explorer (your current browser) is not officially supported. For security reasons, please switch to another browser.":"Internet Explorer (il suo browser corrente) non è ufficialmente supportato. Per ragioni di sicurezza si prega di cambiare browser.","Light mode":"Modalità chiara","Loading":"Caricamento","Log out":"Esci","Login":"Login","Login Error":"Errore di login","Main navigation":"Navigazione principale","Missing or invalid config":"Configurazione mancante o invalida","Navigate to %{ pageName } page":"Vai a pagina %{ pageName }","No email has been set up":"Non è stata impostata nessuna email","Notifications":"Notifiche","or join our":"o unisciti a","ownCloud feedback survey":"Sondaggio ownCloud","Personal storage (%{percentage}% used)":"Spazio personale (utilizzato al %{percentage}%)","Please check if the file config.json exists and is correct.":"Controlla se il file config.json esiste ed è corretto","Please click the button below to authenticate and get access to your data.":"Clicca il pulsante sotto per autenticarti e accedere ai tuoi dati","Please contact the administrator if this error persists.":"Contatta l'amministratore se l'errore persiste","Please contact your administrator if you think this message shows up in error.":"Contatta l'amministratore se pensi che questo messaggio compaia per errore","Please wait, you are being redirected.":"Reindirizzamento in corso, attendere prego.","Private link":"Link privato","Public link":"Link pubblico","User ID":"ID utente","User Menu":"Menu utente","Username":"Nome utente","You are not part of any group":"Non sei parte di alcun gruppo","Your user session is invalid or has expired.":"La tua sessione è invalida o scaduta"}} \ No newline at end of file diff --git a/packages/web-runtime/package.json b/packages/web-runtime/package.json index 0a64fef42d2..6e0aa8f4086 100644 --- a/packages/web-runtime/package.json +++ b/packages/web-runtime/package.json @@ -23,7 +23,7 @@ "lodash-es": "^4.17.21", "luxon": "^2.4.0", "marked": "^4.0.12", - "oidc-client": "1.11.5", + "oidc-client-ts": "^2.0.5", "owncloud-design-system": "14.0.0-alpha.4", "owncloud-sdk": "~3.0.0-alpha.14", "p-queue": "^6.6.2", @@ -52,7 +52,6 @@ "vue-select": "^3.18.3", "vuex": "^3.6.2", "vuex-extensions": "^1.1.5", - "vuex-persist": "3.1.3", "vuex-router-sync": "^5.0.0", "web-pkg": "*", "webdav": "4.9.0", diff --git a/packages/web-runtime/src/App.vue b/packages/web-runtime/src/App.vue index 98e2b81461e..d1eb7ac7b87 100644 --- a/packages/web-runtime/src/App.vue +++ b/packages/web-runtime/src/App.vue @@ -43,6 +43,7 @@ import LayoutLoading from './layouts/Loading.vue' import LayoutPlain from './layouts/Plain.vue' import { getBackendVersion, getWebVersion } from './container/versions' import { defineComponent } from '@vue/composition-api' +import { isPublicLinkContext, isUserContext, isAuthenticationRequired } from './router' export default defineComponent({ components: { @@ -59,23 +60,17 @@ export default defineComponent({ computed: { ...mapState(['route', 'user', 'modal', 'sidebar']), ...mapGetters(['configuration', 'capabilities', 'getSettingsValue']), + ...mapGetters('runtime/auth', ['isUserContextReady', 'isPublicLinkContextReady']), layout() { - if (this.user.isAuthenticated && !this.user.userReady) { - return LayoutLoading + if (!this.$route.name || !isAuthenticationRequired(this.$router, this.$route)) { + return LayoutPlain } - if ( - !this.$route.name || - [ - 'login', - 'oidcCallback', - 'oidcSilentRedirect', - 'privateLink', - 'publicLink', - 'accessDenied' - ].includes(this.$route.name) - ) { - return LayoutPlain + if (isUserContext(this.$router, this.$route) && !this.isUserContextReady) { + return LayoutLoading + } + if (isPublicLinkContext(this.$router, this.$route) && !this.isPublicLinkContextReady) { + return LayoutLoading } return LayoutApplication diff --git a/packages/web-runtime/src/components/Avatar.vue b/packages/web-runtime/src/components/Avatar.vue index 2f00cbf4146..6ef44795051 100644 --- a/packages/web-runtime/src/components/Avatar.vue +++ b/packages/web-runtime/src/components/Avatar.vue @@ -61,7 +61,8 @@ export default { } }, computed: { - ...mapGetters(['getToken', 'capabilities', 'configuration']) + ...mapGetters(['capabilities', 'configuration']), + ...mapGetters('runtime/auth', ['accessToken']) }, watch: { userid: function (userid) { @@ -89,7 +90,7 @@ export default { const headers = new Headers() const instance = this.configuration.server || window.location.origin const url = instance + 'remote.php/dav/avatars/' + userid + '/128.png' - headers.append('Authorization', 'Bearer ' + this.getToken) + headers.append('Authorization', 'Bearer ' + this.accessToken) headers.append('X-Requested-With', 'XMLHttpRequest') fetch(url, { headers }) .then((response) => { diff --git a/packages/web-runtime/src/components/EditPasswordModal.vue b/packages/web-runtime/src/components/EditPasswordModal.vue new file mode 100644 index 00000000000..ad86cb86594 --- /dev/null +++ b/packages/web-runtime/src/components/EditPasswordModal.vue @@ -0,0 +1,78 @@ + + + diff --git a/packages/web-runtime/src/components/Topbar/UserMenu.vue b/packages/web-runtime/src/components/Topbar/UserMenu.vue index 07da3735b98..ac5057d0d3d 100644 --- a/packages/web-runtime/src/components/Topbar/UserMenu.vue +++ b/packages/web-runtime/src/components/Topbar/UserMenu.vue @@ -80,6 +80,7 @@ import { mapGetters } from 'vuex' import filesize from 'filesize' import isNil from 'lodash-es/isNil' +import { authService } from '../../services/auth' export default { props: { @@ -134,10 +135,7 @@ export default { }, methods: { logout() { - // Use timeout to leave enough time for the dropdown to be hidden - setTimeout(() => { - this.$store.dispatch('logout') - }) + authService.logoutUser() } } } diff --git a/packages/web-runtime/src/composables/upload/useUpload.ts b/packages/web-runtime/src/composables/upload/useUpload.ts index 3afa1db6a1c..62ef6672fd8 100644 --- a/packages/web-runtime/src/composables/upload/useUpload.ts +++ b/packages/web-runtime/src/composables/upload/useUpload.ts @@ -1,14 +1,15 @@ import { ClientService } from 'web-pkg/src/services' import { + useAccessToken, useCapabilityFilesTusExtension, useCapabilityFilesTusSupportHttpMethodOverride, useCapabilityFilesTusSupportMaxChunkSize, useClientService, + usePublicLinkContext, + usePublicLinkPassword, useStore } from 'web-pkg/src/composables' import { computed, Ref, unref, watch } from '@vue/composition-api' -import { useActiveLocation } from 'files/src/composables' -import { isLocationPublicActive } from 'files/src/router' import { UppyService } from '../../services/uppyService' import * as uuid from 'uuid' @@ -47,18 +48,17 @@ interface UploadResult { export function useUpload(options: UploadOptions): UploadResult { const store = useStore() - const publicLinkPassword = computed((): string => store.getters['Files/publicLinkPassword']) - const isPublicLocation = useActiveLocation(isLocationPublicActive, 'files-public-files') - const isPublicDropLocation = useActiveLocation(isLocationPublicActive, 'files-public-drop') const clientService = useClientService() - const getToken = computed((): string => store.getters.getToken) + const publicLinkPassword = usePublicLinkPassword({ store }) + const isPublicLinkContext = usePublicLinkContext({ store }) + const accessToken = useAccessToken({ store }) const tusHttpMethodOverride = useCapabilityFilesTusSupportHttpMethodOverride() const tusMaxChunkSize = useCapabilityFilesTusSupportMaxChunkSize() const tusExtension = useCapabilityFilesTusExtension() const headers = computed((): { [key: string]: string } => { - if (unref(isPublicLocation) || unref(isPublicDropLocation)) { + if (unref(isPublicLinkContext)) { const password = unref(publicLinkPassword) if (password) { return { Authorization: 'Basic ' + Buffer.from('public:' + password).toString('base64') } @@ -67,24 +67,22 @@ export function useUpload(options: UploadOptions): UploadResult { return {} } return { - Authorization: 'Bearer ' + unref(getToken) + Authorization: 'Bearer ' + unref(accessToken) } }) const uppyOptions = computed(() => { const isTusSupported = unref(tusMaxChunkSize) > 0 - if (isTusSupported) { - return { - isTusSupported, + return { + isTusSupported, + headers: unref(headers), + ...(isTusSupported && { tusMaxChunkSize: unref(tusMaxChunkSize), tusHttpMethodOverride: unref(tusHttpMethodOverride), - tusExtension: unref(tusExtension), - headers: unref(headers) - } + tusExtension: unref(tusExtension) + }) } - - return { isTusSupported, headers: unref(headers) } }) watch( @@ -102,7 +100,7 @@ export function useUpload(options: UploadOptions): UploadResult { return { createDirectoryTree: createDirectoryTree({ clientService, - isPublicLocation, + isPublicLinkContext, publicLinkPassword, uppyService: options.uppyService }) @@ -111,12 +109,12 @@ export function useUpload(options: UploadOptions): UploadResult { const createDirectoryTree = ({ clientService, - isPublicLocation, + isPublicLinkContext, publicLinkPassword, uppyService }: { clientService: ClientService - isPublicLocation: Ref + isPublicLinkContext: Ref publicLinkPassword?: Ref uppyService: UppyService }) => { @@ -173,7 +171,7 @@ const createDirectoryTree = ({ uppyService.publish('addedForUpload', [uppyResource]) - if (unref(isPublicLocation)) { + if (unref(isPublicLinkContext)) { await client.publicFiles.createFolder( currentFolder, folderToCreate, diff --git a/packages/web-runtime/src/container/application/classic.ts b/packages/web-runtime/src/container/application/classic.ts index 127b48d8856..4747e30b2bf 100644 --- a/packages/web-runtime/src/container/application/classic.ts +++ b/packages/web-runtime/src/container/application/classic.ts @@ -43,12 +43,6 @@ class ClassicApplication extends NextApplication { return Promise.resolve(undefined) } - userReady(instance: Vue): Promise { - const { userReady: userReadyHook } = this.applicationScript - this.attachPublicApi(userReadyHook, instance) - return Promise.resolve(undefined) - } - private attachPublicApi(hook: unknown, instance?: Vue) { isFunction(hook) && hook({ diff --git a/packages/web-runtime/src/container/application/next.ts b/packages/web-runtime/src/container/application/next.ts index db161e0db08..98b50ea05d7 100644 --- a/packages/web-runtime/src/container/application/next.ts +++ b/packages/web-runtime/src/container/application/next.ts @@ -13,6 +13,4 @@ export abstract class NextApplication { abstract ready(): Promise abstract mounted(instance: Vue): Promise - - abstract userReady(instance: Vue): Promise } diff --git a/packages/web-runtime/src/container/bootstrap.ts b/packages/web-runtime/src/container/bootstrap.ts index 44a5a63cec3..d1ed25a0502 100644 --- a/packages/web-runtime/src/container/bootstrap.ts +++ b/packages/web-runtime/src/container/bootstrap.ts @@ -13,11 +13,13 @@ import { getBackendVersion, getWebVersion } from './versions' import { useLocalStorage } from 'web-pkg/src/composables' import { unref } from '@vue/composition-api' import { useDefaultThemeName } from '../composables' -import { clientService } from 'web-pkg/src/services' +import { authService } from '../services/auth' +import { clientService, PermissionManager } from 'web-pkg/src/services' import { UppyService } from '../services/uppyService' import { init as SentryInit } from '@sentry/browser' import { Vue as SentryVueIntegration } from '@sentry/integrations' +import { configurationManager, RawConfig, ConfigurationManager } from 'web-pkg/src/configuration' /** * fetch runtime configuration, this step is optional, all later steps can use a static @@ -28,15 +30,18 @@ import { Vue as SentryVueIntegration } from '@sentry/integrations' * * @param path - path to main configuration */ -export const requestConfiguration = async (path: string): Promise => { +export const announceConfiguration = async (path: string): Promise => { const request = await fetch(path) if (request.status !== 200) { throw new Error(`config could not be loaded. HTTP status-code ${request.status}`) } - return request.json().catch((error) => { + const rawConfig = (await request.json().catch((error) => { throw new Error(`config could not be parsed. ${error}`) - }) + })) as RawConfig + configurationManager.initialize(rawConfig) + // TODO: we might want to get rid of exposing the raw config. needs more refactoring though. + return rawConfig } /** @@ -56,7 +61,6 @@ export const announceStore = async ({ store: Store }): Promise => { await store.dispatch('loadConfig', runtimeConfiguration) - await store.dispatch('initAuth') /** * TODO: Find a different way to access store from within JS files @@ -95,7 +99,6 @@ export const announceClient = async (runtimeConfiguration: RuntimeConfiguration) * announce applications to the runtime, it takes care that all requirements are fulfilled and then: * - bulk build all applications * - bulk register all applications, no other application is guaranteed to be registered here, don't request one - * - bulk activate all applications, all applications are registered, it's safe to request a application api here * * @param runtimeConfiguration * @param store @@ -103,7 +106,7 @@ export const announceClient = async (runtimeConfiguration: RuntimeConfiguration) * @param translations * @param supportedLanguages */ -export const announceApplications = async ({ +export const initializeApplications = async ({ runtimeConfiguration, store, router, @@ -115,7 +118,7 @@ export const announceApplications = async ({ router: VueRouter translations: unknown supportedLanguages: { [key: string]: string } -}): Promise => { +}): Promise => { const { apps: internalApplications = [], external_apps: externalApplications = [] } = rewriteDeprecatedAppNames(runtimeConfiguration) @@ -148,6 +151,20 @@ export const announceApplications = async ({ }, []) await Promise.all(applications.map((application) => application.initialize())) + + return applications +} + +/** + * Bulk activate all applications, all applications are registered, it's safe to request a application api here + * + * @param applications + */ +export const announceApplicationsReady = async ({ + applications +}: { + applications: NextApplication[] +}): Promise => { await Promise.all(applications.map((application) => application.ready())) } @@ -253,6 +270,24 @@ export const announceClientService = ({ vue.prototype.$clientService.owncloudSdk = sdk } +/** + * announce uppyService and inject it into vue + * + * @param vue + * @param store + */ +export const announcePermissionManager = ({ + vue, + store +}: { + vue: VueConstructor + store: Store +}): void => { + const permissionManager = new PermissionManager(store) + vue.prototype.$permissionManager = permissionManager + set(vue, '$permissionManager', permissionManager) +} + /** * announce uppyService and inject it into vue * @@ -262,6 +297,29 @@ export const announceUppyService = ({ vue }: { vue: VueConstructor }): void => { vue.prototype.$uppyService = new UppyService() } +/** + * announce authService and inject it into vue + * + * @param vue + * @param configurationManager + * @param store + * @param router + */ +export const announceAuthService = async ({ + vue, + configurationManager, + store, + router +}: { + vue: VueConstructor + configurationManager: ConfigurationManager + store: Store + router: VueRouter +}): Promise => { + authService.initialize(configurationManager, clientService, store, router) + set(vue, '$authService', authService) +} + /** * announce runtime defaults, this is usual the last needed announcement before rendering the actual ui * diff --git a/packages/web-runtime/src/container/types.ts b/packages/web-runtime/src/container/types.ts index 688acca2864..a10ac590755 100644 --- a/packages/web-runtime/src/container/types.ts +++ b/packages/web-runtime/src/container/types.ts @@ -72,7 +72,6 @@ export interface ClassicApplicationScript { initialize?: () => void ready?: () => void mounted?: () => void - userReady?: () => void } /** RuntimeApi defines the publicly available runtime api */ diff --git a/packages/web-runtime/src/index.ts b/packages/web-runtime/src/index.ts index 410923938d7..cca96495971 100644 --- a/packages/web-runtime/src/index.ts +++ b/packages/web-runtime/src/index.ts @@ -8,10 +8,12 @@ import { } from './defaults' import { router } from './router' +import { configurationManager } from 'web-pkg/src/configuration' import { - requestConfiguration, - announceApplications, + announceConfiguration, + initializeApplications, + announceApplicationsReady, announceClient, announceDefaults, announceClientService, @@ -21,23 +23,27 @@ import { announceVersions, applicationStore, announceUppyService, + announceAuthService, + announcePermissionManager, startSentry } from './container' export const bootstrap = async (configurationPath: string): Promise => { - const runtimeConfiguration = await requestConfiguration(configurationPath) + const runtimeConfiguration = await announceConfiguration(configurationPath) startSentry(runtimeConfiguration, Vue) - announceClientService({ vue: Vue, runtimeConfiguration }) - announceUppyService({ vue: Vue }) - await announceClient(runtimeConfiguration) await announceStore({ vue: Vue, store, runtimeConfiguration }) - await announceApplications({ + await initializeApplications({ runtimeConfiguration, store, supportedLanguages, router, translations }) + announceClientService({ vue: Vue, runtimeConfiguration }) + announceUppyService({ vue: Vue }) + announcePermissionManager({ vue: Vue, store }) + await announceClient(runtimeConfiguration) + await announceAuthService({ vue: Vue, configurationManager, store, router }) announceTranslations({ vue: Vue, supportedLanguages, translations }) await announceTheme({ store, vue: Vue, designSystem, runtimeConfiguration }) announceDefaults({ store, router }) @@ -58,12 +64,14 @@ export const renderSuccess = (): void => { }) store.watch( - (state, getters) => getters.isUserReady, - (newValue, oldValue) => { + (state, getters) => + getters['runtime/auth/isUserContextReady'] || + getters['runtime/auth/isPublicLinkContextReady'], + async (newValue, oldValue) => { if (!newValue || newValue === oldValue) { return } - applications.forEach((application) => application.userReady(instance)) + await announceApplicationsReady({ applications }) }, { immediate: true diff --git a/packages/web-runtime/src/layouts/Application.vue b/packages/web-runtime/src/layouts/Application.vue index 5d89f701c0e..eb377cce9d8 100644 --- a/packages/web-runtime/src/layouts/Application.vue +++ b/packages/web-runtime/src/layouts/Application.vue @@ -30,7 +30,7 @@ import TopBar from '../components/Topbar/TopBar.vue' import MessageBar from '../components/MessageBar.vue' import SidebarNav from '../components/SidebarNav/SidebarNav.vue' import UploadInfo from '../components/UploadInfo.vue' -import { useActiveApp, useRoute } from 'web-pkg/src/composables' +import { useActiveApp, useRoute, useStore, useUserContext } from 'web-pkg/src/composables' import { watch, defineComponent } from '@vue/composition-api' export default defineComponent({ @@ -41,6 +41,7 @@ export default defineComponent({ UploadInfo }, setup() { + const store = useStore() // FIXME: we can convert to a single router-view without name (thus without the loop) and without this watcher when we release v6.0.0 watch( useRoute(), @@ -61,7 +62,8 @@ export default defineComponent({ { immediate: true } ) return { - activeApp: useActiveApp() + activeApp: useActiveApp(), + isUserContext: useUserContext({ store }) } }, data() { @@ -91,7 +93,7 @@ export default defineComponent({ return this.sidebarNavItems.length && this.windowWidth >= 640 }, sidebarNavItems() { - if (this.publicPage()) { + if (!this.isUserContext) { return [] } diff --git a/packages/web-runtime/src/pages/accessDenied.vue b/packages/web-runtime/src/pages/accessDenied.vue index 40f08c78b59..eec911f8676 100644 --- a/packages/web-runtime/src/pages/accessDenied.vue +++ b/packages/web-runtime/src/pages/accessDenied.vue @@ -30,7 +30,8 @@ diff --git a/packages/web-runtime/src/plugins/mediaSource.js b/packages/web-runtime/src/plugins/mediaSource.js index 1cbdc3abb4e..8df37855617 100644 --- a/packages/web-runtime/src/plugins/mediaSource.js +++ b/packages/web-runtime/src/plugins/mediaSource.js @@ -2,12 +2,8 @@ import PQueue from 'p-queue' export default { install(Vue) { - function _mediaSource(source, returnAs = 'url', headers = null) { + function _mediaSource(source, returnAs = 'url', headers) { return new Promise((resolve, reject) => { - if (headers === null) { - headers = new Headers() - headers.append('Authorization', 'Bearer ' + Vue.$store.getters.getToken) - } headers.append('X-Requested-With', 'XMLHttpRequest') fetch(source, { headers }) @@ -79,7 +75,7 @@ export default { } }, methods: { - mediaSource(source, returnAs = 'url', headers = null) { + mediaSource(source, returnAs = 'url', headers) { return this.mediaSourceQueue.add(() => _mediaSource(source, returnAs, headers)) } } diff --git a/packages/web-runtime/src/plugins/web.js b/packages/web-runtime/src/plugins/web.js index e65a7638f2f..b431246ab0e 100644 --- a/packages/web-runtime/src/plugins/web.js +++ b/packages/web-runtime/src/plugins/web.js @@ -6,9 +6,7 @@ export default { install(Vue) { Vue.mixin({ computed: { - ...mapGetters(['getToken', 'isAuthenticated', 'capabilities']), - ...mapGetters('Files', ['publicLinkPassword']), - ...mapGetters(['configuration']), + ...mapGetters(['capabilities']), isUrlSigningEnabled() { return this.capabilities.core && this.capabilities.core['support-url-signing'] @@ -17,19 +15,14 @@ export default { methods: { ...mapActions(['showMessage']), - publicPage() { - // public page is either when not authenticated - // but also when accessing pages that require no auth even when authenticated - return !this.isAuthenticated || this.$route.meta.auth === false - }, - // FIXME: optional publicLinkContext parameter is a mess - async downloadFile(file, publicLinkContext = null, version = null) { - const publicPage = publicLinkContext !== null ? publicLinkContext : this.publicPage() + async downloadFile(file, version = null) { + const isPublicLinkContext = this.$store.getters['runtime/auth/isPublicLinkContextReady'] + const isUserContext = this.$store.getters['runtime/auth/isUserContextReady'] // construct the url and headers let url = null let headers = {} - if (publicPage) { + if (isPublicLinkContext) { url = file.downloadURL } else { if (version === null) { @@ -37,11 +30,12 @@ export default { } else { url = this.$client.fileVersions.getFileVersionUrl(file.id, version) } - headers = { Authorization: 'Bearer ' + this.getToken } + const accessToken = this.$store.getters['runtime/auth/accessToken'] + headers = { Authorization: 'Bearer ' + accessToken } } // download with signing enabled - if (!publicPage && this.isUrlSigningEnabled) { + if (isUserContext && this.isUrlSigningEnabled) { try { const response = await fetch(url, { method: 'HEAD', diff --git a/packages/web-runtime/src/router/helpers.ts b/packages/web-runtime/src/router/helpers.ts new file mode 100644 index 00000000000..ea9f1807b8b --- /dev/null +++ b/packages/web-runtime/src/router/helpers.ts @@ -0,0 +1,139 @@ +import { base, router } from './index' +import Router, { Route, RouteRecordPublic } from 'vue-router' +import { contextQueryToFileContextProps } from 'web-pkg/src/composables' + +export const buildUrl = (pathname) => { + const isHistoryMode = !!base + const baseUrl = new URL(window.location.href.split('#')[0]) + baseUrl.search = '' + if (isHistoryMode) { + // in history mode we can't determine the base path, it must be provided by the document + baseUrl.pathname = new URL(base.href).pathname + } else { + // in hash mode, auto-determine the base path by removing `/index.html` + if (baseUrl.pathname.endsWith('/index.html')) { + baseUrl.pathname = baseUrl.pathname.split('/').slice(0, -1).filter(Boolean).join('/') + } + } + + /** + * build full url by either + * - concatenating baseUrl and pathname (for unknown/non-router urls, e.g. `oidc-callback.html`) or + * - resolving via router (for known routes) + */ + if (/\.(html?)$/i.test(pathname)) { + baseUrl.pathname = [...baseUrl.pathname.split('/'), ...pathname.split('/')] + .filter(Boolean) + .join('/') + } else { + baseUrl[isHistoryMode ? 'pathname' : 'hash'] = router.resolve(pathname).href + } + + return baseUrl.href +} + +/** + * Checks if the `to` route or the route it was reached from (i.e. the `contextRoute`) needs authentication from the IDP. + * + * @param router {Router} + * @param to {Route} + * @returns {boolean} + */ +export const isUserContext = (router: Router, to: Route): boolean => { + if (!isAuthenticationRequired(router, to)) { + return false + } + + if (to.meta?.auth !== false) { + return true + } + + const contextRoute = getContextRoute(router, to) + return contextRoute && contextRoute.meta?.auth !== false +} + +/** + * Checks if the `to` route or the route it was reached from (i.e. the `contextRoute`) is a public link (with or without password). + * + * @param router {Router} + * @param to {Route} + * @returns {boolean} + */ +export const isPublicLinkContext = (router: Router, to: Route): boolean => { + if (!isAuthenticationRequired(router, to)) { + return false + } + + const publicLinkRouteNames = ['files-public-files', 'files-public-drop'] + if (publicLinkRouteNames.includes(to.name)) { + return true + } + + const contextRoute = getContextRoute(router, to) + return contextRoute && publicLinkRouteNames.includes(contextRoute?.name) +} + +/** + * Extracts the public link token from the various possible route params. + * + * @param to {Route} + * @returns {string} + */ +export const extractPublicLinkToken = (to: Route): string => { + const contextRouteParams = contextQueryToFileContextProps(to.query)?.routeParams + if (contextRouteParams) { + return (contextRouteParams.item || '').split('/')[0] + } + + return (to.params.item || to.params.filePath || to.params.token || '').split('/')[0] +} + +/** + * Asserts whether any form of authentication is required, i.e. + * - a user or + * - public link (with or without password), which represents an impersonation of a user via public share + * + * @param router {Router} + * @param to {Route} + * @returns {boolean} + */ +export const isAuthenticationRequired = (router: Router, to: Route): boolean => { + const publicRouteNames = [ + 'login', + 'oidcCallback', + 'oidcSilentRedirect', + 'resolvePrivateLink', + 'resolvePublicLink', + 'accessDenied' + ] + + if (publicRouteNames.includes(to.name)) { + return false + } + + const contextRoute = getContextRoute(router, to) + if (publicRouteNames.includes(contextRoute?.name)) { + return false + } + + return true +} + +/** + * The contextRoute in URLs is used to give applications additional context where the application route was triggered from + * (e.g. from a project space, a public link file listing, a personal space, etc). + * Application routes need to fulfill both their own auth requirements and the auth requirements from the context route. + * + * Example: the `preview` app and its routes don't explicitly require authentication (`meta.auth` is set to `false`), because + * the app can be used from both an authenticated context or from a public link context. The information which endpoint + * the preview app is supposed to load files from is transported via the contextRouteName, contextRouteParams and contextRouteQuery + * in the URL (provided by the context that opens the preview app in the first place). + */ +const getContextRoute = (router: Router, to: Route): RouteRecordPublic | null => { + const contextRouteNameKey = 'contextRouteName' + if (!to.query || !to.query[contextRouteNameKey]) { + return null + } + + return router.getRoutes().find((r) => r.name === to.query[contextRouteNameKey]) +} diff --git a/packages/web-runtime/src/router/index.js b/packages/web-runtime/src/router/index.js deleted file mode 100644 index 43f4df3b55f..00000000000 --- a/packages/web-runtime/src/router/index.js +++ /dev/null @@ -1,188 +0,0 @@ -import get from 'lodash-es/get.js' -import Vue from 'vue' -import qs from 'qs' -// eslint-disable-next-line no-unused-vars -import Router from 'vue-router' -import LoginPage from '../pages/login.vue' -import OidcCallbackPage from '../pages/oidcCallback.vue' -import AccessDeniedPage from '../pages/accessDenied.vue' -import Account from '../pages/account.vue' - -Vue.use(Router) - -// type: patch -// temporary patch till we have upgraded web to the latest vue router which make this obsolete -// this takes care that routes like 'foo/bar/baz' which by default would be converted to 'foo%2Fbar%2Fbaz' stay as they are -// should immediately go away and be removed after finalizing the update -// to apply the patch to a route add meta.patchCleanPath = true to it -// to patch needs to be enabled on a route level, to do so add meta.patchCleanPath = true property to the route -const patchRouter = (router) => { - const bindMatcher = router.match.bind(router) - const cleanPath = (route) => - [ - ['%2F', '/'], - ['//', '/'] - ].reduce((path, rule) => path.replaceAll(rule[0], rule[1]), route || '') - - router.match = (raw, current, redirectFrom) => { - const bindMatch = bindMatcher(raw, current, redirectFrom) - - if (!get(bindMatch, 'meta.patchCleanPath', false)) { - return bindMatch - } - - return { - ...bindMatch, - path: cleanPath(bindMatch.path), - fullPath: cleanPath(bindMatch.fullPath) - } - } - - return router -} - -// just a dummy function to trick gettext tools -function $gettext(msg) { - return msg -} - -const base = document.querySelector('base') -export const router = patchRouter( - new Router({ - parseQuery(query) { - return qs.parse(query, { - allowDots: true - }) - }, - stringifyQuery(obj) { - return qs.stringify(obj, { - allowDots: true, - addQueryPrefix: true - }) - }, - ...(base && { - mode: 'history', - base: new URL(base.href).pathname - }), - routes: [ - { - path: '/login', - name: 'login', - component: LoginPage, - meta: { auth: false, title: $gettext('Login') } - }, - { - path: '/oidc-callback', - component: OidcCallbackPage, - meta: { auth: false, title: $gettext('Oidc callback') } - }, - { - path: '/oidc-silent-redirect', - component: OidcCallbackPage, - meta: { auth: false, title: $gettext('Oidc redirect') } - }, - { - path: '/f/:fileId', - name: 'privateLink', - redirect: '/files/ops/resolver/private-link/:fileId', - meta: { title: $gettext('Private link') } - }, - { - path: '/s/:token', - name: 'publicLink', - redirect: '/files/ops/resolver/public-link/:token', - meta: { auth: false, title: $gettext('Public link') } - }, - { - path: '/access-denied', - name: 'accessDenied', - component: AccessDeniedPage, - meta: { auth: false, title: $gettext('Access denied') } - }, - { - path: '/account', - name: 'account', - component: Account, - meta: { title: $gettext('Account') } - } - ] - }) -) - -export const buildUrl = (pathname) => { - const isHistoryMode = !!base - const baseUrl = new URL(window.location.href.split('#')[0]) - if (isHistoryMode) { - // in history mode we can't determine the base path, it must be provided by the document - baseUrl.pathname = new URL(base.href).pathname - } else { - // in hash mode, auto-determine the base path by removing `/index.html` - if (baseUrl.pathname.endsWith('/index.html')) { - baseUrl.pathname = baseUrl.pathname.split('/').slice(0, -1).filter(Boolean).join('/') - } - } - - /** - * build full url by either - * - concatenating baseUrl and pathname (for unknown/non-router urls, e.g. `oidc-callback.html`) or - * - resolving via router (for known routes) - */ - if (/\.(html?)$/i.test(pathname)) { - baseUrl.pathname = [...baseUrl.pathname.split('/'), ...pathname.split('/')] - .filter(Boolean) - .join('/') - } else { - baseUrl[isHistoryMode ? 'pathname' : 'hash'] = router.resolve(pathname).href - } - - return baseUrl.href -} - -router.beforeEach(function (to, from, next) { - const store = Vue.$store - const isAuthenticated = store.getters.isAuthenticated - if (isAuthRequired(router, to)) { - if (isAuthenticated) { - const url = store.getters.urlBeforeLogin - store.dispatch('saveUrlBeforeLogin', null) - if (url) { - next(url) - } else { - next() - } - } else { - store.dispatch('saveUrlBeforeLogin', to.fullPath) - next('/login') - } - } else { - next() - } -}) - -/** - * Checks if the `to` route needs authentication from the IDP by checking both the route itself and - if present - also the context route. - * - * @param router {Router} - * @param to {Route} - * @returns {boolean} - */ -const isAuthRequired = (router, to) => { - if (to.meta?.auth !== false) { - return true - } - - /** - * The contextRouteName in routes is used to give applications additional context where the new route was triggered from. - * This means that the new route needs to fulfill both its own auth requirements and the auth requirements from the context route. - */ - const contextRouteNameKey = 'contextRouteName' - if (!to.query || !to.query[contextRouteNameKey]) { - return false - } - - const contextRoute = router.getRoutes().find((r) => r.name === to.query[contextRouteNameKey]) - if (contextRoute) { - return contextRoute.meta?.auth !== false - } - return false -} diff --git a/packages/web-runtime/src/router/index.ts b/packages/web-runtime/src/router/index.ts new file mode 100644 index 00000000000..cd44f4ba15e --- /dev/null +++ b/packages/web-runtime/src/router/index.ts @@ -0,0 +1,83 @@ +import qs from 'qs' +import Router from 'vue-router' +import AccessDeniedPage from '../pages/accessDenied.vue' +import Account from '../pages/account.vue' +import LoginPage from '../pages/login.vue' +import OidcCallbackPage from '../pages/oidcCallback.vue' +import ResolvePublicLinkPage from '../pages/resolvePublicLink.vue' +import { setupAuthGuard } from './setupAuthGuard' +import { patchRouter } from './patchCleanPath' + +export * from './helpers' + +// just a dummy function to trick gettext tools +function $gettext(msg) { + return msg +} + +export const base = document.querySelector('base') +export const router = patchRouter( + new Router({ + parseQuery(query) { + return qs.parse(query, { + allowDots: true + }) + }, + stringifyQuery(obj) { + return qs.stringify(obj, { + allowDots: true, + addQueryPrefix: true + }) + }, + ...(base && { + mode: 'history', + base: new URL(base.href).pathname + }), + routes: [ + { + path: '/login', + name: 'login', + component: LoginPage, + meta: { title: $gettext('Login') } + }, + { + path: '/oidc-callback', + name: 'oidcCallback', + component: OidcCallbackPage, + meta: { title: $gettext('Oidc callback') } + }, + { + path: '/oidc-silent-redirect', + name: 'oidcSilentRedirect', + component: OidcCallbackPage, + meta: { title: $gettext('Oidc redirect') } + }, + { + path: '/f/:fileId', + name: 'resolvePrivateLink', + redirect: '/files/ops/resolver/private-link/:fileId', + meta: { title: $gettext('Private link') } + }, + { + path: '/s/:token', + name: 'resolvePublicLink', + component: ResolvePublicLinkPage, + meta: { title: $gettext('Public link') } + }, + { + path: '/access-denied', + name: 'accessDenied', + component: AccessDeniedPage, + meta: { title: $gettext('Access denied') } + }, + { + path: '/account', + name: 'account', + component: Account, + meta: { title: $gettext('Account') } + } + ] + }) +) + +setupAuthGuard(router) diff --git a/packages/web-runtime/src/router/patchCleanPath.ts b/packages/web-runtime/src/router/patchCleanPath.ts new file mode 100644 index 00000000000..a7995fcd7da --- /dev/null +++ b/packages/web-runtime/src/router/patchCleanPath.ts @@ -0,0 +1,33 @@ +import Router from 'vue-router' +import get from 'lodash-es/get' + +// type: patch +// temporary patch till we have upgraded web to the latest vue router which make this obsolete +// this takes care that routes like 'foo/bar/baz' which by default would be converted to 'foo%2Fbar%2Fbaz' stay as they are +// should immediately go away and be removed after finalizing the update +// to apply the patch to a route add meta.patchCleanPath = true to it +// to patch needs to be enabled on a route level, to do so add meta.patchCleanPath = true property to the route +export const patchRouter = (router: Router) => { + const bindMatcher = router.match.bind(router) + const cleanPath = (route) => + [ + ['%2F', '/'], + ['//', '/'] + ].reduce((path, rule) => path.replaceAll(rule[0], rule[1]), route || '') + + router.match = (raw, current, redirectFrom) => { + const bindMatch = bindMatcher(raw, current, redirectFrom) + + if (!get(bindMatch, 'meta.patchCleanPath', false)) { + return bindMatch + } + + return { + ...bindMatch, + path: cleanPath(bindMatch.path), + fullPath: cleanPath(bindMatch.fullPath) + } + } + + return router +} diff --git a/packages/web-runtime/src/router/setupAuthGuard.ts b/packages/web-runtime/src/router/setupAuthGuard.ts new file mode 100644 index 00000000000..b77c892464f --- /dev/null +++ b/packages/web-runtime/src/router/setupAuthGuard.ts @@ -0,0 +1,44 @@ +import { extractPublicLinkToken, isPublicLinkContext, isUserContext } from './index' +import Router, { Route } from 'vue-router' +import Vue from 'vue' +import { contextRouteNameKey, queryItemAsString } from 'web-pkg/src/composables' + +export const setupAuthGuard = (router: Router) => { + router.beforeEach(async (to, from, next) => { + if (from && to.path === from.path && !hasContextRouteNameChanged(to, from)) { + // note: except for the context route, query changes can never trigger re-init of the auth context + return next() + } + + const store = (Vue as any).$store + const authService = (Vue as any).$authService + await authService.initializeContext(to) + + if (isUserContext(router, to) && !store.getters['runtime/auth/isUserContextReady']) { + return next({ path: '/login', query: { redirectUrl: to.fullPath } }) + } + if ( + isPublicLinkContext(router, to) && + !store.getters['runtime/auth/isPublicLinkContextReady'] + ) { + const publicLinkToken = extractPublicLinkToken(to) + return next({ + name: 'resolvePublicLink', + params: { token: publicLinkToken }, + query: { redirectUrl: to.fullPath } + }) + } + return next() + }) +} + +export const hasContextRouteNameChanged = (to: Route, from: Route): boolean => { + if (!to.query[contextRouteNameKey] && !from.query[contextRouteNameKey]) { + return false + } + + return ( + queryItemAsString(to.query[contextRouteNameKey]) !== + queryItemAsString(from.query[contextRouteNameKey]) + ) +} diff --git a/packages/web-runtime/src/services/auth.js b/packages/web-runtime/src/services/auth.js deleted file mode 100644 index e8fd33c55a7..00000000000 --- a/packages/web-runtime/src/services/auth.js +++ /dev/null @@ -1,111 +0,0 @@ -import { Log, User, UserManager, WebStorageStateStore } from 'oidc-client' -import { buildUrl } from '../router' - -export function initVueAuthenticate(config) { - if (config) { - const store = new WebStorageStateStore({ - prefix: 'oc_oAuth', - store: sessionStorage - }) - const openIdConfig = { - userStore: store, - redirect_uri: buildUrl('/oidc-callback.html'), - response_type: 'code', // code triggers auth code grant flow - response_mode: 'query', - scope: 'openid profile offline_access', - monitorSession: false, - post_logout_redirect_uri: buildUrl('/'), - silent_redirect_uri: buildUrl('/oidc-silent-redirect.html'), - accessTokenExpiringNotificationTime: 10, - automaticSilentRenew: true, - filterProtocolClaims: true, - loadUserInfo: true, - logLevel: Log.INFO - } - if (config.openIdConnect && config.openIdConnect.authority) { - Object.assign(openIdConfig, config.openIdConnect) - } else { - // old openidconnect setup - if (config.auth.metaDataUrl) { - Object.assign(openIdConfig, { - authority: config.auth.url, - metadataUrl: config.auth.metaDataUrl, - client_id: config.auth.clientId - }) - } else { - // oauth2 setup - Object.assign(openIdConfig, { - authority: config.auth.url, - // with OAuth2 we need to set the metadata manually - metadata: { - issuer: config.auth.url, - authorization_endpoint: config.auth.authUrl, - token_endpoint: config.auth.url, - userinfo_endpoint: '' - }, - client_id: config.auth.clientId, - response_type: 'token', // token is implicit flow - to be killed - scope: 'openid profile', - loadUserInfo: false - }) - } - } - - const mgr = new UserManager(openIdConfig) - - Log.logger = console - Log.level = openIdConfig.logLevel - - mgr.events.addUserSignedOut(function () { - console.log('UserSignedOut:', arguments) - }) - - return { - authenticate() { - return mgr.signinRedirect() - }, - getToken() { - const storageString = sessionStorage.getItem('oc_oAuth' + mgr._userStoreKey) - if (storageString) { - const user = User.fromStorageString(storageString) - if (user) { - mgr.events.load(user, false) - return user.access_token - } - } - return null - }, - getStoredUserObject() { - const storageString = sessionStorage.getItem('oc_oAuth' + mgr._userStoreKey) - if (storageString) { - const user = User.fromStorageString(storageString) - if (user) { - mgr.events.load(user, false) - return user - } - } - return null - }, - isAuthenticated() { - return this.getToken() !== null - }, - createSignoutRequest(idToken) { - return new Promise((resolve, reject) => { - mgr - .createSignoutRequest(idToken) - .then((signoutRequest) => resolve(signoutRequest.url)) - .catch((error) => reject(error)) - }) - }, - clearLoginState() { - return mgr.removeUser() - }, - mgr: mgr, - events() { - return mgr.events - } - } - } -} - -export default initVueAuthenticate diff --git a/packages/web-runtime/src/services/auth/authService.ts b/packages/web-runtime/src/services/auth/authService.ts new file mode 100644 index 00000000000..78cf96b1168 --- /dev/null +++ b/packages/web-runtime/src/services/auth/authService.ts @@ -0,0 +1,198 @@ +import { UserManager } from './userManager' +import { PublicLinkManager } from './publicLinkManager' +import { Store } from 'vuex' +import { ClientService } from 'web-pkg/src/services' +import { ConfigurationManager } from 'web-pkg/src/configuration' +import VueRouter, { Route } from 'vue-router' +import { extractPublicLinkToken, isPublicLinkContext, isUserContext } from '../../router' + +export class AuthService { + private clientService: ClientService + private configurationManager: ConfigurationManager + private store: Store + private router: VueRouter + private userManager: UserManager + private publicLinkManager: PublicLinkManager + + public initialize( + configurationManager: ConfigurationManager, + clientService: ClientService, + store: Store, + router: VueRouter + ): void { + this.configurationManager = configurationManager + this.clientService = clientService + this.store = store + this.router = router + } + + /** + * Initialize publicLinkContext and userContext (whichever is available, respectively). + * + * FIXME: at the moment the order "publicLink first, user second" is important, because we trigger the `ready` hook of all applications + * as soon as any context is ready. This works well for user context pages, because they can't have a public link context at the same time. + * Public links on the other hand could have a logged in user as well, thus we need to make sure that the public link context is loaded first. + * For the moment this is fine. In the future we might want to wait triggering the `ready` hook of applications until all available contexts + * are loaded. + * + * @param to {Route} + */ + public async initializeContext(to: Route) { + if (!this.publicLinkManager) { + this.publicLinkManager = new PublicLinkManager({ + clientService: this.clientService, + configurationManager: this.configurationManager, + store: this.store + }) + } + + if (isPublicLinkContext(this.router, to)) { + const publicLinkToken = extractPublicLinkToken(to) + if (publicLinkToken) { + await this.publicLinkManager.updateContext(publicLinkToken) + } + } + + if (!this.userManager) { + this.userManager = new UserManager({ + clientService: this.clientService, + configurationManager: this.configurationManager, + store: this.store + }) + this.userManager.events.addAccessTokenExpired(async (...args) => { + console.error('AccessToken Expired:', ...args) + await this.handleAuthError(this.router.currentRoute) + }) + this.userManager.events.addAccessTokenExpiring((...args) => { + console.debug('AccessToken Expiring:', ...args) + }) + this.userManager.events.addUserLoaded(async (user) => { + console.debug( + `New User Loaded. access_token: ${user.access_token}, refresh_token: ${user.refresh_token}` + ) + try { + await this.userManager.updateContext(user.access_token) + } catch (e) { + console.error(e) + await this.handleAuthError(this.router.currentRoute) + } + }) + this.userManager.events.addUserUnloaded(async () => { + console.log('user unloaded…') + await this.resetStateAfterUserLogout() + + if (this.userManager.unloadReason === 'authError') { + return this.router.push({ name: 'accessDenied' }) + } + + // handle redirect after logout + if (this.configurationManager.isOAuth2) { + const oAuth2 = this.configurationManager.oAuth2 + if (oAuth2.logoutUrl) { + return (window.location = oAuth2.logoutUrl as any) + } + return (window.location = + `${this.configurationManager.serverUrl}/index.php/logout` as any) + } + return (window.location = this.userManager.settings.post_logout_redirect_uri as any) + }) + this.userManager.events.addSilentRenewError(async (error) => { + console.error('Silent Renew Error:', error) + await this.handleAuthError(this.router.currentRoute) + }) + } + + // relevant for page reload: token is already in userStore + // no userLoaded event and no signInCallback gets triggered + const accessToken = await this.userManager.getAccessToken() + if (accessToken) { + try { + await this.userManager.updateContext(accessToken) + } catch (e) { + console.error(e) + await this.handleAuthError(this.router.currentRoute) + } + } + } + + public loginUser(redirectUrl?: string) { + this.userManager.setPostLoginRedirectUrl(redirectUrl) + return this.userManager.signinRedirect() + } + + /** + * Sign in callback gets called from the IDP after initial login. + */ + public async signInCallback() { + // craft a url that the parser in oidc-client-ts can handle… this is required for oauth2 logins + const url = + '/?' + + new URLSearchParams(this.router.currentRoute.query as Record).toString() + + try { + await this.userManager.signinRedirectCallback(url) + + const redirectUrl = this.userManager.getAndClearPostLoginRedirectUrl() + return this.router.push({ path: redirectUrl }) + } catch (e) { + console.warn('error during authentication:', e) + return this.handleAuthError(this.router.currentRoute) + } + } + + /** + * Sign in silent callback gets called with OIDC during access token renewal when no `refresh_token` + * is present (`refresh_token` exists when `offline_access` is present in scopes). + * + * The oidc-client lib emits a userLoaded event internally, which already handles the token update + * in web. + */ + public async signInSilentCallback() { + await this.userManager.signinSilentCallback() + } + + public async handleAuthError(route: Route) { + if (isPublicLinkContext(this.router, route)) { + const token = extractPublicLinkToken(route) + this.publicLinkManager.clear(token) + return this.router.push({ + name: 'resolvePublicLink', + params: { token }, + query: { redirectUrl: route.fullPath } + }) + } + if (isUserContext(this.router, route)) { + await this.userManager.removeUser('authError') + } + } + + public async resolvePublicLink(token: string, passwordRequired: boolean, password: string) { + this.publicLinkManager.setPasswordRequired(token, passwordRequired) + this.publicLinkManager.setPassword(token, password) + this.publicLinkManager.setResolved(token, true) + + await this.publicLinkManager.updateContext(token) + } + + public async logoutUser() { + const u = await this.userManager.getUser() + if (u && u.id_token) { + return this.userManager.signoutRedirect({ id_token_hint: u.id_token }) + } else { + await this.userManager.removeUser() + } + } + + private async resetStateAfterUserLogout() { + // TODO: create UserUnloadTask interface and allow registering unload-tasks in the authService + await this.store.dispatch('runtime/auth/clearUserContext') + await this.store.dispatch('resetUserState') + await Promise.all([ + this.store.dispatch('clearDynamicNavItems'), + this.store.dispatch('hideModal'), + this.store.dispatch('clearSettingsValues') + ]) + } +} + +export const authService = new AuthService() diff --git a/packages/web-runtime/src/services/auth/index.ts b/packages/web-runtime/src/services/auth/index.ts new file mode 100644 index 00000000000..c265612971d --- /dev/null +++ b/packages/web-runtime/src/services/auth/index.ts @@ -0,0 +1 @@ +export * from './authService' diff --git a/packages/web-runtime/src/services/auth/publicLinkManager.ts b/packages/web-runtime/src/services/auth/publicLinkManager.ts new file mode 100644 index 00000000000..4387c538b82 --- /dev/null +++ b/packages/web-runtime/src/services/auth/publicLinkManager.ts @@ -0,0 +1,135 @@ +import { ClientService } from 'web-pkg/src/services' +import { ConfigurationManager } from 'web-pkg/src/configuration' +import { Store } from 'vuex' +import isEmpty from 'lodash-es/isEmpty' +import omit from 'lodash-es/omit' + +export interface PublicLinkManagerOptions { + clientService: ClientService + configurationManager: ConfigurationManager + store: Store +} + +export class PublicLinkManager { + private clientService: ClientService + private configurationManager: ConfigurationManager + private store: Store + + constructor(options: PublicLinkManagerOptions) { + this.clientService = options.clientService + this.configurationManager = options.configurationManager + this.store = options.store + } + + private static buildStorageKey(token: string, suffix: string): string { + return `oc.publicLink.${token}.${suffix}` + } + + async clear(token: string): Promise { + ;['resolved', 'passwordRequired', 'password'].forEach((key) => { + sessionStorage.removeItem(PublicLinkManager.buildStorageKey(token, key)) + }) + await this.store.dispatch('runtime/auth/clearPublicLinkContext') + } + + isResolved(token: string): boolean { + const resolved = sessionStorage.getItem(PublicLinkManager.buildStorageKey(token, 'resolved')) + return resolved === 'true' + } + + setResolved(token: string, resolved: boolean): void { + sessionStorage.setItem(PublicLinkManager.buildStorageKey(token, 'resolved'), resolved + '') + } + + isPasswordRequired(token: string): boolean { + const passwordRequired = sessionStorage.getItem( + PublicLinkManager.buildStorageKey(token, 'passwordRequired') + ) + return passwordRequired === 'true' + } + + setPasswordRequired(token: string, required: boolean): void { + sessionStorage.setItem( + PublicLinkManager.buildStorageKey(token, 'passwordRequired'), + required + '' + ) + } + + getPassword(token: string): string { + const password = sessionStorage.getItem(PublicLinkManager.buildStorageKey(token, 'password')) + if (password) { + try { + return Buffer.from(password, 'base64').toString() + } catch (e) { + this.clear(token) + } + } + return '' + } + + setPassword(token: string, password: string): void { + if (password.length) { + const encodedPassword = Buffer.from(password).toString('base64') + sessionStorage.setItem(PublicLinkManager.buildStorageKey(token, 'password'), encodedPassword) + } else { + sessionStorage.removeItem(PublicLinkManager.buildStorageKey(token, 'password')) + } + } + + async updateContext(token: string) { + if (!this.isResolved(token)) { + return + } + if ( + this.store.getters['runtime/auth/isPublicLinkContextReady'] && + this.store.getters['runtime/auth/publicLinkToken'] === token + ) { + return + } + + let password + if (this.isPasswordRequired(token)) { + password = this.getPassword(token) + } + + try { + await this.fetchCapabilities({ + token, + password + }) + } catch (e) { + console.error(e) + } + + this.store.commit('runtime/auth/SET_PUBLIC_LINK_CONTEXT', { + publicLinkToken: token, + publicLinkPassword: password, + publicLinkContextReady: true + }) + } + + private async fetchCapabilities({ token = '', password = '' }): Promise { + if (!isEmpty(this.store.getters.capabilities)) { + return + } + const client = this.clientService.ocsPublicLinkContext( + this.configurationManager.serverUrl, + token, + password + ) + const response = await client.getCapabilities() + + // FIXME: ocis at the moment is not able to create archives for public links that are password protected + // until this is supported by the backend remove it hard as a workaround + // https://github.com/owncloud/web/issues/6423 + if (password) { + this.store.commit('SET_CAPABILITIES', { + capabilities: omit(response.capabilities, ['files.archivers']), + version: response.version + }) + return + } + + this.store.commit('SET_CAPABILITIES', response) + } +} diff --git a/packages/web-runtime/src/services/auth/userManager.ts b/packages/web-runtime/src/services/auth/userManager.ts new file mode 100644 index 00000000000..1aa18a006ae --- /dev/null +++ b/packages/web-runtime/src/services/auth/userManager.ts @@ -0,0 +1,237 @@ +import { + Log, + WebStorageStateStore, + UserManager as OidcUserManager, + UserManagerSettings +} from 'oidc-client-ts' +import { buildUrl } from '../../router' +import { ConfigurationManager } from 'web-pkg/src/configuration' +import { ClientService } from 'web-pkg/src/services' +import { Store } from 'vuex' +import isEmpty from 'lodash-es/isEmpty' +import axios from 'axios' + +const postLoginRedirectUrlKey = 'oc.postLoginRedirectUrl' +type UnloadReason = 'authError' | 'logout' + +export interface UserManagerOptions { + clientService: ClientService + configurationManager: ConfigurationManager + store: Store +} + +export class UserManager extends OidcUserManager { + private readonly storePrefix + private clientService: ClientService + private configurationManager: ConfigurationManager + private store: Store + private updateAccessTokenPromise: Promise | null + private _unloadReason: UnloadReason + + constructor(options: UserManagerOptions) { + const storePrefix = 'oc_oAuth.' + const userStore = new WebStorageStateStore({ + prefix: storePrefix, + store: sessionStorage + }) + const openIdConfig: UserManagerSettings = { + userStore, + redirect_uri: buildUrl('/oidc-callback.html'), + silent_redirect_uri: buildUrl('/oidc-silent-redirect.html'), + + response_mode: 'query', + response_type: 'code', // "code" triggers auth code grant flow + + post_logout_redirect_uri: buildUrl('/'), + accessTokenExpiringNotificationTimeInSeconds: 10, + authority: '', + client_id: '' + } + + if (options.configurationManager.isOIDC) { + Object.assign(openIdConfig, { + scope: 'openid profile', + loadUserInfo: true, + ...options.configurationManager.oidc + }) + } else if (options.configurationManager.isOAuth2) { + const oAuth2 = options.configurationManager.oAuth2 + Object.assign(openIdConfig, { + authority: oAuth2.url, + client_id: oAuth2.clientId, + ...(oAuth2.clientSecret && { + client_authentication: 'client_secret_basic', + client_secret: oAuth2.clientSecret + }), + + scope: 'profile', + loadUserInfo: false, + metadata: { + issuer: oAuth2.url, + authorization_endpoint: oAuth2.authUrl, + token_endpoint: oAuth2.url, + userinfo_endpoint: '' + } + }) + } + + Log.setLevel(Log.INFO) + + super(openIdConfig) + this.storePrefix = storePrefix + this.clientService = options.clientService + this.configurationManager = options.configurationManager + this.store = options.store + } + + /** + * Looks up the access token of an already loaded user without enforcing a signin if no user exists. + * + * @return (string|null) + */ + async getAccessToken(): Promise { + const user = await this.getUser() + return user?.access_token + } + + async removeUser(unloadReason: UnloadReason = 'logout') { + this._unloadReason = unloadReason + await super.removeUser() + } + + get unloadReason(): UnloadReason { + return this._unloadReason + } + + getAndClearPostLoginRedirectUrl(): string { + const url = sessionStorage.getItem(postLoginRedirectUrlKey) || '/' + sessionStorage.removeItem(postLoginRedirectUrlKey) + return url + } + + setPostLoginRedirectUrl(url?: string): void { + if (url) { + sessionStorage.setItem(postLoginRedirectUrlKey, url) + } else { + sessionStorage.removeItem(postLoginRedirectUrlKey) + } + } + + updateContext(accessToken: string): Promise { + const userKnown = !!this.store.getters.user.id + const accessTokenChanged = this.store.getters['runtime/auth/accessToken'] !== accessToken + if (!accessTokenChanged) { + return this.updateAccessTokenPromise + } + this.store.commit('runtime/auth/SET_ACCESS_TOKEN', accessToken) + + this.updateAccessTokenPromise = (async () => { + this.initializeOwnCloudSdk(accessToken) + + if (!userKnown) { + await this.fetchUserInfo(accessToken) + this.store.commit('runtime/auth/SET_USER_CONTEXT_READY', true) + } + })() + return this.updateAccessTokenPromise + } + + private initializeOwnCloudSdk(accessToken): void { + const options = { + baseUrl: this.configurationManager.serverUrl, + auth: { + bearer: accessToken + } + } + if (this.store.getters.user.id) { + ;(options as any).userInfo = { + id: this.store.getters.user.id, + 'display-name': this.store.getters.user.displayname, + email: this.store.getters.user.email + } + } + + this.clientService.owncloudSdk.init(options) + } + + private async fetchUserInfo(accessToken): Promise { + const login = await this.clientService.owncloudSdk.getCurrentUser() + await this.fetchCapabilities({ accessToken }) + + // FIXME: Fetching the user from the graph api can be removed as soon as the uuid is integrated in the OCS api + // see https://github.com/owncloud/ocis/issues/3271 + let graphUser + let role = null + if (this.store.getters.capabilities.spaces?.enabled) { + const graphClient = this.clientService.graphAuthenticated( + this.configurationManager.serverUrl, + accessToken + ) + graphUser = await graphClient.users.getMe() + const { + data: { bundles: roles } + } = await axios.post( + '/api/v0/settings/roles-list', + {}, + { + headers: { + authorization: `Bearer ${accessToken}` + } + } + ) + + this.store.commit('SET_ROLES', roles) + + const userAssignmentResponse = await axios.post( + '/api/v0/settings/assignments-list', + { + account_uuid: graphUser.data.id + }, + { + headers: { + authorization: `Bearer ${accessToken}` + } + } + ) + const assignments = userAssignmentResponse.data?.assignments + const roleAssignment = assignments.find((assignment) => 'roleId' in assignment) + + if (roleAssignment) { + role = roles.find((role) => role.id === roleAssignment.roleId) + } + } + const [user, userGroups] = await Promise.all([ + await this.clientService.owncloudSdk.users.getUser(login.id), + await this.clientService.owncloudSdk.users.getUserGroups(login.id) + ]) + this.store.commit('SET_USER', { + id: login.id, + uuid: graphUser?.data?.id || '', + username: login.username || login.id, + displayname: user.displayname || login['display-name'], + email: login?.email || user?.email || '', + groups: userGroups, + role, + language: login?.language, + ...(user.quota && + user.quota.definition !== 'default' && + user.quota.definition !== 'none' && { quota: user.quota }) + }) + + await this.store.dispatch('loadSettingsValues') + } + + private async fetchCapabilities({ accessToken = '' }): Promise { + if (!isEmpty(this.store.getters.capabilities)) { + return + } + + const client = this.clientService.ocsUserContext( + this.configurationManager.serverUrl, + accessToken + ) + const capabilities = await client.getCapabilities() + + this.store.commit('SET_CAPABILITIES', capabilities) + } +} diff --git a/packages/web-runtime/src/store/auth.ts b/packages/web-runtime/src/store/auth.ts new file mode 100644 index 00000000000..6920bff437d --- /dev/null +++ b/packages/web-runtime/src/store/auth.ts @@ -0,0 +1,53 @@ +const state = { + accessToken: null, + userContextReady: false, + publicLinkToken: null, + publicLinkPassword: null, + publicLinkContextReady: false +} + +const getters = { + accessToken: (state) => state.accessToken, + isUserContextReady: (state) => state.userContextReady, + publicLinkToken: (state) => state.publicLinkToken, + publicLinkPassword: (state) => state.publicLinkPassword, + isPublicLinkContextReady: (state) => state.publicLinkContextReady +} + +const mutations = { + SET_ACCESS_TOKEN(state, accessToken) { + state.accessToken = accessToken + }, + SET_USER_CONTEXT_READY(state, ready) { + state.userContextReady = ready + }, + SET_PUBLIC_LINK_CONTEXT(state, { publicLinkToken, publicLinkPassword, publicLinkContextReady }) { + state.publicLinkToken = publicLinkToken + state.publicLinkPassword = publicLinkPassword + if (typeof publicLinkContextReady === 'boolean') { + state.publicLinkContextReady = publicLinkContextReady + } + } +} + +const actions = { + clearUserContext({ commit }) { + commit('SET_ACCESS_TOKEN', null) + commit('SET_USER_CONTEXT_READY', false) + }, + clearPublicLinkContext({ commit }) { + commit('SET_PUBLIC_LINK_CONTEXT', { + publicLinkToken: null, + publicLinkPassword: null, + publicLinkContextReady: false + }) + } +} + +export default { + namespaced: true, + state, + getters, + mutations, + actions +} diff --git a/packages/web-runtime/src/store/index.js b/packages/web-runtime/src/store/index.js index 84133dfd02c..c23e2318cf5 100644 --- a/packages/web-runtime/src/store/index.js +++ b/packages/web-runtime/src/store/index.js @@ -1,43 +1,31 @@ -import VuexPersistence from 'vuex-persist' - -/* STORE MODULES - */ import app from './app' import apps from './apps' +import auth from './auth' import config from './config' import user from './user' -import router from './router' import settings from './settings' import modal from './modal' import navigation from './navigation' -const vuexPersistInSession = new VuexPersistence({ - key: 'webStateInSessionStorage', - // Browser tab independent storage which gets deleted after the tab is closed - storage: window.sessionStorage, - reducer: (state) => { - const { user, navigation, router } = state - return { - user, - navigation, - router - } - } -}) - const strict = process.env.NODE_ENV === 'development' +const runtime = { + namespaced: true, + modules: { + auth + } +} + export default { - plugins: [vuexPersistInSession.plugin], modules: { app, apps, user, config, - router, settings, modal, - navigation + navigation, + runtime }, strict } diff --git a/packages/web-runtime/src/store/router.js b/packages/web-runtime/src/store/router.js deleted file mode 100644 index fc2c5e8d4db..00000000000 --- a/packages/web-runtime/src/store/router.js +++ /dev/null @@ -1,26 +0,0 @@ -const state = { - urlBeforeLogin: null -} - -const actions = { - saveUrlBeforeLogin({ commit }, url) { - commit('SAVE_URL_BEFORE_LOGIN', url) - } -} - -const mutations = { - SAVE_URL_BEFORE_LOGIN(state, url) { - state.urlBeforeLogin = url - } -} - -const getters = { - urlBeforeLogin: (state) => state.urlBeforeLogin -} - -export default { - state, - actions, - mutations, - getters -} diff --git a/packages/web-runtime/src/store/settings.js b/packages/web-runtime/src/store/settings.js index 5edc4cda738..12d27f86040 100644 --- a/packages/web-runtime/src/store/settings.js +++ b/packages/web-runtime/src/store/settings.js @@ -9,6 +9,10 @@ const state = { } const actions = { + clearSettingsValues({ commit }) { + commit('SET_SETTINGS_VALUES', null) + }, + async loadSettingsValues({ commit, state, dispatch }) { const oldSettingsValues = state.settingsValues commit('SET_SETTINGS_VALUES', null) diff --git a/packages/web-runtime/src/store/user.js b/packages/web-runtime/src/store/user.js deleted file mode 100644 index 38ce5de36a5..00000000000 --- a/packages/web-runtime/src/store/user.js +++ /dev/null @@ -1,312 +0,0 @@ -import get from 'lodash-es/get' -import isEmpty from 'lodash-es/isEmpty' -import initVueAuthenticate from '../services/auth' -import { router } from '../router' -import { clientService } from 'web-pkg/src/services' - -import { setUser as sentrySetUser } from '@sentry/browser' - -let vueAuthInstance - -const state = { - token: '', - id: '', - uuid: '', - displayname: '', - email: '', - isAuthenticated: false, - capabilities: [], - version: {}, - groups: [], - userReady: false, - quota: null, - language: null -} - -const actions = { - cleanUpLoginState(context) { - if (context.state.id === '') { - return - } - - // reset user - this.reset({ self: false, nested: false, modules: { user: { self: true } } }) - - // clear dynamic navItems - context.dispatch('clearDynamicNavItems') - - // clear oidc client state - vueAuthInstance.clearLoginState() - }, - async logout(context) { - const logoutFinalizer = () => { - // Remove signed in user - context.dispatch('cleanUpLoginState') - context.dispatch('hideModal') - context.dispatch('loadSettingsValues') - } - const u = await vueAuthInstance.getStoredUserObject() - - if (u && u.id_token) { - vueAuthInstance - .createSignoutRequest({ id_token_hint: u.id_token }) - .then((signoutRequestUrl) => { - logoutFinalizer() - - // Navigate to signout URL - window.open(signoutRequestUrl, '_self') - }) - .catch((error) => { - console.error(error) - }) - } else { - // Oauth2 logout - logoutFinalizer() - } - }, - async initAuth(context, payload = { autoRedirect: false }) { - const init = async (client, token, doLogin = true) => { - const instance = context.rootState.config.server || window.location.origin - const options = { - baseUrl: instance, - auth: { - bearer: token - }, - headers: { - 'X-Requested-With': 'XMLHttpRequest' - } - } - if (context.state.id) { - options.userInfo = { - id: context.state.id, - 'display-name': context.state.displayname, - email: context.state.email - } - } - - client.init(options) - if (doLogin) { - let login - try { - login = await client.login() - } catch (e) { - console.warn('Seems that your token is invalid. Error:', e) - context.dispatch('cleanUpLoginState') - router.push({ name: 'accessDenied' }) - return - } - - const userGroups = await client.users.getUserGroups(login.id) - const user = await client.users.getUser(login.id) - - // FIXME: Can be removed as soon as the uuid is integrated in the OCS api - let graphUser - if (context.state.capabilities.spaces?.enabled) { - const graphClient = clientService.graphAuthenticated(instance, token) - graphUser = await graphClient.users.getMe() - } - - let userEmail = '' - if (login && login.email) { - userEmail = login.email - } else if (user && user.email) { - userEmail = user.email - } - - const language = user?.language - - context.commit('SET_USER', { - id: login.id, - uuid: graphUser?.data?.id || '', - username: login.username, - displayname: login.displayname || login['display-name'], - email: userEmail, - token, - isAuthenticated: true, - groups: userGroups, - language - }) - - if (user.quota.definition !== 'default' && user.quota.definition !== 'none') { - context.commit('SET_QUOTA', user.quota) - } - await context.dispatch('loadSettingsValues') - if (payload.autoRedirect) { - router.push({ path: '/' }).catch(() => {}) - } - } else { - context.commit('UPDATE_TOKEN', token) - } - - await context.dispatch('loadCapabilities', { token }) - context.commit('SET_USER_READY', true) - } - // if called from login, use available vue-authenticate instance; else re-init - if (!vueAuthInstance) { - vueAuthInstance = initVueAuthenticate(context.rootState.config) - const client = this._vm.$client - vueAuthInstance.events().addAccessTokenExpired(function () { - console.log('AccessToken Expired:', arguments) - }) - vueAuthInstance.mgr.events.addAccessTokenExpiring(function () { - console.log('AccessToken Expiring:', arguments) - }) - vueAuthInstance.events().addUserLoaded((user) => { - console.log( - `New User Loaded. access_token: ${user.access_token}, refresh_token: ${user.refresh_token}` - ) - init(client, user.access_token, false) - }) - vueAuthInstance.events().addUserUnloaded(() => { - console.log('user unloaded…') - context.dispatch('cleanUpLoginState') - - if (context.getters?.configuration?.auth) { - // => OAuth2 - if (context.getters?.configuration?.auth?.logoutUrl) { - return (window.location = context.getters?.configuration?.auth?.logoutUrl) - } else if (context.getters?.configuration?.server) { - return (window.location = `${context.getters?.configuration?.server}index.php/logout`) - } - } - router.push({ name: 'login' }) - }) - vueAuthInstance.events().addSilentRenewError((error) => { - console.error('Silent Renew Error:', error) - context.dispatch('cleanUpLoginState') - router.push({ name: 'accessDenied' }) - }) - } - const token = vueAuthInstance.getToken() - if (token) { - await init(this._vm.$client, token) - } - }, - login(context, payload = { provider: 'oauth2' }) { - // reset vue-authenticate - vueAuthInstance = initVueAuthenticate(context.rootState.config) - vueAuthInstance.authenticate(payload.provider, {}, {}).then(() => { - if (vueAuthInstance.isAuthenticated) { - context.dispatch('initAuth') - } - }) - }, - callback(context) { - if (!vueAuthInstance) vueAuthInstance = initVueAuthenticate(context.rootState.config) - vueAuthInstance.mgr - .signinRedirectCallback() - .then(() => { - context.dispatch('initAuth', { autoRedirect: true }) - }) - .catch((e) => { - console.warn('error in OpenIdConnect:', e) - context.dispatch('cleanUpLoginState') - router.push({ name: 'accessDenied' }) - }) - }, - signinSilentCallback(context) { - if (!vueAuthInstance) vueAuthInstance = initVueAuthenticate(context.rootState.config) - vueAuthInstance.mgr.signinSilentCallback().then(() => { - context.dispatch('initAuth') - }) - }, - async loadCapabilities( - { commit, rootState, state }, - { token, publicToken, user, password, overwrite = false } - ) { - if (!isEmpty(state.capabilities) && !overwrite) { - return - } - - const endpoint = new URL(rootState.config.server || window.location.origin) - endpoint.pathname = endpoint.pathname.replace(/\/$/, '') + '/ocs/v1.php/cloud/capabilities' - endpoint.searchParams.append('format', 'json') - - const headers = { - 'X-Requested-With': 'XMLHttpRequest', - ...(publicToken && { 'public-token': publicToken }), - ...(user && - password && { - Authorization: 'Basic ' + Buffer.from([user, password].join(':')).toString('base64') - }), - ...(token && { - Authorization: 'Bearer ' + token - }) - } - - const capabilitiesApiResponse = await fetch(endpoint.href, { headers }) - const capabilitiesApiResponseJson = await capabilitiesApiResponse.json() - - commit( - 'SET_CAPABILITIES', - get(capabilitiesApiResponseJson, 'ocs.data', { capabilities: null, version: null }) - ) - } -} - -const mutations = { - SET_USER(state, user) { - let email - if (Object.keys(user.email).length === 0) { - email = '' - } else { - email = user.email - } - state.displayname = user.displayname - state.id = user.id - state.uuid = user.uuid - state.username = user.username - state.email = email - state.isAuthenticated = user.isAuthenticated - state.token = user.token - state.groups = user.groups - state.language = user.language - sentrySetUser({ username: user.id }) - }, - SET_CAPABILITIES(state, data) { - state.capabilities = data.capabilities - state.version = data.version - }, - UPDATE_TOKEN(state, token) { - state.token = token - }, - SET_USER_READY(state, ready) { - state.userReady = ready - }, - SET_QUOTA(state, quota) { - // Turn strings into ints - quota.free = parseInt(quota.free) - quota.relative = parseFloat(quota.relative) - quota.used = parseInt(quota.used) - quota.total = parseInt(quota.total) - - state.quota = quota - } -} - -const getters = { - isAuthenticated: (state) => { - return state.isAuthenticated - }, - isUserReady: (state) => { - return state.userReady - }, - getToken: (state) => { - return state.token - }, - user: (state) => { - return state - }, - capabilities: (state) => { - return state.capabilities - }, - - quota: (state) => state.quota -} - -export default { - state, - actions, - mutations, - getters -} diff --git a/packages/web-runtime/src/store/user.ts b/packages/web-runtime/src/store/user.ts new file mode 100644 index 00000000000..5e5f2f6a95e --- /dev/null +++ b/packages/web-runtime/src/store/user.ts @@ -0,0 +1,83 @@ +import { setUser as sentrySetUser } from '@sentry/browser' + +const state = { + id: '', + uuid: '', + displayname: '', + email: '', + capabilities: [], + version: {}, + groups: [], + quota: null, + language: null, + role: null, + roles: [] +} + +const getters = { + /** + * The `getToken` getter is deprecated. Please use getters['runtime/auth/accessToken'] instead. + * + * @param state + * @param getters + * @param rootState + * @param rootGetters + */ + getToken: (state, getters, rootState, rootGetters) => rootGetters['runtime/auth/accessToken'], + capabilities: (state) => state.capabilities, + quota: (state) => state.quota, + user: (state) => state +} + +const mutations = { + SET_USER(state, user) { + let email + if (Object.keys(user.email).length === 0) { + email = '' + } else { + email = user.email + } + state.displayname = user.displayname + state.id = user.id + state.uuid = user.uuid + state.username = user.username + state.email = email + state.groups = user.groups + state.language = user.language + state.role = user.role + sentrySetUser({ username: user.id }) + }, + SET_CAPABILITIES(state, data) { + state.capabilities = data.capabilities + state.version = data.version + }, + SET_QUOTA(state, quota) { + // Turn strings into ints + quota.free = parseInt(quota.free) + quota.relative = parseFloat(quota.relative) + quota.used = parseInt(quota.used) + quota.total = parseInt(quota.total) + + state.quota = quota + }, + SET_ROLES(state, roles) { + state.roles = roles + } +} + +const actions = { + resetUserState(context) { + if (context.state.id === '') { + return + } + // reset user + this.reset({ self: false, nested: false, modules: { user: { self: true } } }) + } +} + +export default { + state, + actions, + mutations, + getters +} diff --git a/packages/web-runtime/tests/unit/components/Avatar.spec.js b/packages/web-runtime/tests/unit/components/Avatar.spec.js index 4f3ee2c3e7f..92c8230f17c 100644 --- a/packages/web-runtime/tests/unit/components/Avatar.spec.js +++ b/packages/web-runtime/tests/unit/components/Avatar.spec.js @@ -132,7 +132,6 @@ function getShallowWrapper(loading = false) { function createStore() { return new Vuex.Store({ getters: { - getToken: jest.fn(() => 'GFwHKXdsMgoFwt'), capabilities: jest.fn(() => ({ files_sharing: { user: { @@ -143,6 +142,19 @@ function createStore() { configuration: jest.fn(() => ({ server: 'https://oc10.org' })) + }, + modules: { + runtime: { + namespaced: true, + modules: { + auth: { + namespaced: true, + getters: { + accessToken: () => 'GFwHKXdsMgoFwt' + } + } + } + } } }) } diff --git a/packages/web-runtime/tests/unit/components/EditPasswordModal.spec.js b/packages/web-runtime/tests/unit/components/EditPasswordModal.spec.js new file mode 100644 index 00000000000..6bfc68884af --- /dev/null +++ b/packages/web-runtime/tests/unit/components/EditPasswordModal.spec.js @@ -0,0 +1,60 @@ +import Vuex from 'vuex' +import { mount, createLocalVue } from '@vue/test-utils' +import EditPasswordModal from '../../../src/components/EditPasswordModal' + +const localVue = createLocalVue() +localVue.use(Vuex) + +afterEach(() => jest.clearAllMocks()) + +describe('EditPasswordModal', () => { + describe('computed method "confirmButtonDisabled"', () => { + it('should be true if any data set is invalid', () => { + const wrapper = getWrapper() + wrapper.vm.currentPassword = '' + expect(wrapper.vm.confirmButtonDisabled).toBeTruthy() + }) + it('should be false if no data set is invalid', () => { + const wrapper = getWrapper() + wrapper.vm.currentPassword = 'password' + wrapper.vm.newPassword = 'newpassword' + wrapper.vm.newPasswordConfirm = 'newpassword' + expect(wrapper.vm.confirmButtonDisabled).toBeFalsy() + }) + }) + + describe('method "validatePasswordConfirm"', () => { + it('should be true if passwords are identical', () => { + const wrapper = getWrapper() + wrapper.vm.newPassword = 'newpassword' + wrapper.vm.newPasswordConfirm = 'newpassword' + expect(wrapper.vm.validatePasswordConfirm).toBeTruthy() + }) + it('should be false if passwords are not identical', () => { + const wrapper = getWrapper() + wrapper.vm.newPassword = 'newpassword' + wrapper.vm.newPasswordConfirm = 'anothernewpassword' + expect(wrapper.vm.validatePasswordConfirm).toBeTruthy() + }) + }) +}) + +function getWrapper() { + return mount(EditPasswordModal, { + localVue, + mocks: { + $gettext: jest.fn(), + $gettextInterpolate: jest.fn() + }, + propsData: { + cancel: jest.fn(), + confirm: jest.fn(), + existingGroups: [ + { + displayName: 'admins' + } + ] + }, + stubs: { 'oc-modal': true, 'oc-text-input': true } + }) +} diff --git a/packages/web-runtime/tests/unit/container/bootstrap.spec.ts b/packages/web-runtime/tests/unit/container/bootstrap.spec.ts index 09ec81a54f1..df8242a0cec 100644 --- a/packages/web-runtime/tests/unit/container/bootstrap.spec.ts +++ b/packages/web-runtime/tests/unit/container/bootstrap.spec.ts @@ -1,9 +1,14 @@ -import { announceApplications } from '../../../src/container' +import { + initializeApplications, + announceApplicationsReady, + announcePermissionManager +} from '../../../src/container' import { buildApplication } from '../../../src/container/application' +import { Vue } from './../../../src/defaults' jest.mock('../../../src/container/application') -describe('announce applications', () => { +describe('initialize applications', () => { it('continues even if one or more applications are falsy', async () => { const fishyError = new Error('fishy') const initialize = jest.fn() @@ -21,7 +26,7 @@ describe('announce applications', () => { jest.mocked(buildApplication).mockImplementation(buildApplicationMock) - await announceApplications({ + const applications = await initializeApplications({ runtimeConfiguration: { apps: ['internalFishy', 'internalValid'], external_apps: [{ path: 'externalFishy' }, { path: 'externalValid' }] @@ -34,9 +39,20 @@ describe('announce applications', () => { expect(buildApplicationMock).toHaveBeenCalledTimes(4) expect(initialize).toHaveBeenCalledTimes(2) - expect(ready).toHaveBeenCalledTimes(2) expect(errorSpy).toHaveBeenCalledTimes(2) expect(errorSpy.mock.calls[0][0]).toMatchObject(fishyError) expect(errorSpy.mock.calls[1][0]).toMatchObject(fishyError) + + await announceApplicationsReady({ applications }) + expect(ready).toHaveBeenCalledTimes(2) + }) +}) + +describe('announcePermissionManager', () => { + it('should inject vue object contains permissionManager instance', () => { + const vue = Vue + announcePermissionManager({ vue: Vue, store: {} as any }) + expect(vue.prototype.$permissionManager).toBeDefined() + expect(vue.$permissionManager).toBeDefined() }) }) diff --git a/packages/web-runtime/tests/unit/pages/account.spec.js b/packages/web-runtime/tests/unit/pages/account.spec.js index 1a4251b51c3..8804bccd58c 100644 --- a/packages/web-runtime/tests/unit/pages/account.spec.js +++ b/packages/web-runtime/tests/unit/pages/account.spec.js @@ -4,8 +4,12 @@ import Vuex from 'vuex' import { createStore } from 'vuex-extensions' import GetTextPlugin from 'vue-gettext' import VueCompositionAPI from '@vue/composition-api' +import mockAxios from 'jest-mock-axios' +import { clientService } from 'web-pkg/src/services' const localVue = createLocalVue() +localVue.prototype.$clientService = clientService + localVue.use(Vuex) localVue.use(VueCompositionAPI) @@ -123,6 +127,50 @@ describe('account page', () => { }) }) }) + + describe('method "editPassword"', () => { + it('should show message on success', async () => { + mockAxios.request.mockImplementationOnce(() => { + return Promise.resolve() + }) + const store = getStore({ server: 'https://example.com' }) + const wrapper = getWrapper(store) + + const showMessageStub = jest.spyOn(wrapper.vm, 'showMessage') + + await wrapper.vm.editPassword('password', 'newPassword') + + expect(showMessageStub).toHaveBeenCalled() + }) + + it('should show message on error', async () => { + mockAxios.request.mockImplementationOnce(() => { + return Promise.reject(new Error()) + }) + const store = getStore({ server: 'https://example.com' }) + const wrapper = getWrapper(store) + + jest.spyOn(console, 'error').mockImplementation(() => {}) + const showMessageStub = jest.spyOn(wrapper.vm, 'showMessage') + + await wrapper.vm.editPassword('password', 'newPassword') + + expect(showMessageStub).toHaveBeenCalled() + }) + }) + + describe('computed method "isChangePasswordEnabled"', () => { + it('should be true if capability is enabled', () => { + const store = getStore({ capabilities: { spaces: { enabled: true } } }) + const wrapper = getWrapper(store) + expect(wrapper.vm.isChangePasswordEnabled).toBeTruthy() + }) + it('should be false if capability is not enabled', () => { + const store = getStore() + const wrapper = getWrapper(store) + expect(wrapper.vm.isChangePasswordEnabled).toBeFalsy() + }) + }) }) function getWrapper(store = getStore()) { @@ -149,14 +197,25 @@ function getStore({ user = {}, server = '', getNavItemsByExtension = jest.fn(() => []), - isAccountEditingEnabled = true + isAccountEditingEnabled = true, + capabilities = {} } = {}) { return createStore(Vuex.Store, { + actions: { + createModal: jest.fn(), + hideModal: jest.fn(), + showMessage: jest.fn(), + setModalInputErrorMessage: jest.fn() + }, getters: { user: () => user, configuration: () => ({ server: server }), + getToken: () => 'token', + capabilities: () => { + return capabilities + }, getNavItemsByExtension: () => getNavItemsByExtension, apps: () => ({ ...(isAccountEditingEnabled || { settings: {} }) diff --git a/packages/web-app-files/tests/unit/views/PublicLink.spec.js b/packages/web-runtime/tests/unit/pages/resolvePublicLink.js similarity index 93% rename from packages/web-app-files/tests/unit/views/PublicLink.spec.js rename to packages/web-runtime/tests/unit/pages/resolvePublicLink.js index 55beca506ec..571e59815f4 100644 --- a/packages/web-app-files/tests/unit/views/PublicLink.spec.js +++ b/packages/web-runtime/tests/unit/pages/resolvePublicLink.js @@ -1,6 +1,6 @@ -import PublicLink from '@files/src/views/PublicLink.vue' -import { getStore, localVue } from './views.setup.js' +import { getStore, localVue } from 'files/tests/unit/views/views.setup.js' import { shallowMount, mount } from '@vue/test-utils' +import resolvePublicLink from '../../../src/pages/resolvePublicLink' const theme = { general: { slogan: 'some-slogan' } @@ -13,7 +13,7 @@ const stubs = { const route = { meta: { title: 'some page title' }, params: { token: 'some-token' } } -const component = { ...PublicLink, mounted: jest.fn(), created: jest.fn() } +const component = { ...resolvePublicLink, mounted: jest.fn(), created: jest.fn() } const selectors = { cardFooter: '.oc-card-footer', @@ -26,7 +26,7 @@ const selectors = { const spinnerStub = 'oc-spinner-stub' const textInputStub = 'oc-text-input-stub' -describe('PublicLink', () => { +describe('resolvePublicLink', () => { describe('theming options', () => { const wrapper = getWrapper() @@ -123,7 +123,7 @@ describe('PublicLink', () => { }) it('should call "resolvePublicLink" method on form submit', async () => { - const spyResolvePublicLink = jest.spyOn(PublicLink.methods, 'resolvePublicLink') + const spyResolvePublicLink = jest.spyOn(resolvePublicLink.methods, 'resolvePublicLink') const wrapper = getMountedWrapper({ loading: false }) await wrapper.setData({ passwordRequired: true, password: 'some-pass' }) diff --git a/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md b/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md index b79c38bad3c..1e42f1044c5 100644 --- a/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md +++ b/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md @@ -8,9 +8,6 @@ Level-3 headings should be used for the references to the relevant issues. Inclu Other free text and markdown formatting can be used elsewhere in the document if needed. But if you want to explain something about the issue, then please post that in the issue itself. -### [Preview from share-with-others page doesn't work in oc10](https://github.com/owncloud/web/issues/7049) -- [webUIPreview/mediaPreview.feature:143](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPreview/imageMediaViewer.feature#L143) - ### [user session of a blocked user is not cleared properly](https://github.com/owncloud/web/issues/4795) - [webUILogin/adminBlocksUser.feature:20](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUILogin/adminBlocksUser.feature#L20) diff --git a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md index 2ad1db7e321..5862a485fe5 100644 --- a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md +++ b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md @@ -44,8 +44,6 @@ Other free text and markdown formatting can be used elsewhere in the document if - [webUISharingInternalUsers/shareWithUsers.feature:276](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature#L276) - [webUISharingInternalUsers/shareWithUsers.feature:277](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature#L277) - [webUISharingInternalUsersShareWithPage/shareWithUsers.feature:140](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsersShareWithPage/shareWithUsers.feature#L140) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:187](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L196) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:200](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L209) - [webUISharingPermissionsUsers/sharePermissionsUsers.feature:214](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L223) - [webUIResharing2/reshareUsers.feature:41](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L41) - [webUIResharing2/reshareUsers.feature:69](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L69) @@ -129,7 +127,6 @@ Other free text and markdown formatting can be used elsewhere in the document if - [webUIPrivateLinks/accessingPrivateLinks.feature:17](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature#L17) - [webUIPrivateLinks/accessingPrivateLinks.feature:25](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature#L25) - [webUIPrivateLinks/accessingPrivateLinks.feature:35](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature#L35) -- [webUIPrivateLinks/accessingPrivateLinks.feature:45](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature#L45) ### [various sharing settings cannot be set](https://github.com/owncloud/ocis/issues/1328) - [webUIRestrictSharing/disableSharing.feature:16](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIRestrictSharing/disableSharing.feature#L16) diff --git a/tests/acceptance/features/webUIFilesList/fileList.feature b/tests/acceptance/features/webUIFilesList/fileList.feature index f77533e169e..e0d60ffa89c 100644 --- a/tests/acceptance/features/webUIFilesList/fileList.feature +++ b/tests/acceptance/features/webUIFilesList/fileList.feature @@ -12,11 +12,11 @@ Feature: User can view files inside a folder And user "Alice" has uploaded file "data.zip" to "data.zip" in the server And user "Alice" has logged in using the webUI - Scenario: Resources are listed + Scenario: Resources are listed and files list displays quicklink quick action When the user browses to the files page + Then quick action "quicklink" should be displayed on the webUI Then folder "simple-folder" should be listed on the webUI And file "textfile0.txt" should be listed on the webUI - And the top bar should match the default baseline @issue-1910 Scenario: Empty folders display no resources in the list @@ -25,11 +25,6 @@ Feature: User can view files inside a folder Then there should be no resources listed on the webUI - Scenario: All files list displays quicklink quick action - When the user browses to the files page - Then quick action "quicklink" should be displayed on the webUI - And the sidebar should match the default baseline - Scenario: files are not selected when the user logs in When the user browses to the files page Then these files should not be selected on the webUI diff --git a/tests/acceptance/features/webUILogin/oauthLogin.feature b/tests/acceptance/features/webUILogin/oauthLogin.feature index e592526bca5..fb493a1cf6d 100644 --- a/tests/acceptance/features/webUILogin/oauthLogin.feature +++ b/tests/acceptance/features/webUILogin/oauthLogin.feature @@ -43,7 +43,7 @@ Feature: login users And the user has browsed to the personal page And user "Alice" has been deleted in the server When the user reloads the current page of the webUI - Then the user should be redirected to the owncloud login page + Then the user should be redirected to the login error page Scenario: the user session of a deleted user should not be valid for newly created user of same name @@ -51,4 +51,4 @@ Feature: login users And user "Alice" has been deleted in the server And user "Alice" has been created with default attributes and without skeleton files in the server When the user reloads the current page of the webUI - Then the user should be redirected to the owncloud login page + Then the user should be redirected to the login error page diff --git a/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature b/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature index 9d83029ee00..a22b399c1fb 100644 --- a/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature +++ b/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature @@ -17,7 +17,7 @@ Feature: Access private link Scenario: Access private link before authorisation When an anonymous user tries to navigate to the private link created by user "Alice" for file "lorem.txt" Then the user should be redirected to the IdP login page - When user "Alice" has logged in using the webUI + When user "Alice" fills in the login form using the webUI Then the app-sidebar for file "lorem.txt" should be visible on the webUI And the "details" details panel should be visible @@ -40,8 +40,3 @@ Feature: Access private link """ An error occurred while resolving the private link """ - - - Scenario: Access the private link anonymously - When an anonymous user tries to navigate to the private link created by user "Alice" for file "lorem.txt" - Then the user should be redirected to the IdP login page diff --git a/tests/acceptance/features/webUISharingPermissionToRoot/sharePermissionsUsers.feature b/tests/acceptance/features/webUISharingPermissionToRoot/sharePermissionsUsers.feature index a1621610892..ad23766ac18 100644 --- a/tests/acceptance/features/webUISharingPermissionToRoot/sharePermissionsUsers.feature +++ b/tests/acceptance/features/webUISharingPermissionToRoot/sharePermissionsUsers.feature @@ -170,25 +170,25 @@ Feature: Sharing files and folders with internal users with different permission | permissions | delete, read, update | - Scenario: User is not allowed to reshare sub-folder with more permissions - Given user "Carol" has been created with default attributes and without skeleton files in the server - And user "Brian" has shared folder "simple-folder" with user "Alice" with "read, share, delete" permissions in the server - And user "Alice" has logged in using the webUI - When the user browses to the folder "simple-folder" on the files page - And the user shares folder "simple-empty-folder" with user "Carol King" as "Custom permissions" with permissions "share, delete, update" using the webUI - Then the error message with header "Error while sharing." should be displayed on the webUI - And as "Carol" folder "simple-empty-folder" should not exist in the server - Scenario: User is not allowed to update permissions of a reshared sub-folder to higher permissions than what user has received - Given user "Carol" has been created with default attributes and without skeleton files in the server - And user "Brian" has shared folder "simple-folder" with user "Alice" with "read, share, delete, update" permissions in the server - And user "Alice" has shared folder "simple-folder" with user "Carol" with "share, delete" permissions in the server - And user "Alice" has logged in using the webUI - When the user browses to the folder "simple-folder" on the files page - And the user shares folder "simple-empty-folder" with user "Carol King" as "Custom permissions" with permissions "share, delete, update, create" using the webUI - Then the error message with header "Error while sharing." should be displayed on the webUI - And as "Carol" folder "simple-empty-folder" should not exist in the server + + + + + + + + + + + + + + + + + Scenario: User is allowed to update permissions of a reshared sub-folder within the permissions that the user has received diff --git a/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature b/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature index 41ba92b0d95..4e4f4eece1e 100644 --- a/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature +++ b/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature @@ -183,32 +183,32 @@ Feature: Sharing files and folders with internal users with different permission | item_type | folder | | permissions | delete, read, update | - @issue-ocis-2260 - Scenario: User is not allowed to reshare sub-folder with more permissions - Given user "Carol" has been created with default attributes and without skeleton files in the server - And user "Brian" has shared folder "simple-folder" with user "Alice" with "read, share, delete" permissions in the server - And user "Alice" has accepted the share "Shares/simple-folder" offered by user "Brian" in the server - And user "Alice" has logged in using the webUI - When the user opens folder "Shares" using the webUI - And the user opens folder "simple-folder" using the webUI - And the user shares folder "simple-empty-folder" with user "Carol King" as "Custom permissions" with permissions "share, delete, update" using the webUI - Then the error message with header "Error while sharing." should be displayed on the webUI - And user "Carol" should not have received any shares in the server - And as "Carol" folder "/Shares/simple-empty-folder" should not exist in the server - @issue-ocis-2260 - Scenario: User is not allowed to update permissions of a reshared sub-folder to higher permissions than what user has received - Given user "Carol" has been created with default attributes and without skeleton files in the server - And user "Brian" has shared folder "simple-folder" with user "Alice" with "read, share, delete, update" permissions in the server - And user "Alice" has accepted the share "Shares/simple-folder" offered by user "Brian" in the server - And user "Alice" has shared folder "/Shares/simple-folder" with user "Carol" with "share, delete" permissions in the server - And user "Alice" has logged in using the webUI - When the user opens folder "Shares" using the webUI - And the user opens folder "simple-folder" using the webUI - And the user shares folder "simple-empty-folder" with user "Carol King" as "Custom permissions" with permissions "share, delete, update, create" using the webUI - Then the error message with header "Error while sharing." should be displayed on the webUI - And user "Carol" should not have received any shares in the server - And as "Carol" folder "/Shares/simple-empty-folder" should not exist in the server + + + + + + + + + + + + + + + + + + + + + + + + + @issue-ocis-2260 Scenario: User is allowed to update permissions of a reshared sub-folder within the permissions that the user has received diff --git a/tests/acceptance/helpers/loginHelper.js b/tests/acceptance/helpers/loginHelper.js index a292c777953..f5cd1ec397f 100644 --- a/tests/acceptance/helpers/loginHelper.js +++ b/tests/acceptance/helpers/loginHelper.js @@ -9,13 +9,24 @@ const userSettings = require('./userSettings') module.exports = { /** + * Navigates to the login page and fills&submits the login form. * * @param {userId} userId * @param {password} [password=null] - If not passed, default password for given `userId` will be used */ loginAsUser: async function (userId, password = null) { await client.page.loginPage().navigate() + await this.fillInAndSubmitLogin(userId, password) + }, + /** + * Fills in the login form, assuming that we are on the login page already. + * + * @param userId + * @param password + * @return {Promise} + */ + fillInAndSubmitLogin: async function (userId, password = null) { password = password || userSettings.getPasswordForUser(userId) if (client.globals.openid_login) { await client.page.ocisLoginPage().login(userId, password) diff --git a/tests/acceptance/nightwatch.conf.js b/tests/acceptance/nightwatch.conf.js index 8fecb26588f..59878f05655 100644 --- a/tests/acceptance/nightwatch.conf.js +++ b/tests/acceptance/nightwatch.conf.js @@ -31,22 +31,14 @@ const OPENID_LOGIN = RUN_ON_OCIS || process.env.OPENID_LOGIN === 'true' const WEB_UI_CONFIG = process.env.WEB_UI_CONFIG || path.join(__dirname, 'dist/config.json') const SCREENSHOTS = process.env.SCREENSHOTS === 'true' -const VISUAL_TEST = process.env.VISUAL_TEST === 'true' -const UPDATE_VRT_SCREENSHOTS = process.env.UPDATE_VRT_SCREENSHOTS === 'true' - const MIDDLEWARE_HOST = withHttp( process.env.MIDDLEWARE_HOST || (RUN_ON_OCIS ? 'http://host.docker.internal:3000' : 'http://host.docker.internal:3001') ) -function generateScreenshotFilePath(nightwatchClient, basePath, imagePath) { - return path.join(process.cwd(), basePath, imagePath) -} - const config = { page_objects_path: './pageObjects', - custom_commands_path: ['./customCommands', 'node_modules/nightwatch-vrt/commands'], - custom_assertions_path: ['node_modules/nightwatch-vrt/assertions'], + custom_commands_path: ['./customCommands'], test_settings: { default: { // ocis doesn't have '#' in the url path anymore @@ -70,19 +62,6 @@ const config = { testing_data_dir: TESTING_DATA_DIR, ldap_password: LDAP_ADMIN_PASSWORD, webUIConfig: WEB_UI_CONFIG, - visual_test: VISUAL_TEST, - visual_regression_settings: { - generate_screenshot_path: generateScreenshotFilePath, - latest_screenshots_path: 'tests/vrt/latest', - latest_suffix: '', - baseline_screenshots_path: 'tests/vrt/baseline', - baseline_suffix: '', - diff_screenshots_path: 'tests/vrt/diff', - diff_suffix: '', - threshold: 0.002, - prompt: false, - always_save_diff_screenshot: UPDATE_VRT_SCREENSHOTS - }, screenshots: SCREENSHOTS, middlewareUrl: MIDDLEWARE_HOST }, @@ -126,8 +105,4 @@ const config = { } } -if (VISUAL_TEST) { - process.env.SCREEN_RESOLUTION = '1280x1024' -} - module.exports = config diff --git a/tests/acceptance/package.json b/tests/acceptance/package.json index faf38e7f42a..3e99bba97d8 100644 --- a/tests/acceptance/package.json +++ b/tests/acceptance/package.json @@ -25,7 +25,6 @@ "lodash": "^4.17.21", "nightwatch": "1.7.11", "nightwatch-api": "3.0.1", - "nightwatch-vrt": "^0.2.10", "node-fetch": "^2.6.7", "tslib": "^2.2.0", "url-search-params-polyfill": "^8.0.0", diff --git a/tests/acceptance/pageObjects/FilesPageElement/previewPage.js b/tests/acceptance/pageObjects/FilesPageElement/previewPage.js index 5b903d45f45..eb44350c638 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/previewPage.js +++ b/tests/acceptance/pageObjects/FilesPageElement/previewPage.js @@ -47,8 +47,7 @@ module.exports = { .useCss() }, downloadMediaResource: function () { - const downloadButtonXpath = - this.elements.actionBar.selector + this.elements.downLoadButton.selector + const downloadButtonXpath = this.elements.downLoadButton.selector return this.useXpath() .waitForElementVisible(downloadButtonXpath) .click(downloadButtonXpath) @@ -56,7 +55,7 @@ module.exports = { .useCss() }, closeMediaResource: function () { - const closeButtonXpath = this.elements.actionBar.selector + this.elements.closeButton.selector + const closeButtonXpath = this.elements.closeButton.selector return this.useXpath() .waitForElementVisible(closeButtonXpath) .click(closeButtonXpath) @@ -78,15 +77,15 @@ module.exports = { locateStrategy: 'xpath' }, downLoadButton: { - selector: `//button[contains(@class, "preview-controls-download")]`, + selector: `//button[contains(@class, "preview-download")]`, locateStrategy: 'xpath' }, closeButton: { - selector: `//button[contains(@class, "preview-controls-close")]`, + selector: `//button[@id='app-top-bar-close']`, locateStrategy: 'xpath' }, mediaImage: { - selector: '//p[contains(@class, "preview-file-name") and contains(text(),"%s")]', + selector: `//div[@id='app-top-bar-resource']//span[@data-test-resource-name='%s']`, locateStrategy: 'xpath' } } diff --git a/tests/acceptance/pageObjects/publicLinkFilesPage.js b/tests/acceptance/pageObjects/publicLinkFilesPage.js index 7fc8ff62e43..dc88ff0dfce 100644 --- a/tests/acceptance/pageObjects/publicLinkFilesPage.js +++ b/tests/acceptance/pageObjects/publicLinkFilesPage.js @@ -2,8 +2,8 @@ const { join } = require('../helpers/path') const util = require('util') module.exports = { - url: function () { - return join(this.api.launchUrl, '/files/ops/resolver/public-link/') + url: function (token = '') { + return join(this.api.launchUrl, '/s', token) }, commands: { /** @@ -11,12 +11,12 @@ module.exports = { * @returns {*} */ navigateAndWaitTillLoaded: function (token) { - return this.navigate(join(this.url(), token)).waitForElementPresent( + return this.navigate(this.url(token)).waitForElementPresent( this.page.FilesPageElement.filesList().elements.anyAfterLoading ) }, navigateAndWaitForPasswordPage: function (token) { - this.navigate(join(this.api.launchUrl, '/files/ops/resolver/public-link', token)) + this.navigate(this.url(token)) return this.page.publicLinkPasswordPage().waitForElementPresent('@passwordInput') }, /** diff --git a/tests/acceptance/pageObjects/textEditorPage.js b/tests/acceptance/pageObjects/textEditorPage.js index fb7488d089b..b4da1b1bd7a 100644 --- a/tests/acceptance/pageObjects/textEditorPage.js +++ b/tests/acceptance/pageObjects/textEditorPage.js @@ -29,8 +29,16 @@ module.exports = { }) return content }, - getFileName: function () { - return this.getInnerText('@fileName') + getFileName: async function () { + let fileName = '' + await this.waitForElementVisible('@fileName').getAttribute( + '@fileName', + 'data-test-resource-name', + (result) => { + fileName = result.value + } + ) + return fileName }, getContentFromEditor: function () { return this.getInputValue('@editorTextarea') @@ -84,10 +92,10 @@ module.exports = { selector: '#text-editor-controls-save' }, closeButton: { - selector: '#text-editor-controls-close' + selector: '#app-top-bar-close' }, fileName: { - selector: '#text-editor-file-path' + selector: '.oc-resource-name' }, previewPanel: { selector: '#text-editor-preview' diff --git a/tests/acceptance/stepDefinitions/debugContext.js b/tests/acceptance/stepDefinitions/debugContext.js new file mode 100644 index 00000000000..45974137941 --- /dev/null +++ b/tests/acceptance/stepDefinitions/debugContext.js @@ -0,0 +1,5 @@ +const { When } = require('@cucumber/cucumber') + +When('pause for {int}', async function (duration) { + await new Promise((resolve) => setTimeout(resolve, duration)) +}) diff --git a/tests/acceptance/stepDefinitions/loginContext.js b/tests/acceptance/stepDefinitions/loginContext.js index 4c60f33b04d..7adb3b2d361 100644 --- a/tests/acceptance/stepDefinitions/loginContext.js +++ b/tests/acceptance/stepDefinitions/loginContext.js @@ -31,6 +31,10 @@ When( When('user {string} logs in using the webUI', (username) => loginHelper.loginAsUser(username)) +When('user {string} fills in the login form using the webUI', (username) => + loginHelper.fillInAndSubmitLogin(username) +) + Then('the files table should not be empty', () => { return ( client.page.FilesPageElement.filesList() diff --git a/tests/acceptance/stepDefinitions/visualContext.js b/tests/acceptance/stepDefinitions/visualContext.js deleted file mode 100644 index f340032c630..00000000000 --- a/tests/acceptance/stepDefinitions/visualContext.js +++ /dev/null @@ -1,42 +0,0 @@ -const { Then } = require('@cucumber/cucumber') -const { client } = require('nightwatch-api') -const _ = require('lodash') -const path = require('path') - -const backends = Object.freeze({ - OCIS: 'ocis', - OC10: 'oc10' -}) - -const visualElements = Object.freeze({ - topBar: '#oc-topbar', - sideBar: '#web-nav-sidebar' -}) - -const getImgPath = function (key) { - const backend = client.globals.ocis ? backends.OCIS : backends.OC10 - if (_.has(visualElements, key)) { - return path.join(backend, key) - } - throw new Error(`Cannot find the element ${key}`) -} - -const assertScreenShot = async function (key) { - if (!client.globals.visual_test) { - return - } - const imgPath = getImgPath(key) - const element = visualElements[key] - await client.assert.screenshotIdenticalToBaseline( - element, - imgPath, - 'Matched the top bar of files page' - ) -} - -Then('the top bar should match the default baseline', function () { - return assertScreenShot('topBar') -}) -Then('the sidebar should match the default baseline', function () { - return assertScreenShot('sideBar') -}) diff --git a/tests/acceptance/yarn.lock b/tests/acceptance/yarn.lock index a2c3d81ed3a..3ed92cbade5 100644 --- a/tests/acceptance/yarn.lock +++ b/tests/acceptance/yarn.lock @@ -1803,13 +1803,6 @@ __metadata: languageName: node linkType: hard -"bignumber.js@npm:^2.1.0": - version: 2.4.0 - resolution: "bignumber.js@npm:2.4.0" - checksum: 822c0318b8d077566f2ae1e3b3a78ebd0aa0a1f74a2dc4a5c0bab0fbcfc3e4af56489db814f64cdca973d4682468d99c251fe10dc81060225a1cfc19404a92c5 - languageName: node - linkType: hard - "bl@npm:^4.0.3": version: 4.1.0 resolution: "bl@npm:4.1.0" @@ -1828,13 +1821,6 @@ __metadata: languageName: node linkType: hard -"bmp-js@npm:0.0.3": - version: 0.0.3 - resolution: "bmp-js@npm:0.0.3" - checksum: 12ab4162800fcea58e0e5b83a2243c6980622f4a94dcd721872f6ba1964a21994e25f6fd463d4f83dd5ea89a4397568e9d24bd20e7145b24aadafd397f01d2b3 - languageName: node - linkType: hard - "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -1883,13 +1869,6 @@ __metadata: languageName: node linkType: hard -"buffer-equal@npm:0.0.1": - version: 0.0.1 - resolution: "buffer-equal@npm:0.0.1" - checksum: ca4b52e6c01143529d957a78cb9a93e4257f172bbab30d9eb87c20ae085ed23c5e07f236ac051202dacbf3d17aba42e1455f84cba21ea79b67d57f2b05e9a613 - languageName: node - linkType: hard - "buffer-from@npm:^1.0.0": version: 1.1.1 resolution: "buffer-from@npm:1.1.1" @@ -2401,13 +2380,6 @@ __metadata: languageName: node linkType: hard -"dom-walk@npm:^0.1.0": - version: 0.1.2 - resolution: "dom-walk@npm:0.1.2" - checksum: 19eb0ce9c6de39d5e231530685248545d9cd2bd97b2cb3486e0bfc0f2a393a9addddfd5557463a932b52fdfcf68ad2a619020cd2c74a5fe46fbecaa8e80872f3 - languageName: node - linkType: hard - "dotenv@npm:7.0.0": version: 7.0.0 resolution: "dotenv@npm:7.0.0" @@ -2558,13 +2530,6 @@ __metadata: languageName: node linkType: hard -"es6-promise@npm:^3.0.2": - version: 3.3.1 - resolution: "es6-promise@npm:3.3.1" - checksum: ce4044009c2b78db18b15212338eb711cd8a4d485961bc9ec18bb24e8c1e91c96d3295b0fcf63066fc0fa1b0ade36da05e6657827d4336dece382be2429b8398 - languageName: node - linkType: hard - "es6-symbol@npm:^3.1.1, es6-symbol@npm:~3.1.3": version: 3.1.3 resolution: "es6-symbol@npm:3.1.3" @@ -2632,13 +2597,6 @@ __metadata: languageName: node linkType: hard -"exif-parser@npm:^0.1.9": - version: 0.1.12 - resolution: "exif-parser@npm:0.1.12" - checksum: 6ba50cb9e0b45a6efa37e966a9582ecd171b5c5b3ef0c47542f2b862c521f70d2f656dde85b4d2a5dd8e1163486b09049f4c412e9c6176bfbda1654a5b2f021c - languageName: node - linkType: hard - "exit-on-epipe@npm:~1.0.1": version: 1.0.1 resolution: "exit-on-epipe@npm:1.0.1" @@ -2755,13 +2713,6 @@ __metadata: languageName: node linkType: hard -"file-type@npm:^3.1.0": - version: 3.9.0 - resolution: "file-type@npm:3.9.0" - checksum: 1db70b2485ac77c4edb4b8753c1874ee6194123533f43c2651820f96b518f505fa570b093fedd6672eb105ba9fb89c62f84b6492e46788e39c3447aed37afa2d - languageName: node - linkType: hard - "file-uri-to-path@npm:2": version: 2.0.0 resolution: "file-uri-to-path@npm:2.0.0" @@ -2993,16 +2944,6 @@ __metadata: languageName: node linkType: hard -"global@npm:~4.4.0": - version: 4.4.0 - resolution: "global@npm:4.4.0" - dependencies: - min-document: ^2.19.0 - process: ^0.11.10 - checksum: 9c057557c8f5a5bcfbeb9378ba4fe2255d04679452be504608dd5f13b54edf79f7be1db1031ea06a4ec6edd3b9f5f17d2d172fb47e6c69dae57fd84b7e72b77f - languageName: node - linkType: hard - "globals@npm:^11.1.0": version: 11.12.0 resolution: "globals@npm:11.12.0" @@ -3193,13 +3134,6 @@ __metadata: languageName: node linkType: hard -"ip-regex@npm:^1.0.1": - version: 1.0.3 - resolution: "ip-regex@npm:1.0.3" - checksum: 9ce02e567949be9cf4d16c5c314cd241ce1edf78b2619e94b276cdff97eefe198970a224f9d1f0c22a92c4655997ad68fd34d82e41e7d19fafa47fe15108f22a - languageName: node - linkType: hard - "ip-regex@npm:^4.1.0": version: 4.3.0 resolution: "ip-regex@npm:4.3.0" @@ -3281,13 +3215,6 @@ __metadata: languageName: node linkType: hard -"is-function@npm:^1.0.1": - version: 1.0.2 - resolution: "is-function@npm:1.0.2" - checksum: 7d564562e07b4b51359547d3ccc10fb93bb392fd1b8177ae2601ee4982a0ece86d952323fc172a9000743a3971f09689495ab78a1d49a9b14fc97a7e28521dc0 - languageName: node - linkType: hard - "is-generator@npm:^1.0.3": version: 1.0.3 resolution: "is-generator@npm:1.0.3" @@ -3462,30 +3389,6 @@ __metadata: languageName: node linkType: hard -"jimp@npm:^0.2.28": - version: 0.2.28 - resolution: "jimp@npm:0.2.28" - dependencies: - bignumber.js: ^2.1.0 - bmp-js: 0.0.3 - es6-promise: ^3.0.2 - exif-parser: ^0.1.9 - file-type: ^3.1.0 - jpeg-js: ^0.2.0 - load-bmfont: ^1.2.3 - mime: ^1.3.4 - mkdirp: 0.5.1 - pixelmatch: ^4.0.0 - pngjs: ^3.0.0 - read-chunk: ^1.0.1 - request: ^2.65.0 - stream-to-buffer: ^0.1.0 - tinycolor2: ^1.1.2 - url-regex: ^3.0.0 - checksum: 58c27dff88b24e2cb93452c4bd277eaf01adc3529b19230ba77a124cadfe933c0797458fa722849e0615d5d28b358791145d74d3566879f2431fd5d0eba13931 - languageName: node - linkType: hard - "join-path@npm:^1.1.1": version: 1.1.1 resolution: "join-path@npm:1.1.1" @@ -3497,13 +3400,6 @@ __metadata: languageName: node linkType: hard -"jpeg-js@npm:^0.2.0": - version: 0.2.0 - resolution: "jpeg-js@npm:0.2.0" - checksum: 2a57b19e252a86b583e9b1e917ddb1c3617170493fee6dfd01bf8ff5e0e43123cb988c0066681f7ea19c093cf1b61d19c47c88258d03395f16946e35856135bc - languageName: node - linkType: hard - "js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -3677,22 +3573,6 @@ __metadata: languageName: node linkType: hard -"load-bmfont@npm:^1.2.3": - version: 1.4.1 - resolution: "load-bmfont@npm:1.4.1" - dependencies: - buffer-equal: 0.0.1 - mime: ^1.3.4 - parse-bmfont-ascii: ^1.0.3 - parse-bmfont-binary: ^1.0.5 - parse-bmfont-xml: ^1.1.4 - phin: ^2.9.1 - xhr: ^2.0.1 - xtend: ^4.0.0 - checksum: 688d932fb0dc4c9333747736ccd926261f0b91734b7bdb6ff24f8659ef068a0f0b2278084b208851afac0beec79af7bd6664fe2ed5b6c5e1db88755fc25f785e - languageName: node - linkType: hard - "locate-path@npm:^3.0.0": version: 3.0.0 resolution: "locate-path@npm:3.0.0" @@ -3868,7 +3748,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.21, lodash@npm:^4.17.4": +"lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.21": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 @@ -3954,15 +3834,6 @@ __metadata: languageName: node linkType: hard -"mime@npm:^1.3.4": - version: 1.6.0 - resolution: "mime@npm:1.6.0" - bin: - mime: cli.js - checksum: fef25e39263e6d207580bdc629f8872a3f9772c923c7f8c7e793175cee22777bbe8bba95e5d509a40aaa292d8974514ce634ae35769faa45f22d17edda5e8557 - languageName: node - linkType: hard - "mimic-fn@npm:^2.1.0": version: 2.1.0 resolution: "mimic-fn@npm:2.1.0" @@ -3970,15 +3841,6 @@ __metadata: languageName: node linkType: hard -"min-document@npm:^2.19.0": - version: 2.19.0 - resolution: "min-document@npm:2.19.0" - dependencies: - dom-walk: ^0.1.0 - checksum: da6437562ea2228041542a2384528e74e22d1daa1a4ec439c165abf0b9d8a63e17e3b8a6dc6e0c731845e85301198730426932a0e813d23f932ca668340c9623 - languageName: node - linkType: hard - "minimatch@npm:3.0.4, minimatch@npm:^3.0.4": version: 3.0.4 resolution: "minimatch@npm:3.0.4" @@ -3988,13 +3850,6 @@ __metadata: languageName: node linkType: hard -"minimist@npm:0.0.8": - version: 0.0.8 - resolution: "minimist@npm:0.0.8" - checksum: 042f8b626b1fa44dffc23bac55771425ac4ee9d267b56f9064c07713e516e1799f3ba933bb628d2475a210caf7dcdb98161611baa1f0daf49309a944cb4bc48f - languageName: node - linkType: hard - "minimist@npm:^1.2.5": version: 1.2.5 resolution: "minimist@npm:1.2.5" @@ -4002,17 +3857,6 @@ __metadata: languageName: node linkType: hard -"mkdirp@npm:0.5.1": - version: 0.5.1 - resolution: "mkdirp@npm:0.5.1" - dependencies: - minimist: 0.0.8 - bin: - mkdirp: bin/cmd.js - checksum: ed1ab49bb1d06c88dba7cfe930a3186f2605b5465aab7c8f24119baaba6e38f9ab4ac1695c68f476c65a48df2a69a8495049cd6e26c360ea082151a0771343d2 - languageName: node - linkType: hard - "mkdirp@npm:0.5.4": version: 0.5.4 resolution: "mkdirp@npm:0.5.4" @@ -4130,16 +3974,6 @@ __metadata: languageName: node linkType: hard -"nightwatch-vrt@npm:^0.2.10": - version: 0.2.10 - resolution: "nightwatch-vrt@npm:0.2.10" - dependencies: - jimp: ^0.2.28 - lodash: ^4.17.4 - checksum: e1a3baf37a9192b0e0b29eed3dac7aab6e17005365a2ee3d7c0dc6d7e181b25dcaec8bd9965ea157d0d9c7265e6d5238c0aec23a205fef75d79f527ae55539e4 - languageName: node - linkType: hard - "nightwatch@npm:1.7.11": version: 1.7.11 resolution: "nightwatch@npm:1.7.11" @@ -4415,37 +4249,6 @@ __metadata: languageName: node linkType: hard -"parse-bmfont-ascii@npm:^1.0.3": - version: 1.0.6 - resolution: "parse-bmfont-ascii@npm:1.0.6" - checksum: de3f6671f183c3e9d64bb4812b0407693b5fd0d24e9d16b2e106bb9eef809d64a6cc061f39ca29bb10c5c2e47e241e91b7aeefa587391fff7ccb27ab9db5012e - languageName: node - linkType: hard - -"parse-bmfont-binary@npm:^1.0.5": - version: 1.0.6 - resolution: "parse-bmfont-binary@npm:1.0.6" - checksum: ca37fb1e92f5941fddc5342b45857fafd27f00d2bd5fa44dd504bec6faeab97536c95ad45260c2dd5fc4c63de71e525663d3cdac09d038cbca803d97c669add5 - languageName: node - linkType: hard - -"parse-bmfont-xml@npm:^1.1.4": - version: 1.1.4 - resolution: "parse-bmfont-xml@npm:1.1.4" - dependencies: - xml-parse-from-string: ^1.0.0 - xml2js: ^0.4.5 - checksum: 879e5435be44f22b8c4934e2e1d2754a6d90a9ddb16309360daff965e1428d877b673f3d1fafaab4fef437c912a0db9f85545e0dd375ec62df7d4d328450d257 - languageName: node - linkType: hard - -"parse-headers@npm:^2.0.0": - version: 2.0.3 - resolution: "parse-headers@npm:2.0.3" - checksum: 32658e1c923cde921fbb170ad3ef9700bfd56bcb6b649df03380b1d8ef60ab05d9f066dcfa7b13c732f2a1ce272f1e637dfd453345fb3041e86a2a9250326096 - languageName: node - linkType: hard - "path-exists@npm:^3.0.0": version: 3.0.0 resolution: "path-exists@npm:3.0.0" @@ -4488,13 +4291,6 @@ __metadata: languageName: node linkType: hard -"phin@npm:^2.9.1": - version: 2.9.3 - resolution: "phin@npm:2.9.3" - checksum: 7e2abd7be74a54eb7be92dccb1d7a019725c8adaa79ac22a38f25220f9a859393e654ea753a559d326aed7bbc966fadac88270cc8c39d78896f7784219560c47 - languageName: node - linkType: hard - "picomatch@npm:^2.2.1, picomatch@npm:^2.2.3": version: 2.3.0 resolution: "picomatch@npm:2.3.0" @@ -4518,17 +4314,6 @@ __metadata: languageName: node linkType: hard -"pixelmatch@npm:^4.0.0": - version: 4.0.2 - resolution: "pixelmatch@npm:4.0.2" - dependencies: - pngjs: ^3.0.0 - bin: - pixelmatch: bin/pixelmatch - checksum: 9c5c1329001938cae6d01e2bb84a909ba767f8256bcafc075422cea2a4dbaa8bebd44fceaa4b4ce7cdc36d11f20d4f1ba0cf669851d5649b32d8d1d27e4f5a36 - languageName: node - linkType: hard - "pkg-dir@npm:^3.0.0": version: 3.0.0 resolution: "pkg-dir@npm:3.0.0" @@ -4538,13 +4323,6 @@ __metadata: languageName: node linkType: hard -"pngjs@npm:^3.0.0": - version: 3.4.0 - resolution: "pngjs@npm:3.4.0" - checksum: 8bd40bd698abd16b72c97b85cb858c80894fbedc76277ce72a784aa441e14795d45d9856e97333ca469b34b67528860ffc8a7317ca6beea349b645366df00bcd - languageName: node - linkType: hard - "precond@npm:0.2": version: 0.2.3 resolution: "precond@npm:0.2.3" @@ -4575,13 +4353,6 @@ __metadata: languageName: node linkType: hard -"process@npm:^0.11.10": - version: 0.11.10 - resolution: "process@npm:0.11.10" - checksum: bfcce49814f7d172a6e6a14d5fa3ac92cc3d0c3b9feb1279774708a719e19acd673995226351a082a9ae99978254e320ccda4240ddc474ba31a76c79491ca7c3 - languageName: node - linkType: hard - "progress@npm:^2.0.3": version: 2.0.3 resolution: "progress@npm:2.0.3" @@ -4662,13 +4433,6 @@ __metadata: languageName: node linkType: hard -"read-chunk@npm:^1.0.1": - version: 1.0.1 - resolution: "read-chunk@npm:1.0.1" - checksum: 9240d6a7dbef26d611f5e816dde890bbda99a4547c3edc2be60f8beab757023dfaaa6486004a20bc6d3f5fce90ff31da64eff131554e4250fc5182ed1e6b2a80 - languageName: node - linkType: hard - "readable-stream@npm:1.1.x": version: 1.1.14 resolution: "readable-stream@npm:1.1.14" @@ -4819,7 +4583,7 @@ __metadata: languageName: node linkType: hard -"request@npm:^2.65.0, request@npm:^2.88.2": +"request@npm:^2.88.2": version: 2.88.2 resolution: "request@npm:2.88.2" dependencies: @@ -4955,7 +4719,7 @@ __metadata: languageName: node linkType: hard -"sax@npm:>=0.6.0, sax@npm:^1.2.4": +"sax@npm:^1.2.4": version: 1.2.4 resolution: "sax@npm:1.2.4" checksum: d3df7d32b897a2c2f28e941f732c71ba90e27c24f62ee918bd4d9a8cfb3553f2f81e5493c7f0be94a11c1911b643a9108f231dd6f60df3fa9586b5d2e3e9e1fe @@ -5178,22 +4942,6 @@ __metadata: languageName: node linkType: hard -"stream-to-buffer@npm:^0.1.0": - version: 0.1.0 - resolution: "stream-to-buffer@npm:0.1.0" - dependencies: - stream-to: ~0.2.0 - checksum: 9adf4eadf245ac4bd2ce1b4cd879170714221d185798637b1b5e4f53aef304d5dccbbd180380932d6f3618f7e1972a0529732618ae5c8e33beb0ca51d6907aec - languageName: node - linkType: hard - -"stream-to@npm:~0.2.0": - version: 0.2.2 - resolution: "stream-to@npm:0.2.2" - checksum: 06a3f163cfc609a7dc6952f0d953e67f5dabf68c75a7349cc0656ed4e211806e58c69ba1270263ec33c288aaf1468386c3055d592e18b76bc0f13e322ab78068 - languageName: node - linkType: hard - "string-argv@npm:^0.3.1": version: 0.3.1 resolution: "string-argv@npm:0.3.1" @@ -5383,7 +5131,6 @@ __metadata: lodash: ^4.17.21 nightwatch: 1.7.11 nightwatch-api: 3.0.1 - nightwatch-vrt: ^0.2.10 node-fetch: ^2.6.7 tslib: ^2.2.0 url-search-params-polyfill: ^8.0.0 @@ -5409,13 +5156,6 @@ __metadata: languageName: node linkType: hard -"tinycolor2@npm:^1.1.2": - version: 1.4.2 - resolution: "tinycolor2@npm:1.4.2" - checksum: 57ed262e08815a4ab0ed933edafdbc6555a17081781766149813b44a080ecbe58b3ee281e81c0e75b42e4d41679f138cfa98eabf043f829e0683c04adb12c031 - languageName: node - linkType: hard - "tmp@npm:^0.2.1": version: 0.2.1 resolution: "tmp@npm:0.2.1" @@ -5614,15 +5354,6 @@ __metadata: languageName: node linkType: hard -"url-regex@npm:^3.0.0": - version: 3.2.0 - resolution: "url-regex@npm:3.2.0" - dependencies: - ip-regex: ^1.0.1 - checksum: 667c8b079491ea76360f54c707d3cbd486a9ec29d6723e47fcbf6b8515a8dcb347bf94c7b1bac8b5af5ce7a5eacb2211d2096aa82fd4f077e559fc70cab8abd0 - languageName: node - linkType: hard - "url-search-params-polyfill@npm:^8.0.0": version: 8.1.1 resolution: "url-search-params-polyfill@npm:8.1.1" @@ -5789,18 +5520,6 @@ __metadata: languageName: node linkType: hard -"xhr@npm:^2.0.1": - version: 2.6.0 - resolution: "xhr@npm:2.6.0" - dependencies: - global: ~4.4.0 - is-function: ^1.0.1 - parse-headers: ^2.0.0 - xtend: ^4.0.0 - checksum: a1db277e37737caf3ed363d2a33ce4b4ea5b5fc190b663a6f70bc252799185b840ccaa166eaeeea4841c9c60b87741f0a24e29cbcf6708dd425986d4df186d2f - languageName: node - linkType: hard - "xml-js@npm:^1.6.11": version: 1.6.11 resolution: "xml-js@npm:1.6.11" @@ -5812,30 +5531,6 @@ __metadata: languageName: node linkType: hard -"xml-parse-from-string@npm:^1.0.0": - version: 1.0.1 - resolution: "xml-parse-from-string@npm:1.0.1" - checksum: 5155cb98e428409829f4060ce542c55438b2f7646d11fd306d850eaf12d35c06ffd9e86d76aa5230121a533b958fd1a319d6f90a5c113391853d0ff01f4da7bb - languageName: node - linkType: hard - -"xml2js@npm:^0.4.5": - version: 0.4.23 - resolution: "xml2js@npm:0.4.23" - dependencies: - sax: ">=0.6.0" - xmlbuilder: ~11.0.0 - checksum: ca0cf2dfbf6deeaae878a891c8fbc0db6fd04398087084edf143cdc83d0509ad0fe199b890f62f39c4415cf60268a27a6aed0d343f0658f8779bd7add690fa98 - languageName: node - linkType: hard - -"xmlbuilder@npm:~11.0.0": - version: 11.0.1 - resolution: "xmlbuilder@npm:11.0.1" - checksum: 7152695e16f1a9976658215abab27e55d08b1b97bca901d58b048d2b6e106b5af31efccbdecf9b07af37c8377d8e7e821b494af10b3a68b0ff4ae60331b415b0 - languageName: node - linkType: hard - "xregexp@npm:2.0.0": version: 2.0.0 resolution: "xregexp@npm:2.0.0" @@ -5843,13 +5538,6 @@ __metadata: languageName: node linkType: hard -"xtend@npm:^4.0.0": - version: 4.0.2 - resolution: "xtend@npm:4.0.2" - checksum: ac5dfa738b21f6e7f0dd6e65e1b3155036d68104e67e5d5d1bde74892e327d7e5636a076f625599dc394330a731861e87343ff184b0047fef1360a7ec0a5a36a - languageName: node - linkType: hard - "y18n@npm:^4.0.0": version: 4.0.3 resolution: "y18n@npm:4.0.3" diff --git a/tests/drone/config-oc10-integration-app-oauth.json b/tests/drone/config-oc10-integration-app-oauth.json index aa564c213aa..dfea6071714 100644 --- a/tests/drone/config-oc10-integration-app-oauth.json +++ b/tests/drone/config-oc10-integration-app-oauth.json @@ -3,6 +3,7 @@ "theme": "http://owncloud/themes/owncloud/theme.json", "auth": { "clientId": "Cxfj9F9ZZWQbQZps1E1M0BszMz6OOFq3lxjSuc8Uh4HLEYb9KIfyRMmgY5ibXXrU", + "clientSecret": "930C6aA0U1VhM03IfNiheR2EwSzRi4hRSpcNqIhhbpeSGU6h38xssVfNcGP0sSwQ", "url": "http://owncloud/index.php/apps/oauth2/api/v1/token", "authUrl": "http://owncloud/index.php/apps/oauth2/authorize" }, diff --git a/tests/drone/config-oc10-oauth.json b/tests/drone/config-oc10-oauth.json index 32dde8aa7e9..fe076bb417c 100644 --- a/tests/drone/config-oc10-oauth.json +++ b/tests/drone/config-oc10-oauth.json @@ -3,6 +3,7 @@ "theme": "http://owncloud/themes/owncloud/theme.json", "auth": { "clientId": "Cxfj9F9ZZWQbQZps1E1M0BszMz6OOFq3lxjSuc8Uh4HLEYb9KIfyRMmgY5ibXXrU", + "clientSecret": "930C6aA0U1VhM03IfNiheR2EwSzRi4hRSpcNqIhhbpeSGU6h38xssVfNcGP0sSwQ", "url": "http://owncloud/index.php/apps/oauth2/api/v1/token", "authUrl": "http://owncloud/index.php/apps/oauth2/authorize" }, diff --git a/tests/e2e/cucumber/steps/app-files/resource.ts b/tests/e2e/cucumber/steps/app-files/resource.ts index 1e48b40ce0d..3d7c8b258e1 100644 --- a/tests/e2e/cucumber/steps/app-files/resource.ts +++ b/tests/e2e/cucumber/steps/app-files/resource.ts @@ -1,4 +1,5 @@ import { DataTable, When, Then } from '@cucumber/cucumber' +import path from 'path' import { World } from '../../environment' import { objects } from '../../../support' import { expect } from '@playwright/test' @@ -249,13 +250,14 @@ export const processDownload = async ( } else { expect(downloads.length).toBe(1) downloads.forEach((download) => { + const { name } = path.parse(download.suggestedFilename()) if (config.ocis) { - expect(download.suggestedFilename()).toBe('download.tar') + expect(name).toBe('download') } else { if (parentFolder) { - expect(download.suggestedFilename()).toBe(parentFolder + '.zip') + expect(name).toBe(parentFolder) } else { - expect(download.suggestedFilename()).toBe('download.zip') + expect(name).toBe('download') } } }) diff --git a/tests/e2e/support/api/graph/user.ts b/tests/e2e/support/api/graph/user.ts index be3bbb5d90e..500023588cf 100644 --- a/tests/e2e/support/api/graph/user.ts +++ b/tests/e2e/support/api/graph/user.ts @@ -26,6 +26,7 @@ export const createUser = async ({ user, admin }: { user: User; admin: User }): body, user: admin }) + checkResponseStatus(response, 'Failed while creating user') return user } diff --git a/tests/e2e/support/environment/actor/shared.ts b/tests/e2e/support/environment/actor/shared.ts index 67720f87083..2ecd519d4fb 100644 --- a/tests/e2e/support/environment/actor/shared.ts +++ b/tests/e2e/support/environment/actor/shared.ts @@ -20,7 +20,8 @@ export interface ActorOptions extends ActorsOptions { export const buildBrowserContextOptions = (options: ActorOptions): BrowserContextOptions => { const contextOptions: BrowserContextOptions = { acceptDownloads: options.context.acceptDownloads, - ignoreHTTPSErrors: true + ignoreHTTPSErrors: true, + locale: 'en-US' } if (options.context.reportVideo) { diff --git a/tests/e2e/support/objects/app-files/page/public.ts b/tests/e2e/support/objects/app-files/page/public.ts index adbf8038168..707e9ab91e3 100644 --- a/tests/e2e/support/objects/app-files/page/public.ts +++ b/tests/e2e/support/objects/app-files/page/public.ts @@ -34,6 +34,7 @@ export class Public { async authenticate({ password }: { password: string }): Promise { await this.#page.locator(passwordInput).fill(password) await this.#page.locator(publicLinkAuthorizeButton).click() + await this.#page.waitForSelector('#web-content') } async dropUpload({ resources }: { resources: File[] }): Promise { diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index b688e52ad49..90e0a6cbbab 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -48,6 +48,10 @@ export const clickResource = async ({ (resp) => resp.url().endsWith(encodeURIComponent(name)) || resp.url().endsWith(itemId) ) ]) + + // toDo: remove me + // @jannik: please have a look here what we can wait for to be sure that it's there + await new Promise((resolve) => setTimeout(resolve, 250)) } } diff --git a/tests/vrt/baseline/oc10/sideBar.png b/tests/vrt/baseline/oc10/sideBar.png deleted file mode 100644 index 0f87c89bc11..00000000000 Binary files a/tests/vrt/baseline/oc10/sideBar.png and /dev/null differ diff --git a/tests/vrt/baseline/oc10/topBar.png b/tests/vrt/baseline/oc10/topBar.png deleted file mode 100644 index e0255374909..00000000000 Binary files a/tests/vrt/baseline/oc10/topBar.png and /dev/null differ diff --git a/tests/vrt/baseline/ocis/sideBar.png b/tests/vrt/baseline/ocis/sideBar.png deleted file mode 100644 index 346d5c855c9..00000000000 Binary files a/tests/vrt/baseline/ocis/sideBar.png and /dev/null differ diff --git a/tests/vrt/baseline/ocis/topBar.png b/tests/vrt/baseline/ocis/topBar.png deleted file mode 100644 index 88e2c7b5f53..00000000000 Binary files a/tests/vrt/baseline/ocis/topBar.png and /dev/null differ diff --git a/yarn.lock b/yarn.lock index 5d80d3d9655..43bb6f8914f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3086,7 +3086,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^7.1.1, acorn@npm:^7.4.0, acorn@npm:^7.4.1": +"acorn@npm:^7.1.1, acorn@npm:^7.4.0": version: 7.4.1 resolution: "acorn@npm:7.4.1" bin: @@ -3775,7 +3775,7 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.3.1, base64-js@npm:^1.5.1": +"base64-js@npm:^1.3.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 @@ -4603,7 +4603,7 @@ __metadata: languageName: node linkType: hard -"core-js@npm:^3.15.2, core-js@npm:^3.19.1, core-js@npm:^3.8.3": +"core-js@npm:^3.15.2, core-js@npm:^3.19.1": version: 3.19.1 resolution: "core-js@npm:3.19.1" checksum: 2f669061788dc6fea823f0433d871deeaaaacc7d68ef2748859509522a34df5c83e648c3c6a1993fed0ab188081b3cf32b957b2a1f46156a2b20bd775961ade4 @@ -4685,7 +4685,7 @@ __metadata: languageName: node linkType: hard -"crypto-js@npm:^4.0.0": +"crypto-js@npm:^4.1.1": version: 4.1.1 resolution: "crypto-js@npm:4.1.1" checksum: b3747c12ee3a7632fab3b3e171ea50f78b182545f0714f6d3e7e2858385f0f4101a15f2517e033802ce9d12ba50a391575ff4638c9de3dd9b2c4bc47768d5425 @@ -6403,7 +6403,7 @@ __metadata: languageName: node linkType: hard -"flatted@npm:^3.0.5, flatted@npm:^3.1.0": +"flatted@npm:^3.1.0": version: 3.2.2 resolution: "flatted@npm:3.2.2" checksum: 9d5e03fd9309b9103f345cf6d0cef4fa46201baa053b0ca3d57fa489449b0bee687b7355407898f630afbb1a1286d2a6658e7e77dea3b85c3cd6c6ce2894a5c3 @@ -8450,6 +8450,13 @@ __metadata: languageName: node linkType: hard +"jwt-decode@npm:^3.1.2": + version: 3.1.2 + resolution: "jwt-decode@npm:3.1.2" + checksum: 20a4b072d44ce3479f42d0d2c8d3dabeb353081ba4982e40b83a779f2459a70be26441be6c160bfc8c3c6eadf9f6380a036fbb06ac5406b5674e35d8c4205eeb + languageName: node + linkType: hard + "kind-of@npm:^3.0.2": version: 3.2.2 resolution: "kind-of@npm:3.2.2" @@ -9594,16 +9601,13 @@ __metadata: languageName: node linkType: hard -"oidc-client@npm:1.11.5": - version: 1.11.5 - resolution: "oidc-client@npm:1.11.5" +"oidc-client-ts@npm:^2.0.5": + version: 2.0.5 + resolution: "oidc-client-ts@npm:2.0.5" dependencies: - acorn: ^7.4.1 - base64-js: ^1.5.1 - core-js: ^3.8.3 - crypto-js: ^4.0.0 - serialize-javascript: ^4.0.0 - checksum: 3d0a84667de96936d7bab1a57c80389e333f2883c4f20e9d6366bdbacde7e4d56bda3625b5df8bd44420df093d4cebe591e6dba3ef6d214bc70c5f86ef41452c + crypto-js: ^4.1.1 + jwt-decode: ^3.1.2 + checksum: 8db72d4f534d3081ebed9b8fb3d53ea00efe8e7030187791e1a9b8e71ed35245b28a239c8369ed173282914e6f4e80ebf3059ed6e913804bbc924df9d77cbb98 languageName: node linkType: hard @@ -13678,18 +13682,6 @@ __metadata: languageName: node linkType: hard -"vuex-persist@npm:3.1.3": - version: 3.1.3 - resolution: "vuex-persist@npm:3.1.3" - dependencies: - deepmerge: ^4.2.2 - flatted: ^3.0.5 - peerDependencies: - vuex: ">=2.5" - checksum: 7cd8348c114da5e7ad1ff4a310782e9c7838b5937e033fe613b3f32c3afad61a9af2109caa8e5722731e64b7e5b9dff65cd0c5297289e3800e729236eb170fdd - languageName: node - linkType: hard - "vuex-router-sync@npm:^5.0.0": version: 5.0.0 resolution: "vuex-router-sync@npm:5.0.0" @@ -13780,7 +13772,7 @@ __metadata: lodash-es: ^4.17.21 luxon: ^2.4.0 marked: ^4.0.12 - oidc-client: 1.11.5 + oidc-client-ts: ^2.0.5 owncloud-design-system: 14.0.0-alpha.4 owncloud-sdk: ~3.0.0-alpha.14 p-queue: ^6.6.2 @@ -13809,7 +13801,6 @@ __metadata: vue-select: ^3.18.3 vuex: ^3.6.2 vuex-extensions: ^1.1.5 - vuex-persist: 3.1.3 vuex-router-sync: ^5.0.0 web-pkg: "*" webdav: 4.9.0