mirror of https://github.com/aminya/setup-cpp
5991 lines
1.6 MiB
JavaScript
5991 lines
1.6 MiB
JavaScript
|
var $k14yv$path=require("path"),$k14yv$os=require("os"),$k14yv$fs=require("fs"),$k14yv$util=require("util"),$k14yv$assert=require("assert"),$k14yv$crypto=require("crypto"),$k14yv$url=require("url"),$k14yv$buffer=require("buffer"),$k14yv$stream=require("stream"),$k14yv$events=require("events"),$k14yv$timers=require("timers"),$k14yv$string_decoder=require("string_decoder"),$k14yv$http=require("http"),$k14yv$https=require("https"),$k14yv$zlib=require("zlib"),$k14yv$child_process=require("child_process");function $parcel$export(e,t,r,i){Object.defineProperty(e,t,{get:r,set:i,enumerable:!0,configurable:!0});}function $parcel$interopDefault(e){return e&&e.__esModule?e.default:e;}var $parcel$global="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},parcelRequire=$parcel$global.parcelRequire810d;parcelRequire.register("4kQHk",function(e,t){$parcel$export(e.exports,"setupActionsPython",()=>x);var r=parcelRequire("gxAVj"),i=parcelRequire("7h1SD"),a=parcelRequire("ER74K"),n=parcelRequire("lcRzN"),o=parcelRequire("ceI0e"),s=parcelRequire("dTX7a"),u=parcelRequire("8wFiF"),c=parcelRequire("4r449"),l=parcelRequire("dOmbL"),p=$k14yv$path.resolve(__dirname,"../../src/python");function d(e){return e.startsWith("pypy");}async function m(e,t){let r=void 0,i=(0,c.getCacheDistributor)(e,t,r);await i.restoreCache();}let h=!1;async function x(e,t,o){u.IS_MAC&&(process.env.AGENT_TOOLSDIRECTORY="/Users/runner/hostedtoolcache");let c=process.env.AGENT_TOOLSDIRECTORY?.trim();if("string"==typeof c&&""!==c&&(process.env.RUNNER_TOOL_CACHE=process.env.AGENT_TOOLSDIRECTORY),(0,n.debug)(`Python is expected to be installed into ${process.env.RUNNER_TOOL_CACHE}`),e){let t;if(d(e)){let r=await(0,i.findPyPyVersion)(e,o,!0,h,!1);t=`${r.resolvedPyPyVersion}-${r.resolvedPythonVersion}`,(0,a.info)(`Successfully set up PyPy ${r.resolvedPyPyVersion} with Python (${r.resolvedPythonVersion})`);}else{let i=await(0,r.useCpythonVersion)(e,o,!0,h,!1);t=i.version,(0,a.info)(`Successfully set up ${i.impl} (${t})`);}if((0,u.isCacheFeatureAvailable)()){let e="pip"// package manager used for caching
|
|||
|
;await m(e,t);}}s.GITHUB_ACTIONS&&(await f());}async function f(){let e=(0,o.join)(p,"python_matcher.json");if(!(await(0,l.pathExists)(e)))return(0,a.warning)("the python_matcher.json file does not exist in the same folder as setup-cpp.js");(0,a.info)(`::add-matcher::${e}`);}}),parcelRequire.register("gxAVj",function(e,t){$parcel$export(e.exports,"useCpythonVersion",()=>u);var r=parcelRequire("8wFiF"),i=parcelRequire("lJEXJ"),a=parcelRequire("8hcOb"),n=parcelRequire("lcRzN"),o=parcelRequire("4ai2V");// Python has "scripts" or "bin" directories where command-line tools that come with packages are installed.
|
|||
|
// This is where pip is, along with anything that pip installs.
|
|||
|
// There is a separate directory for `pip install --user`.
|
|||
|
//
|
|||
|
// For reference, these directories are as follows:
|
|||
|
// macOS / Linux:
|
|||
|
// <sys.prefix>/bin (by default /usr/local/bin, but not on hosted agents -- see the `else`)
|
|||
|
// (--user) ~/.local/bin
|
|||
|
// Windows:
|
|||
|
// <Python installation dir>\Scripts
|
|||
|
// (--user) %APPDATA%\Python\PythonXY\Scripts
|
|||
|
// See https://docs.python.org/3/library/sysconfig.html
|
|||
|
function s(e){return r.IS_WINDOWS?$k14yv$path.join(e,"Scripts"):$k14yv$path.join(e,"bin");}async function u(e,t,u,d,m){let h=null,x=c(e),f=p(x,m);if(n.debug(`Semantic version spec of ${e} is ${f}`),d){h=await a.getManifest();let e=(await a.findReleaseFromManifest(f,t,h))?.version;e?(f=e,n.info(`Resolved as '${f}'`)):n.info(`Failed to resolve version ${f} from manifest`);}let g=o.find("Python",f,t);if(!g){n.info(`Version ${f} was not found in the local cache`);let e=await a.findReleaseFromManifest(f,t,h);e&&e.files&&e.files.length>0&&(n.info(`Version ${f} is available for downloading`),await a.installCpythonFromRelease(e),g=o.find("Python",f,t));}if(!g){let i=await(0,r.getOSInfo)();throw Error([`The version '${e}' with architecture '${t}' was not found for ${i?`${i.osName} ${i.osVersion}`:"this operating system"}.`,`The list of all available versions can be found here: ${a.MANIFEST_URL}`].join($k14yv$os.EOL));}let D=s(g),y=r.IS_WINDOWS?".exe":"",b=$k14yv$path.join(r.IS_WINDOWS?g:D,`python${y}`);if(u){if(n.exportVariable("pythonLocation",g),n.exportVariable("PKG_CONFIG_PATH",g+"/lib/pkgconfig"),n.exportVariable("pythonLocation",g),// https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython
|
|||
|
n.exportVariable("Python_ROOT_DIR",g),// https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2
|
|||
|
n.exportVariable("Python2_ROOT_DIR",g),// https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3
|
|||
|
n.exportVariable("Python3_ROOT_DIR",g),n.exportVariable("PKG_CONFIG_PATH",g+"/lib/pkgconfig"),r.IS_LINUX){let e=process.env.LD_LIBRARY_PATH?`:${process.env.LD_LIBRARY_PATH}`:"",t=$k14yv$path.join(g,"lib");e.split(":").includes(t)||n.exportVariable("LD_LIBRARY_PATH",t+e);}if(n.addPath(g),n.addPath(D),r.IS_WINDOWS){// Add --user directory
|
|||
|
// `installDir` from tool cache should look like $RUNNER_TOOL_CACHE/Python/<semantic version>/x64/
|
|||
|
// So if `findLocalTool` succeeded above, we must have a conformant `installDir`
|
|||
|
let e=$k14yv$path.basename($k14yv$path.dirname(g)),t=i.major(e),r=i.minor(e),a=$k14yv$path.join(process.env.APPDATA||"","Python",`Python${t}${r}`,"Scripts");n.addPath(a);}// On Linux and macOS, pip will create the --user directory and add it to PATH as needed.
|
|||
|
}let v=l(g);return n.setOutput("python-version",v),n.setOutput("python-path",b),{impl:"CPython",version:v};}/** Convert versions like `3.8-dev` to a version like `~3.8.0-0`. */function c(e){let t=/^(\d+)\.(\d+)-dev$/;return e.replace(t,"~$1.$2.0-0");}/** Extracts python version from install path from hosted tool cache as described in README.md */function l(e){let t=e.split($k14yv$path.sep),r=t.findIndex(e=>"PyPy"===e||"Python"===e);return t[r+1]||"";}function p(e,t){let r=/(\d+\.\d+\.\d+)((?:a|b|rc)\d*)/g,i=/^(\d+)\.(\d+)$/,a=e.replace(r,"$1-$2");return t&&(a=a.replace(i,"~$1.$2.0-0")),a;}}),parcelRequire.register("8wFiF",function(e,t){$parcel$export(e.exports,"IS_WINDOWS",()=>o),$parcel$export(e.exports,"IS_LINUX",()=>s),$parcel$export(e.exports,"IS_MAC",()=>u),$parcel$export(e.exports,"WINDOWS_ARCHS",()=>c),$parcel$export(e.exports,"WINDOWS_PLATFORMS",()=>l),$parcel$export(e.exports,"createSymlinkInFolder",()=>d),$parcel$export(e.exports,"validateVersion",()=>m),$parcel$export(e.exports,"isNightlyKeyword",()=>h),$parcel$export(e.exports,"getPyPyVersionFromPath",()=>x),$parcel$export(e.exports,"readExactPyPyVersionFile",()=>f),$parcel$export(e.exports,"writeExactPyPyVersionFile",()=>g),$parcel$export(e.exports,"validatePythonVersionFormatForPyPy",()=>D),$parcel$export(e.exports,"isCacheFeatureAvailable",()=>b),$parcel$export(e.exports,"logWarning",()=>v),$parcel$export(e.exports,"getLinuxInfo",()=>A),$parcel$export(e.exports,"getOSInfo",()=>S);/* eslint no-unsafe-finally: "off" */var r=parcelRequire("lSxMY"),i=parcelRequire("lcRzN"),a=parcelRequire("lJEXJ");parcelRequire("55W4k");var n=parcelRequire("jlr6Q");let o="win32"===process.platform,s="linux"===process.platform,u="darwin"===process.platform,c=["x86","x64"],l=["win32","win64"],p="PYPY_VERSION";function d(e,t,r,i=!1){let a=$k14yv$path.join(e,t),n=$k14yv$path.join(e,r);$parcel$interopDefault($k14yv$fs).existsSync(n)||($parcel$interopDefault($k14yv$fs).symlinkSync(a,n),!o&&i&&$parcel$interopDefault($k14yv$fs).chmodSync(n,"755"));}function m(e){return h(e)||!!a.validRange(e);}function h(e){return"nightly"===e;}function x(e){return $k14yv$path.basename($k14yv$path.dirname(e));}function f(e){let t="",r=$k14yv$path.join(e,p);return $parcel$interopDefault($k14yv$fs).existsSync(r)&&(t=$parcel$interopDefault($k14yv$fs).readFileSync(r).toString().trim()),t;}function g(e,t){let r=$k14yv$path.join(e,p);$parcel$interopDefault($k14yv$fs).writeFileSync(r,t);}function D(e){let t=/^\d+\.\d+$/;return t.test(e);}function y(){let e=new URL(process.env.GITHUB_SERVER_URL||"https://github.com");return"GITHUB.COM"!==e.hostname.toUpperCase();}function b(){return!!r.isFeatureAvailable()||(y()?i.warning("Caching is only supported on GHES version >= 3.5. If you are on a version >= 3.5, please check with your GHES admin if the Actions cache service is enabled or not."):i.warning("The runner was not able to contact the cache service. Caching will be skipped"),!1);}function v(e){let t="[warning]";i.info(`${t}${e}`);}async function C(){let{stdout:e}=await n.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"',void 0,{silent:!0}),t=e.trim().split(" ")[3];return{osName:"Windows",osVersion:t};}async function E(){let{stdout:e}=await n.getExecOutput("sw_vers",["-productVersion"],{silent:!0}),t=e.trim();return{osName:"macOS",osVersion:t};}async function A(){let{stdout:e}=await n.getExecOutput("lsb_release",["-i","-r","-s"],{silent:!0}),[t,r]=e.trim().split("\n");return i.debug(`OS Name: ${t}, Version: ${r}`),{osName:t,osVersion:r};}async function S(){let e;try{o?e=await C():s?e=await A():u&&(e=await E());}catch(t){let e=t;i.debug(e.message);}finally{return e;}}}),parcelRequire.register("lSxMY",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r];}}),Object.defineProperty(e,i,a);}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setM
|
|||
|
* isFeatureAvailable to check the presence of Actions cache service
|
|||
|
*
|
|||
|
* @returns boolean return true if Actions cache service feature is available, otherwise false
|
|||
|
*/function x(){return!!process.env.ACTIONS_CACHE_URL;}/**
|
|||
|
* Restores cache from keys
|
|||
|
*
|
|||
|
* @param paths a list of file paths to restore from the cache
|
|||
|
* @param primaryKey an explicit key for restoring the cache
|
|||
|
* @param restoreKeys an optional ordered list of keys to use for restoring the cache if no cache hit occurred for key
|
|||
|
* @param downloadOptions cache download options
|
|||
|
* @param enableCrossOsArchive an optional boolean enabled to restore on windows any cache created on any platform
|
|||
|
* @returns string returns the key for the cache hit, otherwise returns undefined
|
|||
|
*/function f(e,t,r,i,a=!1){return n(this,void 0,void 0,function*(){m(e),r=r||[];let n=[t,...r];if(o.debug("Resolved Keys:"),o.debug(JSON.stringify(n)),n.length>10)throw new p("Key Validation Error: Keys are limited to a maximum of 10.");for(let e of n)h(e);let d=yield u.getCompressionMethod(),x="";try{// path are needed to compute version
|
|||
|
let t=yield c.getCacheEntry(n,e,{compressionMethod:d,enableCrossOsArchive:a});if(!(null==t?void 0:t.archiveLocation))return;if(null==i?void 0:i.lookupOnly)return o.info("Lookup only - skipping download"),t.cacheKey;x=s.join(yield u.createTempDirectory(),u.getCacheFileName(d)),o.debug(`Archive Path: ${x}`),// Download the cache from the cache entry
|
|||
|
yield c.downloadCache(t.archiveLocation,x,i),o.isDebug()&&(yield(0,l.listTar)(x,d));let r=u.getArchiveFileSizeInBytes(x);return o.info(`Cache Size: ~${Math.round(r/1048576)} MB (${r} B)`),yield(0,l.extractTar)(x,d),o.info("Cache restored successfully"),t.cacheKey;}catch(t){let e=t;if(e.name===p.name)throw t;o.warning(`Failed to restore: ${t.message}`);}finally{// Try to delete the archive to save space
|
|||
|
try{yield u.unlinkFile(x);}catch(e){o.debug(`Failed to delete archive: ${e}`);}}});}/**
|
|||
|
* Saves a list of files with the specified key
|
|||
|
*
|
|||
|
* @param paths a list of file paths to be cached
|
|||
|
* @param key an explicit key for restoring the cache
|
|||
|
* @param enableCrossOsArchive an optional boolean enabled to save cache on windows which could be restored on any platform
|
|||
|
* @param options cache upload options
|
|||
|
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
|||
|
*/function g(e,t,r,i=!1){var a,x,f,g,D;return n(this,void 0,void 0,function*(){m(e),h(t);let n=yield u.getCompressionMethod(),y=-1,b=yield u.resolvePaths(e);if(o.debug("Cache Paths:"),o.debug(`${JSON.stringify(b)}`),0===b.length)throw Error("Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.");let v=yield u.createTempDirectory(),C=s.join(v,u.getCacheFileName(n));o.debug(`Archive Path: ${C}`);try{yield(0,l.createTar)(v,b,n),o.isDebug()&&(yield(0,l.listTar)(C,n));let s=10737418240,p=u.getArchiveFileSizeInBytes(C);// 10GB per repo limit
|
|||
|
// For GHES, this check will take place in ReserveCache API with enterprise file size limit
|
|||
|
if(o.debug(`File Size: ${p}`),p>s&&!u.isGhes())throw Error(`Cache size of ~${Math.round(p/1048576)} MB (${p} B) is over the 10GB limit, not saving cache.`);o.debug("Reserving Cache");let m=yield c.reserveCache(t,e,{compressionMethod:n,enableCrossOsArchive:i,cacheSize:p});if(null===(a=null==m?void 0:m.result)||void 0===a?void 0:a.cacheId)y=null===(x=null==m?void 0:m.result)||void 0===x?void 0:x.cacheId;else if((null==m?void 0:m.statusCode)===400)throw Error(null!==(g=null===(f=null==m?void 0:m.error)||void 0===f?void 0:f.message)&&void 0!==g?g:`Cache size of ~${Math.round(p/1048576)} MB (${p} B) is over the data cap limit, not saving cache.`);else throw new d(`Unable to reserve cache with key ${t}, another job may be creating this cache. More details: ${null===(D=null==m?void 0:m.error)||void 0===D?void 0:D.message}`);o.debug(`Saving Cache (ID: ${y})`),yield c.saveCache(y,C,r);}catch(t){let e=t;if(e.name===p.name)throw t;e.name===d.name?o.info(`Failed to save: ${e.message}`):o.warning(`Failed to save: ${e.message}`);}finally{// Try to delete the archive to save space
|
|||
|
try{yield u.unlinkFile(C);}catch(e){o.debug(`Failed to delete archive: ${e}`);}}return y;});}e.exports.ReserveCacheError=d,e.exports.isFeatureAvailable=x,e.exports.restoreCache=f,e.exports.saveCache=g;}),parcelRequire.register("ju5qo",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r];}}),Object.defineProperty(e,i,a);}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r(function(t){t(e);});}return new(r||(r=Promise))(function(r,n){function o(e){try{u(i.next(e));}catch(e){n(e);}}function s(e){try{u(i.throw(e));}catch(e){n(e);}}function u(e){e.done?r(e.value):a(e.value).then(o,s);}u((i=i.apply(e,t||[])).next());});},o=e.exports&&e.exports.__asyncValues||function(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this;},t);function i(r){t[r]=e[r]&&function(t){return new Promise(function(i,n){a(i,n,(t=e[r](t)).done,t.value);});};}function a(e,t,r,i){Promise.resolve(i).then(function(t){e({value:t,done:r});},t);}};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.isGhes=e.exports.assertDefined=e.exports.getGnuTarPathOnWindows=e.exports.getCacheFileName=e.exports.getCompressionMethod=e.exports.unlinkFile=e.exports.resolvePaths=e.exports.getArchiveFileSizeInBytes=e.exports.createTempDirectory=void 0;let s=a(parcelRequire("lcRzN")),u=a(parcelRequire("jlr6Q")),c=a(parcelRequire("jgwdK")),l=a(parcelRequire("fcBgE")),p=a($k14yv$fs),d=a($k14yv$path),m=a(parcelRequire("lJEXJ")),h=a($k14yv$util);var x=parcelRequire("6c5Th"),f=parcelRequire("78Azy");// From https://github.com/actions/toolkit/blob/main/packages/tool-cache/src/tool-cache.ts#L23
|
|||
|
function g(){return n(this,void 0,void 0,function*(){let e="win32"===process.platform,t=process.env.RUNNER_TEMP||"";if(!t){let r;r=e?process.env.USERPROFILE||"C:\\":"darwin"===process.platform?"/Users":"/home",t=d.join(r,"actions","temp");}let r=d.join(t,(0,x.v4)());return yield l.mkdirP(r),r;});}function D(e){return p.statSync(e).size;}function y(e){var t,r,i,a,u;return n(this,void 0,void 0,function*(){let n=[],l=null!==(u=process.env.GITHUB_WORKSPACE)&&void 0!==u?u:process.cwd(),p=yield c.create(e.join("\n"),{implicitDescendants:!1});try{for(var m,h=!0,x=o(p.globGenerator());!(t=(m=yield x.next()).done);){a=m.value,h=!1;try{let e=a,t=d.relative(l,e).replace(RegExp(`\\${d.sep}`,"g"),"/");s.debug(`Matched: ${t}`),""===t?n.push("."):n.push(`${t}`);}finally{h=!0;}}}catch(e){r={error:e};}finally{try{!h&&!t&&(i=x.return)&&(yield i.call(x));}finally{if(r)throw r.error;}}return n;});}function b(e){return n(this,void 0,void 0,function*(){return h.promisify(p.unlink)(e);});}function v(e,t=[]){return n(this,void 0,void 0,function*(){let r="";t.push("--version"),s.debug(`Checking ${e} ${t.join(" ")}`);try{yield u.exec(`${e}`,t,{ignoreReturnCode:!0,silent:!0,listeners:{stdout:e=>r+=e.toString(),stderr:e=>r+=e.toString()}});}catch(e){s.debug(e.message);}return r=r.trim(),s.debug(r),r;});}// Use zstandard if possible to maximize cache performance
|
|||
|
function C(){return n(this,void 0,void 0,function*(){let e=yield v("zstd",["--quiet"]),t=m.clean(e);return(s.debug(`zstd version: ${t}`),""===e)?f.CompressionMethod.Gzip:f.CompressionMethod.ZstdWithoutLong;});}function E(e){return e===f.CompressionMethod.Gzip?f.CacheFilename.Gzip:f.CacheFilename.Zstd;}function A(){return n(this,void 0,void 0,function*(){if(p.existsSync(f.GnuTarPathOnWindows))return f.GnuTarPathOnWindows;let e=yield v("tar");return e.toLowerCase().includes("gnu tar")?l.which("tar"):"";});}function S(e,t){if(void 0===t)throw Error(`Expected ${e} but value was undefiend`);return t;}function B(){let e=new URL(process.env.GITHUB_SERVER_URL||"https://github.com");return"GITHUB.COM"!==e.hostname.toUpperCase();}e.exports.createTempDirectory=g,e.exports.getArchiveFileSizeInBytes=D,e.exports.resolvePaths=y,e.exports.unlinkFile=b,e.exports.getCompressionMethod=C,e.exports.getCacheFileName=E,e.exports.getGnuTarPathOnWindows=A,e.exports.assertDefined=S,e.exports.isGhes=B;}),parcelRequire.register("jgwdK",function(e,t){var r=e.exports&&e.exports.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r(function(t){t(e);});}return new(r||(r=Promise))(function(r,n){function o(e){try{u(i.next(e));}catch(e){n(e);}}function s(e){try{u(i.throw(e));}catch(e){n(e);}}function u(e){e.done?r(e.value):a(e.value).then(o,s);}u((i=i.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.create=void 0;var i=parcelRequire("jdb10");/**
|
|||
|
* Constructs a globber
|
|||
|
*
|
|||
|
* @param patterns Patterns separated by newlines
|
|||
|
* @param options Glob options
|
|||
|
*/function a(e,t){return r(this,void 0,void 0,function*(){return yield i.DefaultGlobber.create(e,t);});}e.exports.create=a;}),parcelRequire.register("jdb10",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r(function(t){t(e);});}return new(r||(r=Promise))(function(r,n){function o(e){try{u(i.next(e));}catch(e){n(e);}}function s(e){try{u(i.throw(e));}catch(e){n(e);}}function u(e){e.done?r(e.value):a(e.value).then(o,s);}u((i=i.apply(e,t||[])).next());});},o=e.exports&&e.exports.__asyncValues||function(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this;},t);function i(r){t[r]=e[r]&&function(t){return new Promise(function(i,n){a(i,n,(t=e[r](t)).done,t.value);});};}function a(e,t,r,i){Promise.resolve(i).then(function(t){e({value:t,done:r});},t);}},s=e.exports&&e.exports.__await||function(e){return this instanceof s?(this.v=e,this):new s(e);},u=e.exports&&e.exports.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,a=r.apply(e,t||[]),n=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this;},i;function o(e){a[e]&&(i[e]=function(t){return new Promise(function(r,i){n.push([e,t,r,i])>1||u(e,t);});});}function u(e,t){try{c(a[e](t));}catch(e){d(n[0][3],e);}}function c(e){e.value instanceof s?Promise.resolve(e.value.v).then(l,p):d(n[0][2],e);}function l(e){u("next",e);}function p(e){u("throw",e);}function d(e,t){e(t),n.shift(),n.length&&u(n[0][0],n[0][1]);}};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.DefaultGlobber=void 0;let c=a(parcelRequire("lcRzN")),l=a($k14yv$fs),p=a(parcelRequire("gcUtG")),d=a($k14yv$path),m=a(parcelRequire("jeE5j"));var h=parcelRequire("3MqmT"),x=parcelRequire("aY7Rr"),f=parcelRequire("ad8Hv");let g="win32"===process.platform;class D{constructor(e){this.patterns=[],this.searchPaths=[],this.options=p.getOptions(e);}getSearchPaths(){// Return a copy
|
|||
|
return this.searchPaths.slice();}glob(){var e,t;return n(this,void 0,void 0,function*(){let r=[];try{for(var i,a=o(this.globGenerator());!(i=yield a.next()).done;){let e=i.value;r.push(e);}}catch(t){e={error:t};}finally{try{i&&!i.done&&(t=a.return)&&(yield t.call(a));}finally{if(e)throw e.error;}}return r;});}globGenerator(){return u(this,arguments,function*(){// Fill in defaults options
|
|||
|
let e=p.getOptions(this.options),t=[];for(let r of this.patterns)t.push(r),e.implicitDescendants&&(r.trailingSeparator||"**"!==r.segments[r.segments.length-1])&&t.push(new x.Pattern(r.negate,!0,r.segments.concat("**")));// Push the search paths
|
|||
|
let r=[];for(let e of m.getSearchPaths(t)){c.debug(`Search path '${e}'`);// Exists?
|
|||
|
try{// Intentionally using lstat. Detection for broken symlink
|
|||
|
// will be performed later (if following symlinks).
|
|||
|
yield s(l.promises.lstat(e));}catch(e){if("ENOENT"===e.code)continue;throw e;}r.unshift(new f.SearchState(e,1));}// Search
|
|||
|
let i=[];// used to detect cycles
|
|||
|
for(;r.length;){// Pop
|
|||
|
let a=r.pop(),n=m.match(t,a.path),o=!!n||m.partialMatch(t,a.path);if(!n&&!o)continue;// Stat
|
|||
|
let u=yield s(D.stat(a,e,i));// Broken symlink, or symlink cycle detected, or no longer exists
|
|||
|
if(u){// Directory
|
|||
|
if(u.isDirectory()){// Matched
|
|||
|
if(n&h.MatchKind.Directory)yield yield s(a.path);else if(!o)continue;// Push the child items in reverse
|
|||
|
let e=a.level+1,t=(yield s(l.promises.readdir(a.path))).map(t=>new f.SearchState(d.join(a.path,t),e));r.push(...t.reverse());}else n&h.MatchKind.File&&(yield yield s(a.path));}}});}/**
|
|||
|
* Constructs a DefaultGlobber
|
|||
|
*/static create(e,t){return n(this,void 0,void 0,function*(){let r=new D(t);g&&(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n"));let i=e.split("\n").map(e=>e.trim());for(let e of i)!e||e.startsWith("#")||r.patterns.push(new x.Pattern(e));return r.searchPaths.push(...m.getSearchPaths(r.patterns)),r;});}static stat(e,t,r){return n(this,void 0,void 0,function*(){// Note:
|
|||
|
// `stat` returns info about the target of a symlink (or symlink chain)
|
|||
|
// `lstat` returns info about a symlink itself
|
|||
|
let i;if(t.followSymbolicLinks)try{// Use `stat` (following symlinks)
|
|||
|
i=yield l.promises.stat(e.path);}catch(r){if("ENOENT"===r.code){if(t.omitBrokenSymbolicLinks){c.debug(`Broken symlink '${e.path}'`);return;}throw Error(`No information found for the path '${e.path}'. This may indicate a broken symbolic link.`);}throw r;}else i=yield l.promises.lstat(e.path);// Note, isDirectory() returns false for the lstat of a symlink
|
|||
|
if(i.isDirectory()&&t.followSymbolicLinks){// Get the realpath
|
|||
|
let t=yield l.promises.realpath(e.path);// Fixup the traversal chain to match the item level
|
|||
|
for(;r.length>=e.level;)r.pop();// Test for a cycle
|
|||
|
if(r.some(e=>e===t)){c.debug(`Symlink cycle detected for path '${e.path}' and realpath '${t}'`);return;}// Update the traversal chain
|
|||
|
r.push(t);}return i;});}}e.exports.DefaultGlobber=D;}),parcelRequire.register("gcUtG",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.getOptions=void 0;let n=a(parcelRequire("lcRzN"));/**
|
|||
|
* Returns a copy with defaults filled in.
|
|||
|
*/function o(e){let t={followSymbolicLinks:!0,implicitDescendants:!0,omitBrokenSymbolicLinks:!0};return e&&("boolean"==typeof e.followSymbolicLinks&&(t.followSymbolicLinks=e.followSymbolicLinks,n.debug(`followSymbolicLinks '${t.followSymbolicLinks}'`)),"boolean"==typeof e.implicitDescendants&&(t.implicitDescendants=e.implicitDescendants,n.debug(`implicitDescendants '${t.implicitDescendants}'`)),"boolean"==typeof e.omitBrokenSymbolicLinks&&(t.omitBrokenSymbolicLinks=e.omitBrokenSymbolicLinks,n.debug(`omitBrokenSymbolicLinks '${t.omitBrokenSymbolicLinks}'`))),t;}e.exports.getOptions=o;}),parcelRequire.register("jeE5j",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.partialMatch=e.exports.match=e.exports.getSearchPaths=void 0;let n=a(parcelRequire("irDzZ"));var o=parcelRequire("3MqmT");let s="win32"===process.platform;/**
|
|||
|
* Given an array of patterns, returns an array of paths to search.
|
|||
|
* Duplicates and paths under other included paths are filtered out.
|
|||
|
*/function u(e){// Ignore negate patterns
|
|||
|
e=e.filter(e=>!e.negate);// Create a map of all search paths
|
|||
|
let t={};for(let r of e){let e=s?r.searchPath.toUpperCase():r.searchPath;t[e]="candidate";}let r=[];for(let i of e){// Check if already included
|
|||
|
let e=s?i.searchPath.toUpperCase():i.searchPath;if("included"===t[e])continue;// Check for an ancestor search path
|
|||
|
let a=!1,o=e,u=n.dirname(o);for(;u!==o;){if(t[u]){a=!0;break;}o=u,u=n.dirname(o);}a||(r.push(i.searchPath),t[e]="included");}return r;}/**
|
|||
|
* Matches the patterns against the path
|
|||
|
*/function c(e,t){let r=o.MatchKind.None;for(let i of e)i.negate?r&=~i.match(t):r|=i.match(t);return r;}/**
|
|||
|
* Checks whether to descend further into the directory
|
|||
|
*/function l(e,t){return e.some(e=>!e.negate&&e.partialMatch(t));}e.exports.getSearchPaths=u,e.exports.match=c,e.exports.partialMatch=l;}),parcelRequire.register("irDzZ",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e};};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.safeTrimTrailingSeparator=e.exports.normalizeSeparators=e.exports.hasRoot=e.exports.hasAbsoluteRoot=e.exports.ensureAbsoluteRoot=e.exports.dirname=void 0;let o=a($k14yv$path),s=n($k14yv$assert),u="win32"===process.platform;/**
|
|||
|
* Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.
|
|||
|
*
|
|||
|
* For example, on Linux/macOS:
|
|||
|
* - `/ => /`
|
|||
|
* - `/hello => /`
|
|||
|
*
|
|||
|
* For example, on Windows:
|
|||
|
* - `C:\ => C:\`
|
|||
|
* - `C:\hello => C:\`
|
|||
|
* - `C: => C:`
|
|||
|
* - `C:hello => C:`
|
|||
|
* - `\ => \`
|
|||
|
* - `\hello => \`
|
|||
|
* - `\\hello => \\hello`
|
|||
|
* - `\\hello\world => \\hello\world`
|
|||
|
*/function c(e){// Windows UNC root, e.g. \\hello or \\hello\world
|
|||
|
if(// Normalize slashes and trim unnecessary trailing slash
|
|||
|
e=h(e),u&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(e))return e;// Get dirname
|
|||
|
let t=o.dirname(e);return u&&/^\\\\[^\\]+\\[^\\]+\\$/.test(t)&&(t=h(t)),t;}/**
|
|||
|
* Roots the path if not already rooted. On Windows, relative roots like `\`
|
|||
|
* or `C:` are expanded based on the current working directory.
|
|||
|
*/function l(e,t){// Already rooted
|
|||
|
if(s.default(e,"ensureAbsoluteRoot parameter 'root' must not be empty"),s.default(t,"ensureAbsoluteRoot parameter 'itemPath' must not be empty"),p(t))return t;// Windows
|
|||
|
if(u){// Check for itemPath like C: or C:foo
|
|||
|
if(t.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let e=process.cwd();return(// Drive letter matches cwd? Expand to cwd
|
|||
|
(s.default(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),t[0].toUpperCase()!==e[0].toUpperCase())?`${t[0]}:\\${t.substr(2)}`:// Drive only, e.g. C:
|
|||
|
2===t.length?`${t[0]}:\\${e.substr(3)}`:(e.endsWith("\\")||(e+="\\"),`${t[0]}:\\${e.substr(3)}${t.substr(2)}`));}if(m(t).match(/^\\$|^\\[^\\]/)){let e=process.cwd();return s.default(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),`${e[0]}:\\${t.substr(1)}`;}}return s.default(p(e),"ensureAbsoluteRoot parameter 'root' must have an absolute root"),e.endsWith("/")||u&&e.endsWith("\\")||(e+=o.sep),e+t;}/**
|
|||
|
* On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:
|
|||
|
* `\\hello\share` and `C:\hello` (and using alternate separator).
|
|||
|
*/function p(e){return(// Windows
|
|||
|
(s.default(e,"hasAbsoluteRoot parameter 'itemPath' must not be empty"),// Normalize separators
|
|||
|
e=m(e),u)?e.startsWith("\\\\")||/^[A-Z]:\\/i.test(e):e.startsWith("/"));}/**
|
|||
|
* On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:
|
|||
|
* `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator).
|
|||
|
*/function d(e){return(// Windows
|
|||
|
(s.default(e,"isRooted parameter 'itemPath' must not be empty"),// Normalize separators
|
|||
|
e=m(e),u)?e.startsWith("\\")||/^[A-Z]:/i.test(e):e.startsWith("/"));}/**
|
|||
|
* Removes redundant slashes and converts `/` to `\` on Windows
|
|||
|
*/function m(e){// Windows
|
|||
|
if(e=e||"",u){// Convert slashes on Windows
|
|||
|
e=e.replace(/\//g,"\\");// Remove redundant slashes
|
|||
|
let t=/^\\\\+[^\\]/.test(e);// e.g. \\hello
|
|||
|
return(t?"\\":"")+e.replace(/\\\\+/g,"\\");// preserve leading \\ for UNC
|
|||
|
}// Remove redundant slashes
|
|||
|
return e.replace(/\/\/+/g,"/");}/**
|
|||
|
* Normalizes the path separators and trims the trailing separator (when safe).
|
|||
|
* For example, `/foo/ => /foo` but `/ => /`
|
|||
|
*/function h(e){return(// Short-circuit if empty
|
|||
|
e?!// Normalize separators
|
|||
|
(e=m(e)).endsWith(o.sep)||e===o.sep||u&&/^[A-Z]:\\$/i.test(e)?e:e.substr(0,e.length-1):"");}e.exports.dirname=c,e.exports.ensureAbsoluteRoot=l,e.exports.hasAbsoluteRoot=p,e.exports.hasRoot=d,e.exports.normalizeSeparators=m,e.exports.safeTrimTrailingSeparator=h;}),parcelRequire.register("3MqmT",function(e,t){var r;Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.MatchKind=void 0,function(e){/** Not matched */e[e.None=0]="None",/** Matched if the path is a directory */e[e.Directory=1]="Directory",/** Matched if the path is a regular file */e[e.File=2]="File",/** Matched */e[e.All=3]="All";}(r=e.exports.MatchKind||(e.exports.MatchKind={}));}),parcelRequire.register("aY7Rr",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e};};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Pattern=void 0;let o=a($k14yv$os),s=a($k14yv$path),u=a(parcelRequire("irDzZ")),c=n($k14yv$assert);var l=parcelRequire("8sa3G"),p=parcelRequire("3MqmT"),d=parcelRequire("fbRJC");let m="win32"===process.platform;class h{constructor(e,t=!1,r,i){let a;if(/**
|
|||
|
* Indicates whether matches should be excluded from the result set
|
|||
|
*/this.negate=!1,"string"==typeof e)a=e.trim();else{// Convert to pattern
|
|||
|
r=r||[],c.default(r.length,"Parameter 'segments' must not empty");let t=h.getLiteral(r[0]);c.default(t&&u.hasAbsoluteRoot(t),"Parameter 'segments' first element must be a root path"),a=new d.Path(r).toString().trim(),e&&(a=`!${a}`);}// Negate
|
|||
|
for(;a.startsWith("!");)this.negate=!this.negate,a=a.substr(1).trim();// Normalize slashes and ensures absolute root
|
|||
|
a=h.fixupPattern(a,i),// Segments
|
|||
|
this.segments=new d.Path(a).segments,// Trailing slash indicates the pattern should only match directories, not regular files
|
|||
|
this.trailingSeparator=u.normalizeSeparators(a).endsWith(s.sep),a=u.safeTrimTrailingSeparator(a);// Search path (literal path prior to the first glob segment)
|
|||
|
let n=!1,o=this.segments.map(e=>h.getLiteral(e)).filter(e=>!n&&!(n=""===e));this.searchPath=new d.Path(o).toString(),// Root RegExp (required when determining partial match)
|
|||
|
this.rootRegExp=new RegExp(h.regExpEscape(o[0]),m?"i":""),this.isImplicitPattern=t;// Create minimatch
|
|||
|
let p={dot:!0,nobrace:!0,nocase:m,nocomment:!0,noext:!0,nonegate:!0};a=m?a.replace(/\\/g,"/"):a,this.minimatch=new l.Minimatch(a,p);}/**
|
|||
|
* Matches the pattern against the specified path
|
|||
|
*/match(e){return(// Match
|
|||
|
("**"===this.segments[this.segments.length-1]?// Normalize slashes
|
|||
|
(e=u.normalizeSeparators(e)).endsWith(s.sep)||!1!==this.isImplicitPattern||(// For example, formats like C: and C:foo on Windows are resolved to an absolute root.
|
|||
|
e=`${e}${s.sep}`):e=u.safeTrimTrailingSeparator(e),this.minimatch.match(e))?this.trailingSeparator?p.MatchKind.Directory:p.MatchKind.All:p.MatchKind.None);}/**
|
|||
|
* Indicates whether the pattern may match descendants of the specified path
|
|||
|
*/partialMatch(e){return(// matchOne does not handle root path correctly
|
|||
|
(// Normalize slashes and trim unnecessary trailing slash
|
|||
|
e=u.safeTrimTrailingSeparator(e),u.dirname(e)===e)?this.rootRegExp.test(e):this.minimatch.matchOne(e.split(m?/\\+/:/\/+/),this.minimatch.set[0],!0));}/**
|
|||
|
* Escapes glob patterns within a path
|
|||
|
*/static globEscape(e){return(m?e:e.replace(/\\/g,"\\\\")// escape '\' on Linux/macOS
|
|||
|
).replace(/(\[)(?=[^/]+\])/g,"[[]")// escape '[' when ']' follows within the path segment
|
|||
|
.replace(/\?/g,"[?]")// escape '?'
|
|||
|
.replace(/\*/g,"[*]");// escape '*'
|
|||
|
}/**
|
|||
|
* Normalizes slashes and ensures absolute root
|
|||
|
*/static fixupPattern(e,t){// Empty
|
|||
|
c.default(e,"pattern cannot be empty");// Must not contain `.` segment, unless first segment
|
|||
|
// Must not contain `..` segment
|
|||
|
let r=new d.Path(e).segments.map(e=>h.getLiteral(e));// Replace leading `.` segment
|
|||
|
if(c.default(r.every((e,t)=>("."!==e||0===t)&&".."!==e),`Invalid pattern '${e}'. Relative pathing '.' and '..' is not allowed.`),// Must not contain globs in root, e.g. Windows UNC path \\foo\b*r
|
|||
|
c.default(!u.hasRoot(e)||r[0],`Invalid pattern '${e}'. Root segment must not contain globs.`),"."===(// Normalize slashes
|
|||
|
e=u.normalizeSeparators(e))||e.startsWith(`.${s.sep}`))e=h.globEscape(process.cwd())+e.substr(1);else if("~"===e||e.startsWith(`~${s.sep}`))t=t||o.homedir(),c.default(t,"Unable to determine HOME directory"),c.default(u.hasAbsoluteRoot(t),`Expected HOME directory to be a rooted path. Actual '${t}'`),e=h.globEscape(t)+e.substr(1);else if(m&&(e.match(/^[A-Z]:$/i)||e.match(/^[A-Z]:[^\\]/i))){let t=u.ensureAbsoluteRoot("C:\\dummy-root",e.substr(0,2));e.length>2&&!t.endsWith("\\")&&(t+="\\"),e=h.globEscape(t)+e.substr(2);}else if(m&&("\\"===e||e.match(/^\\[^\\]/))){let t=u.ensureAbsoluteRoot("C:\\dummy-root","\\");t.endsWith("\\")||(t+="\\"),e=h.globEscape(t)+e.substr(1);}else e=u.ensureAbsoluteRoot(h.globEscape(process.cwd()),e);return u.normalizeSeparators(e);}/**
|
|||
|
* Attempts to unescape a pattern segment to create a literal path segment.
|
|||
|
* Otherwise returns empty string.
|
|||
|
*/static getLiteral(e){let t="";for(let r=0;r<e.length;r++){let i=e[r];// Escape
|
|||
|
if("\\"===i&&!m&&r+1<e.length){t+=e[++r];continue;}if("*"===i||"?"===i)return"";if("["===i&&r+1<e.length){let i="",a=-1;for(let t=r+1;t<e.length;t++){let r=e[t];// Escape
|
|||
|
if("\\"===r&&!m&&t+1<e.length){i+=e[++t];continue;}if("]"===r){a=t;break;}i+=r;}// Closed?
|
|||
|
if(a>=0){// Cannot convert
|
|||
|
if(i.length>1)return"";// Convert to literal
|
|||
|
if(i){t+=i,r=a;continue;}}// Otherwise fall thru
|
|||
|
}// Append
|
|||
|
t+=i;}return t;}/**
|
|||
|
* Escapes regexp special characters
|
|||
|
* https://javascript.info/regexp-escaping
|
|||
|
*/static regExpEscape(e){return e.replace(/[[\\^$.|?*+()]/g,"\\$&");}}e.exports.Pattern=h;}),parcelRequire.register("8sa3G",function(e,t){e.exports=x,x.Minimatch=f;var r=function(){try{return $6278bd9ea450e724$import$e681ab6e5ccab411;}catch(e){}}()||{sep:"/"};x.sep=r.sep;var i=x.GLOBSTAR=f.GLOBSTAR={},a=parcelRequire("93RSZ"),n={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},o="[^/]",s=o+"*?",u="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",c="(?:(?!(?:\\/|^)\\.).)*?",l=p("().*{}+?[]^$\\!");// "abc" -> { a:true, b:true, c:true }
|
|||
|
function p(e){return e.split("").reduce(function(e,t){return e[t]=!0,e;},{});}// normalizes slashes.
|
|||
|
var d=/\/+/;function m(e,t){return t=t||{},function(r,i,a){return x(r,e,t);};}function h(e,t){t=t||{};var r={};return Object.keys(e).forEach(function(t){r[t]=e[t];}),Object.keys(t).forEach(function(e){r[e]=t[e];}),r;}function x(e,t,r){return(// shortcut: comments match nothing.
|
|||
|
v(t),r||(r={}),(!!r.nocomment||"#"!==t.charAt(0))&&new f(t,r).match(e));}function f(e,t){if(!(this instanceof f))return new f(e,t);v(e),t||(t={}),e=e.trim(),t.allowWindowsEscape||"/"===r.sep||(e=e.split(r.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,// make the set of regexps etc.
|
|||
|
this.make();}function g(){var e=this.pattern,t=this.options;// empty patterns and comments match nothing.
|
|||
|
if(!t.nocomment&&"#"===e.charAt(0)){this.comment=!0;return;}if(!e){this.empty=!0;return;}// step 1: figure out negation, etc.
|
|||
|
this.parseNegate();// step 2: expand braces
|
|||
|
var r=this.globSet=this.braceExpand();t.debug&&(this.debug=function(){console.error.apply(console,arguments);}),this.debug(this.pattern,r),// step 3: now we have a set, so turn each one into a series of path-portion
|
|||
|
// matching patterns.
|
|||
|
// These will be regexps, except in the case of "**", which is
|
|||
|
// set to the GLOBSTAR object for globstar behavior,
|
|||
|
// and will not contain any / characters
|
|||
|
r=this.globParts=r.map(function(e){return e.split(d);}),this.debug(this.pattern,r),// glob --> regexps
|
|||
|
r=r.map(function(e,t,r){return e.map(this.parse,this);},this),this.debug(this.pattern,r),// filter out everything that didn't compile properly.
|
|||
|
r=r.filter(function(e){return-1===e.indexOf(!1);}),this.debug(this.pattern,r),this.set=r;}function D(){var e=this.pattern,t=!1,r=this.options,i=0;if(!r.nonegate){for(var a=0,n=e.length;a<n&&"!"===e.charAt(a);a++)t=!t,i++;i&&(this.pattern=e.substr(i)),this.negate=t;}}function y(e,t){return(// Thanks to Yeting Li <https://github.com/yetingli> for
|
|||
|
// improving this regexp to avoid a ReDOS vulnerability.
|
|||
|
(t||(t=this instanceof f?this.options:{}),v(e=void 0===e?this.pattern:e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e))?[e]:a(e));}x.filter=m,x.defaults=function(e){if(!e||"object"!=typeof e||!Object.keys(e).length)return x;var t=x,r=function(r,i,a){return t(r,i,h(e,a));};return r.Minimatch=function(r,i){return new t.Minimatch(r,h(e,i));},r.Minimatch.defaults=function(r){return t.defaults(h(e,r)).Minimatch;},r.filter=function(r,i){return t.filter(r,h(e,i));},r.defaults=function(r){return t.defaults(h(e,r));},r.makeRe=function(r,i){return t.makeRe(r,h(e,i));},r.braceExpand=function(r,i){return t.braceExpand(r,h(e,i));},r.match=function(r,i,a){return t.match(r,i,h(e,a));},r;},f.defaults=function(e){return x.defaults(e).Minimatch;},f.prototype.debug=function(){},f.prototype.make=g,f.prototype.parseNegate=D,// Brace expansion:
|
|||
|
// a{b,c}d -> abd acd
|
|||
|
// a{b,}c -> abc ac
|
|||
|
// a{0..3}d -> a0d a1d a2d a3d
|
|||
|
// a{b,c{d,e}f}g -> abg acdfg acefg
|
|||
|
// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
|
|||
|
//
|
|||
|
// Invalid sets are not expanded.
|
|||
|
// a{2..}b -> a{2..}b
|
|||
|
// a{b}c -> a{b}c
|
|||
|
x.braceExpand=function(e,t){return y(e,t);},f.prototype.braceExpand=y;var b=65536,v=function(e){if("string"!=typeof e)throw TypeError("invalid pattern");if(e.length>b)throw TypeError("pattern is too long");};// parse a component of the expanded set.
|
|||
|
// At this point, no pattern may contain "/" in it
|
|||
|
// so we're going to return a 2d array, where each entry is the full
|
|||
|
// pattern, split on '/', and then turned into a regular expression.
|
|||
|
// A regexp is made at the end which joins each array with an
|
|||
|
// escaped /, and another full one which joins each regexp with |.
|
|||
|
//
|
|||
|
// Following the lead of Bash 4.1, note that "**" only has special meaning
|
|||
|
// when it is the *only* thing in a path portion. Otherwise, any series
|
|||
|
// of * is equivalent to a single *. Globstar behavior is enabled by
|
|||
|
// default, and can be disabled by setting options.noglobstar.
|
|||
|
f.prototype.parse=E;var C={};function E(e,t){v(e);var r=this.options;// shortcuts
|
|||
|
if("**"===e){if(!r.noglobstar)return i;e="*";}if(""===e)return"";var a="",u=!!r.nocase,c=!1,p=[],d=[],m=!1,h=-1,x=-1,f="."===e.charAt(0)?""// anything
|
|||
|
:r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",g=this;function D(){if(y){// we had some state-tracking character
|
|||
|
// that wasn't consumed by this pass.
|
|||
|
switch(y){case"*":a+=s,u=!0;break;case"?":a+=o,u=!0;break;default:a+="\\"+y;}g.debug("clearStateChar %j %j",y,a),y=!1;}}for(var y,b,E=0,A=e.length;E<A&&(b=e.charAt(E));E++){// skip over any that are escaped.
|
|||
|
if(this.debug("%s %s %s %j",e,E,a,b),c&&l[b]){a+="\\"+b,c=!1;continue;}switch(b){/* istanbul ignore next */case"/":// completely not allowed, even escaped.
|
|||
|
// Should already be path-split by now.
|
|||
|
return!1;case"\\":D(),c=!0;continue;// the various stateChar values
|
|||
|
// for the "extglob" stuff.
|
|||
|
case"?":case"*":case"+":case"@":case"!":// all of those are literals inside a class, except that
|
|||
|
// the glob [!a] means [^a] in regexp
|
|||
|
if(this.debug("%s %s %s %j <-- stateChar",e,E,a,b),m){this.debug(" in class"),"!"===b&&E===x+1&&(b="^"),a+=b;continue;}// if we already have a stateChar, then it means
|
|||
|
// that there was something like ** or +? in there.
|
|||
|
// Handle the stateChar, then proceed with this one.
|
|||
|
g.debug("call clearStateChar %j",y),D(),y=b,r.noext&&D();continue;case"(":if(m){a+="(";continue;}if(!y){a+="\\(";continue;}p.push({type:y,start:E-1,reStart:a.length,open:n[y].open,close:n[y].close}),// negation is (?:(?!js)[^/]*)
|
|||
|
a+="!"===y?"(?:(?!(?:":"(?:",this.debug("plType %j %j",y,a),y=!1;continue;case")":if(m||!p.length){a+="\\)";continue;}D(),u=!0;var B=p.pop();// negation is (?:(?!js)[^/]*)
|
|||
|
// The others are (?:<pattern>)<type>
|
|||
|
a+=B.close,"!"===B.type&&d.push(B),B.reEnd=a.length;continue;case"|":if(m||!p.length||c){a+="\\|",c=!1;continue;}D(),a+="|";continue;// these are mostly the same in regexp and glob
|
|||
|
case"[":if(// swallow any state-tracking char before the [
|
|||
|
D(),m){a+="\\"+b;continue;}m=!0,x=E,h=a.length,a+=b;continue;case"]":// a right bracket shall lose its special
|
|||
|
// meaning and represent itself in
|
|||
|
// a bracket expression if it occurs
|
|||
|
// first in the list. -- POSIX.2 2.8.3.2
|
|||
|
if(E===x+1||!m){a+="\\"+b,c=!1;continue;}// handle the case where we left a class open.
|
|||
|
// "[z-a]" is valid, equivalent to "\[z-a\]"
|
|||
|
// split where the last [ was, make sure we don't have
|
|||
|
// an invalid re. if so, re-walk the contents of the
|
|||
|
// would-be class to re-translate any characters that
|
|||
|
// were passed through as-is
|
|||
|
// TODO: It would probably be faster to determine this
|
|||
|
// without a try/catch and a new RegExp, but it's tricky
|
|||
|
// to do safely. For now, this is safe and works.
|
|||
|
var N=e.substring(x+1,E);try{RegExp("["+N+"]");}catch(e){// not a valid class!
|
|||
|
var F=this.parse(N,C);a=a.substr(0,h)+"\\["+F[0]+"\\]",u=u||F[1],m=!1;continue;}// finish up the class.
|
|||
|
u=!0,m=!1,a+=b;continue;default:// swallow any state char that wasn't consumed
|
|||
|
D(),c?c=!1:l[b]&&!("^"===b&&m)&&(a+="\\"),a+=b;}// switch
|
|||
|
}// for
|
|||
|
// handle the case where we had a +( thing at the *end*
|
|||
|
// of the pattern.
|
|||
|
// each pattern list stack adds 3 chars, and we need to go through
|
|||
|
// and escape any | chars that were passed through as-is for the regexp.
|
|||
|
// Go through and escape them, taking care not to double-escape any
|
|||
|
// | chars that were already escaped.
|
|||
|
for(m&&(// split where the last [ was, and escape it
|
|||
|
// this is a huge pita. We now have to re-walk
|
|||
|
// the contents of the would-be class to re-translate
|
|||
|
// any characters that were passed through as-is
|
|||
|
N=e.substr(x+1),F=this.parse(N,C),a=a.substr(0,h)+"\\["+F[0],u=u||F[1]),B=p.pop();B;B=p.pop()){var w=a.slice(B.reStart+B.open.length);this.debug("setting tail",a,B),// maybe some even number of \, then maybe 1 \, followed by a |
|
|||
|
w=w.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(e,t,r){// need to escape all those slashes *again*, without escaping the
|
|||
|
// one that we need for escaping the | character. As it works out,
|
|||
|
// escaping an even number of slashes can be done by simply repeating
|
|||
|
// it exactly after itself. That's why this trick works.
|
|||
|
//
|
|||
|
// I am sorry that you have to see this.
|
|||
|
return r||(r="\\"),t+t+r+"|";}),this.debug("tail=%j\n %s",w,w,B,a);var P="*"===B.type?s:"?"===B.type?o:"\\"+B.type;u=!0,a=a.slice(0,B.reStart)+P+"\\("+w;}// handle trailing things that only matter at the very end.
|
|||
|
D(),c&&(a+="\\\\");// only need to apply the nodot start if the re starts with
|
|||
|
// something that could conceivably capture a dot
|
|||
|
var T=!1;switch(a.charAt(0)){case"[":case".":case"(":T=!0;}// Hack to work around lack of negative lookbehind in JS
|
|||
|
// A pattern like: *.!(x).!(y|z) needs to ensure that a name
|
|||
|
// like 'a.xyz.yz' doesn't match. So, the first negative
|
|||
|
// lookahead, has to look ALL the way ahead, to the end of
|
|||
|
// the pattern.
|
|||
|
for(var O=d.length-1;O>-1;O--){var R=d[O],I=a.slice(0,R.reStart),z=a.slice(R.reStart,R.reEnd-8),k=a.slice(R.reEnd-8,R.reEnd),M=a.slice(R.reEnd);k+=M;// Handle nested stuff like *(*.js|!(*.json)), where open parens
|
|||
|
// mean that we should *not* include the ) in the bit that is considered
|
|||
|
// "after" the negated section.
|
|||
|
var q=I.split("(").length-1,L=M;for(E=0;E<q;E++)L=L.replace(/\)[+*?]?/,"");var j="";""===(M=L)&&t!==C&&(j="$"),a=I+z+M+j+k;}// parsing just a piece of a larger pattern.
|
|||
|
if(""!==a&&u&&(a="(?=.)"+a),T&&(a=f+a),t===C)return[a,u];// skip the regexp for non-magical patterns
|
|||
|
// unescape anything in it, though, so that it'll be
|
|||
|
// an exact match against a file etc.
|
|||
|
if(!u)return S(e);var H=r.nocase?"i":"";try{var U=RegExp("^"+a+"$",H);}catch(e)/* istanbul ignore next - should be impossible */{// If it was an invalid regular expression, then it can't match
|
|||
|
// anything. This trick looks for a character after the end of
|
|||
|
// the string, which is of course impossible, except in multi-line
|
|||
|
// mode, but it's not a /m regex.
|
|||
|
return RegExp("$.");}return U._glob=e,U._src=a,U;}function A(){if(this.regexp||!1===this.regexp)return this.regexp;// at this point, this.set is a 2d array of partial
|
|||
|
// pattern strings, or "**".
|
|||
|
//
|
|||
|
// It's better to use .match(). This function shouldn't
|
|||
|
// be used, really, but it's pretty convenient sometimes,
|
|||
|
// when you just want to work with a regex.
|
|||
|
var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,r=t.noglobstar?s:t.dot?u:c,a=t.nocase?"i":"",n=e.map(function(e){return e.map(function(e){return e===i?r:"string"==typeof e?B(e):e._src;}).join("\\/");}).join("|");// must match entire pattern
|
|||
|
// ending in a * or ** will make it less strict.
|
|||
|
n="^(?:"+n+")$",this.negate&&(n="^(?!"+n+").*$");try{this.regexp=new RegExp(n,a);}catch(e)/* istanbul ignore next - should be impossible */{this.regexp=!1;}return this.regexp;}// replace stuff like \* with *
|
|||
|
function S(e){return e.replace(/\\(.)/g,"$1");}function B(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");}x.makeRe=function(e,t){return new f(e,t||{}).makeRe();},f.prototype.makeRe=A,x.match=function(e,t,r){r=r||{};var i=new f(t,r);return e=e.filter(function(e){return i.match(e);}),i.options.nonull&&!e.length&&e.push(t),e;},f.prototype.match=function(e,t){// short-circuit in the case of busted things.
|
|||
|
// comments, etc.
|
|||
|
if(void 0===t&&(t=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var i,a,n=this.options;"/"!==r.sep&&(e=e.split(r.sep).join("/")),// treat the test path as a set of pathparts.
|
|||
|
e=e.split(d),this.debug(this.pattern,"split",e);// just ONE of the pattern sets in this.set needs to match
|
|||
|
// in order for it to be valid. If negating, then just one
|
|||
|
// match means that we have failed.
|
|||
|
// Either way, return on the first hit.
|
|||
|
var o=this.set;for(this.debug(this.pattern,"set",o),a=e.length-1;a>=0&&!(i=e[a]);a--);for(a=0;a<o.length;a++){var s=o[a],u=e;if(n.matchBase&&1===s.length&&(u=[i]),this.matchOne(u,s,t)){if(n.flipNegate)return!0;return!this.negate;}}return(// didn't get any hits. this is success if it's a negative
|
|||
|
// pattern, failure otherwise.
|
|||
|
!n.flipNegate&&this.negate);},// set partial to true to test if, for example,
|
|||
|
// "/a/b" matches the start of "/*/b/*/d"
|
|||
|
// Partial means, if you run out of file before you run
|
|||
|
// out of pattern, then that's fine, as long as all
|
|||
|
// the parts match.
|
|||
|
f.prototype.matchOne=function(e,t,r){var a=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var n=0,o=0,s=e.length,u=t.length;n<s&&o<u;n++,o++){this.debug("matchOne loop");var c,l=t[o],p=e[n];// should be impossible.
|
|||
|
// some invalid regexp stuff in the set.
|
|||
|
/* istanbul ignore if */if(this.debug(t,l,p),!1===l)return!1;if(l===i){this.debug("GLOBSTAR",[t,l,p]);// "**"
|
|||
|
// a/**/b/**/c would match the following:
|
|||
|
// a/b/x/y/z/c
|
|||
|
// a/x/y/z/b/c
|
|||
|
// a/b/x/b/x/c
|
|||
|
// a/b/c
|
|||
|
// To do this, take the rest of the pattern after
|
|||
|
// the **, and see if it would match the file remainder.
|
|||
|
// If so, return success.
|
|||
|
// If not, the ** "swallows" a segment, and try again.
|
|||
|
// This is recursively awful.
|
|||
|
//
|
|||
|
// a/**/b/**/c matching a/b/x/y/z/c
|
|||
|
// - a matches a
|
|||
|
// - doublestar
|
|||
|
// - matchOne(b/x/y/z/c, b/**/c)
|
|||
|
// - b matches b
|
|||
|
// - doublestar
|
|||
|
// - matchOne(x/y/z/c, c) -> no
|
|||
|
// - matchOne(y/z/c, c) -> no
|
|||
|
// - matchOne(z/c, c) -> no
|
|||
|
// - matchOne(c, c) yes, hit
|
|||
|
var d=n,m=o+1;if(m===u){// a ** at the end will just swallow the rest.
|
|||
|
// We have found a match.
|
|||
|
// however, it will not swallow /.x, unless
|
|||
|
// options.dot is set.
|
|||
|
// . and .. are *never* matched by **, for explosively
|
|||
|
// exponential reasons.
|
|||
|
for(this.debug("** at the end");n<s;n++)if("."===e[n]||".."===e[n]||!a.dot&&"."===e[n].charAt(0))return!1;return!0;}// ok, let's see if we can swallow whatever we can.
|
|||
|
for(;d<s;){var h=e[d];// XXX remove this slice. Just pass the start index.
|
|||
|
if(this.debug("\nglobstar while",e,d,t,m,h),this.matchOne(e.slice(d),t.slice(m),r))// found a match.
|
|||
|
return this.debug("globstar found match!",d,s,h),!0;// can't swallow "." or ".." ever.
|
|||
|
// can only swallow ".foo" when explicitly asked.
|
|||
|
if("."===h||".."===h||!a.dot&&"."===h.charAt(0)){this.debug("dot detected!",e,d,t,m);break;}// ** swallows a segment, and continue.
|
|||
|
this.debug("globstar swallow a segment, and continue"),d++;}// no match was found.
|
|||
|
// However, in partial mode, we can't say this is necessarily over.
|
|||
|
// If there's more *pattern* left, then
|
|||
|
/* istanbul ignore if */if(r&&(// ran out of file
|
|||
|
this.debug("\n>>> no match, partial?",e,d,t,m),d===s))return!0;return!1;}if("string"==typeof l?(c=p===l,this.debug("string match",l,p,c)):(c=p.match(l),this.debug("pattern match",l,p,c)),!c)return!1;}// Note: ending in / means that we'll get a final ""
|
|||
|
// at the end of the pattern. This can only match a
|
|||
|
// corresponding "" at the end of the file.
|
|||
|
// If the file ends in /, then it can only match a
|
|||
|
// a pattern that ends in /, unless the pattern just
|
|||
|
// doesn't have any more for it. But, a/b/ should *not*
|
|||
|
// match "a/b/*", even though "" matches against the
|
|||
|
// [^/]*? pattern, except in partial mode, where it might
|
|||
|
// simply not be reached yet.
|
|||
|
// However, a/b/ should still satisfy a/*
|
|||
|
// now either we fell off the end of the pattern, or we're done.
|
|||
|
if(n===s&&o===u)// an exact hit!
|
|||
|
return!0;if(n===s)// this is ok if we're doing the match as part of
|
|||
|
// a glob fs traversal.
|
|||
|
return r;/* istanbul ignore else */if(o===u)// this is only acceptable if we're on the very last
|
|||
|
// empty segment of a file with a trailing slash.
|
|||
|
// a/* should match a/b/
|
|||
|
return n===s-1&&""===e[n];// should be unreachable.
|
|||
|
/* istanbul ignore next */throw Error("wtf?");};}),parcelRequire.register("93RSZ",function(e,t){var r=parcelRequire("5Xf9I"),i=parcelRequire("gMNE4");e.exports=m;var a="\x00SLASH"+Math.random()+"\x00",n="\x00OPEN"+Math.random()+"\x00",o="\x00CLOSE"+Math.random()+"\x00",s="\x00COMMA"+Math.random()+"\x00",u="\x00PERIOD"+Math.random()+"\x00";function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0);}function l(e){return e.split("\\\\").join(a).split("\\{").join(n).split("\\}").join(o).split("\\,").join(s).split("\\.").join(u);}function p(e){return e.split(a).join("\\").split(n).join("{").split(o).join("}").split(s).join(",").split(u).join(".");}// Basically just str.split(","), but handling cases
|
|||
|
// where we have nested braced sections, which should be
|
|||
|
// treated as individual members, like {a,{b,c},d}
|
|||
|
function d(e){if(!e)return[""];var t=[],r=i("{","}",e);if(!r)return e.split(",");var a=r.pre,n=r.body,o=r.post,s=a.split(",");s[s.length-1]+="{"+n+"}";var u=d(o);return o.length&&(s[s.length-1]+=u.shift(),s.push.apply(s,u)),t.push.apply(t,s),t;}function m(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),D(l(e),!0).map(p)):[];}function h(e){return"{"+e+"}";}function x(e){return /^-?0\d/.test(e);}function f(e,t){return e<=t;}function g(e,t){return e>=t;}function D(e,t){var a=[],n=i("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),l=s||u,p=n.body.indexOf(",")>=0;if(!l&&!p)return(// {a},b}
|
|||
|
n.post.match(/,.*\}/)?D(e=n.pre+"{"+n.body+o+n.post):[e]);if(l)b=n.body.split(/\.\./);else if(1===(b=d(n.body)).length&&1===// x{{a,b}}y ==> x{a}y x{b}y
|
|||
|
(b=D(b[0],!1).map(h)).length){var m=n.post.length?D(n.post,!1):[""];return m.map(function(e){return n.pre+b[0]+e;});}// at this point, n is the parts, and we know it's not a comma set
|
|||
|
// with a single entry.
|
|||
|
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
|||
|
var y=n.pre,m=n.post.length?D(n.post,!1):[""];if(l){var b,v,C,E=c(b[0]),A=c(b[1]),S=Math.max(b[0].length,b[1].length),B=3==b.length?Math.abs(c(b[2])):1,N=f;A<E&&(B*=-1,N=g);var F=b.some(x);v=[];for(var w=E;N(w,A);w+=B){if(u)"\\"===(C=String.fromCharCode(w))&&(C="");else if(C=String(w),F){var P=S-C.length;if(P>0){var T=Array(P+1).join("0");C=w<0?"-"+T+C.slice(1):T+C;}}v.push(C);}}else v=r(b,function(e){return D(e,!1);});for(var O=0;O<v.length;O++)for(var R=0;R<m.length;R++){var I=y+v[O]+m[R];(!t||l||I)&&a.push(I);}return a;}}),parcelRequire.register("5Xf9I",function(e,t){e.exports=function(e,t){for(var i=[],a=0;a<e.length;a++){var n=t(e[a],a);r(n)?i.push.apply(i,n):i.push(n);}return i;};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e);};}),parcelRequire.register("gMNE4",function(e,t){function r(e,t,r){e instanceof RegExp&&(e=i(e,r)),t instanceof RegExp&&(t=i(t,r));var n=a(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)};}function i(e,t){var r=t.match(e);return r?r[0]:null;}function a(e,t,r){var i,a,n,o,s,u=r.indexOf(e),c=r.indexOf(t,u+1),l=u;if(u>=0&&c>0){if(e===t)return[u,c];for(i=[],n=r.length;l>=0&&!s;)l==u?(i.push(l),u=r.indexOf(e,l+1)):1==i.length?s=[i.pop(),c]:((a=i.pop())<n&&(n=a,o=c),c=r.indexOf(t,l+1)),l=u<c&&u>=0?u:c;i.length&&(s=[n,o]);}return s;}e.exports=r,r.range=a;}),parcelRequire.register("fbRJC",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e};};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Path=void 0;let o=a($k14yv$path),s=a(parcelRequire("irDzZ")),u=n($k14yv$assert),c="win32"===process.platform;/**
|
|||
|
* Helper class for parsing paths into segments
|
|||
|
*/class l{/**
|
|||
|
* Constructs a Path
|
|||
|
* @param itemPath Path or array of segments
|
|||
|
*/constructor(e){// String
|
|||
|
if(this.segments=[],"string"==typeof e){// Not rooted
|
|||
|
if(u.default(e,"Parameter 'itemPath' must not be empty"),// Normalize slashes and trim unnecessary trailing slash
|
|||
|
e=s.safeTrimTrailingSeparator(e),s.hasRoot(e)){// Add all segments, while not at the root
|
|||
|
let t=e,r=s.dirname(t);for(;r!==t;){// Add the segment
|
|||
|
let e=o.basename(t);this.segments.unshift(e),// Truncate the last segment
|
|||
|
t=r,r=s.dirname(t);}// Remainder is the root
|
|||
|
this.segments.unshift(t);}else this.segments=e.split(o.sep);}else{// Must not be empty
|
|||
|
u.default(e.length>0,"Parameter 'itemPath' must not be an empty array");// Each segment
|
|||
|
for(let t=0;t<e.length;t++){let r=e[t];// Must not be empty
|
|||
|
u.default(r,"Parameter 'itemPath' must not contain any empty segments"),// Normalize slashes
|
|||
|
r=s.normalizeSeparators(e[t]),0===t&&s.hasRoot(r)?(r=s.safeTrimTrailingSeparator(r),u.default(r===s.dirname(r),"Parameter 'itemPath' root segment contains information for multiple segments")):// Must not contain slash
|
|||
|
u.default(!r.includes(o.sep),"Parameter 'itemPath' contains unexpected path separators"),this.segments.push(r);}}}/**
|
|||
|
* Converts the path to it's string representation
|
|||
|
*/toString(){// First segment
|
|||
|
let e=this.segments[0],t=e.endsWith(o.sep)||c&&/^[A-Z]:$/i.test(e);for(let r=1;r<this.segments.length;r++)t?t=!1:e+=o.sep,e+=this.segments[r];return e;}}e.exports.Path=l;}),parcelRequire.register("ad8Hv",function(e,t){Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.SearchState=void 0;class r{constructor(e,t){this.path=e,this.level=t;}}e.exports.SearchState=r;}),parcelRequire.register("6c5Th",function(e,t){var r=parcelRequire("6SIOK"),i=parcelRequire("dGCqI"),a=i;a.v1=r,a.v4=i,e.exports=a;}),parcelRequire.register("6SIOK",function(e,t){var r,i,a=parcelRequire("fVQSr"),n=parcelRequire("3MZit"),o=0,s=0;// See https://github.com/uuidjs/uuid for API details
|
|||
|
function u(e,t,u){var c=t&&u||0,l=t||[],p=(e=e||{}).node||r,d=void 0!==e.clockseq?e.clockseq:i;// node and clockseq need to be initialized to random values if they're not
|
|||
|
// specified. We do this lazily to minimize issues related to insufficient
|
|||
|
// system entropy. See #189
|
|||
|
if(null==p||null==d){var m=a();null==p&&(p=r=[1|m[0],m[1],m[2],m[3],m[4],m[5]]),null==d&&(d=i=(m[6]<<8|m[7])&16383);}// UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
|||
|
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
|||
|
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
|||
|
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
|||
|
var h=void 0!==e.msecs?e.msecs:new Date().getTime(),x=void 0!==e.nsecs?e.nsecs:s+1,f=h-o+(x-s)/1e4;// Per 4.2.1.2 Throw error if too many uuids are requested
|
|||
|
if(f<0&&void 0===e.clockseq&&(d=d+1&16383),(f<0||h>o)&&void 0===e.nsecs&&(x=0),x>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");o=h,s=x,i=d;// `time_low`
|
|||
|
var g=((268435455&(// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
|||
|
h+=122192928e5))*1e4+x)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;// `time_mid`
|
|||
|
var D=h/4294967296*1e4&268435455;l[c++]=D>>>8&255,l[c++]=255&D,// `time_high_and_version`
|
|||
|
l[c++]=D>>>24&15|16,l[c++]=D>>>16&255,// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|||
|
l[c++]=d>>>8|128,// `clock_seq_low`
|
|||
|
l[c++]=255&d;// `node`
|
|||
|
for(var y=0;y<6;++y)l[c+y]=p[y];return t||n(l);}e.exports=u;}),parcelRequire.register("78Azy",function(e,t){var r,i,a;Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.ManifestFilename=e.exports.TarFilename=e.exports.SystemTarPathOnWindows=e.exports.GnuTarPathOnWindows=e.exports.SocketTimeout=e.exports.DefaultRetryDelay=e.exports.DefaultRetryAttempts=e.exports.ArchiveToolType=e.exports.CompressionMethod=e.exports.CacheFilename=void 0,function(e){e.Gzip="cache.tgz",e.Zstd="cache.tzst";}(r=e.exports.CacheFilename||(e.exports.CacheFilename={})),function(e){e.Gzip="gzip",// Long range mode was added to zstd in v1.3.2.
|
|||
|
// This enum is for earlier version of zstd that does not have --long support
|
|||
|
e.ZstdWithoutLong="zstd-without-long",e.Zstd="zstd";}(i=e.exports.CompressionMethod||(e.exports.CompressionMethod={})),function(e){e.GNU="gnu",e.BSD="bsd";}(a=e.exports.ArchiveToolType||(e.exports.ArchiveToolType={})),// The default number of retry attempts.
|
|||
|
e.exports.DefaultRetryAttempts=2,// The default delay in milliseconds between retry attempts.
|
|||
|
e.exports.DefaultRetryDelay=5e3,// Socket timeout in milliseconds during download. If no traffic is received
|
|||
|
// over the socket during this period, the socket is destroyed and the download
|
|||
|
// is aborted.
|
|||
|
e.exports.SocketTimeout=5e3,// The default path of GNUtar on hosted Windows runners
|
|||
|
e.exports.GnuTarPathOnWindows=`${process.env.PROGRAMFILES}\\Git\\usr\\bin\\tar.exe`,// The default path of BSDtar on hosted Windows runners
|
|||
|
e.exports.SystemTarPathOnWindows=`${process.env.SYSTEMDRIVE}\\Windows\\System32\\tar.exe`,e.exports.TarFilename="cache.tar",e.exports.ManifestFilename="manifest.txt";}),parcelRequire.register("cOagO",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r];}}),Object.defineProperty(e,i,a);}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r(function(t){t(e);});}return new(r||(r=Promise))(function(r,n){function o(e){try{u(i.next(e));}catch(e){n(e);}}function s(e){try{u(i.throw(e));}catch(e){n(e);}}function u(e){e.done?r(e.value):a(e.value).then(o,s);}u((i=i.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.saveCache=e.exports.reserveCache=e.exports.downloadCache=e.exports.getCacheEntry=e.exports.getCacheVersion=void 0;let o=a(parcelRequire("lcRzN"));var s=parcelRequire("iC7fc"),u=parcelRequire("gaCjs");let c=a($k14yv$crypto),l=a($k14yv$fs),p=a(parcelRequire("ju5qo"));var d=parcelRequire("4DUXu"),m=parcelRequire("hbCiU"),h=parcelRequire("dnI1x");let x="1.0";function f(e){let t=process.env.ACTIONS_CACHE_URL||"";if(!t)throw Error("Cache Service Url not found, unable to restore cache.");let r=`${t}_apis/artifactcache/${e}`;return o.debug(`Resource Url: ${r}`),r;}function g(e,t){return`${e};api-version=${t}`;}function D(){let e={headers:{Accept:g("application/json","6.0-preview.1")}};return e;}function y(){let e=process.env.ACTIONS_RUNTIME_TOKEN||"",t=new u.BearerCredentialHandler(e);return new s.HttpClient("actions/cache",[t],D());}function b(e,t,r=!1){let i=e;return t&&i.push(t),"win32"!==process.platform||r||i.push("windows-only"),// Add salt to cache version to support breaking changes in cache entry
|
|||
|
i.push(x),c.createHash("sha256").update(i.join("|")).digest("hex");}function v(e,t,r){return n(this,void 0,void 0,function*(){let i=y(),a=b(t,null==r?void 0:r.compressionMethod,null==r?void 0:r.enableCrossOsArchive),s=`cache?keys=${encodeURIComponent(e.join(","))}&version=${a}`,u=yield(0,h.retryTypedResponse)("getCacheEntry",()=>n(this,void 0,void 0,function*(){return i.getJson(f(s));}));// Cache not found
|
|||
|
if(204===u.statusCode)return o.isDebug()&&(yield C(e[0],i,a)),null;if(!(0,h.isSuccessStatusCode)(u.statusCode))throw Error(`Cache service responded with ${u.statusCode}`);let c=u.result,l=null==c?void 0:c.archiveLocation;if(!l)throw Error("Cache not found.");return o.setSecret(l),o.debug("Cache Result:"),o.debug(JSON.stringify(c)),c;});}function C(e,t,r){return n(this,void 0,void 0,function*(){let i=`caches?key=${encodeURIComponent(e)}`,a=yield(0,h.retryTypedResponse)("listCache",()=>n(this,void 0,void 0,function*(){return t.getJson(f(i));}));if(200===a.statusCode){let t=a.result,i=null==t?void 0:t.totalCount;if(i&&i>0)for(let i of(o.debug(`No matching cache found for cache key '${e}', version '${r} and scope ${process.env.GITHUB_REF}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
|
|||
|
Other caches with similar key:`),(null==t?void 0:t.artifactCaches)||[]))o.debug(`Cache Key: ${null==i?void 0:i.cacheKey}, Cache Version: ${null==i?void 0:i.cacheVersion}, Cache Scope: ${null==i?void 0:i.scope}, Cache Created: ${null==i?void 0:i.creationTime}`);}});}function E(e,t,r){return n(this,void 0,void 0,function*(){let i=new $k14yv$url.URL(e),a=(0,m.getDownloadOptions)(r);i.hostname.endsWith(".blob.core.windows.net")?a.useAzureSdk?yield(0,d.downloadCacheStorageSDK)(e,t,a):a.concurrentBlobDownloads?yield(0,d.downloadCacheHttpClientConcurrent)(e,t,a):yield(0,d.downloadCacheHttpClient)(e,t):yield(0,d.downloadCacheHttpClient)(e,t);});}// Reserve Cache
|
|||
|
function A(e,t,r){return n(this,void 0,void 0,function*(){let i=y(),a=b(t,null==r?void 0:r.compressionMethod,null==r?void 0:r.enableCrossOsArchive),o={key:e,version:a,cacheSize:null==r?void 0:r.cacheSize},s=yield(0,h.retryTypedResponse)("reserveCache",()=>n(this,void 0,void 0,function*(){return i.postJson(f("caches"),o);}));return s;});}function S(e,t){// Format: `bytes start-end/filesize
|
|||
|
// start and end are inclusive
|
|||
|
// filesize can be *
|
|||
|
// For a 200 byte chunk starting at byte 0:
|
|||
|
// Content-Range: bytes 0-199/*
|
|||
|
return`bytes ${e}-${t}/*`;}function B(e,t,r,i,a){return n(this,void 0,void 0,function*(){o.debug(`Uploading chunk of size ${a-i+1} bytes at offset ${i} with content range: ${S(i,a)}`);let s={"Content-Type":"application/octet-stream","Content-Range":S(i,a)},u=yield(0,h.retryHttpClientResponse)(`uploadChunk (start: ${i}, end: ${a})`,()=>n(this,void 0,void 0,function*(){return e.sendStream("PATCH",t,r(),s);}));if(!(0,h.isSuccessStatusCode)(u.message.statusCode))throw Error(`Cache service responded with ${u.message.statusCode} during upload chunk.`);});}function N(e,t,r,i){return n(this,void 0,void 0,function*(){// Upload Chunks
|
|||
|
let a=p.getArchiveFileSizeInBytes(r),s=f(`caches/${t.toString()}`),u=l.openSync(r,"r"),c=(0,m.getUploadOptions)(i),d=p.assertDefined("uploadConcurrency",c.uploadConcurrency),h=p.assertDefined("uploadChunkSize",c.uploadChunkSize),x=[...Array(d).keys()];o.debug("Awaiting all uploads");let g=0;try{yield Promise.all(x.map(()=>n(this,void 0,void 0,function*(){for(;g<a;){let t=Math.min(a-g,h),i=g,n=g+t-1;g+=h,yield B(e,s,()=>l.createReadStream(r,{fd:u,start:i,end:n,autoClose:!1}).on("error",e=>{throw Error(`Cache upload failed because file read failed with ${e.message}`);}),i,n);}})));}finally{l.closeSync(u);}});}function F(e,t,r){return n(this,void 0,void 0,function*(){let i={size:r};return yield(0,h.retryTypedResponse)("commitCache",()=>n(this,void 0,void 0,function*(){return e.postJson(f(`caches/${t.toString()}`),i);}));});}function w(e,t,r){return n(this,void 0,void 0,function*(){let i=y();o.debug("Upload cache"),yield N(i,e,t,r),// Commit Cache
|
|||
|
o.debug("Commiting cache");let a=p.getArchiveFileSizeInBytes(t);o.info(`Cache Size: ~${Math.round(a/1048576)} MB (${a} B)`);let n=yield F(i,e,a);if(!(0,h.isSuccessStatusCode)(n.statusCode))throw Error(`Cache service responded with ${n.statusCode} during commit cache.`);o.info("Cache saved successfully");});}e.exports.getCacheVersion=b,e.exports.getCacheEntry=v,e.exports.downloadCache=E,e.exports.reserveCache=A,e.exports.saveCache=w;}),parcelRequire.register("4DUXu",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r];}}),Object.defineProperty(e,i,a);}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r(function(t){t(e);});}return new(r||(r=Promise))(function(r,n){function o(e){try{u(i.next(e));}catch(e){n(e);}}function s(e){try{u(i.throw(e));}catch(e){n(e);}}function u(e){e.done?r(e.value):a(e.value).then(o,s);}u((i=i.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.downloadCacheStorageSDK=e.exports.downloadCacheHttpClientConcurrent=e.exports.downloadCacheHttpClient=e.exports.DownloadProgress=void 0;let o=a(parcelRequire("lcRzN"));var s=parcelRequire("iC7fc"),u=parcelRequire("i0GGG");let c=a($k14yv$buffer),l=a($k14yv$fs),p=a($k14yv$stream),d=a($k14yv$util),m=a(parcelRequire("ju5qo"));var h=parcelRequire("78Azy"),x=parcelRequire("dnI1x"),f=parcelRequire("708hs");/**
|
|||
|
* Pipes the body of a HTTP response to a stream
|
|||
|
*
|
|||
|
* @param response the HTTP response
|
|||
|
* @param output the writable stream
|
|||
|
*/function g(e,t){return n(this,void 0,void 0,function*(){let r=d.promisify(p.pipeline);yield r(e.message,t);});}/**
|
|||
|
* Class for tracking the download state and displaying stats.
|
|||
|
*/class D{constructor(e){this.contentLength=e,this.segmentIndex=0,this.segmentSize=0,this.segmentOffset=0,this.receivedBytes=0,this.displayedComplete=!1,this.startTime=Date.now();}/**
|
|||
|
* Progress to the next segment. Only call this method when the previous segment
|
|||
|
* is complete.
|
|||
|
*
|
|||
|
* @param segmentSize the length of the next segment
|
|||
|
*/nextSegment(e){this.segmentOffset=this.segmentOffset+this.segmentSize,this.segmentIndex=this.segmentIndex+1,this.segmentSize=e,this.receivedBytes=0,o.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`);}/**
|
|||
|
* Sets the number of bytes received for the current segment.
|
|||
|
*
|
|||
|
* @param receivedBytes the number of bytes received
|
|||
|
*/setReceivedBytes(e){this.receivedBytes=e;}/**
|
|||
|
* Returns the total number of bytes transferred.
|
|||
|
*/getTransferredBytes(){return this.segmentOffset+this.receivedBytes;}/**
|
|||
|
* Returns true if the download is complete.
|
|||
|
*/isDone(){return this.getTransferredBytes()===this.contentLength;}/**
|
|||
|
* Prints the current download stats. Once the download completes, this will print one
|
|||
|
* last line and then stop.
|
|||
|
*/display(){if(this.displayedComplete)return;let e=this.segmentOffset+this.receivedBytes,t=(100*(e/this.contentLength)).toFixed(1),r=Date.now()-this.startTime,i=(e/1048576/(r/1e3)).toFixed(1);o.info(`Received ${e} of ${this.contentLength} (${t}%), ${i} MBs/sec`),this.isDone()&&(this.displayedComplete=!0);}/**
|
|||
|
* Returns a function used to handle TransferProgressEvents.
|
|||
|
*/onProgress(){return e=>{this.setReceivedBytes(e.loadedBytes);};}/**
|
|||
|
* Starts the timer that displays the stats.
|
|||
|
*
|
|||
|
* @param delayInMs the delay between each write
|
|||
|
*/startDisplayTimer(e=1e3){let t=()=>{this.display(),this.isDone()||(this.timeoutHandle=setTimeout(t,e));};this.timeoutHandle=setTimeout(t,e);}/**
|
|||
|
* Stops the timer that displays the stats. As this typically indicates the download
|
|||
|
* is complete, this will display one last line, unless the last line has already
|
|||
|
* been written.
|
|||
|
*/stopDisplayTimer(){this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=void 0),this.display();}}/**
|
|||
|
* Download the cache using the Actions toolkit http-client
|
|||
|
*
|
|||
|
* @param archiveLocation the URL for the cache
|
|||
|
* @param archivePath the local path where the cache is saved
|
|||
|
*/function y(e,t){return n(this,void 0,void 0,function*(){let r=l.createWriteStream(t),i=new s.HttpClient("actions/cache"),a=yield(0,x.retryHttpClientResponse)("downloadCache",()=>n(this,void 0,void 0,function*(){return i.get(e);}));// Abort download if no traffic received over the socket.
|
|||
|
a.message.socket.setTimeout(h.SocketTimeout,()=>{a.message.destroy(),o.debug(`Aborting download, socket timed out after ${h.SocketTimeout} ms`);}),yield g(a,r);// Validate download size.
|
|||
|
let u=a.message.headers["content-length"];if(u){let e=parseInt(u),r=m.getArchiveFileSizeInBytes(t);if(r!==e)throw Error(`Incomplete download. Expected file size: ${e}, actual file size: ${r}`);}else o.debug("Unable to validate download, no Content-Length header");});}/**
|
|||
|
* Download the cache using the Actions toolkit http-client concurrently
|
|||
|
*
|
|||
|
* @param archiveLocation the URL for the cache
|
|||
|
* @param archivePath the local path where the cache is saved
|
|||
|
*/function b(e,t,r){var i;return n(this,void 0,void 0,function*(){let a=yield l.promises.open(t,"w"),o=new s.HttpClient("actions/cache",void 0,{socketTimeout:r.timeoutInMs,keepAlive:!0});try{let t;let s=yield(0,x.retryHttpClientResponse)("downloadCacheMetadata",()=>n(this,void 0,void 0,function*(){return yield o.request("HEAD",e,null,{});})),u=s.message.headers["content-length"];if(null==u)throw Error("Content-Length not found on blob response");let c=parseInt(u);if(Number.isNaN(c))throw Error(`Could not interpret Content-Length: ${c}`);let l=[],p=4194304;for(let t=0;t<c;t+=p){let r=Math.min(p,c-t);l.push({offset:t,promiseGetter:()=>n(this,void 0,void 0,function*(){return yield v(o,e,t,r);})});}// reverse to use .pop instead of .shift
|
|||
|
l.reverse();let d=0,m=0,h=new D(c);h.startDisplayTimer();let f=h.onProgress(),g=[],y=()=>n(this,void 0,void 0,function*(){let e=yield Promise.race(Object.values(g));yield a.write(e.buffer,0,e.count,e.offset),d--,delete g[e.offset],m+=e.count,f({loadedBytes:m});});for(;t=l.pop();)g[t.offset]=t.promiseGetter(),++d>=(null!==(i=r.downloadConcurrency)&&void 0!==i?i:10)&&(yield y());for(;d>0;)yield y();}finally{o.dispose(),yield a.close();}});}function v(e,t,r,i){return n(this,void 0,void 0,function*(){let a=5,n=0;for(;;)try{let a=3e4,n=yield A(a,C(e,t,r,i));if("string"==typeof n)throw Error("downloadSegmentRetry failed due to timeout");return n;}catch(e){if(n>=a)throw e;n++;}});}function C(e,t,r,i){return n(this,void 0,void 0,function*(){let a=yield(0,x.retryHttpClientResponse)("downloadCachePart",()=>n(this,void 0,void 0,function*(){return yield e.get(t,{Range:`bytes=${r}-${r+i-1}`});}));if(!a.readBodyBuffer)throw Error("Expected HttpClientResponse to implement readBodyBuffer");return{offset:r,count:i,buffer:yield a.readBodyBuffer()};});}/**
|
|||
|
* Download the cache using the Azure Storage SDK. Only call this method if the
|
|||
|
* URL points to an Azure Storage endpoint.
|
|||
|
*
|
|||
|
* @param archiveLocation the URL for the cache
|
|||
|
* @param archivePath the local path where the cache is saved
|
|||
|
* @param options the download options with the defaults set
|
|||
|
*/function E(e,t,r){var i;return n(this,void 0,void 0,function*(){let a=new u.BlockBlobClient(e,void 0,{retryOptions:{// Override the timeout used when downloading each 4 MB chunk
|
|||
|
// The default is 2 min / MB, which is way too slow
|
|||
|
tryTimeoutInMs:r.timeoutInMs}}),n=yield a.getProperties(),s=null!==(i=n.contentLength)&&void 0!==i?i:-1;if(s<0)// We should never hit this condition, but just in case fall back to downloading the
|
|||
|
// file as one large stream
|
|||
|
o.debug("Unable to determine content length, downloading file with http-client..."),yield y(e,t);else{// Use downloadToBuffer for faster downloads, since internally it splits the
|
|||
|
// file into 4 MB chunks which can then be parallelized and retried independently
|
|||
|
//
|
|||
|
// If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
|
|||
|
// on 64-bit systems), split the download into multiple segments
|
|||
|
// ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
|
|||
|
// Updated segment size to 128MB = 134217728 bytes, to complete a segment faster and fail fast
|
|||
|
let e=Math.min(134217728,c.constants.MAX_LENGTH),i=new D(s),n=l.openSync(t,"w");try{i.startDisplayTimer();let t=new f.AbortController(),o=t.signal;for(;!i.isDone();){let u=i.segmentOffset+i.segmentSize,c=Math.min(e,s-u);i.nextSegment(c);let p=yield A(r.segmentTimeoutInMs||36e5,a.downloadToBuffer(u,c,{abortSignal:o,concurrency:r.downloadConcurrency,onProgress:i.onProgress()}));if("timeout"===p)throw t.abort(),Error("Aborting cache download as the download time exceeded the timeout.");Buffer.isBuffer(p)&&l.writeFileSync(n,p);}}finally{i.stopDisplayTimer(),l.closeSync(n);}}});}e.exports.DownloadProgress=D,e.exports.downloadCacheHttpClient=y,e.exports.downloadCacheHttpClientConcurrent=b,e.exports.downloadCacheStorageSDK=E;let A=(e,t)=>n(void 0,void 0,void 0,function*(){let r;let i=new Promise(t=>{r=setTimeout(()=>t("timeout"),e);});return Promise.race([t,i]).then(e=>(clearTimeout(r),e));});}),parcelRequire.register("i0GGG",function(e,t){$parcel$export(e.exports,"BlockBlobClient",()=>R);var r=parcelRequire("9uR57"),i=parcelRequire("lrZDM"),a=parcelRequire("4PgmQ"),n=parcelRequire("1Vc6S"),o=parcelRequire("18oFr"),s=parcelRequire("8sP3n"),u=parcelRequire("2hiFM"),c=parcelRequire("3PTyM"),l=parcelRequire("fJtif"),p=parcelRequire("lncUR"),d=parcelRequire("cLpTG"),m=parcelRequire("4F713"),h=parcelRequire("arn1t"),x=parcelRequire("akPaM"),f=parcelRequire("fkxlr"),g=parcelRequire("aP5Z2"),D=parcelRequire("cayn8"),y=parcelRequire("gYUwj"),b=parcelRequire("2v8Hg"),v=parcelRequire("8PMUt"),C=parcelRequire("fqjk5"),E=parcelRequire("iokdY"),A=parcelRequire("bpW3y"),S=parcelRequire("5MFjo"),B=parcelRequire("gXPSw"),N=parcelRequire("e7JkV"),F=parcelRequire("1kLfv"),w=parcelRequire("1lqbk"),P=parcelRequire("3f6jw");class T extends C.StorageClient{constructor(e,t,r,/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/o){let s,u;if(o=o||{},(0,y.isPipelineLike)(t))// (url: string, pipeline: Pipeline)
|
|||
|
u=e,s=t;else if(i.isNode&&t instanceof d.StorageSharedKeyCredential||t instanceof p.AnonymousCredential||(0,a.isTokenCredential)(t))// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|||
|
u=e,o=r,s=(0,y.newPipeline)(t,o);else if(t||"string"==typeof t){if(t&&"string"==typeof t&&r&&"string"==typeof r){// (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
|
|||
|
let a=t,c=r,l=(0,N.extractConnectionStringParts)(e);if("AccountConnString"===l.kind){if(i.isNode){let e=new d.StorageSharedKeyCredential(l.accountName,l.accountKey);u=(0,N.appendToURLPath)((0,N.appendToURLPath)(l.url,encodeURIComponent(a)),encodeURIComponent(c)),o.proxyOptions||(o.proxyOptions=(0,n.getDefaultProxySettings)(l.proxyUri)),s=(0,y.newPipeline)(e,o);}else throw Error("Account connection string is only supported in Node.js environment");}else if("SASConnString"===l.kind)u=(0,N.appendToURLPath)((0,N.appendToURLPath)(l.url,encodeURIComponent(a)),encodeURIComponent(c))+"?"+l.accountSas,s=(0,y.newPipeline)(new p.AnonymousCredential(),o);else throw Error("Connection string must be either an Account connection string or a SAS connection string");}else throw Error("Expecting non-empty strings for containerName and blobName parameters");}else// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|||
|
// The second parameter is undefined. Use anonymous credential.
|
|||
|
u=e,r&&"string"!=typeof r&&(o=r),s=(0,y.newPipeline)(new p.AnonymousCredential(),o);super(u,s),({blobName:this._name,containerName:this._containerName}=this.getBlobAndContainerNamesFromUrl()),this.blobContext=new m.Blob(this.storageClientContext),this._snapshot=(0,N.getURLParameter)(this.url,S.URLConstants.Parameters.SNAPSHOT),this._versionId=(0,N.getURLParameter)(this.url,S.URLConstants.Parameters.VERSIONID);}/**
|
|||
|
* The name of the blob.
|
|||
|
*/get name(){return this._name;}/**
|
|||
|
* The name of the storage container the blob is associated with.
|
|||
|
*/get containerName(){return this._containerName;}/**
|
|||
|
* Creates a new BlobClient object identical to the source but with the specified snapshot timestamp.
|
|||
|
* Provide "" will remove the snapshot and return a Client to the base blob.
|
|||
|
*
|
|||
|
* @param snapshot - The snapshot timestamp.
|
|||
|
* @returns A new BlobClient object identical to the source but with the specified snapshot timestamp
|
|||
|
*/withSnapshot(e){return new T((0,N.setURLParameter)(this.url,S.URLConstants.Parameters.SNAPSHOT,0===e.length?void 0:e),this.pipeline);}/**
|
|||
|
* Creates a new BlobClient object pointing to a version of this blob.
|
|||
|
* Provide "" will remove the versionId and return a Client to the base blob.
|
|||
|
*
|
|||
|
* @param versionId - The versionId.
|
|||
|
* @returns A new BlobClient object pointing to the version of this blob.
|
|||
|
*/withVersion(e){return new T((0,N.setURLParameter)(this.url,S.URLConstants.Parameters.VERSIONID,0===e.length?void 0:e),this.pipeline);}/**
|
|||
|
* Creates a AppendBlobClient object.
|
|||
|
*
|
|||
|
*/getAppendBlobClient(){return new O(this.url,this.pipeline);}/**
|
|||
|
* Creates a BlockBlobClient object.
|
|||
|
*
|
|||
|
*/getBlockBlobClient(){return new R(this.url,this.pipeline);}/**
|
|||
|
* Creates a PageBlobClient object.
|
|||
|
*
|
|||
|
*/getPageBlobClient(){return new I(this.url,this.pipeline);}/**
|
|||
|
* Reads or downloads a blob from the system, including its metadata and properties.
|
|||
|
* You can also call Get Blob to read a snapshot.
|
|||
|
*
|
|||
|
* * In Node.js, data returns in a Readable stream readableStreamBody
|
|||
|
* * In browsers, data returns in a promise blobBody
|
|||
|
*
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob
|
|||
|
*
|
|||
|
* @param offset - From which position of the blob to download, greater than or equal to 0
|
|||
|
* @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined
|
|||
|
* @param options - Optional options to Blob Download operation.
|
|||
|
*
|
|||
|
*
|
|||
|
* Example usage (Node.js):
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* // Download and convert a blob to a string
|
|||
|
* const downloadBlockBlobResponse = await blobClient.download();
|
|||
|
* const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody);
|
|||
|
* console.log("Downloaded blob content:", downloaded.toString());
|
|||
|
*
|
|||
|
* async function streamToBuffer(readableStream) {
|
|||
|
* return new Promise((resolve, reject) => {
|
|||
|
* const chunks = [];
|
|||
|
* readableStream.on("data", (data) => {
|
|||
|
* chunks.push(data instanceof Buffer ? data : Buffer.from(data));
|
|||
|
* });
|
|||
|
* readableStream.on("end", () => {
|
|||
|
* resolve(Buffer.concat(chunks));
|
|||
|
* });
|
|||
|
* readableStream.on("error", reject);
|
|||
|
* });
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Example usage (browser):
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* // Download and convert a blob to a string
|
|||
|
* const downloadBlockBlobResponse = await blobClient.download();
|
|||
|
* const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody);
|
|||
|
* console.log(
|
|||
|
* "Downloaded blob content",
|
|||
|
* downloaded
|
|||
|
* );
|
|||
|
*
|
|||
|
* async function blobToString(blob: Blob): Promise<string> {
|
|||
|
* const fileReader = new FileReader();
|
|||
|
* return new Promise<string>((resolve, reject) => {
|
|||
|
* fileReader.onloadend = (ev: any) => {
|
|||
|
* resolve(ev.target!.result);
|
|||
|
* };
|
|||
|
* fileReader.onerror = reject;
|
|||
|
* fileReader.readAsText(blob);
|
|||
|
* });
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*/async download(e=0,t,r={}){var a;r.conditions=r.conditions||{},r.conditions=r.conditions||{},(0,g.ensureCpkIfSpecified)(r.customerProvidedKey,this.isHttps);let{span:n,updatedOptions:o}=(0,B.createSpan)("BlobClient-download",r);try{let n=await this.blobContext.download(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:null===(a=r.conditions)||void 0===a?void 0:a.tagConditions}),requestOptions:{onDownloadProgress:i.isNode?void 0:r.onProgress},range:0!==e||t?(0,v.rangeToString)({offset:e,count:t}):void 0,rangeGetContentMD5:r.rangeGetContentMD5,rangeGetContentCRC64:r.rangeGetContentCrc64,snapshot:r.snapshot,cpkInfo:r.customerProvidedKey},(0,B.convertTracingToRequestOptionsBase)(o))),s=Object.assign(Object.assign({},n),{_response:n._response,objectReplicationDestinationPolicyId:n.objectReplicationPolicyId,objectReplicationSourceProperties:(0,N.parseObjectReplicationRecord)(n.objectReplicationRules)});// Return browser response immediately
|
|||
|
if(!i.isNode)return s;if((void 0===r.maxRetryRequests||r.maxRetryRequests<0)&&(r.maxRetryRequests=S.DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS),void 0===n.contentLength)throw RangeError("File download response doesn't contain valid content length header");if(!n.etag)throw RangeError("File download response doesn't contain valid etag header");return new c.BlobDownloadResponse(s,async t=>{var i;let a={leaseAccessConditions:r.conditions,modifiedAccessConditions:{ifMatch:r.conditions.ifMatch||n.etag,ifModifiedSince:r.conditions.ifModifiedSince,ifNoneMatch:r.conditions.ifNoneMatch,ifUnmodifiedSince:r.conditions.ifUnmodifiedSince,ifTags:null===(i=r.conditions)||void 0===i?void 0:i.tagConditions},range:(0,v.rangeToString)({count:e+n.contentLength-t,offset:t}),rangeGetContentMD5:r.rangeGetContentMD5,rangeGetContentCRC64:r.rangeGetContentCrc64,snapshot:r.snapshot,cpkInfo:r.customerProvidedKey};// Debug purpose only
|
|||
|
// console.log(
|
|||
|
// `Read from internal stream, range: ${
|
|||
|
// updatedOptions.range
|
|||
|
// }, options: ${JSON.stringify(updatedOptions)}`
|
|||
|
// );
|
|||
|
return(await this.blobContext.download(Object.assign({abortSignal:r.abortSignal},a))).readableStreamBody;},e,n.contentLength,{maxRetryRequests:r.maxRetryRequests,onProgress:r.onProgress});}catch(e){throw n.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{n.end();}}/**
|
|||
|
* Returns true if the Azure blob resource represented by this client exists; false otherwise.
|
|||
|
*
|
|||
|
* NOTE: use this function with care since an existing blob might be deleted by other clients or
|
|||
|
* applications. Vice versa new blobs might be added by other clients or applications after this
|
|||
|
* function completes.
|
|||
|
*
|
|||
|
* @param options - options to Exists operation.
|
|||
|
*/async exists(e={}){let{span:t,updatedOptions:r}=(0,B.createSpan)("BlobClient-exists",e);try{return(0,g.ensureCpkIfSpecified)(e.customerProvidedKey,this.isHttps),await this.getProperties({abortSignal:e.abortSignal,customerProvidedKey:e.customerProvidedKey,conditions:e.conditions,tracingOptions:r.tracingOptions}),!0;}catch(e){if(404===e.statusCode)return!1;if(409===e.statusCode&&(e.details.errorCode===S.BlobUsesCustomerSpecifiedEncryptionMsg||e.details.errorCode===S.BlobDoesNotUseCustomerSpecifiedEncryption))return!0;throw t.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{t.end();}}/**
|
|||
|
* Returns all user-defined metadata, standard HTTP properties, and system properties
|
|||
|
* for the blob. It does not return the content of the blob.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties
|
|||
|
*
|
|||
|
* WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if
|
|||
|
* they originally contained uppercase characters. This differs from the metadata keys returned by
|
|||
|
* the methods of {@link ContainerClient} that list blobs using the `includeMetadata` option, which
|
|||
|
* will retain their original casing.
|
|||
|
*
|
|||
|
* @param options - Optional options to Get Properties operation.
|
|||
|
*/async getProperties(e={}){var t;let{span:r,updatedOptions:i}=(0,B.createSpan)("BlobClient-getProperties",e);try{e.conditions=e.conditions||{},(0,g.ensureCpkIfSpecified)(e.customerProvidedKey,this.isHttps);let r=await this.blobContext.getProperties(Object.assign({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:null===(t=e.conditions)||void 0===t?void 0:t.tagConditions}),cpkInfo:e.customerProvidedKey},(0,B.convertTracingToRequestOptionsBase)(i)));return Object.assign(Object.assign({},r),{_response:r._response,objectReplicationDestinationPolicyId:r.objectReplicationPolicyId,objectReplicationSourceProperties:(0,N.parseObjectReplicationRecord)(r.objectReplicationRules)});}catch(e){throw r.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{r.end();}}/**
|
|||
|
* Marks the specified blob or snapshot for deletion. The blob is later deleted
|
|||
|
* during garbage collection. Note that in order to delete a blob, you must delete
|
|||
|
* all of its snapshots. You can delete both at the same time with the Delete
|
|||
|
* Blob operation.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob
|
|||
|
*
|
|||
|
* @param options - Optional options to Blob Delete operation.
|
|||
|
*/async delete(e={}){var t;let{span:r,updatedOptions:i}=(0,B.createSpan)("BlobClient-delete",e);e.conditions=e.conditions||{};try{return await this.blobContext.delete(Object.assign({abortSignal:e.abortSignal,deleteSnapshots:e.deleteSnapshots,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:null===(t=e.conditions)||void 0===t?void 0:t.tagConditions})},(0,B.convertTracingToRequestOptionsBase)(i)));}catch(e){throw r.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{r.end();}}/**
|
|||
|
* Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted
|
|||
|
* during garbage collection. Note that in order to delete a blob, you must delete
|
|||
|
* all of its snapshots. You can delete both at the same time with the Delete
|
|||
|
* Blob operation.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob
|
|||
|
*
|
|||
|
* @param options - Optional options to Blob Delete operation.
|
|||
|
*/async deleteIfExists(e={}){var t,r;let{span:i,updatedOptions:a}=(0,B.createSpan)("BlobClient-deleteIfExists",e);try{let e=await this.delete(a);return Object.assign(Object.assign({succeeded:!0},e),{_response:e._response});}catch(e){if((null===(t=e.details)||void 0===t?void 0:t.errorCode)==="BlobNotFound")return i.setStatus({code:u.SpanStatusCode.ERROR,message:"Expected exception when deleting a blob or snapshot only if it exists."}),Object.assign(Object.assign({succeeded:!1},null===(r=e.response)||void 0===r?void 0:r.parsedHeaders),{_response:e.response});throw i.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{i.end();}}/**
|
|||
|
* Restores the contents and metadata of soft deleted blob and any associated
|
|||
|
* soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29
|
|||
|
* or later.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob
|
|||
|
*
|
|||
|
* @param options - Optional options to Blob Undelete operation.
|
|||
|
*/async undelete(e={}){let{span:t,updatedOptions:r}=(0,B.createSpan)("BlobClient-undelete",e);try{return await this.blobContext.undelete(Object.assign({abortSignal:e.abortSignal},(0,B.convertTracingToRequestOptionsBase)(r)));}catch(e){throw t.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{t.end();}}/**
|
|||
|
* Sets system properties on the blob.
|
|||
|
*
|
|||
|
* If no value provided, or no value provided for the specified blob HTTP headers,
|
|||
|
* these blob HTTP headers without a value will be cleared.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties
|
|||
|
*
|
|||
|
* @param blobHTTPHeaders - If no value provided, or no value provided for
|
|||
|
* the specified blob HTTP headers, these blob HTTP
|
|||
|
* headers without a value will be cleared.
|
|||
|
* A common header to set is `blobContentType`
|
|||
|
* enabling the browser to provide functionality
|
|||
|
* based on file type.
|
|||
|
* @param options - Optional options to Blob Set HTTP Headers operation.
|
|||
|
*/async setHTTPHeaders(e,t={}){var r;let{span:i,updatedOptions:a}=(0,B.createSpan)("BlobClient-setHTTPHeaders",t);t.conditions=t.conditions||{};try{return(0,g.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps),await this.blobContext.setHttpHeaders(Object.assign({abortSignal:t.abortSignal,blobHttpHeaders:e,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions})},(0,B.convertTracingToRequestOptionsBase)(a)));}catch(e){throw i.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{i.end();}}/**
|
|||
|
* Sets user-defined metadata for the specified blob as one or more name-value pairs.
|
|||
|
*
|
|||
|
* If no option provided, or no metadata defined in the parameter, the blob
|
|||
|
* metadata will be removed.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata
|
|||
|
*
|
|||
|
* @param metadata - Replace existing metadata with this value.
|
|||
|
* If no value provided the existing metadata will be removed.
|
|||
|
* @param options - Optional options to Set Metadata operation.
|
|||
|
*/async setMetadata(e,t={}){var r;let{span:i,updatedOptions:a}=(0,B.createSpan)("BlobClient-setMetadata",t);t.conditions=t.conditions||{};try{return(0,g.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps),await this.blobContext.setMetadata(Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:e,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions}),cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope},(0,B.convertTracingToRequestOptionsBase)(a)));}catch(e){throw i.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{i.end();}}/**
|
|||
|
* Sets tags on the underlying blob.
|
|||
|
* A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters.
|
|||
|
* Valid tag key and value characters include lower and upper case letters, digits (0-9),
|
|||
|
* space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_').
|
|||
|
*
|
|||
|
* @param tags -
|
|||
|
* @param options -
|
|||
|
*/async setTags(e,t={}){var r;let{span:i,updatedOptions:a}=(0,B.createSpan)("BlobClient-setTags",t);try{return await this.blobContext.setTags(Object.assign(Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions})},(0,B.convertTracingToRequestOptionsBase)(a)),{tags:(0,N.toBlobTags)(e)}));}catch(e){throw i.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{i.end();}}/**
|
|||
|
* Gets the tags associated with the underlying blob.
|
|||
|
*
|
|||
|
* @param options -
|
|||
|
*/async getTags(e={}){var t;let{span:r,updatedOptions:i}=(0,B.createSpan)("BlobClient-getTags",e);try{let r=await this.blobContext.getTags(Object.assign({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:null===(t=e.conditions)||void 0===t?void 0:t.tagConditions})},(0,B.convertTracingToRequestOptionsBase)(i))),a=Object.assign(Object.assign({},r),{_response:r._response,tags:(0,N.toTags)({blobTagSet:r.blobTagSet})||{}});return a;}catch(e){throw r.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{r.end();}}/**
|
|||
|
* Get a {@link BlobLeaseClient} that manages leases on the blob.
|
|||
|
*
|
|||
|
* @param proposeLeaseId - Initial proposed lease Id.
|
|||
|
* @returns A new BlobLeaseClient object for managing leases on the blob.
|
|||
|
*/getBlobLeaseClient(e){return new P.BlobLeaseClient(this,e);}/**
|
|||
|
* Creates a read-only snapshot of a blob.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob
|
|||
|
*
|
|||
|
* @param options - Optional options to the Blob Create Snapshot operation.
|
|||
|
*/async createSnapshot(e={}){var t;let{span:r,updatedOptions:i}=(0,B.createSpan)("BlobClient-createSnapshot",e);e.conditions=e.conditions||{};try{return(0,g.ensureCpkIfSpecified)(e.customerProvidedKey,this.isHttps),await this.blobContext.createSnapshot(Object.assign({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:null===(t=e.conditions)||void 0===t?void 0:t.tagConditions}),cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope},(0,B.convertTracingToRequestOptionsBase)(i)));}catch(e){throw r.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{r.end();}}/**
|
|||
|
* Asynchronously copies a blob to a destination within the storage account.
|
|||
|
* This method returns a long running operation poller that allows you to wait
|
|||
|
* indefinitely until the copy is completed.
|
|||
|
* You can also cancel a copy before it is completed by calling `cancelOperation` on the poller.
|
|||
|
* Note that the onProgress callback will not be invoked if the operation completes in the first
|
|||
|
* request, and attempting to cancel a completed copy will result in an error being thrown.
|
|||
|
*
|
|||
|
* In version 2012-02-12 and later, the source for a Copy Blob operation can be
|
|||
|
* a committed blob in any Azure storage account.
|
|||
|
* Beginning with version 2015-02-21, the source for a Copy Blob operation can be
|
|||
|
* an Azure file in any Azure storage account.
|
|||
|
* Only storage accounts created on or after June 7th, 2012 allow the Copy Blob
|
|||
|
* operation to copy from another storage account.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob
|
|||
|
*
|
|||
|
* Example using automatic polling:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* const copyPoller = await blobClient.beginCopyFromURL('url');
|
|||
|
* const result = await copyPoller.pollUntilDone();
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Example using manual polling:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* const copyPoller = await blobClient.beginCopyFromURL('url');
|
|||
|
* while (!poller.isDone()) {
|
|||
|
* await poller.poll();
|
|||
|
* }
|
|||
|
* const result = copyPoller.getResult();
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Example using progress updates:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* const copyPoller = await blobClient.beginCopyFromURL('url', {
|
|||
|
* onProgress(state) {
|
|||
|
* console.log(`Progress: ${state.copyProgress}`);
|
|||
|
* }
|
|||
|
* });
|
|||
|
* const result = await copyPoller.pollUntilDone();
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Example using a changing polling interval (default 15 seconds):
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* const copyPoller = await blobClient.beginCopyFromURL('url', {
|
|||
|
* intervalInMs: 1000 // poll blob every 1 second for copy progress
|
|||
|
* });
|
|||
|
* const result = await copyPoller.pollUntilDone();
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Example using copy cancellation:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* const copyPoller = await blobClient.beginCopyFromURL('url');
|
|||
|
* // cancel operation after starting it.
|
|||
|
* try {
|
|||
|
* await copyPoller.cancelOperation();
|
|||
|
* // calls to get the result now throw PollerCancelledError
|
|||
|
* await copyPoller.getResult();
|
|||
|
* } catch (err) {
|
|||
|
* if (err.name === 'PollerCancelledError') {
|
|||
|
* console.log('The copy was cancelled.');
|
|||
|
* }
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* @param copySource - url to the source Azure Blob/File.
|
|||
|
* @param options - Optional options to the Blob Start Copy From URL operation.
|
|||
|
*/async beginCopyFromURL(e,t={}){let r={abortCopyFromURL:(...e)=>this.abortCopyFromURL(...e),getProperties:(...e)=>this.getProperties(...e),startCopyFromURL:(...e)=>this.startCopyFromURL(...e)},i=new b.BlobBeginCopyFromUrlPoller({blobClient:r,copySource:e,intervalInMs:t.intervalInMs,onProgress:t.onProgress,resumeFrom:t.resumeFrom,startCopyFromURLOptions:t});return(// Trigger the startCopyFromURL call by calling poll.
|
|||
|
// Any errors from this method should be surfaced to the user.
|
|||
|
await i.poll(),i);}/**
|
|||
|
* Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero
|
|||
|
* length and full metadata. Version 2012-02-12 and newer.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob
|
|||
|
*
|
|||
|
* @param copyId - Id of the Copy From URL operation.
|
|||
|
* @param options - Optional options to the Blob Abort Copy From URL operation.
|
|||
|
*/async abortCopyFromURL(e,t={}){let{span:r,updatedOptions:i}=(0,B.createSpan)("BlobClient-abortCopyFromURL",t);try{return await this.blobContext.abortCopyFromURL(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions},(0,B.convertTracingToRequestOptionsBase)(i)));}catch(e){throw r.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{r.end();}}/**
|
|||
|
* The synchronous Copy From URL operation copies a blob or an internet resource to a new blob. It will not
|
|||
|
* return a response until the copy is complete.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url
|
|||
|
*
|
|||
|
* @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication
|
|||
|
* @param options -
|
|||
|
*/async syncCopyFromURL(e,t={}){var r,i,a;let{span:n,updatedOptions:o}=(0,B.createSpan)("BlobClient-syncCopyFromURL",t);t.conditions=t.conditions||{},t.sourceConditions=t.sourceConditions||{};try{return await this.blobContext.copyFromURL(e,Object.assign({abortSignal:t.abortSignal,metadata:t.metadata,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions.ifMatch,sourceIfModifiedSince:t.sourceConditions.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions.ifUnmodifiedSince},sourceContentMD5:t.sourceContentMD5,copySourceAuthorization:(0,N.httpAuthorizationToString)(t.sourceAuthorization),tier:(0,g.toAccessTier)(t.tier),blobTagsString:(0,N.toBlobTagsString)(t.tags),immutabilityPolicyExpiry:null===(i=t.immutabilityPolicy)||void 0===i?void 0:i.expiriesOn,immutabilityPolicyMode:null===(a=t.immutabilityPolicy)||void 0===a?void 0:a.policyMode,legalHold:t.legalHold,encryptionScope:t.encryptionScope,copySourceTags:t.copySourceTags},(0,B.convertTracingToRequestOptionsBase)(o)));}catch(e){throw n.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{n.end();}}/**
|
|||
|
* Sets the tier on a blob. The operation is allowed on a page blob in a premium
|
|||
|
* storage account and on a block blob in a blob storage account (locally redundant
|
|||
|
* storage only). A premium page blob's tier determines the allowed size, IOPS,
|
|||
|
* and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive
|
|||
|
* storage type. This operation does not update the blob's ETag.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier
|
|||
|
*
|
|||
|
* @param tier - The tier to be set on the blob. Valid values are Hot, Cool, or Archive.
|
|||
|
* @param options - Optional options to the Blob Set Tier operation.
|
|||
|
*/async setAccessTier(e,t={}){var r;let{span:i,updatedOptions:a}=(0,B.createSpan)("BlobClient-setAccessTier",t);try{return await this.blobContext.setTier((0,g.toAccessTier)(e),Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions}),rehydratePriority:t.rehydratePriority},(0,B.convertTracingToRequestOptionsBase)(a)));}catch(e){throw i.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{i.end();}}async downloadToBuffer(e,t,r,i={}){let a;let n=0,o=0,s=i;e instanceof Buffer?(a=e,n=t||0,o="number"==typeof r?r:0):(n="number"==typeof e?e:0,o="number"==typeof t?t:0,s=r||{});let{span:c,updatedOptions:l}=(0,B.createSpan)("BlobClient-downloadToBuffer",s);try{if(s.blockSize||(s.blockSize=0),s.blockSize<0)throw RangeError("blockSize option must be >= 0");if(0===s.blockSize&&(s.blockSize=S.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES),n<0)throw RangeError("offset option must be >= 0");if(o&&o<=0)throw RangeError("count option must be greater than 0");// Customer doesn't specify length, get it
|
|||
|
if(s.conditions||(s.conditions={}),!o){let e=await this.getProperties(Object.assign(Object.assign({},s),{tracingOptions:Object.assign(Object.assign({},s.tracingOptions),(0,B.convertTracingToRequestOptionsBase)(l))}));if((o=e.contentLength-n)<0)throw RangeError(`offset ${n} shouldn't be larger than blob size ${e.contentLength}`);}// Allocate the buffer of size = count if the buffer is not provided
|
|||
|
if(!a)try{a=Buffer.alloc(o);}catch(e){throw Error(`Unable to allocate the buffer of size: ${o}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile". ${e.message}`);}if(a.length<o)throw RangeError(`The buffer's size should be equal to or larger than the request count of bytes: ${o}`);let e=0,t=new E.Batch(s.concurrency);for(let r=n;r<n+o;r+=s.blockSize)t.addOperation(async()=>{// Exclusive chunk end position
|
|||
|
let t=n+o;r+s.blockSize<t&&(t=r+s.blockSize);let i=await this.download(r,t-r,{abortSignal:s.abortSignal,conditions:s.conditions,maxRetryRequests:s.maxRetryRequestsPerBlock,customerProvidedKey:s.customerProvidedKey,tracingOptions:Object.assign(Object.assign({},s.tracingOptions),(0,B.convertTracingToRequestOptionsBase)(l))}),u=i.readableStreamBody;await(0,F.streamToBuffer)(u,a,r-n,t-n),// Update progress after block is downloaded, in case of block trying
|
|||
|
// Could provide finer grained progress updating inside HTTP requests,
|
|||
|
// only if convenience layer download try is enabled
|
|||
|
e+=t-r,s.onProgress&&s.onProgress({loadedBytes:e});});return await t.do(),a;}catch(e){throw c.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{c.end();}}/**
|
|||
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|||
|
*
|
|||
|
* Downloads an Azure Blob to a local file.
|
|||
|
* Fails if the the given file path already exits.
|
|||
|
* Offset and count are optional, pass 0 and undefined respectively to download the entire blob.
|
|||
|
*
|
|||
|
* @param filePath -
|
|||
|
* @param offset - From which position of the block blob to download.
|
|||
|
* @param count - How much data to be downloaded. Will download to the end when passing undefined.
|
|||
|
* @param options - Options to Blob download options.
|
|||
|
* @returns The response data for blob download operation,
|
|||
|
* but with readableStreamBody set to undefined since its
|
|||
|
* content is already read and written into a local file
|
|||
|
* at the specified path.
|
|||
|
*/async downloadToFile(e,t=0,r,i={}){let{span:a,updatedOptions:n}=(0,B.createSpan)("BlobClient-downloadToFile",i);try{let a=await this.download(t,r,Object.assign(Object.assign({},i),{tracingOptions:Object.assign(Object.assign({},i.tracingOptions),(0,B.convertTracingToRequestOptionsBase)(n))}));return a.readableStreamBody&&(await(0,F.readStreamToLocalFile)(a.readableStreamBody,e)),// The stream is no longer accessible so setting it to undefined.
|
|||
|
a.blobDownloadStream=void 0,a;}catch(e){throw a.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{a.end();}}getBlobAndContainerNamesFromUrl(){let e,t;try{// URL may look like the following
|
|||
|
// "https://myaccount.blob.core.windows.net/mycontainer/blob?sasString";
|
|||
|
// "https://myaccount.blob.core.windows.net/mycontainer/blob";
|
|||
|
// "https://myaccount.blob.core.windows.net/mycontainer/blob/a.txt?sasString";
|
|||
|
// "https://myaccount.blob.core.windows.net/mycontainer/blob/a.txt";
|
|||
|
// IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10000/devstoreaccount1/containername/blob`
|
|||
|
// http://localhost:10001/devstoreaccount1/containername/blob
|
|||
|
let r=(0,o.URLBuilder).parse(this.url);if("blob"===r.getHost().split(".")[1]){// "https://myaccount.blob.core.windows.net/containername/blob".
|
|||
|
// .getPath() -> /containername/blob
|
|||
|
let i=r.getPath().match("/([^/]*)(/(.*))?");e=i[1],t=i[3];}else if((0,N.isIpEndpointStyle)(r)){// IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername/blob
|
|||
|
// Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername/blob
|
|||
|
// .getPath() -> /devstoreaccount1/containername/blob
|
|||
|
let i=r.getPath().match("/([^/]*)/([^/]*)(/(.*))?");e=i[2],t=i[4];}else{// "https://customdomain.com/containername/blob".
|
|||
|
// .getPath() -> /containername/blob
|
|||
|
let i=r.getPath().match("/([^/]*)(/(.*))?");e=i[1],t=i[3];}if(// decode the encoded blobName, containerName - to get all the special characters that might be present in them
|
|||
|
e=decodeURIComponent(e),// Azure Storage Server will replace "\" with "/" in the blob names
|
|||
|
// doing the same in the SDK side so that the user doesn't have to replace "\" instances in the blobName
|
|||
|
t=(t=decodeURIComponent(t)).replace(/\\/g,"/"),!e)throw Error("Provided containerName is invalid.");return{blobName:t,containerName:e};}catch(e){throw Error("Unable to extract blobName and containerName with provided information.");}}/**
|
|||
|
* Asynchronously copies a blob to a destination within the storage account.
|
|||
|
* In version 2012-02-12 and later, the source for a Copy Blob operation can be
|
|||
|
* a committed blob in any Azure storage account.
|
|||
|
* Beginning with version 2015-02-21, the source for a Copy Blob operation can be
|
|||
|
* an Azure file in any Azure storage account.
|
|||
|
* Only storage accounts created on or after June 7th, 2012 allow the Copy Blob
|
|||
|
* operation to copy from another storage account.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob
|
|||
|
*
|
|||
|
* @param copySource - url to the source Azure Blob/File.
|
|||
|
* @param options - Optional options to the Blob Start Copy From URL operation.
|
|||
|
*/async startCopyFromURL(e,t={}){var r,i,a;let{span:n,updatedOptions:o}=(0,B.createSpan)("BlobClient-startCopyFromURL",t);t.conditions=t.conditions||{},t.sourceConditions=t.sourceConditions||{};try{return await this.blobContext.startCopyFromURL(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions.ifMatch,sourceIfModifiedSince:t.sourceConditions.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions.ifUnmodifiedSince,sourceIfTags:t.sourceConditions.tagConditions},immutabilityPolicyExpiry:null===(i=t.immutabilityPolicy)||void 0===i?void 0:i.expiriesOn,immutabilityPolicyMode:null===(a=t.immutabilityPolicy)||void 0===a?void 0:a.policyMode,legalHold:t.legalHold,rehydratePriority:t.rehydratePriority,tier:(0,g.toAccessTier)(t.tier),blobTagsString:(0,N.toBlobTagsString)(t.tags),sealBlob:t.sealBlob},(0,B.convertTracingToRequestOptionsBase)(o)));}catch(e){throw n.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{n.end();}}/**
|
|||
|
* Only available for BlobClient constructed with a shared key credential.
|
|||
|
*
|
|||
|
* Generates a Blob Service Shared Access Signature (SAS) URI based on the client properties
|
|||
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|||
|
*
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
|
|||
|
*
|
|||
|
* @param options - Optional parameters.
|
|||
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|||
|
*/generateSasUrl(e){return new Promise(t=>{if(!(this.credential instanceof d.StorageSharedKeyCredential))throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");let r=(0,w.generateBlobSASQueryParameters)(Object.assign({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId},e),this.credential).toString();t((0,N.appendToURLQuery)(this.url,r));});}/**
|
|||
|
* Delete the immutablility policy on the blob.
|
|||
|
*
|
|||
|
* @param options - Optional options to delete immutability policy on the blob.
|
|||
|
*/async deleteImmutabilityPolicy(e){let{span:t,updatedOptions:r}=(0,B.createSpan)("BlobClient-deleteImmutabilityPolicy",e);try{return await this.blobContext.deleteImmutabilityPolicy(Object.assign({abortSignal:null==e?void 0:e.abortSignal},(0,B.convertTracingToRequestOptionsBase)(r)));}catch(e){throw t.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{t.end();}}/**
|
|||
|
* Set immutablility policy on the blob.
|
|||
|
*
|
|||
|
* @param options - Optional options to set immutability policy on the blob.
|
|||
|
*/async setImmutabilityPolicy(e,t){let{span:r,updatedOptions:i}=(0,B.createSpan)("BlobClient-setImmutabilityPolicy",t);try{return await this.blobContext.setImmutabilityPolicy(Object.assign({abortSignal:null==t?void 0:t.abortSignal,immutabilityPolicyExpiry:e.expiriesOn,immutabilityPolicyMode:e.policyMode,modifiedAccessConditions:null==t?void 0:t.modifiedAccessCondition},(0,B.convertTracingToRequestOptionsBase)(i)));}catch(e){throw r.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{r.end();}}/**
|
|||
|
* Set legal hold on the blob.
|
|||
|
*
|
|||
|
* @param options - Optional options to set legal hold on the blob.
|
|||
|
*/async setLegalHold(e,t){let{span:r,updatedOptions:i}=(0,B.createSpan)("BlobClient-setLegalHold",t);try{return await this.blobContext.setLegalHold(e,Object.assign({abortSignal:null==t?void 0:t.abortSignal},(0,B.convertTracingToRequestOptionsBase)(i)));}catch(e){throw r.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{r.end();}}}class O extends T{constructor(e,t,r,/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/o){// In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
|
|||
|
// super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
|
|||
|
let s,u;if(o=o||{},(0,y.isPipelineLike)(t))// (url: string, pipeline: Pipeline)
|
|||
|
u=e,s=t;else if(i.isNode&&t instanceof d.StorageSharedKeyCredential||t instanceof p.AnonymousCredential||(0,a.isTokenCredential)(t))// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) url = urlOrConnectionString;
|
|||
|
u=e,o=r,s=(0,y.newPipeline)(t,o);else if(t||"string"==typeof t){if(t&&"string"==typeof t&&r&&"string"==typeof r){// (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
|
|||
|
let a=t,c=r,l=(0,N.extractConnectionStringParts)(e);if("AccountConnString"===l.kind){if(i.isNode){let e=new d.StorageSharedKeyCredential(l.accountName,l.accountKey);u=(0,N.appendToURLPath)((0,N.appendToURLPath)(l.url,encodeURIComponent(a)),encodeURIComponent(c)),o.proxyOptions||(o.proxyOptions=(0,n.getDefaultProxySettings)(l.proxyUri)),s=(0,y.newPipeline)(e,o);}else throw Error("Account connection string is only supported in Node.js environment");}else if("SASConnString"===l.kind)u=(0,N.appendToURLPath)((0,N.appendToURLPath)(l.url,encodeURIComponent(a)),encodeURIComponent(c))+"?"+l.accountSas,s=(0,y.newPipeline)(new p.AnonymousCredential(),o);else throw Error("Connection string must be either an Account connection string or a SAS connection string");}else throw Error("Expecting non-empty strings for containerName and blobName parameters");}else// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|||
|
u=e,// The second parameter is undefined. Use anonymous credential.
|
|||
|
s=(0,y.newPipeline)(new p.AnonymousCredential(),o);super(u,s),this.appendBlobContext=new h.AppendBlob(this.storageClientContext);}/**
|
|||
|
* Creates a new AppendBlobClient object identical to the source but with the
|
|||
|
* specified snapshot timestamp.
|
|||
|
* Provide "" will remove the snapshot and return a Client to the base blob.
|
|||
|
*
|
|||
|
* @param snapshot - The snapshot timestamp.
|
|||
|
* @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp.
|
|||
|
*/withSnapshot(e){return new O((0,N.setURLParameter)(this.url,S.URLConstants.Parameters.SNAPSHOT,0===e.length?void 0:e),this.pipeline);}/**
|
|||
|
* Creates a 0-length append blob. Call AppendBlock to append data to an append blob.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/put-blob
|
|||
|
*
|
|||
|
* @param options - Options to the Append Block Create operation.
|
|||
|
*
|
|||
|
*
|
|||
|
* Example usage:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* const appendBlobClient = containerClient.getAppendBlobClient("<blob name>");
|
|||
|
* await appendBlobClient.create();
|
|||
|
* ```
|
|||
|
*/async create(e={}){var t,r,i;let{span:a,updatedOptions:n}=(0,B.createSpan)("AppendBlobClient-create",e);e.conditions=e.conditions||{};try{return(0,g.ensureCpkIfSpecified)(e.customerProvidedKey,this.isHttps),await this.appendBlobContext.create(0,Object.assign({abortSignal:e.abortSignal,blobHttpHeaders:e.blobHTTPHeaders,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:null===(t=e.conditions)||void 0===t?void 0:t.tagConditions}),cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope,immutabilityPolicyExpiry:null===(r=e.immutabilityPolicy)||void 0===r?void 0:r.expiriesOn,immutabilityPolicyMode:null===(i=e.immutabilityPolicy)||void 0===i?void 0:i.policyMode,legalHold:e.legalHold,blobTagsString:(0,N.toBlobTagsString)(e.tags)},(0,B.convertTracingToRequestOptionsBase)(n)));}catch(e){throw a.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{a.end();}}/**
|
|||
|
* Creates a 0-length append blob. Call AppendBlock to append data to an append blob.
|
|||
|
* If the blob with the same name already exists, the content of the existing blob will remain unchanged.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/put-blob
|
|||
|
*
|
|||
|
* @param options -
|
|||
|
*/async createIfNotExists(e={}){var t,r;let{span:i,updatedOptions:a}=(0,B.createSpan)("AppendBlobClient-createIfNotExists",e),n={ifNoneMatch:S.ETagAny};try{let e=await this.create(Object.assign(Object.assign({},a),{conditions:n}));return Object.assign(Object.assign({succeeded:!0},e),{_response:e._response});}catch(e){if((null===(t=e.details)||void 0===t?void 0:t.errorCode)==="BlobAlreadyExists")return i.setStatus({code:u.SpanStatusCode.ERROR,message:"Expected exception when creating a blob only if it does not already exist."}),Object.assign(Object.assign({succeeded:!1},null===(r=e.response)||void 0===r?void 0:r.parsedHeaders),{_response:e.response});throw i.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{i.end();}}/**
|
|||
|
* Seals the append blob, making it read only.
|
|||
|
*
|
|||
|
* @param options -
|
|||
|
*/async seal(e={}){var t;let{span:r,updatedOptions:i}=(0,B.createSpan)("AppendBlobClient-seal",e);e.conditions=e.conditions||{};try{return await this.appendBlobContext.seal(Object.assign({abortSignal:e.abortSignal,appendPositionAccessConditions:e.conditions,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:null===(t=e.conditions)||void 0===t?void 0:t.tagConditions})},(0,B.convertTracingToRequestOptionsBase)(i)));}catch(e){throw r.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{r.end();}}/**
|
|||
|
* Commits a new block of data to the end of the existing append blob.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/append-block
|
|||
|
*
|
|||
|
* @param body - Data to be appended.
|
|||
|
* @param contentLength - Length of the body in bytes.
|
|||
|
* @param options - Options to the Append Block operation.
|
|||
|
*
|
|||
|
*
|
|||
|
* Example usage:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* const content = "Hello World!";
|
|||
|
*
|
|||
|
* // Create a new append blob and append data to the blob.
|
|||
|
* const newAppendBlobClient = containerClient.getAppendBlobClient("<blob name>");
|
|||
|
* await newAppendBlobClient.create();
|
|||
|
* await newAppendBlobClient.appendBlock(content, content.length);
|
|||
|
*
|
|||
|
* // Append data to an existing append blob.
|
|||
|
* const existingAppendBlobClient = containerClient.getAppendBlobClient("<blob name>");
|
|||
|
* await existingAppendBlobClient.appendBlock(content, content.length);
|
|||
|
* ```
|
|||
|
*/async appendBlock(e,t,r={}){var i;let{span:a,updatedOptions:n}=(0,B.createSpan)("AppendBlobClient-appendBlock",r);r.conditions=r.conditions||{};try{return(0,g.ensureCpkIfSpecified)(r.customerProvidedKey,this.isHttps),await this.appendBlobContext.appendBlock(t,e,Object.assign({abortSignal:r.abortSignal,appendPositionAccessConditions:r.conditions,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:null===(i=r.conditions)||void 0===i?void 0:i.tagConditions}),requestOptions:{onUploadProgress:r.onProgress},transactionalContentMD5:r.transactionalContentMD5,transactionalContentCrc64:r.transactionalContentCrc64,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope},(0,B.convertTracingToRequestOptionsBase)(n)));}catch(e){throw a.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{a.end();}}/**
|
|||
|
* The Append Block operation commits a new block of data to the end of an existing append blob
|
|||
|
* where the contents are read from a source url.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-url
|
|||
|
*
|
|||
|
* @param sourceURL -
|
|||
|
* The url to the blob that will be the source of the copy. A source blob in the same storage account can
|
|||
|
* be authenticated via Shared Key. However, if the source is a blob in another account, the source blob
|
|||
|
* must either be public or must be authenticated via a shared access signature. If the source blob is
|
|||
|
* public, no authentication is required to perform the operation.
|
|||
|
* @param sourceOffset - Offset in source to be appended
|
|||
|
* @param count - Number of bytes to be appended as a block
|
|||
|
* @param options -
|
|||
|
*/async appendBlockFromURL(e,t,r,i={}){var a;let{span:n,updatedOptions:o}=(0,B.createSpan)("AppendBlobClient-appendBlockFromURL",i);i.conditions=i.conditions||{},i.sourceConditions=i.sourceConditions||{};try{return(0,g.ensureCpkIfSpecified)(i.customerProvidedKey,this.isHttps),await this.appendBlobContext.appendBlockFromUrl(e,0,Object.assign({abortSignal:i.abortSignal,sourceRange:(0,v.rangeToString)({offset:t,count:r}),sourceContentMD5:i.sourceContentMD5,sourceContentCrc64:i.sourceContentCrc64,leaseAccessConditions:i.conditions,appendPositionAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:null===(a=i.conditions)||void 0===a?void 0:a.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:i.sourceConditions.ifMatch,sourceIfModifiedSince:i.sourceConditions.ifModifiedSince,sourceIfNoneMatch:i.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:i.sourceConditions.ifUnmodifiedSince},copySourceAuthorization:(0,N.httpAuthorizationToString)(i.sourceAuthorization),cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope},(0,B.convertTracingToRequestOptionsBase)(o)));}catch(e){throw n.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{n.end();}}}class R extends T{constructor(e,t,r,/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/o){// In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
|
|||
|
// super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
|
|||
|
let s,u;if(o=o||{},(0,y.isPipelineLike)(t))// (url: string, pipeline: Pipeline)
|
|||
|
u=e,s=t;else if(i.isNode&&t instanceof d.StorageSharedKeyCredential||t instanceof p.AnonymousCredential||(0,a.isTokenCredential)(t))// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|||
|
u=e,o=r,s=(0,y.newPipeline)(t,o);else if(t||"string"==typeof t){if(t&&"string"==typeof t&&r&&"string"==typeof r){// (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
|
|||
|
let a=t,c=r,l=(0,N.extractConnectionStringParts)(e);if("AccountConnString"===l.kind){if(i.isNode){let e=new d.StorageSharedKeyCredential(l.accountName,l.accountKey);u=(0,N.appendToURLPath)((0,N.appendToURLPath)(l.url,encodeURIComponent(a)),encodeURIComponent(c)),o.proxyOptions||(o.proxyOptions=(0,n.getDefaultProxySettings)(l.proxyUri)),s=(0,y.newPipeline)(e,o);}else throw Error("Account connection string is only supported in Node.js environment");}else if("SASConnString"===l.kind)u=(0,N.appendToURLPath)((0,N.appendToURLPath)(l.url,encodeURIComponent(a)),encodeURIComponent(c))+"?"+l.accountSas,s=(0,y.newPipeline)(new p.AnonymousCredential(),o);else throw Error("Connection string must be either an Account connection string or a SAS connection string");}else throw Error("Expecting non-empty strings for containerName and blobName parameters");}else// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|||
|
// The second parameter is undefined. Use anonymous credential.
|
|||
|
u=e,r&&"string"!=typeof r&&(o=r),s=(0,y.newPipeline)(new p.AnonymousCredential(),o);super(u,s),this.blockBlobContext=new x.BlockBlob(this.storageClientContext),this._blobContext=new m.Blob(this.storageClientContext);}/**
|
|||
|
* Creates a new BlockBlobClient object identical to the source but with the
|
|||
|
* specified snapshot timestamp.
|
|||
|
* Provide "" will remove the snapshot and return a URL to the base blob.
|
|||
|
*
|
|||
|
* @param snapshot - The snapshot timestamp.
|
|||
|
* @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp.
|
|||
|
*/withSnapshot(e){return new R((0,N.setURLParameter)(this.url,S.URLConstants.Parameters.SNAPSHOT,0===e.length?void 0:e),this.pipeline);}/**
|
|||
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|||
|
*
|
|||
|
* Quick query for a JSON or CSV formatted blob.
|
|||
|
*
|
|||
|
* Example usage (Node.js):
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* // Query and convert a blob to a string
|
|||
|
* const queryBlockBlobResponse = await blockBlobClient.query("select * from BlobStorage");
|
|||
|
* const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString();
|
|||
|
* console.log("Query blob content:", downloaded);
|
|||
|
*
|
|||
|
* async function streamToBuffer(readableStream) {
|
|||
|
* return new Promise((resolve, reject) => {
|
|||
|
* const chunks = [];
|
|||
|
* readableStream.on("data", (data) => {
|
|||
|
* chunks.push(data instanceof Buffer ? data : Buffer.from(data));
|
|||
|
* });
|
|||
|
* readableStream.on("end", () => {
|
|||
|
* resolve(Buffer.concat(chunks));
|
|||
|
* });
|
|||
|
* readableStream.on("error", reject);
|
|||
|
* });
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* @param query -
|
|||
|
* @param options -
|
|||
|
*/async query(e,t={}){var r;(0,g.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps);let{span:a,updatedOptions:n}=(0,B.createSpan)("BlockBlobClient-query",t);try{if(!i.isNode)throw Error("This operation currently is only supported in Node.js.");(0,g.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps);let a=await this._blobContext.query(Object.assign({abortSignal:t.abortSignal,queryRequest:{queryType:"SQL",expression:e,inputSerialization:(0,N.toQuerySerialization)(t.inputTextConfiguration),outputSerialization:(0,N.toQuerySerialization)(t.outputTextConfiguration)},leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions}),cpkInfo:t.customerProvidedKey},(0,B.convertTracingToRequestOptionsBase)(n)));return new l.BlobQueryResponse(a,{abortSignal:t.abortSignal,onProgress:t.onProgress,onError:t.onError});}catch(e){throw a.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{a.end();}}/**
|
|||
|
* Creates a new block blob, or updates the content of an existing block blob.
|
|||
|
* Updating an existing block blob overwrites any existing metadata on the blob.
|
|||
|
* Partial updates are not supported; the content of the existing blob is
|
|||
|
* overwritten with the new content. To perform a partial update of a block blob's,
|
|||
|
* use {@link stageBlock} and {@link commitBlockList}.
|
|||
|
*
|
|||
|
* This is a non-parallel uploading method, please use {@link uploadFile},
|
|||
|
* {@link uploadStream} or {@link uploadBrowserData} for better performance
|
|||
|
* with concurrency uploading.
|
|||
|
*
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/put-blob
|
|||
|
*
|
|||
|
* @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function
|
|||
|
* which returns a new Readable stream whose offset is from data source beginning.
|
|||
|
* @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a
|
|||
|
* string including non non-Base64/Hex-encoded characters.
|
|||
|
* @param options - Options to the Block Blob Upload operation.
|
|||
|
* @returns Response data for the Block Blob Upload operation.
|
|||
|
*
|
|||
|
* Example usage:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* const content = "Hello world!";
|
|||
|
* const uploadBlobResponse = await blockBlobClient.upload(content, content.length);
|
|||
|
* ```
|
|||
|
*/async upload(e,t,r={}){var i,a,n;r.conditions=r.conditions||{};let{span:o,updatedOptions:s}=(0,B.createSpan)("BlockBlobClient-upload",r);try{return(0,g.ensureCpkIfSpecified)(r.customerProvidedKey,this.isHttps),await this.blockBlobContext.upload(t,e,Object.assign({abortSignal:r.abortSignal,blobHttpHeaders:r.blobHTTPHeaders,leaseAccessConditions:r.conditions,metadata:r.metadata,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:null===(i=r.conditions)||void 0===i?void 0:i.tagConditions}),requestOptions:{onUploadProgress:r.onProgress},cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,immutabilityPolicyExpiry:null===(a=r.immutabilityPolicy)||void 0===a?void 0:a.expiriesOn,immutabilityPolicyMode:null===(n=r.immutabilityPolicy)||void 0===n?void 0:n.policyMode,legalHold:r.legalHold,tier:(0,g.toAccessTier)(r.tier),blobTagsString:(0,N.toBlobTagsString)(r.tags)},(0,B.convertTracingToRequestOptionsBase)(s)));}catch(e){throw o.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{o.end();}}/**
|
|||
|
* Creates a new Block Blob where the contents of the blob are read from a given URL.
|
|||
|
* This API is supported beginning with the 2020-04-08 version. Partial updates
|
|||
|
* are not supported with Put Blob from URL; the content of an existing blob is overwritten with
|
|||
|
* the content of the new blob. To perform partial updates to a block blob’s contents using a
|
|||
|
* source URL, use {@link stageBlockFromURL} and {@link commitBlockList}.
|
|||
|
*
|
|||
|
* @param sourceURL - Specifies the URL of the blob. The value
|
|||
|
* may be a URL of up to 2 KB in length that specifies a blob.
|
|||
|
* The value should be URL-encoded as it would appear
|
|||
|
* in a request URI. The source blob must either be public
|
|||
|
* or must be authenticated via a shared access signature.
|
|||
|
* If the source blob is public, no authentication is required
|
|||
|
* to perform the operation. Here are some examples of source object URLs:
|
|||
|
* - https://myaccount.blob.core.windows.net/mycontainer/myblob
|
|||
|
* - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=<DateTime>
|
|||
|
* @param options - Optional parameters.
|
|||
|
*/async syncUploadFromURL(e,t={}){var r,i,a,n,o;t.conditions=t.conditions||{};let{span:s,updatedOptions:c}=(0,B.createSpan)("BlockBlobClient-syncUploadFromURL",t);try{return(0,g.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps),await this.blockBlobContext.putBlobFromUrl(0,e,Object.assign(Object.assign(Object.assign({},t),{blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:t.conditions.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:null===(r=t.sourceConditions)||void 0===r?void 0:r.ifMatch,sourceIfModifiedSince:null===(i=t.sourceConditions)||void 0===i?void 0:i.ifModifiedSince,sourceIfNoneMatch:null===(a=t.sourceConditions)||void 0===a?void 0:a.ifNoneMatch,sourceIfUnmodifiedSince:null===(n=t.sourceConditions)||void 0===n?void 0:n.ifUnmodifiedSince,sourceIfTags:null===(o=t.sourceConditions)||void 0===o?void 0:o.tagConditions},cpkInfo:t.customerProvidedKey,copySourceAuthorization:(0,N.httpAuthorizationToString)(t.sourceAuthorization),tier:(0,g.toAccessTier)(t.tier),blobTagsString:(0,N.toBlobTagsString)(t.tags),copySourceTags:t.copySourceTags}),(0,B.convertTracingToRequestOptionsBase)(c)));}catch(e){throw s.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{s.end();}}/**
|
|||
|
* Uploads the specified block to the block blob's "staging area" to be later
|
|||
|
* committed by a call to commitBlockList.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/put-block
|
|||
|
*
|
|||
|
* @param blockId - A 64-byte value that is base64-encoded
|
|||
|
* @param body - Data to upload to the staging area.
|
|||
|
* @param contentLength - Number of bytes to upload.
|
|||
|
* @param options - Options to the Block Blob Stage Block operation.
|
|||
|
* @returns Response data for the Block Blob Stage Block operation.
|
|||
|
*/async stageBlock(e,t,r,i={}){let{span:a,updatedOptions:n}=(0,B.createSpan)("BlockBlobClient-stageBlock",i);try{return(0,g.ensureCpkIfSpecified)(i.customerProvidedKey,this.isHttps),await this.blockBlobContext.stageBlock(e,r,t,Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,requestOptions:{onUploadProgress:i.onProgress},transactionalContentMD5:i.transactionalContentMD5,transactionalContentCrc64:i.transactionalContentCrc64,cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope},(0,B.convertTracingToRequestOptionsBase)(n)));}catch(e){throw a.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{a.end();}}/**
|
|||
|
* The Stage Block From URL operation creates a new block to be committed as part
|
|||
|
* of a blob where the contents are read from a URL.
|
|||
|
* This API is available starting in version 2018-03-28.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url
|
|||
|
*
|
|||
|
* @param blockId - A 64-byte value that is base64-encoded
|
|||
|
* @param sourceURL - Specifies the URL of the blob. The value
|
|||
|
* may be a URL of up to 2 KB in length that specifies a blob.
|
|||
|
* The value should be URL-encoded as it would appear
|
|||
|
* in a request URI. The source blob must either be public
|
|||
|
* or must be authenticated via a shared access signature.
|
|||
|
* If the source blob is public, no authentication is required
|
|||
|
* to perform the operation. Here are some examples of source object URLs:
|
|||
|
* - https://myaccount.blob.core.windows.net/mycontainer/myblob
|
|||
|
* - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=<DateTime>
|
|||
|
* @param offset - From which position of the blob to download, greater than or equal to 0
|
|||
|
* @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined
|
|||
|
* @param options - Options to the Block Blob Stage Block From URL operation.
|
|||
|
* @returns Response data for the Block Blob Stage Block From URL operation.
|
|||
|
*/async stageBlockFromURL(e,t,r=0,i,a={}){let{span:n,updatedOptions:o}=(0,B.createSpan)("BlockBlobClient-stageBlockFromURL",a);try{return(0,g.ensureCpkIfSpecified)(a.customerProvidedKey,this.isHttps),await this.blockBlobContext.stageBlockFromURL(e,0,t,Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,sourceContentMD5:a.sourceContentMD5,sourceContentCrc64:a.sourceContentCrc64,sourceRange:0!==r||i?(0,v.rangeToString)({offset:r,count:i}):void 0,cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope,copySourceAuthorization:(0,N.httpAuthorizationToString)(a.sourceAuthorization)},(0,B.convertTracingToRequestOptionsBase)(o)));}catch(e){throw n.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{n.end();}}/**
|
|||
|
* Writes a blob by specifying the list of block IDs that make up the blob.
|
|||
|
* In order to be written as part of a blob, a block must have been successfully written
|
|||
|
* to the server in a prior {@link stageBlock} operation. You can call {@link commitBlockList} to
|
|||
|
* update a blob by uploading only those blocks that have changed, then committing the new and existing
|
|||
|
* blocks together. Any blocks not specified in the block list and permanently deleted.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/put-block-list
|
|||
|
*
|
|||
|
* @param blocks - Array of 64-byte value that is base64-encoded
|
|||
|
* @param options - Options to the Block Blob Commit Block List operation.
|
|||
|
* @returns Response data for the Block Blob Commit Block List operation.
|
|||
|
*/async commitBlockList(e,t={}){var r,i,a;t.conditions=t.conditions||{};let{span:n,updatedOptions:o}=(0,B.createSpan)("BlockBlobClient-commitBlockList",t);try{return(0,g.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps),await this.blockBlobContext.commitBlockList({latest:e},Object.assign({abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions}),cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:null===(i=t.immutabilityPolicy)||void 0===i?void 0:i.expiriesOn,immutabilityPolicyMode:null===(a=t.immutabilityPolicy)||void 0===a?void 0:a.policyMode,legalHold:t.legalHold,tier:(0,g.toAccessTier)(t.tier),blobTagsString:(0,N.toBlobTagsString)(t.tags)},(0,B.convertTracingToRequestOptionsBase)(o)));}catch(e){throw n.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{n.end();}}/**
|
|||
|
* Returns the list of blocks that have been uploaded as part of a block blob
|
|||
|
* using the specified block list filter.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/get-block-list
|
|||
|
*
|
|||
|
* @param listType - Specifies whether to return the list of committed blocks,
|
|||
|
* the list of uncommitted blocks, or both lists together.
|
|||
|
* @param options - Options to the Block Blob Get Block List operation.
|
|||
|
* @returns Response data for the Block Blob Get Block List operation.
|
|||
|
*/async getBlockList(e,t={}){var r;let{span:i,updatedOptions:a}=(0,B.createSpan)("BlockBlobClient-getBlockList",t);try{let i=await this.blockBlobContext.getBlockList(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions})},(0,B.convertTracingToRequestOptionsBase)(a)));return i.committedBlocks||(i.committedBlocks=[]),i.uncommittedBlocks||(i.uncommittedBlocks=[]),i;}catch(e){throw i.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{i.end();}}// High level functions
|
|||
|
/**
|
|||
|
* Uploads a Buffer(Node.js)/Blob(browsers)/ArrayBuffer/ArrayBufferView object to a BlockBlob.
|
|||
|
*
|
|||
|
* When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
|
|||
|
* {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.
|
|||
|
* Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
|
|||
|
* to commit the block list.
|
|||
|
*
|
|||
|
* A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is
|
|||
|
* `blobContentType`, enabling the browser to provide
|
|||
|
* functionality based on file type.
|
|||
|
*
|
|||
|
* @param data - Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView
|
|||
|
* @param options -
|
|||
|
*/async uploadData(e,t={}){let{span:r,updatedOptions:a}=(0,B.createSpan)("BlockBlobClient-uploadData",t);try{if(i.isNode){let t;return t=e instanceof Buffer?e:e instanceof ArrayBuffer?Buffer.from(e):Buffer.from(e.buffer,e.byteOffset,e.byteLength),this.uploadSeekableInternal((e,r)=>t.slice(e,e+r),t.byteLength,a);}{let t=new Blob([e]);return this.uploadSeekableInternal((e,r)=>t.slice(e,e+r),t.size,a);}}catch(e){throw r.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{r.end();}}/**
|
|||
|
* ONLY AVAILABLE IN BROWSERS.
|
|||
|
*
|
|||
|
* Uploads a browser Blob/File/ArrayBuffer/ArrayBufferView object to block blob.
|
|||
|
*
|
|||
|
* When buffer length lesser than or equal to 256MB, this method will use 1 upload call to finish the upload.
|
|||
|
* Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call
|
|||
|
* {@link commitBlockList} to commit the block list.
|
|||
|
*
|
|||
|
* A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is
|
|||
|
* `blobContentType`, enabling the browser to provide
|
|||
|
* functionality based on file type.
|
|||
|
*
|
|||
|
* @deprecated Use {@link uploadData} instead.
|
|||
|
*
|
|||
|
* @param browserData - Blob, File, ArrayBuffer or ArrayBufferView
|
|||
|
* @param options - Options to upload browser data.
|
|||
|
* @returns Response data for the Blob Upload operation.
|
|||
|
*/async uploadBrowserData(e,t={}){let{span:r,updatedOptions:i}=(0,B.createSpan)("BlockBlobClient-uploadBrowserData",t);try{let t=new Blob([e]);return await this.uploadSeekableInternal((e,r)=>t.slice(e,e+r),t.size,i);}catch(e){throw r.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{r.end();}}/**
|
|||
|
*
|
|||
|
* Uploads data to block blob. Requires a bodyFactory as the data source,
|
|||
|
* which need to return a {@link HttpRequestBody} object with the offset and size provided.
|
|||
|
*
|
|||
|
* When data length is no more than the specified {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
|
|||
|
* {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.
|
|||
|
* Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
|
|||
|
* to commit the block list.
|
|||
|
*
|
|||
|
* @param bodyFactory -
|
|||
|
* @param size - size of the data to upload.
|
|||
|
* @param options - Options to Upload to Block Blob operation.
|
|||
|
* @returns Response data for the Blob Upload operation.
|
|||
|
*/async uploadSeekableInternal(e,t,r={}){if(r.blockSize||(r.blockSize=0),r.blockSize<0||r.blockSize>S.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES)throw RangeError(`blockSize option must be >= 0 and <= ${S.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`);if(0===r.maxSingleShotSize||r.maxSingleShotSize||(r.maxSingleShotSize=S.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES),r.maxSingleShotSize<0||r.maxSingleShotSize>S.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES)throw RangeError(`maxSingleShotSize option must be >= 0 and <= ${S.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`);if(0===r.blockSize){if(t>S.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES*S.BLOCK_BLOB_MAX_BLOCKS)throw RangeError(`${t} is too larger to upload to a block blob.`);t>r.maxSingleShotSize&&(r.blockSize=Math.ceil(t/S.BLOCK_BLOB_MAX_BLOCKS),r.blockSize<S.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES&&(r.blockSize=S.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES));}r.blobHTTPHeaders||(r.blobHTTPHeaders={}),r.conditions||(r.conditions={});let{span:i,updatedOptions:a}=(0,B.createSpan)("BlockBlobClient-uploadSeekableInternal",r);try{if(t<=r.maxSingleShotSize)return await this.upload(e(0,t),t,a);let i=Math.floor((t-1)/r.blockSize)+1;if(i>S.BLOCK_BLOB_MAX_BLOCKS)throw RangeError(`The buffer's size is too big or the BlockSize is too small;the number of blocks must be <= ${S.BLOCK_BLOB_MAX_BLOCKS}`);let n=[],o=(0,s.generateUuid)(),u=0,c=new E.Batch(r.concurrency);for(let s=0;s<i;s++)c.addOperation(async()=>{let c=(0,N.generateBlockID)(o,s),l=r.blockSize*s,p=s===i-1?t:l+r.blockSize,d=p-l;n.push(c),await this.stageBlock(c,e(l,d),d,{abortSignal:r.abortSignal,conditions:r.conditions,encryptionScope:r.encryptionScope,tracingOptions:a.tracingOptions}),// Update progress after block is successfully uploaded to server, in case of block trying
|
|||
|
// TODO: Hook with convenience layer progress event in finer level
|
|||
|
u+=d,r.onProgress&&r.onProgress({loadedBytes:u});});return await c.do(),this.commitBlockList(n,a);}catch(e){throw i.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{i.end();}}/**
|
|||
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|||
|
*
|
|||
|
* Uploads a local file in blocks to a block blob.
|
|||
|
*
|
|||
|
* When file size lesser than or equal to 256MB, this method will use 1 upload call to finish the upload.
|
|||
|
* Otherwise, this method will call stageBlock to upload blocks, and finally call commitBlockList
|
|||
|
* to commit the block list.
|
|||
|
*
|
|||
|
* @param filePath - Full path of local file
|
|||
|
* @param options - Options to Upload to Block Blob operation.
|
|||
|
* @returns Response data for the Blob Upload operation.
|
|||
|
*/async uploadFile(e,t={}){let{span:r,updatedOptions:i}=(0,B.createSpan)("BlockBlobClient-uploadFile",t);try{let r=(await(0,F.fsStat)(e)).size;return await this.uploadSeekableInternal((t,r)=>()=>(0,F.fsCreateReadStream)(e,{autoClose:!0,end:r?t+r-1:1/0,start:t}),r,Object.assign(Object.assign({},t),{tracingOptions:Object.assign(Object.assign({},t.tracingOptions),(0,B.convertTracingToRequestOptionsBase)(i))}));}catch(e){throw r.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{r.end();}}/**
|
|||
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|||
|
*
|
|||
|
* Uploads a Node.js Readable stream into block blob.
|
|||
|
*
|
|||
|
* PERFORMANCE IMPROVEMENT TIPS:
|
|||
|
* * Input stream highWaterMark is better to set a same value with bufferSize
|
|||
|
* parameter, which will avoid Buffer.concat() operations.
|
|||
|
*
|
|||
|
* @param stream - Node.js Readable stream
|
|||
|
* @param bufferSize - Size of every buffer allocated, also the block size in the uploaded block blob. Default value is 8MB
|
|||
|
* @param maxConcurrency - Max concurrency indicates the max number of buffers that can be allocated,
|
|||
|
* positive correlation with max uploading concurrency. Default value is 5
|
|||
|
* @param options - Options to Upload Stream to Block Blob operation.
|
|||
|
* @returns Response data for the Blob Upload operation.
|
|||
|
*/async uploadStream(e,t=S.DEFAULT_BLOCK_BUFFER_SIZE_BYTES,r=5,i={}){i.blobHTTPHeaders||(i.blobHTTPHeaders={}),i.conditions||(i.conditions={});let{span:a,updatedOptions:n}=(0,B.createSpan)("BlockBlobClient-uploadStream",i);try{let a=0,o=(0,s.generateUuid)(),u=0,c=[],l=new A.BufferScheduler(e,t,r,async(e,t)=>{let r=(0,N.generateBlockID)(o,a);c.push(r),a++,await this.stageBlock(r,e,t,{conditions:i.conditions,encryptionScope:i.encryptionScope,tracingOptions:n.tracingOptions}),// Update progress after block is successfully uploaded to server, in case of block trying
|
|||
|
u+=t,i.onProgress&&i.onProgress({loadedBytes:u});},// reduce the possibility when a outgoing handler waits for stream data, in
|
|||
|
// this situation, outgoing handlers are blocked.
|
|||
|
// Outgoing queue shouldn't be empty.
|
|||
|
Math.ceil(r/4*3));return await l.do(),await this.commitBlockList(c,Object.assign(Object.assign({},i),{tracingOptions:Object.assign(Object.assign({},i.tracingOptions),(0,B.convertTracingToRequestOptionsBase)(n))}));}catch(e){throw a.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{a.end();}}}class I extends T{constructor(e,t,r,/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/o){// In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
|
|||
|
// super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
|
|||
|
let s,u;if(o=o||{},(0,y.isPipelineLike)(t))// (url: string, pipeline: Pipeline)
|
|||
|
u=e,s=t;else if(i.isNode&&t instanceof d.StorageSharedKeyCredential||t instanceof p.AnonymousCredential||(0,a.isTokenCredential)(t))// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|||
|
u=e,o=r,s=(0,y.newPipeline)(t,o);else if(t||"string"==typeof t){if(t&&"string"==typeof t&&r&&"string"==typeof r){// (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
|
|||
|
let a=t,c=r,l=(0,N.extractConnectionStringParts)(e);if("AccountConnString"===l.kind){if(i.isNode){let e=new d.StorageSharedKeyCredential(l.accountName,l.accountKey);u=(0,N.appendToURLPath)((0,N.appendToURLPath)(l.url,encodeURIComponent(a)),encodeURIComponent(c)),o.proxyOptions||(o.proxyOptions=(0,n.getDefaultProxySettings)(l.proxyUri)),s=(0,y.newPipeline)(e,o);}else throw Error("Account connection string is only supported in Node.js environment");}else if("SASConnString"===l.kind)u=(0,N.appendToURLPath)((0,N.appendToURLPath)(l.url,encodeURIComponent(a)),encodeURIComponent(c))+"?"+l.accountSas,s=(0,y.newPipeline)(new p.AnonymousCredential(),o);else throw Error("Connection string must be either an Account connection string or a SAS connection string");}else throw Error("Expecting non-empty strings for containerName and blobName parameters");}else// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|||
|
// The second parameter is undefined. Use anonymous credential.
|
|||
|
u=e,s=(0,y.newPipeline)(new p.AnonymousCredential(),o);super(u,s),this.pageBlobContext=new f.PageBlob(this.storageClientContext);}/**
|
|||
|
* Creates a new PageBlobClient object identical to the source but with the
|
|||
|
* specified snapshot timestamp.
|
|||
|
* Provide "" will remove the snapshot and return a Client to the base blob.
|
|||
|
*
|
|||
|
* @param snapshot - The snapshot timestamp.
|
|||
|
* @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp.
|
|||
|
*/withSnapshot(e){return new I((0,N.setURLParameter)(this.url,S.URLConstants.Parameters.SNAPSHOT,0===e.length?void 0:e),this.pipeline);}/**
|
|||
|
* Creates a page blob of the specified length. Call uploadPages to upload data
|
|||
|
* data to a page blob.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/put-blob
|
|||
|
*
|
|||
|
* @param size - size of the page blob.
|
|||
|
* @param options - Options to the Page Blob Create operation.
|
|||
|
* @returns Response data for the Page Blob Create operation.
|
|||
|
*/async create(e,t={}){var r,i,a;t.conditions=t.conditions||{};let{span:n,updatedOptions:o}=(0,B.createSpan)("PageBlobClient-create",t);try{return(0,g.ensureCpkIfSpecified)(t.customerProvidedKey,this.isHttps),await this.pageBlobContext.create(0,e,Object.assign({abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,blobSequenceNumber:t.blobSequenceNumber,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions}),cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:null===(i=t.immutabilityPolicy)||void 0===i?void 0:i.expiriesOn,immutabilityPolicyMode:null===(a=t.immutabilityPolicy)||void 0===a?void 0:a.policyMode,legalHold:t.legalHold,tier:(0,g.toAccessTier)(t.tier),blobTagsString:(0,N.toBlobTagsString)(t.tags)},(0,B.convertTracingToRequestOptionsBase)(o)));}catch(e){throw n.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{n.end();}}/**
|
|||
|
* Creates a page blob of the specified length. Call uploadPages to upload data
|
|||
|
* data to a page blob. If the blob with the same name already exists, the content
|
|||
|
* of the existing blob will remain unchanged.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/put-blob
|
|||
|
*
|
|||
|
* @param size - size of the page blob.
|
|||
|
* @param options -
|
|||
|
*/async createIfNotExists(e,t={}){var r,i;let{span:a,updatedOptions:n}=(0,B.createSpan)("PageBlobClient-createIfNotExists",t);try{let r={ifNoneMatch:S.ETagAny},i=await this.create(e,Object.assign(Object.assign({},t),{conditions:r,tracingOptions:n.tracingOptions}));return Object.assign(Object.assign({succeeded:!0},i),{_response:i._response});}catch(e){if((null===(r=e.details)||void 0===r?void 0:r.errorCode)==="BlobAlreadyExists")return a.setStatus({code:u.SpanStatusCode.ERROR,message:"Expected exception when creating a blob only if it does not already exist."}),Object.assign(Object.assign({succeeded:!1},null===(i=e.response)||void 0===i?void 0:i.parsedHeaders),{_response:e.response});throw a.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{a.end();}}/**
|
|||
|
* Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/put-page
|
|||
|
*
|
|||
|
* @param body - Data to upload
|
|||
|
* @param offset - Offset of destination page blob
|
|||
|
* @param count - Content length of the body, also number of bytes to be uploaded
|
|||
|
* @param options - Options to the Page Blob Upload Pages operation.
|
|||
|
* @returns Response data for the Page Blob Upload Pages operation.
|
|||
|
*/async uploadPages(e,t,r,i={}){var a;i.conditions=i.conditions||{};let{span:n,updatedOptions:o}=(0,B.createSpan)("PageBlobClient-uploadPages",i);try{return(0,g.ensureCpkIfSpecified)(i.customerProvidedKey,this.isHttps),await this.pageBlobContext.uploadPages(r,e,Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:null===(a=i.conditions)||void 0===a?void 0:a.tagConditions}),requestOptions:{onUploadProgress:i.onProgress},range:(0,v.rangeToString)({offset:t,count:r}),sequenceNumberAccessConditions:i.conditions,transactionalContentMD5:i.transactionalContentMD5,transactionalContentCrc64:i.transactionalContentCrc64,cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope},(0,B.convertTracingToRequestOptionsBase)(o)));}catch(e){throw n.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{n.end();}}/**
|
|||
|
* The Upload Pages operation writes a range of pages to a page blob where the
|
|||
|
* contents are read from a URL.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-url
|
|||
|
*
|
|||
|
* @param sourceURL - Specify a URL to the copy source, Shared Access Signature(SAS) maybe needed for authentication
|
|||
|
* @param sourceOffset - The source offset to copy from. Pass 0 to copy from the beginning of source page blob
|
|||
|
* @param destOffset - Offset of destination page blob
|
|||
|
* @param count - Number of bytes to be uploaded from source page blob
|
|||
|
* @param options -
|
|||
|
*/async uploadPagesFromURL(e,t,r,i,a={}){var n;a.conditions=a.conditions||{},a.sourceConditions=a.sourceConditions||{};let{span:o,updatedOptions:s}=(0,B.createSpan)("PageBlobClient-uploadPagesFromURL",a);try{return(0,g.ensureCpkIfSpecified)(a.customerProvidedKey,this.isHttps),await this.pageBlobContext.uploadPagesFromURL(e,(0,v.rangeToString)({offset:t,count:i}),0,(0,v.rangeToString)({offset:r,count:i}),Object.assign({abortSignal:a.abortSignal,sourceContentMD5:a.sourceContentMD5,sourceContentCrc64:a.sourceContentCrc64,leaseAccessConditions:a.conditions,sequenceNumberAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:null===(n=a.conditions)||void 0===n?void 0:n.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:a.sourceConditions.ifMatch,sourceIfModifiedSince:a.sourceConditions.ifModifiedSince,sourceIfNoneMatch:a.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:a.sourceConditions.ifUnmodifiedSince},cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope,copySourceAuthorization:(0,N.httpAuthorizationToString)(a.sourceAuthorization)},(0,B.convertTracingToRequestOptionsBase)(s)));}catch(e){throw o.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{o.end();}}/**
|
|||
|
* Frees the specified pages from the page blob.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/put-page
|
|||
|
*
|
|||
|
* @param offset - Starting byte position of the pages to clear.
|
|||
|
* @param count - Number of bytes to clear.
|
|||
|
* @param options - Options to the Page Blob Clear Pages operation.
|
|||
|
* @returns Response data for the Page Blob Clear Pages operation.
|
|||
|
*/async clearPages(e=0,t,r={}){var i;r.conditions=r.conditions||{};let{span:a,updatedOptions:n}=(0,B.createSpan)("PageBlobClient-clearPages",r);try{return await this.pageBlobContext.clearPages(0,Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:null===(i=r.conditions)||void 0===i?void 0:i.tagConditions}),range:(0,v.rangeToString)({offset:e,count:t}),sequenceNumberAccessConditions:r.conditions,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope},(0,B.convertTracingToRequestOptionsBase)(n)));}catch(e){throw a.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{a.end();}}/**
|
|||
|
* Returns the list of valid page ranges for a page blob or snapshot of a page blob.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
|||
|
*
|
|||
|
* @param offset - Starting byte position of the page ranges.
|
|||
|
* @param count - Number of bytes to get.
|
|||
|
* @param options - Options to the Page Blob Get Ranges operation.
|
|||
|
* @returns Response data for the Page Blob Get Ranges operation.
|
|||
|
*/async getPageRanges(e=0,t,r={}){var i;r.conditions=r.conditions||{};let{span:a,updatedOptions:n}=(0,B.createSpan)("PageBlobClient-getPageRanges",r);try{return await this.pageBlobContext.getPageRanges(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:null===(i=r.conditions)||void 0===i?void 0:i.tagConditions}),range:(0,v.rangeToString)({offset:e,count:t})},(0,B.convertTracingToRequestOptionsBase)(n))).then(D.rangeResponseFromModel);}catch(e){throw a.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{a.end();}}/**
|
|||
|
* getPageRangesSegment returns a single segment of page ranges starting from the
|
|||
|
* specified Marker. Use an empty Marker to start enumeration from the beginning.
|
|||
|
* After getting a segment, process it, and then call getPageRangesSegment again
|
|||
|
* (passing the the previously-returned Marker) to get the next segment.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
|||
|
*
|
|||
|
* @param offset - Starting byte position of the page ranges.
|
|||
|
* @param count - Number of bytes to get.
|
|||
|
* @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
|
|||
|
* @param options - Options to PageBlob Get Page Ranges Segment operation.
|
|||
|
*/async listPageRangesSegment(e=0,t,r,i={}){var a;let{span:n,updatedOptions:o}=(0,B.createSpan)("PageBlobClient-getPageRangesSegment",i);try{return await this.pageBlobContext.getPageRanges(Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:null===(a=i.conditions)||void 0===a?void 0:a.tagConditions}),range:(0,v.rangeToString)({offset:e,count:t}),marker:r,maxPageSize:i.maxPageSize},(0,B.convertTracingToRequestOptionsBase)(o)));}catch(e){throw n.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{n.end();}}/**
|
|||
|
* Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel}
|
|||
|
*
|
|||
|
* @param offset - Starting byte position of the page ranges.
|
|||
|
* @param count - Number of bytes to get.
|
|||
|
* @param marker - A string value that identifies the portion of
|
|||
|
* the get of page ranges to be returned with the next getting operation. The
|
|||
|
* operation returns the ContinuationToken value within the response body if the
|
|||
|
* getting operation did not return all page ranges remaining within the current page.
|
|||
|
* The ContinuationToken value can be used as the value for
|
|||
|
* the marker parameter in a subsequent call to request the next page of get
|
|||
|
* items. The marker value is opaque to the client.
|
|||
|
* @param options - Options to List Page Ranges operation.
|
|||
|
*/listPageRangeItemSegments(e=0,t,i,a={}){return(0,r.__asyncGenerator)(this,arguments,function*(){let n;if(i||void 0===i)do i=(n=yield(0,r.__await)(this.listPageRangesSegment(e,t,i,a))).continuationToken,yield yield(0,r.__await)(yield(0,r.__await)(n));while(i);});}/**
|
|||
|
* Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
|
|||
|
*
|
|||
|
* @param offset - Starting byte position of the page ranges.
|
|||
|
* @param count - Number of bytes to get.
|
|||
|
* @param options - Options to List Page Ranges operation.
|
|||
|
*/listPageRangeItems(e=0,t,i={}){return(0,r.__asyncGenerator)(this,arguments,function*(){let a;try{for(var n,o,s,u=(0,r.__asyncValues)(this.listPageRangeItemSegments(e,t,a,i));!(s=yield(0,r.__await)(u.next())).done;){let e=s.value;yield(0,r.__await)(yield*(0,r.__asyncDelegator)((0,r.__asyncValues)((0,N.ExtractPageRangeInfoItems)(e))));}}catch(e){n={error:e};}finally{try{s&&!s.done&&(o=u.return)&&(yield(0,r.__await)(o.call(u)));}finally{if(n)throw n.error;}}});}/**
|
|||
|
* Returns an async iterable iterator to list of page ranges for a page blob.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
|||
|
*
|
|||
|
* .byPage() returns an async iterable iterator to list of page ranges for a page blob.
|
|||
|
*
|
|||
|
* Example using `for await` syntax:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* // Get the pageBlobClient before you run these snippets,
|
|||
|
* // Can be obtained from `blobServiceClient.getContainerClient("<your-container-name>").getPageBlobClient("<your-blob-name>");`
|
|||
|
* let i = 1;
|
|||
|
* for await (const pageRange of pageBlobClient.listPageRanges()) {
|
|||
|
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Example using `iter.next()`:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* let i = 1;
|
|||
|
* let iter = pageBlobClient.listPageRanges();
|
|||
|
* let pageRangeItem = await iter.next();
|
|||
|
* while (!pageRangeItem.done) {
|
|||
|
* console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`);
|
|||
|
* pageRangeItem = await iter.next();
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Example using `byPage()`:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* // passing optional maxPageSize in the page settings
|
|||
|
* let i = 1;
|
|||
|
* for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) {
|
|||
|
* for (const pageRange of response) {
|
|||
|
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
|||
|
* }
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Example using paging with a marker:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* let i = 1;
|
|||
|
* let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 });
|
|||
|
* let response = (await iterator.next()).value;
|
|||
|
*
|
|||
|
* // Prints 2 page ranges
|
|||
|
* for (const pageRange of response) {
|
|||
|
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
|||
|
* }
|
|||
|
*
|
|||
|
* // Gets next marker
|
|||
|
* let marker = response.continuationToken;
|
|||
|
*
|
|||
|
* // Passing next marker as continuationToken
|
|||
|
*
|
|||
|
* iterator = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 });
|
|||
|
* response = (await iterator.next()).value;
|
|||
|
*
|
|||
|
* // Prints 10 page ranges
|
|||
|
* for (const blob of response) {
|
|||
|
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
|||
|
* }
|
|||
|
* ```
|
|||
|
* @param offset - Starting byte position of the page ranges.
|
|||
|
* @param count - Number of bytes to get.
|
|||
|
* @param options - Options to the Page Blob Get Ranges operation.
|
|||
|
* @returns An asyncIterableIterator that supports paging.
|
|||
|
*/listPageRanges(e=0,t,r={}){r.conditions=r.conditions||{};// AsyncIterableIterator to iterate over blobs
|
|||
|
let i=this.listPageRangeItems(e,t,r);return{/**
|
|||
|
* The next method, part of the iteration protocol
|
|||
|
*/next:()=>i.next(),/**
|
|||
|
* The connection to the async iterator, part of the iteration protocol
|
|||
|
*/[Symbol.asyncIterator](){return this;},/**
|
|||
|
* Return an AsyncIterableIterator that works a page at a time
|
|||
|
*/byPage:(i={})=>this.listPageRangeItemSegments(e,t,i.continuationToken,Object.assign({maxPageSize:i.maxPageSize},r))};}/**
|
|||
|
* Gets the collection of page ranges that differ between a specified snapshot and this page blob.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
|||
|
*
|
|||
|
* @param offset - Starting byte position of the page blob
|
|||
|
* @param count - Number of bytes to get ranges diff.
|
|||
|
* @param prevSnapshot - Timestamp of snapshot to retrieve the difference.
|
|||
|
* @param options - Options to the Page Blob Get Page Ranges Diff operation.
|
|||
|
* @returns Response data for the Page Blob Get Page Range Diff operation.
|
|||
|
*/async getPageRangesDiff(e,t,r,i={}){var a;i.conditions=i.conditions||{};let{span:n,updatedOptions:o}=(0,B.createSpan)("PageBlobClient-getPageRangesDiff",i);try{return await this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:null===(a=i.conditions)||void 0===a?void 0:a.tagConditions}),prevsnapshot:r,range:(0,v.rangeToString)({offset:e,count:t})},(0,B.convertTracingToRequestOptionsBase)(o))).then(D.rangeResponseFromModel);}catch(e){throw n.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{n.end();}}/**
|
|||
|
* getPageRangesDiffSegment returns a single segment of page ranges starting from the
|
|||
|
* specified Marker for difference between previous snapshot and the target page blob.
|
|||
|
* Use an empty Marker to start enumeration from the beginning.
|
|||
|
* After getting a segment, process it, and then call getPageRangesDiffSegment again
|
|||
|
* (passing the the previously-returned Marker) to get the next segment.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
|||
|
*
|
|||
|
* @param offset - Starting byte position of the page ranges.
|
|||
|
* @param count - Number of bytes to get.
|
|||
|
* @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
|
|||
|
* @param marker - A string value that identifies the portion of the get to be returned with the next get operation.
|
|||
|
* @param options - Options to the Page Blob Get Page Ranges Diff operation.
|
|||
|
*/async listPageRangesDiffSegment(e,t,r,i,a){var n;let{span:o,updatedOptions:s}=(0,B.createSpan)("PageBlobClient-getPageRangesDiffSegment",a);try{return await this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:null==a?void 0:a.abortSignal,leaseAccessConditions:null==a?void 0:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},null==a?void 0:a.conditions),{ifTags:null===(n=null==a?void 0:a.conditions)||void 0===n?void 0:n.tagConditions}),prevsnapshot:r,range:(0,v.rangeToString)({offset:e,count:t}),marker:i,maxPageSize:null==a?void 0:a.maxPageSize},(0,B.convertTracingToRequestOptionsBase)(s)));}catch(e){throw o.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{o.end();}}/**
|
|||
|
* Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel}
|
|||
|
*
|
|||
|
*
|
|||
|
* @param offset - Starting byte position of the page ranges.
|
|||
|
* @param count - Number of bytes to get.
|
|||
|
* @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
|
|||
|
* @param marker - A string value that identifies the portion of
|
|||
|
* the get of page ranges to be returned with the next getting operation. The
|
|||
|
* operation returns the ContinuationToken value within the response body if the
|
|||
|
* getting operation did not return all page ranges remaining within the current page.
|
|||
|
* The ContinuationToken value can be used as the value for
|
|||
|
* the marker parameter in a subsequent call to request the next page of get
|
|||
|
* items. The marker value is opaque to the client.
|
|||
|
* @param options - Options to the Page Blob Get Page Ranges Diff operation.
|
|||
|
*/listPageRangeDiffItemSegments(e,t,i,a,n){return(0,r.__asyncGenerator)(this,arguments,function*(){let o;if(a||void 0===a)do a=(o=yield(0,r.__await)(this.listPageRangesDiffSegment(e,t,i,a,n))).continuationToken,yield yield(0,r.__await)(yield(0,r.__await)(o));while(a);});}/**
|
|||
|
* Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
|
|||
|
*
|
|||
|
* @param offset - Starting byte position of the page ranges.
|
|||
|
* @param count - Number of bytes to get.
|
|||
|
* @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
|
|||
|
* @param options - Options to the Page Blob Get Page Ranges Diff operation.
|
|||
|
*/listPageRangeDiffItems(e,t,i,a){return(0,r.__asyncGenerator)(this,arguments,function*(){let n;try{for(var o,s,u,c=(0,r.__asyncValues)(this.listPageRangeDiffItemSegments(e,t,i,n,a));!(u=yield(0,r.__await)(c.next())).done;){let e=u.value;yield(0,r.__await)(yield*(0,r.__asyncDelegator)((0,r.__asyncValues)((0,N.ExtractPageRangeInfoItems)(e))));}}catch(e){o={error:e};}finally{try{u&&!u.done&&(s=c.return)&&(yield(0,r.__await)(s.call(c)));}finally{if(o)throw o.error;}}});}/**
|
|||
|
* Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
|||
|
*
|
|||
|
* .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.
|
|||
|
*
|
|||
|
* Example using `for await` syntax:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* // Get the pageBlobClient before you run these snippets,
|
|||
|
* // Can be obtained from `blobServiceClient.getContainerClient("<your-container-name>").getPageBlobClient("<your-blob-name>");`
|
|||
|
* let i = 1;
|
|||
|
* for await (const pageRange of pageBlobClient.listPageRangesDiff()) {
|
|||
|
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Example using `iter.next()`:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* let i = 1;
|
|||
|
* let iter = pageBlobClient.listPageRangesDiff();
|
|||
|
* let pageRangeItem = await iter.next();
|
|||
|
* while (!pageRangeItem.done) {
|
|||
|
* console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`);
|
|||
|
* pageRangeItem = await iter.next();
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Example using `byPage()`:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* // passing optional maxPageSize in the page settings
|
|||
|
* let i = 1;
|
|||
|
* for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) {
|
|||
|
* for (const pageRange of response) {
|
|||
|
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
|||
|
* }
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Example using paging with a marker:
|
|||
|
*
|
|||
|
* ```js
|
|||
|
* let i = 1;
|
|||
|
* let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 });
|
|||
|
* let response = (await iterator.next()).value;
|
|||
|
*
|
|||
|
* // Prints 2 page ranges
|
|||
|
* for (const pageRange of response) {
|
|||
|
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
|||
|
* }
|
|||
|
*
|
|||
|
* // Gets next marker
|
|||
|
* let marker = response.continuationToken;
|
|||
|
*
|
|||
|
* // Passing next marker as continuationToken
|
|||
|
*
|
|||
|
* iterator = pageBlobClient.listPageRangesDiff().byPage({ continuationToken: marker, maxPageSize: 10 });
|
|||
|
* response = (await iterator.next()).value;
|
|||
|
*
|
|||
|
* // Prints 10 page ranges
|
|||
|
* for (const blob of response) {
|
|||
|
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
|||
|
* }
|
|||
|
* ```
|
|||
|
* @param offset - Starting byte position of the page ranges.
|
|||
|
* @param count - Number of bytes to get.
|
|||
|
* @param prevSnapshot - Timestamp of snapshot to retrieve the difference.
|
|||
|
* @param options - Options to the Page Blob Get Ranges operation.
|
|||
|
* @returns An asyncIterableIterator that supports paging.
|
|||
|
*/listPageRangesDiff(e,t,r,i={}){i.conditions=i.conditions||{};// AsyncIterableIterator to iterate over blobs
|
|||
|
let a=this.listPageRangeDiffItems(e,t,r,Object.assign({},i));return{/**
|
|||
|
* The next method, part of the iteration protocol
|
|||
|
*/next:()=>a.next(),/**
|
|||
|
* The connection to the async iterator, part of the iteration protocol
|
|||
|
*/[Symbol.asyncIterator](){return this;},/**
|
|||
|
* Return an AsyncIterableIterator that works a page at a time
|
|||
|
*/byPage:(a={})=>this.listPageRangeDiffItemSegments(e,t,r,a.continuationToken,Object.assign({maxPageSize:a.maxPageSize},i))};}/**
|
|||
|
* Gets the collection of page ranges that differ between a specified snapshot and this page blob for managed disks.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
|||
|
*
|
|||
|
* @param offset - Starting byte position of the page blob
|
|||
|
* @param count - Number of bytes to get ranges diff.
|
|||
|
* @param prevSnapshotUrl - URL of snapshot to retrieve the difference.
|
|||
|
* @param options - Options to the Page Blob Get Page Ranges Diff operation.
|
|||
|
* @returns Response data for the Page Blob Get Page Range Diff operation.
|
|||
|
*/async getPageRangesDiffForManagedDisks(e,t,r,i={}){var a;i.conditions=i.conditions||{};let{span:n,updatedOptions:o}=(0,B.createSpan)("PageBlobClient-GetPageRangesDiffForManagedDisks",i);try{return await this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:null===(a=i.conditions)||void 0===a?void 0:a.tagConditions}),prevSnapshotUrl:r,range:(0,v.rangeToString)({offset:e,count:t})},(0,B.convertTracingToRequestOptionsBase)(o))).then(D.rangeResponseFromModel);}catch(e){throw n.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{n.end();}}/**
|
|||
|
* Resizes the page blob to the specified size (which must be a multiple of 512).
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties
|
|||
|
*
|
|||
|
* @param size - Target size
|
|||
|
* @param options - Options to the Page Blob Resize operation.
|
|||
|
* @returns Response data for the Page Blob Resize operation.
|
|||
|
*/async resize(e,t={}){var r;t.conditions=t.conditions||{};let{span:i,updatedOptions:a}=(0,B.createSpan)("PageBlobClient-resize",t);try{return await this.pageBlobContext.resize(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions}),encryptionScope:t.encryptionScope},(0,B.convertTracingToRequestOptionsBase)(a)));}catch(e){throw i.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{i.end();}}/**
|
|||
|
* Sets a page blob's sequence number.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties
|
|||
|
*
|
|||
|
* @param sequenceNumberAction - Indicates how the service should modify the blob's sequence number.
|
|||
|
* @param sequenceNumber - Required if sequenceNumberAction is max or update
|
|||
|
* @param options - Options to the Page Blob Update Sequence Number operation.
|
|||
|
* @returns Response data for the Page Blob Update Sequence Number operation.
|
|||
|
*/async updateSequenceNumber(e,t,r={}){var i;r.conditions=r.conditions||{};let{span:a,updatedOptions:n}=(0,B.createSpan)("PageBlobClient-updateSequenceNumber",r);try{return await this.pageBlobContext.updateSequenceNumber(e,Object.assign({abortSignal:r.abortSignal,blobSequenceNumber:t,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:null===(i=r.conditions)||void 0===i?void 0:i.tagConditions})},(0,B.convertTracingToRequestOptionsBase)(n)));}catch(e){throw a.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{a.end();}}/**
|
|||
|
* Begins an operation to start an incremental copy from one page blob's snapshot to this page blob.
|
|||
|
* The snapshot is copied such that only the differential changes between the previously
|
|||
|
* copied snapshot are transferred to the destination.
|
|||
|
* The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual.
|
|||
|
* @see https://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob
|
|||
|
* @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots
|
|||
|
*
|
|||
|
* @param copySource - Specifies the name of the source page blob snapshot. For example,
|
|||
|
* https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=<DateTime>
|
|||
|
* @param options - Options to the Page Blob Copy Incremental operation.
|
|||
|
* @returns Response data for the Page Blob Copy Incremental operation.
|
|||
|
*/async startCopyIncremental(e,t={}){var r;let{span:i,updatedOptions:a}=(0,B.createSpan)("PageBlobClient-startCopyIncremental",t);try{return await this.pageBlobContext.copyIncremental(e,Object.assign({abortSignal:t.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(r=t.conditions)||void 0===r?void 0:r.tagConditions})},(0,B.convertTracingToRequestOptionsBase)(a)));}catch(e){throw i.setStatus({code:u.SpanStatusCode.ERROR,message:e.message}),e;}finally{i.end();}}}}),parcelRequire.register("9uR57",function(e,t){$parcel$export(e.exports,"__rest",()=>a),$parcel$export(e.exports,"__await",()=>o),$parcel$export(e.exports,"__asyncGenerator",()=>s),$parcel$export(e.exports,"__asyncDelegator",()=>u),$parcel$export(e.exports,"__asyncValues",()=>c);/******************************************************************************
|
|||
|
Copyright (c) Microsoft Corporation.
|
|||
|
|
|||
|
Permission to use, copy, modify, and/or distribute this software for any
|
|||
|
purpose with or without fee is hereby granted.
|
|||
|
|
|||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|||
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|||
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|||
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|||
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|||
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|||
|
PERFORMANCE OF THIS SOFTWARE.
|
|||
|
***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);})(e,t);},i=function(){return(i=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e;}).apply(this,arguments);};function a(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,i=Object.getOwnPropertySymbols(e);a<i.length;a++)0>t.indexOf(i[a])&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(r[i[a]]=e[i[a]]);return r;}function n(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e};}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function o(e){return this instanceof o?(this.v=e,this):new o(e);}function s(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,a=r.apply(e,t||[]),n=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this;},i;function s(e){a[e]&&(i[e]=function(t){return new Promise(function(r,i){n.push([e,t,r,i])>1||u(e,t);});});}function u(e,t){try{c(a[e](t));}catch(e){d(n[0][3],e);}}function c(e){e.value instanceof o?Promise.resolve(e.value.v).then(l,p):d(n[0][2],e);}function l(e){u("next",e);}function p(e){u("throw",e);}function d(e,t){e(t),n.shift(),n.length&&u(n[0][0],n[0][1]);}}function u(e){var t,r;return t={},i("next"),i("throw",function(e){throw e;}),i("return"),t[Symbol.iterator]=function(){return this;},t;function i(i,a){t[i]=e[i]?function(t){return(r=!r)?{value:o(e[i](t)),done:!1}:a?a(t):t;}:a;}}function c(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=n(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this;},t);function i(r){t[r]=e[r]&&function(t){return new Promise(function(i,n){a(i,n,(t=e[r](t)).done,t.value);});};}function a(e,t,r,i){Promise.resolve(i).then(function(t){e({value:t,done:r});},t);}}"function"==typeof SuppressedError&&SuppressedError;}),parcelRequire.register("lrZDM",function(e,t){var r,i,a,n;$parcel$export(e.exports,"isNode",()=>o),"undefined"!=typeof window&&window.document,"object"==typeof self&&"function"==typeof(null==self?void 0:self.importScripts)&&((null===(r=self.constructor)||void 0===r?void 0:r.name)==="DedicatedWorkerGlobalScope"||(null===(i=self.constructor)||void 0===i?void 0:i.name)==="ServiceWorkerGlobalScope"||null===(a=self.constructor)||void 0===a||a.name);let o="undefined"!=typeof process&&!!process.version&&!!(null===(n=process.versions)||void 0===n?void 0:n.node);"undefined"!=typeof Deno&&void 0!==Deno.version&&Deno.version.deno,"undefined"!=typeof Bun&&Bun.version,"undefined"!=typeof navigator&&(null==navigator||navigator.product);}),parcelRequire.register("4PgmQ",function(e,t){$parcel$export(e.exports,"isTokenCredential",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* Tests an object to determine whether it implements TokenCredential.
|
|||
|
*
|
|||
|
* @param credential - The assumed TokenCredential to be tested.
|
|||
|
*/function r(e){// Check for an object with a 'getToken' function and possibly with
|
|||
|
// a 'signRequest' function. We do this check to make sure that
|
|||
|
// a ServiceClientCredentials implementor (like TokenClientCredentials
|
|||
|
// in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if
|
|||
|
// it doesn't actually implement TokenCredential also.
|
|||
|
let t=e;return t&&"function"==typeof t.getToken&&(void 0===t.signRequest||t.getToken.length>0);}}),parcelRequire.register("1Vc6S",function(e,t){$parcel$export(e.exports,"getDefaultProxySettings",()=>d),$parcel$export(e.exports,"proxyPolicy",()=>m);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8"),i=parcelRequire("9PBIu"),a=parcelRequire("18oFr"),n=parcelRequire("8sP3n");let o=[],s=!1,u=new Map();function c(){if(!process)return;let e=(0,n.getEnvironmentValue)(i.Constants.HTTPS_PROXY),t=(0,n.getEnvironmentValue)(i.Constants.ALL_PROXY),r=(0,n.getEnvironmentValue)(i.Constants.HTTP_PROXY);return e||t||r;}/**
|
|||
|
* Check whether the host of a given `uri` matches any pattern in the no proxy list.
|
|||
|
* If there's a match, any request sent to the same host shouldn't have the proxy settings set.
|
|||
|
* This implementation is a port of https://github.com/Azure/azure-sdk-for-net/blob/8cca811371159e527159c7eb65602477898683e2/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxy.cs#L210
|
|||
|
*/function l(e,t,r){if(0===t.length)return!1;let i=(0,a.URLBuilder).parse(e).getHost();if(null==r?void 0:r.has(i))return r.get(i);let n=!1;for(let e of t)"."===e[0]?i.endsWith(e)?n=!0:i.length===e.length-1&&i===e.slice(1)&&(n=!0):i===e&&(n=!0);return null==r||r.set(i,n),n;}function p(){let e=(0,n.getEnvironmentValue)(i.Constants.NO_PROXY);return(s=!0,e)?e.split(",").map(e=>e.trim()).filter(e=>e.length):[];}function d(e){if(!e&&!(e=c()))return;let{username:t,password:r,urlWithoutAuth:i}=h(e),n=(0,a.URLBuilder).parse(i),o=n.getScheme()?n.getScheme()+"://":"";return{host:o+n.getHost(),port:Number.parseInt(n.getPort()||"80"),username:t,password:r};}function m(e,t){return e||(e=d()),s||o.push(...p()),{create:(r,i)=>new x(r,i,e,null==t?void 0:t.customNoProxyList)};}function h(e){let t=e.indexOf("@");if(-1===t)return{urlWithoutAuth:e};let r=e.indexOf("://"),i=-1!==r?r+3:0,a=e.substring(i,t),n=a.indexOf(":"),o=-1!==n,s=o?a.substring(0,n):a,u=o?a.substring(n+1):void 0,c=e.substring(0,i)+e.substring(t+1);return{username:s,password:u,urlWithoutAuth:c};}class x extends r.BaseRequestPolicy{constructor(e,t,r,i){super(e,t),this.proxySettings=r,this.customNoProxyList=i;}sendRequest(e){var t;return e.proxySettings||l(e.url,null!==(t=this.customNoProxyList)&&void 0!==t?t:o,this.customNoProxyList?void 0:u)||(e.proxySettings=this.proxySettings),this._nextPolicy.sendRequest(e);}}}),parcelRequire.register("42Oo8",function(e,t){$parcel$export(e.exports,"BaseRequestPolicy",()=>i),$parcel$export(e.exports,"RequestPolicyOptions",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("4QB3s");class i{/**
|
|||
|
* The main method to implement that manipulates a request/response.
|
|||
|
*/constructor(/**
|
|||
|
* The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.
|
|||
|
*/e,/**
|
|||
|
* The options that can be passed to a given request policy.
|
|||
|
*/t){this._nextPolicy=e,this._options=t;}/**
|
|||
|
* Get whether or not a log with the provided log level should be logged.
|
|||
|
* @param logLevel - The log level of the log that will be logged.
|
|||
|
* @returns Whether or not a log with the provided log level should be logged.
|
|||
|
*/shouldLog(e){return this._options.shouldLog(e);}/**
|
|||
|
* Attempt to log the provided message to the provided logger. If no logger was provided or if
|
|||
|
* the log level does not meat the logger's threshold, then nothing will be logged.
|
|||
|
* @param logLevel - The log level of this log.
|
|||
|
* @param message - The message of this log.
|
|||
|
*/log(e,t){this._options.log(e,t);}}class a{constructor(e){this._logger=e;}/**
|
|||
|
* Get whether or not a log with the provided log level should be logged.
|
|||
|
* @param logLevel - The log level of the log that will be logged.
|
|||
|
* @returns Whether or not a log with the provided log level should be logged.
|
|||
|
*/shouldLog(e){return!!this._logger&&e!==r.HttpPipelineLogLevel.OFF&&e<=this._logger.minimumLogLevel;}/**
|
|||
|
* Attempt to log the provided message to the provided logger. If no logger was provided or if
|
|||
|
* the log level does not meet the logger's threshold, then nothing will be logged.
|
|||
|
* @param logLevel - The log level of this log.
|
|||
|
* @param message - The message of this log.
|
|||
|
*/log(e,t){this._logger&&this.shouldLog(e)&&this._logger.log(e,t);}}}),parcelRequire.register("4QB3s",function(e,t){var r;$parcel$export(e.exports,"HttpPipelineLogLevel",()=>r),function(e){/**
|
|||
|
* A log level that indicates that no logs will be logged.
|
|||
|
*/e[e.OFF=0]="OFF",/**
|
|||
|
* An error log.
|
|||
|
*/e[e.ERROR=1]="ERROR",/**
|
|||
|
* A warning log.
|
|||
|
*/e[e.WARNING=2]="WARNING",/**
|
|||
|
* An information log.
|
|||
|
*/e[e.INFO=3]="INFO";}(r||(r={}));}),parcelRequire.register("9PBIu",function(e,t){$parcel$export(e.exports,"Constants",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* A set of constants used internally when processing requests.
|
|||
|
*/let r={/**
|
|||
|
* The core-http version
|
|||
|
*/coreHttpVersion:"3.0.3",/**
|
|||
|
* Specifies HTTP.
|
|||
|
*/HTTP:"http:",/**
|
|||
|
* Specifies HTTPS.
|
|||
|
*/HTTPS:"https:",/**
|
|||
|
* Specifies HTTP Proxy.
|
|||
|
*/HTTP_PROXY:"HTTP_PROXY",/**
|
|||
|
* Specifies HTTPS Proxy.
|
|||
|
*/HTTPS_PROXY:"HTTPS_PROXY",/**
|
|||
|
* Specifies NO Proxy.
|
|||
|
*/NO_PROXY:"NO_PROXY",/**
|
|||
|
* Specifies ALL Proxy.
|
|||
|
*/ALL_PROXY:"ALL_PROXY",HttpConstants:{/**
|
|||
|
* Http Verbs
|
|||
|
*/HttpVerbs:{PUT:"PUT",GET:"GET",DELETE:"DELETE",POST:"POST",MERGE:"MERGE",HEAD:"HEAD",PATCH:"PATCH"},StatusCodes:{TooManyRequests:429,ServiceUnavailable:503}},/**
|
|||
|
* Defines constants for use with HTTP headers.
|
|||
|
*/HeaderConstants:{/**
|
|||
|
* The Authorization header.
|
|||
|
*/AUTHORIZATION:"authorization",AUTHORIZATION_SCHEME:"Bearer",/**
|
|||
|
* The Retry-After response-header field can be used with a 503 (Service
|
|||
|
* Unavailable) or 349 (Too Many Requests) responses to indicate how long
|
|||
|
* the service is expected to be unavailable to the requesting client.
|
|||
|
*/RETRY_AFTER:"Retry-After",/**
|
|||
|
* The UserAgent header.
|
|||
|
*/USER_AGENT:"User-Agent"}};}),parcelRequire.register("18oFr",function(e,t){$parcel$export(e.exports,"URLQuery",()=>i),$parcel$export(e.exports,"URLBuilder",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("8sP3n");class i{constructor(){this._rawQuery={};}/**
|
|||
|
* Get whether or not there any query parameters in this URLQuery.
|
|||
|
*/any(){return Object.keys(this._rawQuery).length>0;}/**
|
|||
|
* Get the keys of the query string.
|
|||
|
*/keys(){return Object.keys(this._rawQuery);}/**
|
|||
|
* Set a query parameter with the provided name and value. If the parameterValue is undefined or
|
|||
|
* empty, then this will attempt to remove an existing query parameter with the provided
|
|||
|
* parameterName.
|
|||
|
*/set(e,t){let r=t;if(e){if(null!=r){let t=Array.isArray(r)?r:r.toString();this._rawQuery[e]=t;}else delete this._rawQuery[e];}}/**
|
|||
|
* Get the value of the query parameter with the provided name. If no parameter exists with the
|
|||
|
* provided parameter name, then undefined will be returned.
|
|||
|
*/get(e){return e?this._rawQuery[e]:void 0;}/**
|
|||
|
* Get the string representation of this query. The return value will not start with a "?".
|
|||
|
*/toString(){let e="";for(let t in this._rawQuery){e&&(e+="&");let r=this._rawQuery[t];if(Array.isArray(r)){let i=[];for(let e of r)i.push(`${t}=${e}`);e+=i.join("&");}else e+=`${t}=${r}`;}return e;}/**
|
|||
|
* Parse a URLQuery from the provided text.
|
|||
|
*/static parse(e){let t=new i();if(e){e.startsWith("?")&&(e=e.substring(1));let r="ParameterName",i="",a="";for(let n=0;n<e.length;++n){let o=e[n];switch(r){case"ParameterName":switch(o){case"=":r="ParameterValue";break;case"&":i="",a="";break;default:i+=o;}break;case"ParameterValue":"&"===o?(t.set(i,a),i="",a="",r="ParameterName"):a+=o;break;default:throw Error("Unrecognized URLQuery parse state: "+r);}}"ParameterValue"===r&&t.set(i,a);}return t;}}class a{/**
|
|||
|
* Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL
|
|||
|
* (such as a host, port, path, or query), those parts will be added to this URL as well.
|
|||
|
*/setScheme(e){e?this.set(e,"SCHEME"):this._scheme=void 0;}/**
|
|||
|
* Get the scheme that has been set in this URL.
|
|||
|
*/getScheme(){return this._scheme;}/**
|
|||
|
* Set the host for this URL. If the provided host contains other parts of a URL (such as a
|
|||
|
* port, path, or query), those parts will be added to this URL as well.
|
|||
|
*/setHost(e){e?this.set(e,"SCHEME_OR_HOST"):this._host=void 0;}/**
|
|||
|
* Get the host that has been set in this URL.
|
|||
|
*/getHost(){return this._host;}/**
|
|||
|
* Set the port for this URL. If the provided port contains other parts of a URL (such as a
|
|||
|
* path or query), those parts will be added to this URL as well.
|
|||
|
*/setPort(e){null==e||""===e?this._port=void 0:this.set(e.toString(),"PORT");}/**
|
|||
|
* Get the port that has been set in this URL.
|
|||
|
*/getPort(){return this._port;}/**
|
|||
|
* Set the path for this URL. If the provided path contains a query, then it will be added to
|
|||
|
* this URL as well.
|
|||
|
*/setPath(e){if(e){let t=e.indexOf("://");if(-1!==t){let r=e.lastIndexOf("/",t);// Make sure to only grab the URL part of the path before setting the state back to SCHEME
|
|||
|
// this will handle cases such as "/a/b/c/https://microsoft.com" => "https://microsoft.com"
|
|||
|
this.set(-1===r?e:e.substr(r+1),"SCHEME");}else this.set(e,"PATH");}else this._path=void 0;}/**
|
|||
|
* Append the provided path to this URL's existing path. If the provided path contains a query,
|
|||
|
* then it will be added to this URL as well.
|
|||
|
*/appendPath(e){if(e){let t=this.getPath();t&&(t.endsWith("/")||(t+="/"),e.startsWith("/")&&(e=e.substring(1)),e=t+e),this.set(e,"PATH");}}/**
|
|||
|
* Get the path that has been set in this URL.
|
|||
|
*/getPath(){return this._path;}/**
|
|||
|
* Set the query in this URL.
|
|||
|
*/setQuery(e){e?this._query=i.parse(e):this._query=void 0;}/**
|
|||
|
* Set a query parameter with the provided name and value in this URL's query. If the provided
|
|||
|
* query parameter value is undefined or empty, then the query parameter will be removed if it
|
|||
|
* existed.
|
|||
|
*/setQueryParameter(e,t){e&&(this._query||(this._query=new i()),this._query.set(e,t));}/**
|
|||
|
* Get the value of the query parameter with the provided query parameter name. If no query
|
|||
|
* parameter exists with the provided name, then undefined will be returned.
|
|||
|
*/getQueryParameterValue(e){return this._query?this._query.get(e):void 0;}/**
|
|||
|
* Get the query in this URL.
|
|||
|
*/getQuery(){return this._query?this._query.toString():void 0;}/**
|
|||
|
* Set the parts of this URL by parsing the provided text using the provided startState.
|
|||
|
*/set(e,t){let r=new s(e,t);for(;r.next();){let e;let t=r.current();if(t)switch(t.type){case"SCHEME":this._scheme=t.text||void 0;break;case"HOST":this._host=t.text||void 0;break;case"PORT":this._port=t.text||void 0;break;case"PATH":e=t.text||void 0,this._path&&"/"!==this._path&&"/"===e||(this._path=e);break;case"QUERY":this._query=i.parse(t.text);break;default:throw Error(`Unrecognized URLTokenType: ${t.type}`);}}}/**
|
|||
|
* Serializes the URL as a string.
|
|||
|
* @returns the URL as a string.
|
|||
|
*/toString(){let e="";return this._scheme&&(e+=`${this._scheme}://`),this._host&&(e+=this._host),this._port&&(e+=`:${this._port}`),this._path&&(this._path.startsWith("/")||(e+="/"),e+=this._path),this._query&&this._query.any()&&(e+=`?${this._query.toString()}`),e;}/**
|
|||
|
* If the provided searchValue is found in this URLBuilder, then replace it with the provided
|
|||
|
* replaceValue.
|
|||
|
*/replaceAll(e,t){e&&(this.setScheme((0,r.replaceAll)(this.getScheme(),e,t)),this.setHost((0,r.replaceAll)(this.getHost(),e,t)),this.setPort((0,r.replaceAll)(this.getPort(),e,t)),this.setPath((0,r.replaceAll)(this.getPath(),e,t)),this.setQuery((0,r.replaceAll)(this.getQuery(),e,t)));}/**
|
|||
|
* Parses a given string URL into a new {@link URLBuilder}.
|
|||
|
*/static parse(e){let t=new a();return t.set(e,"SCHEME_OR_HOST"),t;}}class n{constructor(e,t){this.text=e,this.type=t;}static scheme(e){return new n(e,"SCHEME");}static host(e){return new n(e,"HOST");}static port(e){return new n(e,"PORT");}static path(e){return new n(e,"PATH");}static query(e){return new n(e,"QUERY");}}function o(e){let t=e.charCodeAt(0);return 48/* '0' */<=t&&t<=57||65/* 'A' */<=t&&t<=90||97/* 'a' */<=t&&t<=122;}class s{constructor(e,t){this._text=e,this._textLength=e?e.length:0,this._currentState=null!=t?t:"SCHEME_OR_HOST",this._currentIndex=0;}/**
|
|||
|
* Get the current URLToken this URLTokenizer is pointing at, or undefined if the URLTokenizer
|
|||
|
* hasn't started or has finished tokenizing.
|
|||
|
*/current(){return this._currentToken;}/**
|
|||
|
* Advance to the next URLToken and return whether or not a URLToken was found.
|
|||
|
*/next(){if(c(this))switch(this._currentState){case"SCHEME":f(this);break;case"SCHEME_OR_HOST":g(this);break;case"HOST":D(this);break;case"PORT":y(this);break;case"PATH":b(this);break;case"QUERY":v(this);break;default:throw Error(`Unrecognized URLTokenizerState: ${this._currentState}`);}else this._currentToken=void 0;return!!this._currentToken;}}/**
|
|||
|
* Read the remaining characters from this Tokenizer's character stream.
|
|||
|
*/function u(e){let t="";return e._currentIndex<e._textLength&&(t=e._text.substring(e._currentIndex),e._currentIndex=e._textLength),t;}/**
|
|||
|
* Whether or not this URLTokenizer has a current character.
|
|||
|
*/function c(e){return e._currentIndex<e._textLength;}/**
|
|||
|
* Get the character in the text string at the current index.
|
|||
|
*/function l(e){return e._text[e._currentIndex];}/**
|
|||
|
* Advance to the character in text that is "step" characters ahead. If no step value is provided,
|
|||
|
* then step will default to 1.
|
|||
|
*/function p(e,t){c(e)&&(t||(t=1),e._currentIndex+=t);}/**
|
|||
|
* Starting with the current character, peek "charactersToPeek" number of characters ahead in this
|
|||
|
* Tokenizer's stream of characters.
|
|||
|
*/function d(e,t){let r=e._currentIndex+t;return e._textLength<r&&(r=e._textLength),e._text.substring(e._currentIndex,r);}/**
|
|||
|
* Read characters from this Tokenizer until the end of the stream or until the provided condition
|
|||
|
* is false when provided the current character.
|
|||
|
*/function m(e,t){let r="";for(;c(e);){let i=l(e);if(t(i))r+=i,p(e);else break;}return r;}/**
|
|||
|
* Read characters from this Tokenizer until a non-alphanumeric character or the end of the
|
|||
|
* character stream is reached.
|
|||
|
*/function h(e){return m(e,e=>o(e));}/**
|
|||
|
* Read characters from this Tokenizer until one of the provided terminating characters is read or
|
|||
|
* the end of the character stream is reached.
|
|||
|
*/function x(e,...t){return m(e,e=>-1===t.indexOf(e));}function f(e){let t=h(e);e._currentToken=n.scheme(t),c(e)?e._currentState="HOST":e._currentState="DONE";}function g(e){let t=x(e,":","/","?");c(e)?":"===l(e)?"://"===d(e,3)?(e._currentToken=n.scheme(t),e._currentState="HOST"):(e._currentToken=n.host(t),e._currentState="PORT"):(e._currentToken=n.host(t),"/"===l(e)?e._currentState="PATH":e._currentState="QUERY"):(e._currentToken=n.host(t),e._currentState="DONE");}function D(e){"://"===d(e,3)&&p(e,3);let t=x(e,":","/","?");e._currentToken=n.host(t),c(e)?":"===l(e)?e._currentState="PORT":"/"===l(e)?e._currentState="PATH":e._currentState="QUERY":e._currentState="DONE";}function y(e){":"===l(e)&&p(e);let t=x(e,"/","?");e._currentToken=n.port(t),c(e)?"/"===l(e)?e._currentState="PATH":e._currentState="QUERY":e._currentState="DONE";}function b(e){let t=x(e,"?");e._currentToken=n.path(t),c(e)?e._currentState="QUERY":e._currentState="DONE";}function v(e){"?"===l(e)&&p(e);let t=u(e);e._currentToken=n.query(t),e._currentState="DONE";}}),parcelRequire.register("8sP3n",function(e,t){$parcel$export(e.exports,"isValidUuid",()=>n),$parcel$export(e.exports,"generateUuid",()=>o),$parcel$export(e.exports,"prepareXMLRootList",()=>s),$parcel$export(e.exports,"isDuration",()=>c),$parcel$export(e.exports,"replaceAll",()=>l),$parcel$export(e.exports,"isPrimitiveType",()=>p),$parcel$export(e.exports,"getEnvironmentValue",()=>d),$parcel$export(e.exports,"isObject",()=>m),parcelRequire("9PBIu");var r=parcelRequire("2dg8H"),i=parcelRequire("4dndm");let a=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;function n(e){return a.test(e);}function o(){return(0,i.default)();}function s(e,t,i,a){if(Array.isArray(e)||(e=[e]),!i||!a)return{[t]:e};let n={[t]:e};return n[r.XML_ATTRKEY]={[i]:a},n;}let u=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function c(e){return u.test(e);}function l(e,t,r){return e&&t?e.split(t).join(r||""):e;}function p(e){return"object"!=typeof e&&"function"!=typeof e||null===e;}function d(e){return process.env[e]?process.env[e]:process.env[e.toLowerCase()]?process.env[e.toLowerCase()]:void 0;}function m(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date);}}),parcelRequire.register("2dg8H",function(e,t){$parcel$export(e.exports,"XML_ATTRKEY",()=>r),$parcel$export(e.exports,"XML_CHARKEY",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* Default key used to access the XML attributes.
|
|||
|
*/let r="$",i="_";}),parcelRequire.register("2hiFM",function(e,t){$parcel$export(e.exports,"SpanKind",()=>r),$parcel$export(e.exports,"setSpan",()=>o),$parcel$export(e.exports,"isSpanContextValid",()=>s),$parcel$export(e.exports,"getTracer",()=>u),$parcel$export(e.exports,"context",()=>c),$parcel$export(e.exports,"SpanStatusCode",()=>i),// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
parcelRequire("d10no");var r,i,a=parcelRequire("bYZ28"),n=parcelRequire("o2G7a");function o(e,t){return(0,a.trace).setSpan(e,t);}function s(e){return(0,a.trace).isSpanContextValid(e);}function u(e,t){return(0,a.trace).getTracer(e||"azure/core-tracing",t);}!function(e){/** Default value. Indicates that the span is used internally. */e[e.INTERNAL=0]="INTERNAL",/**
|
|||
|
* Indicates that the span covers server-side handling of an RPC or other
|
|||
|
* remote request.
|
|||
|
*/e[e.SERVER=1]="SERVER",/**
|
|||
|
* Indicates that the span covers the client-side wrapper around an RPC or
|
|||
|
* other remote request.
|
|||
|
*/e[e.CLIENT=2]="CLIENT",/**
|
|||
|
* Indicates that the span describes producer sending a message to a
|
|||
|
* broker. Unlike client and server, there is no direct critical path latency
|
|||
|
* relationship between producer and consumer spans.
|
|||
|
*/e[e.PRODUCER=3]="PRODUCER",/**
|
|||
|
* Indicates that the span describes consumer receiving a message from a
|
|||
|
* broker. Unlike client and server, there is no direct critical path latency
|
|||
|
* relationship between producer and consumer spans.
|
|||
|
*/e[e.CONSUMER=4]="CONSUMER";}(r||(r={}));let c=n.context;!function(e){/**
|
|||
|
* The default status.
|
|||
|
*/e[e.UNSET=0]="UNSET",/**
|
|||
|
* The operation has been validated by an Application developer or
|
|||
|
* Operator to have completed successfully.
|
|||
|
*/e[e.OK=1]="OK",/**
|
|||
|
* The operation contains an error.
|
|||
|
*/e[e.ERROR=2]="ERROR";}(i||(i={}));}),parcelRequire.register("d10no",function(e,t){$parcel$export(e.exports,"context",()=>parcelRequire("o2G7a").context),$parcel$export(e.exports,"trace",()=>parcelRequire("bYZ28").trace),parcelRequire("5PlQC");var r=parcelRequire("o2G7a"),i=parcelRequire("2h348"),a=parcelRequire("4aj4O"),n=parcelRequire("lxXwI"),o=parcelRequire("bYZ28");r.context,i.diag,a.metrics,n.propagation,o.trace;}),parcelRequire.register("5PlQC",function(e,t){$parcel$export(e.exports,"INVALID_SPANID",()=>i),$parcel$export(e.exports,"INVALID_TRACEID",()=>a),$parcel$export(e.exports,"INVALID_SPAN_CONTEXT",()=>n);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("81NGw"),i="0000000000000000",a="00000000000000000000000000000000",n={traceId:a,spanId:i,traceFlags:r.TraceFlags.NONE};}),parcelRequire.register("81NGw",function(e,t){var r;$parcel$export(e.exports,"TraceFlags",()=>r),function(e){/** Represents no flag set. */e[e.NONE=0]="NONE",/** Bit to represent whether trace is sampled in trace flags. */e[e.SAMPLED=1]="SAMPLED";}(r||(r={}));}),parcelRequire.register("o2G7a",function(e,t){$parcel$export(e.exports,"context",()=>r);var r=(0,parcelRequire("72h6l").ContextAPI).getInstance();}),parcelRequire.register("72h6l",function(e,t){$parcel$export(e.exports,"ContextAPI",()=>c);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("dO1zU"),i=parcelRequire("dvcyp"),a=parcelRequire("6APkH"),n=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,a,n=r.call(e),o=[];try{for(;(void 0===t||t-->0)&&!(i=n.next()).done;)o.push(i.value);}catch(e){a={error:e};}finally{try{i&&!i.done&&(r=n.return)&&r.call(n);}finally{if(a)throw a.error;}}return o;},o=function(e,t,r){if(r||2==arguments.length)for(var i,a=0,n=t.length;a<n;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t));},s="context",u=new r.NoopContextManager(),c=/** @class */function(){/** Empty private constructor prevents end users from constructing a new instance of the API */function e(){}return(/** Get the singleton instance of the Context API */e.getInstance=function(){return this._instance||(this._instance=new e()),this._instance;},/**
|
|||
|
* Set the current context manager.
|
|||
|
*
|
|||
|
* @returns true if the context manager was successfully registered, else false
|
|||
|
*/e.prototype.setGlobalContextManager=function(e){return(0,i.registerGlobal)(s,e,(0,a.DiagAPI).instance());},/**
|
|||
|
* Get the currently active context
|
|||
|
*/e.prototype.active=function(){return this._getContextManager().active();},/**
|
|||
|
* Execute a function with an active context
|
|||
|
*
|
|||
|
* @param context context to be active during function execution
|
|||
|
* @param fn function to execute in a context
|
|||
|
* @param thisArg optional receiver to be used for calling fn
|
|||
|
* @param args optional arguments forwarded to fn
|
|||
|
*/e.prototype.with=function(e,t,r){for(var i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];return(i=this._getContextManager()).with.apply(i,o([e,t,r],n(a),!1));},/**
|
|||
|
* Bind a context to a target function or event emitter
|
|||
|
*
|
|||
|
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|||
|
* @param target function or event emitter to bind
|
|||
|
*/e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t);},e.prototype._getContextManager=function(){return(0,i.getGlobal)(s)||u;},/** Disable and remove the global context manager */e.prototype.disable=function(){this._getContextManager().disable(),(0,i.unregisterGlobal)(s,(0,a.DiagAPI).instance());},e);}();}),parcelRequire.register("dO1zU",function(e,t){$parcel$export(e.exports,"NoopContextManager",()=>n);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("9NuL1"),i=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,a,n=r.call(e),o=[];try{for(;(void 0===t||t-->0)&&!(i=n.next()).done;)o.push(i.value);}catch(e){a={error:e};}finally{try{i&&!i.done&&(r=n.return)&&r.call(n);}finally{if(a)throw a.error;}}return o;},a=function(e,t,r){if(r||2==arguments.length)for(var i,a=0,n=t.length;a<n;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t));},n=/** @class */function(){function e(){}return e.prototype.active=function(){return r.ROOT_CONTEXT;},e.prototype.with=function(e,t,r){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];return t.call.apply(t,a([r],i(n),!1));},e.prototype.bind=function(e,t){return t;},e.prototype.enable=function(){return this;},e.prototype.disable=function(){return this;},e;}();}),parcelRequire.register("9NuL1",function(e,t){/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/ /** Get a key to uniquely identify a context value */function r(e){// The specification states that for the same input, multiple calls should
|
|||
|
// return different keys. Due to the nature of the JS dependency management
|
|||
|
// system, this creates problems where multiple versions of some package
|
|||
|
// could hold different keys for the same property.
|
|||
|
//
|
|||
|
// Therefore, we use Symbol.for which returns the same key for the same input.
|
|||
|
return Symbol.for(e);}$parcel$export(e.exports,"createContextKey",()=>r),$parcel$export(e.exports,"ROOT_CONTEXT",()=>i);var i=new(/** @class */function(){/**
|
|||
|
* Construct a new context which inherits values from an optional parent context.
|
|||
|
*
|
|||
|
* @param parentContext a context from which to inherit values
|
|||
|
*/function e(t){// for minification
|
|||
|
var r=this;r._currentContext=t?new Map(t):new Map(),r.getValue=function(e){return r._currentContext.get(e);},r.setValue=function(t,i){var a=new e(r._currentContext);return a._currentContext.set(t,i),a;},r.deleteValue=function(t){var i=new e(r._currentContext);return i._currentContext.delete(t),i;};}return e;}())();}),parcelRequire.register("dvcyp",function(e,t){$parcel$export(e.exports,"registerGlobal",()=>s),$parcel$export(e.exports,"getGlobal",()=>u),$parcel$export(e.exports,"unregisterGlobal",()=>c);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("2zH50"),i=parcelRequire("lNmW8"),a=parcelRequire("hFqQj"),n=Symbol.for("opentelemetry.js.api."+(0,i.VERSION).split(".")[0]),o=r._globalThis;function s(e,t,r,a){void 0===a&&(a=!1);var s,u=o[n]=null!==(s=o[n])&&void 0!==s?s:{version:i.VERSION};if(!a&&u[e]){// already registered an API of this type
|
|||
|
var c=Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(c.stack||c.message),!1;}if(u.version!==i.VERSION){// All registered APIs must be of the same version exactly
|
|||
|
var c=Error("@opentelemetry/api: Registration of version v"+u.version+" for "+e+" does not match previously registered API v"+i.VERSION);return r.error(c.stack||c.message),!1;}return u[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+i.VERSION+"."),!0;}function u(e){var t,r,i=null===(t=o[n])||void 0===t?void 0:t.version;if(i&&(0,a.isCompatible)(i))return null===(r=o[n])||void 0===r?void 0:r[e];}function c(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+i.VERSION+".");var r=o[n];r&&delete r[e];}}),parcelRequire.register("2zH50",function(e,t){$parcel$export(e.exports,"_globalThis",()=>r);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/ /** only globals that common to node and browsers are allowed */ // eslint-disable-next-line node/no-unsupported-features/es-builtins
|
|||
|
var r="object"==typeof globalThis?globalThis:$parcel$global;}),parcelRequire.register("lNmW8",function(e,t){$parcel$export(e.exports,"VERSION",()=>r);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/ // this is autogenerated file, see scripts/version-update.js
|
|||
|
var r="1.4.1";}),parcelRequire.register("hFqQj",function(e,t){$parcel$export(e.exports,"isCompatible",()=>a);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("lNmW8"),i=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,a=function(e){var t=new Set([e]),r=new Set(),a=e.match(i);if(!a)return function(){return!1;};var n={major:+a[1],minor:+a[2],patch:+a[3],prerelease:a[4]};// if ownVersion has a prerelease tag, versions must match exactly
|
|||
|
if(null!=n.prerelease)return function(t){return t===e;};function o(e){return r.add(e),!1;}function s(e){return t.add(e),!0;}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var a=e.match(i);if(!a)// we cannot guarantee compatibility so we always noop
|
|||
|
return o(e);var u={major:+a[1],minor:+a[2],patch:+a[3],prerelease:a[4]};return(// if globalVersion has a prerelease tag, versions must match exactly
|
|||
|
null!=u.prerelease||n.major!==u.major?o(e):0===n.major?n.minor===u.minor&&n.patch<=u.patch?s(e):o(e):n.minor<=u.minor?s(e):o(e));};}(r.VERSION);}),parcelRequire.register("6APkH",function(e,t){$parcel$export(e.exports,"DiagAPI",()=>c);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("aXGSP"),i=parcelRequire("wWHXg"),a=parcelRequire("izZPz"),n=parcelRequire("dvcyp"),o=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,a,n=r.call(e),o=[];try{for(;(void 0===t||t-->0)&&!(i=n.next()).done;)o.push(i.value);}catch(e){a={error:e};}finally{try{i&&!i.done&&(r=n.return)&&r.call(n);}finally{if(a)throw a.error;}}return o;},s=function(e,t,r){if(r||2==arguments.length)for(var i,a=0,n=t.length;a<n;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t));},u="diag",c=/** @class */function(){/**
|
|||
|
* Private internal constructor
|
|||
|
* @private
|
|||
|
*/function e(){function e(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=(0,n.getGlobal)("diag");// shortcut if logger not set
|
|||
|
if(i)return i[e].apply(i,s([],o(t),!1));};}// Using self local variable for minification purposes as 'this' cannot be minified
|
|||
|
var t=this,c=function(e,r){if(void 0===r&&(r={logLevel:a.DiagLogLevel.INFO}),e===t){// There isn't much we can do here.
|
|||
|
// Logging to the console might break the user application.
|
|||
|
// Try to log to self. If a logger was previously registered it will receive the log.
|
|||
|
var o,s,u,c=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(o=c.stack)&&void 0!==o?o:c.message),!1;}"number"==typeof r&&(r={logLevel:r});var l=(0,n.getGlobal)("diag"),p=(0,i.createLogLevelDiagLogger)(null!==(s=r.logLevel)&&void 0!==s?s:a.DiagLogLevel.INFO,e);// There already is an logger registered. We'll let it know before overwriting it.
|
|||
|
if(l&&!r.suppressOverrideMessage){var d=null!==(u=Error().stack)&&void 0!==u?u:"<failed to generate stacktrace>";l.warn("Current logger will be overwritten from "+d),p.warn("Current logger will overwrite one already registered from "+d);}return(0,n.registerGlobal)("diag",p,t,!0);};t.setLogger=c,t.disable=function(){(0,n.unregisterGlobal)(u,t);},t.createComponentLogger=function(e){return new r.DiagComponentLogger(e);},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error");}return(/** Get the singleton instance of the DiagAPI API */e.instance=function(){return this._instance||(this._instance=new e()),this._instance;},e);}();}),parcelRequire.register("aXGSP",function(e,t){$parcel$export(e.exports,"DiagComponentLogger",()=>n);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("dvcyp"),i=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,a,n=r.call(e),o=[];try{for(;(void 0===t||t-->0)&&!(i=n.next()).done;)o.push(i.value);}catch(e){a={error:e};}finally{try{i&&!i.done&&(r=n.return)&&r.call(n);}finally{if(a)throw a.error;}}return o;},a=function(e,t,r){if(r||2==arguments.length)for(var i,a=0,n=t.length;a<n;a++)!i&&a in t||(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t));},n=/** @class */function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger";}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o("debug",this._namespace,e);},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o("error",this._namespace,e);},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o("info",this._namespace,e);},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o("warn",this._namespace,e);},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o("verbose",this._namespace,e);},e;}();function o(e,t,n){var o=(0,r.getGlobal)("diag");// shortcut if logger not set
|
|||
|
if(o)return n.unshift(t),o[e].apply(o,a([],i(n),!1));}}),parcelRequire.register("wWHXg",function(e,t){$parcel$export(e.exports,"createLogLevelDiagLogger",()=>i);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("izZPz");function i(e,t){function i(r,i){var a=t[r];return"function"==typeof a&&e>=i?a.bind(t):function(){};}return e<r.DiagLogLevel.NONE?e=r.DiagLogLevel.NONE:e>r.DiagLogLevel.ALL&&(e=r.DiagLogLevel.ALL),// In case the logger is null or undefined
|
|||
|
t=t||{},{error:i("error",r.DiagLogLevel.ERROR),warn:i("warn",r.DiagLogLevel.WARN),info:i("info",r.DiagLogLevel.INFO),debug:i("debug",r.DiagLogLevel.DEBUG),verbose:i("verbose",r.DiagLogLevel.VERBOSE)};}}),parcelRequire.register("izZPz",function(e,t){var r;$parcel$export(e.exports,"DiagLogLevel",()=>r),function(e){/** Diagnostic Logging level setting to disable all logging (except and forced logs) */e[e.NONE=0]="NONE",/** Identifies an error scenario */e[e.ERROR=30]="ERROR",/** Identifies a warning scenario */e[e.WARN=50]="WARN",/** General informational log message */e[e.INFO=60]="INFO",/** General debug log message */e[e.DEBUG=70]="DEBUG",/**
|
|||
|
* Detailed trace level logging should only be used for development, should only be set
|
|||
|
* in a development environment.
|
|||
|
*/e[e.VERBOSE=80]="VERBOSE",/** Used to set the logging level to include all logging */e[e.ALL=9999]="ALL";}(r||(r={}));}),parcelRequire.register("2h348",function(e,t){$parcel$export(e.exports,"diag",()=>r);var r=(0,parcelRequire("6APkH").DiagAPI).instance();}),parcelRequire.register("4aj4O",function(e,t){$parcel$export(e.exports,"metrics",()=>r);var r=(0,parcelRequire("lEuqz").MetricsAPI).getInstance();}),parcelRequire.register("lEuqz",function(e,t){$parcel$export(e.exports,"MetricsAPI",()=>o);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("5W7RE"),i=parcelRequire("dvcyp"),a=parcelRequire("6APkH"),n="metrics",o=/** @class */function(){/** Empty private constructor prevents end users from constructing a new instance of the API */function e(){}return(/** Get the singleton instance of the Metrics API */e.getInstance=function(){return this._instance||(this._instance=new e()),this._instance;},/**
|
|||
|
* Set the current global meter provider.
|
|||
|
* Returns true if the meter provider was successfully registered, else false.
|
|||
|
*/e.prototype.setGlobalMeterProvider=function(e){return(0,i.registerGlobal)(n,e,(0,a.DiagAPI).instance());},/**
|
|||
|
* Returns the global meter provider.
|
|||
|
*/e.prototype.getMeterProvider=function(){return(0,i.getGlobal)(n)||r.NOOP_METER_PROVIDER;},/**
|
|||
|
* Returns a meter from the global meter provider.
|
|||
|
*/e.prototype.getMeter=function(e,t,r){return this.getMeterProvider().getMeter(e,t,r);},/** Remove the global meter provider */e.prototype.disable=function(){(0,i.unregisterGlobal)(n,(0,a.DiagAPI).instance());},e);}();}),parcelRequire.register("5W7RE",function(e,t){$parcel$export(e.exports,"NOOP_METER_PROVIDER",()=>i);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("exXOw"),i=new(/** @class */function(){function e(){}return e.prototype.getMeter=function(e,t,i){return r.NOOP_METER;},e;}())();}),parcelRequire.register("exXOw",function(e,t){$parcel$export(e.exports,"NOOP_METER",()=>d);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);})(t,r);};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t;}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i());};}(),i=/** @class */function(){function e(){}return(/**
|
|||
|
* @see {@link Meter.createHistogram}
|
|||
|
*/e.prototype.createHistogram=function(e,t){return h;},/**
|
|||
|
* @see {@link Meter.createCounter}
|
|||
|
*/e.prototype.createCounter=function(e,t){return m;},/**
|
|||
|
* @see {@link Meter.createUpDownCounter}
|
|||
|
*/e.prototype.createUpDownCounter=function(e,t){return x;},/**
|
|||
|
* @see {@link Meter.createObservableGauge}
|
|||
|
*/e.prototype.createObservableGauge=function(e,t){return g;},/**
|
|||
|
* @see {@link Meter.createObservableCounter}
|
|||
|
*/e.prototype.createObservableCounter=function(e,t){return f;},/**
|
|||
|
* @see {@link Meter.createObservableUpDownCounter}
|
|||
|
*/e.prototype.createObservableUpDownCounter=function(e,t){return D;},/**
|
|||
|
* @see {@link Meter.addBatchObservableCallback}
|
|||
|
*/e.prototype.addBatchObservableCallback=function(e,t){},/**
|
|||
|
* @see {@link Meter.removeBatchObservableCallback}
|
|||
|
*/e.prototype.removeBatchObservableCallback=function(e){},e);}(),a=/** @class */function(){return function(){};}(),n=/** @class */function(e){function t(){return null!==e&&e.apply(this,arguments)||this;}return r(t,e),t.prototype.add=function(e,t){},t;}(a),o=/** @class */function(e){function t(){return null!==e&&e.apply(this,arguments)||this;}return r(t,e),t.prototype.add=function(e,t){},t;}(a),s=/** @class */function(e){function t(){return null!==e&&e.apply(this,arguments)||this;}return r(t,e),t.prototype.record=function(e,t){},t;}(a),u=/** @class */function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e;}(),c=/** @class */function(e){function t(){return null!==e&&e.apply(this,arguments)||this;}return r(t,e),t;}(u),l=/** @class */function(e){function t(){return null!==e&&e.apply(this,arguments)||this;}return r(t,e),t;}(u),p=/** @class */function(e){function t(){return null!==e&&e.apply(this,arguments)||this;}return r(t,e),t;}(u),d=new i(),m=new n(),h=new s(),x=new o(),f=new c(),g=new l(),D=new p();}),parcelRequire.register("lxXwI",function(e,t){$parcel$export(e.exports,"propagation",()=>r);var r=(0,parcelRequire("632O2").PropagationAPI).getInstance();}),parcelRequire.register("632O2",function(e,t){$parcel$export(e.exports,"PropagationAPI",()=>l);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("dvcyp"),i=parcelRequire("iynhm"),a=parcelRequire("5v0TN"),n=parcelRequire("yBBjw"),o=parcelRequire("4BDad"),s=parcelRequire("6APkH"),u="propagation",c=new i.NoopTextMapPropagator(),l=/** @class */function(){/** Empty private constructor prevents end users from constructing a new instance of the API */function e(){this.createBaggage=o.createBaggage,this.getBaggage=n.getBaggage,this.getActiveBaggage=n.getActiveBaggage,this.setBaggage=n.setBaggage,this.deleteBaggage=n.deleteBaggage;}return(/** Get the singleton instance of the Propagator API */e.getInstance=function(){return this._instance||(this._instance=new e()),this._instance;},/**
|
|||
|
* Set the current propagator.
|
|||
|
*
|
|||
|
* @returns true if the propagator was successfully registered, else false
|
|||
|
*/e.prototype.setGlobalPropagator=function(e){return(0,r.registerGlobal)(u,e,(0,s.DiagAPI).instance());},/**
|
|||
|
* Inject context into a carrier to be propagated inter-process
|
|||
|
*
|
|||
|
* @param context Context carrying tracing data to inject
|
|||
|
* @param carrier carrier to inject context into
|
|||
|
* @param setter Function used to set values on the carrier
|
|||
|
*/e.prototype.inject=function(e,t,r){return void 0===r&&(r=a.defaultTextMapSetter),this._getGlobalPropagator().inject(e,t,r);},/**
|
|||
|
* Extract context from a carrier
|
|||
|
*
|
|||
|
* @param context Context which the newly created context will inherit from
|
|||
|
* @param carrier Carrier to extract context from
|
|||
|
* @param getter Function used to extract keys from a carrier
|
|||
|
*/e.prototype.extract=function(e,t,r){return void 0===r&&(r=a.defaultTextMapGetter),this._getGlobalPropagator().extract(e,t,r);},/**
|
|||
|
* Return a list of all fields which may be used by the propagator.
|
|||
|
*/e.prototype.fields=function(){return this._getGlobalPropagator().fields();},/** Remove the global propagator */e.prototype.disable=function(){(0,r.unregisterGlobal)(u,(0,s.DiagAPI).instance());},e.prototype._getGlobalPropagator=function(){return(0,r.getGlobal)(u)||c;},e);}();}),parcelRequire.register("iynhm",function(e,t){$parcel$export(e.exports,"NoopTextMapPropagator",()=>r);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/ /**
|
|||
|
* No-op implementations of {@link TextMapPropagator}.
|
|||
|
*/var r=/** @class */function(){function e(){}return(/** Noop inject function does nothing */e.prototype.inject=function(e,t){},/** Noop extract function does nothing and returns the input context */e.prototype.extract=function(e,t){return e;},e.prototype.fields=function(){return[];},e);}();}),parcelRequire.register("5v0TN",function(e,t){$parcel$export(e.exports,"defaultTextMapGetter",()=>r),$parcel$export(e.exports,"defaultTextMapSetter",()=>i);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r={get:function(e,t){if(null!=e)return e[t];},keys:function(e){return null==e?[]:Object.keys(e);}},i={set:function(e,t,r){null!=e&&(e[t]=r);}};}),parcelRequire.register("yBBjw",function(e,t){$parcel$export(e.exports,"getBaggage",()=>a),$parcel$export(e.exports,"getActiveBaggage",()=>n),$parcel$export(e.exports,"setBaggage",()=>o),$parcel$export(e.exports,"deleteBaggage",()=>s);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("72h6l"),i=(0,parcelRequire("9NuL1").createContextKey)("OpenTelemetry Baggage Key");function a(e){return e.getValue(i)||void 0;}function n(){return a((0,r.ContextAPI).getInstance().active());}function o(e,t){return e.setValue(i,t);}function s(e){return e.deleteValue(i);}}),parcelRequire.register("4BDad",function(e,t){$parcel$export(e.exports,"createBaggage",()=>a);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("6APkH"),i=parcelRequire("elPA9");function a(e){return void 0===e&&(e={}),new i.BaggageImpl(new Map(Object.entries(e)));}parcelRequire("czXeZ"),(0,r.DiagAPI).instance();}),parcelRequire.register("elPA9",function(e,t){$parcel$export(e.exports,"BaggageImpl",()=>a);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,a,n=r.call(e),o=[];try{for(;(void 0===t||t-->0)&&!(i=n.next()).done;)o.push(i.value);}catch(e){a={error:e};}finally{try{i&&!i.done&&(r=n.return)&&r.call(n);}finally{if(a)throw a.error;}}return o;},i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e};}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");},a=/** @class */function(){function e(e){this._entries=e?new Map(e):new Map();}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t);},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=r(e,2);return[t[0],t[1]];});},e.prototype.setEntry=function(t,r){var i=new e(this._entries);return i._entries.set(t,r),i;},e.prototype.removeEntry=function(t){var r=new e(this._entries);return r._entries.delete(t),r;},e.prototype.removeEntries=function(){for(var t,r,a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];var o=new e(this._entries);try{for(var s=i(a),u=s.next();!u.done;u=s.next()){var c=u.value;o._entries.delete(c);}}catch(e){t={error:e};}finally{try{u&&!u.done&&(r=s.return)&&r.call(s);}finally{if(t)throw t.error;}}return o;},e.prototype.clear=function(){return new e();},e;}();}),parcelRequire.register("czXeZ",function(e,t){$parcel$export(e.exports,"baggageEntryMetadataSymbol",()=>r);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/ /**
|
|||
|
* Symbol used to make BaggageEntryMetadata an opaque type
|
|||
|
*/var r=Symbol("BaggageEntryMetadata");}),parcelRequire.register("bYZ28",function(e,t){$parcel$export(e.exports,"trace",()=>r);var r=(0,parcelRequire("jFmyP").TraceAPI).getInstance();}),parcelRequire.register("jFmyP",function(e,t){$parcel$export(e.exports,"TraceAPI",()=>u);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("dvcyp"),i=parcelRequire("3p2ZM"),a=parcelRequire("7Gaki"),n=parcelRequire("1rF3w"),o=parcelRequire("6APkH"),s="trace",u=/** @class */function(){/** Empty private constructor prevents end users from constructing a new instance of the API */function e(){this._proxyTracerProvider=new i.ProxyTracerProvider(),this.wrapSpanContext=a.wrapSpanContext,this.isSpanContextValid=a.isSpanContextValid,this.deleteSpan=n.deleteSpan,this.getSpan=n.getSpan,this.getActiveSpan=n.getActiveSpan,this.getSpanContext=n.getSpanContext,this.setSpan=n.setSpan,this.setSpanContext=n.setSpanContext;}return(/** Get the singleton instance of the Trace API */e.getInstance=function(){return this._instance||(this._instance=new e()),this._instance;},/**
|
|||
|
* Set the current global tracer.
|
|||
|
*
|
|||
|
* @returns true if the tracer provider was successfully registered, else false
|
|||
|
*/e.prototype.setGlobalTracerProvider=function(e){var t=(0,r.registerGlobal)(s,this._proxyTracerProvider,(0,o.DiagAPI).instance());return t&&this._proxyTracerProvider.setDelegate(e),t;},/**
|
|||
|
* Returns the global tracer provider.
|
|||
|
*/e.prototype.getTracerProvider=function(){return(0,r.getGlobal)(s)||this._proxyTracerProvider;},/**
|
|||
|
* Returns a tracer from the global tracer provider.
|
|||
|
*/e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t);},/** Remove the global tracer provider */e.prototype.disable=function(){(0,r.unregisterGlobal)(s,(0,o.DiagAPI).instance()),this._proxyTracerProvider=new i.ProxyTracerProvider();},e);}();}),parcelRequire.register("3p2ZM",function(e,t){$parcel$export(e.exports,"ProxyTracerProvider",()=>a);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("fUIQl"),i=new(parcelRequire("7thqo").NoopTracerProvider)(),a=/** @class */function(){function e(){}return(/**
|
|||
|
* Get a {@link ProxyTracer}
|
|||
|
*/e.prototype.getTracer=function(e,t,i){var a;return null!==(a=this.getDelegateTracer(e,t,i))&&void 0!==a?a:new r.ProxyTracer(this,e,t,i);},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:i;},/**
|
|||
|
* Set the delegate tracer provider
|
|||
|
*/e.prototype.setDelegate=function(e){this._delegate=e;},e.prototype.getDelegateTracer=function(e,t,r){var i;return null===(i=this._delegate)||void 0===i?void 0:i.getTracer(e,t,r);},e);}();}),parcelRequire.register("fUIQl",function(e,t){$parcel$export(e.exports,"ProxyTracer",()=>i);var r=new(parcelRequire("8q9Nn").NoopTracer)(),i=/** @class */function(){function e(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i;}return e.prototype.startSpan=function(e,t,r){return this._getTracer().startSpan(e,t,r);},e.prototype.startActiveSpan=function(e,t,r,i){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments);},/**
|
|||
|
* Try to get a tracer from the proxy tracer provider.
|
|||
|
* If the proxy tracer provider has no delegate, return a noop tracer.
|
|||
|
*/e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):r;},e;}();}),parcelRequire.register("8q9Nn",function(e,t){$parcel$export(e.exports,"NoopTracer",()=>s);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("72h6l"),i=parcelRequire("1rF3w"),a=parcelRequire("c2cFl"),n=parcelRequire("7Gaki"),o=(0,r.ContextAPI).getInstance(),s=/** @class */function(){function e(){}return(// startSpan starts a noop span.
|
|||
|
e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=o.active()),null==t?void 0:t.root)return new a.NonRecordingSpan();var s=r&&(0,i.getSpanContext)(r);return u(s)&&(0,n.isSpanContextValid)(s)?new a.NonRecordingSpan(s):new a.NonRecordingSpan();},e.prototype.startActiveSpan=function(e,t,r,a){if(!(arguments.length<2)){2==arguments.length?u=t:3==arguments.length?(n=t,u=r):(n=t,s=r,u=a);var n,s,u,c=null!=s?s:o.active(),l=this.startSpan(e,n,c),p=(0,i.setSpan)(c,l);return o.with(p,u,void 0,l);}},e);}();function u(e){return"object"==typeof e&&"string"==typeof e.spanId&&"string"==typeof e.traceId&&"number"==typeof e.traceFlags;}}),parcelRequire.register("1rF3w",function(e,t){$parcel$export(e.exports,"getSpan",()=>o),$parcel$export(e.exports,"getActiveSpan",()=>s),$parcel$export(e.exports,"setSpan",()=>u),$parcel$export(e.exports,"deleteSpan",()=>c),$parcel$export(e.exports,"setSpanContext",()=>l),$parcel$export(e.exports,"getSpanContext",()=>p);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("9NuL1"),i=parcelRequire("c2cFl"),a=parcelRequire("72h6l"),n=(0,r.createContextKey)("OpenTelemetry Context Key SPAN");function o(e){return e.getValue(n)||void 0;}function s(){return o((0,a.ContextAPI).getInstance().active());}function u(e,t){return e.setValue(n,t);}function c(e){return e.deleteValue(n);}function l(e,t){return u(e,new i.NonRecordingSpan(t));}function p(e){var t;return null===(t=o(e))||void 0===t?void 0:t.spanContext();}}),parcelRequire.register("c2cFl",function(e,t){$parcel$export(e.exports,"NonRecordingSpan",()=>i);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("5PlQC"),i=/** @class */function(){function e(e){void 0===e&&(e=r.INVALID_SPAN_CONTEXT),this._spanContext=e;}return(// Returns a SpanContext.
|
|||
|
e.prototype.spanContext=function(){return this._spanContext;},// By default does nothing
|
|||
|
e.prototype.setAttribute=function(e,t){return this;},// By default does nothing
|
|||
|
e.prototype.setAttributes=function(e){return this;},// By default does nothing
|
|||
|
e.prototype.addEvent=function(e,t){return this;},// By default does nothing
|
|||
|
e.prototype.setStatus=function(e){return this;},// By default does nothing
|
|||
|
e.prototype.updateName=function(e){return this;},// By default does nothing
|
|||
|
e.prototype.end=function(e){},// isRecording always returns false for NonRecordingSpan.
|
|||
|
e.prototype.isRecording=function(){return!1;},// By default does nothing
|
|||
|
e.prototype.recordException=function(e,t){},e);}();}),parcelRequire.register("7Gaki",function(e,t){$parcel$export(e.exports,"isSpanContextValid",()=>u),$parcel$export(e.exports,"wrapSpanContext",()=>c);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("5PlQC"),i=parcelRequire("c2cFl"),a=/^([0-9a-f]{32})$/i,n=/^[0-9a-f]{16}$/i;function o(e){return a.test(e)&&e!==r.INVALID_TRACEID;}function s(e){return n.test(e)&&e!==r.INVALID_SPANID;}function u(e){return o(e.traceId)&&s(e.spanId);}function c(e){return new i.NonRecordingSpan(e);}}),parcelRequire.register("7thqo",function(e,t){$parcel$export(e.exports,"NoopTracerProvider",()=>i);/*
|
|||
|
* Copyright The OpenTelemetry Authors
|
|||
|
*
|
|||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
* you may not use this file except in compliance with the License.
|
|||
|
* You may obtain a copy of the License at
|
|||
|
*
|
|||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|||
|
*
|
|||
|
* Unless required by applicable law or agreed to in writing, software
|
|||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
* See the License for the specific language governing permissions and
|
|||
|
* limitations under the License.
|
|||
|
*/var r=parcelRequire("8q9Nn"),i=/** @class */function(){function e(){}return e.prototype.getTracer=function(e,t,i){return new r.NoopTracer();},e;}();}),parcelRequire.register("3PTyM",function(e,t){$parcel$export(e.exports,"BlobDownloadResponse",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("lrZDM"),i=parcelRequire("e8Rvv");class a{/**
|
|||
|
* Creates an instance of BlobDownloadResponse.
|
|||
|
*
|
|||
|
* @param originalResponse -
|
|||
|
* @param getter -
|
|||
|
* @param offset -
|
|||
|
* @param count -
|
|||
|
* @param options -
|
|||
|
*/constructor(e,t,r,a,n={}){this.originalResponse=e,this.blobDownloadStream=new i.RetriableReadableStream(this.originalResponse.readableStreamBody,t,r,a,n);}/**
|
|||
|
* Indicates that the service supports
|
|||
|
* requests for partial file content.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get acceptRanges(){return this.originalResponse.acceptRanges;}/**
|
|||
|
* Returns if it was previously specified
|
|||
|
* for the file.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get cacheControl(){return this.originalResponse.cacheControl;}/**
|
|||
|
* Returns the value that was specified
|
|||
|
* for the 'x-ms-content-disposition' header and specifies how to process the
|
|||
|
* response.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentDisposition(){return this.originalResponse.contentDisposition;}/**
|
|||
|
* Returns the value that was specified
|
|||
|
* for the Content-Encoding request header.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentEncoding(){return this.originalResponse.contentEncoding;}/**
|
|||
|
* Returns the value that was specified
|
|||
|
* for the Content-Language request header.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentLanguage(){return this.originalResponse.contentLanguage;}/**
|
|||
|
* The current sequence number for a
|
|||
|
* page blob. This header is not returned for block blobs or append blobs.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber;}/**
|
|||
|
* The blob's type. Possible values include:
|
|||
|
* 'BlockBlob', 'PageBlob', 'AppendBlob'.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get blobType(){return this.originalResponse.blobType;}/**
|
|||
|
* The number of bytes present in the
|
|||
|
* response body.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentLength(){return this.originalResponse.contentLength;}/**
|
|||
|
* If the file has an MD5 hash and the
|
|||
|
* request is to read the full file, this response header is returned so that
|
|||
|
* the client can check for message content integrity. If the request is to
|
|||
|
* read a specified range and the 'x-ms-range-get-content-md5' is set to
|
|||
|
* true, then the request returns an MD5 hash for the range, as long as the
|
|||
|
* range size is less than or equal to 4 MB. If neither of these sets of
|
|||
|
* conditions is true, then no value is returned for the 'Content-MD5'
|
|||
|
* header.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentMD5(){return this.originalResponse.contentMD5;}/**
|
|||
|
* Indicates the range of bytes returned if
|
|||
|
* the client requested a subset of the file by setting the Range request
|
|||
|
* header.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentRange(){return this.originalResponse.contentRange;}/**
|
|||
|
* The content type specified for the file.
|
|||
|
* The default content type is 'application/octet-stream'
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentType(){return this.originalResponse.contentType;}/**
|
|||
|
* Conclusion time of the last attempted
|
|||
|
* Copy File operation where this file was the destination file. This value
|
|||
|
* can specify the time of a completed, aborted, or failed copy attempt.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copyCompletedOn(){return this.originalResponse.copyCompletedOn;}/**
|
|||
|
* String identifier for the last attempted Copy
|
|||
|
* File operation where this file was the destination file.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copyId(){return this.originalResponse.copyId;}/**
|
|||
|
* Contains the number of bytes copied and
|
|||
|
* the total bytes in the source in the last attempted Copy File operation
|
|||
|
* where this file was the destination file. Can show between 0 and
|
|||
|
* Content-Length bytes copied.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copyProgress(){return this.originalResponse.copyProgress;}/**
|
|||
|
* URL up to 2KB in length that specifies the
|
|||
|
* source file used in the last attempted Copy File operation where this file
|
|||
|
* was the destination file.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copySource(){return this.originalResponse.copySource;}/**
|
|||
|
* State of the copy operation
|
|||
|
* identified by 'x-ms-copy-id'. Possible values include: 'pending',
|
|||
|
* 'success', 'aborted', 'failed'
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copyStatus(){return this.originalResponse.copyStatus;}/**
|
|||
|
* Only appears when
|
|||
|
* x-ms-copy-status is failed or pending. Describes cause of fatal or
|
|||
|
* non-fatal copy operation failure.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copyStatusDescription(){return this.originalResponse.copyStatusDescription;}/**
|
|||
|
* When a blob is leased,
|
|||
|
* specifies whether the lease is of infinite or fixed duration. Possible
|
|||
|
* values include: 'infinite', 'fixed'.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get leaseDuration(){return this.originalResponse.leaseDuration;}/**
|
|||
|
* Lease state of the blob. Possible
|
|||
|
* values include: 'available', 'leased', 'expired', 'breaking', 'broken'.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get leaseState(){return this.originalResponse.leaseState;}/**
|
|||
|
* The current lease status of the
|
|||
|
* blob. Possible values include: 'locked', 'unlocked'.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get leaseStatus(){return this.originalResponse.leaseStatus;}/**
|
|||
|
* A UTC date/time value generated by the service that
|
|||
|
* indicates the time at which the response was initiated.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get date(){return this.originalResponse.date;}/**
|
|||
|
* The number of committed blocks
|
|||
|
* present in the blob. This header is returned only for append blobs.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount;}/**
|
|||
|
* The ETag contains a value that you can use to
|
|||
|
* perform operations conditionally, in quotes.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get etag(){return this.originalResponse.etag;}/**
|
|||
|
* The number of tags associated with the blob
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get tagCount(){return this.originalResponse.tagCount;}/**
|
|||
|
* The error code.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get errorCode(){return this.originalResponse.errorCode;}/**
|
|||
|
* The value of this header is set to
|
|||
|
* true if the file data and application metadata are completely encrypted
|
|||
|
* using the specified algorithm. Otherwise, the value is set to false (when
|
|||
|
* the file is unencrypted, or if only parts of the file/application metadata
|
|||
|
* are encrypted).
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get isServerEncrypted(){return this.originalResponse.isServerEncrypted;}/**
|
|||
|
* If the blob has a MD5 hash, and if
|
|||
|
* request contains range header (Range or x-ms-range), this response header
|
|||
|
* is returned with the value of the whole blob's MD5 value. This value may
|
|||
|
* or may not be equal to the value returned in Content-MD5 header, with the
|
|||
|
* latter calculated from the requested range.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get blobContentMD5(){return this.originalResponse.blobContentMD5;}/**
|
|||
|
* Returns the date and time the file was last
|
|||
|
* modified. Any operation that modifies the file or its properties updates
|
|||
|
* the last modified time.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get lastModified(){return this.originalResponse.lastModified;}/**
|
|||
|
* Returns the UTC date and time generated by the service that indicates the time at which the blob was
|
|||
|
* last read or written to.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get lastAccessed(){return this.originalResponse.lastAccessed;}/**
|
|||
|
* Returns the date and time the blob was created.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get createdOn(){return this.originalResponse.createdOn;}/**
|
|||
|
* A name-value pair
|
|||
|
* to associate with a file storage object.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get metadata(){return this.originalResponse.metadata;}/**
|
|||
|
* This header uniquely identifies the request
|
|||
|
* that was made and can be used for troubleshooting the request.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get requestId(){return this.originalResponse.requestId;}/**
|
|||
|
* If a client request id header is sent in the request, this header will be present in the
|
|||
|
* response with the same value.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get clientRequestId(){return this.originalResponse.clientRequestId;}/**
|
|||
|
* Indicates the version of the Blob service used
|
|||
|
* to execute the request.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get version(){return this.originalResponse.version;}/**
|
|||
|
* Indicates the versionId of the downloaded blob version.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get versionId(){return this.originalResponse.versionId;}/**
|
|||
|
* Indicates whether version of this blob is a current version.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get isCurrentVersion(){return this.originalResponse.isCurrentVersion;}/**
|
|||
|
* The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned
|
|||
|
* when the blob was encrypted with a customer-provided key.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256;}/**
|
|||
|
* If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to
|
|||
|
* true, then the request returns a crc64 for the range, as long as the range size is less than
|
|||
|
* or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is
|
|||
|
* specified in the same request, it will fail with 400(Bad Request)
|
|||
|
*/get contentCrc64(){return this.originalResponse.contentCrc64;}/**
|
|||
|
* Object Replication Policy Id of the destination blob.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get objectReplicationDestinationPolicyId(){return this.originalResponse.objectReplicationDestinationPolicyId;}/**
|
|||
|
* Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get objectReplicationSourceProperties(){return this.originalResponse.objectReplicationSourceProperties;}/**
|
|||
|
* If this blob has been sealed.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get isSealed(){return this.originalResponse.isSealed;}/**
|
|||
|
* UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get immutabilityPolicyExpiresOn(){return this.originalResponse.immutabilityPolicyExpiresOn;}/**
|
|||
|
* Indicates immutability policy mode.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get immutabilityPolicyMode(){return this.originalResponse.immutabilityPolicyMode;}/**
|
|||
|
* Indicates if a legal hold is present on the blob.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get legalHold(){return this.originalResponse.legalHold;}/**
|
|||
|
* The response body as a browser Blob.
|
|||
|
* Always undefined in node.js.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentAsBlob(){return this.originalResponse.blobBody;}/**
|
|||
|
* The response body as a node.js Readable stream.
|
|||
|
* Always undefined in the browser.
|
|||
|
*
|
|||
|
* It will automatically retry when internal read stream unexpected ends.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get readableStreamBody(){return r.isNode?this.blobDownloadStream:void 0;}/**
|
|||
|
* The HTTP response.
|
|||
|
*/get _response(){return this.originalResponse._response;}}}),parcelRequire.register("e8Rvv",function(e,t){$parcel$export(e.exports,"RetriableReadableStream",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
class r extends $k14yv$stream.Readable{/**
|
|||
|
* Creates an instance of RetriableReadableStream.
|
|||
|
*
|
|||
|
* @param source - The current ReadableStream returned from getter
|
|||
|
* @param getter - A method calling downloading request returning
|
|||
|
* a new ReadableStream from specified offset
|
|||
|
* @param offset - Offset position in original data source to read
|
|||
|
* @param count - How much data in original data source to read
|
|||
|
* @param options -
|
|||
|
*/constructor(e,t,r,i,a={}){super({highWaterMark:a.highWaterMark}),this.retries=0,this.sourceDataHandler=e=>{if(this.options.doInjectErrorOnce){this.options.doInjectErrorOnce=void 0,this.source.pause(),this.source.removeAllListeners("data"),this.source.emit("end");return;}// console.log(
|
|||
|
// `Offset: ${this.offset}, Received ${data.length} from internal stream`
|
|||
|
// );
|
|||
|
this.offset+=e.length,this.onProgress&&this.onProgress({loadedBytes:this.offset-this.start}),this.push(e)||this.source.pause();},this.sourceErrorOrEndHandler=e=>{if(e&&"AbortError"===e.name){this.destroy(e);return;}// console.log(
|
|||
|
// `Source stream emits end or error, offset: ${
|
|||
|
// this.offset
|
|||
|
// }, dest end : ${this.end}`
|
|||
|
// );
|
|||
|
this.removeSourceEventHandlers(),this.offset-1===this.end?this.push(null):this.offset<=this.end?this.retries<this.maxRetryRequests?(this.retries+=1,this.getter(this.offset).then(e=>{this.source=e,this.setSourceEventHandlers();}).catch(e=>{this.destroy(e);})):this.destroy(Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset-1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`)):this.destroy(Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset-1}`));},this.getter=t,this.source=e,this.start=r,this.offset=r,this.end=r+i-1,this.maxRetryRequests=a.maxRetryRequests&&a.maxRetryRequests>=0?a.maxRetryRequests:0,this.onProgress=a.onProgress,this.options=a,this.setSourceEventHandlers();}_read(){this.source.resume();}setSourceEventHandlers(){this.source.on("data",this.sourceDataHandler),this.source.on("end",this.sourceErrorOrEndHandler),this.source.on("error",this.sourceErrorOrEndHandler);}removeSourceEventHandlers(){this.source.removeListener("data",this.sourceDataHandler),this.source.removeListener("end",this.sourceErrorOrEndHandler),this.source.removeListener("error",this.sourceErrorOrEndHandler);}_destroy(e,t){// remove listener from source and release source
|
|||
|
this.removeSourceEventHandlers(),this.source.destroy(),t(null===e?void 0:e);}}}),parcelRequire.register("fJtif",function(e,t){$parcel$export(e.exports,"BlobQueryResponse",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("lrZDM"),i=parcelRequire("gXNtF");class a{/**
|
|||
|
* Creates an instance of BlobQueryResponse.
|
|||
|
*
|
|||
|
* @param originalResponse -
|
|||
|
* @param options -
|
|||
|
*/constructor(e,t={}){this.originalResponse=e,this.blobDownloadStream=new i.BlobQuickQueryStream(this.originalResponse.readableStreamBody,t);}/**
|
|||
|
* Indicates that the service supports
|
|||
|
* requests for partial file content.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get acceptRanges(){return this.originalResponse.acceptRanges;}/**
|
|||
|
* Returns if it was previously specified
|
|||
|
* for the file.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get cacheControl(){return this.originalResponse.cacheControl;}/**
|
|||
|
* Returns the value that was specified
|
|||
|
* for the 'x-ms-content-disposition' header and specifies how to process the
|
|||
|
* response.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentDisposition(){return this.originalResponse.contentDisposition;}/**
|
|||
|
* Returns the value that was specified
|
|||
|
* for the Content-Encoding request header.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentEncoding(){return this.originalResponse.contentEncoding;}/**
|
|||
|
* Returns the value that was specified
|
|||
|
* for the Content-Language request header.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentLanguage(){return this.originalResponse.contentLanguage;}/**
|
|||
|
* The current sequence number for a
|
|||
|
* page blob. This header is not returned for block blobs or append blobs.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber;}/**
|
|||
|
* The blob's type. Possible values include:
|
|||
|
* 'BlockBlob', 'PageBlob', 'AppendBlob'.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get blobType(){return this.originalResponse.blobType;}/**
|
|||
|
* The number of bytes present in the
|
|||
|
* response body.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentLength(){return this.originalResponse.contentLength;}/**
|
|||
|
* If the file has an MD5 hash and the
|
|||
|
* request is to read the full file, this response header is returned so that
|
|||
|
* the client can check for message content integrity. If the request is to
|
|||
|
* read a specified range and the 'x-ms-range-get-content-md5' is set to
|
|||
|
* true, then the request returns an MD5 hash for the range, as long as the
|
|||
|
* range size is less than or equal to 4 MB. If neither of these sets of
|
|||
|
* conditions is true, then no value is returned for the 'Content-MD5'
|
|||
|
* header.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentMD5(){return this.originalResponse.contentMD5;}/**
|
|||
|
* Indicates the range of bytes returned if
|
|||
|
* the client requested a subset of the file by setting the Range request
|
|||
|
* header.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentRange(){return this.originalResponse.contentRange;}/**
|
|||
|
* The content type specified for the file.
|
|||
|
* The default content type is 'application/octet-stream'
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get contentType(){return this.originalResponse.contentType;}/**
|
|||
|
* Conclusion time of the last attempted
|
|||
|
* Copy File operation where this file was the destination file. This value
|
|||
|
* can specify the time of a completed, aborted, or failed copy attempt.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copyCompletedOn(){}/**
|
|||
|
* String identifier for the last attempted Copy
|
|||
|
* File operation where this file was the destination file.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copyId(){return this.originalResponse.copyId;}/**
|
|||
|
* Contains the number of bytes copied and
|
|||
|
* the total bytes in the source in the last attempted Copy File operation
|
|||
|
* where this file was the destination file. Can show between 0 and
|
|||
|
* Content-Length bytes copied.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copyProgress(){return this.originalResponse.copyProgress;}/**
|
|||
|
* URL up to 2KB in length that specifies the
|
|||
|
* source file used in the last attempted Copy File operation where this file
|
|||
|
* was the destination file.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copySource(){return this.originalResponse.copySource;}/**
|
|||
|
* State of the copy operation
|
|||
|
* identified by 'x-ms-copy-id'. Possible values include: 'pending',
|
|||
|
* 'success', 'aborted', 'failed'
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copyStatus(){return this.originalResponse.copyStatus;}/**
|
|||
|
* Only appears when
|
|||
|
* x-ms-copy-status is failed or pending. Describes cause of fatal or
|
|||
|
* non-fatal copy operation failure.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get copyStatusDescription(){return this.originalResponse.copyStatusDescription;}/**
|
|||
|
* When a blob is leased,
|
|||
|
* specifies whether the lease is of infinite or fixed duration. Possible
|
|||
|
* values include: 'infinite', 'fixed'.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get leaseDuration(){return this.originalResponse.leaseDuration;}/**
|
|||
|
* Lease state of the blob. Possible
|
|||
|
* values include: 'available', 'leased', 'expired', 'breaking', 'broken'.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get leaseState(){return this.originalResponse.leaseState;}/**
|
|||
|
* The current lease status of the
|
|||
|
* blob. Possible values include: 'locked', 'unlocked'.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get leaseStatus(){return this.originalResponse.leaseStatus;}/**
|
|||
|
* A UTC date/time value generated by the service that
|
|||
|
* indicates the time at which the response was initiated.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get date(){return this.originalResponse.date;}/**
|
|||
|
* The number of committed blocks
|
|||
|
* present in the blob. This header is returned only for append blobs.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount;}/**
|
|||
|
* The ETag contains a value that you can use to
|
|||
|
* perform operations conditionally, in quotes.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get etag(){return this.originalResponse.etag;}/**
|
|||
|
* The error code.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get errorCode(){return this.originalResponse.errorCode;}/**
|
|||
|
* The value of this header is set to
|
|||
|
* true if the file data and application metadata are completely encrypted
|
|||
|
* using the specified algorithm. Otherwise, the value is set to false (when
|
|||
|
* the file is unencrypted, or if only parts of the file/application metadata
|
|||
|
* are encrypted).
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get isServerEncrypted(){return this.originalResponse.isServerEncrypted;}/**
|
|||
|
* If the blob has a MD5 hash, and if
|
|||
|
* request contains range header (Range or x-ms-range), this response header
|
|||
|
* is returned with the value of the whole blob's MD5 value. This value may
|
|||
|
* or may not be equal to the value returned in Content-MD5 header, with the
|
|||
|
* latter calculated from the requested range.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get blobContentMD5(){return this.originalResponse.blobContentMD5;}/**
|
|||
|
* Returns the date and time the file was last
|
|||
|
* modified. Any operation that modifies the file or its properties updates
|
|||
|
* the last modified time.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get lastModified(){return this.originalResponse.lastModified;}/**
|
|||
|
* A name-value pair
|
|||
|
* to associate with a file storage object.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get metadata(){return this.originalResponse.metadata;}/**
|
|||
|
* This header uniquely identifies the request
|
|||
|
* that was made and can be used for troubleshooting the request.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get requestId(){return this.originalResponse.requestId;}/**
|
|||
|
* If a client request id header is sent in the request, this header will be present in the
|
|||
|
* response with the same value.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get clientRequestId(){return this.originalResponse.clientRequestId;}/**
|
|||
|
* Indicates the version of the File service used
|
|||
|
* to execute the request.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get version(){return this.originalResponse.version;}/**
|
|||
|
* The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned
|
|||
|
* when the blob was encrypted with a customer-provided key.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256;}/**
|
|||
|
* If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to
|
|||
|
* true, then the request returns a crc64 for the range, as long as the range size is less than
|
|||
|
* or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is
|
|||
|
* specified in the same request, it will fail with 400(Bad Request)
|
|||
|
*/get contentCrc64(){return this.originalResponse.contentCrc64;}/**
|
|||
|
* The response body as a browser Blob.
|
|||
|
* Always undefined in node.js.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get blobBody(){}/**
|
|||
|
* The response body as a node.js Readable stream.
|
|||
|
* Always undefined in the browser.
|
|||
|
*
|
|||
|
* It will parse avor data returned by blob query.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get readableStreamBody(){return r.isNode?this.blobDownloadStream:void 0;}/**
|
|||
|
* The HTTP response.
|
|||
|
*/get _response(){return this.originalResponse._response;}}}),parcelRequire.register("gXNtF",function(e,t){$parcel$export(e.exports,"BlobQuickQueryStream",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("6gltH"),i=parcelRequire("4DO95");class a extends $k14yv$stream.Readable{/**
|
|||
|
* Creates an instance of BlobQuickQueryStream.
|
|||
|
*
|
|||
|
* @param source - The current ReadableStream returned from getter
|
|||
|
* @param options -
|
|||
|
*/constructor(e,t={}){super(),this.avroPaused=!0,this.source=e,this.onProgress=t.onProgress,this.onError=t.onError,this.avroReader=new r.AvroReader(new i.AvroReadableFromStream(this.source)),this.avroIter=this.avroReader.parseObjects({abortSignal:t.abortSignal});}_read(){this.avroPaused&&this.readInternal().catch(e=>{this.emit("error",e);});}async readInternal(){let e;this.avroPaused=!1;do{if((e=await this.avroIter.next()).done)break;let t=e.value,r=t.$schema;if("string"!=typeof r)throw Error("Missing schema in avro record.");switch(r){case"com.microsoft.azure.storage.queryBlobContents.resultData":{let e=t.data;if(e instanceof Uint8Array==!1)throw Error("Invalid data in avro result record.");this.push(Buffer.from(e))||(this.avroPaused=!0);}break;case"com.microsoft.azure.storage.queryBlobContents.progress":{let e=t.bytesScanned;if("number"!=typeof e)throw Error("Invalid bytesScanned in avro progress record.");this.onProgress&&this.onProgress({loadedBytes:e});}break;case"com.microsoft.azure.storage.queryBlobContents.end":if(this.onProgress){let e=t.totalBytes;if("number"!=typeof e)throw Error("Invalid totalBytes in avro end record.");this.onProgress({loadedBytes:e});}this.push(null);break;case"com.microsoft.azure.storage.queryBlobContents.error":if(this.onError){let e=t.fatal;if("boolean"!=typeof e)throw Error("Invalid fatal in avro error record.");let r=t.name;if("string"!=typeof r)throw Error("Invalid name in avro error record.");let i=t.description;if("string"!=typeof i)throw Error("Invalid description in avro error record.");let a=t.position;if("number"!=typeof a)throw Error("Invalid position in avro error record.");this.onError({position:a,name:r,isFatal:e,description:i});}break;default:throw Error(`Unknown schema ${r} in avro progress record.`);}}while(!e.done&&!this.avroPaused);}}}),parcelRequire.register("6gltH",function(e,t){$parcel$export(e.exports,"AvroReader",()=>o);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("9uR57");parcelRequire("9p2hp");var i=parcelRequire("kdMbX"),a=parcelRequire("6PkHc"),n=parcelRequire("iqCIj");class o{constructor(e,t,r,i){this._dataStream=e,this._headerStream=t||e,this._initialized=!1,this._blockOffset=r||0,this._objectIndex=i||0,this._initialBlockOffset=r||0;}get blockOffset(){return this._blockOffset;}get objectIndex(){return this._objectIndex;}async initialize(e={}){let t=await(0,a.AvroParser).readFixedBytes(this._headerStream,i.AVRO_INIT_BYTES.length,{abortSignal:e.abortSignal});if(!(0,n.arraysEqual)(t,i.AVRO_INIT_BYTES))throw Error("Stream is not an Avro file.");// File metadata is written as if defined by the following map schema:
|
|||
|
// { "type": "map", "values": "bytes"}
|
|||
|
this._metadata=await(0,a.AvroParser).readMap(this._headerStream,a.AvroParser.readString,{abortSignal:e.abortSignal});// Validate codec
|
|||
|
let r=this._metadata[i.AVRO_CODEC_KEY];if(!(null==r||"null"===r))throw Error("Codecs are not supported");// The 16-byte, randomly-generated sync marker for this file.
|
|||
|
this._syncMarker=await(0,a.AvroParser).readFixedBytes(this._headerStream,i.AVRO_SYNC_MARKER_SIZE,{abortSignal:e.abortSignal});// Parse the schema
|
|||
|
let o=JSON.parse(this._metadata[i.AVRO_SCHEMA_KEY]);if(this._itemType=(0,a.AvroType).fromSchema(o),0===this._blockOffset&&(this._blockOffset=this._initialBlockOffset+this._dataStream.position),this._itemsRemainingInBlock=await(0,a.AvroParser).readLong(this._dataStream,{abortSignal:e.abortSignal}),// skip block length
|
|||
|
await(0,a.AvroParser).readLong(this._dataStream,{abortSignal:e.abortSignal}),this._initialized=!0,this._objectIndex&&this._objectIndex>0)for(let t=0;t<this._objectIndex;t++)await this._itemType.read(this._dataStream,{abortSignal:e.abortSignal}),this._itemsRemainingInBlock--;}hasNext(){return!this._initialized||this._itemsRemainingInBlock>0;}parseObjects(e={}){return(0,r.__asyncGenerator)(this,arguments,function*(){for(this._initialized||(yield(0,r.__await)(this.initialize(e)));this.hasNext();){let t=yield(0,r.__await)(this._itemType.read(this._dataStream,{abortSignal:e.abortSignal}));if(this._itemsRemainingInBlock--,this._objectIndex++,0===this._itemsRemainingInBlock){let t=yield(0,r.__await)((0,a.AvroParser).readFixedBytes(this._dataStream,i.AVRO_SYNC_MARKER_SIZE,{abortSignal:e.abortSignal}));if(this._blockOffset=this._initialBlockOffset+this._dataStream.position,this._objectIndex=0,!(0,n.arraysEqual)(this._syncMarker,t))throw Error("Stream is not a valid Avro file.");try{this._itemsRemainingInBlock=yield(0,r.__await)((0,a.AvroParser).readLong(this._dataStream,{abortSignal:e.abortSignal}));}catch(e){// We hit the end of the stream.
|
|||
|
this._itemsRemainingInBlock=0;}this._itemsRemainingInBlock>0&&(yield(0,r.__await)((0,a.AvroParser).readLong(this._dataStream,{abortSignal:e.abortSignal})));}yield yield(0,r.__await)(t);}});}}}),parcelRequire.register("9p2hp",function(e,t){// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
parcelRequire("d72qk"),parcelRequire("6BYYC");}),parcelRequire.register("d72qk",function(e,t){// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
}),parcelRequire.register("6BYYC",function(e,t){parcelRequire("9uR57");}),parcelRequire.register("kdMbX",function(e,t){$parcel$export(e.exports,"AVRO_SYNC_MARKER_SIZE",()=>r),$parcel$export(e.exports,"AVRO_INIT_BYTES",()=>i),$parcel$export(e.exports,"AVRO_CODEC_KEY",()=>a),$parcel$export(e.exports,"AVRO_SCHEMA_KEY",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
let r=16,i=new Uint8Array([79,98,106,1]),a="avro.codec",n="avro.schema";}),parcelRequire.register("6PkHc",function(e,t){var r,i;$parcel$export(e.exports,"AvroParser",()=>a),$parcel$export(e.exports,"AvroType",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
class a{/**
|
|||
|
* Reads a fixed number of bytes from the stream.
|
|||
|
*
|
|||
|
* @param stream -
|
|||
|
* @param length -
|
|||
|
* @param options -
|
|||
|
*/static async readFixedBytes(e,t,r={}){let i=await e.read(t,{abortSignal:r.abortSignal});if(i.length!==t)throw Error("Hit stream end.");return i;}/**
|
|||
|
* Reads a single byte from the stream.
|
|||
|
*
|
|||
|
* @param stream -
|
|||
|
* @param options -
|
|||
|
*/static async readByte(e,t={}){let r=await a.readFixedBytes(e,1,t);return r[0];}// int and long are stored in variable-length zig-zag coding.
|
|||
|
// variable-length: https://lucene.apache.org/core/3_5_0/fileformats.html#VInt
|
|||
|
// zig-zag: https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types
|
|||
|
static async readZigZagLong(e,t={}){let r,i,n,o=0,s=0;do i=128&(r=await a.readByte(e,t)),o|=(127&r)<<s,s+=7;while(i&&s<28);// bitwise operation only works for 32-bit integers
|
|||
|
if(i){n=268435456;// 2 ** 28.
|
|||
|
do o+=(127&(r=await a.readByte(e,t)))*n,n*=128;while(128&r);let i=(o%2?-(o+1):o)/2;if(i<Number.MIN_SAFE_INTEGER||i>Number.MAX_SAFE_INTEGER)throw Error("Integer overflow.");return i;}return o>>1^-(1&o);}static async readLong(e,t={}){return a.readZigZagLong(e,t);}static async readInt(e,t={}){return a.readZigZagLong(e,t);}static async readNull(){return null;}static async readBoolean(e,t={}){let r=await a.readByte(e,t);if(1===r)return!0;if(0===r)return!1;throw Error("Byte was not a boolean.");}static async readFloat(e,t={}){let r=await a.readFixedBytes(e,4,t),i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.getFloat32(0,!0);// littleEndian = true
|
|||
|
}static async readDouble(e,t={}){let r=await a.readFixedBytes(e,8,t),i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.getFloat64(0,!0);// littleEndian = true
|
|||
|
}static async readBytes(e,t={}){let r=await a.readLong(e,t);if(r<0)throw Error("Bytes size was negative.");return e.read(r,{abortSignal:t.abortSignal});}static async readString(e,t={}){let r=await a.readBytes(e,t),i=new TextDecoder();return i.decode(r);}static async readMapPair(e,t,r={}){let i=await a.readString(e,r),n=await t(e,r);return{key:i,value:n};}static async readMap(e,t,r={}){let i=(e,r={})=>a.readMapPair(e,t,r),n=await a.readArray(e,i,r),o={};for(let e of n)o[e.key]=e.value;return o;}static async readArray(e,t,r={}){let i=[];for(let n=await a.readLong(e,r);0!==n;n=await a.readLong(e,r))for(n<0&&(// Ignore block sizes
|
|||
|
await a.readLong(e,r),n=-n);n--;){let a=await t(e,r);i.push(a);}return i;}}(function(e){e.RECORD="record",e.ENUM="enum",e.ARRAY="array",e.MAP="map",e.UNION="union",e.FIXED="fixed";})(r||(r={})),function(e){e.NULL="null",e.BOOLEAN="boolean",e.INT="int",e.LONG="long",e.FLOAT="float",e.DOUBLE="double",e.BYTES="bytes",e.STRING="string";}(i||(i={}));class n{/**
|
|||
|
* Determines the AvroType from the Avro Schema.
|
|||
|
*/static fromSchema(e){return"string"==typeof e?n.fromStringSchema(e):Array.isArray(e)?n.fromArraySchema(e):n.fromObjectSchema(e);}static fromStringSchema(e){switch(e){case i.NULL:case i.BOOLEAN:case i.INT:case i.LONG:case i.FLOAT:case i.DOUBLE:case i.BYTES:case i.STRING:return new o(e);default:throw Error(`Unexpected Avro type ${e}`);}}static fromArraySchema(e){return new u(e.map(n.fromSchema));}static fromObjectSchema(e){let t=e.type;// Primitives can be defined as strings or objects
|
|||
|
try{return n.fromStringSchema(t);}catch(e){// eslint-disable-line no-empty
|
|||
|
}switch(t){case r.RECORD:if(e.aliases)throw Error(`aliases currently is not supported, schema: ${e}`);if(!e.name)throw Error(`Required attribute 'name' doesn't exist on schema: ${e}`);// eslint-disable-next-line no-case-declarations
|
|||
|
let i={};if(!e.fields)throw Error(`Required attribute 'fields' doesn't exist on schema: ${e}`);for(let t of e.fields)i[t.name]=n.fromSchema(t.type);return new l(i,e.name);case r.ENUM:if(e.aliases)throw Error(`aliases currently is not supported, schema: ${e}`);if(!e.symbols)throw Error(`Required attribute 'symbols' doesn't exist on schema: ${e}`);return new s(e.symbols);case r.MAP:if(!e.values)throw Error(`Required attribute 'values' doesn't exist on schema: ${e}`);return new c(n.fromSchema(e.values));case r.ARRAY:case r.FIXED:default:throw Error(`Unexpected Avro type ${t} in ${e}`);}}}class o extends n{constructor(e){super(),this._primitive=e;}read(e,t={}){switch(this._primitive){case i.NULL:return a.readNull();case i.BOOLEAN:return a.readBoolean(e,t);case i.INT:return a.readInt(e,t);case i.LONG:return a.readLong(e,t);case i.FLOAT:return a.readFloat(e,t);case i.DOUBLE:return a.readDouble(e,t);case i.BYTES:return a.readBytes(e,t);case i.STRING:return a.readString(e,t);default:throw Error("Unknown Avro Primitive");}}}class s extends n{constructor(e){super(),this._symbols=e;}async read(e,t={}){let r=await a.readInt(e,t);return this._symbols[r];}}class u extends n{constructor(e){super(),this._types=e;}async read(e,t={}){// eslint-disable-line @typescript-eslint/ban-types
|
|||
|
let r=await a.readInt(e,t);return this._types[r].read(e,t);}}class c extends n{constructor(e){super(),this._itemType=e;}read(e,t={}){let r=(e,t)=>this._itemType.read(e,t);return a.readMap(e,r,t);}}class l extends n{constructor(e,t){super(),this._fields=e,this._name=t;}async read(e,t={}){let r={};for(let i in r.$schema=this._name,this._fields)Object.prototype.hasOwnProperty.call(this._fields,i)&&(r[i]=await this._fields[i].read(e,t));return r;}}}),parcelRequire.register("iqCIj",function(e,t){$parcel$export(e.exports,"arraysEqual",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
function r(e,t){if(e===t)return!0;// eslint-disable-next-line eqeqeq
|
|||
|
if(null==e||null==t||e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0;}}),parcelRequire.register("4DO95",function(e,t){$parcel$export(e.exports,"AvroReadableFromStream",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("1Gs4H"),i=parcelRequire("708hs");let a=new i.AbortError("Reading from the avro stream was aborted.");class n extends r.AvroReadable{constructor(e){super(),this._readable=e,this._position=0;}toUint8Array(e){return"string"==typeof e?Buffer.from(e):e;}get position(){return this._position;}async read(e,t={}){var r;if(null===(r=t.abortSignal)||void 0===r?void 0:r.aborted)throw a;if(e<0)throw Error(`size parameter should be positive: ${e}`);if(0===e)return new Uint8Array();if(!this._readable.readable)throw Error("Stream no longer readable.");// See if there is already enough data.
|
|||
|
let i=this._readable.read(e);return i?(this._position+=i.length,this.toUint8Array(i)):new Promise((r,i)=>{/* eslint-disable @typescript-eslint/no-use-before-define */let n=()=>{this._readable.removeListener("readable",o),this._readable.removeListener("error",s),this._readable.removeListener("end",s),this._readable.removeListener("close",s),t.abortSignal&&t.abortSignal.removeEventListener("abort",u);},o=()=>{let t=this._readable.read(e);t&&(this._position+=t.length,n(),// callbackChunk.length maybe less than desired size if the stream ends.
|
|||
|
r(this.toUint8Array(t)));},s=()=>{n(),i();},u=()=>{n(),i(a);};this._readable.on("readable",o),this._readable.once("error",s),this._readable.once("end",s),this._readable.once("close",s),t.abortSignal&&t.abortSignal.addEventListener("abort",u);/* eslint-enable @typescript-eslint/no-use-before-define */});}}}),parcelRequire.register("1Gs4H",function(e,t){$parcel$export(e.exports,"AvroReadable",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
class r{}}),parcelRequire.register("708hs",function(e,t){$parcel$export(e.exports,"AbortError",()=>i),$parcel$export(e.exports,"AbortController",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("ftGSl");class i extends Error{constructor(e){super(e),this.name="AbortError";}}class a{// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|||
|
constructor(e){if(this._signal=new r.AbortSignal(),!e)return;for(let t of(Array.isArray(e)||(e=arguments),e))t.aborted?this.abort():t.addEventListener("abort",()=>{this.abort();});}/**
|
|||
|
* The AbortSignal associated with this controller that will signal aborted
|
|||
|
* when the abort method is called on this controller.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get signal(){return this._signal;}/**
|
|||
|
* Signal that any operations passed this controller's associated abort signal
|
|||
|
* to cancel any remaining work and throw an `AbortError`.
|
|||
|
*/abort(){(0,r.abortSignal)(this._signal);}/**
|
|||
|
* Creates a new AbortSignal instance that will abort after the provided ms.
|
|||
|
* @param ms - Elapsed time in milliseconds to trigger an abort.
|
|||
|
*/static timeout(e){let t=new r.AbortSignal(),i=setTimeout(r.abortSignal,e,t);return"function"==typeof i.unref&&i.unref(),t;}}}),parcelRequire.register("ftGSl",function(e,t){$parcel$export(e.exports,"AbortSignal",()=>a),$parcel$export(e.exports,"abortSignal",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/// <reference path="../shims-public.d.ts" />
|
|||
|
let r=new WeakMap(),i=new WeakMap();class a{constructor(){/**
|
|||
|
* onabort event listener.
|
|||
|
*/this.onabort=null,r.set(this,[]),i.set(this,!1);}/**
|
|||
|
* Status of whether aborted or not.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get aborted(){if(!i.has(this))throw TypeError("Expected `this` to be an instance of AbortSignal.");return i.get(this);}/**
|
|||
|
* Creates a new AbortSignal instance that will never be aborted.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/static get none(){return new a();}/**
|
|||
|
* Added new "abort" event listener, only support "abort" event.
|
|||
|
*
|
|||
|
* @param _type - Only support "abort" event
|
|||
|
* @param listener - The listener to be added
|
|||
|
*/addEventListener(e,t){if(!r.has(this))throw TypeError("Expected `this` to be an instance of AbortSignal.");let i=r.get(this);i.push(t);}/**
|
|||
|
* Remove "abort" event listener, only support "abort" event.
|
|||
|
*
|
|||
|
* @param _type - Only support "abort" event
|
|||
|
* @param listener - The listener to be removed
|
|||
|
*/removeEventListener(e,t){if(!r.has(this))throw TypeError("Expected `this` to be an instance of AbortSignal.");let i=r.get(this),a=i.indexOf(t);a>-1&&i.splice(a,1);}/**
|
|||
|
* Dispatches a synthetic event to the AbortSignal.
|
|||
|
*/dispatchEvent(e){throw Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes.");}}function n(e){if(e.aborted)return;e.onabort&&e.onabort.call(e);let t=r.get(e);t&&// (e.g. via removeListener calls) don't affect the listeners
|
|||
|
// we invoke.
|
|||
|
t.slice().forEach(t=>{t.call(e,{type:"abort"});}),i.set(e,!0);}}),parcelRequire.register("lncUR",function(e,t){$parcel$export(e.exports,"AnonymousCredential",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("acV1f"),i=parcelRequire("fkoc5");class a extends i.Credential{/**
|
|||
|
* Creates an {@link AnonymousCredentialPolicy} object.
|
|||
|
*
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
*/create(e,t){return new r.AnonymousCredentialPolicy(e,t);}}}),parcelRequire.register("acV1f",function(e,t){$parcel$export(e.exports,"AnonymousCredentialPolicy",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("fR1l8");class i extends r.CredentialPolicy{/**
|
|||
|
* Creates an instance of AnonymousCredentialPolicy.
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
*/ // The base class has a protected constructor. Adding a public one to enable constructing of this class.
|
|||
|
/* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/constructor(e,t){super(e,t);}}}),parcelRequire.register("fR1l8",function(e,t){$parcel$export(e.exports,"CredentialPolicy",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8");class i extends r.BaseRequestPolicy{/**
|
|||
|
* Sends out request.
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
*/sendRequest(e){return this._nextPolicy.sendRequest(this.signRequest(e));}/**
|
|||
|
* Child classes must implement this method with request signing. This method
|
|||
|
* will be executed in {@link sendRequest}.
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
*/signRequest(e){// Child classes must override this method with request signing. This method
|
|||
|
// will be executed in sendRequest().
|
|||
|
return e;}}}),parcelRequire.register("fkoc5",function(e,t){$parcel$export(e.exports,"Credential",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* Credential is an abstract class for Azure Storage HTTP requests signing. This
|
|||
|
* class will host an credentialPolicyCreator factory which generates CredentialPolicy.
|
|||
|
*/class r{/**
|
|||
|
* Creates a RequestPolicy object.
|
|||
|
*
|
|||
|
* @param _nextPolicy -
|
|||
|
* @param _options -
|
|||
|
*/create(e,t){throw Error("Method should be implemented in children classes.");}}}),parcelRequire.register("cLpTG",function(e,t){$parcel$export(e.exports,"StorageSharedKeyCredential",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("jD4bY"),i=parcelRequire("fkoc5");class a extends i.Credential{/**
|
|||
|
* Creates an instance of StorageSharedKeyCredential.
|
|||
|
* @param accountName -
|
|||
|
* @param accountKey -
|
|||
|
*/constructor(e,t){super(),this.accountName=e,this.accountKey=Buffer.from(t,"base64");}/**
|
|||
|
* Creates a StorageSharedKeyCredentialPolicy object.
|
|||
|
*
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
*/create(e,t){return new r.StorageSharedKeyCredentialPolicy(e,t,this);}/**
|
|||
|
* Generates a hash signature for an HTTP request or for a SAS.
|
|||
|
*
|
|||
|
* @param stringToSign -
|
|||
|
*/computeHMACSHA256(e){return(0,$k14yv$crypto.createHmac)("sha256",this.accountKey).update(e,"utf8").digest("base64");}}}),parcelRequire.register("jD4bY",function(e,t){$parcel$export(e.exports,"StorageSharedKeyCredentialPolicy",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("5MFjo"),i=parcelRequire("e7JkV"),a=parcelRequire("fR1l8");class n extends a.CredentialPolicy{/**
|
|||
|
* Creates an instance of StorageSharedKeyCredentialPolicy.
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
* @param factory -
|
|||
|
*/constructor(e,t,r){super(e,t),this.factory=r;}/**
|
|||
|
* Signs request.
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
*/signRequest(e){e.headers.set(r.HeaderConstants.X_MS_DATE,new Date().toUTCString()),e.body&&("string"==typeof e.body||void 0!==e.body)&&e.body.length>0&&e.headers.set(r.HeaderConstants.CONTENT_LENGTH,Buffer.byteLength(e.body));let t=[e.method.toUpperCase(),this.getHeaderValueToSign(e,r.HeaderConstants.CONTENT_LANGUAGE),this.getHeaderValueToSign(e,r.HeaderConstants.CONTENT_ENCODING),this.getHeaderValueToSign(e,r.HeaderConstants.CONTENT_LENGTH),this.getHeaderValueToSign(e,r.HeaderConstants.CONTENT_MD5),this.getHeaderValueToSign(e,r.HeaderConstants.CONTENT_TYPE),this.getHeaderValueToSign(e,r.HeaderConstants.DATE),this.getHeaderValueToSign(e,r.HeaderConstants.IF_MODIFIED_SINCE),this.getHeaderValueToSign(e,r.HeaderConstants.IF_MATCH),this.getHeaderValueToSign(e,r.HeaderConstants.IF_NONE_MATCH),this.getHeaderValueToSign(e,r.HeaderConstants.IF_UNMODIFIED_SINCE),this.getHeaderValueToSign(e,r.HeaderConstants.RANGE)].join("\n")+"\n"+this.getCanonicalizedHeadersString(e)+this.getCanonicalizedResourceString(e),i=this.factory.computeHMACSHA256(t);// console.log(`[URL]:${request.url}`);
|
|||
|
// console.log(`[HEADERS]:${request.headers.toString()}`);
|
|||
|
// console.log(`[STRING TO SIGN]:${JSON.stringify(stringToSign)}`);
|
|||
|
// console.log(`[KEY]: ${request.headers.get(HeaderConstants.AUTHORIZATION)}`);
|
|||
|
return e.headers.set(r.HeaderConstants.AUTHORIZATION,`SharedKey ${this.factory.accountName}:${i}`),e;}/**
|
|||
|
* Retrieve header value according to shared key sign rules.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
* @param headerName -
|
|||
|
*/getHeaderValueToSign(e,t){let i=e.headers.get(t);return i&&(t!==r.HeaderConstants.CONTENT_LENGTH||"0"!==i)?i:"";}/**
|
|||
|
* To construct the CanonicalizedHeaders portion of the signature string, follow these steps:
|
|||
|
* 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header.
|
|||
|
* 2. Convert each HTTP header name to lowercase.
|
|||
|
* 3. Sort the headers lexicographically by header name, in ascending order.
|
|||
|
* Each header may appear only once in the string.
|
|||
|
* 4. Replace any linear whitespace in the header value with a single space.
|
|||
|
* 5. Trim any whitespace around the colon in the header.
|
|||
|
* 6. Finally, append a new-line character to each canonicalized header in the resulting list.
|
|||
|
* Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string.
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
*/getCanonicalizedHeadersString(e){let t=e.headers.headersArray().filter(e=>e.name.toLowerCase().startsWith(r.HeaderConstants.PREFIX_FOR_STORAGE));t.sort((e,t)=>e.name.toLowerCase().localeCompare(t.name.toLowerCase()));let i="";return(// Remove duplicate headers
|
|||
|
(t=t.filter((e,t,r)=>!(t>0)||e.name.toLowerCase()!==r[t-1].name.toLowerCase())).forEach(e=>{i+=`${e.name.toLowerCase().trimRight()}:${e.value.trimLeft()}
|
|||
|
`;}),i);}/**
|
|||
|
* Retrieves the webResource canonicalized resource string.
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
*/getCanonicalizedResourceString(e){let t=(0,i.getURLPath)(e.url)||"/",r="";r+=`/${this.factory.accountName}${t}`;let a=(0,i.getURLQueries)(e.url),n={};if(a){let e=[];for(let t in a)if(Object.prototype.hasOwnProperty.call(a,t)){let r=t.toLowerCase();n[r]=a[t],e.push(r);}for(let t of(e.sort(),e))r+=`
|
|||
|
${t}:${decodeURIComponent(n[t])}`;}return r;}}}),parcelRequire.register("5MFjo",function(e,t){$parcel$export(e.exports,"SDK_VERSION",()=>r),$parcel$export(e.exports,"SERVICE_VERSION",()=>i),$parcel$export(e.exports,"BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES",()=>a),$parcel$export(e.exports,"BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES",()=>n),$parcel$export(e.exports,"BLOCK_BLOB_MAX_BLOCKS",()=>o),$parcel$export(e.exports,"DEFAULT_BLOCK_BUFFER_SIZE_BYTES",()=>s),$parcel$export(e.exports,"DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES",()=>u),$parcel$export(e.exports,"DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS",()=>c),$parcel$export(e.exports,"REQUEST_TIMEOUT",()=>l),$parcel$export(e.exports,"StorageOAuthScopes",()=>p),$parcel$export(e.exports,"URLConstants",()=>d),$parcel$export(e.exports,"HeaderConstants",()=>m),$parcel$export(e.exports,"ETagNone",()=>h),$parcel$export(e.exports,"ETagAny",()=>x),$parcel$export(e.exports,"EncryptionAlgorithmAES25",()=>f),$parcel$export(e.exports,"DevelopmentConnectionString",()=>g),$parcel$export(e.exports,"StorageBlobLoggingAllowedHeaderNames",()=>D),$parcel$export(e.exports,"StorageBlobLoggingAllowedQueryParameters",()=>y),$parcel$export(e.exports,"BlobUsesCustomerSpecifiedEncryptionMsg",()=>b),$parcel$export(e.exports,"BlobDoesNotUseCustomerSpecifiedEncryption",()=>v),$parcel$export(e.exports,"PathStylePorts",()=>C);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
let r="12.15.0",i="2023-01-03",a=268435456,n=4194304e3,o=5e4,s=8388608,u=4194304,c=5,l=1e5,p="https://storage.azure.com/.default",d={Parameters:{FORCE_BROWSER_NO_CACHE:"_",SIGNATURE:"sig",SNAPSHOT:"snapshot",VERSIONID:"versionid",TIMEOUT:"timeout"}},m={AUTHORIZATION:"Authorization",AUTHORIZATION_SCHEME:"Bearer",CONTENT_ENCODING:"Content-Encoding",CONTENT_ID:"Content-ID",CONTENT_LANGUAGE:"Content-Language",CONTENT_LENGTH:"Content-Length",CONTENT_MD5:"Content-Md5",CONTENT_TRANSFER_ENCODING:"Content-Transfer-Encoding",CONTENT_TYPE:"Content-Type",COOKIE:"Cookie",DATE:"date",IF_MATCH:"if-match",IF_MODIFIED_SINCE:"if-modified-since",IF_NONE_MATCH:"if-none-match",IF_UNMODIFIED_SINCE:"if-unmodified-since",PREFIX_FOR_STORAGE:"x-ms-",RANGE:"Range",USER_AGENT:"User-Agent",X_MS_CLIENT_REQUEST_ID:"x-ms-client-request-id",X_MS_COPY_SOURCE:"x-ms-copy-source",X_MS_DATE:"x-ms-date",X_MS_ERROR_CODE:"x-ms-error-code",X_MS_VERSION:"x-ms-version"},h="",x="*",f="AES256",g="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;",D=["Access-Control-Allow-Origin","Cache-Control","Content-Length","Content-Type","Date","Request-Id","traceparent","Transfer-Encoding","User-Agent","x-ms-client-request-id","x-ms-date","x-ms-error-code","x-ms-request-id","x-ms-return-client-request-id","x-ms-version","Accept-Ranges","Content-Disposition","Content-Encoding","Content-Language","Content-MD5","Content-Range","ETag","Last-Modified","Server","Vary","x-ms-content-crc64","x-ms-copy-action","x-ms-copy-completion-time","x-ms-copy-id","x-ms-copy-progress","x-ms-copy-status","x-ms-has-immutability-policy","x-ms-has-legal-hold","x-ms-lease-state","x-ms-lease-status","x-ms-range","x-ms-request-server-encrypted","x-ms-server-encrypted","x-ms-snapshot","x-ms-source-range","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","x-ms-access-tier","x-ms-access-tier-change-time","x-ms-access-tier-inferred","x-ms-account-kind","x-ms-archive-status","x-ms-blob-append-offset","x-ms-blob-cache-control","x-ms-blob-committed-block-count","x-ms-blob-condition-appendpos","x-ms-blob-condition-maxsize","x-ms-blob-content-disposition","x-ms-blob-content-encoding","x-ms-blob-content-language","x-ms-blob-content-length","x-ms-blob-content-md5","x-ms-blob-content-type","x-ms-blob-public-access","x-ms-blob-sequence-number","x-ms-blob-type","x-ms-copy-destination-snapshot","x-ms-creation-time","x-ms-default-encryption-scope","x-ms-delete-snapshots","x-ms-delete-type-permanent","x-ms-deny-encryption-scope-override","x-ms-encryption-algorithm","x-ms-if-sequence-number-eq","x-ms-if-sequence-number-le","x-ms-if-sequence-number-lt","x-ms-incremental-copy","x-ms-lease-action","x-ms-lease-break-period","x-ms-lease-duration","x-ms-lease-id","x-ms-lease-time","x-ms-page-write","x-ms-proposed-lease-id","x-ms-range-get-content-md5","x-ms-rehydrate-priority","x-ms-sequence-number-action","x-ms-sku-name","x-ms-source-content-md5","x-ms-source-if-match","x-ms-source-if-modified-since","x-ms-source-if-none-match","x-ms-source-if-unmodified-since","x-ms-tag-count","x-ms-encryption-key-sha256","x-ms-if-tags","x-ms-source-if-tags"],y=["comp","maxresults","rscc","rscd","rsce","rscl","rsct","se","si","sip","sp","spr","sr","srt","ss","st","sv","include","marker","prefix","copyid","restype","blockid","blocklisttype","delimiter","prevsnapshot","ske","skoid","sks","skt","sktid","skv","snapshot"],b="BlobUsesCustomerSpecifiedEncryption",v="BlobDoesNotUseCustomerSpecifiedEncryption",C=["10000","10001","10002","10003","10004","10100","10101","10102","10103","10104","11000","11001","11002","11003","11004","11100","11101","11102","11103","11104"];}),parcelRequire.register("e7JkV",function(e,t){$parcel$export(e.exports,"escapeURLPath",()=>n),$parcel$export(e.exports,"extractConnectionStringParts",()=>u),$parcel$export(e.exports,"getAccountNameFromUrl",()=>A),$parcel$export(e.exports,"appendToURLPath",()=>l),$parcel$export(e.exports,"setURLParameter
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("18oFr"),i=parcelRequire("lrZDM");parcelRequire("awoW3");var a=parcelRequire("5MFjo");function n(e){let t=(0,r.URLBuilder).parse(e),i=t.getPath();return i=c(i=i||"/"),t.setPath(i),t.toString();}function o(e){// Development Connection String
|
|||
|
// https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string#connect-to-the-emulator-account-using-the-well-known-account-name-and-key
|
|||
|
let t="";if(-1!==e.search("DevelopmentStorageProxyUri=")){// CONNECTION_STRING=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://myProxyUri
|
|||
|
let r=e.split(";");for(let e of r)e.trim().startsWith("DevelopmentStorageProxyUri=")&&(t=e.trim().match("DevelopmentStorageProxyUri=(.*)")[1]);}return t;}function s(e,t){let r=e.split(";");for(let e of r)if(e.trim().startsWith(t))return e.trim().match(t+"=(.*)")[1];return"";}function u(e){let t="";e.startsWith("UseDevelopmentStorage=true")&&(// Development connection string
|
|||
|
t=o(e),e=a.DevelopmentConnectionString);// Matching BlobEndpoint in the Account connection string
|
|||
|
let r=s(e,"BlobEndpoint");if(// Slicing off '/' at the end if exists
|
|||
|
// (The methods that use `extractConnectionStringParts` expect the url to not have `/` at the end)
|
|||
|
r=r.endsWith("/")?r.slice(0,-1):r,-1!==e.search("DefaultEndpointsProtocol=")&&-1!==e.search("AccountKey=")){// Account connection string
|
|||
|
let i="",a="",n=Buffer.from("accountKey","base64"),o="";if(// Get account name and key
|
|||
|
a=s(e,"AccountName"),n=Buffer.from(s(e,"AccountKey"),"base64"),!r){// BlobEndpoint is not present in the Account connection string
|
|||
|
// Can be obtained from `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`
|
|||
|
i=s(e,"DefaultEndpointsProtocol");let t=i.toLowerCase();if("https"!==t&&"http"!==t)throw Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'");if(!(o=s(e,"EndpointSuffix")))throw Error("Invalid EndpointSuffix in the provided Connection String");r=`${i}://${a}.blob.${o}`;}if(a){if(0===n.length)throw Error("Invalid AccountKey in the provided Connection String");}else throw Error("Invalid AccountName in the provided Connection String");return{kind:"AccountConnString",url:r,accountName:a,accountKey:n,proxyUri:t};}{// SAS connection string
|
|||
|
let t=s(e,"SharedAccessSignature"),i=A(r);if(r){if(!t)throw Error("Invalid SharedAccessSignature in the provided SAS Connection String");}else throw Error("Invalid BlobEndpoint in the provided SAS Connection String");return{kind:"SASConnString",url:r,accountName:i,accountSas:t};}}/**
|
|||
|
* Internal escape method implemented Strategy Two mentioned in escapeURL() description.
|
|||
|
*
|
|||
|
* @param text -
|
|||
|
*/function c(e){return encodeURIComponent(e).replace(/%2F/g,"/")// Don't escape for "/"
|
|||
|
.replace(/'/g,"%27")// Escape for "'"
|
|||
|
.replace(/\+/g,"%20").replace(/%25/g,"%");// Revert encoded "%"
|
|||
|
}function l(e,t){let i=(0,r.URLBuilder).parse(e),a=i.getPath();a=a?a.endsWith("/")?`${a}${t}`:`${a}/${t}`:t,i.setPath(a);let n=new URL(i.toString());return n.toString();}function p(e,t,i){let a=(0,r.URLBuilder).parse(e);return a.setQueryParameter(t,i),a.toString();}function d(e,t){let i=(0,r.URLBuilder).parse(e);return i.getQueryParameterValue(t);}function m(e,t){let i=(0,r.URLBuilder).parse(e);return i.setHost(t),i.toString();}function h(e){let t=(0,r.URLBuilder).parse(e);return t.getPath();}function x(e){let t=(0,r.URLBuilder).parse(e);return t.getScheme();}function f(e){let t=(0,r.URLBuilder).parse(e).getQuery();if(!t)return{};let i=(t=(t=t.trim()).startsWith("?")?t.substr(1):t).split("&");i=i.filter(e=>{let t=e.indexOf("="),r=e.lastIndexOf("=");return t>0&&t===r&&r<e.length-1;});let a={};for(let e of i){let t=e.split("="),r=t[0],i=t[1];a[r]=i;}return a;}function g(e,t){let i=(0,r.URLBuilder).parse(e),a=i.getQuery();return a?a+="&"+t:a=t,i.setQuery(a),i.toString();}function D(e,t=!0){// Date.toISOString() will return like "2018-10-29T06:34:36.139Z"
|
|||
|
let r=e.toISOString();return t?r.substring(0,r.length-1)+"0000Z":r.substring(0,r.length-5)+"Z";}function y(e){return i.isNode?Buffer.from(e).toString("base64"):btoa(e);}function b(e,t){// To generate a 64 bytes base64 string, source string should be 48
|
|||
|
let r=48,i=6,a=r-i;e.length>a&&(e=e.slice(0,a));let n=e+C(t.toString(),r-e.length,"0");return y(n);}async function v(e,t,r){return new Promise((i,a)=>{let n;let o=()=>{void 0!==n&&clearTimeout(n),a(r);},s=()=>{void 0!==t&&t.removeEventListener("abort",o),i();};n=setTimeout(s,e),void 0!==t&&t.addEventListener("abort",o);});}function C(e,t,r=" "){return(// @ts-expect-error: TS doesn't know this code needs to run downlevel sometimes
|
|||
|
String.prototype.padStart?e.padStart(t,r):(r=r||" ",e.length>t)?e:((t-=e.length)>r.length&&(r+=r.repeat(t/r.length)),r.slice(0,t)+e));}function E(e,t){return e.toLocaleLowerCase()===t.toLocaleLowerCase();}function A(e){let t;let i=(0,r.URLBuilder).parse(e);try{return t="blob"===i.getHost().split(".")[1]?i.getHost().split(".")[0]:S(i)?i.getPath().split("/")[1]:"";}catch(e){throw Error("Unable to extract accountName with provided information.");}}function S(e){if(void 0===e.getHost())return!1;let t=e.getHost()+(void 0===e.getPort()?"":":"+e.getPort());// Case 1: Ipv6, use a broad regex to find out candidates whose host contains two ':'.
|
|||
|
// Case 2: localhost(:port), use broad regex to match port part.
|
|||
|
// Case 3: Ipv4, use broad regex which just check if host contains Ipv4.
|
|||
|
// For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.
|
|||
|
return /^.*:.*:.*$|^localhost(:[0-9]+)?$|^(\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])){3}(:[0-9]+)?$/.test(t)||void 0!==e.getPort()&&(0,a.PathStylePorts).includes(e.getPort());}function B(e){if(void 0===e)return;let t=[];for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let i=e[r];t.push(`${encodeURIComponent(r)}=${encodeURIComponent(i)}`);}return t.join("&");}function N(e){if(void 0===e)return;let t={blobTagSet:[]};for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let i=e[r];t.blobTagSet.push({key:r,value:i});}return t;}function F(e){if(void 0===e)return;let t={};for(let r of e.blobTagSet)t[r.key]=r.value;return t;}function w(e){if(void 0!==e)switch(e.kind){case"csv":return{format:{type:"delimited",delimitedTextConfiguration:{columnSeparator:e.columnSeparator||",",fieldQuote:e.fieldQuote||"",recordSeparator:e.recordSeparator,escapeChar:e.escapeCharacter||"",headersPresent:e.hasHeaders||!1}}};case"json":return{format:{type:"json",jsonTextConfiguration:{recordSeparator:e.recordSeparator}}};case"arrow":return{format:{type:"arrow",arrowConfiguration:{schema:e.schema}}};case"parquet":return{format:{type:"parquet"}};default:throw Error("Invalid BlobQueryTextConfiguration.");}}function P(e){if(!e||"policy-id"in e)return;let t=[];for(let r in e){let i=r.split("_"),a="or-";i[0].startsWith(a)&&(i[0]=i[0].substring(a.length));let n={ruleId:i[1],replicationStatus:e[r]},o=t.findIndex(e=>e.policyId===i[0]);o>-1?t[o].rules.push(n):t.push({policyId:i[0],rules:[n]});}return t;}function T(e,t){return e.credential=t,e;}function O(e){return e?e.scheme+" "+e.value:void 0;}function*R(e){let t=[],r=[];e.pageRange&&(t=e.pageRange),e.clearRange&&(r=e.clearRange);let i=0,a=0;for(;i<t.length&&a<r.length;)t[i].start<r[a].start?(yield{start:t[i].start,end:t[i].end,isClear:!1},++i):(yield{start:r[a].start,end:r[a].end,isClear:!0},++a);for(;i<t.length;++i)yield{start:t[i].start,end:t[i].end,isClear:!1};for(;a<r.length;++a)yield{start:r[a].start,end:r[a].end,isClear:!0};}}),parcelRequire.register("awoW3",function(e,t){// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* A collection of HttpHeaders that can be sent with a HTTP request.
|
|||
|
*/function r(e){return e.toLowerCase();}function i(e){if(e&&"object"==typeof e){let t=e;if("function"==typeof t.rawHeaders&&"function"==typeof t.clone&&"function"==typeof t.get&&"function"==typeof t.set&&"function"==typeof t.contains&&"function"==typeof t.remove&&"function"==typeof t.headersArray&&"function"==typeof t.headerValues&&"function"==typeof t.headerNames&&"function"==typeof t.toJson)return!0;}return!1;}$parcel$export(e.exports,"isHttpHeadersLike",()=>i),$parcel$export(e.exports,"HttpHeaders",()=>a);class a{constructor(e){if(this._headersMap={},e)for(let t in e)this.set(t,e[t]);}/**
|
|||
|
* Set a header in this collection with the provided name and value. The name is
|
|||
|
* case-insensitive.
|
|||
|
* @param headerName - The name of the header to set. This value is case-insensitive.
|
|||
|
* @param headerValue - The value of the header to set.
|
|||
|
*/set(e,t){this._headersMap[r(e)]={name:e,value:t.toString()};}/**
|
|||
|
* Get the header value for the provided header name, or undefined if no header exists in this
|
|||
|
* collection with the provided name.
|
|||
|
* @param headerName - The name of the header.
|
|||
|
*/get(e){let t=this._headersMap[r(e)];return t?t.value:void 0;}/**
|
|||
|
* Get whether or not this header collection contains a header entry for the provided header name.
|
|||
|
*/contains(e){return!!this._headersMap[r(e)];}/**
|
|||
|
* Remove the header with the provided headerName. Return whether or not the header existed and
|
|||
|
* was removed.
|
|||
|
* @param headerName - The name of the header to remove.
|
|||
|
*/remove(e){let t=this.contains(e);return delete this._headersMap[r(e)],t;}/**
|
|||
|
* Get the headers that are contained this collection as an object.
|
|||
|
*/rawHeaders(){return this.toJson({preserveCase:!0});}/**
|
|||
|
* Get the headers that are contained in this collection as an array.
|
|||
|
*/headersArray(){let e=[];for(let t in this._headersMap)e.push(this._headersMap[t]);return e;}/**
|
|||
|
* Get the header names that are contained in this collection.
|
|||
|
*/headerNames(){let e=[],t=this.headersArray();for(let r=0;r<t.length;++r)e.push(t[r].name);return e;}/**
|
|||
|
* Get the header values that are contained in this collection.
|
|||
|
*/headerValues(){let e=[],t=this.headersArray();for(let r=0;r<t.length;++r)e.push(t[r].value);return e;}/**
|
|||
|
* Get the JSON object representation of this HTTP header collection.
|
|||
|
*/toJson(e={}){let t={};if(e.preserveCase)for(let e in this._headersMap){let r=this._headersMap[e];t[r.name]=r.value;}else for(let e in this._headersMap){let i=this._headersMap[e];t[r(i.name)]=i.value;}return t;}/**
|
|||
|
* Get the string representation of this HTTP header collection.
|
|||
|
*/toString(){return JSON.stringify(this.toJson({preserveCase:!0}));}/**
|
|||
|
* Create a deep clone/copy of this HttpHeaders collection.
|
|||
|
*/clone(){let e={};for(let t in this._headersMap){let r=this._headersMap[t];e[r.name]=r.value;}return new a(e);}}}),parcelRequire.register("4F713",function(e,t){$parcel$export(e.exports,"Blob",()=>o);/*
|
|||
|
* Copyright (c) Microsoft Corporation.
|
|||
|
* Licensed under the MIT License.
|
|||
|
*
|
|||
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|||
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|||
|
*/var r=parcelRequire("ivnR6"),i=parcelRequire("e5kiN"),a=parcelRequire("iGLpU"),n=parcelRequire("4lprA");class o{/**
|
|||
|
* Initialize a new instance of the class Blob class.
|
|||
|
* @param client Reference to the service client
|
|||
|
*/constructor(e){this.client=e;}/**
|
|||
|
* The Download operation reads or downloads a blob from the system, including its metadata and
|
|||
|
* properties. You can also call Download to read a snapshot.
|
|||
|
* @param options The options parameters.
|
|||
|
*/download(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,u);}/**
|
|||
|
* The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system
|
|||
|
* properties for the blob. It does not return the content of the blob.
|
|||
|
* @param options The options parameters.
|
|||
|
*/getProperties(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,c);}/**
|
|||
|
* If the storage account's soft delete feature is disabled then, when a blob is deleted, it is
|
|||
|
* permanently removed from the storage account. If the storage account's soft delete feature is
|
|||
|
* enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible
|
|||
|
* immediately. However, the blob service retains the blob or snapshot for the number of days specified
|
|||
|
* by the DeleteRetentionPolicy section of [Storage service properties]
|
|||
|
* (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is
|
|||
|
* permanently removed from the storage account. Note that you continue to be charged for the
|
|||
|
* soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the
|
|||
|
* "include=deleted" query parameter to discover which blobs and snapshots have been soft deleted. You
|
|||
|
* can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a
|
|||
|
* soft-deleted blob or snapshot causes the service to return an HTTP status code of 404
|
|||
|
* (ResourceNotFound).
|
|||
|
* @param options The options parameters.
|
|||
|
*/delete(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,l);}/**
|
|||
|
* Undelete a blob that was previously soft deleted
|
|||
|
* @param options The options parameters.
|
|||
|
*/undelete(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,p);}/**
|
|||
|
* Sets the time a blob will expire and be deleted.
|
|||
|
* @param expiryOptions Required. Indicates mode of the expiry time
|
|||
|
* @param options The options parameters.
|
|||
|
*/setExpiry(e,t){let i={expiryOptions:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,d);}/**
|
|||
|
* The Set HTTP Headers operation sets system properties on the blob
|
|||
|
* @param options The options parameters.
|
|||
|
*/setHttpHeaders(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,m);}/**
|
|||
|
* The Set Immutability Policy operation sets the immutability policy on the blob
|
|||
|
* @param options The options parameters.
|
|||
|
*/setImmutabilityPolicy(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,h);}/**
|
|||
|
* The Delete Immutability Policy operation deletes the immutability policy on the blob
|
|||
|
* @param options The options parameters.
|
|||
|
*/deleteImmutabilityPolicy(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,x);}/**
|
|||
|
* The Set Legal Hold operation sets a legal hold on the blob.
|
|||
|
* @param legalHold Specified if a legal hold should be set on the blob.
|
|||
|
* @param options The options parameters.
|
|||
|
*/setLegalHold(e,t){let i={legalHold:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,f);}/**
|
|||
|
* The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more
|
|||
|
* name-value pairs
|
|||
|
* @param options The options parameters.
|
|||
|
*/setMetadata(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,g);}/**
|
|||
|
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
|
|||
|
* operations
|
|||
|
* @param options The options parameters.
|
|||
|
*/acquireLease(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,D);}/**
|
|||
|
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
|
|||
|
* operations
|
|||
|
* @param leaseId Specifies the current lease ID on the resource.
|
|||
|
* @param options The options parameters.
|
|||
|
*/releaseLease(e,t){let i={leaseId:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,y);}/**
|
|||
|
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
|
|||
|
* operations
|
|||
|
* @param leaseId Specifies the current lease ID on the resource.
|
|||
|
* @param options The options parameters.
|
|||
|
*/renewLease(e,t){let i={leaseId:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,b);}/**
|
|||
|
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
|
|||
|
* operations
|
|||
|
* @param leaseId Specifies the current lease ID on the resource.
|
|||
|
* @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400
|
|||
|
* (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor
|
|||
|
* (String) for a list of valid GUID string formats.
|
|||
|
* @param options The options parameters.
|
|||
|
*/changeLease(e,t,i){let a={leaseId:e,proposedLeaseId:t,options:r.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,v);}/**
|
|||
|
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
|
|||
|
* operations
|
|||
|
* @param options The options parameters.
|
|||
|
*/breakLease(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,C);}/**
|
|||
|
* The Create Snapshot operation creates a read-only snapshot of a blob
|
|||
|
* @param options The options parameters.
|
|||
|
*/createSnapshot(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,E);}/**
|
|||
|
* The Start Copy From URL operation copies a blob or an internet resource to a new blob.
|
|||
|
* @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to
|
|||
|
* 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would
|
|||
|
* appear in a request URI. The source blob must either be public or must be authenticated via a shared
|
|||
|
* access signature.
|
|||
|
* @param options The options parameters.
|
|||
|
*/startCopyFromURL(e,t){let i={copySource:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,A);}/**
|
|||
|
* The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return
|
|||
|
* a response until the copy is complete.
|
|||
|
* @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to
|
|||
|
* 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would
|
|||
|
* appear in a request URI. The source blob must either be public or must be authenticated via a shared
|
|||
|
* access signature.
|
|||
|
* @param options The options parameters.
|
|||
|
*/copyFromURL(e,t){let i={copySource:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,S);}/**
|
|||
|
* The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination
|
|||
|
* blob with zero length and full metadata.
|
|||
|
* @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob
|
|||
|
* operation.
|
|||
|
* @param options The options parameters.
|
|||
|
*/abortCopyFromURL(e,t){let i={copyId:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,B);}/**
|
|||
|
* The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium
|
|||
|
* storage account and on a block blob in a blob storage account (locally redundant storage only). A
|
|||
|
* premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block
|
|||
|
* blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's
|
|||
|
* ETag.
|
|||
|
* @param tier Indicates the tier to be set on the blob.
|
|||
|
* @param options The options parameters.
|
|||
|
*/setTier(e,t){let i={tier:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,N);}/**
|
|||
|
* Returns the sku name and account kind
|
|||
|
* @param options The options parameters.
|
|||
|
*/getAccountInfo(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,F);}/**
|
|||
|
* The Query operation enables users to select/project on blob data by providing simple query
|
|||
|
* expressions.
|
|||
|
* @param options The options parameters.
|
|||
|
*/query(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,w);}/**
|
|||
|
* The Get Tags operation enables users to get the tags associated with a blob.
|
|||
|
* @param options The options parameters.
|
|||
|
*/getTags(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,P);}/**
|
|||
|
* The Set Tags operation enables users to set tags on a blob.
|
|||
|
* @param options The options parameters.
|
|||
|
*/setTags(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,T);}}// Operation Specifications
|
|||
|
let s=new i.Serializer(a,/* isXml */!0),u={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:a.BlobDownloadHeaders},206:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:a.BlobDownloadHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlobDownloadExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.snapshot,n.versionId],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.range,n.rangeGetContentMD5,n.rangeGetContentCRC64,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags],isXML:!0,serializer:s},c={path:"/{containerName}/{blob}",httpMethod:"HEAD",responses:{200:{headersMapper:a.BlobGetPropertiesHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlobGetPropertiesExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.snapshot,n.versionId],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags],isXML:!0,serializer:s},l={path:"/{containerName}/{blob}",httpMethod:"DELETE",responses:{202:{headersMapper:a.BlobDeleteHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlobDeleteExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.snapshot,n.versionId,n.blobDeleteType],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.ifMatch,n.ifNoneMatch,n.ifTags,n.deleteSnapshots],isXML:!0,serializer:s},p={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:a.BlobUndeleteHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlobUndeleteExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.comp8],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1],isXML:!0,serializer:s},d={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:a.BlobSetExpiryHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlobSetExpiryExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.comp11],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.expiryOptions,n.expiresOn],isXML:!0,serializer:s},m={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:a.BlobSetHttpHeadersHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlobSetHttpHeadersExceptionHeaders}},queryParameters:[n.comp,n.timeoutInSeconds],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.ifMatch,n.ifNoneMatch,n.ifTags,n.blobCacheControl,n.blobContentType,n.blobContentMD5,n.blobContentEncoding,n.blobContentLanguage,n.blobContentDisposition],isXML:!0,serializer:s},h={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:a.BlobSetImmutabilityPolicyHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlobSetImmutabilityPolicyExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.comp12],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.ifUnmodifiedSince,n.immutabilityPolicyExpiry,n.immutabilityPolicyMode],isXML:!0,serializer:s},x={path:"/{containerName}/{blob}",httpMethod:"DELETE",responses:{200:{headersMapper:a.BlobDeleteImmutabilityPolicyHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlobDeleteImmutabilityPolicyExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.comp12],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1],isXML:!0,serializer:s},f={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:a.BlobSetLegalHoldHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlobSetLegalHoldExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.comp13],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.legalHold],isXML:!0,serializer:s},g={path:"/{containerName}/{blob
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("9uR57");function i(e){let{requestOptions:t,tracingOptions:i}=e,a=(0,r.__rest)(e,["requestOptions","tracingOptions"]),n=a;return t&&(n=Object.assign(Object.assign({},n),t)),i&&(n.tracingContext=i.tracingContext,// By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier.
|
|||
|
n.spanOptions=null==i?void 0:i.spanOptions),n;}}),parcelRequire.register("e5kiN",function(e,t){$parcel$export(e.exports,"Serializer",()=>n),$parcel$export(e.exports,"MapperType",()=>O);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/* eslint-disable eqeqeq */var r=parcelRequire("39aAY"),i=parcelRequire("8sP3n"),a=parcelRequire("2dg8H");class n{constructor(/**
|
|||
|
* The provided model mapper.
|
|||
|
*/e={},/**
|
|||
|
* Whether the contents are XML or not.
|
|||
|
*/t){this.modelMappers=e,this.isXML=t;}/**
|
|||
|
* Validates constraints, if any. This function will throw if the provided value does not respect those constraints.
|
|||
|
* @param mapper - The definition of data models.
|
|||
|
* @param value - The value.
|
|||
|
* @param objectName - Name of the object. Used in the error messages.
|
|||
|
* @deprecated Removing the constraints validation on client side.
|
|||
|
*/validateConstraints(e,t,r){let i=(e,i)=>{throw Error(`"${r}" with value "${t}" should satisfy the constraint "${e}": ${i}.`);};if(e.constraints&&void 0!=t){let r=t,{ExclusiveMaximum:a,ExclusiveMinimum:n,InclusiveMaximum:o,InclusiveMinimum:s,MaxItems:u,MaxLength:c,MinItems:l,MinLength:p,MultipleOf:d,Pattern:m,UniqueItems:h}=e.constraints;void 0!=a&&r>=a&&i("ExclusiveMaximum",a),void 0!=n&&r<=n&&i("ExclusiveMinimum",n),void 0!=o&&r>o&&i("InclusiveMaximum",o),void 0!=s&&r<s&&i("InclusiveMinimum",s);let x=t;if(void 0!=u&&x.length>u&&i("MaxItems",u),void 0!=c&&x.length>c&&i("MaxLength",c),void 0!=l&&x.length<l&&i("MinItems",l),void 0!=p&&x.length<p&&i("MinLength",p),void 0!=d&&r%d!=0&&i("MultipleOf",d),m){let e="string"==typeof m?new RegExp(m):m;("string"!=typeof t||null===t.match(e))&&i("Pattern",m);}h&&x.some((e,t,r)=>r.indexOf(e)!==t)&&i("UniqueItems",h);}}/**
|
|||
|
* Serialize the given object based on its metadata defined in the mapper.
|
|||
|
*
|
|||
|
* @param mapper - The mapper which defines the metadata of the serializable object.
|
|||
|
* @param object - A valid Javascript object to be serialized.
|
|||
|
* @param objectName - Name of the serialized object.
|
|||
|
* @param options - additional options to deserialization.
|
|||
|
* @returns A valid serialized Javascript object.
|
|||
|
*/serialize(e,t,r,i={}){var n,o,s;let u={rootName:null!==(n=i.rootName)&&void 0!==n?n:"",includeRoot:null!==(o=i.includeRoot)&&void 0!==o&&o,xmlCharKey:null!==(s=i.xmlCharKey)&&void 0!==s?s:a.XML_CHARKEY},c={},l=e.type.name;r||(r=e.serializedName),null!==l.match(/^Sequence$/i)&&(c=[]),e.isConstant&&(t=e.defaultValue);// This table of allowed values should help explain
|
|||
|
// the mapper.required and mapper.nullable properties.
|
|||
|
// X means "neither undefined or null are allowed".
|
|||
|
// || required
|
|||
|
// || true | false
|
|||
|
// nullable || ==========================
|
|||
|
// true || null | undefined/null
|
|||
|
// false || X | undefined
|
|||
|
// undefined || X | undefined/null
|
|||
|
let{required:p,nullable:y}=e;if(p&&y&&void 0===t)throw Error(`${r} cannot be undefined.`);if(p&&!y&&void 0==t)throw Error(`${r} cannot be null or undefined.`);if(!p&&!1===y&&null===t)throw Error(`${r} cannot be null.`);if(void 0==t)c=t;else if(null!==l.match(/^any$/i))c=t;else if(null!==l.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i))c=d(l,r,t);else if(null!==l.match(/^Enum$/i)){let i=e;c=m(r,i.type.allowedValues,t);}else null!==l.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i)?c=f(l,t,r):null!==l.match(/^ByteArray$/i)?c=h(r,t):null!==l.match(/^Base64Url$/i)?c=x(r,t):null!==l.match(/^Sequence$/i)?c=g(this,e,t,r,!!this.isXML,u):null!==l.match(/^Dictionary$/i)?c=D(this,e,t,r,!!this.isXML,u):null!==l.match(/^Composite$/i)&&(c=C(this,e,t,r,!!this.isXML,u));return c;}/**
|
|||
|
* Deserialize the given object based on its metadata defined in the mapper.
|
|||
|
*
|
|||
|
* @param mapper - The mapper which defines the metadata of the serializable object.
|
|||
|
* @param responseBody - A valid Javascript entity to be deserialized.
|
|||
|
* @param objectName - Name of the deserialized object.
|
|||
|
* @param options - Controls behavior of XML parser and builder.
|
|||
|
* @returns A valid deserialized Javascript object.
|
|||
|
*/deserialize(e,t,i,n={}){var o,s,c;let l;let d={rootName:null!==(o=n.rootName)&&void 0!==o?o:"",includeRoot:null!==(s=n.includeRoot)&&void 0!==s&&s,xmlCharKey:null!==(c=n.xmlCharKey)&&void 0!==c?c:a.XML_CHARKEY};if(void 0==t)return this.isXML&&"Sequence"===e.type.name&&!e.xmlIsWrapped&&(// between the list being empty versus being missing,
|
|||
|
// so let's do the more user-friendly thing and return an empty list.
|
|||
|
t=[]),void 0!==e.defaultValue&&(t=e.defaultValue),t;let m=e.type.name;if(i||(i=e.serializedName),null!==m.match(/^Composite$/i))l=S(this,e,t,i,d);else{if(this.isXML){let e=d.xmlCharKey,r=t;void 0!=r[a.XML_ATTRKEY]&&void 0!=r[e]&&(t=r[e]);}null!==m.match(/^Number$/i)?isNaN(l=parseFloat(t))&&(l=t):null!==m.match(/^Boolean$/i)?l="true"===t||"false"!==t&&t:null!==m.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i)?l=t:null!==m.match(/^(Date|DateTime|DateTimeRfc1123)$/i)?l=new Date(t):null!==m.match(/^UnixTime$/i)?l=p(t):null!==m.match(/^ByteArray$/i)?l=r.decodeString(t):null!==m.match(/^Base64Url$/i)?l=u(t):null!==m.match(/^Sequence$/i)?l=N(this,e,t,i,d):null!==m.match(/^Dictionary$/i)&&(l=B(this,e,t,i,d));}return e.isConstant&&(l=e.defaultValue),l;}}function o(e,t){let r=e.length;for(;r-1>=0&&e[r-1]===t;)--r;return e.substr(0,r);}function s(e){if(!e)return;if(!(e instanceof Uint8Array))throw Error("Please provide an input of type Uint8Array for converting to Base64Url.");// Uint8Array to Base64.
|
|||
|
let t=r.encodeByteArray(e);// Base64 to Base64Url.
|
|||
|
return o(t,"=").replace(/\+/g,"-").replace(/\//g,"_");}function u(e){if(e){if(e&&"string"!=typeof e.valueOf())throw Error("Please provide an input of type string for converting to Uint8Array");// Base64 to Uint8Array.
|
|||
|
return(// Base64Url to Base64.
|
|||
|
e=e.replace(/-/g,"+").replace(/_/g,"/"),r.decodeString(e));}}function c(e){let t=[],r="";if(e){let i=e.split(".");for(let e of i)"\\"===e.charAt(e.length-1)?r+=e.substr(0,e.length-1)+".":(r+=e,t.push(r),r="");}return t;}function l(e){if(e)return"string"==typeof e.valueOf()&&(e=new Date(e)),Math.floor(e.getTime()/1e3);}function p(e){if(e)return new Date(1e3*e);}function d(e,t,r){if(null!=r){if(null!==e.match(/^Number$/i)){if("number"!=typeof r)throw Error(`${t} with value ${r} must be of type number.`);}else if(null!==e.match(/^String$/i)){if("string"!=typeof r.valueOf())throw Error(`${t} with value "${r}" must be of type string.`);}else if(null!==e.match(/^Uuid$/i)){if(!("string"==typeof r.valueOf()&&i.isValidUuid(r)))throw Error(`${t} with value "${r}" must be of type string and a valid uuid.`);}else if(null!==e.match(/^Boolean$/i)){if("boolean"!=typeof r)throw Error(`${t} with value ${r} must be of type boolean.`);}else if(null!==e.match(/^Stream$/i)){let e=typeof r;if("string"!==e&&"function"!==e&&!(r instanceof ArrayBuffer)&&!ArrayBuffer.isView(r)&&!(("function"==typeof Blob||"object"==typeof Blob)&&r instanceof Blob))throw Error(`${t} must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.`);}}return r;}function m(e,t,r){if(!t)throw Error(`Please provide a set of allowedValues to validate ${e} as an Enum Type.`);let i=t.some(e=>"string"==typeof e.valueOf()?e.toLowerCase()===r.toLowerCase():e===r);if(!i)throw Error(`${r} is not a valid value for ${e}. The valid values are: ${JSON.stringify(t)}.`);return r;}function h(e,t){let i="";if(void 0!=t){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);i=r.encodeByteArray(t);}return i;}function x(e,t){let r="";if(void 0!=t){if(!(t instanceof Uint8Array))throw Error(`${e} must be of type Uint8Array.`);r=s(t)||"";}return r;}function f(e,t,r){if(void 0!=t){if(null!==e.match(/^Date$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw Error(`${r} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString().substring(0,10):new Date(t).toISOString().substring(0,10);}else if(null!==e.match(/^DateTime$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw Error(`${r} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString():new Date(t).toISOString();}else if(null!==e.match(/^DateTimeRfc1123$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw Error(`${r} must be an instanceof Date or a string in RFC-1123 format.`);t=t instanceof Date?t.toUTCString():new Date(t).toUTCString();}else if(null!==e.match(/^UnixTime$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw Error(`${r} must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.`);t=l(t);}else if(null!==e.match(/^TimeSpan$/i)&&!i.isDuration(t))throw Error(`${r} must be a string in ISO 8601 format. Instead was "${t}".`);}return t;}function g(e,t,r,i,n,o){if(!Array.isArray(r))throw Error(`${i} must be of type Array.`);let s=t.type.element;if(!s||"object"!=typeof s)throw Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${i}.`);let u=[];for(let t=0;t<r.length;t++){let c=e.serialize(s,r[t],i,o);if(n&&s.xmlNamespace){let e=s.xmlNamespacePrefix?`xmlns:${s.xmlNamespacePrefix}`:"xmlns";"Composite"===s.type.name?u[t]=Object.assign({},c):(u[t]={},u[t][o.xmlCharKey]=c),u[t][a.XML_ATTRKEY]={[e]:s.xmlNamespace};}else u[t]=c;}return u;}function D(e,t,r,i,n,o){if("object"!=typeof r)throw Error(`${i} must be of type object.`);let s=t.type.value;if(!s||"object"!=typeof s)throw Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${i}.`);let u={};for(let t of Object.keys(r)){let a=e.serialize(s,r[t],i,o);// If the element needs an XML namespace we need to add it within the $ property
|
|||
|
u[t]=E(s,a,n,o);}// Add the namespace to the root element if needed
|
|||
|
if(n&&t.xmlNamespace){let e=t.xmlNamespacePrefix?`xmlns:${t.xmlNamespacePrefix}`:"xmlns",r=u;return r[a.XML_ATTRKEY]={[e]:t.xmlNamespace},r;}return u;}/**
|
|||
|
* Resolves the additionalProperties property from a referenced mapper.
|
|||
|
* @param serializer - The serializer containing the entire set of mappers.
|
|||
|
* @param mapper - The composite mapper to resolve.
|
|||
|
* @param objectName - Name of the object being serialized.
|
|||
|
*/function y(e,t,r){let i=t.type.additionalProperties;if(!i&&t.type.className){let i=b(e,t,r);return null==i?void 0:i.type.additionalProperties;}return i;}/**
|
|||
|
* Finds the mapper referenced by `className`.
|
|||
|
* @param serializer - The serializer containing the entire set of mappers
|
|||
|
* @param mapper - The composite mapper to resolve
|
|||
|
* @param objectName - Name of the object being serialized
|
|||
|
*/function b(e,t,r){let i=t.type.className;if(!i)throw Error(`Class name for model "${r}" is not provided in the mapper "${JSON.stringify(t,void 0,2)}".`);return e.modelMappers[i];}/**
|
|||
|
* Resolves a composite mapper's modelProperties.
|
|||
|
* @param serializer - The serializer containing the entire set of mappers
|
|||
|
* @param mapper - The composite mapper to resolve
|
|||
|
*/function v(e,t,r){let i=t.type.modelProperties;if(!i){let a=b(e,t,r);if(!a)throw Error(`mapper() cannot be null or undefined for model "${t.type.className}".`);if(!(i=null==a?void 0:a.type.modelProperties))throw Error(`modelProperties cannot be null or undefined in the mapper "${JSON.stringify(a)}" of type "${t.type.className}" for object "${r}".`);}return i;}function C(e,t,r,i,n,o){if(w(e,t)&&(t=F(e,t,r,"clientName")),void 0!=r){let s={},u=v(e,t,i);for(let l of Object.keys(u)){let p;let d=u[l];if(d.readOnly)continue;let m=s;if(e.isXML)p=d.xmlIsWrapped?d.xmlName:d.xmlElementName||d.xmlName;else{let e=c(d.serializedName);for(let t of(p=e.pop(),e)){let e=m[t];void 0==e&&(void 0!=r[l]||void 0!==d.defaultValue)&&(m[t]={}),m=m[t];}}if(void 0!=m){if(n&&t.xmlNamespace){let e=t.xmlNamespacePrefix?`xmlns:${t.xmlNamespacePrefix}`:"xmlns";m[a.XML_ATTRKEY]=Object.assign(Object.assign({},m[a.XML_ATTRKEY]),{[e]:t.xmlNamespace});}let s=""!==d.serializedName?i+"."+d.serializedName:i,u=r[l],c=w(e,t);c&&c.clientName===l&&void 0==u&&(u=t.serializedName);let h=e.serialize(d,u,s,o);if(void 0!==h&&void 0!=p){let e=E(d,h,n,o);n&&d.xmlIsAttribute?(// XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js.
|
|||
|
// This keeps things simple while preventing name collision
|
|||
|
// with names in user documents.
|
|||
|
m[a.XML_ATTRKEY]=m[a.XML_ATTRKEY]||{},m[a.XML_ATTRKEY][p]=h):n&&d.xmlIsWrapped?m[p]={[d.xmlElementName]:e}:m[p]=e;}}}let l=y(e,t,i);if(l){let t=Object.keys(u);for(let a in r){let n=t.every(e=>e!==a);n&&(s[a]=e.serialize(l,r[a],i+'["'+a+'"]',o));}}return s;}return r;}function E(e,t,r,i){if(!r||!e.xmlNamespace)return t;let n=e.xmlNamespacePrefix?`xmlns:${e.xmlNamespacePrefix}`:"xmlns",o={[n]:e.xmlNamespace};if(["Composite"].includes(e.type.name)){if(t[a.XML_ATTRKEY])return t;{let e=Object.assign({},t);return e[a.XML_ATTRKEY]=o,e;}}let s={};return s[i.xmlCharKey]=t,s[a.XML_ATTRKEY]=o,s;}function A(e,t){return[(0,a.XML_ATTRKEY),t.xmlCharKey].includes(e);}function S(e,t,r,i,n){var o,s;let u=null!==(o=n.xmlCharKey)&&void 0!==o?o:a.XML_CHARKEY;w(e,t)&&(t=F(e,t,r,"serializedName"));let l=v(e,t,i),p={},d=[];for(let o of Object.keys(l)){let m=l[o],h=c(l[o].serializedName);d.push(h[0]);let{serializedName:x,xmlName:f,xmlElementName:g}=m,D=i;""!==x&&void 0!==x&&(D=i+"."+x);let y=m.headerCollectionPrefix;if(y){let t={};for(let i of Object.keys(r))i.startsWith(y)&&(t[i.substring(y.length)]=e.deserialize(m.type.value,r[i],D,n)),d.push(i);p[o]=t;}else if(e.isXML){if(m.xmlIsAttribute&&r[a.XML_ATTRKEY])p[o]=e.deserialize(m,r[a.XML_ATTRKEY][f],D,n);else if(m.xmlIsMsText)void 0!==r[u]?p[o]=r[u]:"string"==typeof r&&(// `{ name: "content"}` instead of `{ name: { "_": "content" }}`
|
|||
|
p[o]=r);else{let t=g||f||x;if(m.xmlIsWrapped){/* a list of <xmlElementName> wrapped by <xmlName>
|
|||
|
For the xml example below
|
|||
|
<Cors>
|
|||
|
<CorsRule>...</CorsRule>
|
|||
|
<CorsRule>...</CorsRule>
|
|||
|
</Cors>
|
|||
|
the responseBody has
|
|||
|
{
|
|||
|
Cors: {
|
|||
|
CorsRule: [{...}, {...}]
|
|||
|
}
|
|||
|
}
|
|||
|
xmlName is "Cors" and xmlElementName is"CorsRule".
|
|||
|
*/let t=r[f],i=null!==(s=null==t?void 0:t[g])&&void 0!==s?s:[];p[o]=e.deserialize(m,i,D,n),d.push(f);}else{let i=r[t];p[o]=e.deserialize(m,i,D,n),d.push(t);}}}else{let i,a;let s=r;// traversing the object step by step.
|
|||
|
for(let e of h){if(!s)break;s=s[e];}i=s;let u=t.type.polymorphicDiscriminator;// paging
|
|||
|
if(u&&o===u.clientName&&void 0==i&&(i=t.serializedName),Array.isArray(r[o])&&""===l[o].serializedName){i=r[o];let t=e.deserialize(m,i,D,n);// Copy over any properties that have already been added into the instance, where they do
|
|||
|
// not exist on the newly de-serialized array
|
|||
|
for(let[e,r]of Object.entries(p))Object.prototype.hasOwnProperty.call(t,e)||(t[e]=r);p=t;}else(void 0!==i||void 0!==m.defaultValue)&&(a=e.deserialize(m,i,D,n),p[o]=a);}}let m=t.type.additionalProperties;if(m){let t=e=>{for(let t in l){let r=c(l[t].serializedName);if(r[0]===e)return!1;}return!0;};for(let a in r)t(a)&&(p[a]=e.deserialize(m,r[a],i+'["'+a+'"]',n));}else if(r)for(let e of Object.keys(r))void 0!==p[e]||d.includes(e)||A(e,n)||(p[e]=r[e]);return p;}function B(e,t,r,i,a){let n=t.type.value;if(!n||"object"!=typeof n)throw Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${i}`);if(r){let t={};for(let o of Object.keys(r))t[o]=e.deserialize(n,r[o],i,a);return t;}return r;}function N(e,t,r,i,a){let n=t.type.element;if(!n||"object"!=typeof n)throw Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${i}`);if(r){Array.isArray(r)||(r=[r]);let t=[];for(let o=0;o<r.length;o++)t[o]=e.deserialize(n,r[o],`${i}[${o}]`,a);return t;}return r;}function F(e,t,r,i){let a=w(e,t);if(a){let n=a[i];if(void 0!=n){let i=r[n];if(void 0!=i){let r=t.type.uberParent||t.type.className,a=i===r?i:r+"."+i,n=e.modelMappers.discriminators[a];n&&(t=n);}}}return t;}function w(e,t){return t.type.polymorphicDiscriminator||P(e,t.type.uberParent)||P(e,t.type.className);}function P(e,t){return t&&e.modelMappers[t]&&e.modelMappers[t].type.polymorphicDiscriminator;}/**
|
|||
|
* Utility function to create a K:V from a list of strings
|
|||
|
*/function T(e){let t={};for(let r of e)t[r]=r;return t;}let O=T(["Base64Url","Boolean","ByteArray","Composite","Date","DateTime","DateTimeRfc1123","Dictionary","Enum","Number","Object","Sequence","String","Stream","TimeSpan","UnixTime"]);}),parcelRequire.register("39aAY",function(e,t){function r(e){// Buffer.from accepts <ArrayBuffer> | <SharedArrayBuffer>-- the TypeScript definition is off here
|
|||
|
// https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length
|
|||
|
let t=e instanceof Buffer?e:Buffer.from(e.buffer);return t.toString("base64");}function i(e){return Buffer.from(e,"base64");}$parcel$export(e.exports,"encodeByteArray",()=>r),$parcel$export(e.exports,"decodeString",()=>i);}),parcelRequire.register("iGLpU",function(e,t){$parcel$export(e.exports,"BlobServiceProperties",()=>r),$parcel$export(e.exports,"Logging",()=>i),$parcel$export(e.exports,"RetentionPolicy",()=>a),$parcel$export(e.exports,"Metrics",()=>n),$parcel$export(e.exports,"CorsRule",()=>o),$parcel$export(e.exports,"StaticWebsite",()=>s),$parcel$export(e.exports,"StorageError",()=>u),$parcel$export(e.exports,"BlobServiceStatistics",()=>c),$parcel$export(e.exports,"GeoReplication",()=>l),$parcel$export(e.exports,"ListContainersSegmentResponse",()=>p),$parcel$export(e.exports,"ContainerItem",()=>d),$parcel$export(e.exports,"ContainerProperties",()=>m),$parcel$export(e.exports,"KeyInfo",()=>h),$parcel$export(e.exports,"UserDelegationKey",()=>x),$parcel$export(e.exports,"FilterBlobSegment",()=>f),$parcel$export(e.exports,"FilterBlobItem",()=>g),$parcel$export(e.exports,"BlobTags",()=>D),$parcel$export(e.exports,"BlobTag",()=>y),$parcel$export(e.exports,"SignedIdentifier",()=>b),$parcel$export(e.exports,"AccessPolicy",()=>v),$parcel$export(e.exports,"ListBlobsFlatSegmentResponse",()=>C),$parcel$export(e.exports,"BlobFlatListSegment",()=>E),$parcel$export(e.exports,"BlobItemInternal",()=>A),$parcel$export(e.exports,"BlobName",()=>S),$parcel$export(e.exports,"BlobPropertiesInternal",()=>B),$parcel$export(e.exports,"ListBlobsHierarchySegmentResponse",()=>N),$parcel$export(e.exports,"BlobHierarchyListSegment",()=>F),$parcel$export(e.exports,"BlobPrefix",()=>w),$parcel$export(e.exports,"BlockLookupList",()=>P),$parcel$export(e.exports,"BlockList",()=>T),$parcel$export(e.exports,"Block",()=>O),$parcel$export(e.exports,"PageList",()=>R),$parcel$export(e.exports,"PageRange",()=>I),$parcel$export(e.exports,"ClearRange",()=>z),$parcel$export(e.exports,"QueryRequest",()=>k),$parcel$export(e.exports,"QuerySerialization",()=>M),$parcel$export(e.exports,"QueryFormat",()=>q),$parcel$export(e.exports,"DelimitedTextConfiguration",()=>L),$parcel$export(e.exports,"JsonTextConfiguration",()=>j),$parcel$export(e.exports,"ArrowConfiguration",()=>H),$parcel$export(e.exports,"ArrowField",()=>U),$parcel$export(e.exports,"ServiceSetPropertiesHeaders",()=>$),$parcel$export(e.exports,"ServiceSetPropertiesExceptionHeaders",()=>V),$parcel$export(e.exports,"ServiceGetPropertiesHeaders",()=>K),$parcel$export(e.exports,"ServiceGetPropertiesExceptionHeaders",()=>G),$parcel$export(e.exports,"ServiceGetStatisticsHeaders",()=>W),$parcel$export(e.exports,"ServiceGetStatisticsExceptionHeaders",()=>X),$parcel$export(e.exports,"ServiceListContainersSegmentHeaders",()=>Y),$parcel$export(e.exports,"ServiceListContainersSegmentExceptionHeaders",()=>Q),$parcel$export(e.exports,"ServiceGetUserDelegationKeyHeaders",()=>J),$parcel$export(e.exports,"ServiceGetUserDelegationKeyExceptionHeaders",()=>Z),$parcel$export(e.exports,"ServiceGetAccountInfoHeaders",()=>ee),$parcel$export(e.exports,"ServiceGetAccountInfoExceptionHeaders",()=>et),$parcel$export(e.exports,"ServiceSubmitBatchHeaders",()=>er),$parcel$export(e.exports,"ServiceSubmitBatchExceptionHeaders",()=>ei),$parcel$export(e.exports,"ServiceFilterBlobsHeaders",()=>ea),$parcel$export(e.exports,"ServiceFilterBlobsExceptionHeaders",()=>en),$parcel$export(e.exports,"ContainerCreateHeaders",()=>eo),$parcel$export(e.exports,"ContainerCreateExceptionHeaders",()=>es),$parcel$export(e.exports,"ContainerGetPropertiesHeaders",()=>eu),$parcel$export(e.exports,"ContainerGetPropertiesExceptionHeaders",()=>ec),$parcel$export(e.exports,"ContainerDeleteHeaders",()=>el),$parcel$export(e.exports,"ContainerDeleteExceptionHeaders",()=>ep),$parcel$export(e.exports,"ContainerSetMetadataHeaders",()=>ed),$parcel$export(e.exports,"ContainerSetMetadataExceptionHeaders",()=>em),$parcel$export(e.exports,"ContainerGetAccessPolicyHeaders",()=>eh),$parcel$export(e.exports,"ContainerGetAccessPolicyExceptionHeaders",()=>ex),$parcel$export(e.exp
|
|||
|
* Copyright (c) Microsoft Corporation.
|
|||
|
* Licensed under the MIT License.
|
|||
|
*
|
|||
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|||
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|||
|
*/let r={serializedName:"BlobServiceProperties",xmlName:"StorageServiceProperties",type:{name:"Composite",className:"BlobServiceProperties",modelProperties:{blobAnalyticsLogging:{serializedName:"Logging",xmlName:"Logging",type:{name:"Composite",className:"Logging"}},hourMetrics:{serializedName:"HourMetrics",xmlName:"HourMetrics",type:{name:"Composite",className:"Metrics"}},minuteMetrics:{serializedName:"MinuteMetrics",xmlName:"MinuteMetrics",type:{name:"Composite",className:"Metrics"}},cors:{serializedName:"Cors",xmlName:"Cors",xmlIsWrapped:!0,xmlElementName:"CorsRule",type:{name:"Sequence",element:{type:{name:"Composite",className:"CorsRule"}}}},defaultServiceVersion:{serializedName:"DefaultServiceVersion",xmlName:"DefaultServiceVersion",type:{name:"String"}},deleteRetentionPolicy:{serializedName:"DeleteRetentionPolicy",xmlName:"DeleteRetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}},staticWebsite:{serializedName:"StaticWebsite",xmlName:"StaticWebsite",type:{name:"Composite",className:"StaticWebsite"}}}}},i={serializedName:"Logging",type:{name:"Composite",className:"Logging",modelProperties:{version:{serializedName:"Version",required:!0,xmlName:"Version",type:{name:"String"}},deleteProperty:{serializedName:"Delete",required:!0,xmlName:"Delete",type:{name:"Boolean"}},read:{serializedName:"Read",required:!0,xmlName:"Read",type:{name:"Boolean"}},write:{serializedName:"Write",required:!0,xmlName:"Write",type:{name:"Boolean"}},retentionPolicy:{serializedName:"RetentionPolicy",xmlName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}}}}},a={serializedName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy",modelProperties:{enabled:{serializedName:"Enabled",required:!0,xmlName:"Enabled",type:{name:"Boolean"}},days:{constraints:{InclusiveMinimum:1},serializedName:"Days",xmlName:"Days",type:{name:"Number"}}}}},n={serializedName:"Metrics",type:{name:"Composite",className:"Metrics",modelProperties:{version:{serializedName:"Version",xmlName:"Version",type:{name:"String"}},enabled:{serializedName:"Enabled",required:!0,xmlName:"Enabled",type:{name:"Boolean"}},includeAPIs:{serializedName:"IncludeAPIs",xmlName:"IncludeAPIs",type:{name:"Boolean"}},retentionPolicy:{serializedName:"RetentionPolicy",xmlName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}}}}},o={serializedName:"CorsRule",type:{name:"Composite",className:"CorsRule",modelProperties:{allowedOrigins:{serializedName:"AllowedOrigins",required:!0,xmlName:"AllowedOrigins",type:{name:"String"}},allowedMethods:{serializedName:"AllowedMethods",required:!0,xmlName:"AllowedMethods",type:{name:"String"}},allowedHeaders:{serializedName:"AllowedHeaders",required:!0,xmlName:"AllowedHeaders",type:{name:"String"}},exposedHeaders:{serializedName:"ExposedHeaders",required:!0,xmlName:"ExposedHeaders",type:{name:"String"}},maxAgeInSeconds:{constraints:{InclusiveMinimum:0},serializedName:"MaxAgeInSeconds",required:!0,xmlName:"MaxAgeInSeconds",type:{name:"Number"}}}}},s={serializedName:"StaticWebsite",type:{name:"Composite",className:"StaticWebsite",modelProperties:{enabled:{serializedName:"Enabled",required:!0,xmlName:"Enabled",type:{name:"Boolean"}},indexDocument:{serializedName:"IndexDocument",xmlName:"IndexDocument",type:{name:"String"}},errorDocument404Path:{serializedName:"ErrorDocument404Path",xmlName:"ErrorDocument404Path",type:{name:"String"}},defaultIndexDocumentPath:{serializedName:"DefaultIndexDocumentPath",xmlName:"DefaultIndexDocumentPath",type:{name:"String"}}}}},u={serializedName:"StorageError",type:{name:"Composite",className:"StorageError",modelProperties:{message:{serializedName:"Message",xmlName:"Message",type:{name:"String"}},code:{serializedName:"Code",xmlName:"Code",type:{name:"String"}}}}},c={serializedName:"BlobServiceStatistics",xmlName:"StorageServiceStats",type:{name:"Composite",className:"BlobServiceStatistics",modelProperties:{geoReplication:{serializedName:"GeoReplication",xmlName:"GeoReplication",type:{name:"Composite",className:"GeoReplication"}}}}},l={serializedName:"GeoReplication",ty
|
|||
|
* Copyright (c) Microsoft Corporation.
|
|||
|
* Licensed under the MIT License.
|
|||
|
*
|
|||
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|||
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|||
|
*/var r=parcelRequire("2xU1D"),i=parcelRequire("iGLpU");let a={parameterPath:["options","contentType"],mapper:{defaultValue:"application/xml",isConstant:!0,serializedName:"Content-Type",type:{name:"String"}}};i.BlobServiceProperties;let n={parameterPath:"accept",mapper:{defaultValue:"application/xml",isConstant:!0,serializedName:"Accept",type:{name:"String"}}},o={parameterPath:"url",mapper:{serializedName:"url",required:!0,xmlName:"url",type:{name:"String"}},skipEncoding:!0},s={parameterPath:"comp",mapper:{defaultValue:"properties",isConstant:!0,serializedName:"comp",type:{name:"String"}}},u={parameterPath:["options","timeoutInSeconds"],mapper:{constraints:{InclusiveMinimum:0},serializedName:"timeout",xmlName:"timeout",type:{name:"Number"}}},c={parameterPath:"version",mapper:{defaultValue:"2023-01-03",isConstant:!0,serializedName:"x-ms-version",type:{name:"String"}}},l={parameterPath:["options","requestId"],mapper:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}}},p={parameterPath:"accept",mapper:{defaultValue:"application/xml",isConstant:!0,serializedName:"Accept",type:{name:"String"}}},d={parameterPath:"comp",mapper:{defaultValue:"list",isConstant:!0,serializedName:"comp",type:{name:"String"}}},m={parameterPath:["options","prefix"],mapper:{serializedName:"prefix",xmlName:"prefix",type:{name:"String"}}},h={parameterPath:["options","marker"],mapper:{serializedName:"marker",xmlName:"marker",type:{name:"String"}}},x={parameterPath:["options","maxPageSize"],mapper:{constraints:{InclusiveMinimum:1},serializedName:"maxresults",xmlName:"maxresults",type:{name:"Number"}}};r.QueryCollectionFormat.Csv,i.KeyInfo;let f={parameterPath:"restype",mapper:{defaultValue:"account",isConstant:!0,serializedName:"restype",type:{name:"String"}}},g={parameterPath:"body",mapper:{serializedName:"body",required:!0,xmlName:"body",type:{name:"Stream"}}},D={parameterPath:"comp",mapper:{defaultValue:"batch",isConstant:!0,serializedName:"comp",type:{name:"String"}}},y={parameterPath:"contentLength",mapper:{serializedName:"Content-Length",required:!0,xmlName:"Content-Length",type:{name:"Number"}}},b={parameterPath:"multipartContentType",mapper:{serializedName:"Content-Type",required:!0,xmlName:"Content-Type",type:{name:"String"}}},v={parameterPath:"comp",mapper:{defaultValue:"blobs",isConstant:!0,serializedName:"comp",type:{name:"String"}}},C={parameterPath:["options","where"],mapper:{serializedName:"where",xmlName:"where",type:{name:"String"}}},E={parameterPath:"restype",mapper:{defaultValue:"container",isConstant:!0,serializedName:"restype",type:{name:"String"}}},A={parameterPath:["options","metadata"],mapper:{serializedName:"x-ms-meta",xmlName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"}},S={parameterPath:["options","access"],mapper:{serializedName:"x-ms-blob-public-access",xmlName:"x-ms-blob-public-access",type:{name:"Enum",allowedValues:["container","blob"]}}},B={parameterPath:["options","containerEncryptionScope","defaultEncryptionScope"],mapper:{serializedName:"x-ms-default-encryption-scope",xmlName:"x-ms-default-encryption-scope",type:{name:"String"}}},N={parameterPath:["options","containerEncryptionScope","preventEncryptionScopeOverride"],mapper:{serializedName:"x-ms-deny-encryption-scope-override",xmlName:"x-ms-deny-encryption-scope-override",type:{name:"Boolean"}}},F={parameterPath:["options","leaseAccessConditions","leaseId"],mapper:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}}},w={parameterPath:["options","modifiedAccessConditions","ifModifiedSince"],mapper:{serializedName:"If-Modified-Since",xmlName:"If-Modified-Since",type:{name:"DateTimeRfc1123"}}},P={parameterPath:["options","modifiedAccessConditions","ifUnmodifiedSince"],mapper:{serializedName:"If-Unmodified-Since",xmlName:"If-Unmodified-Since",type:{name:"DateTimeRfc1123"}}},T={parameterPath:"comp",mapper:{defaultValue:"metadata",isConstant:!0,serializedName:"comp",type:{name:"String"}}},O={parameterPath:"comp",mapper:{defaultValue:"acl",isConstant
|
|||
|
* CSV: Each pair of segments joined by a single comma.
|
|||
|
*/e.Csv=",",/**
|
|||
|
* SSV: Each pair of segments joined by a single space character.
|
|||
|
*/e.Ssv=" ",/**
|
|||
|
* TSV: Each pair of segments joined by a single tab character.
|
|||
|
*/e.Tsv=" ",/**
|
|||
|
* Pipes: Each pair of segments joined by a single pipe character.
|
|||
|
*/e.Pipes="|",/**
|
|||
|
* Denotes this is an array of values that should be passed to the server in multiple key/value pairs, e.g. `?queryParam=value1&queryParam=value2`
|
|||
|
*/e.Multi="Multi";}(r||(r={}));}),parcelRequire.register("arn1t",function(e,t){$parcel$export(e.exports,"AppendBlob",()=>o);/*
|
|||
|
* Copyright (c) Microsoft Corporation.
|
|||
|
* Licensed under the MIT License.
|
|||
|
*
|
|||
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|||
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|||
|
*/var r=parcelRequire("ivnR6"),i=parcelRequire("e5kiN"),a=parcelRequire("iGLpU"),n=parcelRequire("4lprA");class o{/**
|
|||
|
* Initialize a new instance of the class AppendBlob class.
|
|||
|
* @param client Reference to the service client
|
|||
|
*/constructor(e){this.client=e;}/**
|
|||
|
* The Create Append Blob operation creates a new append blob.
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param options The options parameters.
|
|||
|
*/create(e,t){let i={contentLength:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,c);}/**
|
|||
|
* The Append Block operation commits a new block of data to the end of an existing append blob. The
|
|||
|
* Append Block operation is permitted only if the blob was created with x-ms-blob-type set to
|
|||
|
* AppendBlob. Append Block is supported only on version 2015-02-21 version or later.
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param body Initial data
|
|||
|
* @param options The options parameters.
|
|||
|
*/appendBlock(e,t,i){let a={contentLength:e,body:t,options:r.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,l);}/**
|
|||
|
* The Append Block operation commits a new block of data to the end of an existing append blob where
|
|||
|
* the contents are read from a source url. The Append Block operation is permitted only if the blob
|
|||
|
* was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version
|
|||
|
* 2015-02-21 version or later.
|
|||
|
* @param sourceUrl Specify a URL to the copy source.
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param options The options parameters.
|
|||
|
*/appendBlockFromUrl(e,t,i){let a={sourceUrl:e,contentLength:t,options:r.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,p);}/**
|
|||
|
* The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version
|
|||
|
* 2019-12-12 version or later.
|
|||
|
* @param options The options parameters.
|
|||
|
*/seal(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,d);}}// Operation Specifications
|
|||
|
let s=new i.Serializer(a,/* isXml */!0),u=new i.Serializer(a,/* isXml */!1),c={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.AppendBlobCreateHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.AppendBlobCreateExceptionHeaders}},queryParameters:[n.timeoutInSeconds],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.contentLength,n.metadata,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags,n.blobCacheControl,n.blobContentType,n.blobContentMD5,n.blobContentEncoding,n.blobContentLanguage,n.blobContentDisposition,n.immutabilityPolicyExpiry,n.immutabilityPolicyMode,n.encryptionScope,n.blobTagsString,n.legalHold1,n.blobType1],isXML:!0,serializer:s},l={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.AppendBlobAppendBlockHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.AppendBlobAppendBlockExceptionHeaders}},requestBody:n.body1,queryParameters:[n.timeoutInSeconds,n.comp22],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.contentLength,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags,n.encryptionScope,n.transactionalContentMD5,n.transactionalContentCrc64,n.contentType1,n.accept2,n.maxSize,n.appendPosition],mediaType:"binary",serializer:u},p={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.AppendBlobAppendBlockFromUrlHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.AppendBlobAppendBlockFromUrlExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.comp22],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.contentLength,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags,n.encryptionScope,n.sourceIfModifiedSince,n.sourceIfUnmodifiedSince,n.sourceIfMatch,n.sourceIfNoneMatch,n.sourceContentMD5,n.copySourceAuthorization,n.transactionalContentMD5,n.sourceUrl,n.sourceContentCrc64,n.maxSize,n.appendPosition,n.sourceRange1],isXML:!0,serializer:s},d={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:a.AppendBlobSealHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.AppendBlobSealExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.comp23],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.ifMatch,n.ifNoneMatch,n.appendPosition],isXML:!0,serializer:s};}),parcelRequire.register("akPaM",function(e,t){$parcel$export(e.exports,"BlockBlob",()=>o);/*
|
|||
|
* Copyright (c) Microsoft Corporation.
|
|||
|
* Licensed under the MIT License.
|
|||
|
*
|
|||
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|||
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|||
|
*/var r=parcelRequire("ivnR6"),i=parcelRequire("e5kiN"),a=parcelRequire("iGLpU"),n=parcelRequire("4lprA");class o{/**
|
|||
|
* Initialize a new instance of the class BlockBlob class.
|
|||
|
* @param client Reference to the service client
|
|||
|
*/constructor(e){this.client=e;}/**
|
|||
|
* The Upload Block Blob operation updates the content of an existing block blob. Updating an existing
|
|||
|
* block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put
|
|||
|
* Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a
|
|||
|
* partial update of the content of a block blob, use the Put Block List operation.
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param body Initial data
|
|||
|
* @param options The options parameters.
|
|||
|
*/upload(e,t,i){let a={contentLength:e,body:t,options:r.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,c);}/**
|
|||
|
* The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read
|
|||
|
* from a given URL. This API is supported beginning with the 2020-04-08 version. Partial updates are
|
|||
|
* not supported with Put Blob from URL; the content of an existing blob is overwritten with the
|
|||
|
* content of the new blob. To perform partial updates to a block blob’s contents using a source URL,
|
|||
|
* use the Put Block from URL API in conjunction with Put Block List.
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to
|
|||
|
* 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would
|
|||
|
* appear in a request URI. The source blob must either be public or must be authenticated via a shared
|
|||
|
* access signature.
|
|||
|
* @param options The options parameters.
|
|||
|
*/putBlobFromUrl(e,t,i){let a={contentLength:e,copySource:t,options:r.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,l);}/**
|
|||
|
* The Stage Block operation creates a new block to be committed as part of a blob
|
|||
|
* @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string
|
|||
|
* must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified
|
|||
|
* for the blockid parameter must be the same size for each block.
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param body Initial data
|
|||
|
* @param options The options parameters.
|
|||
|
*/stageBlock(e,t,i,a){let n={blockId:e,contentLength:t,body:i,options:r.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(n,p);}/**
|
|||
|
* The Stage Block operation creates a new block to be committed as part of a blob where the contents
|
|||
|
* are read from a URL.
|
|||
|
* @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string
|
|||
|
* must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified
|
|||
|
* for the blockid parameter must be the same size for each block.
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param sourceUrl Specify a URL to the copy source.
|
|||
|
* @param options The options parameters.
|
|||
|
*/stageBlockFromURL(e,t,i,a){let n={blockId:e,contentLength:t,sourceUrl:i,options:r.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(n,d);}/**
|
|||
|
* The Commit Block List operation writes a blob by specifying the list of block IDs that make up the
|
|||
|
* blob. In order to be written as part of a blob, a block must have been successfully written to the
|
|||
|
* server in a prior Put Block operation. You can call Put Block List to update a blob by uploading
|
|||
|
* only those blocks that have changed, then committing the new and existing blocks together. You can
|
|||
|
* do this by specifying whether to commit a block from the committed block list or from the
|
|||
|
* uncommitted block list, or to commit the most recently uploaded version of the block, whichever list
|
|||
|
* it may belong to.
|
|||
|
* @param blocks Blob Blocks.
|
|||
|
* @param options The options parameters.
|
|||
|
*/commitBlockList(e,t){let i={blocks:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,m);}/**
|
|||
|
* The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block
|
|||
|
* blob
|
|||
|
* @param listType Specifies whether to return the list of committed blocks, the list of uncommitted
|
|||
|
* blocks, or both lists together.
|
|||
|
* @param options The options parameters.
|
|||
|
*/getBlockList(e,t){let i={listType:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,h);}}// Operation Specifications
|
|||
|
let s=new i.Serializer(a,/* isXml */!0),u=new i.Serializer(a,/* isXml */!1),c={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.BlockBlobUploadHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlockBlobUploadExceptionHeaders}},requestBody:n.body1,queryParameters:[n.timeoutInSeconds],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.contentLength,n.metadata,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags,n.blobCacheControl,n.blobContentType,n.blobContentMD5,n.blobContentEncoding,n.blobContentLanguage,n.blobContentDisposition,n.immutabilityPolicyExpiry,n.immutabilityPolicyMode,n.encryptionScope,n.tier,n.blobTagsString,n.legalHold1,n.transactionalContentMD5,n.transactionalContentCrc64,n.contentType1,n.accept2,n.blobType2],mediaType:"binary",serializer:u},l={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.BlockBlobPutBlobFromUrlHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlockBlobPutBlobFromUrlExceptionHeaders}},queryParameters:[n.timeoutInSeconds],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.contentLength,n.metadata,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags,n.blobCacheControl,n.blobContentType,n.blobContentMD5,n.blobContentEncoding,n.blobContentLanguage,n.blobContentDisposition,n.encryptionScope,n.tier,n.sourceIfModifiedSince,n.sourceIfUnmodifiedSince,n.sourceIfMatch,n.sourceIfNoneMatch,n.sourceIfTags,n.copySource,n.blobTagsString,n.sourceContentMD5,n.copySourceAuthorization,n.copySourceTags,n.transactionalContentMD5,n.blobType2,n.copySourceBlobProperties],isXML:!0,serializer:s},p={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.BlockBlobStageBlockHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlockBlobStageBlockExceptionHeaders}},requestBody:n.body1,queryParameters:[n.timeoutInSeconds,n.comp24,n.blockId],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.contentLength,n.leaseId,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.encryptionScope,n.transactionalContentMD5,n.transactionalContentCrc64,n.contentType1,n.accept2],mediaType:"binary",serializer:u},d={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.BlockBlobStageBlockFromURLHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlockBlobStageBlockFromURLExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.comp24,n.blockId],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.contentLength,n.leaseId,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.encryptionScope,n.sourceIfModifiedSince,n.sourceIfUnmodifiedSince,n.sourceIfMatch,n.sourceIfNoneMatch,n.sourceContentMD5,n.copySourceAuthorization,n.sourceUrl,n.sourceContentCrc64,n.sourceRange1],isXML:!0,serializer:s},m={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.BlockBlobCommitBlockListHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.BlockBlobCommitBlockListExceptionHeaders}},requestBody:n.blocks,queryParameters:[n.timeoutInSeconds,n.comp25],urlParameters:[n.url],headerParameters:[n.contentType,n.accept,n.version,n.requestId,n.metadata,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags,n.blobCacheControl,n.blobContentType,n.blobContentMD5,n.blobContentEncoding,n.blobContentLanguage,n.blobContentDisposition,n.immutabilityPolicyExpiry,n.immutabilityPolicyMode,n.encryptionScope,n.tier,n.blobTagsString,n.legalHold1,n.transactionalContentMD5,n.transactionalContentCrc64],isXML:!0,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:s},h={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:a.BlockList,headersMapper:a.BlockBlobGetBlockListHeaders},default:{bodyMapper:a.StorageError,headersMappe
|
|||
|
* Copyright (c) Microsoft Corporation.
|
|||
|
* Licensed under the MIT License.
|
|||
|
*
|
|||
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|||
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|||
|
*/var r=parcelRequire("ivnR6"),i=parcelRequire("e5kiN"),a=parcelRequire("iGLpU"),n=parcelRequire("4lprA");class o{/**
|
|||
|
* Initialize a new instance of the class PageBlob class.
|
|||
|
* @param client Reference to the service client
|
|||
|
*/constructor(e){this.client=e;}/**
|
|||
|
* The Create operation creates a new page blob.
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The
|
|||
|
* page blob size must be aligned to a 512-byte boundary.
|
|||
|
* @param options The options parameters.
|
|||
|
*/create(e,t,i){let a={contentLength:e,blobContentLength:t,options:r.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,c);}/**
|
|||
|
* The Upload Pages operation writes a range of pages to a page blob
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param body Initial data
|
|||
|
* @param options The options parameters.
|
|||
|
*/uploadPages(e,t,i){let a={contentLength:e,body:t,options:r.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,l);}/**
|
|||
|
* The Clear Pages operation clears a set of pages from a page blob
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param options The options parameters.
|
|||
|
*/clearPages(e,t){let i={contentLength:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,p);}/**
|
|||
|
* The Upload Pages operation writes a range of pages to a page blob where the contents are read from a
|
|||
|
* URL
|
|||
|
* @param sourceUrl Specify a URL to the copy source.
|
|||
|
* @param sourceRange Bytes of source data in the specified range. The length of this range should
|
|||
|
* match the ContentLength header and x-ms-range/Range destination range header.
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param range The range of bytes to which the source range would be written. The range should be 512
|
|||
|
* aligned and range-end is required.
|
|||
|
* @param options The options parameters.
|
|||
|
*/uploadPagesFromURL(e,t,i,a,n){let o={sourceUrl:e,sourceRange:t,contentLength:i,range:a,options:r.operationOptionsToRequestOptionsBase(n||{})};return this.client.sendOperationRequest(o,d);}/**
|
|||
|
* The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a
|
|||
|
* page blob
|
|||
|
* @param options The options parameters.
|
|||
|
*/getPageRanges(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,m);}/**
|
|||
|
* The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were
|
|||
|
* changed between target blob and previous snapshot.
|
|||
|
* @param options The options parameters.
|
|||
|
*/getPageRangesDiff(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,h);}/**
|
|||
|
* Resize the Blob
|
|||
|
* @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The
|
|||
|
* page blob size must be aligned to a 512-byte boundary.
|
|||
|
* @param options The options parameters.
|
|||
|
*/resize(e,t){let i={blobContentLength:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,x);}/**
|
|||
|
* Update the sequence number of the blob
|
|||
|
* @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request.
|
|||
|
* This property applies to page blobs only. This property indicates how the service should modify the
|
|||
|
* blob's sequence number
|
|||
|
* @param options The options parameters.
|
|||
|
*/updateSequenceNumber(e,t){let i={sequenceNumberAction:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,f);}/**
|
|||
|
* The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob.
|
|||
|
* The snapshot is copied such that only the differential changes between the previously copied
|
|||
|
* snapshot are transferred to the destination. The copied snapshots are complete copies of the
|
|||
|
* original snapshot and can be read or copied from as usual. This API is supported since REST version
|
|||
|
* 2016-05-31.
|
|||
|
* @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to
|
|||
|
* 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would
|
|||
|
* appear in a request URI. The source blob must either be public or must be authenticated via a shared
|
|||
|
* access signature.
|
|||
|
* @param options The options parameters.
|
|||
|
*/copyIncremental(e,t){let i={copySource:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,g);}}// Operation Specifications
|
|||
|
let s=new i.Serializer(a,/* isXml */!0),u=new i.Serializer(a,/* isXml */!1),c={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.PageBlobCreateHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.PageBlobCreateExceptionHeaders}},queryParameters:[n.timeoutInSeconds],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.contentLength,n.metadata,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags,n.blobCacheControl,n.blobContentType,n.blobContentMD5,n.blobContentEncoding,n.blobContentLanguage,n.blobContentDisposition,n.immutabilityPolicyExpiry,n.immutabilityPolicyMode,n.encryptionScope,n.tier,n.blobTagsString,n.legalHold1,n.blobType,n.blobContentLength,n.blobSequenceNumber],isXML:!0,serializer:s},l={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.PageBlobUploadPagesHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.PageBlobUploadPagesExceptionHeaders}},requestBody:n.body1,queryParameters:[n.timeoutInSeconds,n.comp19],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.contentLength,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.range,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags,n.encryptionScope,n.transactionalContentMD5,n.transactionalContentCrc64,n.contentType1,n.accept2,n.pageWrite,n.ifSequenceNumberLessThanOrEqualTo,n.ifSequenceNumberLessThan,n.ifSequenceNumberEqualTo],mediaType:"binary",serializer:u},p={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.PageBlobClearPagesHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.PageBlobClearPagesExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.comp19],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.contentLength,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.range,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags,n.encryptionScope,n.ifSequenceNumberLessThanOrEqualTo,n.ifSequenceNumberLessThan,n.ifSequenceNumberEqualTo,n.pageWrite1],isXML:!0,serializer:s},d={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:a.PageBlobUploadPagesFromURLHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.PageBlobUploadPagesFromURLExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.comp19],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.contentLength,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.encryptionKey,n.encryptionKeySha256,n.encryptionAlgorithm,n.ifMatch,n.ifNoneMatch,n.ifTags,n.encryptionScope,n.sourceIfModifiedSince,n.sourceIfUnmodifiedSince,n.sourceIfMatch,n.sourceIfNoneMatch,n.sourceContentMD5,n.copySourceAuthorization,n.pageWrite,n.ifSequenceNumberLessThanOrEqualTo,n.ifSequenceNumberLessThan,n.ifSequenceNumberEqualTo,n.sourceUrl,n.sourceRange,n.sourceContentCrc64,n.range1],isXML:!0,serializer:s},m={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:a.PageList,headersMapper:a.PageBlobGetPageRangesHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.PageBlobGetPageRangesExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.marker,n.maxPageSize,n.snapshot,n.comp20],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.range,n.ifMatch,n.ifNoneMatch,n.ifTags],isXML:!0,serializer:s},h={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:a.PageList,headersMapper:a.PageBlobGetPageRangesDiffHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.PageBlobGetPageRangesDiffExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.marker,n.maxPageSize,n.snapshot,n.comp20,n.prevsnapshot],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince,n.range,n.ifMatch,n.ifNoneMatch,n.ifTags,n.prevSnapshotUrl],isXML:!0,serializer:s},x={path:"/{containerName}/{blob}",httpMethod:"PUT",res
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r,i,a,n=parcelRequire("5MFjo");function o(e){if(void 0!==e)return e;// No more check if string is a valid AccessTier, and left this to underlay logic to decide(service).
|
|||
|
}function s(e,t){if(e&&!t)throw RangeError("Customer-provided encryption key must be used over HTTPS.");e&&!e.encryptionAlgorithm&&(e.encryptionAlgorithm=n.EncryptionAlgorithmAES25);}(function(e){/**
|
|||
|
* Optimized for storing data that is accessed frequently.
|
|||
|
*/e.Hot="Hot",/**
|
|||
|
* Optimized for storing data that is infrequently accessed and stored for at least 30 days.
|
|||
|
*/e.Cool="Cool",/**
|
|||
|
* Optimized for storing data that is rarely accessed.
|
|||
|
*/e.Cold="Cold",/**
|
|||
|
* Optimized for storing data that is rarely accessed and stored for at least 180 days
|
|||
|
* with flexible latency requirements (on the order of hours).
|
|||
|
*/e.Archive="Archive";})(r||(r={})),function(e){/**
|
|||
|
* P4 Tier.
|
|||
|
*/e.P4="P4",/**
|
|||
|
* P6 Tier.
|
|||
|
*/e.P6="P6",/**
|
|||
|
* P10 Tier.
|
|||
|
*/e.P10="P10",/**
|
|||
|
* P15 Tier.
|
|||
|
*/e.P15="P15",/**
|
|||
|
* P20 Tier.
|
|||
|
*/e.P20="P20",/**
|
|||
|
* P30 Tier.
|
|||
|
*/e.P30="P30",/**
|
|||
|
* P40 Tier.
|
|||
|
*/e.P40="P40",/**
|
|||
|
* P50 Tier.
|
|||
|
*/e.P50="P50",/**
|
|||
|
* P60 Tier.
|
|||
|
*/e.P60="P60",/**
|
|||
|
* P70 Tier.
|
|||
|
*/e.P70="P70",/**
|
|||
|
* P80 Tier.
|
|||
|
*/e.P80="P80";}(i||(i={})),function(e){/**
|
|||
|
* The OAuth scope to use to retrieve an AAD token for Azure Storage.
|
|||
|
*/e.StorageOAuthScopes="https://storage.azure.com/.default",/**
|
|||
|
* The OAuth scope to use to retrieve an AAD token for Azure Disk.
|
|||
|
*/e.DiskComputeOAuthScopes="https://disk.compute.azure.com/.default";}(a||(a={}));}),parcelRequire.register("cayn8",function(e,t){$parcel$export(e.exports,"rangeResponseFromModel",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* Function that converts PageRange and ClearRange to a common Range object.
|
|||
|
* PageRange and ClearRange have start and end while Range offset and count
|
|||
|
* this function normalizes to Range.
|
|||
|
* @param response - Model PageBlob Range response
|
|||
|
*/function r(e){let t=(e._response.parsedBody.pageRange||[]).map(e=>({offset:e.start,count:e.end-e.start})),r=(e._response.parsedBody.clearRange||[]).map(e=>({offset:e.start,count:e.end-e.start}));return Object.assign(Object.assign({},e),{pageRange:t,clearRange:r,_response:Object.assign(Object.assign({},e._response),{parsedBody:{pageRange:t,clearRange:r}})});}}),parcelRequire.register("gYUwj",function(e,t){$parcel$export(e.exports,"isPipelineLike",()=>b),$parcel$export(e.exports,"newPipeline",()=>C);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("9VZfm"),i=parcelRequire("60VDC"),a=parcelRequire("fqZ1u"),n=parcelRequire("llt85"),o=parcelRequire("fIS4N"),s=parcelRequire("lrZDM"),u=parcelRequire("1Vc6S"),c=parcelRequire("7estx"),l=parcelRequire("4PgmQ"),p=parcelRequire("kx2Q5"),d=parcelRequire("6tWZN"),m=parcelRequire("eZ981"),h=parcelRequire("lncUR"),x=parcelRequire("5MFjo"),f=parcelRequire("chMMF"),g=parcelRequire("lnlvP"),D=parcelRequire("e7JkV"),y=parcelRequire("jcFdF");function b(e){if(!e||"object"!=typeof e)return!1;let t=e;return Array.isArray(t.factories)&&"object"==typeof t.options&&"function"==typeof t.toServiceClientOptions;}class v{/**
|
|||
|
* Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.
|
|||
|
*
|
|||
|
* @param factories -
|
|||
|
* @param options -
|
|||
|
*/constructor(e,t={}){this.factories=e,// when options.httpClient is not specified, passing in a DefaultHttpClient instance to
|
|||
|
// avoid each client creating its own http client.
|
|||
|
this.options=Object.assign(Object.assign({},t),{httpClient:t.httpClient||(0,g.getCachedDefaultHttpClient)()});}/**
|
|||
|
* Transfer Pipeline object to ServiceClientOptions object which is required by
|
|||
|
* ServiceClient constructor.
|
|||
|
*
|
|||
|
* @returns The ServiceClientOptions object from this Pipeline.
|
|||
|
*/toServiceClientOptions(){return{httpClient:this.options.httpClient,requestPolicyFactories:this.factories};}}function C(e,t={}){var g;void 0===e&&(e=new h.AnonymousCredential());// Order is important. Closer to the API at the top & closer to the network at the bottom.
|
|||
|
// The credential's policy factory must appear close to the wire so it can sign any
|
|||
|
// changes made by other factories (like UniqueRequestIDPolicyFactory)
|
|||
|
let b=new f.TelemetryPolicyFactory(t.userAgentOptions),C=[(0,r.tracingPolicy)({userAgent:b.telemetryString}),(0,i.keepAlivePolicy)(t.keepAliveOptions),b,(0,a.generateClientRequestIdPolicy)(),new d.StorageBrowserPolicyFactory(),new m.StorageRetryPolicyFactory(t.retryOptions),// Default deserializationPolicy is provided by protocol layer
|
|||
|
// Use customized XML char key of "#" so we could deserialize metadata
|
|||
|
// with "_" key
|
|||
|
(0,n.deserializationPolicy)(void 0,{xmlCharKey:"#"}),(0,o.logPolicy)({logger:p.logger.info,allowedHeaderNames:x.StorageBlobLoggingAllowedHeaderNames,allowedQueryParameters:x.StorageBlobLoggingAllowedQueryParameters})];return s.isNode&&(// policies only available in Node.js runtime, not in browsers
|
|||
|
C.push((0,u.proxyPolicy)(t.proxyOptions)),C.push((0,c.disableResponseDecompressionPolicy)())),C.push((0,l.isTokenCredential)(e)?(0,D.attachCredential)((0,y.storageBearerTokenChallengeAuthenticationPolicy)(e,null!==(g=t.audience)&&void 0!==g?g:x.StorageOAuthScopes),e):e),new v(C,t);}}),parcelRequire.register("9VZfm",function(e,t){$parcel$export(e.exports,"tracingPolicy",()=>u);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8"),i=parcelRequire("baIZW"),a=parcelRequire("2hiFM"),n=parcelRequire("bLdCz"),o=parcelRequire("aQvX1");let s=(0,i.createSpanFunction)({packagePrefix:"",namespace:""});function u(e={}){return{create:(t,r)=>new c(t,r,e)};}class c extends r.BaseRequestPolicy{constructor(e,t,r){super(e,t),this.userAgent=r.userAgent;}async sendRequest(e){if(!e.tracingContext)return this._nextPolicy.sendRequest(e);let t=this.tryCreateSpan(e);if(!t)return this._nextPolicy.sendRequest(e);try{let r=await this._nextPolicy.sendRequest(e);return this.tryProcessResponse(t,r),r;}catch(e){throw this.tryProcessError(t,e),e;}}tryCreateSpan(e){var t;try{// Passing spanOptions as part of tracingOptions to maintain compatibility @azure/core-tracing@preview.13 and earlier.
|
|||
|
// We can pass this as a separate parameter once we upgrade to the latest core-tracing.
|
|||
|
let{span:r}=s(`HTTP ${e.method}`,{tracingOptions:{spanOptions:Object.assign(Object.assign({},e.spanOptions),{kind:a.SpanKind.CLIENT}),tracingContext:e.tracingContext}});// If the span is not recording, don't do any more work.
|
|||
|
if(!r.isRecording()){r.end();return;}let i=null===(t=e.tracingContext)||void 0===t?void 0:t.getValue(Symbol.for("az.namespace"));"string"==typeof i&&r.setAttribute("az.namespace",i),r.setAttributes({"http.method":e.method,"http.url":e.url,requestId:e.requestId}),this.userAgent&&r.setAttribute("http.user_agent",this.userAgent);// set headers
|
|||
|
let o=r.spanContext(),u=(0,n.getTraceParentHeader)(o);if(u&&(0,a.isSpanContextValid)(o)){e.headers.set("traceparent",u);let t=o.traceState&&o.traceState.serialize();t&&e.headers.set("tracestate",t);}return r;}catch(e){(0,o.logger).warning(`Skipping creating a tracing span due to an error: ${e.message}`);return;}}tryProcessError(e,t){try{e.setStatus({code:a.SpanStatusCode.ERROR,message:t.message}),t.statusCode&&e.setAttribute("http.status_code",t.statusCode),e.end();}catch(e){(0,o.logger).warning(`Skipping tracing span processing due to an error: ${e.message}`);}}tryProcessResponse(e,t){try{e.setAttribute("http.status_code",t.status);let r=t.headers.get("x-ms-request-id");r&&e.setAttribute("serviceRequestId",r),e.setStatus({code:a.SpanStatusCode.OK}),e.end();}catch(e){(0,o.logger).warning(`Skipping tracing span processing due to an error: ${e.message}`);}}}}),parcelRequire.register("baIZW",function(e,t){$parcel$export(e.exports,"createSpanFunction",()=>o);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("2hiFM");parcelRequire("d10no");var i=parcelRequire("bYZ28"),a=parcelRequire("5PlQC");function n(){var e;if("undefined"==typeof process)return!1;let t=null===(e=process.env.AZURE_TRACING_DISABLED)||void 0===e?void 0:e.toLowerCase();return"false"!==t&&"0"!==t&&!!t;}function o(e){return function(t,o){let s;let u=(0,r.getTracer)(),c=(null==o?void 0:o.tracingOptions)||{},l=Object.assign({kind:r.SpanKind.INTERNAL},c.spanOptions),p=e.packagePrefix?`${e.packagePrefix}.${t}`:t;s=n()?(0,i.trace).wrapSpanContext(a.INVALID_SPAN_CONTEXT):u.startSpan(p,l,c.tracingContext),e.namespace&&s.setAttribute("az.namespace",e.namespace);let d=c.spanOptions||{};s.isRecording()&&e.namespace&&(d=Object.assign(Object.assign({},c.spanOptions),{attributes:Object.assign(Object.assign({},l.attributes),{"az.namespace":e.namespace})}));let m=Object.assign(Object.assign({},c),{spanOptions:d,tracingContext:(0,r.setSpan)(c.tracingContext||(0,r.context).active(),s)}),h=Object.assign(Object.assign({},o),{tracingOptions:m});return{span:s,updatedOptions:h};};}}),parcelRequire.register("bLdCz",function(e,t){$parcel$export(e.exports,"getTraceParentHeader",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
let r="00";function i(e){let t=[];if(e.traceId||t.push("traceId"),e.spanId||t.push("spanId"),t.length)return;let i=e.traceFlags||0/* NONE */,a=i.toString(16),n=1===a.length?`0${a}`:a;// https://www.w3.org/TR/trace-context/#traceparent-header-field-values
|
|||
|
return`${r}-${e.traceId}-${e.spanId}-${n}`;}}),parcelRequire.register("aQvX1",function(e,t){$parcel$export(e.exports,"logger",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("dcIHy");let i=(0,r.createClientLogger)("core-http");}),parcelRequire.register("dcIHy",function(e,t){let r;$parcel$export(e.exports,"createClientLogger",()=>l);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var i=parcelRequire("k3IFV");let a=new Set(),n="undefined"!=typeof process&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,o=(0,i.default)("azure");o.log=(...e)=>{(0,i.default).log(...e);};let s=["verbose","info","warning","error"];function u(e){if(e&&!h(e))throw Error(`Unknown log level '${e}'. Acceptable values: ${s.join(",")}`);r=e;let t=[];for(let e of a)m(e)&&t.push(e.namespace);(0,i.default).enable(t.join(","));}n&&(h(n)?u(n):console.error(`AZURE_LOG_LEVEL set to unknown log level '${n}'; logging is not enabled. Acceptable values: ${s.join(", ")}.`));let c={verbose:400,info:300,warning:200,error:100};function l(e){let t=o.extend(e);return p(o,t),{error:d(t,"error"),warning:d(t,"warning"),info:d(t,"info"),verbose:d(t,"verbose")};}function p(e,t){t.log=(...t)=>{e.log(...t);};}function d(e,t){let r=Object.assign(e.extend(t),{level:t});if(p(e,r),m(r)){let e=(0,i.default).disable();(0,i.default).enable(e+","+r.namespace);}return a.add(r),r;}function m(e){return!!(r&&c[e.level]<=c[r]);}function h(e){return s.includes(e);}}),parcelRequire.register("k3IFV",function(e,t){let r;$parcel$export(e.exports,"default",()=>x);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var i=parcelRequire("gpmsq");let a="undefined"!=typeof process&&process.env&&process.env.DEBUG||void 0,n=[],o=[],s=[];a&&c(a);let u=Object.assign(e=>d(e),{enable:c,enabled:l,disable:p,log:i.log});function c(e){r=e,n=[],o=[];let t=/\*/g,i=e.split(",").map(e=>e.trim().replace(t,".*?"));for(let e of i)e.startsWith("-")?o.push(RegExp(`^${e.substr(1)}$`)):n.push(RegExp(`^${e}$`));for(let e of s)e.enabled=l(e.namespace);}function l(e){if(e.endsWith("*"))return!0;for(let t of o)if(t.test(e))return!1;for(let t of n)if(t.test(e))return!0;return!1;}function p(){let e=r||"";return c(""),e;}function d(e){let t=Object.assign(r,{enabled:l(e),destroy:m,log:u.log,namespace:e,extend:h});function r(...i){t.enabled&&(i.length>0&&(i[0]=`${e} ${i[0]}`),t.log(...i));}return s.push(t),t;}function m(){let e=s.indexOf(this);return e>=0&&(s.splice(e,1),!0);}function h(e){let t=d(`${this.namespace}:${e}`);return t.log=this.log,t;}var x=u;}),parcelRequire.register("gpmsq",function(e,t){$parcel$export(e.exports,"log",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
function r(e,...t){process.stderr.write(`${$parcel$interopDefault($k14yv$util).format(e,...t)}${$k14yv$os.EOL}`);}}),parcelRequire.register("60VDC",function(e,t){$parcel$export(e.exports,"DefaultKeepAliveOptions",()=>i),$parcel$export(e.exports,"keepAlivePolicy",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8");let i={enable:!0};function a(e){return{create:(t,r)=>new n(t,r,e||i)};}class n extends r.BaseRequestPolicy{/**
|
|||
|
* Creates an instance of KeepAlivePolicy.
|
|||
|
*
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
* @param keepAliveOptions -
|
|||
|
*/constructor(e,t,r){super(e,t),this.keepAliveOptions=r;}/**
|
|||
|
* Sends out request.
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
* @returns
|
|||
|
*/async sendRequest(e){return e.keepAlive=this.keepAliveOptions.enable,this._nextPolicy.sendRequest(e);}}}),parcelRequire.register("fqZ1u",function(e,t){$parcel$export(e.exports,"generateClientRequestIdPolicy",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8");function i(e="x-ms-client-request-id"){return{create:(t,r)=>new a(t,r,e)};}class a extends r.BaseRequestPolicy{constructor(e,t,r){super(e,t),this._requestIdHeaderName=r;}sendRequest(e){return e.headers.contains(this._requestIdHeaderName)||e.headers.set(this._requestIdHeaderName,e.requestId),this._nextPolicy.sendRequest(e);}}}),parcelRequire.register("llt85",function(e,t){$parcel$export(e.exports,"deserializationPolicy",()=>s),$parcel$export(e.exports,"DefaultDeserializationOptions",()=>l);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8"),i=parcelRequire("2dg8H"),a=parcelRequire("e5kiN"),n=parcelRequire("f1RLO"),o=parcelRequire("hLHYf");function s(e,t){return{create:(r,i)=>new p(r,i,e,t)};}let u=["application/json","text/json"],c=["application/xml","application/atom+xml"],l={expectedContentTypes:{json:u,xml:c}};class p extends r.BaseRequestPolicy{constructor(e,t,r,a={}){var n;super(e,t),this.jsonContentTypes=r&&r.json||u,this.xmlContentTypes=r&&r.xml||c,this.xmlCharKey=null!==(n=a.xmlCharKey)&&void 0!==n?n:i.XML_CHARKEY;}async sendRequest(e){return this._nextPolicy.sendRequest(e).then(e=>h(this.jsonContentTypes,this.xmlContentTypes,e,{xmlCharKey:this.xmlCharKey}));}}function d(e){let t;let r=e.request,i=r.operationSpec;if(i){let a=r.operationResponseGetter;t=a?a(i,e):i.responses[e.status];}return t;}function m(e){let t=e.request.shouldDeserialize;return void 0===t||("boolean"==typeof t?t:t(e));}function h(e,t,r,o={}){var s,u,c;let l={rootName:null!==(s=o.rootName)&&void 0!==s?s:"",includeRoot:null!==(u=o.includeRoot)&&void 0!==u&&u,xmlCharKey:null!==(c=o.xmlCharKey)&&void 0!==c?c:i.XML_CHARKEY};return g(e,t,r,l).then(e=>{if(!m(e))return e;let t=e.request.operationSpec;if(!t||!t.responses)return e;let i=d(e),{error:s,shouldReturnResponse:u}=f(e,t,i);if(s)throw s;if(u)return e;// An operation response spec does exist for current status code, so
|
|||
|
// use it to deserialize the response.
|
|||
|
if(i){if(i.bodyMapper){let r=e.parsedBody;t.isXML&&i.bodyMapper.type.name===a.MapperType.Sequence&&(r="object"==typeof r?r[i.bodyMapper.xmlElementName]:[]);try{e.parsedBody=t.serializer.deserialize(i.bodyMapper,r,"operationRes.parsedBody",o);}catch(r){let t=new n.RestError(`Error ${r} occurred in deserializing the responseBody - ${e.bodyAsText}`,void 0,e.status,e.request,e);throw t;}}else"HEAD"===t.httpMethod&&(e.parsedBody=r.status>=200&&r.status<300);i.headersMapper&&(e.parsedHeaders=t.serializer.deserialize(i.headersMapper,e.headers.toJson(),"operationRes.parsedHeaders",o));}return e;});}function x(e){let t=Object.keys(e.responses);return 0===t.length||1===t.length&&"default"===t[0];}function f(e,t,r){var i;let o=200<=e.status&&e.status<300,s=x(t)?o:!!r;if(s&&(!r||!r.isError))return{error:null,shouldReturnResponse:!1};let u=null!=r?r:t.responses.default,c=(null===(i=e.request.streamResponseStatusCodes)||void 0===i?void 0:i.has(e.status))||e.request.streamResponseBody,l=c?`Unexpected status code: ${e.status}`:e.bodyAsText,p=new n.RestError(l,void 0,e.status,e.request,e);// If the item failed but there's no error spec or default spec to deserialize the error,
|
|||
|
// we should fail so we just throw the parsed response
|
|||
|
if(!u)throw p;let d=u.bodyMapper,m=u.headersMapper;try{// If error response has a body, try to deserialize it using default body mapper.
|
|||
|
// Then try to extract error code & message from it
|
|||
|
if(e.parsedBody){let r;let i=e.parsedBody;if(d){let e=i;t.isXML&&d.type.name===a.MapperType.Sequence&&(e="object"==typeof i?i[d.xmlElementName]:[]),r=t.serializer.deserialize(d,e,"error.response.parsedBody");}let n=i.error||r||i;p.code=n.code,n.message&&(p.message=n.message),d&&(p.response.parsedBody=r);}e.headers&&m&&(p.response.parsedHeaders=t.serializer.deserialize(m,e.headers.toJson(),"operationRes.parsedHeaders"));}catch(t){p.message=`Error "${t.message}" occurred in deserializing the responseBody - "${e.bodyAsText}" for the default response.`;}return{error:p,shouldReturnResponse:!1};}function g(e,t,r,i){var a;let s=e=>{let t=`Error "${e}" occurred while parsing the response body - ${r.bodyAsText}.`,i=e.code||n.RestError.PARSE_ERROR,a=new n.RestError(t,i,r.status,r.request,r);return Promise.reject(a);},u=(null===(a=r.request.streamResponseStatusCodes)||void 0===a?void 0:a.has(r.status))||r.request.streamResponseBody;if(!u&&r.bodyAsText){let a=r.bodyAsText,n=r.headers.get("Content-Type")||"",u=n?n.split(";").map(e=>e.toLowerCase()):[];if(0===u.length||u.some(t=>-1!==e.indexOf(t)))return new Promise(e=>{r.parsedBody=JSON.parse(a),e(r);}).catch(s);if(u.some(e=>-1!==t.indexOf(e)))return(0,o.parseXML)(a,i).then(e=>(r.parsedBody=e,r)).catch(s);}return Promise.resolve(r);}}),parcelRequire.register("f1RLO",function(e,t){$parcel$export(e.exports,"RestError",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("huRpD"),i=parcelRequire("d3CDj");let a=new r.Sanitizer();class n extends Error{constructor(e,t,r,i,a){super(e),this.name="RestError",this.code=t,this.statusCode=r,this.request=i,this.response=a,Object.setPrototypeOf(this,n.prototype);}/**
|
|||
|
* Logging method for util.inspect in Node
|
|||
|
*/[i.custom](){return`RestError: ${this.message}
|
|||
|
${a.sanitize(this)}`;}}/**
|
|||
|
* A constant string to identify errors that may arise when making an HTTP request that indicates an issue with the transport layer (e.g. the hostname of the URL cannot be resolved via DNS.)
|
|||
|
*/n.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR",/**
|
|||
|
* A constant string to identify errors that may arise from parsing an incoming HTTP response. Usually indicates a malformed HTTP body, such as an encoded JSON payload that is incomplete.
|
|||
|
*/n.PARSE_ERROR="PARSE_ERROR";}),parcelRequire.register("huRpD",function(e,t){$parcel$export(e.exports,"Sanitizer",()=>s);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("18oFr"),i=parcelRequire("8sP3n");let a="REDACTED",n=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],o=["api-version"];class s{constructor({allowedHeaderNames:e=[],allowedQueryParameters:t=[]}={}){e=Array.isArray(e)?n.concat(e):n,t=Array.isArray(t)?o.concat(t):o,this.allowedHeaderNames=new Set(e.map(e=>e.toLowerCase())),this.allowedQueryParameters=new Set(t.map(e=>e.toLowerCase()));}sanitize(e){let t=new Set();return JSON.stringify(e,(e,r)=>{// Ensure Errors include their interesting non-enumerable members
|
|||
|
if(r instanceof Error)return Object.assign(Object.assign({},r),{name:r.name,message:r.message});if("_headersMap"===e)return this.sanitizeHeaders(r);if("url"===e)return this.sanitizeUrl(r);if("query"===e)return this.sanitizeQuery(r);if("body"!==e){if("response"===e)return;if("operationSpec"===e)// field with the autorest spec. No need to log it.
|
|||
|
return;else if(Array.isArray(r)||(0,i.isObject)(r)){if(t.has(r))return"[Circular]";t.add(r);}return r;}},2);}sanitizeHeaders(e){return this.sanitizeObject(e,this.allowedHeaderNames,(e,t)=>e[t].value);}sanitizeQuery(e){return this.sanitizeObject(e,this.allowedQueryParameters,(e,t)=>e[t]);}sanitizeObject(e,t,r){if("object"!=typeof e||null===e)return e;let i={};for(let n of Object.keys(e))t.has(n.toLowerCase())?i[n]=r(e,n):i[n]=a;return i;}sanitizeUrl(e){if("string"!=typeof e||null===e)return e;let t=(0,r.URLBuilder).parse(e),i=t.getQuery();if(!i)return e;let n=(0,r.URLQuery).parse(i);for(let e of n.keys())this.allowedQueryParameters.has(e.toLowerCase())||n.set(e,a);return t.setQuery(n.toString()),t.toString();}}}),parcelRequire.register("d3CDj",function(e,t){$parcel$export(e.exports,"custom",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
let r=$k14yv$util.inspect.custom;}),parcelRequire.register("hLHYf",function(e,t){$parcel$export(e.exports,"stringifyXML",()=>s),$parcel$export(e.exports,"parseXML",()=>u);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("9OKsB"),i=parcelRequire("2dg8H");// Note: The reason we re-define all of the xml2js default settings (version 2.0) here is because the default settings object exposed
|
|||
|
// by the xm2js library is mutable. See https://github.com/Leonidas-from-XIV/node-xml2js/issues/536
|
|||
|
// By creating a new copy of the settings each time we instantiate the parser,
|
|||
|
// we are safeguarding against the possibility of the default settings being mutated elsewhere unintentionally.
|
|||
|
let a={explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:i.XML_ATTRKEY,explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:void 0,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:void 0,attrValueProcessors:void 0,tagNameProcessors:void 0,valueProcessors:void 0,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:void 0,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1},n=Object.assign({},a);n.explicitArray=!1;// The xml2js settings for general XML building operations.
|
|||
|
let o=Object.assign({},a);function s(e,t={}){var a;o.rootName=t.rootName,o.charkey=null!==(a=t.xmlCharKey)&&void 0!==a?a:i.XML_CHARKEY;let n=new r.Builder(o);return n.buildObject(e);}function u(e,t={}){var a;n.explicitRoot=!!t.includeRoot,n.charkey=null!==(a=t.xmlCharKey)&&void 0!==a?a:i.XML_CHARKEY;let o=new r.Parser(n);return new Promise((t,r)=>{e?o.parseString(e,(e,i)=>{e?r(e):t(i);}):r(Error("Document is empty"));});}o.explicitArray=!1,o.renderOpts={pretty:!1};}),parcelRequire.register("9OKsB",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a,n=function(e,t){for(var r in t)o.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},o={}.hasOwnProperty;r=parcelRequire("AfX4q"),t=parcelRequire("hBFg5"),i=parcelRequire("7JuJD"),a=parcelRequire("jyooR"),e.exports.defaults=r.defaults,e.exports.processors=a,e.exports.ValidationError=function(e){function t(e){this.message=e;}return n(t,e),t;}(Error),e.exports.Builder=t.Builder,e.exports.Parser=i.Parser,e.exports.parseString=i.parseString,e.exports.parseStringPromise=i.parseStringPromise;}).call(e.exports);}),parcelRequire.register("AfX4q",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){e.exports.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}};}).call(e.exports);}),parcelRequire.register("hBFg5",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a,n,o={}.hasOwnProperty;t=parcelRequire("iexRW"),r=parcelRequire("AfX4q").defaults,a=function(e){return"string"==typeof e&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0);},n=function(e){return"<![CDATA["+i(e)+"]]>";},i=function(e){return e.replace("]]>","]]]]><![CDATA[>");},e.exports.Builder=function(){function e(e){var t,i,a;for(t in this.options={},i=r["0.2"])o.call(i,t)&&(a=i[t],this.options[t]=a);for(t in e)o.call(e,t)&&(a=e[t],this.options[t]=a);}return e.prototype.buildObject=function(e){var i,s,u,c;return i=this.options.attrkey,s=this.options.charkey,1===Object.keys(e).length&&this.options.rootName===r["0.2"].rootName?(c=Object.keys(e)[0],e=e[c]):c=this.options.rootName,(u=function(e){return function(t,r){var c,l,p,d,m,h;if("object"!=typeof r)e.options.cdata&&a(r)?t.raw(n(r)):t.txt(r);else if(Array.isArray(r)){for(d in r)if(o.call(r,d))for(m in l=r[d])p=l[m],t=u(t.ele(m),p).up();}else for(m in r)if(o.call(r,m)){if(l=r[m],m===i){if("object"==typeof l)for(c in l)h=l[c],t=t.att(c,h);}else if(m===s)t=e.options.cdata&&a(l)?t.raw(n(l)):t.txt(l);else if(Array.isArray(l))for(d in l)o.call(l,d)&&(p=l[d],t="string"==typeof p?e.options.cdata&&a(p)?t.ele(m).raw(n(p)).up():t.ele(m,p).up():u(t.ele(m),p).up());else"object"==typeof l?t=u(t.ele(m),l).up():"string"==typeof l&&e.options.cdata&&a(l)?t=t.ele(m).raw(n(l)).up():(null==l&&(l=""),t=t.ele(m,l.toString()).up());}return t;};}(this))(t.create(c,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),e).end(this.options.renderOpts);},e;}();}).call(e.exports);}),parcelRequire.register("iexRW",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a,n,o,s,u,c,l;u=(l=parcelRequire("kVJuC")).assign,c=l.isFunction,i=parcelRequire("6Kdev"),a=parcelRequire("chPmK"),n=parcelRequire("evXP7"),s=parcelRequire("5Jk7q"),o=parcelRequire("dS5Gn"),t=parcelRequire("jlPhh"),r=parcelRequire("cc1c1"),e.exports.create=function(e,t,r,i){var n,o;if(null==e)throw Error("Root element needs a name.");return i=u({},t,r,i),o=(n=new a(i)).element(e),i.headless||(n.declaration(i),(null!=i.pubID||null!=i.sysID)&&n.dtd(i)),o;},e.exports.begin=function(e,t,r){var i;return(c(e)&&(t=(i=[e,t])[0],r=i[1],e={}),t)?new n(e,t,r):new a(e);},e.exports.stringWriter=function(e){return new s(e);},e.exports.streamWriter=function(e,t){return new o(e,t);},e.exports.implementation=new i(),e.exports.nodeType=t,e.exports.writerState=r;}).call(e.exports);}),parcelRequire.register("kVJuC",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a,n,o,s,u=[].slice,c={}.hasOwnProperty;t=function(){var e,t,r,i,a,o;if(o=arguments[0],a=2<=arguments.length?u.call(arguments,1):[],n(Object.assign))Object.assign.apply(null,arguments);else for(e=0,r=a.length;e<r;e++)if(null!=(i=a[e]))for(t in i)c.call(i,t)&&(o[t]=i[t]);return o;},n=function(e){return!!e&&"[object Function]"===Object.prototype.toString.call(e);},o=function(e){var t;return!!e&&("function"==(t=typeof e)||"object"===t);},i=function(e){return n(Array.isArray)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e);},a=function(e){var t;if(i(e))return!e.length;for(t in e)if(c.call(e,t))return!1;return!0;},s=function(e){var t,r;return o(e)&&(r=Object.getPrototypeOf(e))&&(t=r.constructor)&&"function"==typeof t&&t instanceof t&&Function.prototype.toString.call(t)===Function.prototype.toString.call(Object);},r=function(e){return n(e.valueOf)?e.valueOf():e;},e.exports.assign=t,e.exports.isFunction=n,e.exports.isObject=o,e.exports.isArray=i,e.exports.isEmpty=a,e.exports.isPlainObject=s,e.exports.getValue=r;}).call(e.exports);}),parcelRequire.register("6Kdev",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){e.exports=function(){function e(){}return e.prototype.hasFeature=function(e,t){return!0;},e.prototype.createDocumentType=function(e,t,r){throw Error("This DOM method is not implemented.");},e.prototype.createDocument=function(e,t,r){throw Error("This DOM method is not implemented.");},e.prototype.createHTMLDocument=function(e){throw Error("This DOM method is not implemented.");},e.prototype.getFeature=function(e,t){throw Error("This DOM method is not implemented.");},e;}();}).call(e.exports);}),parcelRequire.register("chPmK",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a,n,o,s,u=function(e,t){for(var r in t)c.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},c={}.hasOwnProperty;s=parcelRequire("kVJuC").isPlainObject,i=parcelRequire("6Kdev"),r=parcelRequire("1PJTc"),a=parcelRequire("lCtNl"),t=parcelRequire("jlPhh"),o=parcelRequire("jCuSG"),n=parcelRequire("5Jk7q"),e.exports=function(e){function a(e){a.__super__.constructor.call(this,null),this.name="#document",this.type=t.Document,this.documentURI=null,this.domConfig=new r(),e||(e={}),e.writer||(e.writer=new n()),this.options=e,this.stringify=new o(e);}return u(a,e),Object.defineProperty(a.prototype,"implementation",{value:new i()}),Object.defineProperty(a.prototype,"doctype",{get:function(){var e,r,i,a;for(r=0,i=(a=this.children).length;r<i;r++)if((e=a[r]).type===t.DocType)return e;return null;}}),Object.defineProperty(a.prototype,"documentElement",{get:function(){return this.rootObject||null;}}),Object.defineProperty(a.prototype,"inputEncoding",{get:function(){return null;}}),Object.defineProperty(a.prototype,"strictErrorChecking",{get:function(){return!1;}}),Object.defineProperty(a.prototype,"xmlEncoding",{get:function(){return 0!==this.children.length&&this.children[0].type===t.Declaration?this.children[0].encoding:null;}}),Object.defineProperty(a.prototype,"xmlStandalone",{get:function(){return 0!==this.children.length&&this.children[0].type===t.Declaration&&"yes"===this.children[0].standalone;}}),Object.defineProperty(a.prototype,"xmlVersion",{get:function(){return 0!==this.children.length&&this.children[0].type===t.Declaration?this.children[0].version:"1.0";}}),Object.defineProperty(a.prototype,"URL",{get:function(){return this.documentURI;}}),Object.defineProperty(a.prototype,"origin",{get:function(){return null;}}),Object.defineProperty(a.prototype,"compatMode",{get:function(){return null;}}),Object.defineProperty(a.prototype,"characterSet",{get:function(){return null;}}),Object.defineProperty(a.prototype,"contentType",{get:function(){return null;}}),a.prototype.end=function(e){var t;return t={},e?s(e)&&(t=e,e=this.options.writer):e=this.options.writer,e.document(this,e.filterOptions(t));},a.prototype.toString=function(e){return this.options.writer.document(this,this.options.writer.filterOptions(e));},a.prototype.createElement=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.createDocumentFragment=function(){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.createTextNode=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.createComment=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.createCDATASection=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.createProcessingInstruction=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.createAttribute=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.createEntityReference=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.getElementsByTagName=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.importNode=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.createElementNS=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.createAttributeNS=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.getElementsByTagNameNS=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.getElementById=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.adoptNode=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.normalizeDocument=function(){throw Error("This DOM method
|
|||
|
(function(){var t,r;t=parcelRequire("8zaN6"),r=parcelRequire("9ih7M"),e.exports=function(){function e(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new t(),infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Object.create(this.defaultParams);}return Object.defineProperty(e.prototype,"parameterNames",{get:function(){return new r(Object.keys(this.defaultParams));}}),e.prototype.getParameter=function(e){return this.params.hasOwnProperty(e)?this.params[e]:null;},e.prototype.canSetParameter=function(e,t){return!0;},e.prototype.setParameter=function(e,t){return null!=t?this.params[e]=t:delete this.params[e];},e;}();}).call(e.exports);}),parcelRequire.register("8zaN6",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){e.exports=function(){function e(){}return e.prototype.handleError=function(e){throw Error(e);},e;}();}).call(e.exports);}),parcelRequire.register("9ih7M",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){e.exports=function(){function e(e){this.arr=e||[];}return Object.defineProperty(e.prototype,"length",{get:function(){return this.arr.length;}}),e.prototype.item=function(e){return this.arr[e]||null;},e.prototype.contains=function(e){return-1!==this.arr.indexOf(e);},e;}();}).call(e.exports);}),parcelRequire.register("lCtNl",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a,n,o,s,u,c,l,p,d,m,h,x,f,g,D,y={}.hasOwnProperty;g=(D=parcelRequire("kVJuC")).isObject,f=D.isFunction,x=D.isEmpty,h=D.getValue,u=null,i=null,a=null,n=null,o=null,d=null,m=null,p=null,s=null,r=null,l=null,t=null,e.exports=function(){function e(e){this.parent=e,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,u||(u=parcelRequire("fKfZt"),i=parcelRequire("hXN4g"),a=parcelRequire("dMHoW"),n=parcelRequire("hkFgb"),o=parcelRequire("ci5Ld"),d=parcelRequire("1COsN"),m=parcelRequire("5uTV5"),p=parcelRequire("lAu2Z"),s=parcelRequire("9TZDR"),r=parcelRequire("jlPhh"),l=parcelRequire("5ZspB"),c=parcelRequire("i7kdB"),t=parcelRequire("3Kkfu"));}return Object.defineProperty(e.prototype,"nodeName",{get:function(){return this.name;}}),Object.defineProperty(e.prototype,"nodeType",{get:function(){return this.type;}}),Object.defineProperty(e.prototype,"nodeValue",{get:function(){return this.value;}}),Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent;}}),Object.defineProperty(e.prototype,"childNodes",{get:function(){return this.childNodeList&&this.childNodeList.nodes||(this.childNodeList=new l(this.children)),this.childNodeList;}}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.children[0]||null;}}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null;}}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){var e;return e=this.parent.children.indexOf(this),this.parent.children[e-1]||null;}}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){var e;return e=this.parent.children.indexOf(this),this.parent.children[e+1]||null;}}),Object.defineProperty(e.prototype,"ownerDocument",{get:function(){return this.document()||null;}}),Object.defineProperty(e.prototype,"textContent",{get:function(){var e,t,i,a,n;if(this.nodeType!==r.Element&&this.nodeType!==r.DocumentFragment)return null;for(t=0,n="",i=(a=this.children).length;t<i;t++)(e=a[t]).textContent&&(n+=e.textContent);return n;},set:function(e){throw Error("This DOM method is not implemented."+this.debugInfo());}}),e.prototype.setParent=function(e){var t,r,i,a,n;for(this.parent=e,e&&(this.options=e.options,this.stringify=e.stringify),a=this.children,n=[],r=0,i=a.length;r<i;r++)t=a[r],n.push(t.setParent(this));return n;},e.prototype.element=function(e,t,r){var i,a,n,o,s,u,c,l,p,d,m;if(u=null,null===t&&null==r&&(t=(p=[{},null])[0],r=p[1]),null==t&&(t={}),g(t=h(t))||(r=(d=[t,r])[0],t=d[1]),null!=e&&(e=h(e)),Array.isArray(e))for(n=0,c=e.length;n<c;n++)a=e[n],u=this.element(a);else if(f(e))u=this.element(e.apply());else if(g(e)){for(s in e)if(y.call(e,s)){if(m=e[s],f(m)&&(m=m.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&0===s.indexOf(this.stringify.convertAttKey))u=this.attribute(s.substr(this.stringify.convertAttKey.length),m);else if(!this.options.separateArrayItems&&Array.isArray(m)&&x(m))u=this.dummy();else if(g(m)&&x(m))u=this.element(s);else if(this.options.keepNullNodes||null!=m){if(!this.options.separateArrayItems&&Array.isArray(m))for(o=0,l=m.length;o<l;o++)a=m[o],(i={})[s]=a,u=this.element(i);else g(m)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&0===s.indexOf(this.stringify.convertTextKey)?u=this.element(m):(u=this.element(s)).element(m):u=this.element(s,m);}else u=this.dummy();}}else u=this.options.keepNullNodes||null!==r?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&0===e.indexOf(this.stringify.convertTextKey)?this.text(r):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&0===e.indexOf(this.stringify.convertCDataKey)?this.cdata(r):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&0===e.indexOf(this.stringify.convertCommentKey)?this.comment(r):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&0===e.indexOf(this.stringify.convertRawKey)?this.raw(r):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&0===e.indexOf(this.stringif
|
|||
|
(function(){var t,r,i,a,n,o,s,u,c=function(e,t){for(var r in t)l.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},l={}.hasOwnProperty;s=(u=parcelRequire("kVJuC")).isObject,o=u.isFunction,n=u.getValue,a=parcelRequire("lCtNl"),t=parcelRequire("jlPhh"),r=parcelRequire("26xpk"),i=parcelRequire("i7kdB"),e.exports=function(e){function a(e,r,i){var n,o,s,u;if(a.__super__.constructor.call(this,e),null==r)throw Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(r),this.type=t.Element,this.attribs={},this.schemaTypeInfo=null,null!=i&&this.attribute(i),e.type===t.Document&&(this.isRoot=!0,this.documentObject=e,e.rootObject=this,e.children)){for(o=0,s=(u=e.children).length;o<s;o++)if((n=u[o]).type===t.DocType){n.name=this.name;break;}}}return c(a,e),Object.defineProperty(a.prototype,"tagName",{get:function(){return this.name;}}),Object.defineProperty(a.prototype,"namespaceURI",{get:function(){return"";}}),Object.defineProperty(a.prototype,"prefix",{get:function(){return"";}}),Object.defineProperty(a.prototype,"localName",{get:function(){return this.name;}}),Object.defineProperty(a.prototype,"id",{get:function(){throw Error("This DOM method is not implemented."+this.debugInfo());}}),Object.defineProperty(a.prototype,"className",{get:function(){throw Error("This DOM method is not implemented."+this.debugInfo());}}),Object.defineProperty(a.prototype,"classList",{get:function(){throw Error("This DOM method is not implemented."+this.debugInfo());}}),Object.defineProperty(a.prototype,"attributes",{get:function(){return this.attributeMap&&this.attributeMap.nodes||(this.attributeMap=new i(this.attribs)),this.attributeMap;}}),a.prototype.clone=function(){var e,t,r,i;for(t in(r=Object.create(this)).isRoot&&(r.documentObject=null),r.attribs={},i=this.attribs)l.call(i,t)&&(e=i[t],r.attribs[t]=e.clone());return r.children=[],this.children.forEach(function(e){var t;return(t=e.clone()).parent=r,r.children.push(t);}),r;},a.prototype.attribute=function(e,t){var i,a;if(null!=e&&(e=n(e)),s(e))for(i in e)l.call(e,i)&&(a=e[i],this.attribute(i,a));else o(t)&&(t=t.apply()),this.options.keepNullAttributes&&null==t?this.attribs[e]=new r(this,e,""):null!=t&&(this.attribs[e]=new r(this,e,t));return this;},a.prototype.removeAttribute=function(e){var t,r,i;if(null==e)throw Error("Missing attribute name. "+this.debugInfo());if(Array.isArray(e=n(e)))for(r=0,i=e.length;r<i;r++)t=e[r],delete this.attribs[t];else delete this.attribs[e];return this;},a.prototype.toString=function(e){return this.options.writer.element(this,this.options.writer.filterOptions(e));},a.prototype.att=function(e,t){return this.attribute(e,t);},a.prototype.a=function(e,t){return this.attribute(e,t);},a.prototype.getAttribute=function(e){return this.attribs.hasOwnProperty(e)?this.attribs[e].value:null;},a.prototype.setAttribute=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.getAttributeNode=function(e){return this.attribs.hasOwnProperty(e)?this.attribs[e]:null;},a.prototype.setAttributeNode=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.removeAttributeNode=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.getElementsByTagName=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.getAttributeNS=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.setAttributeNS=function(e,t,r){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.removeAttributeNS=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.getAttributeNodeNS=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.setAttributeNodeNS=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},a.prototype.getElementsByTagNameNS=function(e,t){throw Error("This DOM method is
|
|||
|
(function(){e.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205};}).call(e.exports);}),parcelRequire.register("26xpk",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r;t=parcelRequire("jlPhh"),r=parcelRequire("lCtNl"),e.exports=function(){function e(e,r,i){if(this.parent=e,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),null==r)throw Error("Missing attribute name. "+this.debugInfo(r));this.name=this.stringify.name(r),this.value=this.stringify.attValue(i),this.type=t.Attribute,this.isId=!1,this.schemaTypeInfo=null;}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return this.type;}}),Object.defineProperty(e.prototype,"ownerElement",{get:function(){return this.parent;}}),Object.defineProperty(e.prototype,"textContent",{get:function(){return this.value;},set:function(e){return this.value=e||"";}}),Object.defineProperty(e.prototype,"namespaceURI",{get:function(){return"";}}),Object.defineProperty(e.prototype,"prefix",{get:function(){return"";}}),Object.defineProperty(e.prototype,"localName",{get:function(){return this.name;}}),Object.defineProperty(e.prototype,"specified",{get:function(){return!0;}}),e.prototype.clone=function(){return Object.create(this);},e.prototype.toString=function(e){return this.options.writer.attribute(this,this.options.writer.filterOptions(e));},e.prototype.debugInfo=function(e){return null==(e=e||this.name)?"parent: <"+this.parent.name+">":"attribute: {"+e+"}, parent: <"+this.parent.name+">";},e.prototype.isEqualNode=function(e){return e.namespaceURI===this.namespaceURI&&e.prefix===this.prefix&&e.localName===this.localName&&e.value===this.value;},e;}();}).call(e.exports);}),parcelRequire.register("i7kdB",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){e.exports=function(){function e(e){this.nodes=e;}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0;}}),e.prototype.clone=function(){return this.nodes=null;},e.prototype.getNamedItem=function(e){return this.nodes[e];},e.prototype.setNamedItem=function(e){var t;return t=this.nodes[e.nodeName],this.nodes[e.nodeName]=e,t||null;},e.prototype.removeNamedItem=function(e){var t;return t=this.nodes[e],delete this.nodes[e],t||null;},e.prototype.item=function(e){return this.nodes[Object.keys(this.nodes)[e]]||null;},e.prototype.getNamedItemNS=function(e,t){throw Error("This DOM method is not implemented.");},e.prototype.setNamedItemNS=function(e){throw Error("This DOM method is not implemented.");},e.prototype.removeNamedItemNS=function(e,t){throw Error("This DOM method is not implemented.");},e;}();}).call(e.exports);}),parcelRequire.register("hXN4g",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i=function(e,t){for(var r in t)a.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},a={}.hasOwnProperty;t=parcelRequire("jlPhh"),r=parcelRequire("kMEMg"),e.exports=function(e){function r(e,i){if(r.__super__.constructor.call(this,e),null==i)throw Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=t.CData,this.value=this.stringify.cdata(i);}return i(r,e),r.prototype.clone=function(){return Object.create(this);},r.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e));},r;}(r);}).call(e.exports);}),parcelRequire.register("kMEMg",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r=function(e,t){for(var r in t)i.call(t,r)&&(e[r]=t[r]);function a(){this.constructor=e;}return a.prototype=t.prototype,e.prototype=new a(),e.__super__=t.prototype,e;},i={}.hasOwnProperty;t=parcelRequire("lCtNl"),e.exports=function(e){function t(e){t.__super__.constructor.call(this,e),this.value="";}return r(t,e),Object.defineProperty(t.prototype,"data",{get:function(){return this.value;},set:function(e){return this.value=e||"";}}),Object.defineProperty(t.prototype,"length",{get:function(){return this.value.length;}}),Object.defineProperty(t.prototype,"textContent",{get:function(){return this.value;},set:function(e){return this.value=e||"";}}),t.prototype.clone=function(){return Object.create(this);},t.prototype.substringData=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},t.prototype.appendData=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},t.prototype.insertData=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},t.prototype.deleteData=function(e,t){throw Error("This DOM method is not implemented."+this.debugInfo());},t.prototype.replaceData=function(e,t,r){throw Error("This DOM method is not implemented."+this.debugInfo());},t.prototype.isEqualNode=function(e){return!!t.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)&&e.data===this.data;},t;}(t);}).call(e.exports);}),parcelRequire.register("dMHoW",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i=function(e,t){for(var r in t)a.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},a={}.hasOwnProperty;t=parcelRequire("jlPhh"),r=parcelRequire("kMEMg"),e.exports=function(e){function r(e,i){if(r.__super__.constructor.call(this,e),null==i)throw Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=t.Comment,this.value=this.stringify.comment(i);}return i(r,e),r.prototype.clone=function(){return Object.create(this);},r.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e));},r;}(r);}).call(e.exports);}),parcelRequire.register("hkFgb",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a=function(e,t){for(var r in t)n.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},n={}.hasOwnProperty;i=parcelRequire("kVJuC").isObject,r=parcelRequire("lCtNl"),t=parcelRequire("jlPhh"),e.exports=function(e){function r(e,a,n,o){var s;r.__super__.constructor.call(this,e),i(a)&&(a=(s=a).version,n=s.encoding,o=s.standalone),a||(a="1.0"),this.type=t.Declaration,this.version=this.stringify.xmlVersion(a),null!=n&&(this.encoding=this.stringify.xmlEncoding(n)),null!=o&&(this.standalone=this.stringify.xmlStandalone(o));}return a(r,e),r.prototype.toString=function(e){return this.options.writer.declaration(this,this.options.writer.filterOptions(e));},r;}(r);}).call(e.exports);}),parcelRequire.register("ci5Ld",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a,n,o,s,u,c=function(e,t){for(var r in t)l.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},l={}.hasOwnProperty;u=parcelRequire("kVJuC").isObject,s=parcelRequire("lCtNl"),t=parcelRequire("jlPhh"),r=parcelRequire("hyYIz"),a=parcelRequire("jDv5A"),i=parcelRequire("e1Cf2"),n=parcelRequire("kowMM"),o=parcelRequire("i7kdB"),e.exports=function(e){function s(e,r,i){var a,n,o,c,l,p;if(s.__super__.constructor.call(this,e),this.type=t.DocType,e.children){for(n=0,o=(c=e.children).length;n<o;n++)if((a=c[n]).type===t.Element){this.name=a.name;break;}}this.documentObject=e,u(r)&&(r=(l=r).pubID,i=l.sysID),null==i&&(i=(p=[r,i])[0],r=p[1]),null!=r&&(this.pubID=this.stringify.dtdPubID(r)),null!=i&&(this.sysID=this.stringify.dtdSysID(i));}return c(s,e),Object.defineProperty(s.prototype,"entities",{get:function(){var e,r,i,a,n;for(r=0,a={},i=(n=this.children).length;r<i;r++)(e=n[r]).type!==t.EntityDeclaration||e.pe||(a[e.name]=e);return new o(a);}}),Object.defineProperty(s.prototype,"notations",{get:function(){var e,r,i,a,n;for(r=0,a={},i=(n=this.children).length;r<i;r++)(e=n[r]).type===t.NotationDeclaration&&(a[e.name]=e);return new o(a);}}),Object.defineProperty(s.prototype,"publicId",{get:function(){return this.pubID;}}),Object.defineProperty(s.prototype,"systemId",{get:function(){return this.sysID;}}),Object.defineProperty(s.prototype,"internalSubset",{get:function(){throw Error("This DOM method is not implemented."+this.debugInfo());}}),s.prototype.element=function(e,t){var r;return r=new i(this,e,t),this.children.push(r),this;},s.prototype.attList=function(e,t,i,a,n){var o;return o=new r(this,e,t,i,a,n),this.children.push(o),this;},s.prototype.entity=function(e,t){var r;return r=new a(this,!1,e,t),this.children.push(r),this;},s.prototype.pEntity=function(e,t){var r;return r=new a(this,!0,e,t),this.children.push(r),this;},s.prototype.notation=function(e,t){var r;return r=new n(this,e,t),this.children.push(r),this;},s.prototype.toString=function(e){return this.options.writer.docType(this,this.options.writer.filterOptions(e));},s.prototype.ele=function(e,t){return this.element(e,t);},s.prototype.att=function(e,t,r,i,a){return this.attList(e,t,r,i,a);},s.prototype.ent=function(e,t){return this.entity(e,t);},s.prototype.pent=function(e,t){return this.pEntity(e,t);},s.prototype.not=function(e,t){return this.notation(e,t);},s.prototype.up=function(){return this.root()||this.documentObject;},s.prototype.isEqualNode=function(e){return!!s.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)&&e.name===this.name&&e.publicId===this.publicId&&e.systemId===this.systemId;},s;}(s);}).call(e.exports);}),parcelRequire.register("hyYIz",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i=function(e,t){for(var r in t)a.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},a={}.hasOwnProperty;r=parcelRequire("lCtNl"),t=parcelRequire("jlPhh"),e.exports=function(e){function r(e,i,a,n,o,s){if(r.__super__.constructor.call(this,e),null==i)throw Error("Missing DTD element name. "+this.debugInfo());if(null==a)throw Error("Missing DTD attribute name. "+this.debugInfo(i));if(!n)throw Error("Missing DTD attribute type. "+this.debugInfo(i));if(!o)throw Error("Missing DTD attribute default. "+this.debugInfo(i));if(0!==o.indexOf("#")&&(o="#"+o),!o.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(i));if(s&&!o.match(/^(#FIXED|#DEFAULT)$/))throw Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(i));this.elementName=this.stringify.name(i),this.type=t.AttributeDeclaration,this.attributeName=this.stringify.name(a),this.attributeType=this.stringify.dtdAttType(n),s&&(this.defaultValue=this.stringify.dtdAttDefault(s)),this.defaultValueType=o;}return i(r,e),r.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e));},r;}(r);}).call(e.exports);}),parcelRequire.register("jDv5A",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a=function(e,t){for(var r in t)n.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},n={}.hasOwnProperty;i=parcelRequire("kVJuC").isObject,r=parcelRequire("lCtNl"),t=parcelRequire("jlPhh"),e.exports=function(e){function r(e,a,n,o){if(r.__super__.constructor.call(this,e),null==n)throw Error("Missing DTD entity name. "+this.debugInfo(n));if(null==o)throw Error("Missing DTD entity value. "+this.debugInfo(n));if(this.pe=!!a,this.name=this.stringify.name(n),this.type=t.EntityDeclaration,i(o)){if(!o.pubID&&!o.sysID)throw Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(n));if(o.pubID&&!o.sysID)throw Error("System identifier is required for a public external entity. "+this.debugInfo(n));if(this.internal=!1,null!=o.pubID&&(this.pubID=this.stringify.dtdPubID(o.pubID)),null!=o.sysID&&(this.sysID=this.stringify.dtdSysID(o.sysID)),null!=o.nData&&(this.nData=this.stringify.dtdNData(o.nData)),this.pe&&this.nData)throw Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(n));}else this.value=this.stringify.dtdEntityValue(o),this.internal=!0;}return a(r,e),Object.defineProperty(r.prototype,"publicId",{get:function(){return this.pubID;}}),Object.defineProperty(r.prototype,"systemId",{get:function(){return this.sysID;}}),Object.defineProperty(r.prototype,"notationName",{get:function(){return this.nData||null;}}),Object.defineProperty(r.prototype,"inputEncoding",{get:function(){return null;}}),Object.defineProperty(r.prototype,"xmlEncoding",{get:function(){return null;}}),Object.defineProperty(r.prototype,"xmlVersion",{get:function(){return null;}}),r.prototype.toString=function(e){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(e));},r;}(r);}).call(e.exports);}),parcelRequire.register("e1Cf2",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i=function(e,t){for(var r in t)a.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},a={}.hasOwnProperty;r=parcelRequire("lCtNl"),t=parcelRequire("jlPhh"),e.exports=function(e){function r(e,i,a){if(r.__super__.constructor.call(this,e),null==i)throw Error("Missing DTD element name. "+this.debugInfo());a||(a="(#PCDATA)"),Array.isArray(a)&&(a="("+a.join(",")+")"),this.name=this.stringify.name(i),this.type=t.ElementDeclaration,this.value=this.stringify.dtdElementValue(a);}return i(r,e),r.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e));},r;}(r);}).call(e.exports);}),parcelRequire.register("kowMM",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i=function(e,t){for(var r in t)a.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},a={}.hasOwnProperty;r=parcelRequire("lCtNl"),t=parcelRequire("jlPhh"),e.exports=function(e){function r(e,i,a){if(r.__super__.constructor.call(this,e),null==i)throw Error("Missing DTD notation name. "+this.debugInfo(i));if(!a.pubID&&!a.sysID)throw Error("Public or system identifiers are required for an external entity. "+this.debugInfo(i));this.name=this.stringify.name(i),this.type=t.NotationDeclaration,null!=a.pubID&&(this.pubID=this.stringify.dtdPubID(a.pubID)),null!=a.sysID&&(this.sysID=this.stringify.dtdSysID(a.sysID));}return i(r,e),Object.defineProperty(r.prototype,"publicId",{get:function(){return this.pubID;}}),Object.defineProperty(r.prototype,"systemId",{get:function(){return this.sysID;}}),r.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e));},r;}(r);}).call(e.exports);}),parcelRequire.register("1COsN",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i=function(e,t){for(var r in t)a.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},a={}.hasOwnProperty;t=parcelRequire("jlPhh"),r=parcelRequire("lCtNl"),e.exports=function(e){function r(e,i){if(r.__super__.constructor.call(this,e),null==i)throw Error("Missing raw text. "+this.debugInfo());this.type=t.Raw,this.value=this.stringify.raw(i);}return i(r,e),r.prototype.clone=function(){return Object.create(this);},r.prototype.toString=function(e){return this.options.writer.raw(this,this.options.writer.filterOptions(e));},r;}(r);}).call(e.exports);}),parcelRequire.register("5uTV5",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i=function(e,t){for(var r in t)a.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},a={}.hasOwnProperty;t=parcelRequire("jlPhh"),r=parcelRequire("kMEMg"),e.exports=function(e){function r(e,i){if(r.__super__.constructor.call(this,e),null==i)throw Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=t.Text,this.value=this.stringify.text(i);}return i(r,e),Object.defineProperty(r.prototype,"isElementContentWhitespace",{get:function(){throw Error("This DOM method is not implemented."+this.debugInfo());}}),Object.defineProperty(r.prototype,"wholeText",{get:function(){var e,t,r;for(r="",t=this.previousSibling;t;)r=t.data+r,t=t.previousSibling;for(r+=this.data,e=this.nextSibling;e;)r+=e.data,e=e.nextSibling;return r;}}),r.prototype.clone=function(){return Object.create(this);},r.prototype.toString=function(e){return this.options.writer.text(this,this.options.writer.filterOptions(e));},r.prototype.splitText=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},r.prototype.replaceWholeText=function(e){throw Error("This DOM method is not implemented."+this.debugInfo());},r;}(r);}).call(e.exports);}),parcelRequire.register("lAu2Z",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i=function(e,t){for(var r in t)a.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},a={}.hasOwnProperty;t=parcelRequire("jlPhh"),r=parcelRequire("kMEMg"),e.exports=function(e){function r(e,i,a){if(r.__super__.constructor.call(this,e),null==i)throw Error("Missing instruction target. "+this.debugInfo());this.type=t.ProcessingInstruction,this.target=this.stringify.insTarget(i),this.name=this.target,a&&(this.value=this.stringify.insValue(a));}return i(r,e),r.prototype.clone=function(){return Object.create(this);},r.prototype.toString=function(e){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(e));},r.prototype.isEqualNode=function(e){return!!r.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)&&e.target===this.target;},r;}(r);}).call(e.exports);}),parcelRequire.register("9TZDR",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i=function(e,t){for(var r in t)a.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},a={}.hasOwnProperty;r=parcelRequire("lCtNl"),t=parcelRequire("jlPhh"),e.exports=function(e){function r(e){r.__super__.constructor.call(this,e),this.type=t.Dummy;}return i(r,e),r.prototype.clone=function(){return Object.create(this);},r.prototype.toString=function(e){return"";},r;}(r);}).call(e.exports);}),parcelRequire.register("5ZspB",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){e.exports=function(){function e(e){this.nodes=e;}return Object.defineProperty(e.prototype,"length",{get:function(){return this.nodes.length||0;}}),e.prototype.clone=function(){return this.nodes=null;},e.prototype.item=function(e){return this.nodes[e]||null;},e;}();}).call(e.exports);}),parcelRequire.register("3Kkfu",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){e.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32};}).call(e.exports);}),parcelRequire.register("jCuSG",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t=function(e,t){return function(){return e.apply(t,arguments);};},r={}.hasOwnProperty;e.exports=function(){function e(e){var i,a,n;for(i in this.assertLegalName=t(this.assertLegalName,this),this.assertLegalChar=t(this.assertLegalChar,this),e||(e={}),this.options=e,this.options.version||(this.options.version="1.0"),a=e.stringify||{})r.call(a,i)&&(n=a[i],this[i]=n);}return e.prototype.name=function(e){return this.options.noValidation?e:this.assertLegalName(""+e||"");},e.prototype.text=function(e){return this.options.noValidation?e:this.assertLegalChar(this.textEscape(""+e||""));},e.prototype.cdata=function(e){return this.options.noValidation?e:(e=(e=""+e||"").replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(e));},e.prototype.comment=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/--/))throw Error("Comment text cannot contain double-hypen: "+e);return this.assertLegalChar(e);},e.prototype.raw=function(e){return this.options.noValidation?e:""+e||"";},e.prototype.attValue=function(e){return this.options.noValidation?e:this.assertLegalChar(this.attEscape(e=""+e||""));},e.prototype.insTarget=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"");},e.prototype.insValue=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/\?>/))throw Error("Invalid processing instruction value: "+e);return this.assertLegalChar(e);},e.prototype.xmlVersion=function(e){if(this.options.noValidation)return e;if(!(e=""+e||"").match(/1\.[0-9]+/))throw Error("Invalid version number: "+e);return e;},e.prototype.xmlEncoding=function(e){if(this.options.noValidation)return e;if(!(e=""+e||"").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw Error("Invalid encoding: "+e);return this.assertLegalChar(e);},e.prototype.xmlStandalone=function(e){return this.options.noValidation?e:e?"yes":"no";},e.prototype.dtdPubID=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"");},e.prototype.dtdSysID=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"");},e.prototype.dtdElementValue=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"");},e.prototype.dtdAttType=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"");},e.prototype.dtdAttDefault=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"");},e.prototype.dtdEntityValue=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"");},e.prototype.dtdNData=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"");},e.prototype.convertAttKey="@",e.prototype.convertPIKey="?",e.prototype.convertTextKey="#text",e.prototype.convertCDataKey="#cdata",e.prototype.convertCommentKey="#comment",e.prototype.convertRawKey="#raw",e.prototype.assertLegalChar=function(e){var t,r;if(this.options.noValidation)return e;if(t="","1.0"===this.options.version){if(t=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,r=e.match(t))throw Error("Invalid character in string: "+e+" at index "+r.index);}else if("1.1"===this.options.version&&(t=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,r=e.match(t)))throw Error("Invalid character in string: "+e+" at index "+r.index);return e;},e.prototype.assertLegalName=function(e){var t;if(this.options.noValidation)return e;if(this.assertLegalChar(e),t=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!e.match(t))throw Error("Invalid character in name");return e;},e.prototype.textEscape=function(e){var t;return this.options.noValidation?e:(t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,e.replace(t,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g
|
|||
|
(function(){var t,r=function(e,t){for(var r in t)i.call(t,r)&&(e[r]=t[r]);function a(){this.constructor=e;}return a.prototype=t.prototype,e.prototype=new a(),e.__super__=t.prototype,e;},i={}.hasOwnProperty;t=parcelRequire("iSJWK"),e.exports=function(e){function t(e){t.__super__.constructor.call(this,e);}return r(t,e),t.prototype.document=function(e,t){var r,i,a,n,o;for(i=0,t=this.filterOptions(t),n="",a=(o=e.children).length;i<a;i++)r=o[i],n+=this.writeChildNode(r,t,0);return t.pretty&&n.slice(-t.newline.length)===t.newline&&(n=n.slice(0,-t.newline.length)),n;},t;}(t);}).call(e.exports);}),parcelRequire.register("iSJWK",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a,n,o,s,u,c,l,p,d,m,h,x,f,g={}.hasOwnProperty;f=parcelRequire("kVJuC").assign,t=parcelRequire("jlPhh"),c=parcelRequire("hkFgb"),l=parcelRequire("ci5Ld"),i=parcelRequire("hXN4g"),a=parcelRequire("dMHoW"),d=parcelRequire("fKfZt"),h=parcelRequire("1COsN"),x=parcelRequire("5uTV5"),m=parcelRequire("lAu2Z"),p=parcelRequire("9TZDR"),n=parcelRequire("hyYIz"),o=parcelRequire("e1Cf2"),s=parcelRequire("jDv5A"),u=parcelRequire("kowMM"),r=parcelRequire("cc1c1"),e.exports=function(){function e(e){var t,r,i;for(t in e||(e={}),this.options=e,r=e.writer||{})g.call(r,t)&&(i=r[t],this["_"+t]=this[t],this[t]=i);}return e.prototype.filterOptions=function(e){var t,i,a,n,o,s,u,c;return e||(e={}),e=f({},this.options,e),(t={writer:this}).pretty=e.pretty||!1,t.allowEmpty=e.allowEmpty||!1,t.indent=null!=(i=e.indent)?i:" ",t.newline=null!=(a=e.newline)?a:"\n",t.offset=null!=(n=e.offset)?n:0,t.dontPrettyTextNodes=null!=(o=null!=(s=e.dontPrettyTextNodes)?s:e.dontprettytextnodes)?o:0,t.spaceBeforeSlash=null!=(u=null!=(c=e.spaceBeforeSlash)?c:e.spacebeforeslash)?u:"",!0===t.spaceBeforeSlash&&(t.spaceBeforeSlash=" "),t.suppressPrettyCount=0,t.user={},t.state=r.None,t;},e.prototype.indent=function(e,t,r){var i;if(!t.pretty||t.suppressPrettyCount);else if(t.pretty&&(i=(r||0)+t.offset+1)>0)return Array(i).join(t.indent);return"";},e.prototype.endline=function(e,t,r){return!t.pretty||t.suppressPrettyCount?"":t.newline;},e.prototype.attribute=function(e,t,r){var i;return this.openAttribute(e,t,r),i=" "+e.name+'="'+e.value+'"',this.closeAttribute(e,t,r),i;},e.prototype.cdata=function(e,t,i){var a;return this.openNode(e,t,i),t.state=r.OpenTag,a=this.indent(e,t,i)+"<![CDATA[",t.state=r.InsideTag,a+=e.value,t.state=r.CloseTag,a+="]]>"+this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),a;},e.prototype.comment=function(e,t,i){var a;return this.openNode(e,t,i),t.state=r.OpenTag,a=this.indent(e,t,i)+"<!-- ",t.state=r.InsideTag,a+=e.value,t.state=r.CloseTag,a+=" -->"+this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),a;},e.prototype.declaration=function(e,t,i){var a;return this.openNode(e,t,i),t.state=r.OpenTag,a=this.indent(e,t,i)+"<?xml",t.state=r.InsideTag,a+=' version="'+e.version+'"',null!=e.encoding&&(a+=' encoding="'+e.encoding+'"'),null!=e.standalone&&(a+=' standalone="'+e.standalone+'"'),t.state=r.CloseTag,a+=t.spaceBeforeSlash+"?>"+this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),a;},e.prototype.docType=function(e,t,i){var a,n,o,s,u;if(i||(i=0),this.openNode(e,t,i),t.state=r.OpenTag,s=this.indent(e,t,i)+"<!DOCTYPE "+e.root().name,e.pubID&&e.sysID?s+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.sysID&&(s+=' SYSTEM "'+e.sysID+'"'),e.children.length>0){for(s+=" ["+this.endline(e,t,i),t.state=r.InsideTag,n=0,o=(u=e.children).length;n<o;n++)a=u[n],s+=this.writeChildNode(a,t,i+1);t.state=r.CloseTag,s+="]";}return t.state=r.CloseTag,s+=t.spaceBeforeSlash+">"+this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),s;},e.prototype.element=function(e,i,a){var n,o,s,u,c,l,p,d,m,h,x,f,D,y;for(m in a||(a=0),h=!1,x="",this.openNode(e,i,a),i.state=r.OpenTag,x+=this.indent(e,i,a)+"<"+e.name,f=e.attribs)g.call(f,m)&&(n=f[m],x+=this.attribute(n,i,a));if(u=0===(s=e.children.length)?null:e.children[0],0===s||e.children.every(function(e){return(e.type===t.Text||e.type===t.Raw)&&""===e.value;}))i.allowEmpty?(x+=">",i.state=r.CloseTag,x+="</"+e.name+">"+this.endline(e,i,a)):(i.state=r.CloseTag,x+=i.spaceBeforeSlash+"/>"+this.endline(e,i,a));else if(i.pretty&&1===s&&(u.type===t.Text||u.type===t.Raw)&&null!=u.value)x+=">",i.state=r.InsideTag,i.suppressPrettyCount++,h=!0,x+=this.writeChildNode(u,i,a+1),i.suppressPrettyCount--,h=!1,i.state=r.CloseTag,x+="</"+e.name+">"+this.endline(e,i,a);else{if(i.dontPrettyTextNodes){for(c=0,p=(D=e.children).length;c<p;c++)if(((o=D[c]).type===t.Text||o.type===t.Raw)&&null!=o.value){i.suppressPrettyCount++,h=!0;break;}}for(x+=">"+this.endline(e,i,a),i.state=r.InsideTag,l=0,d=(y=e.children).length;l<d;l++)o=y[l],x+=this.writeChildNode(o,i,a+1);i.state=r.CloseTag,x+=this.indent(e,i,a)+"</"+e.name+">",h&&i.suppre
|
|||
|
(function(){e.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3};}).call(e.exports);}),parcelRequire.register("evXP7",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a,n,o,s,u,c,l,p,d,m,h,x,f,g,D,y,b,v,C,E,A={}.hasOwnProperty;v=(E=parcelRequire("kVJuC")).isObject,b=E.isFunction,C=E.isPlainObject,y=E.getValue,t=parcelRequire("jlPhh"),d=parcelRequire("chPmK"),m=parcelRequire("fKfZt"),a=parcelRequire("hXN4g"),n=parcelRequire("dMHoW"),x=parcelRequire("1COsN"),D=parcelRequire("5uTV5"),h=parcelRequire("lAu2Z"),l=parcelRequire("hkFgb"),p=parcelRequire("ci5Ld"),o=parcelRequire("hyYIz"),u=parcelRequire("jDv5A"),s=parcelRequire("e1Cf2"),c=parcelRequire("kowMM"),i=parcelRequire("26xpk"),g=parcelRequire("jCuSG"),f=parcelRequire("5Jk7q"),r=parcelRequire("cc1c1"),e.exports=function(){function e(e,r,i){var a;this.name="?xml",this.type=t.Document,e||(e={}),a={},e.writer?C(e.writer)&&(a=e.writer,e.writer=new f()):e.writer=new f(),this.options=e,this.writer=e.writer,this.writerOptions=this.writer.filterOptions(a),this.stringify=new g(e),this.onDataCallback=r||function(){},this.onEndCallback=i||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null;}return e.prototype.createChildNode=function(e){var r,i,a,n,o,s,u,c;switch(e.type){case t.CData:this.cdata(e.value);break;case t.Comment:this.comment(e.value);break;case t.Element:for(i in a={},u=e.attribs)A.call(u,i)&&(r=u[i],a[i]=r.value);this.node(e.name,a);break;case t.Dummy:this.dummy();break;case t.Raw:this.raw(e.value);break;case t.Text:this.text(e.value);break;case t.ProcessingInstruction:this.instruction(e.target,e.value);break;default:throw Error("This XML node type is not supported in a JS object: "+e.constructor.name);}for(o=0,s=(c=e.children).length;o<s;o++)n=c[o],this.createChildNode(n),n.type===t.Element&&this.up();return this;},e.prototype.dummy=function(){return this;},e.prototype.node=function(e,t,r){var i;if(null==e)throw Error("Missing node name.");if(this.root&&-1===this.currentLevel)throw Error("Document can only have one root node. "+this.debugInfo(e));return this.openCurrent(),e=y(e),null==t&&(t={}),v(t=y(t))||(r=(i=[t,r])[0],t=i[1]),this.currentNode=new m(this,e,t),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,null!=r&&this.text(r),this;},e.prototype.element=function(e,r,i){var a,n,o,s,u,c;if(this.currentNode&&this.currentNode.type===t.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(e)||v(e)||b(e))for(s=this.options.noValidation,this.options.noValidation=!0,(c=new d(this.options).element("TEMP_ROOT")).element(e),this.options.noValidation=s,n=0,o=(u=c.children).length;n<o;n++)a=u[n],this.createChildNode(a),a.type===t.Element&&this.up();else this.node(e,r,i);return this;},e.prototype.attribute=function(e,t){var r,a;if(!this.currentNode||this.currentNode.children)throw Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(e));if(null!=e&&(e=y(e)),v(e))for(r in e)A.call(e,r)&&(a=e[r],this.attribute(r,a));else b(t)&&(t=t.apply()),this.options.keepNullAttributes&&null==t?this.currentNode.attribs[e]=new i(this,e,""):null!=t&&(this.currentNode.attribs[e]=new i(this,e,t));return this;},e.prototype.text=function(e){var t;return this.openCurrent(),t=new D(this,e),this.onData(this.writer.text(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this;},e.prototype.cdata=function(e){var t;return this.openCurrent(),t=new a(this,e),this.onData(this.writer.cdata(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this;},e.prototype.comment=function(e){var t;return this.openCurrent(),t=new n(this,e),this.onData(this.writer.comment(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this;},e.prototype.raw=function(e){var t;return this.openCurrent(),t=new x(this,e),this.onData(this.writer.raw(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this;},e.prototype.instruction=function(e,t){var r,i,a,n,o;if(this.openCurrent(),null!=e&&(e=y(e)),null!=t&&(t=y(t)),Array.isArray(e))for(r=0,n=e.length;r<n;r++)i=e[r],this.instruction(i);else if(v(e))for(i in e)A.call(e,i)&&(a=e[i],this.instruction(i,a)
|
|||
|
(function(){var t,r,i,a=function(e,t){for(var r in t)n.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},n={}.hasOwnProperty;t=parcelRequire("jlPhh"),i=parcelRequire("iSJWK"),r=parcelRequire("cc1c1"),e.exports=function(e){function i(e,t){this.stream=e,i.__super__.constructor.call(this,t);}return a(i,e),i.prototype.endline=function(e,t,a){return e.isLastRootNode&&t.state===r.CloseTag?"":i.__super__.endline.call(this,e,t,a);},i.prototype.document=function(e,t){var r,i,a,n,o,s,u,c,l;for(u=e.children,i=a=0,o=u.length;a<o;i=++a)(r=u[i]).isLastRootNode=i===e.children.length-1;for(n=0,t=this.filterOptions(t),c=e.children,l=[],s=c.length;n<s;n++)r=c[n],l.push(this.writeChildNode(r,t,0));return l;},i.prototype.attribute=function(e,t,r){return this.stream.write(i.__super__.attribute.call(this,e,t,r));},i.prototype.cdata=function(e,t,r){return this.stream.write(i.__super__.cdata.call(this,e,t,r));},i.prototype.comment=function(e,t,r){return this.stream.write(i.__super__.comment.call(this,e,t,r));},i.prototype.declaration=function(e,t,r){return this.stream.write(i.__super__.declaration.call(this,e,t,r));},i.prototype.docType=function(e,t,i){var a,n,o,s;if(i||(i=0),this.openNode(e,t,i),t.state=r.OpenTag,this.stream.write(this.indent(e,t,i)),this.stream.write("<!DOCTYPE "+e.root().name),e.pubID&&e.sysID?this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'):e.sysID&&this.stream.write(' SYSTEM "'+e.sysID+'"'),e.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(e,t,i)),t.state=r.InsideTag,n=0,o=(s=e.children).length;n<o;n++)a=s[n],this.writeChildNode(a,t,i+1);t.state=r.CloseTag,this.stream.write("]");}return t.state=r.CloseTag,this.stream.write(t.spaceBeforeSlash+">"),this.stream.write(this.endline(e,t,i)),t.state=r.None,this.closeNode(e,t,i);},i.prototype.element=function(e,i,a){var o,s,u,c,l,p,d,m,h;for(d in a||(a=0),this.openNode(e,i,a),i.state=r.OpenTag,this.stream.write(this.indent(e,i,a)+"<"+e.name),m=e.attribs)n.call(m,d)&&(o=m[d],this.attribute(o,i,a));if(c=0===(u=e.children.length)?null:e.children[0],0===u||e.children.every(function(e){return(e.type===t.Text||e.type===t.Raw)&&""===e.value;}))i.allowEmpty?(this.stream.write(">"),i.state=r.CloseTag,this.stream.write("</"+e.name+">")):(i.state=r.CloseTag,this.stream.write(i.spaceBeforeSlash+"/>"));else if(i.pretty&&1===u&&(c.type===t.Text||c.type===t.Raw)&&null!=c.value)this.stream.write(">"),i.state=r.InsideTag,i.suppressPrettyCount++,this.writeChildNode(c,i,a+1),i.suppressPrettyCount--,i.state=r.CloseTag,this.stream.write("</"+e.name+">");else{for(this.stream.write(">"+this.endline(e,i,a)),i.state=r.InsideTag,l=0,p=(h=e.children).length;l<p;l++)s=h[l],this.writeChildNode(s,i,a+1);i.state=r.CloseTag,this.stream.write(this.indent(e,i,a)+"</"+e.name+">");}return this.stream.write(this.endline(e,i,a)),i.state=r.None,this.closeNode(e,i,a);},i.prototype.processingInstruction=function(e,t,r){return this.stream.write(i.__super__.processingInstruction.call(this,e,t,r));},i.prototype.raw=function(e,t,r){return this.stream.write(i.__super__.raw.call(this,e,t,r));},i.prototype.text=function(e,t,r){return this.stream.write(i.__super__.text.call(this,e,t,r));},i.prototype.dtdAttList=function(e,t,r){return this.stream.write(i.__super__.dtdAttList.call(this,e,t,r));},i.prototype.dtdElement=function(e,t,r){return this.stream.write(i.__super__.dtdElement.call(this,e,t,r));},i.prototype.dtdEntity=function(e,t,r){return this.stream.write(i.__super__.dtdEntity.call(this,e,t,r));},i.prototype.dtdNotation=function(e,t,r){return this.stream.write(i.__super__.dtdNotation.call(this,e,t,r));},i;}(i);}).call(e.exports);}),parcelRequire.register("7JuJD",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t,r,i,a,n,o,s,u,c=function(e,t){return function(){return e.apply(t,arguments);};},l=function(e,t){for(var r in t)p.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e;}return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},p={}.hasOwnProperty;s=parcelRequire("e4c2j"),i=$k14yv$events,t=parcelRequire("cUdNd"),o=parcelRequire("jyooR"),u=$k14yv$timers.setImmediate,r=parcelRequire("AfX4q").defaults,a=function(e){return"object"==typeof e&&null!=e&&0===Object.keys(e).length;},n=function(e,t,r){var i,a;for(i=0,a=e.length;i<a;i++)t=(0,e[i])(t,r);return t;},e.exports.Parser=function(i){function d(t){var i,a,n;if(this.parseStringPromise=c(this.parseStringPromise,this),this.parseString=c(this.parseString,this),this.reset=c(this.reset,this),this.assignOrPush=c(this.assignOrPush,this),this.processAsync=c(this.processAsync,this),!(this instanceof e.exports.Parser))return new e.exports.Parser(t);for(i in this.options={},a=r["0.2"])p.call(a,i)&&(n=a[i],this.options[i]=n);for(i in t)p.call(t,i)&&(n=t[i],this.options[i]=n);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(o.normalize)),this.reset();}return l(d,i),d.prototype.processAsync=function(){var e,t;try{if(this.remaining.length<=this.options.chunkSize)return e=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(e),this.saxParser.close();return e=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(e),u(this.processAsync);}catch(e){if(t=e,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(t);}},d.prototype.assignOrPush=function(e,t,r){return t in e?(e[t]instanceof Array||(e[t]=[e[t]]),e[t].push(r)):this.options.explicitArray?e[t]=[r]:e[t]=r;},d.prototype.reset=function(){var e,t,r,i;return this.removeAllListeners(),this.saxParser=s.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(e){return function(t){if(e.saxParser.resume(),!e.saxParser.errThrown)return e.saxParser.errThrown=!0,e.emit("error",t);};}(this),this.saxParser.onend=function(e){return function(){if(!e.saxParser.ended)return e.saxParser.ended=!0,e.emit("end",e.resultObject);};}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,i=[],e=this.options.attrkey,t=this.options.charkey,this.saxParser.onopentag=function(r){return function(a){var o,s,u,c,l;if((u=Object.create(null))[t]="",!r.options.ignoreAttrs)for(o in l=a.attributes)p.call(l,o)&&(e in u||r.options.mergeAttrs||(u[e]=Object.create(null)),s=r.options.attrValueProcessors?n(r.options.attrValueProcessors,a.attributes[o],o):a.attributes[o],c=r.options.attrNameProcessors?n(r.options.attrNameProcessors,o):o,r.options.mergeAttrs?r.assignOrPush(u,c,s):u[e][c]=s);return u["#name"]=r.options.tagNameProcessors?n(r.options.tagNameProcessors,a.name):a.name,r.options.xmlns&&(u[r.options.xmlnskey]={uri:a.uri,local:a.local}),i.push(u);};}(this),this.saxParser.onclosetag=function(e){return function(){var r,o,s,u,c,l,d,m,h,x;if(c=(l=i.pop())["#name"],e.options.explicitChildren&&e.options.preserveChildrenOrder||delete l["#name"],!0===l.cdata&&(r=l.cdata,delete l.cdata),h=i[i.length-1],l[t].match(/^\s*$/)&&!r?(o=l[t],delete l[t]):(e.options.trim&&(l[t]=l[t].trim()),e.options.normalize&&(l[t]=l[t].replace(/\s{2,}/g," ").trim()),l[t]=e.options.valueProcessors?n(e.options.valueProcessors,l[t],c):l[t],1===Object.keys(l).length&&t in l&&!e.EXPLICIT_CHARKEY&&(l=l[t])),a(l)&&(l="function"==typeof e.options.emptyTag?e.options.emptyTag():""!==e.options.emptyTag?e.options.emptyTag:o),null!=e.options.validator&&(x="/"+function(){var e,t,r;for(e=0,r=[],t=i.length;e<t;e++)u=i[e],r.push(u["#name"]);return r;}().concat(c).join("/"),function(){var t;try{l=e.options.validator(x,h&&h[c],l);}catch(r){return t=r,e.emit("error
|
|||
|
// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
|
|||
|
// since that's the earliest that a buffer overrun could occur. This way, checks are
|
|||
|
// as rare as required, but as often as necessary to ensure never crossing this bound.
|
|||
|
// Furthermore, buffers are only tested at most once per write(), so passing a very
|
|||
|
// large string into write() might have undesirable effects, but this is manageable by
|
|||
|
// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
|
|||
|
// edge case, result in creating at most one complete copy of the string passed in.
|
|||
|
// Set to Infinity to have unlimited buffers.
|
|||
|
e.MAX_BUFFER_LENGTH=65536;var t,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function i(t,r){if(!(this instanceof i))return new i(t,r);var a=this;n(a),a.q=a.c="",a.bufferCheckPosition=e.MAX_BUFFER_LENGTH,a.opt=r||{},a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags,a.looseCase=a.opt.lowercase?"toLowerCase":"toUpperCase",a.tags=[],a.closed=a.closedRoot=a.sawRoot=!1,a.tag=a.error=null,a.strict=!!t,a.noscript=!!(t||a.opt.noscript),a.state=A.BEGIN,a.strictEntities=a.opt.strictEntities,a.ENTITIES=a.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),a.attribList=[],a.opt.xmlns&&(a.ns=Object.create(h)),// mostly just for error reporting
|
|||
|
a.trackPosition=!1!==a.opt.position,a.trackPosition&&(a.position=a.line=a.column=0),B(a,"onready");}function a(t){for(var i=Math.max(e.MAX_BUFFER_LENGTH,10),a=0,n=0,o=r.length;n<o;n++){var s=t[r[n]].length;if(s>i)// we can get here under normal conditions.
|
|||
|
// Avoid issues by emitting the text node now,
|
|||
|
// so at least it won't get any bigger.
|
|||
|
switch(r[n]){case"textNode":F(t);break;case"cdata":N(t,"oncdata",t.cdata),t.cdata="";break;case"script":N(t,"onscript",t.script),t.script="";break;default:P(t,"Max buffer length exceeded: "+r[n]);}a=Math.max(a,s);}var u=e.MAX_BUFFER_LENGTH-a;t.bufferCheckPosition=u+t.position;}function n(e){for(var t=0,i=r.length;t<i;t++)e[r[t]]="";}function o(e){F(e),""!==e.cdata&&(N(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(N(e,"onscript",e.script),e.script="");}e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t();}),Object.keys||(Object.keys=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t;}),i.prototype={end:function(){T(this);},write:H,resume:function(){return this.error=null,this;},close:function(){return this.write(null);},flush:function(){o(this);}};try{t=$a3dac6931405aaba$import$a76f70335a4bd6d1$6a4eb2e7fc9e8903;}catch(e){t=function(){};}var s=e.EVENTS.filter(function(e){return"error"!==e&&"end"!==e;});function u(e,t){return new c(e,t);}function c(e,r){if(!(this instanceof c))return new c(e,r);t.apply(this),this._parser=new i(e,r),this.writable=!0,this.readable=!0;var a=this;this._parser.onend=function(){a.emit("end");},this._parser.onerror=function(e){a.emit("error",e),// if didn't throw, then means error was handled.
|
|||
|
// go ahead and clear error, so we can write again.
|
|||
|
a._parser.error=null;},this._decoder=null,s.forEach(function(e){Object.defineProperty(a,"on"+e,{get:function(){return a._parser["on"+e];},set:function(t){if(!t)return a.removeAllListeners(e),a._parser["on"+e]=t,t;a.on(e,t);},enumerable:!0,configurable:!1});});}c.prototype=Object.create(t.prototype,{constructor:{value:c}}),c.prototype.write=function(e){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)){if(!this._decoder){var t=$k14yv$string_decoder.StringDecoder;this._decoder=new t("utf8");}e=this._decoder.write(e);}return this._parser.write(e.toString()),this.emit("data",e),!0;},c.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0;},c.prototype.on=function(e,r){var i=this;return i._parser["on"+e]||-1===s.indexOf(e)||(i._parser["on"+e]=function(){var t=1==arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),i.emit.apply(i,t);}),t.prototype.on.call(i,e,r);};// this really needs to be replaced with character classes.
|
|||
|
// XML allows all manner of ridiculous numbers and digits.
|
|||
|
var l="[CDATA[",p="DOCTYPE",d="http://www.w3.org/XML/1998/namespace",m="http://www.w3.org/2000/xmlns/",h={xml:d,xmlns:m},x=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,g=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,D=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function y(e){return" "===e||"\n"===e||"\r"===e||" "===e;}function b(e){return'"'===e||"'"===e;}function v(e){return">"===e||y(e);}function C(e,t){return e.test(t);}function E(e,t){return!C(e,t);}var A=0;for(var S in e.STATE={BEGIN:A++,BEGIN_WHITESPACE:A++,TEXT:A++,TEXT_ENTITY:A++,OPEN_WAKA:A++,SGML_DECL:A++,SGML_DECL_QUOTED:A++,DOCTYPE:A++,DOCTYPE_QUOTED:A++,DOCTYPE_DTD:A++,DOCTYPE_DTD_QUOTED:A++,COMMENT_STARTING:A++,COMMENT:A++,COMMENT_ENDING:A++,COMMENT_ENDED:A++,CDATA:A++,CDATA_ENDING:A++,CDATA_ENDING_2:A++,PROC_INST:A++,PROC_INST_BODY:A++,PROC_INST_ENDING:A++,OPEN_TAG:A++,OPEN_TAG_SLASH:A++,ATTRIB:A++,ATTRIB_NAME:A++,ATTRIB_NAME_SAW_WHITE:A++,ATTRIB_VALUE:A++,ATTRIB_VALUE_QUOTED:A++,ATTRIB_VALUE_CLOSED:A++,ATTRIB_VALUE_UNQUOTED:A++,ATTRIB_VALUE_ENTITY_Q:A++,ATTRIB_VALUE_ENTITY_U:A++,CLOSE_TAG:A++,CLOSE_TAG_SAW_WHITE:A++,SCRIPT:A++,SCRIPT_ENDING:A++// <script> ... <
|
|||
|
},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(t){var r=e.ENTITIES[t],i="number"==typeof r?String.fromCharCode(r):r;e.ENTITIES[t]=i;}),e.STATE)e.STATE[e.STATE[S]]=S;function B(e,t,r){e[t]&&e[t](r);}function N(e,t,r){e.textNode&&F(e),B(e,t,r);}function F(e){e.textNode=w(e.opt,e.textNode),e.textNode&&B(e,"ontext",e.textNode),e.textNode="";}function w(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t;}function P(e,t){return F(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=Error(t),e.error=t,B(e,"onerror",t),e;}function T(e){return e.sawRoot&&!e.closedRoot&&O(e,"Unclosed root tag"),e.state!==A.BEGIN&&e.state!==A.BEGIN_WHITESPACE&&e.state!==A.TEXT&&P(e,"Unexpected end"),F(e),e.c="",e.closed=!0,B(e,"onend"),i.call(e,e.strict,e.opt),e;}function O(e,t){if("object"!=typeof e||!(e instanceof i))throw Error("bad call to strictFail");e.strict&&P(e,t);}function R(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,r=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(r.ns=t.ns),e.attribList.length=0,N(e,"onopentagstart",r);}function I(e,t){var r=0>e.indexOf(":")?["",e]:e.split(":"),i=r[0],a=r[1];return t&&"xmlns"===e&&(i="xmlns",a=""),{prefix:i,local:a};}function z(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName)){e.attribName=e.attribValue="";return;}if(e.opt.xmlns){var t=I(e.attribName,!0),r=t.prefix,i=t.loc
|
|||
|
if("xml"===i&&e.attribValue!==d)O(e,"xml: prefix must be bound to "+d+"\nActual: "+e.attribValue);else if("xmlns"===i&&e.attribValue!==m)O(e,"xmlns: prefix must be bound to "+m+"\nActual: "+e.attribValue);else{var a=e.tag,n=e.tags[e.tags.length-1]||e;a.ns===n.ns&&(a.ns=Object.create(n.ns)),a.ns[i]=e.attribValue;}}// defer onattribute events until all attributes have been seen
|
|||
|
// so any new bindings can take effect. preserve attribute order
|
|||
|
// so deferred events can be emitted in document order
|
|||
|
e.attribList.push([e.attribName,e.attribValue]);}else// in non-xmlns mode, we can emit the event right away
|
|||
|
e.tag.attributes[e.attribName]=e.attribValue,N(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue="";}function k(e,t){if(e.opt.xmlns){// emit namespace binding events
|
|||
|
var r=e.tag,i=I(e.tagName);r.prefix=i.prefix,r.local=i.local,r.uri=r.ns[i.prefix]||"",r.prefix&&!r.uri&&(O(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),r.uri=i.prefix);var a=e.tags[e.tags.length-1]||e;r.ns&&a.ns!==r.ns&&Object.keys(r.ns).forEach(function(t){N(e,"onopennamespace",{prefix:t,uri:r.ns[t]});});// handle deferred onattribute events
|
|||
|
// Note: do not apply default ns to attributes:
|
|||
|
// http://www.w3.org/TR/REC-xml-names/#defaulting
|
|||
|
for(var n=0,o=e.attribList.length;n<o;n++){var s=e.attribList[n],u=s[0],c=s[1],l=I(u,!0),p=l.prefix,d=l.local,m=""===p?"":r.ns[p]||"",h={name:u,value:c,prefix:p,local:d,uri:m};p&&"xmlns"!==p&&!m&&(O(e,"Unbound namespace prefix: "+JSON.stringify(p)),h.uri=p),e.tag.attributes[u]=h,N(e,"onattribute",h);}e.attribList.length=0;}e.tag.isSelfClosing=!!t,// process the tag
|
|||
|
e.sawRoot=!0,e.tags.push(e.tag),N(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=A.TEXT:e.state=A.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0;}function M(e){if(!e.tagName){O(e,"Weird empty close tag."),e.textNode+="</>",e.state=A.TEXT;return;}if(e.script){if("script"!==e.tagName){e.script+="</"+e.tagName+">",e.tagName="",e.state=A.SCRIPT;return;}N(e,"onscript",e.script),e.script="";}// first make sure that the closing tag actually exists.
|
|||
|
// <a><b></c></b></a> will close everything, otherwise.
|
|||
|
var t=e.tags.length,r=e.tagName;e.strict||(r=r[e.looseCase]());for(var i=r;t--;)if(e.tags[t].name!==i)O(e,"Unexpected close tag");else break;// didn't find it. we already failed for strict, so just abort.
|
|||
|
if(t<0){O(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",e.state=A.TEXT;return;}e.tagName=r;for(var a=e.tags.length;a-->t;){var n=e.tag=e.tags.pop();e.tagName=e.tag.name,N(e,"onclosetag",e.tagName);var o={};for(var s in n.ns)o[s]=n.ns[s];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&n.ns!==u.ns&&Object.keys(n.ns).forEach(function(t){var r=n.ns[t];N(e,"onclosenamespace",{prefix:t,uri:r});});}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=A.TEXT;}function q(e){var t,r=e.entity,i=r.toLowerCase(),a="";return e.ENTITIES[r]?e.ENTITIES[r]:e.ENTITIES[i]?e.ENTITIES[i]:("#"===(r=i).charAt(0)&&(a="x"===r.charAt(1)?(t=parseInt(r=r.slice(2),16)).toString(16):(t=parseInt(r=r.slice(1),10)).toString(10)),r=r.replace(/^0+/,""),isNaN(t)||a.toLowerCase()!==r)?(O(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t);}function L(e,t){"<"===t?(e.state=A.OPEN_WAKA,e.startTagPosition=e.position):y(t)||(// have to process this as a text node.
|
|||
|
// weird, but happens.
|
|||
|
O(e,"Non-whitespace before first tag."),e.textNode=t,e.state=A.TEXT);}function j(e,t){var r="";return t<e.length&&(r=e.charAt(t)),r;}function H(e){var t=this;if(this.error)throw this.error;if(t.closed)return P(t,"Cannot write after close. Assign an onready handler.");if(null===e)return T(t);"object"==typeof e&&(e=e.toString());for(var r=0,i="";i=j(e,r++),t.c=i,i;)switch(t.trackPosition&&(t.position++,"\n"===i?(t.line++,t.column=0):t.column++),t.state){case A.BEGIN:if(t.state=A.BEGIN_WHITESPACE,"\uFEFF"===i)continue;L(t,i);continue;case A.BEGIN_WHITESPACE:L(t,i);continue;case A.TEXT:if(t.sawRoot&&!t.closedRoot){for(var n,o,s=r-1;i&&"<"!==i&&"&"!==i;)(i=j(e,r++))&&t.trackPosition&&(t.position++,"\n"===i?(t.line++,t.column=0):t.column++);t.textNode+=e.substring(s,r-1);}"<"!==i||t.sawRoot&&t.closedRoot&&!t.strict?(y(i)||t.sawRoot&&!t.closedRoot||O(t,"Text data outside of root node."),"&"===i?t.state=A.TEXT_ENTITY:t.textNode+=i):(t.state=A.OPEN_WAKA,t.startTagPosition=t.position);continue;case A.SCRIPT:"<"===i?t.state=A.SCRIPT_ENDING:t.script+=i;continue;case A.SCRIPT_ENDING:"/"===i?t.state=A.CLOSE_TAG:(t.script+="<"+i,t.state=A.SCRIPT);continue;case A.OPEN_WAKA:"!"===i?(t.state=A.SGML_DECL,t.sgmlDecl=""):y(i)||(C(x,i)?(t.state=A.OPEN_TAG,t.tagName=i):"/"===i?(t.state=A.CLOSE_TAG,t.tagName=""):"?"===i?(t.state=A.PROC_INST,t.procInstName=t.procInstBody=""):(O(t,"Unencoded <"),t.startTagPosition+1<t.position&&(i=Array(t.position-t.startTagPosition).join(" ")+i),t.textNode+="<"+i,t.state=A.TEXT));continue;case A.SGML_DECL:(t.sgmlDecl+i).toUpperCase()===l?(N(t,"onopencdata"),t.state=A.CDATA,t.sgmlDecl="",t.cdata=""):t.sgmlDecl+i==="--"?(t.state=A.COMMENT,t.comment="",t.sgmlDecl=""):(t.sgmlDecl+i).toUpperCase()===p?(t.state=A.DOCTYPE,(t.doctype||t.sawRoot)&&O(t,"Inappropriately located doctype declaration"),t.doctype="",t.sgmlDecl=""):">"===i?(N(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=A.TEXT):(b(i)&&(t.state=A.SGML_DECL_QUOTED),t.sgmlDecl+=i);continue;case A.SGML_DECL_QUOTED:i===t.q&&(t.state=A.SGML_DECL,t.q=""),t.sgmlDecl+=i;continue;case A.DOCTYPE:">"===i?(t.state=A.TEXT,N(t,"ondoctype",t.doctype),t.doctype=!0// just remember that we saw it.
|
|||
|
):(t.doctype+=i,"["===i?t.state=A.DOCTYPE_DTD:b(i)&&(t.state=A.DOCTYPE_QUOTED,t.q=i));continue;case A.DOCTYPE_QUOTED:t.doctype+=i,i===t.q&&(t.q="",t.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:t.doctype+=i,"]"===i?t.state=A.DOCTYPE:b(i)&&(t.state=A.DOCTYPE_DTD_QUOTED,t.q=i);continue;case A.DOCTYPE_DTD_QUOTED:t.doctype+=i,i===t.q&&(t.state=A.DOCTYPE_DTD,t.q="");continue;case A.COMMENT:"-"===i?t.state=A.COMMENT_ENDING:t.comment+=i;continue;case A.COMMENT_ENDING:"-"===i?(t.state=A.COMMENT_ENDED,t.comment=w(t.opt,t.comment),t.comment&&N(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+i,t.state=A.COMMENT);continue;case A.COMMENT_ENDED:">"!==i?(O(t,"Malformed comment"),// allow <!-- blah -- bloo --> in non-strict mode,
|
|||
|
// which is a comment of " blah -- bloo "
|
|||
|
t.comment+="--"+i,t.state=A.COMMENT):t.state=A.TEXT;continue;case A.CDATA:"]"===i?t.state=A.CDATA_ENDING:t.cdata+=i;continue;case A.CDATA_ENDING:"]"===i?t.state=A.CDATA_ENDING_2:(t.cdata+="]"+i,t.state=A.CDATA);continue;case A.CDATA_ENDING_2:">"===i?(t.cdata&&N(t,"oncdata",t.cdata),N(t,"onclosecdata"),t.cdata="",t.state=A.TEXT):"]"===i?t.cdata+="]":(t.cdata+="]]"+i,t.state=A.CDATA);continue;case A.PROC_INST:"?"===i?t.state=A.PROC_INST_ENDING:y(i)?t.state=A.PROC_INST_BODY:t.procInstName+=i;continue;case A.PROC_INST_BODY:!t.procInstBody&&y(i)||("?"===i?t.state=A.PROC_INST_ENDING:t.procInstBody+=i);continue;case A.PROC_INST_ENDING:">"===i?(N(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=A.TEXT):(t.procInstBody+="?"+i,t.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:C(f,i)?t.tagName+=i:(R(t),">"===i?k(t):"/"===i?t.state=A.OPEN_TAG_SLASH:(y(i)||O(t,"Invalid character in tag name"),t.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:">"===i?(k(t,!0),M(t)):(O(t,"Forward-slash in opening tag not followed by >"),t.state=A.ATTRIB);continue;case A.ATTRIB:y(i)||(">"===i?k(t):"/"===i?t.state=A.OPEN_TAG_SLASH:C(x,i)?(t.attribName=i,t.attribValue="",t.state=A.ATTRIB_NAME):O(t,"Invalid attribute name"));continue;case A.ATTRIB_NAME:"="===i?t.state=A.ATTRIB_VALUE:">"===i?(O(t,"Attribute without value"),t.attribValue=t.attribName,z(t),k(t)):y(i)?t.state=A.ATTRIB_NAME_SAW_WHITE:C(f,i)?t.attribName+=i:O(t,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if("="===i)t.state=A.ATTRIB_VALUE;else{if(y(i))continue;O(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",N(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===i?k(t):C(x,i)?(t.attribName=i,t.state=A.ATTRIB_NAME):(O(t,"Invalid attribute name"),t.state=A.ATTRIB);}continue;case A.ATTRIB_VALUE:y(i)||(b(i)?(t.q=i,t.state=A.ATTRIB_VALUE_QUOTED):(O(t,"Unquoted attribute value"),t.state=A.ATTRIB_VALUE_UNQUOTED,t.attribValue=i));continue;case A.ATTRIB_VALUE_QUOTED:if(i!==t.q){"&"===i?t.state=A.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=i;continue;}z(t),t.q="",t.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:y(i)?t.state=A.ATTRIB:">"===i?k(t):"/"===i?t.state=A.OPEN_TAG_SLASH:C(x,i)?(O(t,"No whitespace between attributes"),t.attribName=i,t.attribValue="",t.state=A.ATTRIB_NAME):O(t,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!v(i)){"&"===i?t.state=A.ATTRIB_VALUE_ENTITY_U:t.attribValue+=i;continue;}z(t),">"===i?k(t):t.state=A.ATTRIB;continue;case A.CLOSE_TAG:t.tagName?">"===i?M(t):C(f,i)?t.tagName+=i:t.script?(t.script+="</"+t.tagName,t.tagName="",t.state=A.SCRIPT):(y(i)||O(t,"Invalid tagname in closing tag"),t.state=A.CLOSE_TAG_SAW_WHITE):y(i)||(E(x,i)?t.script?(t.script+="</"+i,t.state=A.SCRIPT):O(t,"Invalid tagname in closing tag."):t.tagName=i);continue;case A.CLOSE_TAG_SAW_WHITE:if(y(i))continue;">"===i?M(t):O(t,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:switch(t.state){case A.TEXT_ENTITY:n=A.TEXT,o="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:n=A.ATTRIB_VALUE_QUOTED,o="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:n=A.ATTRIB_VALUE_UNQUOTED,o="attribValue";}";"===i?(t[o]+=q(t),t.entity="",t.state=n):C(t.entity.length?D:g,i)?t.entity+=i:(O(t,"Invalid character in entity name"),t[o]+="&"+t.entity+i,t.entity="",t.state=n);continue;default:throw Error(t,"Unknown state: "+t.state);}// while
|
|||
|
return t.position>=t.bufferCheckPosition&&a(t),t;}// shorthand
|
|||
|
A=e.STATE,String.fromCodePoint||function(){var e=String.fromCharCode,t=Math.floor,r=function(){var r,i,a=16384,n=[],o=-1,s=arguments.length;if(!s)return"";for(var u="";++o<s;){var c=Number(arguments[o]);if(!isFinite(c)||// `NaN`, `+Infinity`, or `-Infinity`
|
|||
|
c<0||// not a valid Unicode code point
|
|||
|
c>1114111||// not a valid Unicode code point
|
|||
|
t(c)!==c// not an integer
|
|||
|
)throw RangeError("Invalid code point: "+c);c<=65535?n.push(c):(// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
|||
|
c-=65536,r=(c>>10)+55296,i=c%1024+56320,n.push(r,i)),(o+1===s||n.length>a)&&(u+=e.apply(null,n),n.length=0);}return u;};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:r,configurable:!0,writable:!0}):String.fromCodePoint=r;}();}(e.exports);}),parcelRequire.register("cUdNd",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){e.exports.stripBOM=function(e){return"\uFEFF"===e[0]?e.substring(1):e;};}).call(e.exports);}),parcelRequire.register("jyooR",function(e,t){// Generated by CoffeeScript 1.12.7
|
|||
|
(function(){var t;t=new RegExp(/(?!xmlns)^.*:/),e.exports.normalize=function(e){return e.toLowerCase();},e.exports.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1);},e.exports.stripPrefix=function(e){return e.replace(t,"");},e.exports.parseNumbers=function(e){return isNaN(e)||(e=e%1==0?parseInt(e,10):parseFloat(e)),e;},e.exports.parseBooleans=function(e){return /^(?:true|false)$/i.test(e)&&(e="true"===e.toLowerCase()),e;};}).call(e.exports);}),parcelRequire.register("fIS4N",function(e,t){$parcel$export(e.exports,"logPolicy",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8"),i=parcelRequire("huRpD"),a=parcelRequire("aQvX1");function n(e={}){return{create:(t,r)=>new o(t,r,e)};}class o extends r.BaseRequestPolicy{constructor(e,t,{logger:r=a.logger.info,allowedHeaderNames:n=[],allowedQueryParameters:o=[]}={}){super(e,t),this.logger=r,this.sanitizer=new i.Sanitizer({allowedHeaderNames:n,allowedQueryParameters:o});}/**
|
|||
|
* Header names whose values will be logged when logging is enabled. Defaults to
|
|||
|
* Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers
|
|||
|
* specified in this field will be added to that list. Any other values will
|
|||
|
* be written to logs as "REDACTED".
|
|||
|
* @deprecated Pass these into the constructor instead.
|
|||
|
*/get allowedHeaderNames(){return this.sanitizer.allowedHeaderNames;}/**
|
|||
|
* Header names whose values will be logged when logging is enabled. Defaults to
|
|||
|
* Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers
|
|||
|
* specified in this field will be added to that list. Any other values will
|
|||
|
* be written to logs as "REDACTED".
|
|||
|
* @deprecated Pass these into the constructor instead.
|
|||
|
*/set allowedHeaderNames(e){this.sanitizer.allowedHeaderNames=e;}/**
|
|||
|
* Query string names whose values will be logged when logging is enabled. By default no
|
|||
|
* query string values are logged.
|
|||
|
* @deprecated Pass these into the constructor instead.
|
|||
|
*/get allowedQueryParameters(){return this.sanitizer.allowedQueryParameters;}/**
|
|||
|
* Query string names whose values will be logged when logging is enabled. By default no
|
|||
|
* query string values are logged.
|
|||
|
* @deprecated Pass these into the constructor instead.
|
|||
|
*/set allowedQueryParameters(e){this.sanitizer.allowedQueryParameters=e;}sendRequest(e){return this.logger.enabled?(this.logRequest(e),this._nextPolicy.sendRequest(e).then(e=>this.logResponse(e))):this._nextPolicy.sendRequest(e);}logRequest(e){this.logger(`Request: ${this.sanitizer.sanitize(e)}`);}logResponse(e){return this.logger(`Response status code: ${e.status}`),this.logger(`Headers: ${this.sanitizer.sanitize(e.headers)}`),e;}}}),parcelRequire.register("7estx",function(e,t){$parcel$export(e.exports,"disableResponseDecompressionPolicy",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8");function i(){return{create:(e,t)=>new a(e,t)};}class a extends r.BaseRequestPolicy{/**
|
|||
|
* Creates an instance of DisableResponseDecompressionPolicy.
|
|||
|
*
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
*/ // The parent constructor is protected.
|
|||
|
/* eslint-disable-next-line @typescript-eslint/no-useless-constructor */constructor(e,t){super(e,t);}/**
|
|||
|
* Sends out request.
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
* @returns
|
|||
|
*/async sendRequest(e){return e.decompressResponse=!1,this._nextPolicy.sendRequest(e);}}}),parcelRequire.register("kx2Q5",function(e,t){$parcel$export(e.exports,"logger",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("dcIHy");let i=(0,r.createClientLogger)("storage-blob");}),parcelRequire.register("6tWZN",function(e,t){$parcel$export(e.exports,"StorageBrowserPolicyFactory",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("14UBe");class i{/**
|
|||
|
* Creates a StorageBrowserPolicyFactory object.
|
|||
|
*
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
*/create(e,t){return new r.StorageBrowserPolicy(e,t);}}}),parcelRequire.register("14UBe",function(e,t){$parcel$export(e.exports,"StorageBrowserPolicy",()=>o);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("lrZDM"),i=parcelRequire("42Oo8"),a=parcelRequire("5MFjo"),n=parcelRequire("e7JkV");class o extends i.BaseRequestPolicy{/**
|
|||
|
* Creates an instance of StorageBrowserPolicy.
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
*/ // The base class has a protected constructor. Adding a public one to enable constructing of this class.
|
|||
|
/* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/constructor(e,t){super(e,t);}/**
|
|||
|
* Sends out request.
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
*/async sendRequest(e){return r.isNode||(("GET"===e.method.toUpperCase()||"HEAD"===e.method.toUpperCase())&&(e.url=(0,n.setURLParameter)(e.url,a.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE,new Date().getTime().toString())),e.headers.remove(a.HeaderConstants.COOKIE),// According to XHR standards, content-length should be fully controlled by browsers
|
|||
|
e.headers.remove(a.HeaderConstants.CONTENT_LENGTH)),this._nextPolicy.sendRequest(e);}}}),parcelRequire.register("eZ981",function(e,t){$parcel$export(e.exports,"StorageRetryPolicyFactory",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("3khs0");class i{/**
|
|||
|
* Creates an instance of StorageRetryPolicyFactory.
|
|||
|
* @param retryOptions -
|
|||
|
*/constructor(e){this.retryOptions=e;}/**
|
|||
|
* Creates a StorageRetryPolicy object.
|
|||
|
*
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
*/create(e,t){return new r.StorageRetryPolicy(e,t,this.retryOptions);}}}),parcelRequire.register("3khs0",function(e,t){$parcel$export(e.exports,"StorageRetryPolicy",()=>l);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r,i=parcelRequire("708hs"),a=parcelRequire("42Oo8"),n=parcelRequire("5MFjo"),o=parcelRequire("e7JkV"),s=parcelRequire("kx2Q5");!function(e){/**
|
|||
|
* Exponential retry. Retry time delay grows exponentially.
|
|||
|
*/e[e.EXPONENTIAL=0]="EXPONENTIAL",/**
|
|||
|
* Linear retry. Retry time delay grows linearly.
|
|||
|
*/e[e.FIXED=1]="FIXED";}(r||(r={}));// Default values of StorageRetryOptions
|
|||
|
let u={maxRetryDelayInMs:12e4,maxTries:4,retryDelayInMs:4e3,retryPolicyType:r.EXPONENTIAL,secondaryHost:"",tryTimeoutInMs:void 0},c=new i.AbortError("The operation was aborted.");class l extends a.BaseRequestPolicy{/**
|
|||
|
* Creates an instance of RetryPolicy.
|
|||
|
*
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
* @param retryOptions -
|
|||
|
*/constructor(e,t,r=u){super(e,t),// Initialize retry options
|
|||
|
this.retryOptions={retryPolicyType:r.retryPolicyType?r.retryPolicyType:u.retryPolicyType,maxTries:r.maxTries&&r.maxTries>=1?Math.floor(r.maxTries):u.maxTries,tryTimeoutInMs:r.tryTimeoutInMs&&r.tryTimeoutInMs>=0?r.tryTimeoutInMs:u.tryTimeoutInMs,retryDelayInMs:r.retryDelayInMs&&r.retryDelayInMs>=0?Math.min(r.retryDelayInMs,r.maxRetryDelayInMs?r.maxRetryDelayInMs:u.maxRetryDelayInMs):u.retryDelayInMs,maxRetryDelayInMs:r.maxRetryDelayInMs&&r.maxRetryDelayInMs>=0?r.maxRetryDelayInMs:u.maxRetryDelayInMs,secondaryHost:r.secondaryHost?r.secondaryHost:u.secondaryHost};}/**
|
|||
|
* Sends request.
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
*/async sendRequest(e){return this.attemptSendRequest(e,!1,1);}/**
|
|||
|
* Decide and perform next retry. Won't mutate request parameter.
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
* @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then
|
|||
|
* the resource was not found. This may be due to replication delay. So, in this
|
|||
|
* case, we'll never try the secondary again for this operation.
|
|||
|
* @param attempt - How many retries has been attempted to performed, starting from 1, which includes
|
|||
|
* the attempt will be performed by this method call.
|
|||
|
*/async attemptSendRequest(e,t,r){let i;let a=e.clone(),u=t||!this.retryOptions.secondaryHost||!("GET"===e.method||"HEAD"===e.method||"OPTIONS"===e.method)||r%2==1;u||(a.url=(0,o.setURLHost)(a.url,this.retryOptions.secondaryHost)),this.retryOptions.tryTimeoutInMs&&(a.url=(0,o.setURLParameter)(a.url,n.URLConstants.Parameters.TIMEOUT,Math.floor(this.retryOptions.tryTimeoutInMs/1e3).toString()));try{if((0,s.logger).info(`RetryPolicy: =====> Try=${r} ${u?"Primary":"Secondary"}`),i=await this._nextPolicy.sendRequest(a),!this.shouldRetry(u,r,i))return i;t=t||!u&&404===i.status;}catch(e){if((0,s.logger).error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`),!this.shouldRetry(u,r,i,e))throw e;}return await this.delay(u,r,e.abortSignal),this.attemptSendRequest(e,t,++r);}/**
|
|||
|
* Decide whether to retry according to last HTTP response and retry counters.
|
|||
|
*
|
|||
|
* @param isPrimaryRetry -
|
|||
|
* @param attempt -
|
|||
|
* @param response -
|
|||
|
* @param err -
|
|||
|
*/shouldRetry(e,t,r,i){if(t>=this.retryOptions.maxTries)return(0,s.logger).info(`RetryPolicy: Attempt(s) ${t} >= maxTries ${this.retryOptions.maxTries}, no further try.`),!1;// Handle network failures, you may need to customize the list when you implement
|
|||
|
// your own http client
|
|||
|
let a=["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNREFUSED","ECONNRESET","ENOENT","ENOTFOUND","TIMEOUT","EPIPE","REQUEST_SEND_ERROR"];if(i){for(let e of a)if(i.name.toUpperCase().includes(e)||i.message.toUpperCase().includes(e)||i.code&&i.code.toString().toUpperCase()===e)return(0,s.logger).info(`RetryPolicy: Network error ${e} found, will retry.`),!0;}// If attempt was against the secondary & it returned a StatusNotFound (404), then
|
|||
|
// the resource was not found. This may be due to replication delay. So, in this
|
|||
|
// case, we'll never try the secondary again for this operation.
|
|||
|
if(r||i){let t=r?r.status:i?i.statusCode:0;if(!e&&404===t)return(0,s.logger).info("RetryPolicy: Secondary access with 404, will retry."),!0;// Server internal error or server timeout
|
|||
|
if(503===t||500===t)return(0,s.logger).info(`RetryPolicy: Will retry for status code ${t}.`),!0;}return!!((null==i?void 0:i.code)==="PARSE_ERROR"&&(null==i?void 0:i.message.startsWith('Error "Error: Unclosed root tag')))&&((0,s.logger).info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."),!0);}/**
|
|||
|
* Delay a calculated time between retries.
|
|||
|
*
|
|||
|
* @param isPrimaryRetry -
|
|||
|
* @param attempt -
|
|||
|
* @param abortSignal -
|
|||
|
*/async delay(e,t,i){let a=0;if(e)switch(this.retryOptions.retryPolicyType){case r.EXPONENTIAL:a=Math.min((Math.pow(2,t-1)-1)*this.retryOptions.retryDelayInMs,this.retryOptions.maxRetryDelayInMs);break;case r.FIXED:a=this.retryOptions.retryDelayInMs;}else a=1e3*Math.random();return(0,s.logger).info(`RetryPolicy: Delay for ${a}ms`),(0,o.delay)(a,i,c);}}}),parcelRequire.register("chMMF",function(e,t){$parcel$export(e.exports,"TelemetryPolicyFactory",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("lrZDM"),i=parcelRequire("6o8LA"),a=parcelRequire("5MFjo");class n{/**
|
|||
|
* Creates an instance of TelemetryPolicyFactory.
|
|||
|
* @param telemetry -
|
|||
|
*/constructor(e){let t=[];if(r.isNode){if(e){let r=e.userAgentPrefix||"";r.length>0&&-1===t.indexOf(r)&&t.push(r);}// e.g. azsdk-js-storageblob/10.0.0
|
|||
|
let r=`azsdk-js-storageblob/${a.SDK_VERSION}`;-1===t.indexOf(r)&&t.push(r);// e.g. (NODE-VERSION 4.9.1; Windows_NT 10.0.16299)
|
|||
|
let i=`(NODE-VERSION ${process.version})`;$k14yv$os&&(i=`(NODE-VERSION ${process.version}; ${$k14yv$os.type()} ${$k14yv$os.release()})`),-1===t.indexOf(i)&&t.push(i);}this.telemetryString=t.join(" ");}/**
|
|||
|
* Creates a TelemetryPolicy object.
|
|||
|
*
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
*/create(e,t){return new i.TelemetryPolicy(e,t,this.telemetryString);}}}),parcelRequire.register("6o8LA",function(e,t){$parcel$export(e.exports,"TelemetryPolicy",()=>o);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("lrZDM"),i=parcelRequire("awoW3"),a=parcelRequire("42Oo8"),n=parcelRequire("5MFjo");class o extends a.BaseRequestPolicy{/**
|
|||
|
* Creates an instance of TelemetryPolicy.
|
|||
|
* @param nextPolicy -
|
|||
|
* @param options -
|
|||
|
* @param telemetry -
|
|||
|
*/constructor(e,t,r){super(e,t),this.telemetry=r;}/**
|
|||
|
* Sends out request.
|
|||
|
*
|
|||
|
* @param request -
|
|||
|
*/async sendRequest(e){return r.isNode&&(e.headers||(e.headers=new i.HttpHeaders()),e.headers.get(n.HeaderConstants.USER_AGENT)||e.headers.set(n.HeaderConstants.USER_AGENT,this.telemetry)),this._nextPolicy.sendRequest(e);}}}),parcelRequire.register("lnlvP",function(e,t){$parcel$export(e.exports,"getCachedDefaultHttpClient",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("e5vqu");let i=new r.NodeFetchHttpClient();function a(){return i;}}),parcelRequire.register("e5vqu",function(e,t){$parcel$export(e.exports,"NodeFetchHttpClient",()=>h);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("708hs"),i=parcelRequire("awoW3"),a=parcelRequire("jDsDO"),n=parcelRequire("1eDaz"),o=parcelRequire("f1RLO"),s=parcelRequire("aQvX1"),u=parcelRequire("eSooj");function c(e,t){return e?t.httpsAgent:t.httpAgent;}class l extends $k14yv$stream.Transform{constructor(e){super(),this.progressCallback=e,this.loadedBytes=0;}_transform(e,t,r){this.push(e),this.loadedBytes+=e.length,this.progressCallback({loadedBytes:this.loadedBytes}),r(void 0);}}function p(e){return e&&"function"==typeof e.pipe;}function d(e,t){return new Promise(r=>{e.once("close",()=>{null==t||t.abort(),r();}),e.once("end",r),e.once("error",r);});}function m(e){let t=new i.HttpHeaders();return e.forEach((e,r)=>{t.set(r,e);}),t;}class h{constructor(){// a mapping of proxy settings string `${host}:${port}:${username}:${password}` to agent
|
|||
|
this.proxyAgentMap=new Map(),this.keepAliveAgents={};}/**
|
|||
|
* Provides minimum viable error handling and the logic that executes the abstract methods.
|
|||
|
* @param httpRequest - Object representing the outgoing HTTP request.
|
|||
|
* @returns An object representing the incoming HTTP response.
|
|||
|
*/async sendRequest(e){var t;let i,a;if(!e&&"object"!=typeof e)throw Error("'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object.");let u=new r.AbortController();if(e.abortSignal){if(e.abortSignal.aborted)throw new r.AbortError("The operation was aborted.");i=e=>{"abort"===e.type&&u.abort();},e.abortSignal.addEventListener("abort",i);}if(e.timeout&&setTimeout(()=>{u.abort();},e.timeout),e.formData){let t=e.formData,r=new(/*@__PURE__*/$parcel$interopDefault(n))(),i=(e,t)=>{"function"==typeof t&&(t=t()),t&&Object.prototype.hasOwnProperty.call(t,"value")&&Object.prototype.hasOwnProperty.call(t,"options")?r.append(e,t.value,t.options):r.append(e,t);};for(let e of Object.keys(t)){let r=t[e];if(Array.isArray(r))for(let t=0;t<r.length;t++)i(e,r[t]);else i(e,r);}e.body=r,e.formData=void 0;let a=e.headers.get("Content-Type");a&&-1!==a.indexOf("multipart/form-data")&&("function"==typeof r.getBoundary?e.headers.set("Content-Type",`multipart/form-data; boundary=${r.getBoundary()}`):e.headers.remove("Content-Type"));}let c=e.body?"function"==typeof e.body?e.body():e.body:void 0;if(e.onUploadProgress&&e.body){let t=e.onUploadProgress,r=new l(t);p(c)?c.pipe(r):r.end(c),c=r;}let h=await this.prepareRequest(e),x=Object.assign({body:c,headers:e.headers.rawHeaders(),method:e.method,// the types for RequestInit are from the browser, which expects AbortSignal to
|
|||
|
// have `reason` and `throwIfAborted`, but these don't exist on our polyfill
|
|||
|
// for Node.
|
|||
|
signal:u.signal,redirect:"manual"},h);try{let r=await this.fetch(e.url,x),i=m(r.headers),n=(null===(t=e.streamResponseStatusCodes)||void 0===t?void 0:t.has(r.status))||e.streamResponseBody;a={headers:i,request:e,status:r.status,readableStreamBody:n?r.body:void 0,bodyAsText:n?void 0:await r.text()};let o=e.onDownloadProgress;if(o){let e=r.body||void 0;if(p(e)){let t=new l(o);e.pipe(t),a.readableStreamBody=t;}else{let e=parseInt(i.get("Content-Length"))||void 0;e&&o({loadedBytes:e});}}return await this.processRequest(a),a;}catch(i){let t=i;if("ENOTFOUND"===t.code)throw new o.RestError(t.message,o.RestError.REQUEST_SEND_ERROR,void 0,e);if("aborted"===t.type)throw new r.AbortError("The operation was aborted.");throw t;}finally{// clean up event listener
|
|||
|
if(e.abortSignal&&i){let t=Promise.resolve();p(c)&&(t=d(c));let r=Promise.resolve();p(null==a?void 0:a.readableStreamBody)&&(r=d(a.readableStreamBody,u)),Promise.all([t,r]).then(()=>{var t;null===(t=e.abortSignal)||void 0===t||t.removeEventListener("abort",i);}).catch(e=>{(0,s.logger).warning("Error when cleaning up abortListener on httpRequest",e);});}}}getOrCreateAgent(e){var t;let r=(0,a.isUrlHttps)(e.url);// At the moment, proxy settings and keepAlive are mutually
|
|||
|
// exclusive because the 'tunnel' library currently lacks the
|
|||
|
// ability to create a proxy with keepAlive turned on.
|
|||
|
if(e.proxySettings){let{host:i,port:n,username:o,password:s}=e.proxySettings,u=`${i}:${n}:${o}:${s}`,l=null!==(t=this.proxyAgentMap.get(u))&&void 0!==t?t:{},p=c(r,l);if(p)return p;let d=(0,a.createProxyAgent)(e.url,e.proxySettings,e.headers);return p=d.agent,d.isHttps?l.httpsAgent=d.agent:l.httpAgent=d.agent,this.proxyAgentMap.set(u,l),p;}if(!e.keepAlive)return r?$k14yv$https.globalAgent:$k14yv$http.globalAgent;{let t=c(r,this.keepAliveAgents);if(t)return t;let i={keepAlive:e.keepAlive};return r?this.keepAliveAgents.httpsAgent=new $k14yv$https.Agent(i):this.keepAliveAgents.httpAgent=new $k14yv$http.Agent(i);}}/**
|
|||
|
* Uses `node-fetch` to perform the request.
|
|||
|
*/ // eslint-disable-next-line @azure/azure-sdk/ts-apisurface-standardized-verbs
|
|||
|
async fetch(e,t){return(0,u.default)(e,t);}/**
|
|||
|
* Prepares a request based on the provided web resource.
|
|||
|
*/async prepareRequest(e){let t={};return(// Set the http(s) agent
|
|||
|
t.agent=this.getOrCreateAgent(e),t.compress=e.decompressResponse,t);}/**
|
|||
|
* Process an HTTP response.
|
|||
|
*/async processRequest(e){/* no_op */}}}),parcelRequire.register("jDsDO",function(e,t){$parcel$export(e.exports,"createProxyAgent",()=>a),$parcel$export(e.exports,"isUrlHttps",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("eYDoL"),i=parcelRequire("18oFr");function a(e,t,r){let a=(0,i.URLBuilder).parse(t.host).getHost();if(!a)throw Error("Expecting a non-empty host in proxy settings.");if(!s(t.port))throw Error("Expecting a valid port number in the range of [0, 65535] in proxy settings.");let u={proxy:{host:a,port:t.port,headers:r&&r.rawHeaders()||{}}};t.username&&t.password?u.proxy.proxyAuth=`${t.username}:${t.password}`:t.username&&(u.proxy.proxyAuth=`${t.username}`);let c=n(e),l=n(t.host),p={isHttps:c,agent:o(c,l,u)};return p;}function n(e){let t=(0,i.URLBuilder).parse(e).getScheme()||"";return"https"===t.toLowerCase();}function o(e,t,i){return e&&t?r.httpsOverHttps(i):e&&!t?r.httpsOverHttp(i):!e&&t?r.httpOverHttps(i):r.httpOverHttp(i);}function s(e){// any port in 0-65535 range is valid (RFC 793) even though almost all implementations
|
|||
|
// will reserve 0 for a specific purpose, and a range of numbers for ephemeral ports
|
|||
|
return 0<=e&&e<=65535;}}),parcelRequire.register("1eDaz",function(e,t){var r=parcelRequire("cOmur"),i=$k14yv$url.parse,a=$k14yv$stream.Stream,n=parcelRequire("gZH9u"),o=parcelRequire("RRCEG"),s=parcelRequire("b0Nbf");/**
|
|||
|
* Create readable "multipart/form-data" streams.
|
|||
|
* Can be used to submit forms
|
|||
|
* and file uploads to other web applications.
|
|||
|
*
|
|||
|
* @constructor
|
|||
|
* @param {Object} options - Properties to be added/overriden for FormData and CombinedStream
|
|||
|
*/function u(e){if(!(this instanceof u))return new u(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],r.call(this),e=e||{})this[t]=e[t];}// Public API
|
|||
|
e.exports=u,// make it a Stream
|
|||
|
$k14yv$util.inherits(u,r),u.LINE_BREAK="\r\n",u.DEFAULT_CONTENT_TYPE="application/octet-stream",u.prototype.append=function(e,t,i){"string"==typeof(i=i||{})&&(i={filename:i});var a=r.prototype.append.bind(this);// https://github.com/felixge/node-form-data/issues/38
|
|||
|
if("number"==typeof t&&(t=""+t),$k14yv$util.isArray(t)){// Please convert your array into string
|
|||
|
// the way web server expects it
|
|||
|
this._error(Error("Arrays are not supported."));return;}var n=this._multiPartHeader(e,t,i),o=this._multiPartFooter();a(n),a(t),a(o),// pass along options.knownLength
|
|||
|
this._trackLength(n,t,i);},u.prototype._trackLength=function(e,t,r){var i=0;null!=r.knownLength?i+=+r.knownLength:Buffer.isBuffer(t)?i=t.length:"string"==typeof t&&(i=Buffer.byteLength(t)),this._valueLength+=i,// @check why add CRLF? does this account for custom/multiple CRLFs?
|
|||
|
this._overheadLength+=Buffer.byteLength(e)+u.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion")||t instanceof a)&&!r.knownLength&&this._valuesToMeasure.push(t);},u.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?void 0!=e.end&&e.end!=1/0&&void 0!=e.start?// no need to calculate range
|
|||
|
// inclusive, starts with 0
|
|||
|
t(null,e.end+1-(e.start?e.start:0)):$k14yv$fs.stat(e.path,function(r,i){if(r){t(r);return;}t(null,i.size-(e.start?e.start:0));}):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(// wait till response come back
|
|||
|
e.on("response",function(r){e.pause(),t(null,+r.headers["content-length"]);}),e.resume()):t("Unknown stream");},u.prototype._multiPartHeader=function(e,t,r){// custom header specified (as string)?
|
|||
|
// it becomes responsible for boundary
|
|||
|
// (e.g. to handle extra CRLFs on .NET servers)
|
|||
|
if("string"==typeof r.header)return r.header;var i,a=this._getContentDisposition(t,r),n=this._getContentType(t,r),o="",c={// add custom disposition as third element or keep it two elements if not
|
|||
|
"Content-Disposition":["form-data",'name="'+e+'"'].concat(a||[]),// if no content type. allow it to be empty array
|
|||
|
"Content-Type":[].concat(n||[])};for(var l in"object"==typeof r.header&&s(c,r.header),c)c.hasOwnProperty(l)&&null!=(i=c[l])&&(Array.isArray(i)||(i=[i]),i.length&&(o+=l+": "+i.join("; ")+u.LINE_BREAK));return"--"+this.getBoundary()+u.LINE_BREAK+o+u.LINE_BREAK;},u.prototype._getContentDisposition=function(e,t){var r,i;return"string"==typeof t.filepath?r=$k14yv$path.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?// formidable and the browser add a name property
|
|||
|
// fs- and request- streams have path property
|
|||
|
r=$k14yv$path.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(r=$k14yv$path.basename(e.client._httpMessage.path||"")),r&&(i='filename="'+r+'"'),i;},u.prototype._getContentType=function(e,t){// use custom content-type above all
|
|||
|
var r=t.contentType;return!r&&e.name&&(r=n.lookup(e.name)),!r&&e.path&&(r=n.lookup(e.path)),!r&&e.readable&&e.hasOwnProperty("httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=n.lookup(t.filepath||t.filename)),r||"object"!=typeof e||(r=u.DEFAULT_CONTENT_TYPE),r;},u.prototype._multiPartFooter=function(){return function(e){var t=u.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t);}.bind(this);},u.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+u.LINE_BREAK;},u.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(r[t.toLowerCase()]=e[t]);return r;},u.prototype.setBoundary=function(e){this._boundary=e;},u.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary;},u.prototype.getBuffer=function(){// Create the form content. Add Line breaks to the end of data.
|
|||
|
for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,i=this._streams.length;r<i;r++)"function"!=typeof this._streams[r]&&(e=Buffer.isBuffer(this._streams[r])?Buffer.concat([e,this._streams[r]]):Buffer.concat([e,Buffer.from(this._streams[r])]),("string"!=typeof this._streams[r]||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(u.LINE_BREAK)])));// Add the footer and return the Buffer object.
|
|||
|
return Buffer.concat([e,Buffer.from(this._lastBoundary())]);},u.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e;},// Note: getLengthSync DOESN'T calculate streams length
|
|||
|
// As workaround one can calculate file size manually
|
|||
|
// and add it as knownLength option
|
|||
|
u.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||// therefore synchronous length calculation is false.
|
|||
|
// Please use getLength(callback) to get proper length
|
|||
|
this._error(Error("Cannot calculate proper length in synchronous way.")),e;},// Public API to check if length of added values is known
|
|||
|
// https://github.com/form-data/form-data/issues/196
|
|||
|
// https://github.com/form-data/form-data/issues/262
|
|||
|
u.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e;},u.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return;}o.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,i){if(r){e(r);return;}i.forEach(function(e){t+=e;}),e(null,t);});},u.prototype.submit=function(e,t){var r,a,n={method:"post"};return"string"==typeof e?a=s({port:(e=i(e)).port,path:e.pathname,host:e.hostname,protocol:e.protocol},n):(a=s(e,n)).port||(a.port="https:"==a.protocol?443:80),// put that good code in getHeaders to some use
|
|||
|
a.headers=this.getHeaders(e.headers),r="https:"==a.protocol?$k14yv$https.request(a):$k14yv$http.request(a),// get content length and fire away
|
|||
|
this.getLength(function(e,i){if(e&&"Unknown stream"!==e){this._error(e);return;}if(i&&r.setHeader("Content-Length",i),this.pipe(r),t){var a,n=function(e,i){return r.removeListener("error",n),r.removeListener("response",a),t.call(this,e,i);};a=n.bind(this,null),r.on("error",n),r.on("response",a);}}.bind(this)),r;},u.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e));},u.prototype.toString=function(){return"[object FormData]";};}),parcelRequire.register("cOmur",function(e,t){var r=$k14yv$stream.Stream,i=parcelRequire("10LEs");function a(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1;}e.exports=a,$k14yv$util.inherits(a,r),a.create=function(e){var t=new this();for(var r in e=e||{})t[r]=e[r];return t;},a.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e);},a.prototype.append=function(e){if(a.isStreamLike(e)){if(!(e instanceof i)){var t=i.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=t;}this._handleErrors(e),this.pauseStreams&&e.pause();}return this._streams.push(e),this;},a.prototype.pipe=function(e,t){return r.prototype.pipe.call(this,e,t),this.resume(),e;},a.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return;// defer call
|
|||
|
}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext);}finally{this._insideLoop=!1;}},a.prototype._realGetNext=function(){var e=this._streams.shift();if(void 0===e){this.end();return;}if("function"!=typeof e){this._pipeNext(e);return;}e(function(e){a.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e);}.bind(this));},a.prototype._pipeNext=function(e){if(this._currentStream=e,a.isStreamLike(e)){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return;}var t=e;this.write(t),this._getNext();},a.prototype._handleErrors=function(e){var t=this;e.on("error",function(e){t._emitError(e);});},a.prototype.write=function(e){this.emit("data",e);},a.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"));},a.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume");},a.prototype.end=function(){this._reset(),this.emit("end");},a.prototype.destroy=function(){this._reset(),this.emit("close");},a.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null;},a.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(Error(e));}},a.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize);}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize);},a.prototype._emitError=function(e){this._reset(),this.emit("error",e);};}),parcelRequire.register("10LEs",function(e,t){var r=$k14yv$stream.Stream;function i(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[];}e.exports=i,$k14yv$util.inherits(i,r),i.create=function(e,t){var r=new this();for(var i in t=t||{})r[i]=t[i];r.source=e;var a=e.emit;return e.emit=function(){return r._handleEmit(arguments),a.apply(e,arguments);},e.on("error",function(){}),r.pauseStream&&e.pause(),r;},Object.defineProperty(i.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable;}}),i.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments);},i.prototype.resume=function(){this._released||this.release(),this.source.resume();},i.prototype.pause=function(){this.source.pause();},i.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e);}.bind(this)),this._bufferedEvents=[];},i.prototype.pipe=function(){var e=r.prototype.pipe.apply(this,arguments);return this.resume(),e;},i.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return;}"data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e);},i.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",Error(e));}};}),parcelRequire.register("gZH9u",function(e,t){$parcel$export(e.exports,"charset",()=>r,e=>r=e),$parcel$export(e.exports,"extensions",()=>i,e=>i=e),$parcel$export(e.exports,"lookup",()=>a,e=>a=e),$parcel$export(e.exports,"types",()=>n,e=>n=e);var r,i,a,n,o=parcelRequire("lqEiY"),s=$k14yv$path.extname,u=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;/**
|
|||
|
* Lookup the MIME type for a file path/extension.
|
|||
|
*
|
|||
|
* @param {string} path
|
|||
|
* @return {boolean|string}
|
|||
|
*/function l(e){if(!e||"string"!=typeof e)return!1;// get the extension ("ext" or ".ext" or full path)
|
|||
|
var t=s("x."+e).toLowerCase().substr(1);return!!t&&(n[t]||!1);}/**
|
|||
|
* Populate the extensions and types maps.
|
|||
|
* @private
|
|||
|
*/function p(e,t){// source preference (least -> most)
|
|||
|
var r=["nginx","apache",void 0,"iana"];Object.keys(o).forEach(function(i){var a=o[i],n=a.extensions;if(n&&n.length){// mime -> extensions
|
|||
|
e[i]=n;// extension -> mime
|
|||
|
for(var s=0;s<n.length;s++){var u=n[s];if(t[u]){var c=r.indexOf(o[t[u]].source),l=r.indexOf(a.source);if("application/octet-stream"!==t[u]&&(c>l||c===l&&"application/"===t[u].substr(0,12)))continue;}// set the extension -> mime
|
|||
|
t[u]=i;}}});}r=/**
|
|||
|
* Get the default charset for a MIME type.
|
|||
|
*
|
|||
|
* @param {string} type
|
|||
|
* @return {boolean|string}
|
|||
|
*/function(e){if(!e||"string"!=typeof e)return!1;// TODO: use media-typer
|
|||
|
var t=u.exec(e),r=t&&o[t[1].toLowerCase()];return r&&r.charset?r.charset:!!(t&&c.test(t[1]))&&"UTF-8";},i=Object.create(null),a=l,n=Object.create(null),// Populate the extensions/types maps
|
|||
|
p(i,n);}),parcelRequire.register("lqEiY",function(e,t){/*!
|
|||
|
* mime-db
|
|||
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/ /**
|
|||
|
* Module exports.
|
|||
|
*/e.exports=parcelRequire("1QpFo");}),parcelRequire.register("1QpFo",function(e,t){e.exports=JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/ace+cbor":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/at+jwt":{"source":"iana"},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"a
|
|||
|
* Runs iterator over provided array elements in parallel
|
|||
|
*
|
|||
|
* @param {array|object} list - array or object (named list) to iterate over
|
|||
|
* @param {function} iterator - iterator to run
|
|||
|
* @param {function} callback - invoked when all elements processed
|
|||
|
* @returns {function} - jobs terminator
|
|||
|
*/function n(e,t,n){for(var o=i(e);o.index<(o.keyedList||e).length;)r(e,t,o,function(e,t){if(e){n(e,t);return;}// looks like it's the last one
|
|||
|
if(0===Object.keys(o.jobs).length){n(null,o.results);return;}}),o.index++;return a.bind(o,n);}// Public API
|
|||
|
e.exports=n;}),parcelRequire.register("dJabY",function(e,t){var r=parcelRequire("dhxfR"),i=parcelRequire("bOJJ3");/**
|
|||
|
* Iterates over each job object
|
|||
|
*
|
|||
|
* @param {array|object} list - array or object (named list) to iterate over
|
|||
|
* @param {function} iterator - iterator to run
|
|||
|
* @param {object} state - current job status
|
|||
|
* @param {function} callback - invoked when all elements processed
|
|||
|
*/function a(e,t,r,a){// store current index
|
|||
|
var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=n(t,o,e[o],function(e,t){o in r.jobs&&(// clean up jobs
|
|||
|
delete r.jobs[o],e?// stop still active jobs
|
|||
|
// and reset the list
|
|||
|
i(r):r.results[o]=t,// return salvaged results
|
|||
|
a(e,r.results));});}/**
|
|||
|
* Runs iterator over provided job element
|
|||
|
*
|
|||
|
* @param {function} iterator - iterator to invoke
|
|||
|
* @param {string|number} key - key/index of the element in the list of jobs
|
|||
|
* @param {mixed} item - job description
|
|||
|
* @param {function} callback - invoked after iterator is done with the job
|
|||
|
* @returns {function|mixed} - job abort function or something else
|
|||
|
*/function n(e,t,i,a){return 2==e.length?e(i,r(a)):e(i,t,r(a));}// API
|
|||
|
e.exports=a;}),parcelRequire.register("dhxfR",function(e,t){var r=parcelRequire("53GbM");/**
|
|||
|
* Runs provided callback asynchronously
|
|||
|
* even if callback itself is not
|
|||
|
*
|
|||
|
* @param {function} callback - callback to invoke
|
|||
|
* @returns {function} - augmented callback
|
|||
|
*/function i(e){var t=!1;return(// check if async happened
|
|||
|
r(function(){t=!0;}),function(i,a){t?e(i,a):r(function(){e(i,a);});});}// API
|
|||
|
e.exports=i;}),parcelRequire.register("53GbM",function(e,t){e.exports=r;/**
|
|||
|
* Runs provided function on next iteration of the event loop
|
|||
|
*
|
|||
|
* @param {function} fn - function to run
|
|||
|
*/function r(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0);}}),parcelRequire.register("bOJJ3",function(e,t){/**
|
|||
|
* Aborts leftover active jobs
|
|||
|
*
|
|||
|
* @param {object} state - current state object
|
|||
|
*/function r(e){Object.keys(e.jobs).forEach(i.bind(e)),// reset leftover jobs
|
|||
|
e.jobs={};}/**
|
|||
|
* Cleans up leftover job by invoking abort function for the provided job id
|
|||
|
*
|
|||
|
* @this state
|
|||
|
* @param {string|number} key - job id to abort
|
|||
|
*/function i(e){"function"==typeof this.jobs[e]&&this.jobs[e]();}// API
|
|||
|
e.exports=r;}),parcelRequire.register("8vGvV",function(e,t){// API
|
|||
|
e.exports=r;/**
|
|||
|
* Creates initial state object
|
|||
|
* for iteration over list
|
|||
|
*
|
|||
|
* @param {array|object} list - list to iterate over
|
|||
|
* @param {function|null} sortMethod - function to use for keys sort,
|
|||
|
* or `null` to keep them as is
|
|||
|
* @returns {object} - initial state object
|
|||
|
*/function r(e,t){var r=!Array.isArray(e),i={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&// sort object's keys just on own merit
|
|||
|
i.keyedList.sort(r?t:function(r,i){return t(e[r],e[i]);}),i;}}),parcelRequire.register("lbD8k",function(e,t){var r=parcelRequire("bOJJ3"),i=parcelRequire("dhxfR");/**
|
|||
|
* Terminates jobs in the attached state context
|
|||
|
*
|
|||
|
* @this AsyncKitState#
|
|||
|
* @param {function} callback - final callback to invoke after termination
|
|||
|
*/function a(e){Object.keys(this.jobs).length&&(// fast forward iteration index
|
|||
|
this.index=this.size,// abort jobs
|
|||
|
r(this),// send back results we have so far
|
|||
|
i(e)(null,this.results));}// API
|
|||
|
e.exports=a;}),parcelRequire.register("797hS",function(e,t){var r=parcelRequire("jT8yt");/**
|
|||
|
* Runs iterator over provided array elements in series
|
|||
|
*
|
|||
|
* @param {array|object} list - array or object (named list) to iterate over
|
|||
|
* @param {function} iterator - iterator to run
|
|||
|
* @param {function} callback - invoked when all elements processed
|
|||
|
* @returns {function} - jobs terminator
|
|||
|
*/function i(e,t,i){return r(e,t,null,i);}// Public API
|
|||
|
e.exports=i;}),parcelRequire.register("jT8yt",function(e,t){var r=parcelRequire("dJabY"),i=parcelRequire("8vGvV"),a=parcelRequire("lbD8k");/**
|
|||
|
* Runs iterator over provided sorted array elements in series
|
|||
|
*
|
|||
|
* @param {array|object} list - array or object (named list) to iterate over
|
|||
|
* @param {function} iterator - iterator to run
|
|||
|
* @param {function} sortMethod - custom sort function
|
|||
|
* @param {function} callback - invoked when all elements processed
|
|||
|
* @returns {function} - jobs terminator
|
|||
|
*/function n(e,t,n,o){var s=i(e,n);return r(e,t,s,function i(a,n){if(a){o(a,n);return;}// are we there yet?
|
|||
|
if(s.index++,s.index<(s.keyedList||e).length){r(e,t,s,i);return;}// done here
|
|||
|
o(null,s.results);}),a.bind(s,o);}/*
|
|||
|
* -- Sort methods
|
|||
|
*/ /**
|
|||
|
* sort helper to sort array elements in ascending order
|
|||
|
*
|
|||
|
* @param {mixed} a - an item to compare
|
|||
|
* @param {mixed} b - an item to compare
|
|||
|
* @returns {number} - comparison result
|
|||
|
*/function o(e,t){return e<t?-1:e>t?1:0;}/**
|
|||
|
* sort helper to sort array elements in descending order
|
|||
|
*
|
|||
|
* @param {mixed} a - an item to compare
|
|||
|
* @param {mixed} b - an item to compare
|
|||
|
* @returns {number} - comparison result
|
|||
|
*/function s(e,t){return-1*o(e,t);}// Public API
|
|||
|
e.exports=n,// sorting helpers
|
|||
|
e.exports.ascending=o,e.exports.descending=s;}),parcelRequire.register("b0Nbf",function(e,t){// populates missing values
|
|||
|
e.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r];}),e;};}),parcelRequire.register("eSooj",function(e,t){let r;$parcel$export(e.exports,"default",()=>et);var i=parcelRequire("h17jx");// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
|
|||
|
// fix for "Readable" isn't a named export issue
|
|||
|
let a=$parcel$interopDefault($k14yv$stream).Readable,n=Symbol("buffer"),o=Symbol("type");class s{constructor(){this[o]="";let e=arguments[0],t=arguments[1],r=[],i=0;if(e){let t=e,a=Number(t.length);for(let e=0;e<a;e++){let a;let o=t[e];i+=(a=o instanceof Buffer?o:ArrayBuffer.isView(o)?Buffer.from(o.buffer,o.byteOffset,o.byteLength):o instanceof ArrayBuffer?Buffer.from(o):o instanceof s?o[n]:Buffer.from("string"==typeof o?o:String(o))).length,r.push(a);}}this[n]=Buffer.concat(r);let a=t&&void 0!==t.type&&String(t.type).toLowerCase();a&&!/[^\u0020-\u007E]/.test(a)&&(this[o]=a);}get size(){return this[n].length;}get type(){return this[o];}text(){return Promise.resolve(this[n].toString());}arrayBuffer(){let e=this[n],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t);}stream(){let e=new a();return e._read=function(){},e.push(this[n]),e.push(null),e;}toString(){return"[object Blob]";}slice(){let e,t;let r=this.size,i=arguments[0],a=arguments[1];e=void 0===i?0:i<0?Math.max(r+i,0):Math.min(i,r),t=void 0===a?r:a<0?Math.max(r+a,0):Math.min(a,r);let o=Math.max(t-e,0),u=this[n],c=u.slice(e,e+o),l=new s([],{type:arguments[2]});return l[n]=c,l;}}/**
|
|||
|
* fetch-error.js
|
|||
|
*
|
|||
|
* FetchError interface for operational errors
|
|||
|
*/ /**
|
|||
|
* Create FetchError instance
|
|||
|
*
|
|||
|
* @param String message Error message for human
|
|||
|
* @param String type Error type for machine
|
|||
|
* @param String systemError For Node.js system error
|
|||
|
* @return FetchError
|
|||
|
*/function u(e,t,r){Error.call(this,e),this.message=e,this.type=t,r&&(this.code=this.errno=r.code),// hide custom error implementation details from end-users
|
|||
|
Error.captureStackTrace(this,this.constructor);}Object.defineProperties(s.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(s.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),u.prototype=Object.create(Error.prototype),u.prototype.constructor=u,u.prototype.name="FetchError";try{r=parcelRequire("bZ2Z4").convert;}catch(e){}let c=Symbol("Body internals"),l=$parcel$interopDefault($k14yv$stream).PassThrough;/**
|
|||
|
* Body mixin
|
|||
|
*
|
|||
|
* Ref: https://fetch.spec.whatwg.org/#body
|
|||
|
*
|
|||
|
* @param Stream body Readable stream
|
|||
|
* @param Object opts Response options
|
|||
|
* @return Void
|
|||
|
*/function p(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.size;let a=void 0===i?0:i;var n=r.timeout;let o=void 0===n?0:n;null==e?e=null:h(e)?e=Buffer.from(e.toString()):x(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof $parcel$interopDefault($k14yv$stream)||(// coerce to string then buffer
|
|||
|
e=Buffer.from(String(e)))),this[c]={body:e,disturbed:!1,error:null},this.size=a,this.timeout=o,e instanceof $parcel$interopDefault($k14yv$stream)&&e.on("error",function(e){let r="AbortError"===e.name?e:new u(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[c].error=r;});}/**
|
|||
|
* Consume and convert an entire Body to a Buffer.
|
|||
|
*
|
|||
|
* Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
|
|||
|
*
|
|||
|
* @return Promise
|
|||
|
*/function d(){var e=this;if(this[c].disturbed)return p.Promise.reject(TypeError(`body used already for: ${this.url}`));if(this[c].disturbed=!0,this[c].error)return p.Promise.reject(this[c].error);let t=this.body;// body is null
|
|||
|
if(null===t)return p.Promise.resolve(Buffer.alloc(0));// body is buffer
|
|||
|
if(x(t)&&(t=t.stream()),Buffer.isBuffer(t))return p.Promise.resolve(t);// istanbul ignore if: should never happen
|
|||
|
if(!(t instanceof $parcel$interopDefault($k14yv$stream)))return p.Promise.resolve(Buffer.alloc(0));// body is stream
|
|||
|
// get ready to actually consume the body
|
|||
|
let r=[],i=0,a=!1;return new p.Promise(function(n,o){let s;e.timeout&&(s=setTimeout(function(){a=!0,o(new u(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"));},e.timeout)),// handle stream errors
|
|||
|
t.on("error",function(t){"AbortError"===t.name?(// if the request was aborted, reject with this Error
|
|||
|
a=!0,o(t)):o(new u(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t));}),t.on("data",function(t){if(!a&&null!==t){if(e.size&&i+t.length>e.size){a=!0,o(new u(`content size at ${e.url} over limit: ${e.size}`,"max-size"));return;}i+=t.length,r.push(t);}}),t.on("end",function(){if(!a){clearTimeout(s);try{n(Buffer.concat(r,i));}catch(t){// handle streams that have accumulated too much data (issue #414)
|
|||
|
o(new u(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t));}}});});}/**
|
|||
|
* Detect buffer encoding and convert to target encoding
|
|||
|
* ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
|
|||
|
*
|
|||
|
* @param Buffer buffer Incoming buffer
|
|||
|
* @param String encoding Target encoding
|
|||
|
* @return String
|
|||
|
*/function m(e,t){let i,a;if("function"!=typeof r)throw Error("The package `encoding` must be installed to use the textConverted() function");let n=t.get("content-type"),o="utf-8";// turn raw buffers into a single utf-8 buffer
|
|||
|
return n&&(i=/charset=([^;]*)/i.exec(n)),// no charset in content type, peek at response body for at most 1024 bytes
|
|||
|
a=e.slice(0,1024).toString(),!i&&a&&(i=/<meta.+?charset=(['"])(.+?)\1/i.exec(a)),!i&&a&&(!(i=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(a))&&(i=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(a))&&i.pop(),i&&(i=/charset=(.*)/i.exec(i.pop()))),!i&&a&&(i=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(a)),i&&("gb2312"===(o=i.pop())||"gbk"===o)&&(o="gb18030"),r(e,"UTF-8",o).toString();}/**
|
|||
|
* Detect a URLSearchParams object
|
|||
|
* ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
|
|||
|
*
|
|||
|
* @param Object obj Object to detect by type or brand
|
|||
|
* @return String
|
|||
|
*/function h(e){return(// Duck-typing as a necessary condition.
|
|||
|
"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort));}/**
|
|||
|
* Check if `obj` is a W3C `Blob` object (which `File` inherits from)
|
|||
|
* @param {*} obj
|
|||
|
* @return {boolean}
|
|||
|
*/function x(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]);}/**
|
|||
|
* Clone body given Res/Req instance
|
|||
|
*
|
|||
|
* @param Mixed instance Response or Request instance
|
|||
|
* @return Mixed
|
|||
|
*/function f(e){let t,r;let i=e.body;// don't allow cloning a used body
|
|||
|
if(e.bodyUsed)throw Error("cannot clone body after it is used");return i instanceof $parcel$interopDefault($k14yv$stream)&&"function"!=typeof i.getBoundary&&(// tee instance body
|
|||
|
t=new l(),r=new l(),i.pipe(t),i.pipe(r),// set instance body to teed body and return the other teed body
|
|||
|
e[c].body=t,i=r),i;}/**
|
|||
|
* Performs the operation "extract a `Content-Type` value from |object|" as
|
|||
|
* specified in the specification:
|
|||
|
* https://fetch.spec.whatwg.org/#concept-bodyinit-extract
|
|||
|
*
|
|||
|
* This function assumes that instance.body is present.
|
|||
|
*
|
|||
|
* @param Mixed instance Any options.body input
|
|||
|
*/function g(e){if(null===e)return null;if("string"==typeof e)return"text/plain;charset=UTF-8";if(h(e))return"application/x-www-form-urlencoded;charset=UTF-8";if(x(e))return e.type||null;if(Buffer.isBuffer(e))return null;if("[object ArrayBuffer]"===Object.prototype.toString.call(e))return null;if(ArrayBuffer.isView(e))return null;else if("function"==typeof e.getBoundary)return`multipart/form-data;boundary=${e.getBoundary()}`;else if(e instanceof $parcel$interopDefault($k14yv$stream))// can't really do much about this
|
|||
|
return null;else return"text/plain;charset=UTF-8";}/**
|
|||
|
* The Fetch Standard treats this as if "total bytes" is a property on the body.
|
|||
|
* For us, we have to explicitly get it with a function.
|
|||
|
*
|
|||
|
* ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
|
|||
|
*
|
|||
|
* @param Body instance Instance of Body
|
|||
|
* @return Number? Number of bytes, or null if not possible
|
|||
|
*/function D(e){let t=e.body;return null===t?0:x(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||// 1.x
|
|||
|
t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null;}/**
|
|||
|
* Write a Body to a Node.js WritableStream (e.g. http.Request) object.
|
|||
|
*
|
|||
|
* @param Body instance Instance of Body
|
|||
|
* @return Void
|
|||
|
*/function y(e,t){let r=t.body;null===r?e.end():x(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(// body is buffer
|
|||
|
e.write(r),e.end()):r.pipe(e);}p.prototype={get body(){return this[c].body;},get bodyUsed(){return this[c].disturbed;},/**
|
|||
|
* Decode response as ArrayBuffer
|
|||
|
*
|
|||
|
* @return Promise
|
|||
|
*/arrayBuffer(){return d.call(this).then(function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);});},/**
|
|||
|
* Return raw response as Blob
|
|||
|
*
|
|||
|
* @return Promise
|
|||
|
*/blob(){let e=this.headers&&this.headers.get("content-type")||"";return d.call(this).then(function(t){return Object.assign(new s([],{type:e.toLowerCase()}),{[n]:t});});},/**
|
|||
|
* Decode response as json
|
|||
|
*
|
|||
|
* @return Promise
|
|||
|
*/json(){var e=this;return d.call(this).then(function(t){try{return JSON.parse(t.toString());}catch(t){return p.Promise.reject(new u(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"));}});},/**
|
|||
|
* Decode response as text
|
|||
|
*
|
|||
|
* @return Promise
|
|||
|
*/text(){return d.call(this).then(function(e){return e.toString();});},/**
|
|||
|
* Decode response as buffer (non-spec api)
|
|||
|
*
|
|||
|
* @return Promise
|
|||
|
*/buffer(){return d.call(this);},/**
|
|||
|
* Decode response as text, while automatically detecting the encoding and
|
|||
|
* trying to decode to UTF-8 (non-spec api)
|
|||
|
*
|
|||
|
* @return Promise
|
|||
|
*/textConverted(){var e=this;return d.call(this).then(function(t){return m(t,e.headers);});}},// In browsers, all properties are enumerable.
|
|||
|
Object.defineProperties(p.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),p.mixIn=function(e){for(let t of Object.getOwnPropertyNames(p.prototype))if(!(t in e)){let r=Object.getOwnPropertyDescriptor(p.prototype,t);Object.defineProperty(e,t,r);}},// expose Promise
|
|||
|
p.Promise=$parcel$global.Promise;/**
|
|||
|
* headers.js
|
|||
|
*
|
|||
|
* Headers class offers convenient helpers
|
|||
|
*/let b=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,v=/[^\t\x20-\x7e\x80-\xff]/;function C(e){if(e=`${e}`,b.test(e)||""===e)throw TypeError(`${e} is not a legal HTTP header name`);}function E(e){if(e=`${e}`,v.test(e))throw TypeError(`${e} is not a legal HTTP header value`);}/**
|
|||
|
* Find the key in the map object given a header name.
|
|||
|
*
|
|||
|
* Returns undefined if not found.
|
|||
|
*
|
|||
|
* @param String name Header name
|
|||
|
* @return String|Undefined
|
|||
|
*/function A(e,t){for(let r in t=t.toLowerCase(),e)if(r.toLowerCase()===t)return r;}let S=Symbol("map");class B{/**
|
|||
|
* Headers class
|
|||
|
*
|
|||
|
* @param Object headers Response headers
|
|||
|
* @return Void
|
|||
|
*/constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[S]=Object.create(null),e instanceof B){let t=e.raw(),r=Object.keys(t);for(let e of r)for(let r of t[e])this.append(e,r);return;}// We don't worry about converting prop to ByteString here as append()
|
|||
|
// will handle it.
|
|||
|
if(null==e);else if("object"==typeof e){let t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw TypeError("Header pairs must be iterable");// sequence<sequence<ByteString>>
|
|||
|
// Note: per spec we have to first exhaust the lists then process them
|
|||
|
let r=[];for(let t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw TypeError("Each header pair must be iterable");r.push(Array.from(t));}for(let e of r){if(2!==e.length)throw TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1]);}}else for(let t of Object.keys(e)){let r=e[t];this.append(t,r);}}else throw TypeError("Provided initializer must be an object");}/**
|
|||
|
* Return combined header value given name
|
|||
|
*
|
|||
|
* @param String name Header name
|
|||
|
* @return Mixed
|
|||
|
*/get(e){C(e=`${e}`);let t=A(this[S],e);return void 0===t?null:this[S][t].join(", ");}/**
|
|||
|
* Iterate over all headers
|
|||
|
*
|
|||
|
* @param Function callback Executed for each item with parameters (value, name, thisArg)
|
|||
|
* @param Boolean thisArg `this` context for callback function
|
|||
|
* @return Void
|
|||
|
*/forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=N(this),i=0;for(;i<r.length;){var a=r[i];let n=a[0],o=a[1];e.call(t,o,n,this),r=N(this),i++;}}/**
|
|||
|
* Overwrite header values given name
|
|||
|
*
|
|||
|
* @param String name Header name
|
|||
|
* @param String value Header value
|
|||
|
* @return Void
|
|||
|
*/set(e,t){e=`${e}`,t=`${t}`,C(e),E(t);let r=A(this[S],e);this[S][void 0!==r?r:e]=[t];}/**
|
|||
|
* Append a value onto existing header
|
|||
|
*
|
|||
|
* @param String name Header name
|
|||
|
* @param String value Header value
|
|||
|
* @return Void
|
|||
|
*/append(e,t){e=`${e}`,t=`${t}`,C(e),E(t);let r=A(this[S],e);void 0!==r?this[S][r].push(t):this[S][e]=[t];}/**
|
|||
|
* Check for header name existence
|
|||
|
*
|
|||
|
* @param String name Header name
|
|||
|
* @return Boolean
|
|||
|
*/has(e){return C(e=`${e}`),void 0!==A(this[S],e);}/**
|
|||
|
* Delete all header values given name
|
|||
|
*
|
|||
|
* @param String name Header name
|
|||
|
* @return Void
|
|||
|
*/delete(e){C(e=`${e}`);let t=A(this[S],e);void 0!==t&&delete this[S][t];}/**
|
|||
|
* Return raw headers (non-spec api)
|
|||
|
*
|
|||
|
* @return Object
|
|||
|
*/raw(){return this[S];}/**
|
|||
|
* Get an iterator on keys.
|
|||
|
*
|
|||
|
* @return Iterator
|
|||
|
*/keys(){return w(this,"key");}/**
|
|||
|
* Get an iterator on values.
|
|||
|
*
|
|||
|
* @return Iterator
|
|||
|
*/values(){return w(this,"value");}/**
|
|||
|
* Get an iterator on entries.
|
|||
|
*
|
|||
|
* This is the default iterator of the Headers object.
|
|||
|
*
|
|||
|
* @return Iterator
|
|||
|
*/[Symbol.iterator](){return w(this,"key+value");}}function N(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value",r=Object.keys(e[S]).sort();return r.map("key"===t?function(e){return e.toLowerCase();}:"value"===t?function(t){return e[S][t].join(", ");}:function(t){return[t.toLowerCase(),e[S][t].join(", ")];});}B.prototype.entries=B.prototype[Symbol.iterator],Object.defineProperty(B.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(B.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});let F=Symbol("internal");function w(e,t){let r=Object.create(P);return r[F]={target:e,kind:t,index:0},r;}let P=Object.setPrototypeOf({next(){// istanbul ignore if
|
|||
|
if(!this||Object.getPrototypeOf(this)!==P)throw TypeError("Value of `this` is not a HeadersIterator");var e=this[F];let t=e.target,r=e.kind,i=e.index,a=N(t,r),n=a.length;return i>=n?{value:void 0,done:!0}:(this[F].index=i+1,{value:a[i],done:!1});}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));/**
|
|||
|
* Export the Headers object in a form that Node.js can consume.
|
|||
|
*
|
|||
|
* @param Headers headers
|
|||
|
* @return Object
|
|||
|
*/function T(e){let t=Object.assign({__proto__:null},e[S]),r=A(e[S],"Host");return void 0!==r&&(t[r]=t[r][0]),t;}/**
|
|||
|
* Create a Headers object from an object of headers, ignoring those that do
|
|||
|
* not conform to HTTP grammar productions.
|
|||
|
*
|
|||
|
* @param Object obj Object of headers
|
|||
|
* @return Headers
|
|||
|
*/function O(e){let t=new B();for(let r of Object.keys(e))if(!b.test(r)){if(Array.isArray(e[r]))for(let i of e[r])v.test(i)||(void 0===t[S][r]?t[S][r]=[i]:t[S][r].push(i));else v.test(e[r])||(t[S][r]=[e[r]]);}return t;}Object.defineProperty(P,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});let R=Symbol("Response internals"),I=$parcel$interopDefault($k14yv$http).STATUS_CODES;/**
|
|||
|
* Response class
|
|||
|
*
|
|||
|
* @param Stream body Readable stream
|
|||
|
* @param Object opts Response options
|
|||
|
* @return Void
|
|||
|
*/class z{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p.call(this,e,t);let r=t.status||200,i=new B(t.headers);if(null!=e&&!i.has("Content-Type")){let t=g(e);t&&i.append("Content-Type",t);}this[R]={url:t.url,status:r,statusText:t.statusText||I[r],headers:i,counter:t.counter};}get url(){return this[R].url||"";}get status(){return this[R].status;}/**
|
|||
|
* Convenience property representing if the request ended normally
|
|||
|
*/get ok(){return this[R].status>=200&&this[R].status<300;}get redirected(){return this[R].counter>0;}get statusText(){return this[R].statusText;}get headers(){return this[R].headers;}/**
|
|||
|
* Clone this response
|
|||
|
*
|
|||
|
* @return Response
|
|||
|
*/clone(){return new z(f(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected});}}p.mixIn(z.prototype),Object.defineProperties(z.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(z.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});let k=Symbol("Request internals"),M=$parcel$interopDefault($k14yv$url).URL||/*@__PURE__*/$parcel$interopDefault(i).URL,q=$parcel$interopDefault($k14yv$url).parse,L=$parcel$interopDefault($k14yv$url).format;/**
|
|||
|
* Wrapper around `new URL` to handle arbitrary URLs
|
|||
|
*
|
|||
|
* @param {string} urlStr
|
|||
|
* @return {void}
|
|||
|
*/function j(e){// Fallback to old implementation for arbitrary URLs
|
|||
|
return /^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(e)&&(e=new M(e).toString()),q(e);}let H=("destroy"in $parcel$interopDefault($k14yv$stream).Readable.prototype);/**
|
|||
|
* Check if a value is an instance of Request.
|
|||
|
*
|
|||
|
* @param Mixed input
|
|||
|
* @return Boolean
|
|||
|
*/function U(e){return"object"==typeof e&&"object"==typeof e[k];}function $(e){let t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!!(t&&"AbortSignal"===t.constructor.name);}/**
|
|||
|
* Request class
|
|||
|
*
|
|||
|
* @param Mixed input Url or Request instance
|
|||
|
* @param Object init Custom options
|
|||
|
* @return Void
|
|||
|
*/class V{constructor(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(e)?t=j(e.url):(// will fall into this branch also (since their `toString()` will return
|
|||
|
// `href` property anyway)
|
|||
|
t=e&&e.href?j(e.href):j(`${e}`),e={});let i=r.method||e.method||"GET";if(i=i.toUpperCase(),(null!=r.body||U(e)&&null!==e.body)&&("GET"===i||"HEAD"===i))throw TypeError("Request with GET/HEAD method cannot have body");let a=null!=r.body?r.body:U(e)&&null!==e.body?f(e):null;p.call(this,a,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});let n=new B(r.headers||e.headers||{});if(null!=a&&!n.has("Content-Type")){let e=g(a);e&&n.append("Content-Type",e);}let o=U(e)?e.signal:null;if("signal"in r&&(o=r.signal),null!=o&&!$(o))throw TypeError("Expected signal to be an instanceof AbortSignal");this[k]={method:i,redirect:r.redirect||e.redirect||"follow",headers:n,parsedURL:t,signal:o},// node-fetch-only options
|
|||
|
this.follow=void 0!==r.follow?r.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===e.compress||e.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent;}get method(){return this[k].method;}get url(){return L(this[k].parsedURL);}get headers(){return this[k].headers;}get redirect(){return this[k].redirect;}get signal(){return this[k].signal;}/**
|
|||
|
* Clone this request
|
|||
|
*
|
|||
|
* @return Request
|
|||
|
*/clone(){return new V(this);}}/**
|
|||
|
* Convert a Request to Node.js http request options.
|
|||
|
*
|
|||
|
* @param Request A Request instance
|
|||
|
* @return Object The options object to be passed to http.request
|
|||
|
*/function K(e){let t=e[k].parsedURL,r=new B(e[k].headers);// Basic fetch
|
|||
|
if(r.has("Accept")||r.set("Accept","*/*"),!t.protocol||!t.hostname)throw TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof $parcel$interopDefault($k14yv$stream).Readable&&!H)throw Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");// HTTP-network-or-cache fetch steps 2.4-2.7
|
|||
|
let i=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(i="0"),null!=e.body){let t=D(e);"number"==typeof t&&(i=String(t));}i&&r.set("Content-Length",i),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let a=e.agent;// HTTP-network fetch step 4.2
|
|||
|
// chunked encoding is handled by Node.js
|
|||
|
return"function"==typeof a&&(a=a(t)),Object.assign({},t,{method:e.method,headers:T(r),agent:a});}/**
|
|||
|
* abort-error.js
|
|||
|
*
|
|||
|
* AbortError interface for cancelled requests
|
|||
|
*/ /**
|
|||
|
* Create AbortError instance
|
|||
|
*
|
|||
|
* @param String message Error message for human
|
|||
|
* @return AbortError
|
|||
|
*/function G(e){Error.call(this,e),this.type="aborted",this.message=e,// hide custom error implementation details from end-users
|
|||
|
Error.captureStackTrace(this,this.constructor);}p.mixIn(V.prototype),Object.defineProperty(V.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(V.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),G.prototype=Object.create(Error.prototype),G.prototype.constructor=G,G.prototype.name="AbortError";let W=$parcel$interopDefault($k14yv$url).URL||/*@__PURE__*/$parcel$interopDefault(i).URL,X=$parcel$interopDefault($k14yv$stream).PassThrough,Y=function(e,t){let r=new W(t).hostname,i=new W(e).hostname;return r===i||"."===r[r.length-i.length-1]&&r.endsWith(i);},Q=function(e,t){let r=new W(t).protocol,i=new W(e).protocol;return r===i;};/**
|
|||
|
* Fetch function
|
|||
|
*
|
|||
|
* @param Mixed url Absolute url or Request instance
|
|||
|
* @param Object opts Fetch options
|
|||
|
* @return Promise
|
|||
|
*/function J(e,t){// allow custom promise
|
|||
|
if(!J.Promise)throw Error("native promise missing, set fetch.Promise to your favorite alternative");// wrap http.request into fetch
|
|||
|
return p.Promise=J.Promise,new J.Promise(function(r,i){let a;// build request object
|
|||
|
let n=new V(e,t),o=K(n),s=("https:"===o.protocol?$parcel$interopDefault($k14yv$https):$parcel$interopDefault($k14yv$http)).request,c=n.signal,l=null,p=function(){let e=new G("The user aborted a request.");i(e),n.body&&n.body instanceof $parcel$interopDefault($k14yv$stream).Readable&&ee(n.body,e),l&&l.body&&l.body.emit("error",e);};if(c&&c.aborted){p();return;}let d=function(){p(),h();},m=s(o);function h(){m.abort(),c&&c.removeEventListener("abort",d),clearTimeout(a);}c&&c.addEventListener("abort",d),n.timeout&&m.once("socket",function(e){a=setTimeout(function(){i(new u(`network timeout at: ${n.url}`,"request-timeout")),h();},n.timeout);}),m.on("error",function(e){i(new u(`request to ${n.url} failed, reason: ${e.message}`,"system",e)),l&&l.body&&ee(l.body,e),h();}),Z(m,function(e){(!c||!c.aborted)&&l&&l.body&&ee(l.body,e);}),14>parseInt(process.version.substring(1))&&// properly handle when the socket close/end events are out of order.
|
|||
|
m.on("socket",function(e){e.addListener("close",function(t){// if a data listener is still present we didn't end cleanly
|
|||
|
let r=e.listenerCount("data")>0;// if end happened before close but the socket didn't emit an error, do it now
|
|||
|
if(l&&r&&!t&&!(c&&c.aborted)){let e=Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",l.body.emit("error",e);}});}),m.on("response",function(e){clearTimeout(a);let t=O(e.headers);// HTTP fetch step 5
|
|||
|
if(J.isRedirect(e.statusCode)){// HTTP fetch step 5.2
|
|||
|
let a=t.get("Location"),o=null;try{o=null===a?null:new W(a,n.url).toString();}catch(e){// error here can only be invalid URL in Location: header
|
|||
|
// do not throw when options.redirect == manual
|
|||
|
// let the user extract the errorneous redirect URL
|
|||
|
if("manual"!==n.redirect){i(new u(`uri requested responds with an invalid redirect URL: ${a}`,"invalid-redirect")),h();return;}}// HTTP fetch step 5.5
|
|||
|
switch(n.redirect){case"error":i(new u(`uri requested responds with a redirect, redirect mode is set to error: ${n.url}`,"no-redirect")),h();return;case"manual":// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
|
|||
|
if(null!==o)try{t.set("Location",o);}catch(e){// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
|
|||
|
i(e);}break;case"follow":// HTTP-redirect fetch step 2
|
|||
|
if(null===o)break;// HTTP-redirect fetch step 5
|
|||
|
if(n.counter>=n.follow){i(new u(`maximum redirect reached at: ${n.url}`,"max-redirect")),h();return;}// HTTP-redirect fetch step 6 (counter increment)
|
|||
|
// Create a new Request object.
|
|||
|
let s={headers:new B(n.headers),follow:n.follow,counter:n.counter+1,agent:n.agent,compress:n.compress,method:n.method,body:n.body,signal:n.signal,timeout:n.timeout,size:n.size};if(!Y(n.url,o)||!Q(n.url,o))for(let e of["authorization","www-authenticate","cookie","cookie2"])s.headers.delete(e);// HTTP-redirect fetch step 9
|
|||
|
if(303!==e.statusCode&&n.body&&null===D(n)){i(new u("Cannot follow redirect with body being a readable stream","unsupported-redirect")),h();return;}(303===e.statusCode||(301===e.statusCode||302===e.statusCode)&&"POST"===n.method)&&(s.method="GET",s.body=void 0,s.headers.delete("content-length")),// HTTP-redirect fetch step 15
|
|||
|
r(J(new V(o,s))),h();return;}}// prepare response
|
|||
|
e.once("end",function(){c&&c.removeEventListener("abort",d);});let o=e.pipe(new X()),s={url:n.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:n.size,timeout:n.timeout,counter:n.counter},p=t.get("Content-Encoding");// HTTP-network fetch step 12.1.1.4: handle content codings
|
|||
|
// in following scenarios we ignore compression support
|
|||
|
// 1. compression support is disabled
|
|||
|
// 2. HEAD request
|
|||
|
// 3. no Content-Encoding header
|
|||
|
// 4. no content response (204)
|
|||
|
// 5. content not modified response (304)
|
|||
|
if(!n.compress||"HEAD"===n.method||null===p||204===e.statusCode||304===e.statusCode){r(l=new z(o,s));return;}// For Node v6+
|
|||
|
// Be less strict when decoding compressed responses, since sometimes
|
|||
|
// servers send slightly invalid responses that are still accepted
|
|||
|
// by common browsers.
|
|||
|
// Always using Z_SYNC_FLUSH is what cURL does.
|
|||
|
let m={flush:$parcel$interopDefault($k14yv$zlib).Z_SYNC_FLUSH,finishFlush:$parcel$interopDefault($k14yv$zlib).Z_SYNC_FLUSH};// for gzip
|
|||
|
if("gzip"==p||"x-gzip"==p){o=o.pipe($parcel$interopDefault($k14yv$zlib).createGunzip(m)),r(l=new z(o,s));return;}// for deflate
|
|||
|
if("deflate"==p||"x-deflate"==p){// handle the infamous raw deflate response from old servers
|
|||
|
// a hack for old IIS and Apache servers
|
|||
|
let t=e.pipe(new X());t.once("data",function(e){o=(15&e[0])==8?o.pipe($parcel$interopDefault($k14yv$zlib).createInflate()):o.pipe($parcel$interopDefault($k14yv$zlib).createInflateRaw()),r(l=new z(o,s));}),t.on("end",function(){l||r(l=new z(o,s));});return;}// for br
|
|||
|
if("br"==p&&"function"==typeof $parcel$interopDefault($k14yv$zlib).createBrotliDecompress){o=o.pipe($parcel$interopDefault($k14yv$zlib).createBrotliDecompress()),r(l=new z(o,s));return;}r(// otherwise, use response as-is
|
|||
|
l=new z(o,s));}),y(m,n);});}function Z(e,t){let r;e.on("socket",function(e){r=e;}),e.on("response",function(e){let i=e.headers;"chunked"!==i["transfer-encoding"]||i["content-length"]||e.once("close",function(e){// tests for socket presence, as in some situations the
|
|||
|
// the 'socket' event is not triggered for the request
|
|||
|
// (happens in deno), avoids `TypeError`
|
|||
|
// if a data listener is still present we didn't end cleanly
|
|||
|
let i=r&&r.listenerCount("data")>0;if(i&&!e){let e=Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",t(e);}});});}function ee(e,t){e.destroy?e.destroy(t):(// node < 8
|
|||
|
e.emit("error",t),e.end());}/**
|
|||
|
* Redirect code matching
|
|||
|
*
|
|||
|
* @param Number code Status code
|
|||
|
* @return Boolean
|
|||
|
*/J.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e;},// expose Promise
|
|||
|
J.Promise=$parcel$global.Promise;var et=J;}),parcelRequire.register("h17jx",function(e,t){$parcel$export(e.exports,"URL",()=>r,e=>r=e),$parcel$export(e.exports,"URLSearchParams",()=>i,e=>i=e),$parcel$export(e.exports,"parseURL",()=>a,e=>a=e),$parcel$export(e.exports,"basicURLParse",()=>n,e=>n=e),$parcel$export(e.exports,"serializeURL",()=>o,e=>o=e),$parcel$export(e.exports,"serializePath",()=>s,e=>s=e),$parcel$export(e.exports,"serializeHost",()=>u,e=>u=e),$parcel$export(e.exports,"serializeInteger",()=>c,e=>c=e),$parcel$export(e.exports,"serializeURLOrigin",()=>l,e=>l=e),$parcel$export(e.exports,"setTheUsername",()=>p,e=>p=e),$parcel$export(e.exports,"setThePassword",()=>d,e=>d=e),$parcel$export(e.exports,"cannotHaveAUsernamePasswordPort",()=>m,e=>m=e),$parcel$export(e.exports,"hasAnOpaquePath",()=>h,e=>h=e),$parcel$export(e.exports,"percentDecodeString",()=>x,e=>x=e),$parcel$export(e.exports,"percentDecodeBytes",()=>f,e=>f=e);var r,i,a,n,o,s,u,c,l,p,d,m,h,x,f,g=parcelRequire("cJXg7"),D=g.URL,y=g.URLSearchParams,b=parcelRequire("jWSo7"),v=parcelRequire("fyHEG");let C={Array:Array,Object:Object,Promise:Promise,String:String,TypeError:TypeError};D.install(C,["Window"]),y.install(C,["Window"]),r=C.URL,i=C.URLSearchParams,a=b.parseURL,n=b.basicURLParse,o=b.serializeURL,s=b.serializePath,u=b.serializeHost,c=b.serializeInteger,l=b.serializeURLOrigin,p=b.setTheUsername,d=b.setThePassword,m=b.cannotHaveAUsernamePasswordPort,h=b.hasAnOpaquePath,x=v.percentDecodeString,f=v.percentDecodeBytes;}),parcelRequire.register("cJXg7",function(e,t){$parcel$export(e.exports,"URL",()=>r,e=>r=e),$parcel$export(e.exports,"URLSearchParams",()=>i,e=>i=e);var r,i,a=parcelRequire("5nBsd"),n=parcelRequire("kjQRQ");r=a,i=n;}),parcelRequire.register("5nBsd",function(e,t){$parcel$export(e.exports,"is",()=>r,e=>r=e),$parcel$export(e.exports,"isImpl",()=>i,e=>i=e),$parcel$export(e.exports,"convert",()=>a,e=>a=e),$parcel$export(e.exports,"create",()=>n,e=>n=e),$parcel$export(e.exports,"setup",()=>u,e=>u=e),$parcel$export(e.exports,"createImpl",()=>o,e=>o=e),$parcel$export(e.exports,"_internalSetup",()=>s,e=>s=e),$parcel$export(e.exports,"new",()=>c,e=>c=e),$parcel$export(e.exports,"install",()=>l,e=>l=e);var r,i,a,n,o,s,u,c,l,p=parcelRequire("2I7mI"),d=parcelRequire("l1V8r");let m=d.implSymbol,h=d.ctorRegistrySymbol,x="URL";function f(e,t){let r;return void 0!==t&&(r=t.prototype),d.isObject(r)||(r=e[h].URL.prototype),Object.create(r);}r=e=>d.isObject(e)&&d.hasOwn(e,m)&&e[m]instanceof D.implementation,i=e=>d.isObject(e)&&e instanceof D.implementation,a=(e,t,{context:i="The provided value"}={})=>{if(r(t))return d.implForWrapper(t);throw new e.TypeError(`${i} is not of type 'URL'.`);},n=(e,t,r)=>{let i=f(e);return u(i,e,t,r);},o=(e,t,r)=>{let i=n(e,t,r);return d.implForWrapper(i);},s=(e,t)=>{},u=(e,t,r=[],i={})=>(i.wrapper=e,s(e,t),Object.defineProperty(e,m,{value:new D.implementation(t,r,i),configurable:!0}),e[m][d.wrapperSymbol]=e,D.init&&D.init(e[m]),e),c=(e,t)=>{let r=f(e,t);return s(r,e),Object.defineProperty(r,m,{value:Object.create(D.implementation.prototype),configurable:!0}),r[m][d.wrapperSymbol]=r,D.init&&D.init(r[m]),r[m];};let g=new Set(["Window","Worker"]);l=(e,t)=>{if(!t.some(e=>g.has(e)))return;let i=d.initCtorRegistry(e);class a{constructor(t){if(arguments.length<1)throw new e.TypeError(`Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`);let r=[];{let t=arguments[0];t=p.USVString(t,{context:"Failed to construct 'URL': parameter 1",globals:e}),r.push(t);}{let t=arguments[1];void 0!==t&&(t=p.USVString(t,{context:"Failed to construct 'URL': parameter 2",globals:e})),r.push(t);}return u(Object.create(new.target.prototype),e,r);}toJSON(){let t=this!==null&&void 0!==this?this:e;if(!r(t))throw new e.TypeError("'toJSON' called on an object that is not a valid instance of URL.");return t[m].toJSON();}get href(){let t=this!==null&&void 0!==this?this:e;if(!r(t))throw new e.TypeError("'get href' called on an object that is not a valid instance of URL.");return t[m].href;}set href(t){let i=this!==null&&void 0!==this?
|
|||
|
function a(e){return(// There are four cases for numbers with fractional part being .5:
|
|||
|
//
|
|||
|
// case | x | floor(x) | round(x) | expected | x <> 0 | x % 1 | x & 1 | example
|
|||
|
// 1 | 2n + 0.5 | 2n | 2n + 1 | 2n | > | 0.5 | 0 | 0.5 -> 0
|
|||
|
// 2 | 2n + 1.5 | 2n + 1 | 2n + 2 | 2n + 2 | > | 0.5 | 1 | 1.5 -> 2
|
|||
|
// 3 | -2n - 0.5 | -2n - 1 | -2n | -2n | < | -0.5 | 0 | -0.5 -> 0
|
|||
|
// 4 | -2n - 1.5 | -2n - 2 | -2n - 1 | -2n - 2 | < | -0.5 | 1 | -1.5 -> -2
|
|||
|
// (where n is a non-negative integer)
|
|||
|
//
|
|||
|
// Branch here for cases 1 and 4
|
|||
|
e>0&&e%1==.5&&(1&e)==0||e<0&&e%1==-.5&&(1&e)==1?u(Math.floor(e)):u(Math.round(e)));}function n(e){return u(Math.trunc(e));}function o(e){return e<0?-1:1;}function s(e,t){// https://tc39.github.io/ecma262/#eqn-modulo
|
|||
|
// Note that http://stackoverflow.com/a/4467559/3191 does NOT work for large modulos
|
|||
|
let r=e%t;return o(t)!==o(r)?r+t:r;}function u(e){return 0===e?0:e;}function c(e,{unsigned:t}){let o,c;t?(o=0,c=2**e-1):(o=-(2**(e-1)),c=2**(e-1)-1);let l=2**e,p=2**(e-1);return(e,d={})=>{let m=i(e,d);if(m=u(m),d.enforceRange){if(!Number.isFinite(m))throw r(TypeError,"is not a finite number",d);if((m=n(m))<o||m>c)throw r(TypeError,`is outside the accepted range of ${o} to ${c}, inclusive`,d);return m;}return!Number.isNaN(m)&&d.clamp?m=a(m=Math.min(Math.max(m,o),c)):Number.isFinite(m)&&0!==m?(m=n(m))>=o&&m<=c?m:(// These will not work great for bitLength of 64, but oh well. See the README for more details.
|
|||
|
m=s(m,l),!t&&m>=p)?m-l:m:0;};}function l(e,{unsigned:t}){let o=Number.MAX_SAFE_INTEGER,s=t?0:Number.MIN_SAFE_INTEGER,c=t?BigInt.asUintN:BigInt.asIntN;return(t,l={})=>{let p=i(t,l);if(p=u(p),l.enforceRange){if(!Number.isFinite(p))throw r(TypeError,"is not a finite number",l);if((p=n(p))<s||p>o)throw r(TypeError,`is outside the accepted range of ${s} to ${o}, inclusive`,l);return p;}if(!Number.isNaN(p)&&l.clamp)return a(p=Math.min(Math.max(p,s),o));if(!Number.isFinite(p)||0===p)return 0;let d=BigInt(n(p));return Number(d=c(e,d));};}e.exports.any=e=>e,e.exports.undefined=()=>{},e.exports.boolean=e=>!!e,e.exports.byte=c(8,{unsigned:!1}),e.exports.octet=c(8,{unsigned:!0}),e.exports.short=c(16,{unsigned:!1}),e.exports["unsigned short"]=c(16,{unsigned:!0}),e.exports.long=c(32,{unsigned:!1}),e.exports["unsigned long"]=c(32,{unsigned:!0}),e.exports["long long"]=l(64,{unsigned:!1}),e.exports["unsigned long long"]=l(64,{unsigned:!0}),e.exports.double=(e,t={})=>{let a=i(e,t);if(!Number.isFinite(a))throw r(TypeError,"is not a finite floating-point value",t);return a;},e.exports["unrestricted double"]=(e,t={})=>{let r=i(e,t);return r;},e.exports.float=(e,t={})=>{let a=i(e,t);if(!Number.isFinite(a))throw r(TypeError,"is not a finite floating-point value",t);if(Object.is(a,-0))return a;let n=Math.fround(a);if(!Number.isFinite(n))throw r(TypeError,"is outside the range of a single-precision floating-point value",t);return n;},e.exports["unrestricted float"]=(e,t={})=>{let r=i(e,t);return isNaN(r)||Object.is(r,-0)?r:Math.fround(r);},e.exports.DOMString=(e,t={})=>{if(t.treatNullAsEmptyString&&null===e)return"";if("symbol"==typeof e)throw r(TypeError,"is a symbol, which cannot be converted to a string",t);let i=t.globals?t.globals.String:String;return i(e);},e.exports.ByteString=(t,i={})=>{let a;let n=e.exports.DOMString(t,i);for(let e=0;void 0!==(a=n.codePointAt(e));++e)if(a>255)throw r(TypeError,"is not a valid ByteString",i);return n;},e.exports.USVString=(t,r={})=>{let i=e.exports.DOMString(t,r),a=i.length,n=[];for(let e=0;e<a;++e){let t=i.charCodeAt(e);if(t<55296||t>57343)n.push(String.fromCodePoint(t));else if(56320<=t&&t<=57343)n.push(String.fromCodePoint(65533));else if(e===a-1)n.push(String.fromCodePoint(65533));else{let r=i.charCodeAt(e+1);if(56320<=r&&r<=57343){let i=1023&t,a=1023&r;n.push(String.fromCodePoint(65536+1024*i+a)),++e;}else n.push(String.fromCodePoint(65533));}}return n.join("");},e.exports.object=(e,t={})=>{if(null===e||"object"!=typeof e&&"function"!=typeof e)throw r(TypeError,"is not an object",t);return e;};let p=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,d="function"==typeof SharedArrayBuffer?Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get:null;function m(e){try{return(// This will throw on SharedArrayBuffers, but not detached ArrayBuffers.
|
|||
|
// (The spec says it should throw, but the spec conflicts with implementations: https://github.com/tc39/ecma262/issues/678)
|
|||
|
p.call(e),!0);}catch{return!1;}}function h(e){try{return d.call(e),!0;}catch{return!1;}}function x(e){try{return(// eslint-disable-next-line no-new
|
|||
|
new Uint8Array(e),!1);}catch{return!0;}}e.exports.ArrayBuffer=(e,t={})=>{if(!m(e)){if(t.allowShared&&!h(e))throw r(TypeError,"is not an ArrayBuffer or SharedArrayBuffer",t);throw r(TypeError,"is not an ArrayBuffer",t);}if(x(e))throw r(TypeError,"is a detached ArrayBuffer",t);return e;};let f=Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get;e.exports.DataView=(e,t={})=>{try{f.call(e);}catch(e){throw r(TypeError,"is not a DataView",t);}if(!t.allowShared&&h(e.buffer))throw r(TypeError,"is backed by a SharedArrayBuffer, which is not allowed",t);if(x(e.buffer))throw r(TypeError,"is backed by a detached ArrayBuffer",t);return e;};// Returns the unforgeable `TypedArray` constructor name or `undefined`,
|
|||
|
// if the `this` value isn't a valid `TypedArray` object.
|
|||
|
//
|
|||
|
// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag
|
|||
|
let g=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array).prototype,Symbol.toStringTag).get;[Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach(t=>{let{name:i}=t,a=/^[AEIOU]/u.test(i)?"an":"a";e.exports[i]=(e,t={})=>{if(!ArrayBuffer.isView(e)||g.call(e)!==i)throw r(TypeError,`is not ${a} ${i} object`,t);if(!t.allowShared&&h(e.buffer))throw r(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",t);if(x(e.buffer))throw r(TypeError,"is a view on a detached ArrayBuffer",t);return e;};}),// Common definitions
|
|||
|
e.exports.ArrayBufferView=(e,t={})=>{if(!ArrayBuffer.isView(e))throw r(TypeError,"is not a view on an ArrayBuffer or SharedArrayBuffer",t);if(!t.allowShared&&h(e.buffer))throw r(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",t);if(x(e.buffer))throw r(TypeError,"is a view on a detached ArrayBuffer",t);return e;},e.exports.BufferSource=(e,t={})=>{if(ArrayBuffer.isView(e)){if(!t.allowShared&&h(e.buffer))throw r(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",t);if(x(e.buffer))throw r(TypeError,"is a view on a detached ArrayBuffer",t);return e;}if(!t.allowShared&&!m(e))throw r(TypeError,"is not an ArrayBuffer or a view on one",t);if(t.allowShared&&!h(e)&&!m(e))throw r(TypeError,"is not an ArrayBuffer, SharedArrayBuffer, or a view on one",t);if(x(e))throw r(TypeError,"is a detached ArrayBuffer",t);return e;},e.exports.DOMTimeStamp=e.exports["unsigned long long"];}),parcelRequire.register("l1V8r",function(e,t){// Returns "Type(value) is Object" in ES terminology.
|
|||
|
function r(e){return"object"==typeof e&&null!==e||"function"==typeof e;}let i=Function.prototype.call.bind(Object.prototype.hasOwnProperty);// Like `Object.assign`, but using `[[GetOwnProperty]]` and `[[DefineOwnProperty]]`
|
|||
|
// instead of `[[Get]]` and `[[Set]]` and only allowing objects
|
|||
|
function a(e,t){for(let r of Reflect.ownKeys(t)){let i=Reflect.getOwnPropertyDescriptor(t,r);if(i&&!Reflect.defineProperty(e,r,i))throw TypeError(`Cannot redefine property: ${String(r)}`);}}function n(e,t){let r=p(e);return Object.defineProperties(Object.create(r["%Object.prototype%"]),Object.getOwnPropertyDescriptors(t));}let o=Symbol("wrapper"),s=Symbol("impl"),u=Symbol("SameObject caches"),c=Symbol.for("[webidl2js] constructor registry"),l=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);function p(e){if(i(e,c))return e[c];let t=Object.create(null);// In addition to registering all the WebIDL2JS-generated types in the constructor registry,
|
|||
|
// we also register a few intrinsics that we make use of in generated code, since they are not
|
|||
|
// easy to grab from the globalObject variable.
|
|||
|
t["%Object.prototype%"]=e.Object.prototype,t["%IteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(new e.Array()[Symbol.iterator]()));try{t["%AsyncIteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(e.eval("(async function* () {})").prototype));}catch{t["%AsyncIteratorPrototype%"]=l;}return e[c]=t,t;}function d(e,t,r){return e[u]||(e[u]=Object.create(null)),t in e[u]||(e[u][t]=r()),e[u][t];}function m(e){return e?e[o]:null;}function h(e){return e?e[s]:null;}function x(e){let t=m(e);return t||e;}function f(e){let t=h(e);return t||e;}let g=Symbol("internal");function D(e){if("string"!=typeof e)return!1;let t=e>>>0;if(t===4294967296-1)return!1;let r=`${t}`;return e===r;}let y=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;function b(e){try{return y.call(e),!0;}catch(e){return!1;}}function v([e,t],r){let i;switch(r){case"key":i=e;break;case"value":i=t;break;case"key+value":i=[e,t];}return{value:i,done:!1};}let C=Symbol("supports property index"),E=Symbol("supported property indices"),A=Symbol("supports property name"),S=Symbol("supported property names"),B=Symbol("indexed property get"),N=Symbol("indexed property set new"),F=Symbol("indexed property set existing"),w=Symbol("named property get"),P=Symbol("named property set new"),T=Symbol("named property set existing"),O=Symbol("named property delete"),R=Symbol("async iterator get the next iteration result"),I=Symbol("async iterator return steps"),z=Symbol("async iterator initialization steps"),k=Symbol("async iterator end of iteration");e.exports={isObject:r,hasOwn:i,define:a,newObjectInRealm:n,wrapperSymbol:o,implSymbol:s,getSameObject:d,ctorRegistrySymbol:c,initCtorRegistry:p,wrapperForImpl:m,implForWrapper:h,tryWrapperForImpl:x,tryImplForWrapper:f,iterInternalSymbol:g,isArrayBuffer:b,isArrayIndexPropName:D,supportsPropertyIndex:C,supportedPropertyIndices:E,supportsPropertyName:A,supportedPropertyNames:S,indexedGet:B,indexedSetNew:N,indexedSetExisting:F,namedGet:w,namedSetNew:P,namedSetExisting:T,namedDelete:O,asyncIteratorNext:R,asyncIteratorReturn:I,asyncIteratorInit:z,asyncIteratorEOI:k,iteratorResult:v};}),parcelRequire.register("brwrt",function(e,t){$parcel$export(e.exports,"implementation",()=>r,e=>r=e);var r,i=parcelRequire("jWSo7"),a=parcelRequire("8aC6h"),n=parcelRequire("kjQRQ");r=class{constructor(e,t){let r=t[0],a=t[1],o=null;if(void 0!==a&&null===(o=i.basicURLParse(a)))throw TypeError(`Invalid base URL: ${a}`);let s=i.basicURLParse(r,{baseURL:o});if(null===s)throw TypeError(`Invalid URL: ${r}`);let u=null!==s.query?s.query:"";this._url=s,// We cannot invoke the "new URLSearchParams object" algorithm without going through the constructor, which strips
|
|||
|
// question mark by default. Therefore the doNotStripQMark hack is used.
|
|||
|
this._query=n.createImpl(e,[u],{doNotStripQMark:!0}),this._query._url=this;}get href(){return i.serializeURL(this._url);}set href(e){let t=i.basicURLParse(e);if(null===t)throw TypeError(`Invalid URL: ${e}`);this._url=t,this._query._list.splice(0);let{query:r}=t;null!==r&&(this._query._list=a.parseUrlencodedString(r));}get origin(){return i.serializeURLOrigin(this._url);}get protocol(){return`${this._url.scheme}:`;}set protocol(e){i.basicURLParse(`${e}:`,{url:this._url,stateOverride:"scheme start"});}get username(){return this._url.username;}set username(e){i.cannotHaveAUsernamePasswordPort(this._url)||i.setTheUsername(this._url,e);}get password(){return this._url.password;}set password(e){i.cannotHaveAUsernamePasswordPort(this._url)||i.setThePassword(this._url,e);}get host(){let e=this._url;return null===e.host?"":null===e.port?i.serializeHost(e.host):`${i.serializeHost(e.host)}:${i.serializeInteger(e.port)}`;}set host(e){i.hasAnOpaquePath(this._url)||i.basicURLParse(e,{url:this._url,stateOverride:"host"});}get hostname(){return null===this._url.host?"":i.serializeHost(this._url.host);}set hostname(e){i.hasAnOpaquePath(this._url)||i.basicURLParse(e,{url:this._url,stateOverride:"hostname"});}get port(){return null===this._url.port?"":i.serializeInteger(this._url.port);}set port(e){i.cannotHaveAUsernamePasswordPort(this._url)||(""===e?this._url.port=null:i.basicURLParse(e,{url:this._url,stateOverride:"port"}));}get pathname(){return i.serializePath(this._url);}set pathname(e){i.hasAnOpaquePath(this._url)||(this._url.path=[],i.basicURLParse(e,{url:this._url,stateOverride:"path start"}));}get search(){return null===this._url.query||""===this._url.query?"":`?${this._url.query}`;}set search(e){let t=this._url;if(""===e){t.query=null,this._query._list=[],this._potentiallyStripTrailingSpacesFromAnOpaquePath();return;}let r="?"===e[0]?e.substring(1):e;t.query="",i.basicURLParse(r,{url:t,stateOverride:"query"}),this._query._list=a.parseUrlencodedString(r);}get searchParams(){return this._query;}get hash(){return null===this._url.fragment||""===this._url.fragment?"":`#${this._url.fragment}`;}set hash(e){if(""===e){this._url.fragment=null,this._potentiallyStripTrailingSpacesFromAnOpaquePath();return;}let t="#"===e[0]?e.substring(1):e;this._url.fragment="",i.basicURLParse(t,{url:this._url,stateOverride:"fragment"});}toJSON(){return this.href;}_potentiallyStripTrailingSpacesFromAnOpaquePath(){i.hasAnOpaquePath(this._url)&&null===this._url.fragment&&null===this._url.query&&(this._url.path=this._url.path.replace(/\u0020+$/u,""));}};}),parcelRequire.register("jWSo7",function(e,t){$parcel$export(e.exports,"serializeURL",()=>r,e=>r=e),$parcel$export(e.exports,"serializePath",()=>i,e=>i=e),$parcel$export(e.exports,"serializeURLOrigin",()=>a,e=>a=e),$parcel$export(e.exports,"parseURL",()=>d,e=>d=e),$parcel$export(e.exports,"basicURLParse",()=>n,e=>n=e),$parcel$export(e.exports,"setTheUsername",()=>o,e=>o=e),$parcel$export(e.exports,"setThePassword",()=>s,e=>s=e),$parcel$export(e.exports,"serializeHost",()=>u,e=>u=e),$parcel$export(e.exports,"cannotHaveAUsernamePasswordPort",()=>c,e=>c=e),$parcel$export(e.exports,"hasAnOpaquePath",()=>l,e=>l=e),$parcel$export(e.exports,"serializeInteger",()=>p,e=>p=e);var r,i,a,n,o,s,u,c,l,p,d,m=parcelRequire("56niv"),h=parcelRequire("edPbH"),x=parcelRequire("gC3SW").utf8DecodeWithoutBOM,f=parcelRequire("fyHEG"),g=f.percentDecodeString,D=f.utf8PercentEncodeCodePoint,y=f.utf8PercentEncodeString,b=f.isC0ControlPercentEncode,v=f.isFragmentPercentEncode,C=f.isQueryPercentEncode,E=f.isSpecialQueryPercentEncode,A=f.isPathPercentEncode,S=f.isUserinfoPercentEncode;function B(e){return e.codePointAt(0);}let N={ftp:21,file:null,http:80,https:443,ws:80,wss:443},F=Symbol("failure");function w(e){return[...e].length;}function P(e,t){let r=e[t];return isNaN(r)?void 0:String.fromCodePoint(r);}function T(e){return"."===e||"%2e"===e.toLowerCase();}function O(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e;}function R(e,t){return h.isASCIIAlpha(e)&&(t===B(":")||t===B("|"));}function I(e){return 2===e
|
|||
|
a>r?i:t);}function J(e){return"number"==typeof e?V(e):e instanceof Array?`[${G(e)}]`:e;}function Z(e,t=!1){let r=m.toASCII(e,{checkBidi:!0,checkHyphens:!1,checkJoiners:!0,useSTD3ASCIIRules:t,verifyDNSLength:t});return null===r||""===r?F:r;}function ee(e){return e.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/ug,"");}function et(e){return e.replace(/\u0009|\u000A|\u000D/ug,"");}function er(e){let{path:t}=e;0!==t.length&&("file"===e.scheme&&1===t.length&&eo(t[0])||t.pop());}function ei(e){return""!==e.username||""!==e.password;}function ea(e){return null===e.host||""===e.host||"file"===e.scheme;}function en(e){return"string"==typeof e.path;}function eo(e){return /^[A-Za-z]:$/u.test(e);}function es(e,t,r,i,a){if(this.pointer=0,this.input=e,this.base=t||null,this.encodingOverride=r||"utf-8",this.stateOverride=a,this.url=i,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null};let e=ee(this.input);e!==this.input&&(this.parseError=!0),this.input=e;}let n=et(this.input);for(n!==this.input&&(this.parseError=!0),this.input=n,this.state=a||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=Array.from(this.input,e=>e.codePointAt(0));this.pointer<=this.input.length;++this.pointer){let e=this.input[this.pointer],t=isNaN(e)?void 0:String.fromCodePoint(e),r=this[`parse ${this.state}`](e,t);if(r){if(r===F){this.failure=!0;break;}}else break;// terminate algorithm
|
|||
|
}}es.prototype["parse scheme start"]=function(e,t){if(h.isASCIIAlpha(e))this.buffer+=t.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,F;this.state="no scheme",--this.pointer;}return!0;},es.prototype["parse scheme"]=function(e,t){if(h.isASCIIAlphanumeric(e)||e===B("+")||e===B("-")||e===B("."))this.buffer+=t.toLowerCase();else if(e===B(":")){if(this.stateOverride&&(L(this.url)&&!q(this.buffer)||!L(this.url)&&q(this.buffer)||(ei(this.url)||null!==this.url.port)&&"file"===this.buffer||"file"===this.url.scheme&&""===this.url.host))return!1;if(this.url.scheme=this.buffer,this.stateOverride)return this.url.port===H(this.url.scheme)&&(this.url.port=null),!1;this.buffer="","file"===this.url.scheme?((this.input[this.pointer+1]!==B("/")||this.input[this.pointer+2]!==B("/"))&&(this.parseError=!0),this.state="file"):L(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":L(this.url)?this.state="special authority slashes":this.input[this.pointer+1]===B("/")?(this.state="path or authority",++this.pointer):(this.url.path="",this.state="opaque path");}else{if(this.stateOverride)return this.parseError=!0,F;this.buffer="",this.state="no scheme",this.pointer=-1;}return!0;},es.prototype["parse no scheme"]=function(e){return null===this.base||en(this.base)&&e!==B("#")?F:(en(this.base)&&e===B("#")?(this.url.scheme=this.base.scheme,this.url.path=this.base.path,this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):("file"===this.base.scheme?this.state="file":this.state="relative",--this.pointer),!0);},es.prototype["parse special relative or authority"]=function(e){return e===B("/")&&this.input[this.pointer+1]===B("/")?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0;},es.prototype["parse path or authority"]=function(e){return e===B("/")?this.state="authority":(this.state="path",--this.pointer),!0;},es.prototype["parse relative"]=function(e){return this.url.scheme=this.base.scheme,e===B("/")?this.state="relative slash":L(this.url)&&e===B("\\")?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,e===B("?")?(this.url.query="",this.state="query"):e===B("#")?(this.url.fragment="",this.state="fragment"):!isNaN(e)&&(this.url.query=null,this.url.path.pop(),this.state="path",--this.pointer)),!0;},es.prototype["parse relative slash"]=function(e){return L(this.url)&&(e===B("/")||e===B("\\"))?(e===B("\\")&&(this.parseError=!0),this.state="special authority ignore slashes"):e===B("/")?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer),!0;},es.prototype["parse special authority slashes"]=function(e){return e===B("/")&&this.input[this.pointer+1]===B("/")?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0;},es.prototype["parse special authority ignore slashes"]=function(e){return e!==B("/")&&e!==B("\\")?(this.state="authority",--this.pointer):this.parseError=!0,!0;},es.prototype["parse authority"]=function(e,t){if(e===B("@")){this.parseError=!0,this.atFlag&&(this.buffer=`%40${this.buffer}`),this.atFlag=!0;// careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars
|
|||
|
let e=w(this.buffer);for(let t=0;t<e;++t){let e=this.buffer.codePointAt(t);if(e===B(":")&&!this.passwordTokenSeenFlag){this.passwordTokenSeenFlag=!0;continue;}let r=D(e,S);this.passwordTokenSeenFlag?this.url.password+=r:this.url.username+=r;}this.buffer="";}else if(isNaN(e)||e===B("/")||e===B("?")||e===B("#")||L(this.url)&&e===B("\\")){if(this.atFlag&&""===this.buffer)return this.parseError=!0,F;this.pointer-=w(this.buffer)+1,this.buffer="",this.state="host";}else this.buffer+=t;return!0;},es.prototype["parse hostname"]=es.prototype["parse host"]=function(e,t){if(this.stateOverride&&"file"===this.url.scheme)--this.pointer,this.state="file host";else if(e!==B(":")||this.arrFlag){if(isNaN(e)||e===B("/")||e===B("?")||e===B("#")||L(this.url)&&e===B("\\")){if(--this.pointer,L(this.url)&&""===this.buffer)return this.parseError=!0,F;if(this.stateOverride&&""===this.buffer&&(ei(this.url)||null!==this.url.port))return this.parseError=!0,!1;let e=W(this.buffer,j(this.url));if(e===F)return F;if(this.url.host=e,this.buffer="",this.state="path start",this.stateOverride)return!1;}else e===B("[")?this.arrFlag=!0:e===B("]")&&(this.arrFlag=!1),this.buffer+=t;}else{if(""===this.buffer)return this.parseError=!0,F;if("hostname"===this.stateOverride)return!1;let e=W(this.buffer,j(this.url));if(e===F)return F;this.url.host=e,this.buffer="",this.state="port";}return!0;},es.prototype["parse port"]=function(e,t){if(h.isASCIIDigit(e))this.buffer+=t;else{if(!(isNaN(e)||e===B("/")||e===B("?")||e===B("#")||L(this.url)&&e===B("\\"))&&!this.stateOverride)return this.parseError=!0,F;if(""!==this.buffer){let e=parseInt(this.buffer);if(e>65535)return this.parseError=!0,F;this.url.port=e===H(this.url.scheme)?null:e,this.buffer="";}if(this.stateOverride)return!1;this.state="path start",--this.pointer;}return!0;};let eu=new Set([B("/"),B("\\"),B("?"),B("#")]);function ec(e,t){let r=e.length-t;return r>=2&&R(e[t],e[t+1])&&(2===r||eu.has(e[t+2]));}function el(e){let t=`${e.scheme}://`;return t+=J(e.host),null!==e.port&&(t+=`:${e.port}`),t;}function ep(e){if(en(e))return e.path;let t="";for(let r of e.path)t+=`/${r}`;return t;}es.prototype["parse file"]=function(e){return this.url.scheme="file",this.url.host="",e===B("/")||e===B("\\")?(e===B("\\")&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,e===B("?")?(this.url.query="",this.state="query"):e===B("#")?(this.url.fragment="",this.state="fragment"):!isNaN(e)&&(this.url.query=null,ec(this.input,this.pointer)?(this.parseError=!0,this.url.path=[]):er(this.url),this.state="path",--this.pointer)):(this.state="path",--this.pointer),!0;},es.prototype["parse file slash"]=function(e){return e===B("/")||e===B("\\")?(e===B("\\")&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(!ec(this.input,this.pointer)&&z(this.base.path[0])&&this.url.path.push(this.base.path[0]),this.url.host=this.base.host),this.state="path",--this.pointer),!0;},es.prototype["parse file host"]=function(e,t){if(isNaN(e)||e===B("/")||e===B("\\")||e===B("?")||e===B("#")){if(--this.pointer,!this.stateOverride&&I(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start";}else{let e=W(this.buffer,j(this.url));if(e===F)return F;if("localhost"===e&&(e=""),this.url.host=e,this.stateOverride)return!1;this.buffer="",this.state="path start";}}else this.buffer+=t;return!0;},es.prototype["parse path start"]=function(e){return L(this.url)?(e===B("\\")&&(this.parseError=!0),this.state="path",e!==B("/")&&e!==B("\\")&&--this.pointer):this.stateOverride||e!==B("?")?this.stateOverride||e!==B("#")?void 0!==e?(this.state="path",e!==B("/")&&--this.pointer):this.stateOverride&&null===this.url.host&&this.url.path.push(""):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0;},es.prototype["parse path"]=function(e){return isNaN(e)||e===B("/")||L(this.url)&&e===B("\\")||!t
|
|||
|
switch(e.scheme){case"blob":try{return a(d(ep(e)));}catch(e){// serializing an opaque origin returns "null"
|
|||
|
return"null";}case"ftp":case"http":case"https":case"ws":case"wss":return el({scheme:e.scheme,host:e.host,port:e.port});default:// The spec says:
|
|||
|
// > Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin.
|
|||
|
// Browsers tested so far:
|
|||
|
// - Chrome says "file://", but treats file: URLs as cross-origin for most (all?) purposes; see e.g.
|
|||
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=37586
|
|||
|
// - Firefox says "null", but treats file: URLs as same-origin sometimes based on directory stuff; see
|
|||
|
// https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs
|
|||
|
return"null";}},n=function(e,t){void 0===t&&(t={});let r=new es(e,t.baseURL,t.encodingOverride,t.url,t.stateOverride);return r.failure?null:r.url;},o=function(e,t){e.username=y(t,S);},s=function(e,t){e.password=y(t,S);},u=J,c=ea,l=en,p=function(e){return String(e);},d=function(e,t){// We don't handle blobs, so this just delegates:
|
|||
|
return void 0===t&&(t={}),n(e,{baseURL:t.baseURL,encodingOverride:t.encodingOverride});};}),parcelRequire.register("56niv",function(e,t){var r=parcelRequire("6HPPK"),i=parcelRequire("f25qZ"),a=parcelRequire("5Iol2"),n=parcelRequire("d3YUo").STATUS_MAPPING;function o(e){return /[^\x00-\x7F]/u.test(e);}function s(e,{useSTD3ASCIIRules:t}){let r=0,i=a.length-1;for(;r<=i;){let o=Math.floor((r+i)/2),s=a[o],u=Array.isArray(s[0])?s[0][0]:s[0],c=Array.isArray(s[0])?s[0][1]:s[0];if(u<=e&&c>=e){if(t&&(s[1]===n.disallowed_STD3_valid||s[1]===n.disallowed_STD3_mapped))return[n.disallowed,...s.slice(2)];if(s[1]===n.disallowed_STD3_valid)return[n.valid,...s.slice(2)];if(s[1]===n.disallowed_STD3_mapped)return[n.mapped,...s.slice(2)];return s.slice(1);}u>e?i=o-1:r=o+1;}return null;}function u(e,{useSTD3ASCIIRules:t,processingOption:r}){let i=!1,a="";for(let o of e){let[e,u]=s(o.codePointAt(0),{useSTD3ASCIIRules:t});switch(e){case n.disallowed:i=!0,a+=o;break;case n.ignored:break;case n.mapped:a+=u;break;case n.deviation:"transitional"===r?a+=u:a+=o;break;case n.valid:a+=o;}}return{string:a,error:i};}function c(e,{checkHyphens:t,checkBidi:r,checkJoiners:a,processingOption:o,useSTD3ASCIIRules:u}){if(e.normalize("NFC")!==e)return!1;let c=Array.from(e);if(t&&("-"===c[2]&&"-"===c[3]||e.startsWith("-")||e.endsWith("-"))||e.includes(".")||c.length>0&&i.combiningMarks.test(c[0]))return!1;for(let e of c){let[t]=s(e.codePointAt(0),{useSTD3ASCIIRules:u});if("transitional"===o&&t!==n.valid||"nontransitional"===o&&t!==n.valid&&t!==n.deviation)return!1;}// https://tools.ietf.org/html/rfc5892#appendix-A
|
|||
|
if(a){let e=0;for(let[t,r]of c.entries())if(""===r||""===r){if(t>0){if(i.combiningClassVirama.test(c[t-1]))continue;if(""===r){// TODO: make this more efficient
|
|||
|
let r=c.indexOf("",t+1),a=r<0?c.slice(e):c.slice(e,r);if(i.validZWNJ.test(a.join(""))){e=t+1;continue;}}}return!1;}}// https://tools.ietf.org/html/rfc5893#section-2
|
|||
|
// For the codePoints length check, see discussion in https://github.com/jsdom/whatwg-url/pull/250 and the second item
|
|||
|
// in https://github.com/whatwg/url/issues/744.
|
|||
|
if(r&&c.length>0){let t;// 1
|
|||
|
if(i.bidiS1LTR.test(c[0]))t=!1;else{if(!i.bidiS1RTL.test(c[0]))return!1;t=!0;}if(t)// 2-4
|
|||
|
{if(!i.bidiS2.test(e)||!i.bidiS3.test(e)||i.bidiS4EN.test(e)&&i.bidiS4AN.test(e))return!1;}else if(!i.bidiS5.test(e)||!i.bidiS6.test(e))return!1;}return!0;}function l(e){let t=e.map(e=>{if(e.startsWith("xn--"))try{return r.decode(e.substring(4));}catch(e){return"";}return e;}).join(".");return i.bidiDomain.test(t);}function p(e,t){let{processingOption:i}=t,{string:a,error:n}=u(e,t);// 2. Normalize.
|
|||
|
a=a.normalize("NFC");// 3. Break.
|
|||
|
let o=a.split("."),s=l(o);// 4. Convert/Validate.
|
|||
|
for(let[e,a]of o.entries()){let u=a,l=i;if(u.startsWith("xn--")){try{u=r.decode(u.substring(4)),o[e]=u;}catch(e){n=!0;continue;}l="nontransitional";}// No need to validate if we already know there is an error.
|
|||
|
if(n)continue;let p=c(u,{...t,processingOption:l,checkBidi:t.checkBidi&&s});p||(n=!0);}return{string:o.join("."),error:n};}function d(e,{checkHyphens:t=!1,checkBidi:i=!1,checkJoiners:a=!1,useSTD3ASCIIRules:n=!1,processingOption:s="nontransitional",verifyDNSLength:u=!1}={}){if("transitional"!==s&&"nontransitional"!==s)throw RangeError("processingOption must be either transitional or nontransitional");let c=p(e,{processingOption:s,checkHyphens:t,checkBidi:i,checkJoiners:a,useSTD3ASCIIRules:n}),l=c.string.split(".");if(l=l.map(e=>{if(o(e))try{return`xn--${r.encode(e)}`;}catch(e){c.error=!0;}return e;}),u){let e=l.join(".").length;(e>253||0===e)&&(c.error=!0);for(let e=0;e<l.length;++e)if(l[e].length>63||0===l[e].length){c.error=!0;break;}}return c.error?null:l.join(".");}function m(e,{checkHyphens:t=!1,checkBidi:r=!1,checkJoiners:i=!1,useSTD3ASCIIRules:a=!1,processingOption:n="nontransitional"}={}){let o=p(e,{processingOption:n,checkHyphens:t,checkBidi:r,checkJoiners:i,useSTD3ASCIIRules:a});return{domain:o.string,error:o.error};}e.exports={toASCII:d,toUnicode:m};}),parcelRequire.register("6HPPK",function(e,t){$parcel$export(e.exports,"decode",()=>b),$parcel$export(e.exports,"encode",()=>v);/** Highest positive signed 32-bit float value */let r=2147483647,i=36,a=1,n=26,o=38,s=700,u=72,c=128,l="-",p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=i-a,m=Math.floor,h=String.fromCharCode;// aka. 0x7FFFFFFF or 2^31-1
|
|||
|
/*--------------------------------------------------------------------------*/ /**
|
|||
|
* A generic error utility function.
|
|||
|
* @private
|
|||
|
* @param {String} type The error type.
|
|||
|
* @returns {Error} Throws a `RangeError` with the applicable error message.
|
|||
|
*/function x(e){throw RangeError(p[e]);}/**
|
|||
|
* Creates an array containing the numeric code points of each Unicode
|
|||
|
* character in the string. While JavaScript uses UCS-2 internally,
|
|||
|
* this function will convert a pair of surrogate halves (each of which
|
|||
|
* UCS-2 exposes as separate characters) into a single code point,
|
|||
|
* matching UTF-16.
|
|||
|
* @see `punycode.ucs2.encode`
|
|||
|
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|||
|
* @memberOf punycode.ucs2
|
|||
|
* @name decode
|
|||
|
* @param {String} string The Unicode input string (UCS-2).
|
|||
|
* @returns {Array} The new array of code points.
|
|||
|
*/function f(e){let t=[],r=0,i=e.length;for(;r<i;){let a=e.charCodeAt(r++);if(a>=55296&&a<=56319&&r<i){// It's a high surrogate, and there is a next character.
|
|||
|
let i=e.charCodeAt(r++);(64512&i)==56320?t.push(((1023&a)<<10)+(1023&i)+65536):(// It's an unmatched surrogate; only append this code unit, in case the
|
|||
|
// next code unit is the high surrogate of a surrogate pair.
|
|||
|
t.push(a),r--);}else t.push(a);}return t;}/**
|
|||
|
* Converts a basic code point into a digit/integer.
|
|||
|
* @see `digitToBasic()`
|
|||
|
* @private
|
|||
|
* @param {Number} codePoint The basic numeric code point value.
|
|||
|
* @returns {Number} The numeric value of a basic code point (for use in
|
|||
|
* representing integers) in the range `0` to `base - 1`, or `base` if
|
|||
|
* the code point does not represent a value.
|
|||
|
*/let g=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:i;},D=function(e,t){// 0..25 map to ASCII a..z or A..Z
|
|||
|
// 26..35 map to ASCII 0..9
|
|||
|
return e+22+75*(e<26)-((0!=t)<<5);},y=function(e,t,r){let a=0;for(e=r?m(e/s):e>>1,e+=m(e/t);e>d*n>>1;a+=i)e=m(e/d);return m(a+(d+1)*e/(e+o));},b=function(e){// Don't use UCS-2.
|
|||
|
let t=[],o=e.length,s=0,p=c,d=u,h=e.lastIndexOf(l);h<0&&(h=0);for(let r=0;r<h;++r)e.charCodeAt(r)>=128&&x("not-basic"),t.push(e.charCodeAt(r));// Main decoding loop: start just after the last delimiter if any basic code
|
|||
|
// points were copied; start at the beginning otherwise.
|
|||
|
for(let u=h>0?h+1:0;u<o;){// `index` is the index of the next character to be consumed.
|
|||
|
// Decode a generalized variable-length integer into `delta`,
|
|||
|
// which gets added to `i`. The overflow checking is easier
|
|||
|
// if we increase `i` as we go, then subtract off its starting
|
|||
|
// value at the end to obtain `delta`.
|
|||
|
let c=s;for(let t=1,c=i;;c+=i){u>=o&&x("invalid-input");let l=g(e.charCodeAt(u++));l>=i&&x("invalid-input"),l>m((r-s)/t)&&x("overflow"),s+=l*t;let p=c<=d?a:c>=d+n?n:c-d;if(l<p)break;let h=i-p;t>m(r/h)&&x("overflow"),t*=h;}let l=t.length+1;d=y(s-c,l,0==c),m(s/l)>r-p&&x("overflow"),p+=m(s/l),s%=l,// Insert `n` at position `i` of the output.
|
|||
|
t.splice(s++,0,p);}return String.fromCodePoint(...t);},v=function(e){let t=[];// Convert the input in UCS-2 to an array of Unicode code points.
|
|||
|
e=f(e);// Cache the length.
|
|||
|
let o=e.length,s=c,p=0,d=u;// Handle the basic code points.
|
|||
|
for(let r of e)r<128&&t.push(h(r));let g=t.length,b=g;// Main encoding loop:
|
|||
|
for(g&&t.push(l);b<o;){// All non-basic code points < n have been handled already. Find the next
|
|||
|
// larger one:
|
|||
|
let o=r;for(let t of e)t>=s&&t<o&&(o=t);// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
|
|||
|
// but guard against overflow.
|
|||
|
let u=b+1;for(let c of(o-s>m((r-p)/u)&&x("overflow"),p+=(o-s)*u,s=o,e))if(c<s&&++p>r&&x("overflow"),c===s){// Represent delta as a generalized variable-length integer.
|
|||
|
let e=p;for(let r=i;;r+=i){let o=r<=d?a:r>=d+n?n:r-d;if(e<o)break;let s=e-o,u=i-o;t.push(h(D(o+s%u,0))),e=m(s/u);}t.push(h(D(e,0))),d=y(p,u,b===g),p=0,++b;}++p,++s;}return t.join("");};}),parcelRequire.register("f25qZ",function(e,t){let r=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10EAB}\u{10EAC}\u{10EFD}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{13440}\u{13447}-\u{13455}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\
|
|||
|
function r(e){return e>=48&&e<=57;}function i(e){return e>=65&&e<=90||e>=97&&e<=122;}function a(e){return i(e)||r(e);}function n(e){return r(e)||e>=65&&e<=70||e>=97&&e<=102;}e.exports={isASCIIDigit:r,isASCIIAlpha:i,isASCIIAlphanumeric:a,isASCIIHex:n};}),parcelRequire.register("gC3SW",function(e,t){let r=new TextEncoder(),i=new TextDecoder("utf-8",{ignoreBOM:!0});function a(e){return r.encode(e);}function n(e){return i.decode(e);}e.exports={utf8Encode:a,utf8DecodeWithoutBOM:n};}),parcelRequire.register("fyHEG",function(e,t){var r=parcelRequire("edPbH").isASCIIHex,i=parcelRequire("gC3SW").utf8Encode;function a(e){return e.codePointAt(0);}// https://url.spec.whatwg.org/#percent-encode
|
|||
|
function n(e){let t=e.toString(16).toUpperCase();return 1===t.length&&(t=`0${t}`),`%${t}`;}// https://url.spec.whatwg.org/#percent-decode
|
|||
|
function o(e){let t=new Uint8Array(e.byteLength),i=0;for(let a=0;a<e.byteLength;++a){let n=e[a];if(37!==n)t[i++]=n;else if(37!==n||r(e[a+1])&&r(e[a+2])){let r=parseInt(String.fromCodePoint(e[a+1],e[a+2]),16);t[i++]=r,a+=2;}else t[i++]=n;}return t.slice(0,i);}// https://url.spec.whatwg.org/#string-percent-decode
|
|||
|
function s(e){let t=i(e);return o(t);}// https://url.spec.whatwg.org/#c0-control-percent-encode-set
|
|||
|
function u(e){return e<=31||e>126;}// https://url.spec.whatwg.org/#fragment-percent-encode-set
|
|||
|
let c=new Set([a(" "),a('"'),a("<"),a(">"),a("`")]);function l(e){return u(e)||c.has(e);}// https://url.spec.whatwg.org/#query-percent-encode-set
|
|||
|
let p=new Set([a(" "),a('"'),a("#"),a("<"),a(">")]);function d(e){return u(e)||p.has(e);}// https://url.spec.whatwg.org/#special-query-percent-encode-set
|
|||
|
function m(e){return d(e)||e===a("'");}// https://url.spec.whatwg.org/#path-percent-encode-set
|
|||
|
let h=new Set([a("?"),a("`"),a("{"),a("}")]);function x(e){return d(e)||h.has(e);}// https://url.spec.whatwg.org/#userinfo-percent-encode-set
|
|||
|
let f=new Set([a("/"),a(":"),a(";"),a("="),a("@"),a("["),a("\\"),a("]"),a("^"),a("|")]);function g(e){return x(e)||f.has(e);}// https://url.spec.whatwg.org/#component-percent-encode-set
|
|||
|
let D=new Set([a("$"),a("%"),a("&"),a("+"),a(",")]);function y(e){return g(e)||D.has(e);}// https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set
|
|||
|
let b=new Set([a("!"),a("'"),a("("),a(")"),a("~")]);function v(e){return y(e)||b.has(e);}// https://url.spec.whatwg.org/#code-point-percent-encode-after-encoding
|
|||
|
// https://url.spec.whatwg.org/#utf-8-percent-encode
|
|||
|
// Assuming encoding is always utf-8 allows us to trim one of the logic branches. TODO: support encoding.
|
|||
|
// The "-Internal" variant here has code points as JS strings. The external version used by other files has code points
|
|||
|
// as JS numbers, like the rest of the codebase.
|
|||
|
function C(e,t){let r=i(e),a="";for(let e of r)t(e)?a+=n(e):a+=String.fromCharCode(e);return a;}function E(e,t){return C(String.fromCodePoint(e),t);}// https://url.spec.whatwg.org/#string-percent-encode-after-encoding
|
|||
|
// https://url.spec.whatwg.org/#string-utf-8-percent-encode
|
|||
|
function A(e,t,r=!1){let i="";for(let a of e)r&&" "===a?i+="+":i+=C(a,t);return i;}e.exports={isC0ControlPercentEncode:u,isFragmentPercentEncode:l,isQueryPercentEncode:d,isSpecialQueryPercentEncode:m,isPathPercentEncode:x,isUserinfoPercentEncode:g,isURLEncodedPercentEncode:v,percentDecodeString:s,percentDecodeBytes:o,utf8PercentEncodeString:A,utf8PercentEncodeCodePoint:E};}),parcelRequire.register("8aC6h",function(e,t){var r=parcelRequire("gC3SW"),i=r.utf8Encode,a=r.utf8DecodeWithoutBOM,n=parcelRequire("fyHEG"),o=n.percentDecodeBytes,s=n.utf8PercentEncodeString,u=n.isURLEncodedPercentEncode;function c(e){return e.codePointAt(0);}// https://url.spec.whatwg.org/#concept-urlencoded-parser
|
|||
|
function l(e){let t=m(e,c("&")),r=[];for(let e of t){let t,i;if(0===e.length)continue;let n=e.indexOf(c("="));n>=0?(t=e.slice(0,n),i=e.slice(n+1)):(t=e,i=new Uint8Array(0)),t=h(t,43,32),i=h(i,43,32);let s=a(o(t)),u=a(o(i));r.push([s,u]);}return r;}// https://url.spec.whatwg.org/#concept-urlencoded-string-parser
|
|||
|
function p(e){return l(i(e));}// https://url.spec.whatwg.org/#concept-urlencoded-serializer
|
|||
|
function d(e,t){let r="utf-8";void 0!==t&&(r=t);let i="";for(let[t,a]of e.entries()){// TODO: handle encoding override
|
|||
|
let e=s(a[0],u,!0),n=a[1];a.length>2&&void 0!==a[2]&&("hidden"===a[2]&&"_charset_"===e?n=r:"file"===a[2]&&(n=n.name)),n=s(n,u,!0),0!==t&&(i+="&"),i+=`${e}=${n}`;}return i;}function m(e,t){let r=[],i=0,a=e.indexOf(t);for(;a>=0;)r.push(e.slice(i,a)),i=a+1,a=e.indexOf(t,i);return i!==e.length&&r.push(e.slice(i)),r;}function h(e,t,r){let i=e.indexOf(t);for(;i>=0;)e[i]=r,i=e.indexOf(t,i+1);return e;}e.exports={parseUrlencodedString:p,serializeUrlencoded:d};}),parcelRequire.register("kjQRQ",function(e,t){$parcel$export(e.exports,"is",()=>r,e=>r=e),$parcel$export(e.exports,"isImpl",()=>i,e=>i=e),$parcel$export(e.exports,"convert",()=>a,e=>a=e),$parcel$export(e.exports,"createDefaultIterator",()=>n,e=>n=e),$parcel$export(e.exports,"create",()=>o,e=>o=e),$parcel$export(e.exports,"setup",()=>c,e=>c=e),$parcel$export(e.exports,"createImpl",()=>s,e=>s=e),$parcel$export(e.exports,"_internalSetup",()=>u,e=>u=e),$parcel$export(e.exports,"new",()=>l,e=>l=e),$parcel$export(e.exports,"install",()=>p,e=>p=e);var r,i,a,n,o,s,u,c,l,p,d=parcelRequire("2I7mI"),m=parcelRequire("l1V8r"),h=parcelRequire("8Lizx");let x=m.newObjectInRealm,f=m.implSymbol,g=m.ctorRegistrySymbol,D="URLSearchParams";function y(e,t){let r;return void 0!==t&&(r=t.prototype),m.isObject(r)||(r=e[g].URLSearchParams.prototype),Object.create(r);}r=e=>m.isObject(e)&&m.hasOwn(e,f)&&e[f]instanceof v.implementation,i=e=>m.isObject(e)&&e instanceof v.implementation,a=(e,t,{context:i="The provided value"}={})=>{if(r(t))return m.implForWrapper(t);throw new e.TypeError(`${i} is not of type 'URLSearchParams'.`);},n=(e,t,r)=>{let i=e[g],a=i["URLSearchParams Iterator"],n=Object.create(a);return Object.defineProperty(n,m.iterInternalSymbol,{value:{target:t,kind:r,index:0},configurable:!0}),n;},o=(e,t,r)=>{let i=y(e);return c(i,e,t,r);},s=(e,t,r)=>{let i=o(e,t,r);return m.implForWrapper(i);},u=(e,t)=>{},c=(e,t,r=[],i={})=>(i.wrapper=e,u(e,t),Object.defineProperty(e,f,{value:new v.implementation(t,r,i),configurable:!0}),e[f][m.wrapperSymbol]=e,v.init&&v.init(e[f]),e),l=(e,t)=>{let r=y(e,t);return u(r,e),Object.defineProperty(r,f,{value:Object.create(v.implementation.prototype),configurable:!0}),r[f][m.wrapperSymbol]=r,v.init&&v.init(r[f]),r[f];};let b=new Set(["Window","Worker"]);p=(e,t)=>{if(!t.some(e=>b.has(e)))return;let i=m.initCtorRegistry(e);class a{constructor(){let t=[];{let r=arguments[0];if(void 0!==r){if(m.isObject(r)){if(void 0!==r[Symbol.iterator]){if(m.isObject(r)){let t=[],i=r;for(let r of i){if(m.isObject(r)){let t=[],i=r;for(let r of i)r=d.USVString(r,{context:"Failed to construct 'URLSearchParams': parameter 1 sequence's element's element",globals:e}),t.push(r);r=t;}else throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");t.push(r);}r=t;}else throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");}else if(m.isObject(r)){let t=Object.create(null);for(let i of Reflect.ownKeys(r)){let a=Object.getOwnPropertyDescriptor(r,i);if(a&&a.enumerable){let a=i;a=d.USVString(a,{context:"Failed to construct 'URLSearchParams': parameter 1 record's key",globals:e});let n=r[i];n=d.USVString(n,{context:"Failed to construct 'URLSearchParams': parameter 1 record's value",globals:e}),t[a]=n;}}r=t;}else throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");}else r=d.USVString(r,{context:"Failed to construct 'URLSearchParams': parameter 1",globals:e});}else r="";t.push(r);}return c(Object.create(new.target.prototype),e,t);}append(t,i){let a=this!==null&&void 0!==this?this:e;if(!r(a))throw new e.TypeError("'append' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new e.TypeError(`Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);let n=[];{let t=arguments[0];t=d.USVString(t,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 1",globals:e}),n.push(t);}{let t=arguments[1];t=d.USVString(t,{context:"Fail
|
|||
|
* Convert encoding of astring with iconv-lite
|
|||
|
*
|
|||
|
* @param {String|Buffer} str String to be converted
|
|||
|
* @param {String} to Encoding to be converted to
|
|||
|
* @param {String} [from='UTF-8'] Encoding to be converted from
|
|||
|
* @return {Buffer} Encoded string
|
|||
|
*/function a(e,t,r){return"UTF-8"===t?i.decode(e,r):"UTF-8"===r?i.encode(e,t):i.encode(i.decode(e,r),t);}/**
|
|||
|
* Converts charset name if needed
|
|||
|
*
|
|||
|
* @param {String} name Character set
|
|||
|
* @return {String} Character set name
|
|||
|
*/function n(e){return(e||"").toString().trim().replace(/^latin[\-_]?(\d+)$/i,"ISO-8859-$1").replace(/^win(?:dows)?[\-_]?(\d+)$/i,"WINDOWS-$1").replace(/^utf[\-_]?(\d+)$/i,"UTF-$1").replace(/^ks_c_5601\-1987$/i,"CP949").replace(/^us[\-_]?ascii$/i,"ASCII").toUpperCase();}r=/**
|
|||
|
* Convert encoding of an UTF-8 string or a buffer
|
|||
|
*
|
|||
|
* @param {String|Buffer} str String to be converted
|
|||
|
* @param {String} to Encoding to be converted to
|
|||
|
* @param {String} [from='UTF-8'] Encoding to be converted from
|
|||
|
* @return {Buffer} Encoded string
|
|||
|
*/function(e,t,r){var i;if(r=n(r||"UTF-8"),t=n(t||"UTF-8"),e=e||"","UTF-8"!==r&&"string"==typeof e&&(e=Buffer.from(e,"binary")),r===t)i="string"==typeof e?Buffer.from(e):e;else try{i=a(e,t,r);}catch(t){console.error(t),i=e;}return"string"==typeof i&&(i=Buffer.from(i,"utf-8")),i;};}),parcelRequire.register("7KhNm",function(e,t){var r,i=parcelRequire("kMt20").Buffer,a=parcelRequire("1PUh6"),n=e.exports;// All codecs and aliases are kept here, keyed by encoding name/alias.
|
|||
|
// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
|
|||
|
n.encodings=null,// Characters emitted in case of error.
|
|||
|
n.defaultCharUnicode="<22>",n.defaultCharSingleByte="?",// Public API.
|
|||
|
n.encode=function(e,t,r){e=""+(e||"");// Ensure string.
|
|||
|
var a=n.getEncoder(t,r),o=a.write(e),s=a.end();return s&&s.length>0?i.concat([o,s]):o;},n.decode=function(e,t,r){"string"==typeof e&&(n.skipDecodeWarning||(console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding"),n.skipDecodeWarning=!0),e=i.from(""+(e||""),"binary"));var a=n.getDecoder(t,r),o=a.write(e),s=a.end();return s?o+s:o;},n.encodingExists=function(e){try{return n.getCodec(e),!0;}catch(e){return!1;}},// Legacy aliases to convert functions
|
|||
|
n.toEncoding=n.encode,n.fromEncoding=n.decode,// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
|
|||
|
n._codecDataCache={},n.getCodec=function(e){n.encodings||(n.encodings=parcelRequire("bloCd"));// Lazy load all encoding definitions.
|
|||
|
for(// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
|
|||
|
var t=n._canonicalizeEncoding(e),r={};;){var i=n._codecDataCache[t];if(i)return i;var a=n.encodings[t];switch(typeof a){case"string":t=a;break;case"object":for(var o in a)r[o]=a[o];r.encodingName||(r.encodingName=t),t=a.type;break;case"function":return r.encodingName||(r.encodingName=t),// The codec function must load all tables and return object with .encoder and .decoder methods.
|
|||
|
// It'll be called only once (for each different options object).
|
|||
|
i=new a(r,n),n._codecDataCache[r.encodingName]=i,i;default:throw Error("Encoding not recognized: '"+e+"' (searched as: '"+t+"')");}}},n._canonicalizeEncoding=function(e){// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
|
|||
|
return(""+e).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g,"");},n.getEncoder=function(e,t){var r=n.getCodec(e),i=new r.encoder(t,r);return r.bomAware&&t&&t.addBOM&&(i=new a.PrependBOM(i,t)),i;},n.getDecoder=function(e,t){var r=n.getCodec(e),i=new r.decoder(t,r);return r.bomAware&&!(t&&!1===t.stripBOM)&&(i=new a.StripBOM(i,t)),i;},// Streaming API
|
|||
|
// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add
|
|||
|
// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default.
|
|||
|
// If you would like to enable it explicitly, please add the following code to your app:
|
|||
|
// > iconv.enableStreamingAPI(require('stream'));
|
|||
|
n.enableStreamingAPI=function(e){if(!n.supportsStreams){// Dependency-inject stream module to create IconvLite stream classes.
|
|||
|
var t=parcelRequire("4uRfH")(e);// Not public API yet, but expose the stream classes.
|
|||
|
n.IconvLiteEncoderStream=t.IconvLiteEncoderStream,n.IconvLiteDecoderStream=t.IconvLiteDecoderStream,// Streaming API.
|
|||
|
n.encodeStream=function(e,t){return new n.IconvLiteEncoderStream(n.getEncoder(e,t),t);},n.decodeStream=function(e,t){return new n.IconvLiteDecoderStream(n.getDecoder(e,t),t);},n.supportsStreams=!0;}};try{r=$5a3aa20b07ad55fd$import$eef889b09a5f4a73;}catch(e){}r&&r.Transform?n.enableStreamingAPI(r):n.encodeStream=n.decodeStream=function(){throw Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");};}),parcelRequire.register("kMt20",function(e,t){var r,i=$k14yv$buffer.Buffer,a={};for(r in $k14yv$buffer)$k14yv$buffer.hasOwnProperty(r)&&"SlowBuffer"!==r&&"Buffer"!==r&&(a[r]=$k14yv$buffer[r]);var n=a.Buffer={};for(r in i)i.hasOwnProperty(r)&&"allocUnsafe"!==r&&"allocUnsafeSlow"!==r&&(n[r]=i[r]);if(a.Buffer.prototype=i.prototype,n.from&&n.from!==Uint8Array.from||(n.from=function(e,t,r){if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return i(e,t,r);}),n.alloc||(n.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2147483648)throw RangeError('The value "'+e+'" is invalid for option "size"');var a=i(e);return t&&0!==t.length?"string"==typeof r?a.fill(t,r):a.fill(t):a.fill(0),a;}),!a.kStringMaxLength)try{a.kStringMaxLength=process.binding("buffer").kStringMaxLength;}catch(e){// we can't determine kStringMaxLength in environments where process.binding
|
|||
|
// is unsupported, so let's not set it
|
|||
|
}!a.constants&&(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),e.exports=a;}),parcelRequire.register("1PUh6",function(e,t){$parcel$export(e.exports,"PrependBOM",()=>r,e=>r=e),$parcel$export(e.exports,"StripBOM",()=>i,e=>i=e);var r,i,a="\uFEFF";function n(e,t){this.encoder=e,this.addBOM=!0;}function o(e,t){this.decoder=e,this.pass=!1,this.options=t||{};}r=n,n.prototype.write=function(e){return this.addBOM&&(e=a+e,this.addBOM=!1),this.encoder.write(e);},n.prototype.end=function(){return this.encoder.end();},i=o,o.prototype.write=function(e){var t=this.decoder.write(e);return this.pass||!t||(t[0]===a&&(t=t.slice(1),"function"==typeof this.options.stripBOM&&this.options.stripBOM()),this.pass=!0),t;},o.prototype.end=function(){return this.decoder.end();};}),parcelRequire.register("bloCd",function(e,t){// Put all encoding/alias/codec definitions to single object and export it.
|
|||
|
for(var r=[parcelRequire("7HwRg"),parcelRequire("hlyUB"),parcelRequire("elrhm"),parcelRequire("4JnNn"),parcelRequire("lJI6V"),parcelRequire("kDWYT"),parcelRequire("8HNKX"),parcelRequire("7Srce"),parcelRequire("876gt")],i=0;i<r.length;i++){var a=r[i];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e.exports[n]=a[n]);}}),parcelRequire.register("7HwRg",function(e,t){var r=parcelRequire("kMt20").Buffer;//------------------------------------------------------------------------------
|
|||
|
function i(e,t){this.enc=e.encodingName,this.bomAware=e.bomAware,"base64"===this.enc?this.encoder=s:"cesu8"===this.enc&&(this.enc="utf8",this.encoder=u,"\uD83D\uDCA9"!==r.from("eda0bdedb2a9","hex").toString()&&(this.decoder=c,this.defaultCharUnicode=t.defaultCharUnicode));}// Export Node.js internal encodings.
|
|||
|
e.exports={// Encodings
|
|||
|
utf8:{type:"_internal",bomAware:!0},cesu8:{type:"_internal",bomAware:!0},unicode11utf8:"utf8",ucs2:{type:"_internal",bomAware:!0},utf16le:"ucs2",binary:{type:"_internal"},base64:{type:"_internal"},hex:{type:"_internal"},// Codec.
|
|||
|
_internal:i},i.prototype.encoder=o,i.prototype.decoder=n;var a=$k14yv$string_decoder.StringDecoder;function n(e,t){this.decoder=new a(t.enc);}//------------------------------------------------------------------------------
|
|||
|
// Encoder is mostly trivial
|
|||
|
function o(e,t){this.enc=t.enc;}//------------------------------------------------------------------------------
|
|||
|
// Except base64 encoder, which must keep its state.
|
|||
|
function s(e,t){this.prevStr="";}//------------------------------------------------------------------------------
|
|||
|
// CESU-8 encoder is also special.
|
|||
|
function u(e,t){}//------------------------------------------------------------------------------
|
|||
|
// CESU-8 decoder is not implemented in Node v4.0+
|
|||
|
function c(e,t){this.acc=0,this.contBytes=0,this.accBytes=0,this.defaultCharUnicode=t.defaultCharUnicode;}a.prototype.end||(a.prototype.end=function(){}),n.prototype.write=function(e){return r.isBuffer(e)||(e=r.from(e)),this.decoder.write(e);},n.prototype.end=function(){return this.decoder.end();},o.prototype.write=function(e){return r.from(e,this.enc);},o.prototype.end=function(){},s.prototype.write=function(e){var t=(e=this.prevStr+e).length-e.length%4;return this.prevStr=e.slice(t),e=e.slice(0,t),r.from(e,"base64");},s.prototype.end=function(){return r.from(this.prevStr,"base64");},u.prototype.write=function(e){for(var t=r.alloc(3*e.length),i=0,a=0;a<e.length;a++){var n=e.charCodeAt(a);n<128?t[i++]=n:(n<2048?t[i++]=192+(n>>>6):(t[i++]=224+(n>>>12),t[i++]=128+(n>>>6&63)),t[i++]=128+(63&n));}return t.slice(0,i);},u.prototype.end=function(){},c.prototype.write=function(e){for(var t=this.acc,r=this.contBytes,i=this.accBytes,a="",n=0;n<e.length;n++){var o=e[n];(192&o)!=128?(r>0&&(a+=this.defaultCharUnicode,r=0),o<128?a+=String.fromCharCode(o):o<224?(t=31&o,r=1,i=1):o<240?(t=15&o,r=2,i=1):a+=this.defaultCharUnicode):r>0?(t=t<<6|63&o,r--,i++,0===r&&(2===i&&t<128&&t>0?a+=this.defaultCharUnicode:3===i&&t<2048?a+=this.defaultCharUnicode:a+=String.fromCharCode(t))):a+=this.defaultCharUnicode;}return this.acc=t,this.contBytes=r,this.accBytes=i,a;},c.prototype.end=function(){var e=0;return this.contBytes>0&&(e+=this.defaultCharUnicode),e;};}),parcelRequire.register("hlyUB",function(e,t){$parcel$export(e.exports,"_utf32",()=>r,e=>r=e),$parcel$export(e.exports,"utf32le",()=>i,e=>i=e),$parcel$export(e.exports,"utf32be",()=>a,e=>a=e),$parcel$export(e.exports,"ucs4le",()=>n,e=>n=e),$parcel$export(e.exports,"ucs4be",()=>o,e=>o=e),$parcel$export(e.exports,"utf32",()=>s,e=>s=e),$parcel$export(e.exports,"ucs4",()=>u,e=>u=e);var r,i,a,n,o,s,u,c=parcelRequire("kMt20").Buffer;function l(e,t){this.iconv=t,this.bomAware=!0,this.isLE=e.isLE;}// -- Encoding
|
|||
|
function p(e,t){this.isLE=t.isLE,this.highSurrogate=0;}// -- Decoding
|
|||
|
function d(e,t){this.isLE=t.isLE,this.badChar=t.iconv.defaultCharUnicode.charCodeAt(0),this.overflow=[];}function m(e,t,r,i){// Ephemeral Planes: Write high surrogate.
|
|||
|
if((r<0||r>1114111)&&(r=i),r>=65536){var a=55296|(r-=65536)>>10;e[t++]=255&a,e[t++]=a>>8;// Low surrogate is written below.
|
|||
|
var r=56320|1023&r;}return(// Write BMP char or low surrogate.
|
|||
|
e[t++]=255&r,e[t++]=r>>8,t);}function h(e,t){this.iconv=t;}// -- Encoding
|
|||
|
function x(e,t){void 0===(e=e||{}).addBOM&&(e.addBOM=!0),this.encoder=t.iconv.getEncoder(e.defaultEncoding||"utf-32le",e);}// -- Decoding
|
|||
|
function f(e,t){this.decoder=null,this.initialBufs=[],this.initialBufsLen=0,this.options=e||{},this.iconv=t.iconv;}function g(e,t){var r=[],i=0,a=0,n=0,o=0,s=0;e:for(var u=0;u<e.length;u++)for(var c=e[u],l=0;l<c.length;l++)if(r.push(c[l]),4===r.length){if(0===i){// Check BOM first.
|
|||
|
if(255===r[0]&&254===r[1]&&0===r[2]&&0===r[3])return"utf-32le";if(0===r[0]&&0===r[1]&&254===r[2]&&255===r[3])return"utf-32be";}if((0!==r[0]||r[1]>16)&&n++,(0!==r[3]||r[2]>16)&&a++,0===r[0]&&0===r[1]&&(0!==r[2]||0!==r[3])&&s++,(0!==r[0]||0!==r[1])&&0===r[2]&&0===r[3]&&o++,r.length=0,++i>=100)break e;}return(// Make decisions.
|
|||
|
s-n>o-a?"utf-32be":s-n<o-a?"utf-32le":t||"utf-32le");}r=l,i={type:"_utf32",isLE:!0},a={type:"_utf32",isLE:!1},n="utf32le",o="utf32be",l.prototype.encoder=p,l.prototype.decoder=d,p.prototype.write=function(e){for(var t=c.from(e,"ucs2"),r=c.alloc(2*t.length),i=this.isLE?r.writeUInt32LE:r.writeUInt32BE,a=0,n=0;n<t.length;n+=2){var o=t.readUInt16LE(n),s=55296<=o&&o<56320,u=56320<=o&&o<57344;if(this.highSurrogate){if(s||!u)// There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low
|
|||
|
// surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character
|
|||
|
// (technically wrong, but expected by some applications, like Windows file names).
|
|||
|
i.call(r,this.highSurrogate,a),a+=4;else{// Create 32-bit value from high and low surrogates;
|
|||
|
var l=(this.highSurrogate-55296<<10|o-56320)+65536;i.call(r,l,a),a+=4,this.highSurrogate=0;continue;}}s?this.highSurrogate=o:(// Even if the current character is a low surrogate, with no previous high surrogate, we'll
|
|||
|
// encode it as a semi-invalid stand-alone character for the same reasons expressed above for
|
|||
|
// unpaired high surrogates.
|
|||
|
i.call(r,o,a),a+=4,this.highSurrogate=0);}return a<r.length&&(r=r.slice(0,a)),r;},p.prototype.end=function(){// Treat any leftover high surrogate as a semi-valid independent character.
|
|||
|
if(this.highSurrogate){var e=c.alloc(4);return this.isLE?e.writeUInt32LE(this.highSurrogate,0):e.writeUInt32BE(this.highSurrogate,0),this.highSurrogate=0,e;}},d.prototype.write=function(e){if(0===e.length)return"";var t=0,r=0,i=c.alloc(e.length+4),a=0,n=this.isLE,o=this.overflow,s=this.badChar;if(o.length>0){for(;t<e.length&&o.length<4;t++)o.push(e[t]);4===o.length&&(r=n?o[t]|o[t+1]<<8|o[t+2]<<16|o[t+3]<<24:o[t+3]|o[t+2]<<8|o[t+1]<<16|o[t]<<24,o.length=0,a=m(i,a,r,s));}// Main loop. Should be as optimized as possible.
|
|||
|
for(;t<e.length-3;t+=4)a=m(i,a,r=n?e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24:e[t+3]|e[t+2]<<8|e[t+1]<<16|e[t]<<24,s);// Keep overflowing bytes.
|
|||
|
for(;t<e.length;t++)o.push(e[t]);return i.slice(0,a).toString("ucs2");},d.prototype.end=function(){this.overflow.length=0;},s=h,u="utf32",h.prototype.encoder=x,h.prototype.decoder=f,x.prototype.write=function(e){return this.encoder.write(e);},x.prototype.end=function(){return this.encoder.end();},f.prototype.write=function(e){if(!this.decoder){if(// Codec is not chosen yet. Accumulate initial bytes.
|
|||
|
this.initialBufs.push(e),this.initialBufsLen+=e.length,this.initialBufsLen<32)return"";// We have enough bytes -> detect endianness.
|
|||
|
var t=g(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);for(var r="",i=0;i<this.initialBufs.length;i++)r+=this.decoder.write(this.initialBufs[i]);return this.initialBufs.length=this.initialBufsLen=0,r;}return this.decoder.write(e);},f.prototype.end=function(){if(!this.decoder){var e=g(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);for(var t="",r=0;r<this.initialBufs.length;r++)t+=this.decoder.write(this.initialBufs[r]);var i=this.decoder.end();return i&&(t+=i),this.initialBufs.length=this.initialBufsLen=0,t;}return this.decoder.end();};}),parcelRequire.register("elrhm",function(e,t){$parcel$export(e.exports,"utf16be",()=>r,e=>r=e),$parcel$export(e.exports,"utf16",()=>i,e=>i=e);var r,i,a=parcelRequire("kMt20").Buffer;function n(){}// -- Encoding
|
|||
|
function o(){}// -- Decoding
|
|||
|
function s(){this.overflowByte=-1;}function u(e,t){this.iconv=t;}// -- Encoding (pass-through)
|
|||
|
function c(e,t){void 0===(e=e||{}).addBOM&&(e.addBOM=!0),this.encoder=t.iconv.getEncoder("utf-16le",e);}// -- Decoding
|
|||
|
function l(e,t){this.decoder=null,this.initialBufs=[],this.initialBufsLen=0,this.options=e||{},this.iconv=t.iconv;}function p(e,t){var r=[],i=0,a=0,n=0;e:for(var o=0;o<e.length;o++)for(var s=e[o],u=0;u<s.length;u++)if(r.push(s[u]),2===r.length){if(0===i){// Check BOM first.
|
|||
|
if(255===r[0]&&254===r[1])return"utf-16le";if(254===r[0]&&255===r[1])return"utf-16be";}if(0===r[0]&&0!==r[1]&&n++,0!==r[0]&&0===r[1]&&a++,r.length=0,++i>=100)break e;}return(// Make decisions.
|
|||
|
// Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon.
|
|||
|
// So, we count ASCII as if it was LE or BE, and decide from that.
|
|||
|
n>a?"utf-16be":n<a?"utf-16le":t||"utf-16le");}r=n,n.prototype.encoder=o,n.prototype.decoder=s,n.prototype.bomAware=!0,o.prototype.write=function(e){for(var t=a.from(e,"ucs2"),r=0;r<t.length;r+=2){var i=t[r];t[r]=t[r+1],t[r+1]=i;}return t;},o.prototype.end=function(){},s.prototype.write=function(e){if(0==e.length)return"";var t=a.alloc(e.length+1),r=0,i=0;for(-1!==this.overflowByte&&(t[0]=e[0],t[1]=this.overflowByte,r=1,i=2);r<e.length-1;r+=2,i+=2)t[i]=e[r+1],t[i+1]=e[r];return this.overflowByte=r==e.length-1?e[e.length-1]:-1,t.slice(0,i).toString("ucs2");},s.prototype.end=function(){this.overflowByte=-1;},i=u,u.prototype.encoder=c,u.prototype.decoder=l,c.prototype.write=function(e){return this.encoder.write(e);},c.prototype.end=function(){return this.encoder.end();},l.prototype.write=function(e){if(!this.decoder){if(// Codec is not chosen yet. Accumulate initial bytes.
|
|||
|
this.initialBufs.push(e),this.initialBufsLen+=e.length,this.initialBufsLen<16)return"";// We have enough bytes -> detect endianness.
|
|||
|
var t=p(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);for(var r="",i=0;i<this.initialBufs.length;i++)r+=this.decoder.write(this.initialBufs[i]);return this.initialBufs.length=this.initialBufsLen=0,r;}return this.decoder.write(e);},l.prototype.end=function(){if(!this.decoder){var e=p(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);for(var t="",r=0;r<this.initialBufs.length;r++)t+=this.decoder.write(this.initialBufs[r]);var i=this.decoder.end();return i&&(t+=i),this.initialBufs.length=this.initialBufsLen=0,t;}return this.decoder.end();};}),parcelRequire.register("4JnNn",function(e,t){$parcel$export(e.exports,"utf7",()=>r,e=>r=e),$parcel$export(e.exports,"unicode11utf7",()=>i,e=>i=e),$parcel$export(e.exports,"utf7imap",()=>a,e=>a=e);var r,i,a,n=parcelRequire("kMt20").Buffer;function o(e,t){this.iconv=t;}r=o,i="utf7",o.prototype.encoder=u,o.prototype.decoder=c,o.prototype.bomAware=!0;// -- Encoding
|
|||
|
var s=/[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;function u(e,t){this.iconv=t.iconv;}// -- Decoding
|
|||
|
function c(e,t){this.iconv=t.iconv,this.inBase64=!1,this.base64Accum="";}u.prototype.write=function(e){// Naive implementation.
|
|||
|
// Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
|
|||
|
return n.from(e.replace(s,function(e){return"+"+("+"===e?"":this.iconv.encode(e,"utf16-be").toString("base64").replace(/=+$/,""))+"-";}.bind(this)));},u.prototype.end=function(){};for(var l=/[A-Za-z0-9\/+]/,p=[],d=0;d<256;d++)p[d]=l.test(String.fromCharCode(d));var m=43,h=45,x=38;function f(e,t){this.iconv=t;}// -- Encoding
|
|||
|
function g(e,t){this.iconv=t.iconv,this.inBase64=!1,this.base64Accum=n.alloc(6),this.base64AccumIdx=0;}// -- Decoding
|
|||
|
function D(e,t){this.iconv=t.iconv,this.inBase64=!1,this.base64Accum="";}c.prototype.write=function(e){// The decoder is more involved as we must handle chunks in stream.
|
|||
|
for(var t="",r=0,i=this.inBase64,a=this.base64Accum,o=0;o<e.length;o++)if(i){if(!p[e[o]]){if(o==r&&e[o]==h)t+="+";else{var s=a+this.iconv.decode(e.slice(r,o),"ascii");t+=this.iconv.decode(n.from(s,"base64"),"utf16-be");}e[o]!=h&&o--,r=o+1,i=!1,a="";}}else e[o]==m&&(t+=this.iconv.decode(e.slice(r,o),"ascii"),r=o+1,i=!0);if(i){var s=a+this.iconv.decode(e.slice(r),"ascii"),u=s.length-s.length%8;a=s.slice(u),s=s.slice(0,u),t+=this.iconv.decode(n.from(s,"base64"),"utf16-be");}else t+=this.iconv.decode(e.slice(r),"ascii");// Write direct chars.
|
|||
|
return this.inBase64=i,this.base64Accum=a,t;},c.prototype.end=function(){var e="";return this.inBase64&&this.base64Accum.length>0&&(e=this.iconv.decode(n.from(this.base64Accum,"base64"),"utf16-be")),this.inBase64=!1,this.base64Accum="",e;},a=f,f.prototype.encoder=g,f.prototype.decoder=D,f.prototype.bomAware=!0,g.prototype.write=function(e){for(var t=this.inBase64,r=this.base64Accum,i=this.base64AccumIdx,a=n.alloc(5*e.length+10),o=0,s=0;s<e.length;s++){var u=e.charCodeAt(s);32<=u&&u<=126?(t&&(i>0&&(o+=a.write(r.slice(0,i).toString("base64").replace(/\//g,",").replace(/=+$/,""),o),i=0),a[o++]=h,t=!1),t||(a[o++]=u,u!==x||(a[o++]=h))):(t||(a[o++]=x,t=!0),t&&(r[i++]=u>>8,r[i++]=255&u,i==r.length&&(o+=a.write(r.toString("base64").replace(/\//g,","),o),i=0)));}return this.inBase64=t,this.base64AccumIdx=i,a.slice(0,o);},g.prototype.end=function(){var e=n.alloc(10),t=0;return this.inBase64&&(this.base64AccumIdx>0&&(t+=e.write(this.base64Accum.slice(0,this.base64AccumIdx).toString("base64").replace(/\//g,",").replace(/=+$/,""),t),this.base64AccumIdx=0),e[t++]=h,this.inBase64=!1),e.slice(0,t);};var y=p.slice();y[",".charCodeAt(0)]=!0,D.prototype.write=function(e){// The decoder is more involved as we must handle chunks in stream.
|
|||
|
// It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).
|
|||
|
for(var t="",r=0,i=this.inBase64,a=this.base64Accum,o=0;o<e.length;o++)if(i){if(!y[e[o]]){if(o==r&&e[o]==h)t+="&";else{var s=a+this.iconv.decode(e.slice(r,o),"ascii").replace(/,/g,"/");t+=this.iconv.decode(n.from(s,"base64"),"utf16-be");}e[o]!=h&&o--,r=o+1,i=!1,a="";}}else e[o]==x&&(t+=this.iconv.decode(e.slice(r,o),"ascii"),r=o+1,i=!0);if(i){var s=a+this.iconv.decode(e.slice(r),"ascii").replace(/,/g,"/"),u=s.length-s.length%8;a=s.slice(u),s=s.slice(0,u),t+=this.iconv.decode(n.from(s,"base64"),"utf16-be");}else t+=this.iconv.decode(e.slice(r),"ascii");// Write direct chars.
|
|||
|
return this.inBase64=i,this.base64Accum=a,t;},D.prototype.end=function(){var e="";return this.inBase64&&this.base64Accum.length>0&&(e=this.iconv.decode(n.from(this.base64Accum,"base64"),"utf16-be")),this.inBase64=!1,this.base64Accum="",e;};}),parcelRequire.register("lJI6V",function(e,t){$parcel$export(e.exports,"_sbcs",()=>r,e=>r=e);var r,i=parcelRequire("kMt20").Buffer;function a(e,t){if(!e)throw Error("SBCS codec is called without the data.");// Prepare char buffer for decoding.
|
|||
|
if(!e.chars||128!==e.chars.length&&256!==e.chars.length)throw Error("Encoding '"+e.type+"' has incorrect 'chars' (must be of len 128 or 256)");if(128===e.chars.length){for(var r="",a=0;a<128;a++)r+=String.fromCharCode(a);e.chars=r+e.chars;}this.decodeBuf=i.from(e.chars,"ucs2");for(var n=i.alloc(65536,t.defaultCharSingleByte.charCodeAt(0)),a=0;a<e.chars.length;a++)n[e.chars.charCodeAt(a)]=a;this.encodeBuf=n;}function n(e,t){this.encodeBuf=t.encodeBuf;}function o(e,t){this.decodeBuf=t.decodeBuf;}r=a,a.prototype.encoder=n,a.prototype.decoder=o,n.prototype.write=function(e){for(var t=i.alloc(e.length),r=0;r<e.length;r++)t[r]=this.encodeBuf[e.charCodeAt(r)];return t;},n.prototype.end=function(){},o.prototype.write=function(e){for(var t=this.decodeBuf,r=i.alloc(2*e.length),a=0,n=0,o=0;o<e.length;o++)a=2*e[o],r[n=2*o]=t[a],r[n+1]=t[a+1];return r.toString("ucs2");},o.prototype.end=function(){};}),parcelRequire.register("kDWYT",function(e,t){// Manually added data to be used by sbcs codec in addition to generated one.
|
|||
|
e.exports={// Not supported by iconv, not sure why.
|
|||
|
10029:"maccenteuro",maccenteuro:{type:"_sbcs",chars:"\xc4Āā\xc9Ą\xd6\xdc\xe1ąČ\xe4čĆć\xe9ŹźĎ\xedďĒēĖ\xf3ė\xf4\xf6\xf5\xfaĚě\xfc†\xb0Ę\xa3\xa7•\xb6\xdf\xae\xa9™ę\xa8≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņŃ\xac√ńŇ∆\xab\xbb…\xa0ňŐ\xd5őŌ–—“”‘’\xf7◊ōŔŕŘ‹›řŖŗŠ‚„šŚś\xc1Ťť\xcdŽžŪ\xd3\xd4ūŮ\xdaůŰűŲų\xdd\xfdķŻŁżĢˇ"},808:"cp808",ibm808:"cp808",cp808:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў\xb0∙\xb7√№€■\xa0"},mik:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№\xa7╗╝┘┌█▄▌▐▀α\xdfΓπΣσ\xb5τΦΘΩδ∞φε∩≡\xb1≥≤⌠⌡\xf7≈\xb0∙\xb7√ⁿ\xb2■\xa0"},cp720:{type:"_sbcs",chars:"\x80\x81\xe9\xe2\x84\xe0\x86\xe7\xea\xeb\xe8\xef\xee\x8d\x8e\x8f\x90ّْ\xf4\xa4ـ\xfb\xf9ءآأؤ\xa3إئابةتثجحخدذرزسشص\xab\xbb░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغف\xb5قكلمنهوىي≡ًٌٍَُِ≈\xb0∙\xb7√ⁿ\xb2■\xa0"},// Aliases of generated encodings.
|
|||
|
ascii8bit:"ascii",usascii:"ascii",ansix34:"ascii",ansix341968:"ascii",ansix341986:"ascii",csascii:"ascii",cp367:"ascii",ibm367:"ascii",isoir6:"ascii",iso646us:"ascii",iso646irv:"ascii",us:"ascii",latin1:"iso88591",latin2:"iso88592",latin3:"iso88593",latin4:"iso88594",latin5:"iso88599",latin6:"iso885910",latin7:"iso885913",latin8:"iso885914",latin9:"iso885915",latin10:"iso885916",csisolatin1:"iso88591",csisolatin2:"iso88592",csisolatin3:"iso88593",csisolatin4:"iso88594",csisolatincyrillic:"iso88595",csisolatinarabic:"iso88596",csisolatingreek:"iso88597",csisolatinhebrew:"iso88598",csisolatin5:"iso88599",csisolatin6:"iso885910",l1:"iso88591",l2:"iso88592",l3:"iso88593",l4:"iso88594",l5:"iso88599",l6:"iso885910",l7:"iso885913",l8:"iso885914",l9:"iso885915",l10:"iso885916",isoir14:"iso646jp",isoir57:"iso646cn",isoir100:"iso88591",isoir101:"iso88592",isoir109:"iso88593",isoir110:"iso88594",isoir144:"iso88595",isoir127:"iso88596",isoir126:"iso88597",isoir138:"iso88598",isoir148:"iso88599",isoir157:"iso885910",isoir166:"tis620",isoir179:"iso885913",isoir199:"iso885914",isoir203:"iso885915",isoir226:"iso885916",cp819:"iso88591",ibm819:"iso88591",cyrillic:"iso88595",arabic:"iso88596",arabic8:"iso88596",ecma114:"iso88596",asmo708:"iso88596",greek:"iso88597",greek8:"iso88597",ecma118:"iso88597",elot928:"iso88597",hebrew:"iso88598",hebrew8:"iso88598",turkish:"iso88599",turkish8:"iso88599",thai:"iso885911",thai8:"iso885911",celtic:"iso885914",celtic8:"iso885914",isoceltic:"iso885914",tis6200:"tis620",tis62025291:"tis620",tis62025330:"tis620",1e4:"macroman",10006:"macgreek",10007:"maccyrillic",10079:"maciceland",10081:"macturkish",cspc8codepage437:"cp437",cspc775baltic:"cp775",cspc850multilingual:"cp850",cspcp852:"cp852",cspc862latinhebrew:"cp862",cpgr:"cp869",msee:"cp1250",mscyrl:"cp1251",msansi:"cp1252",msgreek:"cp1253",msturk:"cp1254",mshebr:"cp1255",msarab:"cp1256",winbaltrim:"cp1257",cp20866:"koi8r",20866:"koi8r",ibm878:"koi8r",cskoi8r:"koi8r",cp21866:"koi8u",21866:"koi8u",ibm1168:"koi8u",strk10482002:"rk1048",tcvn5712:"tcvn",tcvn57121:"tcvn",gb198880:"iso646cn",cn:"iso646cn",csiso14jisc6220ro:"iso646jp",jisc62201969ro:"iso646jp",jp:"iso646jp",cshproman8:"hproman8",r8:"hproman8",roman8:"hproman8",xroman8:"hproman8",ibm1051:"hproman8",mac:"macintosh",csmacintosh:"macintosh"};}),parcelRequire.register("8HNKX",function(e,t){// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script.
|
|||
|
e.exports={437:"cp437",737:"cp737",775:"cp775",850:"cp850",852:"cp852",855:"cp855",856:"cp856",857:"cp857",858:"cp858",860:"cp860",861:"cp861",862:"cp862",863:"cp863",864:"cp864",865:"cp865",866:"cp866",869:"cp869",874:"windows874",922:"cp922",1046:"cp1046",1124:"cp1124",1125:"cp1125",1129:"cp1129",1133:"cp1133",1161:"cp1161",1162:"cp1162",1163:"cp1163",1250:"windows1250",1251:"windows1251",1252:"windows1252",1253:"windows1253",1254:"windows1254",1255:"windows1255",1256:"windows1256",1257:"windows1257",1258:"windows1258",28591:"iso88591",28592:"iso88592",28593:"iso88593",28594:"iso88594",28595:"iso88595",28596:"iso88596",28597:"iso88597",28598:"iso88598",28599:"iso88599",28600:"iso885910",28601:"iso885911",28603:"iso885913",28604:"iso885914",28605:"iso885915",28606:"iso885916",windows874:{type:"_sbcs",chars:"€<><E282AC><EFBFBD><EFBFBD>…<EFBFBD><E280A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>‘’“”•–—<E28093><E28094><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\xa0กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู<E0B8B9><E0B8BA><EFBFBD><EFBFBD>฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛<E0B99A><E0B99B><EFBFBD><EFBFBD>"},win874:"windows874",cp874:"windows874",windows1250:{type:"_sbcs",chars:"€<>‚<EFBFBD>„…†‡<E280A0>‰Š‹ŚŤŽŹ<C5BD>‘’“”•–—<E28093>™š›śťžź\xa0ˇ˘Ł\xa4Ą\xa6\xa7\xa8\xa9Ş\xab\xac\xad\xaeŻ\xb0\xb1˛ł\xb4\xb5\xb6\xb7\xb8ąş\xbbĽ˝ľżŔ\xc1\xc2Ă\xc4ĹĆ\xc7Č\xc9Ę\xcbĚ\xcd\xceĎĐŃŇ\xd3\xd4Ő\xd6\xd7ŘŮ\xdaŰ\xdc\xddŢ\xdfŕ\xe1\xe2ă\xe4ĺć\xe7č\xe9ę\xebě\xed\xeeďđńň\xf3\xf4ő\xf6\xf7řů\xfaű\xfc\xfdţ˙"},win1250:"windows1250",cp1250:"windows1250",windows1251:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—<E28093>™љ›њќћџ\xa0ЎўЈ\xa4Ґ\xa6\xa7Ё\xa9Є\xab\xac\xad\xaeЇ\xb0\xb1Ііґ\xb5\xb6\xb7ё№є\xbbјЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},win1251:"windows1251",cp1251:"windows1251",windows1252:{type:"_sbcs",chars:"€<>‚ƒ„…†‡ˆ‰Š‹Œ<E280B9>Ž<EFBFBD><C5BD>‘’“”•–—˜™š›œ<E280BA>žŸ\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"},win1252:"windows1252",cp1252:"windows1252",windows1253:{type:"_sbcs",chars:"€<>‚ƒ„…†‡<E280A0>‰<EFBFBD>‹<EFBFBD><E280B9><EFBFBD><EFBFBD><EFBFBD>‘’“”•–—<E28093>™<EFBFBD>›<EFBFBD><E280BA><EFBFBD><EFBFBD>\xa0΅Ά\xa3\xa4\xa5\xa6\xa7\xa8\xa9<61>\xab\xac\xad\xae―\xb0\xb1\xb2\xb3΄\xb5\xb6\xb7ΈΉΊ\xbbΌ\xbdΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ<CEA0>ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ<CF8D>"},win1253:"windows1253",cp1253:"windows1253",windows1254:{type:"_sbcs",chars:"€<>‚ƒ„…†‡ˆ‰Š‹Œ<E280B9><C592><EFBFBD><EFBFBD>‘’“”•–—˜™š›œ<E280BA><C593>Ÿ\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcfĞ\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdcİŞ\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xefğ\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfcış\xff"},win1254:"windows1254",cp1254:"windows1254",windows1255:{type:"_sbcs",chars:"€<>‚ƒ„…†‡ˆ‰<CB86>‹<EFBFBD><E280B9><EFBFBD><EFBFBD><EFBFBD>‘’“”•–—˜™<CB9C>›<EFBFBD><E280BA><EFBFBD><EFBFBD>\xa0\xa1\xa2\xa3₪\xa5\xa6\xa7\xa8\xa9\xd7\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xf7\xbb\xbc\xbd\xbe\xbfְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״<D7B3><D7B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>אבגדהוזחטיךכלםמןנסעףפץצקרשת<D7A9><D7AA><E2808E>"},win1255:"windows1255",cp1255:"windows1255",windows1256:{type:"_sbcs",chars:"€پ‚ƒ„…†‡ˆ‰ٹ‹Œچ<EFBFBD>
|
|||
|
function p(e,t){if(this.encodingName=e.encodingName,!e)throw Error("DBCS codec is called without the data.");if(!e.table)throw Error("Encoding '"+this.encodingName+"' has no data.");// Load tables.
|
|||
|
var r=e.table();// Decode tables: MBCS -> Unicode.
|
|||
|
// decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256.
|
|||
|
// Trie root is decodeTables[0].
|
|||
|
// Values: >= 0 -> unicode character code. can be > 0xFFFF
|
|||
|
// == UNASSIGNED -> unknown/unassigned sequence.
|
|||
|
// == GB18030_CODE -> this is the end of a GB18030 4-byte sequence.
|
|||
|
// <= NODE_START -> index of the next node in our trie to process next byte.
|
|||
|
// <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq.
|
|||
|
this.decodeTables=[],this.decodeTables[0]=u.slice(0),// Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here.
|
|||
|
this.decodeTableSeq=[];// Actual mapping tables consist of chunks. Use them to fill up decode tables.
|
|||
|
for(var i=0;i<r.length;i++)this._addDecodeChunk(r[i]);// Load & create GB18030 tables when needed.
|
|||
|
if("function"==typeof e.gb18030){this.gb18030=e.gb18030();// Load GB18030 ranges.
|
|||
|
// Add GB18030 common decode nodes.
|
|||
|
var o=this.decodeTables.length;this.decodeTables.push(u.slice(0));var c=this.decodeTables.length;this.decodeTables.push(u.slice(0));for(var l=this.decodeTables[0],i=129;i<=254;i++)for(var p=this.decodeTables[s-l[i]],d=48;d<=57;d++){if(p[d]===a)p[d]=s-o;else if(p[d]>s)throw Error("gb18030 decode tables conflict at byte 2");for(var m=this.decodeTables[s-p[d]],h=129;h<=254;h++){if(m[h]===a)m[h]=s-c;else if(m[h]===s-c)continue;else if(m[h]>s)throw Error("gb18030 decode tables conflict at byte 3");for(var x=this.decodeTables[s-m[h]],f=48;f<=57;f++)x[f]===a&&(x[f]=n);}}}this.defaultCharUnicode=t.defaultCharUnicode,// Encode tables: Unicode -> DBCS.
|
|||
|
// `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance.
|
|||
|
// Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null.
|
|||
|
// Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.).
|
|||
|
// == UNASSIGNED -> no conversion found. Output a default char.
|
|||
|
// <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence.
|
|||
|
this.encodeTable=[],// `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of
|
|||
|
// objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key
|
|||
|
// means end of sequence (needed when one sequence is a strict subsequence of another).
|
|||
|
// Objects are kept separately from encodeTable to increase performance.
|
|||
|
this.encodeTableSeq=[];// Some chars can be decoded, but need not be encoded.
|
|||
|
var g={};if(e.encodeSkipVals)for(var i=0;i<e.encodeSkipVals.length;i++){var D=e.encodeSkipVals[i];if("number"==typeof D)g[D]=!0;else for(var d=D.from;d<=D.to;d++)g[d]=!0;}// Add more encoding pairs when needed.
|
|||
|
if(// Use decode trie to recursively fill out encode tables.
|
|||
|
this._fillEncodeTable(0,0,g),e.encodeAdd)for(var y in e.encodeAdd)Object.prototype.hasOwnProperty.call(e.encodeAdd,y)&&this._setEncodeChar(y.charCodeAt(0),e.encodeAdd[y]);this.defCharSB=this.encodeTable[0][t.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===a&&(this.defCharSB=this.encodeTable[0]["?"]),this.defCharSB===a&&(this.defCharSB=63);}// == Encoder ==================================================================
|
|||
|
function d(e,t){// Encoder state
|
|||
|
this.leadSurrogate=-1,this.seqObj=void 0,// Static data
|
|||
|
this.encodeTable=t.encodeTable,this.encodeTableSeq=t.encodeTableSeq,this.defaultCharSingleByte=t.defCharSB,this.gb18030=t.gb18030;}// == Decoder ==================================================================
|
|||
|
function m(e,t){// Decoder state
|
|||
|
this.nodeIdx=0,this.prevBytes=[],// Static data
|
|||
|
this.decodeTables=t.decodeTables,this.decodeTableSeq=t.decodeTableSeq,this.defaultCharUnicode=t.defaultCharUnicode,this.gb18030=t.gb18030;}// Binary search for GB18030. Returns largest i such that table[i] <= val.
|
|||
|
function h(e,t){if(e[0]>t)return-1;for(var r=0,i=e.length;r<i-1;){var a=r+(i-r+1>>1);e[a]<=t?r=a:i=a;}return r;}p.prototype.encoder=d,p.prototype.decoder=m,// Decoder helpers
|
|||
|
p.prototype._getDecodeTrieNode=function(e){for(var t=[];e>0;e>>>=8)t.push(255&e);0==t.length&&t.push(0);for(var r=this.decodeTables[0],i=t.length-1;i>0;i--){var n=r[t[i]];if(n==a)r[t[i]]=s-this.decodeTables.length,this.decodeTables.push(r=u.slice(0));else if(n<=s)r=this.decodeTables[s-n];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+e.toString(16));}return r;},p.prototype._addDecodeChunk=function(e){// First element of chunk is the hex mbcs code where we start.
|
|||
|
var t=parseInt(e[0],16),r=this._getDecodeTrieNode(t);t&=255;// Write all other elements of the chunk to the table.
|
|||
|
for(var i=1;i<e.length;i++){var a=e[i];if("string"==typeof a)for(var n=0;n<a.length;){var s=a.charCodeAt(n++);if(55296<=s&&s<56320){var u=a.charCodeAt(n++);if(56320<=u&&u<57344)r[t++]=65536+(s-55296)*1024+(u-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+e[0]);}else if(4080<s&&s<=4095){for(var c=4095-s+2,l=[],p=0;p<c;p++)l.push(a.charCodeAt(n++));// Simple variation: don't support surrogates or subsequences in seq.
|
|||
|
r[t++]=o-this.decodeTableSeq.length,this.decodeTableSeq.push(l);}else r[t++]=s;// Basic char
|
|||
|
}else if("number"==typeof a)for(var d=r[t-1]+1,n=0;n<a;n++)r[t++]=d++;else throw Error("Incorrect type '"+typeof a+"' given in "+this.encodingName+" at chunk "+e[0]);}if(t>255)throw Error("Incorrect chunk in "+this.encodingName+" at addr "+e[0]+": too long"+t);},// Encoder helpers
|
|||
|
p.prototype._getEncodeBucket=function(e){var t=e>>8;// This could be > 0xFF because of astral characters.
|
|||
|
return void 0===this.encodeTable[t]&&(this.encodeTable[t]=u.slice(0)),this.encodeTable[t];},p.prototype._setEncodeChar=function(e,t){var r=this._getEncodeBucket(e),i=255&e;r[i]<=o?this.encodeTableSeq[o-r[i]][c]=t:r[i]==a&&(r[i]=t);},p.prototype._setEncodeSequence=function(e,t){// Get the root of character tree according to first character of the sequence.
|
|||
|
var r,i=e[0],n=this._getEncodeBucket(i),s=255&i;n[s]<=o?r=this.encodeTableSeq[o-n[s]]:(// There was no sequence object - allocate a new one.
|
|||
|
r={},n[s]!==a&&(r[c]=n[s]),n[s]=o-this.encodeTableSeq.length,this.encodeTableSeq.push(r));// Traverse the character tree, allocating new nodes as needed.
|
|||
|
for(var u=1;u<e.length-1;u++){var l=r[i];"object"==typeof l?r=l:(r=r[i]={},void 0!==l&&(r[c]=l));}r[// Set the leaf to given dbcsCode.
|
|||
|
i=e[e.length-1]]=t;},p.prototype._fillEncodeTable=function(e,t,r){for(var i=this.decodeTables[e],a=!1,n={},u=0;u<256;u++){var c=i[u],l=t+u;if(!r[l]){if(c>=0)this._setEncodeChar(c,l),a=!0;else if(c<=s){var p=s-c;if(!n[p]){var d=l<<8>>>0;// NOTE: '>>> 0' keeps 32-bit num positive.
|
|||
|
this._fillEncodeTable(p,d,r)?a=!0:n[p]=!0;}}else c<=o&&(this._setEncodeSequence(this.decodeTableSeq[o-c],l),a=!0);}}return a;},d.prototype.write=function(e){for(var t=i.alloc(e.length*(this.gb18030?4:3)),r=this.leadSurrogate,n=this.seqObj,s=-1,u=0,l=0;;){// 0. Get next character.
|
|||
|
if(-1===s){if(u==e.length)break;var p=e.charCodeAt(u++);}else{var p=s;s=-1;}// 1. Handle surrogates.
|
|||
|
if(55296<=p&&p<57344){if(p<56320){if(-1===r){r=p;continue;}r=p,// Double lead surrogate found.
|
|||
|
p=a;}else-1!==r?(p=65536+(r-55296)*1024+(p-56320),r=-1):p=a;}else-1!==r&&(// Incomplete surrogate pair - only lead surrogate found.
|
|||
|
s=p,p=a,r=-1);// 2. Convert uCode character.
|
|||
|
var d=a;if(void 0!==n&&p!=a){var m=n[p];if("object"==typeof m){n=m;continue;}"number"==typeof m?d=m:void 0==m&&void 0!==(// Try default character for this sequence
|
|||
|
m=n[c])&&(d=m,s=p),n=void 0;}else if(p>=0){var x=this.encodeTable[p>>8];if(void 0!==x&&(d=x[255&p]),d<=o){n=this.encodeTableSeq[o-d];continue;}if(d==a&&this.gb18030){// Use GB18030 algorithm to find character(s) to write.
|
|||
|
var f=h(this.gb18030.uChars,p);if(-1!=f){var d=this.gb18030.gbChars[f]+(p-this.gb18030.uChars[f]);t[l++]=129+Math.floor(d/12600),d%=12600,t[l++]=48+Math.floor(d/1260),d%=1260,t[l++]=129+Math.floor(d/10),d%=10,t[l++]=48+d;continue;}}}d===a&&(d=this.defaultCharSingleByte),d<256?t[l++]=d:(d<65536?t[l++]=d>>8:d<16777216?(t[l++]=d>>16,t[l++]=d>>8&255):(t[l++]=d>>>24,t[l++]=d>>>16&255,t[l++]=d>>>8&255),t[l++]=255&d);}return this.seqObj=n,this.leadSurrogate=r,t.slice(0,l);},d.prototype.end=function(){if(-1!==this.leadSurrogate||void 0!==this.seqObj){var e=i.alloc(10),t=0;if(this.seqObj){var r=this.seqObj[c];void 0!==r&&(r<256?e[t++]=r:(e[t++]=r>>8,e[t++]=255&r)),this.seqObj=void 0;}return-1!==this.leadSurrogate&&(// Incomplete surrogate pair - only lead surrogate found.
|
|||
|
e[t++]=this.defaultCharSingleByte,this.leadSurrogate=-1),e.slice(0,t);}// All clean. Most often case.
|
|||
|
},// Export for testing
|
|||
|
d.prototype.findIdx=h,m.prototype.write=function(e){for(var t,r=i.alloc(2*e.length),u=this.nodeIdx,c=this.prevBytes,l=this.prevBytes.length,p=-this.prevBytes.length,d=0,m=0;d<e.length;d++){var x=d>=0?e[d]:c[d+l],t=this.decodeTables[u][x];if(t>=0);else if(t===a)// TODO: Callback with seq.
|
|||
|
t=this.defaultCharUnicode.charCodeAt(0),d=p;else if(t===n){if(d>=3)var f=(e[d-3]-129)*12600+(e[d-2]-48)*1260+(e[d-1]-129)*10+(x-48);else var f=(c[d-3+l]-129)*12600+((d-2>=0?e[d-2]:c[d-2+l])-48)*1260+((d-1>=0?e[d-1]:c[d-1+l])-129)*10+(x-48);var g=h(this.gb18030.gbChars,f);t=this.gb18030.uChars[g]+f-this.gb18030.gbChars[g];}else if(t<=s){u=s-t;continue;}else if(t<=o){for(var D=this.decodeTableSeq[o-t],y=0;y<D.length-1;y++)t=D[y],r[m++]=255&t,r[m++]=t>>8;t=D[D.length-1];}else throw Error("iconv-lite internal error: invalid decoding table value "+t+" at "+u+"/"+x);// Write the character to buffer, handling higher planes using surrogate pair.
|
|||
|
if(t>=65536){var b=55296|(t-=65536)>>10;r[m++]=255&b,r[m++]=b>>8,t=56320|1023&t;}r[m++]=255&t,r[m++]=t>>8,// Reset trie node.
|
|||
|
u=0,p=d+1;}return this.nodeIdx=u,this.prevBytes=p>=0?Array.prototype.slice.call(e,p):c.slice(p+l).concat(Array.prototype.slice.call(e)),r.slice(0,m).toString("ucs2");},m.prototype.end=function(){// Try to parse all remaining chars.
|
|||
|
for(var e="";this.prevBytes.length>0;){// Skip 1 character in the buffer.
|
|||
|
e+=this.defaultCharUnicode;var t=this.prevBytes.slice(1);// Parse remaining as usual.
|
|||
|
this.prevBytes=[],this.nodeIdx=0,t.length>0&&(e+=this.write(t));}return this.prevBytes=[],this.nodeIdx=0,e;};}),parcelRequire.register("876gt",function(e,t){// Description of supported double byte encodings and aliases.
|
|||
|
// Tables are not require()-d until they are needed to speed up library load.
|
|||
|
// require()-s are direct to support Browserify.
|
|||
|
e.exports={// == Japanese/ShiftJIS ====================================================
|
|||
|
// All japanese encodings are based on JIS X set of standards:
|
|||
|
// JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
|
|||
|
// JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes.
|
|||
|
// Has several variations in 1978, 1983, 1990 and 1997.
|
|||
|
// JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
|
|||
|
// JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.
|
|||
|
// 2 planes, first is superset of 0208, second - revised 0212.
|
|||
|
// Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)
|
|||
|
// Byte encodings are:
|
|||
|
// * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte
|
|||
|
// encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.
|
|||
|
// Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.
|
|||
|
// * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes.
|
|||
|
// 0x00-0x7F - lower part of 0201
|
|||
|
// 0x8E, 0xA1-0xDF - upper part of 0201
|
|||
|
// (0xA1-0xFE)x2 - 0208 plane (94x94).
|
|||
|
// 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).
|
|||
|
// * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
|
|||
|
// Used as-is in ISO2022 family.
|
|||
|
// * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII,
|
|||
|
// 0201-1976 Roman, 0208-1978, 0208-1983.
|
|||
|
// * ISO2022-JP-1: Adds esc seq for 0212-1990.
|
|||
|
// * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.
|
|||
|
// * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.
|
|||
|
// * ISO2022-JP-2004: Adds 0213-2004 Plane 1.
|
|||
|
//
|
|||
|
// After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.
|
|||
|
//
|
|||
|
// Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html
|
|||
|
shiftjis:{type:"_dbcs",table:function(){return parcelRequire("diqjQ");},encodeAdd:{"\xa5":92,"‾":126},encodeSkipVals:[{from:60736,to:63808}]},csshiftjis:"shiftjis",mskanji:"shiftjis",sjis:"shiftjis",windows31j:"shiftjis",ms31j:"shiftjis",xsjis:"shiftjis",windows932:"shiftjis",ms932:"shiftjis",932:"shiftjis",cp932:"shiftjis",eucjp:{type:"_dbcs",table:function(){return parcelRequire("5gTgZ");},encodeAdd:{"\xa5":92,"‾":126}},// TODO: KDDI extension to Shift_JIS
|
|||
|
// TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.
|
|||
|
// TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.
|
|||
|
// == Chinese/GBK ==========================================================
|
|||
|
// http://en.wikipedia.org/wiki/GBK
|
|||
|
// We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder
|
|||
|
// Oldest GB2312 (1981, ~7600 chars) is a subset of CP936
|
|||
|
gb2312:"cp936",gb231280:"cp936",gb23121980:"cp936",csgb2312:"cp936",csiso58gb231280:"cp936",euccn:"cp936",// Microsoft's CP936 is a subset and approximation of GBK.
|
|||
|
windows936:"cp936",ms936:"cp936",936:"cp936",cp936:{type:"_dbcs",table:function(){return parcelRequire("dVSrc");}},// GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
|
|||
|
gbk:{type:"_dbcs",table:function(){return parcelRequire("dVSrc").concat(parcelRequire("88svc"));}},xgbk:"gbk",isoir58:"gbk",// GB18030 is an algorithmic extension of GBK.
|
|||
|
// Main source: https://www.w3.org/TR/encoding/#gbk-encoder
|
|||
|
// http://icu-project.org/docs/papers/gb18030.html
|
|||
|
// http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
|
|||
|
// http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
|
|||
|
gb18030:{type:"_dbcs",table:function(){return parcelRequire("dVSrc").concat(parcelRequire("88svc"));},gb18030:function(){return parcelRequire("laZJN");},encodeSkipVals:[128],encodeAdd:{"€":41699}},chinese:"gb18030",// == Korean ===============================================================
|
|||
|
// EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.
|
|||
|
windows949:"cp949",ms949:"cp949",949:"cp949",cp949:{type:"_dbcs",table:function(){return parcelRequire("hJRIO");}},cseuckr:"cp949",csksc56011987:"cp949",euckr:"cp949",isoir149:"cp949",korean:"cp949",ksc56011987:"cp949",ksc56011989:"cp949",ksc5601:"cp949",// == Big5/Taiwan/Hong Kong ================================================
|
|||
|
// There are lots of tables for Big5 and cp950. Please see the following links for history:
|
|||
|
// http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html
|
|||
|
// Variations, in roughly number of defined chars:
|
|||
|
// * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
|
|||
|
// * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/
|
|||
|
// * Big5-2003 (Taiwan standard) almost superset of cp950.
|
|||
|
// * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
|
|||
|
// * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard.
|
|||
|
// many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
|
|||
|
// Plus, it has 4 combining sequences.
|
|||
|
// Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299
|
|||
|
// because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.
|
|||
|
// Implementations are not consistent within browsers; sometimes labeled as just big5.
|
|||
|
// MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.
|
|||
|
// Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31
|
|||
|
// In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.
|
|||
|
// Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
|
|||
|
// http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
|
|||
|
//
|
|||
|
// Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
|
|||
|
// Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
|
|||
|
windows950:"cp950",ms950:"cp950",950:"cp950",cp950:{type:"_dbcs",table:function(){return parcelRequire("hOXqG");}},// Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
|
|||
|
big5:"big5hkscs",big5hkscs:{type:"_dbcs",table:function(){return parcelRequire("hOXqG").concat(parcelRequire("69fl6"));},encodeSkipVals:[// Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of
|
|||
|
// https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU.
|
|||
|
// But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter.
|
|||
|
36457,36463,36478,36523,36532,36557,36560,36695,36713,36718,36811,36862,36973,36986,37060,37084,37105,37311,37551,37552,37553,37554,37585,37959,38090,38361,38652,39285,39798,39800,39803,39878,39902,39916,39926,40002,40019,40034,40040,40043,40055,40124,40125,40144,40279,40282,40388,40431,40443,40617,40687,40701,40800,40907,41079,41180,41183,36812,37576,38468,38637,// Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345
|
|||
|
41636,41637,41639,41638,41676,41678]},cnbig5:"big5hkscs",csbig5:"big5hkscs",xxbig5:"big5hkscs"};}),parcelRequire.register("diqjQ",function(e,t){e.exports=JSON.parse('[["0","\\u0000",128],["a1","。",62],["8140"," 、。,.・:;?!゛゜\xb4`\xa8^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-\xb1\xd7"],["8180","\xf7=≠<>≦≧∞∴♂♀\xb0′″℃¥$¢£%#&*@\xa7☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"],["81b8","∈∋⊆⊇⊂⊃∪∩"],["81c8","∧∨¬⇒⇔∀∃"],["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["81f0","ʼn♯♭♪†‡\xb6"],["81fc","◯"],["824f","0",9],["8260","A",25],["8281","a",25],["829f","ぁ",82],["8340","ァ",62],["8380","ム",22],["839f","Α",16,"Σ",6],["83bf","α",16,"σ",6],["8440","А",5,"ЁЖ",25],["8470","а",5,"ёж",7],["8480","о",17],["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["8740","①",19,"Ⅰ",9],["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["877e","㍻"],["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"],["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"],["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"],["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"],["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿<EFBFBD>
|
|||
|
// we opt to dependency-inject it instead of creating a hard dependency.
|
|||
|
e.exports=function(e){var t=e.Transform;// == Encoder stream =======================================================
|
|||
|
function i(e,r){this.conv=e,(r=r||{}).decodeStrings=!1,t.call(this,r);}// == Decoder stream =======================================================
|
|||
|
function a(e,r){this.conv=e,(r=r||{}).encoding=this.encoding="utf8",t.call(this,r);}return i.prototype=Object.create(t.prototype,{constructor:{value:i}}),i.prototype._transform=function(e,t,r){if("string"!=typeof e)return r(Error("Iconv encoding stream needs strings as its input."));try{var i=this.conv.write(e);i&&i.length&&this.push(i),r();}catch(e){r(e);}},i.prototype._flush=function(e){try{var t=this.conv.end();t&&t.length&&this.push(t),e();}catch(t){e(t);}},i.prototype.collect=function(e){var t=[];return this.on("error",e),this.on("data",function(e){t.push(e);}),this.on("end",function(){e(null,r.concat(t));}),this;},a.prototype=Object.create(t.prototype,{constructor:{value:a}}),a.prototype._transform=function(e,t,i){if(!r.isBuffer(e)&&!(e instanceof Uint8Array))return i(Error("Iconv decoding stream needs buffers as its input."));try{var a=this.conv.write(e);a&&a.length&&this.push(a,this.encoding),i();}catch(e){i(e);}},a.prototype._flush=function(e){try{var t=this.conv.end();t&&t.length&&this.push(t,this.encoding),e();}catch(t){e(t);}},a.prototype.collect=function(e){var t="";return this.on("error",e),this.on("data",function(e){t+=e;}),this.on("end",function(){e(null,t);}),this;},{IconvLiteEncoderStream:i,IconvLiteDecoderStream:a};};}),parcelRequire.register("jcFdF",function(e,t){$parcel$export(e.exports,"storageBearerTokenChallengeAuthenticationPolicy",()=>p);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("abB4m"),i=parcelRequire("18oFr"),a=parcelRequire("42Oo8");/**
|
|||
|
* A set of constants used internally when processing requests.
|
|||
|
*/let n={DefaultScope:"/.default",/**
|
|||
|
* Defines constants for use with HTTP headers.
|
|||
|
*/HeaderConstants:{/**
|
|||
|
* The Authorization header.
|
|||
|
*/AUTHORIZATION:"authorization"}},o={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:12e4};/**
|
|||
|
* Converts an an unreliable access token getter (which may resolve with null)
|
|||
|
* into an AccessTokenGetter by retrying the unreliable getter in a regular
|
|||
|
* interval.
|
|||
|
*
|
|||
|
* @param getAccessToken - a function that produces a promise of an access
|
|||
|
* token that may fail by returning null
|
|||
|
* @param retryIntervalInMs - the time (in milliseconds) to wait between retry
|
|||
|
* attempts
|
|||
|
* @param timeoutInMs - the timestamp after which the refresh attempt will fail,
|
|||
|
* throwing an exception
|
|||
|
* @returns - a promise that, if it resolves, will resolve with an access token
|
|||
|
*/async function s(e,t,i){// This wrapper handles exceptions gracefully as long as we haven't exceeded
|
|||
|
// the timeout.
|
|||
|
async function a(){if(Date.now()<i)try{return await e();}catch(e){return null;}else{let t=await e();// Timeout is up, so throw if it's still null
|
|||
|
if(null===t)throw Error("Failed to refresh access token.");return t;}}let n=await a();for(;null===n;)await(0,r.delay)(t),n=await a();return n;}/**
|
|||
|
* Creates a token cycler from a credential, scopes, and optional settings.
|
|||
|
*
|
|||
|
* A token cycler represents a way to reliably retrieve a valid access token
|
|||
|
* from a TokenCredential. It will handle initializing the token, refreshing it
|
|||
|
* when it nears expiration, and synchronizes refresh attempts to avoid
|
|||
|
* concurrency hazards.
|
|||
|
*
|
|||
|
* @param credential - the underlying TokenCredential that provides the access
|
|||
|
* token
|
|||
|
* @param scopes - the scopes to request authorization for
|
|||
|
* @param tokenCyclerOptions - optionally override default settings for the cycler
|
|||
|
*
|
|||
|
* @returns - a function that reliably produces a valid access token
|
|||
|
*/function u(e,t,r){let i=null,a=null,n=Object.assign(Object.assign({},o),r),u={/**
|
|||
|
* Produces true if a refresh job is currently in progress.
|
|||
|
*/get isRefreshing(){return null!==i;},/**
|
|||
|
* Produces true if the cycler SHOULD refresh (we are within the refresh
|
|||
|
* window and not already refreshing)
|
|||
|
*/get shouldRefresh(){var c;return!u.isRefreshing&&(null!==(c=null==a?void 0:a.expiresOnTimestamp)&&void 0!==c?c:0)-n.refreshWindowInMs<Date.now();},/**
|
|||
|
* Produces true if the cycler MUST refresh (null or nearly-expired
|
|||
|
* token).
|
|||
|
*/get mustRefresh(){return null===a||a.expiresOnTimestamp-n.forcedRefreshWindowInMs<Date.now();}};/**
|
|||
|
* Starts a refresh job or returns the existing job if one is already
|
|||
|
* running.
|
|||
|
*/function l(r){var o;if(!u.isRefreshing){// We bind `scopes` here to avoid passing it around a lot
|
|||
|
let u=()=>e.getToken(t,r);// Take advantage of promise chaining to insert an assignment to `token`
|
|||
|
// before the refresh can be considered done.
|
|||
|
i=s(u,n.retryIntervalInMs,null!==(o=null==a?void 0:a.expiresOnTimestamp)&&void 0!==o?o:Date.now()).then(e=>(i=null,a=e)).catch(e=>{throw(// We also should reset the refresher if we enter a failed state. All
|
|||
|
// existing awaiters will throw, but subsequent requests will start a
|
|||
|
// new retry chain.
|
|||
|
i=null,a=null,e);});}return i;}return async e=>//
|
|||
|
// Simple rules:
|
|||
|
// - If we MUST refresh, then return the refresh task, blocking
|
|||
|
// the pipeline until a token is available.
|
|||
|
// - If we SHOULD refresh, then run refresh but don't return it
|
|||
|
// (we can still use the cached token).
|
|||
|
// - Return the token, since it's fine if we didn't return in
|
|||
|
// step 1.
|
|||
|
//
|
|||
|
u.mustRefresh?l(e):(u.shouldRefresh&&l(e),a);}/**
|
|||
|
* We will retrieve the challenge only if the response status code was 401,
|
|||
|
* and if the response contained the header "WWW-Authenticate" with a non-empty value.
|
|||
|
*/function c(e){let t=e.headers.get("WWW-Authenticate");if(401===e.status&&t)return t;}/**
|
|||
|
* Converts: `Bearer a="b" c="d"`.
|
|||
|
* Into: `[ { a: 'b', c: 'd' }]`.
|
|||
|
*
|
|||
|
* @internal
|
|||
|
*/function l(e){let t=e.slice(7),r=`${t.trim()} `.split(" ").filter(e=>e),i=r.map(e=>(([e,t])=>({[e]:t}))(e.trim().split("=")));// Key-value pairs to plain object:
|
|||
|
return i.reduce((e,t)=>Object.assign(Object.assign({},e),t),{});}function p(e,t){// This simple function encapsulates the entire process of reliably retrieving the token
|
|||
|
let r=u(e,t);class o extends a.BaseRequestPolicy{constructor(e,t){super(e,t);}async sendRequest(t){if(!t.url.toLowerCase().startsWith("https://"))throw Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");let a=r,o=(await a({abortSignal:t.abortSignal,tracingOptions:{tracingContext:t.tracingContext}})).token;t.headers.set(n.HeaderConstants.AUTHORIZATION,`Bearer ${o}`);let s=await this._nextPolicy.sendRequest(t);if((null==s?void 0:s.status)===401){let a=c(s);if(a){let o=l(a),s=o.resource_id+n.DefaultScope,c=(0,i.URLBuilder).parse(o.authorization_uri),p=c.getPath().split("/"),d=p[1],m=u(e,s),h=(await m({abortSignal:t.abortSignal,tracingOptions:{tracingContext:t.tracingContext},tenantId:d})).token;return r=m,t.headers.set(n.HeaderConstants.AUTHORIZATION,`Bearer ${h}`),this._nextPolicy.sendRequest(t);}}return s;}}return{create:(e,t)=>new o(e,t)};}}),parcelRequire.register("abB4m",function(e,t){$parcel$export(e.exports,"delay",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("ft27P");let i="The delay was aborted.";function a(e,t){let a;let{abortSignal:n,abortErrorMsg:o}=null!=t?t:{};return(0,r.createAbortablePromise)(t=>{a=setTimeout(t,e);},{cleanupBeforeAbort:()=>clearTimeout(a),abortSignal:n,abortErrorMsg:null!=o?o:i});}}),parcelRequire.register("ft27P",function(e,t){$parcel$export(e.exports,"createAbortablePromise",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("708hs");function i(e,t){let{cleanupBeforeAbort:i,abortSignal:a,abortErrorMsg:n}=null!=t?t:{};return new Promise((t,o)=>{function s(){o(new r.AbortError(null!=n?n:"The operation was aborted."));}function u(){null==a||a.removeEventListener("abort",c);}function c(){null==i||i(),u(),s();}if(null==a?void 0:a.aborted)return s();try{e(e=>{u(),t(e);},e=>{u(),o(e);});}catch(e){o(e);}null==a||a.addEventListener("abort",c);});}}),parcelRequire.register("2v8Hg",function(e,t){$parcel$export(e.exports,"BlobBeginCopyFromUrlPoller",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("abB4m"),i=parcelRequire("k6hms");class a extends i.Poller{constructor(e){let t;let{blobClient:r,copySource:i,intervalInMs:a=15e3,onProgress:n,resumeFrom:o,startCopyFromURLOptions:s}=e;o&&(t=JSON.parse(o).state);let c=u(Object.assign(Object.assign({},t),{blobClient:r,copySource:i,startCopyFromURLOptions:s}));super(c),"function"==typeof n&&this.onProgress(n),this.intervalInMs=a;}delay(){return(0,r.delay)(this.intervalInMs);}}/**
|
|||
|
* Note: Intentionally using function expression over arrow function expression
|
|||
|
* so that the function can be invoked with a different context.
|
|||
|
* This affects what `this` refers to.
|
|||
|
* @hidden
|
|||
|
*/let n=async function(e={}){let t=this.state,{copyId:r}=t;return t.isCompleted||(r&&(// if abortCopyFromURL throws, it will bubble up to user's poller.cancelOperation call
|
|||
|
await t.blobClient.abortCopyFromURL(r,{abortSignal:e.abortSignal})),t.isCancelled=!0),u(t);},o=async function(e={}){let t=this.state,{blobClient:r,copySource:i,startCopyFromURLOptions:a}=t;if(t.isStarted){if(!t.isCompleted)try{let r=await t.blobClient.getProperties({abortSignal:e.abortSignal}),{copyStatus:i,copyProgress:a}=r,n=t.copyProgress;a&&(t.copyProgress=a),"pending"===i&&a!==n&&"function"==typeof e.fireProgress?e.fireProgress(t):"success"===i?(t.result=r,t.isCompleted=!0):"failed"===i&&(t.error=Error(`Blob copy failed with reason: "${r.copyStatusDescription||"unknown"}"`),t.isCompleted=!0);}catch(e){t.error=e,t.isCompleted=!0;}}else{t.isStarted=!0;let e=await r.startCopyFromURL(i,a);// copyId is needed to abort
|
|||
|
t.copyId=e.copyId,"success"===e.copyStatus&&(t.result=e,t.isCompleted=!0);}return u(t);},s=function(){return JSON.stringify({state:this.state},(e,t)=>{// remove blobClient from serialized state since a client can't be hydrated from this info.
|
|||
|
if("blobClient"!==e)return t;});};/**
|
|||
|
* Creates a poll operation given the provided state.
|
|||
|
* @hidden
|
|||
|
*/function u(e){return{state:Object.assign({},e),cancel:n,toString:s,update:o};}}),parcelRequire.register("k6hms",function(e,t){$parcel$export(e.exports,"Poller",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* When a poller is manually stopped through the `stopPolling` method,
|
|||
|
* the poller will be rejected with an instance of the PollerStoppedError.
|
|||
|
*/class r extends Error{constructor(e){super(e),this.name="PollerStoppedError",Object.setPrototypeOf(this,r.prototype);}}class i extends Error{constructor(e){super(e),this.name="PollerCancelledError",Object.setPrototypeOf(this,i.prototype);}}class a{/**
|
|||
|
* A poller needs to be initialized by passing in at least the basic properties of the `PollOperation<TState, TResult>`.
|
|||
|
*
|
|||
|
* When writing an implementation of a Poller, this implementation needs to deal with the initialization
|
|||
|
* of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's
|
|||
|
* operation has already been defined, at least its basic properties. The code below shows how to approach
|
|||
|
* the definition of the constructor of a new custom poller.
|
|||
|
*
|
|||
|
* ```ts
|
|||
|
* export class MyPoller extends Poller<MyOperationState, string> {
|
|||
|
* constructor({
|
|||
|
* // Anything you might need outside of the basics
|
|||
|
* }) {
|
|||
|
* let state: MyOperationState = {
|
|||
|
* privateProperty: private,
|
|||
|
* publicProperty: public,
|
|||
|
* };
|
|||
|
*
|
|||
|
* const operation = {
|
|||
|
* state,
|
|||
|
* update,
|
|||
|
* cancel,
|
|||
|
* toString
|
|||
|
* }
|
|||
|
*
|
|||
|
* // Sending the operation to the parent's constructor.
|
|||
|
* super(operation);
|
|||
|
*
|
|||
|
* // You can assign more local properties here.
|
|||
|
* }
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* Inside of this constructor, a new promise is created. This will be used to
|
|||
|
* tell the user when the poller finishes (see `pollUntilDone()`). The promise's
|
|||
|
* resolve and reject methods are also used internally to control when to resolve
|
|||
|
* or reject anyone waiting for the poller to finish.
|
|||
|
*
|
|||
|
* The constructor of a custom implementation of a poller is where any serialized version of
|
|||
|
* a previous poller's operation should be deserialized into the operation sent to the
|
|||
|
* base constructor. For example:
|
|||
|
*
|
|||
|
* ```ts
|
|||
|
* export class MyPoller extends Poller<MyOperationState, string> {
|
|||
|
* constructor(
|
|||
|
* baseOperation: string | undefined
|
|||
|
* ) {
|
|||
|
* let state: MyOperationState = {};
|
|||
|
* if (baseOperation) {
|
|||
|
* state = {
|
|||
|
* ...JSON.parse(baseOperation).state,
|
|||
|
* ...state
|
|||
|
* };
|
|||
|
* }
|
|||
|
* const operation = {
|
|||
|
* state,
|
|||
|
* // ...
|
|||
|
* }
|
|||
|
* super(operation);
|
|||
|
* }
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* @param operation - Must contain the basic properties of `PollOperation<State, TResult>`.
|
|||
|
*/constructor(e){/** controls whether to throw an error if the operation failed or was canceled. */this.resolveOnUnsuccessful=!1,this.stopped=!0,this.pollProgressCallbacks=[],this.operation=e,this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t;}),// This prevents the UnhandledPromiseRejectionWarning in node.js from being thrown.
|
|||
|
// The above warning would get thrown if `poller.poll` is called, it returns an error,
|
|||
|
// and pullUntilDone did not have a .catch or await try/catch on it's return value.
|
|||
|
this.promise.catch(()=>{/* intentionally blank */});}/**
|
|||
|
* Starts a loop that will break only if the poller is done
|
|||
|
* or if the poller is stopped.
|
|||
|
*/async startPolling(e={}){for(this.stopped&&(this.stopped=!1);!this.isStopped()&&!this.isDone();)await this.poll(e),await this.delay();}/**
|
|||
|
* pollOnce does one polling, by calling to the update method of the underlying
|
|||
|
* poll operation to make any relevant change effective.
|
|||
|
*
|
|||
|
* It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike.
|
|||
|
*
|
|||
|
* @param options - Optional properties passed to the operation's update method.
|
|||
|
*/async pollOnce(e={}){this.isDone()||(this.operation=await this.operation.update({abortSignal:e.abortSignal,fireProgress:this.fireProgress.bind(this)})),this.processUpdatedState();}/**
|
|||
|
* fireProgress calls the functions passed in via onProgress the method of the poller.
|
|||
|
*
|
|||
|
* It loops over all of the callbacks received from onProgress, and executes them, sending them
|
|||
|
* the current operation state.
|
|||
|
*
|
|||
|
* @param state - The current operation state.
|
|||
|
*/fireProgress(e){for(let t of this.pollProgressCallbacks)t(e);}/**
|
|||
|
* Invokes the underlying operation's cancel method.
|
|||
|
*/async cancelOnce(e={}){this.operation=await this.operation.cancel(e);}/**
|
|||
|
* Returns a promise that will resolve once a single polling request finishes.
|
|||
|
* It does this by calling the update method of the Poller's operation.
|
|||
|
*
|
|||
|
* It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike.
|
|||
|
*
|
|||
|
* @param options - Optional properties passed to the operation's update method.
|
|||
|
*/poll(e={}){if(!this.pollOncePromise){this.pollOncePromise=this.pollOnce(e);let t=()=>{this.pollOncePromise=void 0;};this.pollOncePromise.then(t,t).catch(this.reject);}return this.pollOncePromise;}processUpdatedState(){if(this.operation.state.error&&(this.stopped=!0,!this.resolveOnUnsuccessful))throw this.reject(this.operation.state.error),this.operation.state.error;if(this.operation.state.isCancelled&&(this.stopped=!0,!this.resolveOnUnsuccessful)){let e=new i("Operation was canceled");throw this.reject(e),e;}this.isDone()&&this.resolve&&// However, it can be the case that TResult is instantiated to void, so
|
|||
|
// we are not expecting a result anyway. To assert that we might not
|
|||
|
// have a result eventually after finishing polling, we cast the result
|
|||
|
// to TResult.
|
|||
|
this.resolve(this.getResult());}/**
|
|||
|
* Returns a promise that will resolve once the underlying operation is completed.
|
|||
|
*/async pollUntilDone(e={}){return this.stopped&&this.startPolling(e).catch(this.reject),// This is needed because the state could have been updated by
|
|||
|
// `cancelOperation`, e.g. the operation is canceled or an error occurred.
|
|||
|
this.processUpdatedState(),this.promise;}/**
|
|||
|
* Invokes the provided callback after each polling is completed,
|
|||
|
* sending the current state of the poller's operation.
|
|||
|
*
|
|||
|
* It returns a method that can be used to stop receiving updates on the given callback function.
|
|||
|
*/onProgress(e){return this.pollProgressCallbacks.push(e),()=>{this.pollProgressCallbacks=this.pollProgressCallbacks.filter(t=>t!==e);};}/**
|
|||
|
* Returns true if the poller has finished polling.
|
|||
|
*/isDone(){let e=this.operation.state;return!!(e.isCompleted||e.isCancelled||e.error);}/**
|
|||
|
* Stops the poller from continuing to poll.
|
|||
|
*/stopPolling(){!this.stopped&&(this.stopped=!0,this.reject&&this.reject(new r("This poller is already stopped")));}/**
|
|||
|
* Returns true if the poller is stopped.
|
|||
|
*/isStopped(){return this.stopped;}/**
|
|||
|
* Attempts to cancel the underlying operation.
|
|||
|
*
|
|||
|
* It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike.
|
|||
|
*
|
|||
|
* If it's called again before it finishes, it will throw an error.
|
|||
|
*
|
|||
|
* @param options - Optional properties passed to the operation's update method.
|
|||
|
*/cancelOperation(e={}){if(this.cancelPromise){if(e.abortSignal)throw Error("A cancel request is currently pending");}else this.cancelPromise=this.cancelOnce(e);return this.cancelPromise;}/**
|
|||
|
* Returns the state of the operation.
|
|||
|
*
|
|||
|
* Even though TState will be the same type inside any of the methods of any extension of the Poller class,
|
|||
|
* implementations of the pollers can customize what's shared with the public by writing their own
|
|||
|
* version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller
|
|||
|
* and a public type representing a safe to share subset of the properties of the internal state.
|
|||
|
* Their definition of getOperationState can then return their public type.
|
|||
|
*
|
|||
|
* Example:
|
|||
|
*
|
|||
|
* ```ts
|
|||
|
* // Let's say we have our poller's operation state defined as:
|
|||
|
* interface MyOperationState extends PollOperationState<ResultType> {
|
|||
|
* privateProperty?: string;
|
|||
|
* publicProperty?: string;
|
|||
|
* }
|
|||
|
*
|
|||
|
* // To allow us to have a true separation of public and private state, we have to define another interface:
|
|||
|
* interface PublicState extends PollOperationState<ResultType> {
|
|||
|
* publicProperty?: string;
|
|||
|
* }
|
|||
|
*
|
|||
|
* // Then, we define our Poller as follows:
|
|||
|
* export class MyPoller extends Poller<MyOperationState, ResultType> {
|
|||
|
* // ... More content is needed here ...
|
|||
|
*
|
|||
|
* public getOperationState(): PublicState {
|
|||
|
* const state: PublicState = this.operation.state;
|
|||
|
* return {
|
|||
|
* // Properties from PollOperationState<TResult>
|
|||
|
* isStarted: state.isStarted,
|
|||
|
* isCompleted: state.isCompleted,
|
|||
|
* isCancelled: state.isCancelled,
|
|||
|
* error: state.error,
|
|||
|
* result: state.result,
|
|||
|
*
|
|||
|
* // The only other property needed by PublicState.
|
|||
|
* publicProperty: state.publicProperty
|
|||
|
* }
|
|||
|
* }
|
|||
|
* }
|
|||
|
* ```
|
|||
|
*
|
|||
|
* You can see this in the tests of this repository, go to the file:
|
|||
|
* `../test/utils/testPoller.ts`
|
|||
|
* and look for the getOperationState implementation.
|
|||
|
*/getOperationState(){return this.operation.state;}/**
|
|||
|
* Returns the result value of the operation,
|
|||
|
* regardless of the state of the poller.
|
|||
|
* It can return undefined or an incomplete form of the final TResult value
|
|||
|
* depending on the implementation.
|
|||
|
*/getResult(){let e=this.operation.state;return e.result;}/**
|
|||
|
* Returns a serialized version of the poller's operation
|
|||
|
* by invoking the operation's toString method.
|
|||
|
*/toString(){return this.operation.toString();}}}),parcelRequire.register("8PMUt",function(e,t){$parcel$export(e.exports,"rangeToString",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* Generate a range string. For example:
|
|||
|
*
|
|||
|
* "bytes=255-" or "bytes=0-511"
|
|||
|
*
|
|||
|
* @param iRange -
|
|||
|
*/function r(e){if(e.offset<0)throw RangeError("Range.offset cannot be smaller than 0.");if(e.count&&e.count<=0)throw RangeError("Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.");return e.count?`bytes=${e.offset}-${e.offset+e.count-1}`:`bytes=${e.offset}-`;}}),parcelRequire.register("fqjk5",function(e,t){$parcel$export(e.exports,"StorageClient",()=>u);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("hYmUv"),i=parcelRequire("e7JkV"),a=parcelRequire("lncUR"),n=parcelRequire("cLpTG"),o=parcelRequire("lrZDM"),s=parcelRequire("4PgmQ");class u{/**
|
|||
|
* Creates an instance of StorageClient.
|
|||
|
* @param url - url to resource
|
|||
|
* @param pipeline - request policy pipeline.
|
|||
|
*/constructor(e,t){for(let u of(// URL should be encoded and only once, protocol layer shouldn't encode URL again
|
|||
|
this.url=(0,i.escapeURLPath)(e),this.accountName=(0,i.getAccountNameFromUrl)(e),this.pipeline=t,this.storageClientContext=new r.StorageClientContext(this.url,t.toServiceClientOptions()),this.isHttps=(0,i.iEqual)((0,i.getURLScheme)(this.url)||"","https"),this.credential=new a.AnonymousCredential(),this.pipeline.factories))o.isNode&&u instanceof n.StorageSharedKeyCredential||u instanceof a.AnonymousCredential?this.credential=u:(0,s.isTokenCredential)(u.credential)&&(// We do that in newPipeline() when using TokenCredential.
|
|||
|
this.credential=u.credential);// Override protocol layer's default content-type
|
|||
|
let u=this.storageClientContext;u.requestContentType=void 0;}}}),parcelRequire.register("hYmUv",function(e,t){$parcel$export(e.exports,"StorageClientContext",()=>o);/*
|
|||
|
* Copyright (c) Microsoft Corporation.
|
|||
|
* Licensed under the MIT License.
|
|||
|
*
|
|||
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|||
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|||
|
*/var r=parcelRequire("dR1Ya"),i=parcelRequire("kW4jD");let a="azure-storage-blob",n="12.15.0";class o extends i.ServiceClient{/**
|
|||
|
* Initializes a new instance of the StorageClientContext class.
|
|||
|
* @param url The URL of the service account, container, or blob that is the target of the desired
|
|||
|
* operation.
|
|||
|
* @param options The parameter options
|
|||
|
*/constructor(e,t){if(void 0===e)throw Error("'url' cannot be null");if(t||(t={}),!t.userAgent){let e=r.getDefaultUserAgentValue();t.userAgent=`${a}/${n} ${e}`;}super(void 0,t),this.requestContentType="application/json; charset=utf-8",this.baseUri=t.endpoint||"{url}",// Parameter assignments
|
|||
|
this.url=e,// Assigning values to Constant parameters
|
|||
|
this.version=t.version||"2023-01-03";}}}),parcelRequire.register("dR1Ya",function(e,t){$parcel$export(e.exports,"getDefaultUserAgentHeaderName",()=>u),$parcel$export(e.exports,"getDefaultUserAgentValue",()=>c),$parcel$export(e.exports,"userAgentPolicy",()=>l);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8"),i=parcelRequire("5TV2V"),a=parcelRequire("9PBIu"),n=parcelRequire("awoW3");function o(){let e={key:"core-http",value:a.Constants.coreHttpVersion};return[e];}function s(e,t=" ",r="/"){return e.map(e=>{let t=e.value?`${r}${e.value}`:"";return`${e.key}${t}`;}).join(t);}let u=i.getDefaultUserAgentKey;function c(){let e=o(),t=(0,i.getPlatformSpecificData)(),r=s(e.concat(t));return r;}function l(e){let t=e&&void 0!==e.key&&null!==e.key?e.key:(0,i.getDefaultUserAgentKey)(),r=e&&void 0!==e.value&&null!==e.value?e.value:c();return{create:(e,i)=>new p(e,i,t,r)};}class p extends r.BaseRequestPolicy{constructor(e,t,r,i){super(e,t),this._nextPolicy=e,this._options=t,this.headerKey=r,this.headerValue=i;}sendRequest(e){return this.addUserAgentHeader(e),this._nextPolicy.sendRequest(e);}/**
|
|||
|
* Adds the user agent header to the outgoing request.
|
|||
|
*/addUserAgentHeader(e){e.headers||(e.headers=new n.HttpHeaders()),!e.headers.get(this.headerKey)&&this.headerValue&&e.headers.set(this.headerKey,this.headerValue);}}}),parcelRequire.register("5TV2V",function(e,t){$parcel$export(e.exports,"getDefaultUserAgentKey",()=>i),$parcel$export(e.exports,"getPlatformSpecificData",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("9PBIu");function i(){return r.Constants.HeaderConstants.USER_AGENT;}function a(){let e={key:"Node",value:process.version},t={key:"OS",value:`(${$k14yv$os.arch()}-${$k14yv$os.type()}-${$k14yv$os.release()})`};return[e,t];}}),parcelRequire.register("kW4jD",function(e,t){$parcel$export(e.exports,"ServiceClient",()=>F);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("8sP3n"),i=parcelRequire("e5kiN"),a=parcelRequire("llt85");parcelRequire("60VDC");var n=parcelRequire("jgb7X"),o=parcelRequire("lvWck"),s=parcelRequire("fIS4N"),u=parcelRequire("fSaRC"),c=parcelRequire("eqP38"),l=parcelRequire("kp6Ng"),p=parcelRequire("42Oo8"),d=parcelRequire("2dg8H"),m=parcelRequire("lrZDM"),h=parcelRequire("4PgmQ"),x=parcelRequire("dR1Ya"),f=parcelRequire("2xU1D"),g=parcelRequire("18oFr"),D=parcelRequire("dzJNC");parcelRequire("7estx");var y=parcelRequire("fqZ1u"),b=parcelRequire("37P36"),v=parcelRequire("aQvX1");parcelRequire("3SEeK");var C=parcelRequire("1Vc6S"),E=parcelRequire("7wQUW"),A=parcelRequire("kWBuP"),S=parcelRequire("hLHYf"),B=parcelRequire("8JYh8"),N=parcelRequire("1yvfc");parcelRequire("9VZfm");class F{/**
|
|||
|
* The ServiceClient constructor
|
|||
|
* @param credentials - The credentials used for authentication with the service.
|
|||
|
* @param options - The service client options that govern the behavior of the client.
|
|||
|
*/constructor(e,/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */t){let r;if(t||(t={}),this._withCredentials=t.withCredentials||!1,this._httpClient=t.httpClient||(0,b.getCachedDefaultHttpClient)(),this._requestPolicyOptions=new p.RequestPolicyOptions(t.httpPipelineLogger),Array.isArray(t.requestPolicyFactories))(0,v.logger).info("ServiceClient: using custom request policies"),r=t.requestPolicyFactories;else{let i;if((0,h.isTokenCredential)(e)){(0,v.logger).info("ServiceClient: creating bearer token authentication policy from provided credentials");// Create a wrapped RequestPolicyFactory here so that we can provide the
|
|||
|
// correct scope to the BearerTokenAuthenticationPolicy at the first time
|
|||
|
// one is requested. This is needed because generated ServiceClient
|
|||
|
// implementations do not set baseUri until after ServiceClient's constructor
|
|||
|
// is finished, leaving baseUri empty at the time when it is needed to
|
|||
|
// build the correct scope name.
|
|||
|
let r=()=>{let r;// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|||
|
let i=this,a=t;return{create(t,n){let o=M(a,i.baseUri);if(!o)throw Error("When using credential, the ServiceClient must contain a baseUri or a credentialScopes in ServiceClientOptions. Unable to create a bearerTokenAuthenticationPolicy");return null==r&&(r=(0,D.bearerTokenAuthenticationPolicy)(e,o)),r.create(t,n);}};};i=r();}else if(e&&"function"==typeof e.signRequest)(0,v.logger).info("ServiceClient: creating signing policy from provided credentials"),i=(0,A.signingPolicy)(e);else if(null!=e)throw Error("The credentials argument must implement the TokenCredential interface");if((0,v.logger).info("ServiceClient: using default request policies"),r=O(i,t),t.requestPolicyFactories){// options.requestPolicyFactories can also be a function that manipulates
|
|||
|
// the default requestPolicyFactories array
|
|||
|
let e=t.requestPolicyFactories(r);e&&(r=e);}}this._requestPolicyFactories=r;}/**
|
|||
|
* Send the provided httpRequest.
|
|||
|
*/sendRequest(e){let t;if(null==e||"object"!=typeof e)throw Error("options cannot be null or undefined and it must be of type object.");try{(0,l.isWebResourceLike)(e)?(e.validateRequestProperties(),t=e):t=(t=new l.WebResource()).prepare(e);}catch(e){return Promise.reject(e);}let r=this._httpClient;if(this._requestPolicyFactories&&this._requestPolicyFactories.length>0)for(let e=this._requestPolicyFactories.length-1;e>=0;--e)r=this._requestPolicyFactories[e].create(r,this._requestPolicyOptions);return r.sendRequest(t);}/**
|
|||
|
* Send an HTTP request that is populated using the provided OperationSpec.
|
|||
|
* @param operationArguments - The arguments that the HTTP request's templated values will be populated from.
|
|||
|
* @param operationSpec - The OperationSpec to use to populate the httpRequest.
|
|||
|
* @param callback - The callback to call when the response is received.
|
|||
|
*/async sendOperationRequest(e,t,r){var i;let a;"function"==typeof e.options&&(r=e.options,e.options=void 0);let n=null===(i=e.options)||void 0===i?void 0:i.serializerOptions,o=new l.WebResource();try{let r,i;let s=t.baseUrl||this.baseUri;if(!s)throw Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use.");o.method=t.httpMethod,o.operationSpec=t;let l=(0,g.URLBuilder).parse(s);if(t.path&&l.appendPath(t.path),t.urlParameters&&t.urlParameters.length>0)for(let r of t.urlParameters){let i=R(this,e,r,t.serializer);i=t.serializer.serialize(r.mapper,i,(0,u.getPathStringFromParameter)(r),n),r.skipEncoding||(i=encodeURIComponent(i)),l.replaceAll(`{${r.mapper.serializedName||(0,u.getPathStringFromParameter)(r)}}`,i);}if(t.queryParameters&&t.queryParameters.length>0)for(let r of t.queryParameters){let i=R(this,e,r,t.serializer);if(null!=i){if(i=t.serializer.serialize(r.mapper,i,(0,u.getPathStringFromParameter)(r),n),void 0!==r.collectionFormat&&null!==r.collectionFormat){if(r.collectionFormat===f.QueryCollectionFormat.Multi){if(0===i.length)continue;for(let e in i){let t=i[e];i[e]=null==t?"":t.toString();}}else(r.collectionFormat===f.QueryCollectionFormat.Ssv||r.collectionFormat===f.QueryCollectionFormat.Tsv)&&(i=i.join(r.collectionFormat));}if(!r.skipEncoding){if(Array.isArray(i))for(let e in i)void 0!==i[e]&&null!==i[e]&&(i[e]=encodeURIComponent(i[e]));else i=encodeURIComponent(i);}void 0!==r.collectionFormat&&null!==r.collectionFormat&&r.collectionFormat!==f.QueryCollectionFormat.Multi&&r.collectionFormat!==f.QueryCollectionFormat.Ssv&&r.collectionFormat!==f.QueryCollectionFormat.Tsv&&(i=i.join(r.collectionFormat)),l.setQueryParameter(r.mapper.serializedName||(0,u.getPathStringFromParameter)(r),i);}}o.url=l.toString();let p=t.contentType||this.requestContentType;if(p&&t.requestBody&&o.headers.set("Content-Type",p),t.headerParameters)for(let r of t.headerParameters){let i=R(this,e,r,t.serializer);if(null!=i){i=t.serializer.serialize(r.mapper,i,(0,u.getPathStringFromParameter)(r),n);let e=r.mapper.headerCollectionPrefix;if(e)for(let t of Object.keys(i))o.headers.set(e+t,i[t]);else o.headers.set(r.mapper.serializedName||(0,u.getPathStringFromParameter)(r),i);}}let d=e.options;if(d){if(d.customHeaders)for(let e in d.customHeaders)o.headers.set(e,d.customHeaders[e]);d.abortSignal&&(o.abortSignal=d.abortSignal),d.timeout&&(o.timeout=d.timeout),d.onUploadProgress&&(o.onUploadProgress=d.onUploadProgress),d.onDownloadProgress&&(o.onDownloadProgress=d.onDownloadProgress),d.spanOptions&&(o.spanOptions=d.spanOptions),d.tracingContext&&(o.tracingContext=d.tracingContext),void 0!==d.shouldDeserialize&&null!==d.shouldDeserialize&&(o.shouldDeserialize=d.shouldDeserialize);}o.withCredentials=this._withCredentials,w(this,o,e,t),void 0===o.streamResponseStatusCodes&&(o.streamResponseStatusCodes=(0,c.getStreamResponseStatusCodes)(t));try{r=await this.sendRequest(o);}catch(e){i=e;}i?(i.response&&(i.details=k(i.response,t.responses[i.statusCode]||t.responses.default)),a=Promise.reject(i)):a=Promise.resolve(k(r,t.responses[r.status]));}catch(e){a=Promise.reject(e);}let s=r;return s&&a.then(e=>s(null,e._response.parsedBody,e._response.request,e._response)).catch(e=>s(e)),a;}}function w(e,t,a,n){var o,s,c,l,p,m;let h=null!==(s=null===(o=a.options)||void 0===o?void 0:o.serializerOptions)&&void 0!==s?s:{},x={rootName:null!==(c=h.rootName)&&void 0!==c?c:"",includeRoot:null!==(l=h.includeRoot)&&void 0!==l&&l,xmlCharKey:null!==(p=h.xmlCharKey)&&void 0!==p?p:d.XML_CHARKEY},f=h.xmlCharKey;if(n.requestBody&&n.requestBody.mapper){t.body=R(e,a,n.requestBody,n.serializer);let o=n.requestBody.mapper,{required:s,xmlName:c,xmlElementName:l,serializedName:p,xmlNamespace:d,xmlNamespacePrefix:h}=o,g=o.type.name;try{if(void 0!==t.body&&null!==t.body||s){let e=(0,u.getPathStringFromParameter)(n.requestBody);t.body=n.serializer.serialize(o,t.body,e,x);let a=g===i.MapperType.Stream;if(n.isXML){let e=h?`xmlns:${h}`:"xmlns",n=P(d,e,g,t.body,x);g===i.MapperType.Sequence?t.body=(0,S.s
|
|||
|
return;a||(t.body=JSON.stringify(t.body));}}}catch(e){throw Error(`Error "${e.message}" occurred in serializing the payload - ${JSON.stringify(p,void 0," ")}.`);}}else if(n.formDataParameters&&n.formDataParameters.length>0)for(let r of(t.formData={},n.formDataParameters)){let i=R(e,a,r,n.serializer);if(null!=i){let e=r.mapper.serializedName||(0,u.getPathStringFromParameter)(r);t.formData[e]=n.serializer.serialize(r.mapper,i,(0,u.getPathStringFromParameter)(r),x);}}}/**
|
|||
|
* Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself
|
|||
|
*/function P(e,t,r,i,a){// Composite and Sequence schemas already got their root namespace set during serialization
|
|||
|
// We just need to add xmlns to the other schema types
|
|||
|
if(e&&!["Composite","Sequence","Dictionary"].includes(r)){let r={};return r[a.xmlCharKey]=i,r[d.XML_ATTRKEY]={[t]:e},r;}return i;}function T(e,t){let r;return"string"==typeof e?r=e:(r=t(),"function"==typeof e&&(r=e(r))),r;}function O(e,t){let r=[];t.generateClientRequestIdHeader&&r.push((0,y.generateClientRequestIdPolicy)(t.clientRequestIdHeaderName)),e&&r.push(e);let i=T(t.userAgentHeaderName,x.getDefaultUserAgentHeaderName),u=T(t.userAgent,x.getDefaultUserAgentValue);return i&&u&&r.push((0,x.userAgentPolicy)({key:i,value:u})),r.push((0,n.redirectPolicy)()),r.push((0,E.rpRegistrationPolicy)(t.rpRegistrationRetryTimeout)),t.noRetryPolicy||(r.push((0,o.exponentialRetryPolicy)()),r.push((0,B.systemErrorRetryPolicy)()),r.push((0,N.throttlingRetryPolicy)())),r.push((0,a.deserializationPolicy)(t.deserializationContentTypes)),m.isNode&&r.push((0,C.proxyPolicy)(t.proxySettings)),r.push((0,s.logPolicy)({logger:v.logger.info})),r;}function R(e,t,r,i){return I(e,t,r.parameterPath,r.mapper,i);}function I(e,t,r,i,a){var n;let o;"string"==typeof r&&(r=[r]);let s=null===(n=t.options)||void 0===n?void 0:n.serializerOptions;if(Array.isArray(r)){if(r.length>0){if(i.isConstant)o=i.defaultValue;else{let a=z(t,r);a.propertyFound||(a=z(e,r));let n=!1;a.propertyFound||(n=i.required||"options"===r[0]&&2===r.length),o=n?i.defaultValue:a.propertyValue;}// Serialize just for validation purposes.
|
|||
|
let n=(0,u.getPathStringFromParameterPath)(r,i);a.serialize(i,o,n,s);}}else for(let n in i.required&&(o={}),r){let c=i.type.modelProperties[n],l=r[n],p=I(e,t,l,c,a),d=(0,u.getPathStringFromParameterPath)(l,c);a.serialize(c,p,d,s),null!=p&&(o||(o={}),o[n]=p);}return o;}function z(e,t){let r={propertyFound:!1},i=0;for(;i<t.length;++i){let r=t[i];// Make sure to check inherited properties too, so don't use hasOwnProperty().
|
|||
|
if(null!=e&&r in e)e=e[r];else break;}return i===t.length&&(r.propertyValue=e,r.propertyFound=!0),r;}function k(e,t){let i=e.parsedHeaders,a=t&&t.bodyMapper,n=t=>Object.defineProperty(t,"_response",{value:e});if(a){let t=a.type.name;if("Stream"===t)return n(Object.assign(Object.assign({},i),{blobBody:e.blobBody,readableStreamBody:e.readableStreamBody}));let r="Composite"===t&&a.type.modelProperties||{},o=Object.keys(r).some(e=>""===r[e].serializedName);if("Sequence"===t||o){let t=[...(e.parsedBody||[])];for(let i of Object.keys(r))r[i].serializedName&&(t[i]=e.parsedBody[i]);if(i)for(let e of Object.keys(i))t[e]=i[e];return n(t),t;}if("Composite"===t||"Dictionary"===t)return n(Object.assign(Object.assign({},i),e.parsedBody));}return n(a||"HEAD"===e.request.method||r.isPrimitiveType(e.parsedBody)?Object.assign(Object.assign({},i),{body:e.parsedBody}):Object.assign(Object.assign({},i),e.parsedBody));}function M(e,t){return(null==e?void 0:e.credentialScopes)?e.credentialScopes:t?`${t}/.default`:void 0;}}),parcelRequire.register("jgb7X",function(e,t){$parcel$export(e.exports,"DefaultRedirectOptions",()=>n),$parcel$export(e.exports,"redirectPolicy",()=>o);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8"),i=parcelRequire("18oFr");/**
|
|||
|
* Methods that are allowed to follow redirects 301 and 302
|
|||
|
*/let a=["GET","HEAD"],n={handleRedirects:!0,maxRetries:20};function o(e=20){return{create:(t,r)=>new s(t,r,e)};}class s extends r.BaseRequestPolicy{constructor(e,t,r=20){super(e,t),this.maxRetries=r;}sendRequest(e){return this._nextPolicy.sendRequest(e).then(e=>u(this,e,0));}}function u(e,t,r){let{request:n,status:o}=t,s=t.headers.get("location");if(s&&(300===o||301===o&&a.includes(n.method)||302===o&&a.includes(n.method)||303===o&&"POST"===n.method||307===o)&&(!e.maxRetries||r<e.maxRetries)){let t=(0,i.URLBuilder).parse(n.url);return t.setPath(s),n.url=t.toString(),303===o&&(n.method="GET",delete n.body),e._nextPolicy.sendRequest(n).then(t=>u(e,t,r+1));}return Promise.resolve(t);}}),parcelRequire.register("lvWck",function(e,t){$parcel$export(e.exports,"exponentialRetryPolicy",()=>c),$parcel$export(e.exports,"DefaultRetryOptions",()=>l);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r,i=parcelRequire("42Oo8"),a=parcelRequire("5QV0w"),n=parcelRequire("9PBIu"),o=parcelRequire("f1RLO"),s=parcelRequire("abB4m"),u=parcelRequire("aQvX1");function c(e,t,r){return{create:(i,a)=>new p(i,a,e,t,r)};}!function(e){/**
|
|||
|
* Currently supported retry mode.
|
|||
|
* Each time a retry happens, it will take exponentially more time than the last time.
|
|||
|
*/e[e.Exponential=0]="Exponential";}(r||(r={}));let l={maxRetries:a.DEFAULT_CLIENT_RETRY_COUNT,retryDelayInMs:a.DEFAULT_CLIENT_RETRY_INTERVAL,maxRetryDelayInMs:a.DEFAULT_CLIENT_MAX_RETRY_INTERVAL};class p extends i.BaseRequestPolicy{/**
|
|||
|
* @param nextPolicy - The next RequestPolicy in the pipeline chain.
|
|||
|
* @param options - The options for this RequestPolicy.
|
|||
|
* @param retryCount - The client retry count.
|
|||
|
* @param retryInterval - The client retry interval, in milliseconds.
|
|||
|
* @param minRetryInterval - The minimum retry interval, in milliseconds.
|
|||
|
* @param maxRetryInterval - The maximum retry interval, in milliseconds.
|
|||
|
*/constructor(e,t,r,i,n){super(e,t),this.retryCount=(0,a.isNumber)(r)?r:a.DEFAULT_CLIENT_RETRY_COUNT,this.retryInterval=(0,a.isNumber)(i)?i:a.DEFAULT_CLIENT_RETRY_INTERVAL,this.maxRetryInterval=(0,a.isNumber)(n)?n:a.DEFAULT_CLIENT_MAX_RETRY_INTERVAL;}sendRequest(e){return this._nextPolicy.sendRequest(e.clone()).then(t=>d(this,e,t)).catch(t=>d(this,e,t.response,void 0,t));}}async function d(e,t,r,i,c){function l(e){let t=null==e?void 0:e.status;return!(503===t&&(null==r?void 0:r.headers.get(n.Constants.HeaderConstants.RETRY_AFTER)))&&void 0!==t&&(!(t<500)||408===t)&&501!==t&&505!==t;}i=(0,a.updateRetryData)({retryInterval:e.retryInterval,minRetryInterval:0,maxRetryInterval:e.maxRetryInterval},i,c);let p=t.abortSignal&&t.abortSignal.aborted;if(!p&&(0,a.shouldRetry)(e.retryCount,l,i,r)){(0,u.logger).info(`Retrying request in ${i.retryInterval}`);try{await(0,s.delay)(i.retryInterval);let r=await e._nextPolicy.sendRequest(t.clone());return d(e,t,r,i);}catch(a){return d(e,t,r,i,a);}}else{if(!p&&!c&&r)return r;// If the operation failed in the end, return all errors instead of just the last one
|
|||
|
let e=i.error||new o.RestError("Failed to send the request.",o.RestError.REQUEST_SEND_ERROR,r&&r.status,r&&r.request,r);throw e;}}}),parcelRequire.register("5QV0w",function(e,t){$parcel$export(e.exports,"DEFAULT_CLIENT_RETRY_COUNT",()=>r),$parcel$export(e.exports,"DEFAULT_CLIENT_RETRY_INTERVAL",()=>i),$parcel$export(e.exports,"DEFAULT_CLIENT_MAX_RETRY_INTERVAL",()=>a),$parcel$export(e.exports,"DEFAULT_CLIENT_MIN_RETRY_INTERVAL",()=>n),$parcel$export(e.exports,"isNumber",()=>o),$parcel$export(e.exports,"shouldRetry",()=>s),$parcel$export(e.exports,"updateRetryData",()=>u);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
let r=3,i=3e4,a=9e4,n=3e3;function o(e){return"number"==typeof e;}function s(e,t,r,i,a){return!!t(i,a)&&r.retryCount<e;}function u(e,t={retryCount:0,retryInterval:0},r){r&&(t.error&&(r.innerError=t.error),t.error=r),// Adjust retry count
|
|||
|
t.retryCount++;// Adjust retry interval
|
|||
|
let i=Math.pow(2,t.retryCount-1)-1,a=.8*e.retryInterval+Math.floor(Math.random()*(.4*e.retryInterval));return i*=a,t.retryInterval=Math.min(e.minRetryInterval+i,e.maxRetryInterval),t;}}),parcelRequire.register("fSaRC",function(e,t){// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* Get the path to this parameter's value as a dotted string (a.b.c).
|
|||
|
* @param parameter - The parameter to get the path string for.
|
|||
|
* @returns The path to this parameter's value as a dotted string.
|
|||
|
*/function r(e){return i(e.parameterPath,e.mapper);}function i(e,t){return"string"==typeof e?e:Array.isArray(e)?e.join("."):t.serializedName;}$parcel$export(e.exports,"getPathStringFromParameter",()=>r),$parcel$export(e.exports,"getPathStringFromParameterPath",()=>i);}),parcelRequire.register("eqP38",function(e,t){$parcel$export(e.exports,"getStreamResponseStatusCodes",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("e5kiN");function i(e){let t=new Set();for(let i in e.responses){let a=e.responses[i];a.bodyMapper&&a.bodyMapper.type.name===r.MapperType.Stream&&t.add(Number(i));}return t;}}),parcelRequire.register("kp6Ng",function(e,t){$parcel$export(e.exports,"isWebResourceLike",()=>n),$parcel$export(e.exports,"WebResource",()=>o);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("awoW3"),i=parcelRequire("e5kiN"),a=parcelRequire("8sP3n");function n(e){if(e&&"object"==typeof e){let t=e;if("string"==typeof t.url&&"string"==typeof t.method&&"object"==typeof t.headers&&(0,r.isHttpHeadersLike)(t.headers)&&"function"==typeof t.validateRequestProperties&&"function"==typeof t.prepare&&"function"==typeof t.clone)return!0;}return!1;}class o{constructor(e,t,i,n,o,s,u,c,l,p,d,m,h,x,f){this.streamResponseBody=s,this.streamResponseStatusCodes=f,this.url=e||"",this.method=t||"GET",this.headers=(0,r.isHttpHeadersLike)(o)?o:new r.HttpHeaders(o),this.body=i,this.query=n,this.formData=void 0,this.withCredentials=u||!1,this.abortSignal=c,this.timeout=l||0,this.onUploadProgress=p,this.onDownloadProgress=d,this.proxySettings=m,this.keepAlive=h,this.decompressResponse=x,this.requestId=this.headers.get("x-ms-client-request-id")||(0,a.generateUuid)();}/**
|
|||
|
* Validates that the required properties such as method, url, headers["Content-Type"],
|
|||
|
* headers["accept-language"] are defined. It will throw an error if one of the above
|
|||
|
* mentioned properties are not defined.
|
|||
|
*/validateRequestProperties(){if(!this.method)throw Error("WebResource.method is required.");if(!this.url)throw Error("WebResource.url is required.");}/**
|
|||
|
* Prepares the request.
|
|||
|
* @param options - Options to provide for preparing the request.
|
|||
|
* @returns Returns the prepared WebResource (HTTP Request) object that needs to be given to the request pipeline.
|
|||
|
*/prepare(e){if(!e)throw Error("options object is required");if(void 0===e.method||null===e.method||"string"!=typeof e.method.valueOf())throw Error("options.method must be a string.");if(e.url&&e.pathTemplate)throw Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them.");if((void 0===e.pathTemplate||null===e.pathTemplate||"string"!=typeof e.pathTemplate.valueOf())&&(void 0===e.url||null===e.url||"string"!=typeof e.url.valueOf()))throw Error("Please provide exactly one of options.pathTemplate or options.url.");// set the url if it is provided.
|
|||
|
if(e.url){if("string"!=typeof e.url)throw Error('options.url must be of type "string".');this.url=e.url;}// set the method
|
|||
|
if(e.method){let t=["GET","PUT","HEAD","DELETE","OPTIONS","POST","PATCH","TRACE"];if(-1===t.indexOf(e.method.toUpperCase()))throw Error('The provided method "'+e.method+'" is invalid. Supported HTTP methods are: '+JSON.stringify(t));}// construct the url if path template is provided
|
|||
|
if(this.method=e.method.toUpperCase(),e.pathTemplate){let{pathTemplate:t,pathParameters:r}=e;if("string"!=typeof t)throw Error('options.pathTemplate must be of type "string".');e.baseUrl||(e.baseUrl="https://management.azure.com");let i=e.baseUrl,a=i+(i.endsWith("/")?"":"/")+(t.startsWith("/")?t.slice(1):t),n=a.match(/({[\w-]*\s*[\w-]*})/gi);if(n&&n.length){if(!r)throw Error(`pathTemplate: ${t} has been provided. Hence, options.pathParameters must also be provided.`);n.forEach(function(e){let i=e.slice(1,-1),n=r[i];if(null==n||!("string"==typeof n||"object"==typeof n)){let e=JSON.stringify(r,void 0,2);throw Error(`pathTemplate: ${t} contains the path parameter ${i} however, it is not present in parameters: ${e}.The value of the path parameter can either be a "string" of the form { ${i}: "some sample value" } or it can be an "object" of the form { "${i}": { value: "some sample value", skipUrlEncoding: true } }.`);}if("string"==typeof n.valueOf()&&(a=a.replace(e,encodeURIComponent(n))),"object"==typeof n.valueOf()){if(!n.value)throw Error(`options.pathParameters[${i}] is of type "object" but it does not contain a "value" property.`);a=n.skipUrlEncoding?a.replace(e,n.value):a.replace(e,encodeURIComponent(n.value));}});}this.url=a;}// append query parameters to the url if they are provided. They can be provided with pathTemplate or url option.
|
|||
|
if(e.queryParameters){let t=e.queryParameters;if("object"!=typeof t)throw Error('options.queryParameters must be of type object. It should be a JSON object of "query-parameter-name" as the key and the "query-parameter-value" as the value. The "query-parameter-value" may be fo type "string" or an "object" of the form { value: "query-parameter-value", skipUrlEncoding: true }.');this.url&&-1===this.url.indexOf("?")&&(this.url+="?");// construct queryString
|
|||
|
let r=[];for(let e in// We need to populate this.query as a dictionary if the request is being used for Sway's validateRequest().
|
|||
|
this.query={},t){let i=t[e];if(i){if("string"==typeof i)r.push(e+"="+encodeURIComponent(i)),this.query[e]=encodeURIComponent(i);else if("object"==typeof i){if(!i.value)throw Error(`options.queryParameters[${e}] is of type "object" but it does not contain a "value" property.`);i.skipUrlEncoding?(r.push(e+"="+i.value),this.query[e]=i.value):(r.push(e+"="+encodeURIComponent(i.value)),this.query[e]=encodeURIComponent(i.value));}}}// end-of-for
|
|||
|
// append the queryString
|
|||
|
this.url+=r.join("&");}// add headers to the request if they are provided
|
|||
|
if(e.headers){let t=e.headers;for(let r of Object.keys(e.headers))this.headers.set(r,t[r]);}return this.headers.get("accept-language")||this.headers.set("accept-language","en-US"),this.headers.get("x-ms-client-request-id")||e.disableClientRequestId||this.headers.set("x-ms-client-request-id",this.requestId),this.headers.get("Content-Type")||this.headers.set("Content-Type","application/json; charset=utf-8"),// set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicitly
|
|||
|
this.body=e.body,void 0===e.body||null===e.body||(e.bodyIsStream?(this.headers.get("Transfer-Encoding")||this.headers.set("Transfer-Encoding","chunked"),"application/octet-stream"!==this.headers.get("Content-Type")&&this.headers.set("Content-Type","application/octet-stream")):(e.serializationMapper&&(this.body=new(0,i.Serializer)(e.mappers).serialize(e.serializationMapper,e.body,"requestBody")),e.disableJsonStringifyOnBody||(this.body=JSON.stringify(e.body)))),e.spanOptions&&(this.spanOptions=e.spanOptions),e.tracingContext&&(this.tracingContext=e.tracingContext),this.abortSignal=e.abortSignal,this.onDownloadProgress=e.onDownloadProgress,this.onUploadProgress=e.onUploadProgress,this;}/**
|
|||
|
* Clone this WebResource HTTP request object.
|
|||
|
* @returns The clone of this WebResource HTTP request object.
|
|||
|
*/clone(){let e=new o(this.url,this.method,this.body,this.query,this.headers&&this.headers.clone(),this.streamResponseBody,this.withCredentials,this.abortSignal,this.timeout,this.onUploadProgress,this.onDownloadProgress,this.proxySettings,this.keepAlive,this.decompressResponse,this.streamResponseStatusCodes);return this.formData&&(e.formData=this.formData),this.operationSpec&&(e.operationSpec=this.operationSpec),this.shouldDeserialize&&(e.shouldDeserialize=this.shouldDeserialize),this.operationResponseGetter&&(e.operationResponseGetter=this.operationResponseGetter),e;}}}),parcelRequire.register("dzJNC",function(e,t){$parcel$export(e.exports,"bearerTokenAuthenticationPolicy",()=>u);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8"),i=parcelRequire("9PBIu"),a=parcelRequire("abB4m");let n={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:12e4};/**
|
|||
|
* Converts an an unreliable access token getter (which may resolve with null)
|
|||
|
* into an AccessTokenGetter by retrying the unreliable getter in a regular
|
|||
|
* interval.
|
|||
|
*
|
|||
|
* @param getAccessToken - a function that produces a promise of an access
|
|||
|
* token that may fail by returning null
|
|||
|
* @param retryIntervalInMs - the time (in milliseconds) to wait between retry
|
|||
|
* attempts
|
|||
|
* @param timeoutInMs - the timestamp after which the refresh attempt will fail,
|
|||
|
* throwing an exception
|
|||
|
* @returns - a promise that, if it resolves, will resolve with an access token
|
|||
|
*/async function o(e,t,r){// This wrapper handles exceptions gracefully as long as we haven't exceeded
|
|||
|
// the timeout.
|
|||
|
async function i(){if(Date.now()<r)try{return await e();}catch(e){return null;}else{let t=await e();// Timeout is up, so throw if it's still null
|
|||
|
if(null===t)throw Error("Failed to refresh access token.");return t;}}let n=await i();for(;null===n;)await(0,a.delay)(t),n=await i();return n;}/**
|
|||
|
* Creates a token cycler from a credential, scopes, and optional settings.
|
|||
|
*
|
|||
|
* A token cycler represents a way to reliably retrieve a valid access token
|
|||
|
* from a TokenCredential. It will handle initializing the token, refreshing it
|
|||
|
* when it nears expiration, and synchronizes refresh attempts to avoid
|
|||
|
* concurrency hazards.
|
|||
|
*
|
|||
|
* @param credential - the underlying TokenCredential that provides the access
|
|||
|
* token
|
|||
|
* @param scopes - the scopes to request authorization for
|
|||
|
* @param tokenCyclerOptions - optionally override default settings for the cycler
|
|||
|
*
|
|||
|
* @returns - a function that reliably produces a valid access token
|
|||
|
*/function s(e,t,r){let i=null,a=null,s=Object.assign(Object.assign({},n),r),u={/**
|
|||
|
* Produces true if a refresh job is currently in progress.
|
|||
|
*/get isRefreshing(){return null!==i;},/**
|
|||
|
* Produces true if the cycler SHOULD refresh (we are within the refresh
|
|||
|
* window and not already refreshing)
|
|||
|
*/get shouldRefresh(){var c;return!u.isRefreshing&&(null!==(c=null==a?void 0:a.expiresOnTimestamp)&&void 0!==c?c:0)-s.refreshWindowInMs<Date.now();},/**
|
|||
|
* Produces true if the cycler MUST refresh (null or nearly-expired
|
|||
|
* token).
|
|||
|
*/get mustRefresh(){return null===a||a.expiresOnTimestamp-s.forcedRefreshWindowInMs<Date.now();}};/**
|
|||
|
* Starts a refresh job or returns the existing job if one is already
|
|||
|
* running.
|
|||
|
*/function l(r){var n;if(!u.isRefreshing){// We bind `scopes` here to avoid passing it around a lot
|
|||
|
let u=()=>e.getToken(t,r);// Take advantage of promise chaining to insert an assignment to `token`
|
|||
|
// before the refresh can be considered done.
|
|||
|
i=o(u,s.retryIntervalInMs,null!==(n=null==a?void 0:a.expiresOnTimestamp)&&void 0!==n?n:Date.now()).then(e=>(i=null,a=e)).catch(e=>{throw(// We also should reset the refresher if we enter a failed state. All
|
|||
|
// existing awaiters will throw, but subsequent requests will start a
|
|||
|
// new retry chain.
|
|||
|
i=null,a=null,e);});}return i;}return async e=>//
|
|||
|
// Simple rules:
|
|||
|
// - If we MUST refresh, then return the refresh task, blocking
|
|||
|
// the pipeline until a token is available.
|
|||
|
// - If we SHOULD refresh, then run refresh but don't return it
|
|||
|
// (we can still use the cached token).
|
|||
|
// - Return the token, since it's fine if we didn't return in
|
|||
|
// step 1.
|
|||
|
//
|
|||
|
u.mustRefresh?l(e):(u.shouldRefresh&&l(e),a);}function u(e,t){// This simple function encapsulates the entire process of reliably retrieving the token
|
|||
|
let a=s(e,t/* , options */);class n extends r.BaseRequestPolicy{constructor(e,t){super(e,t);}async sendRequest(e){if(!e.url.toLowerCase().startsWith("https://"))throw Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");let{token:t}=await a({abortSignal:e.abortSignal,tracingOptions:{tracingContext:e.tracingContext}});return e.headers.set(i.Constants.HeaderConstants.AUTHORIZATION,`Bearer ${t}`),this._nextPolicy.sendRequest(e);}}return{create:(e,t)=>new n(e,t)};}}),parcelRequire.register("37P36",function(e,t){let r;$parcel$export(e.exports,"getCachedDefaultHttpClient",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var i=parcelRequire("e5vqu");function a(){return r||(r=new i.NodeFetchHttpClient()),r;}}),parcelRequire.register("3SEeK",function(e,t){$parcel$export(e.exports,"ndJsonPolicy",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
// BaseRequestPolicy has a protected constructor.
|
|||
|
/* eslint-disable @typescript-eslint/no-useless-constructor */var r=parcelRequire("42Oo8");function i(){return{create:(e,t)=>new a(e,t)};}/**
|
|||
|
* NdJsonPolicy that formats a JSON array as newline-delimited JSON
|
|||
|
*/class a extends r.BaseRequestPolicy{/**
|
|||
|
* Creates an instance of KeepAlivePolicy.
|
|||
|
*/constructor(e,t){super(e,t);}/**
|
|||
|
* Sends a request.
|
|||
|
*/async sendRequest(e){// There currently isn't a good way to bypass the serializer
|
|||
|
if("string"==typeof e.body&&e.body.startsWith("[")){let t=JSON.parse(e.body);Array.isArray(t)&&(e.body=t.map(e=>JSON.stringify(e)+"\n").join(""));}return this._nextPolicy.sendRequest(e);}}}),parcelRequire.register("7wQUW",function(e,t){$parcel$export(e.exports,"rpRegistrationPolicy",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("8sP3n"),i=parcelRequire("42Oo8"),a=parcelRequire("abB4m");function n(e=30){return{create:(t,r)=>new o(t,r,e)};}class o extends i.BaseRequestPolicy{constructor(e,t,r=30){super(e,t),this._retryTimeout=r;}sendRequest(e){return this._nextPolicy.sendRequest(e.clone()).then(t=>s(this,e,t));}}function s(e,t,i){if(409===i.status){let a=c(i.bodyAsText);if(a){let n=l(t.url);return p(e,n,a,t)// Autoregistration of ${provider} failed for some reason. We will not return this error
|
|||
|
// instead will return the initial response with 409 status code back to the user.
|
|||
|
// do nothing here as we are returning the original response at the end of this method.
|
|||
|
.catch(()=>!1).then(a=>a?(// Retry the original request. We have to change the x-ms-client-request-id
|
|||
|
// otherwise Azure endpoint will return the initial 409 (cached) response.
|
|||
|
t.headers.set("x-ms-client-request-id",r.generateUuid()),e._nextPolicy.sendRequest(t.clone())):i);}}return Promise.resolve(i);}/**
|
|||
|
* Reuses the headers of the original request and url (if specified).
|
|||
|
* @param originalRequest - The original request
|
|||
|
* @param reuseUrlToo - Should the url from the original request be reused as well. Default false.
|
|||
|
* @returns A new request object with desired headers.
|
|||
|
*/function u(e,t=!1){let i=e.clone();return t&&(i.url=e.url),// We have to change the x-ms-client-request-id otherwise Azure endpoint
|
|||
|
// will return the initial 409 (cached) response.
|
|||
|
i.headers.set("x-ms-client-request-id",r.generateUuid()),// Set content-type to application/json
|
|||
|
i.headers.set("Content-Type","application/json; charset=utf-8"),i;}/**
|
|||
|
* Validates the error code and message associated with 409 response status code. If it matches to that of
|
|||
|
* RP not registered then it returns the name of the RP else returns undefined.
|
|||
|
* @param body - The response body received after making the original request.
|
|||
|
* @returns The name of the RP if condition is satisfied else undefined.
|
|||
|
*/function c(e){let t,r;if(e){try{r=JSON.parse(e);}catch(e){// do nothing;
|
|||
|
}if(r&&r.error&&r.error.message&&r.error.code&&"MissingSubscriptionRegistration"===r.error.code){let e=r.error.message.match(/.*'(.*)'/i);e&&(t=e.pop());}}return t;}/**
|
|||
|
* Extracts the first part of the URL, just after subscription:
|
|||
|
* https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/
|
|||
|
* @param url - The original request url
|
|||
|
* @returns The url prefix as explained above.
|
|||
|
*/function l(e){let t;let r=e.match(/.*\/subscriptions\/[a-f0-9-]+\//gi);if(r&&r[0])t=r[0];else throw Error(`Unable to extract subscriptionId from the given url - ${e}.`);return t;}/**
|
|||
|
* Registers the given provider.
|
|||
|
* @param policy - The RPRegistrationPolicy this function is being called against.
|
|||
|
* @param urlPrefix - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/
|
|||
|
* @param provider - The provider name to be registered.
|
|||
|
* @param originalRequest - The original request sent by the user that returned a 409 response
|
|||
|
* with a message that the provider is not registered.
|
|||
|
*/async function p(e,t,r,i){let a=`${t}providers/${r}/register?api-version=2016-02-01`,n=`${t}providers/${r}?api-version=2016-02-01`,o=u(i);o.method="POST",o.url=a;let s=await e._nextPolicy.sendRequest(o);if(200!==s.status)throw Error(`Autoregistration of ${r} failed. Please try registering manually.`);return d(e,n,i);}/**
|
|||
|
* Polls the registration status of the provider that was registered. Polling happens at an interval of 30 seconds.
|
|||
|
* Polling will happen till the registrationState property of the response body is "Registered".
|
|||
|
* @param policy - The RPRegistrationPolicy this function is being called against.
|
|||
|
* @param url - The request url for polling
|
|||
|
* @param originalRequest - The original request sent by the user that returned a 409 response
|
|||
|
* with a message that the provider is not registered.
|
|||
|
* @returns True if RP Registration is successful.
|
|||
|
*/async function d(e,t,r){let i=u(r);i.url=t,i.method="GET";let n=await e._nextPolicy.sendRequest(i),o=n.parsedBody;return!!n.parsedBody&&!!o.registrationState&&"Registered"===o.registrationState||(await(0,a.delay)(1e3*e._retryTimeout),d(e,t,r));}}),parcelRequire.register("kWBuP",function(e,t){$parcel$export(e.exports,"signingPolicy",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8");function i(e){return{create:(t,r)=>new a(t,r,e)};}class a extends r.BaseRequestPolicy{constructor(e,t,r){super(e,t),this.authenticationProvider=r;}signRequest(e){return this.authenticationProvider.signRequest(e);}sendRequest(e){return this.signRequest(e).then(e=>this._nextPolicy.sendRequest(e));}}}),parcelRequire.register("8JYh8",function(e,t){$parcel$export(e.exports,"systemErrorRetryPolicy",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8"),i=parcelRequire("5QV0w"),a=parcelRequire("abB4m");function n(e,t,r,i){return{create:(a,n)=>new o(a,n,e,t,r,i)};}class o extends r.BaseRequestPolicy{constructor(e,t,r,a,n,o){super(e,t),this.retryCount=(0,i.isNumber)(r)?r:i.DEFAULT_CLIENT_RETRY_COUNT,this.retryInterval=(0,i.isNumber)(a)?a:i.DEFAULT_CLIENT_RETRY_INTERVAL,this.minRetryInterval=(0,i.isNumber)(n)?n:i.DEFAULT_CLIENT_MIN_RETRY_INTERVAL,this.maxRetryInterval=(0,i.isNumber)(o)?o:i.DEFAULT_CLIENT_MAX_RETRY_INTERVAL;}sendRequest(e){return this._nextPolicy.sendRequest(e.clone()).catch(t=>s(this,e,t.response,t));}}async function s(e,t,r,n,o){function u(e,t){return!!t&&!!t.code&&("ETIMEDOUT"===t.code||"ESOCKETTIMEDOUT"===t.code||"ECONNREFUSED"===t.code||"ECONNRESET"===t.code||"ENOENT"===t.code);}if(o=(0,i.updateRetryData)(e,o,n),!(0,i.shouldRetry)(e.retryCount,u,o,r,n))return n?Promise.reject(o.error):r;try{return await(0,a.delay)(o.retryInterval),e._nextPolicy.sendRequest(t.clone());}catch(i){return s(e,t,r,i,o);}}}),parcelRequire.register("1yvfc",function(e,t){$parcel$export(e.exports,"throttlingRetryPolicy",()=>u);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("42Oo8"),i=parcelRequire("708hs"),a=parcelRequire("9PBIu"),n=parcelRequire("9ceU8"),o=parcelRequire("abB4m");let s=a.Constants.HttpConstants.StatusCodes;function u(){return{create:(e,t)=>new l(e,t)};}let c="The operation was aborted.";class l extends r.BaseRequestPolicy{constructor(e,t,r){super(e,t),this.numberOfRetries=0,this._handleResponse=r||this._defaultResponseHandler;}async sendRequest(e){let t=await this._nextPolicy.sendRequest(e.clone());return t.status!==s.TooManyRequests&&t.status!==s.ServiceUnavailable?t:this._handleResponse(e,t);}async _defaultResponseHandler(e,t){var r;let s=t.headers.get(a.Constants.HeaderConstants.RETRY_AFTER);if(s){let t=l.parseRetryAfterHeader(s);if(t){if(this.numberOfRetries+=1,await(0,o.delay)(t,{abortSignal:e.abortSignal,abortErrorMsg:c}),null===(r=e.abortSignal)||void 0===r?void 0:r.aborted)throw new i.AbortError(c);return this.numberOfRetries<n.DEFAULT_CLIENT_MAX_RETRY_COUNT?this.sendRequest(e):this._nextPolicy.sendRequest(e);}}return t;}static parseRetryAfterHeader(e){let t=Number(e);return Number.isNaN(t)?l.parseDateRetryAfterHeader(e):1e3*t;}static parseDateRetryAfterHeader(e){try{let t=Date.now(),r=Date.parse(e),i=r-t;return Number.isNaN(i)?void 0:i;}catch(e){return;}}}}),parcelRequire.register("9ceU8",function(e,t){$parcel$export(e.exports,"DEFAULT_CLIENT_MAX_RETRY_COUNT",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* Maximum number of retries for the throttling retry policy
|
|||
|
*/let r=3;}),parcelRequire.register("iokdY",function(e,t){var r;$parcel$export(e.exports,"Batch",()=>i),function(e){e[e.Good=0]="Good",e[e.Error=1]="Error";}(r||(r={}));class i{/**
|
|||
|
* Creates an instance of Batch.
|
|||
|
* @param concurrency -
|
|||
|
*/constructor(e=5){if(/**
|
|||
|
* Number of active operations under execution.
|
|||
|
*/this.actives=0,/**
|
|||
|
* Number of completed operations under execution.
|
|||
|
*/this.completed=0,/**
|
|||
|
* Offset of next operation to be executed.
|
|||
|
*/this.offset=0,/**
|
|||
|
* Operation array to be executed.
|
|||
|
*/this.operations=[],/**
|
|||
|
* States of Batch. When an error happens, state will turn into error.
|
|||
|
* Batch will stop execute left operations.
|
|||
|
*/this.state=r.Good,e<1)throw RangeError("concurrency must be larger than 0");this.concurrency=e,this.emitter=new $k14yv$events.EventEmitter();}/**
|
|||
|
* Add a operation into queue.
|
|||
|
*
|
|||
|
* @param operation -
|
|||
|
*/addOperation(e){this.operations.push(async()=>{try{this.actives++,await e(),this.actives--,this.completed++,this.parallelExecute();}catch(e){this.emitter.emit("error",e);}});}/**
|
|||
|
* Start execute operations in the queue.
|
|||
|
*
|
|||
|
*/async do(){return 0===this.operations.length?Promise.resolve():(this.parallelExecute(),new Promise((e,t)=>{this.emitter.on("finish",e),this.emitter.on("error",e=>{this.state=r.Error,t(e);});}));}/**
|
|||
|
* Get next operation to be executed. Return null when reaching ends.
|
|||
|
*
|
|||
|
*/nextOperation(){return this.offset<this.operations.length?this.operations[this.offset++]:null;}/**
|
|||
|
* Start execute operations. One one the most important difference between
|
|||
|
* this method with do() is that do() wraps as an sync method.
|
|||
|
*
|
|||
|
*/parallelExecute(){if(this.state!==r.Error){if(this.completed>=this.operations.length){this.emitter.emit("finish");return;}for(;this.actives<this.concurrency;){let e=this.nextOperation();if(!e)return;e();}}}}}),parcelRequire.register("bpW3y",function(e,t){$parcel$export(e.exports,"BufferScheduler",()=>i);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("gvg1d");class i{/**
|
|||
|
* Creates an instance of BufferScheduler.
|
|||
|
*
|
|||
|
* @param readable - A Node.js Readable stream
|
|||
|
* @param bufferSize - Buffer size of every maintained buffer
|
|||
|
* @param maxBuffers - How many buffers can be allocated
|
|||
|
* @param outgoingHandler - An async function scheduled to be
|
|||
|
* triggered when a buffer fully filled
|
|||
|
* with stream data
|
|||
|
* @param concurrency - Concurrency of executing outgoingHandlers (>0)
|
|||
|
* @param encoding - [Optional] Encoding of Readable stream when it's a string stream
|
|||
|
*/constructor(e,t,r,i,a,n){if(/**
|
|||
|
* An internal event emitter.
|
|||
|
*/this.emitter=new $k14yv$events.EventEmitter(),/**
|
|||
|
* An internal offset marker to track data offset in bytes of next outgoingHandler.
|
|||
|
*/this.offset=0,/**
|
|||
|
* An internal marker to track whether stream is end.
|
|||
|
*/this.isStreamEnd=!1,/**
|
|||
|
* An internal marker to track whether stream or outgoingHandler returns error.
|
|||
|
*/this.isError=!1,/**
|
|||
|
* How many handlers are executing.
|
|||
|
*/this.executingOutgoingHandlers=0,/**
|
|||
|
* How many buffers have been allocated.
|
|||
|
*/this.numBuffers=0,/**
|
|||
|
* Because this class doesn't know how much data every time stream pops, which
|
|||
|
* is defined by highWaterMarker of the stream. So BufferScheduler will cache
|
|||
|
* data received from the stream, when data in unresolvedDataArray exceeds the
|
|||
|
* blockSize defined, it will try to concat a blockSize of buffer, fill into available
|
|||
|
* buffers from incoming and push to outgoing array.
|
|||
|
*/this.unresolvedDataArray=[],/**
|
|||
|
* How much data consisted in unresolvedDataArray.
|
|||
|
*/this.unresolvedLength=0,/**
|
|||
|
* The array includes all the available buffers can be used to fill data from stream.
|
|||
|
*/this.incoming=[],/**
|
|||
|
* The array (queue) includes all the buffers filled from stream data.
|
|||
|
*/this.outgoing=[],t<=0)throw RangeError(`bufferSize must be larger than 0, current is ${t}`);if(r<=0)throw RangeError(`maxBuffers must be larger than 0, current is ${r}`);if(a<=0)throw RangeError(`concurrency must be larger than 0, current is ${a}`);this.bufferSize=t,this.maxBuffers=r,this.readable=e,this.outgoingHandler=i,this.concurrency=a,this.encoding=n;}/**
|
|||
|
* Start the scheduler, will return error when stream of any of the outgoingHandlers
|
|||
|
* returns error.
|
|||
|
*
|
|||
|
*/async do(){return new Promise((e,t)=>{this.readable.on("data",e=>{e="string"==typeof e?Buffer.from(e,this.encoding):e,this.appendUnresolvedData(e),this.resolveData()||this.readable.pause();}),this.readable.on("error",e=>{this.emitter.emit("error",e);}),this.readable.on("end",()=>{this.isStreamEnd=!0,this.emitter.emit("checkEnd");}),this.emitter.on("error",e=>{this.isError=!0,this.readable.pause(),t(e);}),this.emitter.on("checkEnd",()=>{if(this.outgoing.length>0){this.triggerOutgoingHandlers();return;}if(this.isStreamEnd&&0===this.executingOutgoingHandlers){if(this.unresolvedLength>0&&this.unresolvedLength<this.bufferSize){let r=this.shiftBufferFromUnresolvedDataArray();this.outgoingHandler(()=>r.getReadableStream(),r.size,this.offset).then(e).catch(t);}else{if(this.unresolvedLength>=this.bufferSize)return;e();}}});});}/**
|
|||
|
* Insert a new data into unresolved array.
|
|||
|
*
|
|||
|
* @param data -
|
|||
|
*/appendUnresolvedData(e){this.unresolvedDataArray.push(e),this.unresolvedLength+=e.length;}/**
|
|||
|
* Try to shift a buffer with size in blockSize. The buffer returned may be less
|
|||
|
* than blockSize when data in unresolvedDataArray is less than bufferSize.
|
|||
|
*
|
|||
|
*/shiftBufferFromUnresolvedDataArray(e){return e?e.fill(this.unresolvedDataArray,this.unresolvedLength):e=new r.PooledBuffer(this.bufferSize,this.unresolvedDataArray,this.unresolvedLength),this.unresolvedLength-=e.size,e;}/**
|
|||
|
* Resolve data in unresolvedDataArray. For every buffer with size in blockSize
|
|||
|
* shifted, it will try to get (or allocate a buffer) from incoming, and fill it,
|
|||
|
* then push it into outgoing to be handled by outgoing handler.
|
|||
|
*
|
|||
|
* Return false when available buffers in incoming are not enough, else true.
|
|||
|
*
|
|||
|
* @returns Return false when buffers in incoming are not enough, else true.
|
|||
|
*/resolveData(){for(;this.unresolvedLength>=this.bufferSize;){let e;if(this.incoming.length>0)e=this.incoming.shift(),this.shiftBufferFromUnresolvedDataArray(e);else{if(!(this.numBuffers<this.maxBuffers))return!1;e=this.shiftBufferFromUnresolvedDataArray(),this.numBuffers++;}this.outgoing.push(e),this.triggerOutgoingHandlers();}return!0;}/**
|
|||
|
* Try to trigger a outgoing handler for every buffer in outgoing. Stop when
|
|||
|
* concurrency reaches.
|
|||
|
*/async triggerOutgoingHandlers(){let e;do{if(this.executingOutgoingHandlers>=this.concurrency)return;(e=this.outgoing.shift())&&this.triggerOutgoingHandler(e);}while(e);}/**
|
|||
|
* Trigger a outgoing handler for a buffer shifted from outgoing.
|
|||
|
*
|
|||
|
* @param buffer -
|
|||
|
*/async triggerOutgoingHandler(e){let t=e.size;this.executingOutgoingHandlers++,this.offset+=t;try{await this.outgoingHandler(()=>e.getReadableStream(),t,this.offset-t);}catch(e){this.emitter.emit("error",e);return;}this.executingOutgoingHandlers--,this.reuseBuffer(e),this.emitter.emit("checkEnd");}/**
|
|||
|
* Return buffer used by outgoing handler into incoming.
|
|||
|
*
|
|||
|
* @param buffer -
|
|||
|
*/reuseBuffer(e){this.incoming.push(e),!this.isError&&this.resolveData()&&!this.isStreamEnd&&this.readable.resume();}}}),parcelRequire.register("gvg1d",function(e,t){$parcel$export(e.exports,"PooledBuffer",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("7wFkZ");/**
|
|||
|
* maxBufferLength is max size of each buffer in the pooled buffers.
|
|||
|
*/ // Can't use import as Typescript doesn't recognize "buffer".
|
|||
|
let i=$k14yv$buffer.constants.MAX_LENGTH;class a{constructor(e,t,r){/**
|
|||
|
* Internal buffers used to keep the data.
|
|||
|
* Each buffer has a length of the maxBufferLength except last one.
|
|||
|
*/this.buffers=[],this.capacity=e,this._size=0;// allocate
|
|||
|
let a=Math.ceil(e/i);for(let t=0;t<a;t++){let r=t===a-1?e%i:i;0===r&&(r=i),this.buffers.push(Buffer.allocUnsafe(r));}t&&this.fill(t,r);}/**
|
|||
|
* The size of the data contained in the pooled buffers.
|
|||
|
*/get size(){return this._size;}/**
|
|||
|
* Fill the internal buffers with data in the input buffers serially
|
|||
|
* with respect to the total length and the total capacity of the internal buffers.
|
|||
|
* Data copied will be shift out of the input buffers.
|
|||
|
*
|
|||
|
* @param buffers - Input buffers containing the data to be filled in the pooled buffer
|
|||
|
* @param totalLength - Total length of the data to be filled in.
|
|||
|
*
|
|||
|
*/fill(e,t){this._size=Math.min(this.capacity,t);let r=0,i=0,a=0,n=0,o=0;for(;o<this._size;){let t=e[r],s=this.buffers[i],u=t.copy(s,a,n);o+=u,n+=u,a+=u,n===t.length&&(r++,n=0),a===s.length&&(i++,a=0);}// clear copied from source buffers
|
|||
|
e.splice(0,r),e.length>0&&(e[0]=e[0].slice(n));}/**
|
|||
|
* Get the readable stream assembled from all the data in the internal buffers.
|
|||
|
*
|
|||
|
*/getReadableStream(){return new r.BuffersStream(this.buffers,this.size);}}}),parcelRequire.register("7wFkZ",function(e,t){$parcel$export(e.exports,"BuffersStream",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
class r extends $k14yv$stream.Readable{/**
|
|||
|
* Creates an instance of BuffersStream that will emit the data
|
|||
|
* contained in the array of buffers.
|
|||
|
*
|
|||
|
* @param buffers - Array of buffers containing the data
|
|||
|
* @param byteLength - The total length of data contained in the buffers
|
|||
|
*/constructor(e,t,r){super(r),this.buffers=e,this.byteLength=t,this.byteOffsetInCurrentBuffer=0,this.bufferIndex=0,this.pushedBytesLength=0;// check byteLength is no larger than buffers[] total length
|
|||
|
let i=0;for(let e of this.buffers)i+=e.byteLength;if(i<this.byteLength)throw Error("Data size shouldn't be larger than the total length of buffers.");}/**
|
|||
|
* Internal _read() that will be called when the stream wants to pull more data in.
|
|||
|
*
|
|||
|
* @param size - Optional. The size of data to be read
|
|||
|
*/_read(e){this.pushedBytesLength>=this.byteLength&&this.push(null),e||(e=this.readableHighWaterMark);let t=[],r=0;for(;r<e&&this.pushedBytesLength<this.byteLength;){// The last buffer may be longer than the data it contains.
|
|||
|
let i=this.byteLength-this.pushedBytesLength,a=this.buffers[this.bufferIndex].byteLength-this.byteOffsetInCurrentBuffer,n=Math.min(a,i);if(n>e-r){// chunkSize = size - i
|
|||
|
let i=this.byteOffsetInCurrentBuffer+e-r;t.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer,i)),this.pushedBytesLength+=e-r,this.byteOffsetInCurrentBuffer=i,r=e;break;}{// chunkSize = remaining
|
|||
|
let e=this.byteOffsetInCurrentBuffer+n;t.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer,e)),n===a?(// this.buffers[this.bufferIndex] used up, shift to next one
|
|||
|
this.byteOffsetInCurrentBuffer=0,this.bufferIndex++):this.byteOffsetInCurrentBuffer=e,this.pushedBytesLength+=n,r+=n;}}t.length>1?this.push(Buffer.concat(t)):1===t.length&&this.push(t[0]);}}}),parcelRequire.register("gXPSw",function(e,t){$parcel$export(e.exports,"createSpan",()=>i),$parcel$export(e.exports,"convertTracingToRequestOptionsBase",()=>a);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("baIZW");let i=(0,r.createSpanFunction)({packagePrefix:"Azure.Storage.Blob",namespace:"Microsoft.Storage"});function a(e){var t,r;return{// By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier.
|
|||
|
spanOptions:null===(t=null==e?void 0:e.tracingOptions)||void 0===t?void 0:t.spanOptions,tracingContext:null===(r=null==e?void 0:e.tracingOptions)||void 0===r?void 0:r.tracingContext};}}),parcelRequire.register("1kLfv",function(e,t){$parcel$export(e.exports,"streamToBuffer",()=>i),$parcel$export(e.exports,"readStreamToLocalFile",()=>a),$parcel$export(e.exports,"fsStat",()=>n),$parcel$export(e.exports,"fsCreateReadStream",()=>o);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("5MFjo");async function i(e,t,i,a,n){let o=0,s=a-i;// Position in stream
|
|||
|
return new Promise((a,u)=>{let c=setTimeout(()=>u(Error("The operation cannot be completed in timeout.")),r.REQUEST_TIMEOUT);e.on("readable",()=>{if(o>=s){clearTimeout(c),a();return;}let r=e.read();if(!r)return;"string"==typeof r&&(r=Buffer.from(r,n));// How much data needed in this chunk
|
|||
|
let u=o+r.length>s?s-o:r.length;t.fill(r.slice(0,u),i+o,i+o+u),o+=u;}),e.on("end",()=>{clearTimeout(c),o<s&&u(Error(`Stream drains before getting enough data needed. Data read: ${o}, data need: ${s}`)),a();}),e.on("error",e=>{clearTimeout(c),u(e);});});}async function a(e,t){return new Promise((r,i)=>{let a=$k14yv$fs.createWriteStream(t);e.on("error",e=>{i(e);}),a.on("error",e=>{i(e);}),a.on("close",r),e.pipe(a);});}let n=$k14yv$util.promisify($k14yv$fs.stat),o=$k14yv$fs.createReadStream;}),parcelRequire.register("1lqbk",function(e,t){$parcel$export(e.exports,"generateBlobSASQueryParameters",()=>l);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("ddpK3"),i=parcelRequire("2GvCp"),a=parcelRequire("cLpTG"),n=parcelRequire("kSgXk"),o=parcelRequire("4Lscn"),s=parcelRequire("aTFdr"),u=parcelRequire("5MFjo"),c=parcelRequire("e7JkV");function l(e,t,r){let i;let o=e.version?e.version:u.SERVICE_VERSION,s=t instanceof a.StorageSharedKeyCredential?t:void 0;if(void 0===s&&void 0!==r&&(i=new n.UserDelegationKeyCredential(r,t)),void 0===s&&void 0===i)throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName.");// Version 2020-12-06 adds support for encryptionscope in SAS.
|
|||
|
if(o>="2020-12-06")return void 0!==s?m(e,s):f(e,i);// Version 2019-12-12 adds support for the blob tags permission.
|
|||
|
// Version 2018-11-09 adds support for the signed resource and signed blob snapshot time fields.
|
|||
|
// https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas#constructing-the-signature-string
|
|||
|
if(o>="2018-11-09")return void 0!==s?d(e,s):// Version 2020-02-10 delegation SAS signature construction includes preauthorizedAgentObjectId, agentObjectId, correlationId.
|
|||
|
o>="2020-02-10"?x(e,i):h(e,i);if(o>="2015-04-05"){if(void 0!==s)return p(e,s);throw RangeError("'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key.");}throw RangeError("'version' must be >= '2015-04-05'.");}/**
|
|||
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|||
|
* IMPLEMENTATION FOR API VERSION FROM 2015-04-05 AND BEFORE 2018-11-09.
|
|||
|
*
|
|||
|
* Creates an instance of SASQueryParameters.
|
|||
|
*
|
|||
|
* Only accepts required settings needed to create a SAS. For optional settings please
|
|||
|
* set corresponding properties directly, such as permissions, startsOn and identifier.
|
|||
|
*
|
|||
|
* WARNING: When identifier is not provided, permissions and expiresOn are required.
|
|||
|
* You MUST assign value to identifier or expiresOn & permissions manually if you initial with
|
|||
|
* this constructor.
|
|||
|
*
|
|||
|
* @param blobSASSignatureValues -
|
|||
|
* @param sharedKeyCredential -
|
|||
|
*/function p(e,t){let a;if(!(e=D(e)).identifier&&!(e.permissions&&e.expiresOn))throw RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");let n="c";e.blobName&&(n="b"),e.permissions&&(a=e.blobName?(0,r.BlobSASPermissions).parse(e.permissions.toString()).toString():(0,i.ContainerSASPermissions).parse(e.permissions.toString()).toString());// Signature is generated on the un-url-encoded values.
|
|||
|
let u=[a||"",e.startsOn?(0,c.truncatedISO8061Date)(e.startsOn,!1):"",e.expiresOn?(0,c.truncatedISO8061Date)(e.expiresOn,!1):"",g(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?(0,o.ipRangeToString)(e.ipRange):"",e.protocol?e.protocol:"",e.version,e.cacheControl?e.cacheControl:"",e.contentDisposition?e.contentDisposition:"",e.contentEncoding?e.contentEncoding:"",e.contentLanguage?e.contentLanguage:"",e.contentType?e.contentType:""].join("\n"),l=t.computeHMACSHA256(u);return new s.SASQueryParameters(e.version,l,a,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType);}/**
|
|||
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|||
|
* IMPLEMENTATION FOR API VERSION FROM 2018-11-09.
|
|||
|
*
|
|||
|
* Creates an instance of SASQueryParameters.
|
|||
|
*
|
|||
|
* Only accepts required settings needed to create a SAS. For optional settings please
|
|||
|
* set corresponding properties directly, such as permissions, startsOn and identifier.
|
|||
|
*
|
|||
|
* WARNING: When identifier is not provided, permissions and expiresOn are required.
|
|||
|
* You MUST assign value to identifier or expiresOn & permissions manually if you initial with
|
|||
|
* this constructor.
|
|||
|
*
|
|||
|
* @param blobSASSignatureValues -
|
|||
|
* @param sharedKeyCredential -
|
|||
|
*/function d(e,t){let a;if(!(e=D(e)).identifier&&!(e.permissions&&e.expiresOn))throw RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");let n="c",u=e.snapshotTime;e.blobName&&(n="b",e.snapshotTime?n="bs":e.versionId&&(n="bv",u=e.versionId)),e.permissions&&(a=e.blobName?(0,r.BlobSASPermissions).parse(e.permissions.toString()).toString():(0,i.ContainerSASPermissions).parse(e.permissions.toString()).toString());// Signature is generated on the un-url-encoded values.
|
|||
|
let l=[a||"",e.startsOn?(0,c.truncatedISO8061Date)(e.startsOn,!1):"",e.expiresOn?(0,c.truncatedISO8061Date)(e.expiresOn,!1):"",g(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?(0,o.ipRangeToString)(e.ipRange):"",e.protocol?e.protocol:"",e.version,n,u,e.cacheControl?e.cacheControl:"",e.contentDisposition?e.contentDisposition:"",e.contentEncoding?e.contentEncoding:"",e.contentLanguage?e.contentLanguage:"",e.contentType?e.contentType:""].join("\n"),p=t.computeHMACSHA256(l);return new s.SASQueryParameters(e.version,p,a,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType);}/**
|
|||
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|||
|
* IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
|
|||
|
*
|
|||
|
* Creates an instance of SASQueryParameters.
|
|||
|
*
|
|||
|
* Only accepts required settings needed to create a SAS. For optional settings please
|
|||
|
* set corresponding properties directly, such as permissions, startsOn and identifier.
|
|||
|
*
|
|||
|
* WARNING: When identifier is not provided, permissions and expiresOn are required.
|
|||
|
* You MUST assign value to identifier or expiresOn & permissions manually if you initial with
|
|||
|
* this constructor.
|
|||
|
*
|
|||
|
* @param blobSASSignatureValues -
|
|||
|
* @param sharedKeyCredential -
|
|||
|
*/function m(e,t){let a;if(!(e=D(e)).identifier&&!(e.permissions&&e.expiresOn))throw RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");let n="c",u=e.snapshotTime;e.blobName&&(n="b",e.snapshotTime?n="bs":e.versionId&&(n="bv",u=e.versionId)),e.permissions&&(a=e.blobName?(0,r.BlobSASPermissions).parse(e.permissions.toString()).toString():(0,i.ContainerSASPermissions).parse(e.permissions.toString()).toString());// Signature is generated on the un-url-encoded values.
|
|||
|
let l=[a||"",e.startsOn?(0,c.truncatedISO8061Date)(e.startsOn,!1):"",e.expiresOn?(0,c.truncatedISO8061Date)(e.expiresOn,!1):"",g(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?(0,o.ipRangeToString)(e.ipRange):"",e.protocol?e.protocol:"",e.version,n,u,e.encryptionScope,e.cacheControl?e.cacheControl:"",e.contentDisposition?e.contentDisposition:"",e.contentEncoding?e.contentEncoding:"",e.contentLanguage?e.contentLanguage:"",e.contentType?e.contentType:""].join("\n"),p=t.computeHMACSHA256(l);return new s.SASQueryParameters(e.version,p,a,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,void 0,void 0,void 0,e.encryptionScope);}/**
|
|||
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|||
|
* IMPLEMENTATION FOR API VERSION FROM 2018-11-09.
|
|||
|
*
|
|||
|
* Creates an instance of SASQueryParameters.
|
|||
|
*
|
|||
|
* Only accepts required settings needed to create a SAS. For optional settings please
|
|||
|
* set corresponding properties directly, such as permissions, startsOn.
|
|||
|
*
|
|||
|
* WARNING: identifier will be ignored, permissions and expiresOn are required.
|
|||
|
*
|
|||
|
* @param blobSASSignatureValues -
|
|||
|
* @param userDelegationKeyCredential -
|
|||
|
*/function h(e,t){let a;// Stored access policies are not supported for a user delegation SAS.
|
|||
|
if(!(e=D(e)).permissions||!e.expiresOn)throw RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");let n="c",u=e.snapshotTime;e.blobName&&(n="b",e.snapshotTime?n="bs":e.versionId&&(n="bv",u=e.versionId)),e.permissions&&(a=e.blobName?(0,r.BlobSASPermissions).parse(e.permissions.toString()).toString():(0,i.ContainerSASPermissions).parse(e.permissions.toString()).toString());// Signature is generated on the un-url-encoded values.
|
|||
|
let l=[a||"",e.startsOn?(0,c.truncatedISO8061Date)(e.startsOn,!1):"",e.expiresOn?(0,c.truncatedISO8061Date)(e.expiresOn,!1):"",g(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?(0,c.truncatedISO8061Date)(t.userDelegationKey.signedStartsOn,!1):"",t.userDelegationKey.signedExpiresOn?(0,c.truncatedISO8061Date)(t.userDelegationKey.signedExpiresOn,!1):"",t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.ipRange?(0,o.ipRangeToString)(e.ipRange):"",e.protocol?e.protocol:"",e.version,n,u,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join("\n"),p=t.computeHMACSHA256(l);return new s.SASQueryParameters(e.version,p,a,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey);}/**
|
|||
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|||
|
* IMPLEMENTATION FOR API VERSION FROM 2020-02-10.
|
|||
|
*
|
|||
|
* Creates an instance of SASQueryParameters.
|
|||
|
*
|
|||
|
* Only accepts required settings needed to create a SAS. For optional settings please
|
|||
|
* set corresponding properties directly, such as permissions, startsOn.
|
|||
|
*
|
|||
|
* WARNING: identifier will be ignored, permissions and expiresOn are required.
|
|||
|
*
|
|||
|
* @param blobSASSignatureValues -
|
|||
|
* @param userDelegationKeyCredential -
|
|||
|
*/function x(e,t){let a;// Stored access policies are not supported for a user delegation SAS.
|
|||
|
if(!(e=D(e)).permissions||!e.expiresOn)throw RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");let n="c",u=e.snapshotTime;e.blobName&&(n="b",e.snapshotTime?n="bs":e.versionId&&(n="bv",u=e.versionId)),e.permissions&&(a=e.blobName?(0,r.BlobSASPermissions).parse(e.permissions.toString()).toString():(0,i.ContainerSASPermissions).parse(e.permissions.toString()).toString());// Signature is generated on the un-url-encoded values.
|
|||
|
let l=[a||"",e.startsOn?(0,c.truncatedISO8061Date)(e.startsOn,!1):"",e.expiresOn?(0,c.truncatedISO8061Date)(e.expiresOn,!1):"",g(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?(0,c.truncatedISO8061Date)(t.userDelegationKey.signedStartsOn,!1):"",t.userDelegationKey.signedExpiresOn?(0,c.truncatedISO8061Date)(t.userDelegationKey.signedExpiresOn,!1):"",t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.preauthorizedAgentObjectId,void 0,e.correlationId,e.ipRange?(0,o.ipRangeToString)(e.ipRange):"",e.protocol?e.protocol:"",e.version,n,u,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join("\n"),p=t.computeHMACSHA256(l);return new s.SASQueryParameters(e.version,p,a,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId);}/**
|
|||
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|||
|
* IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
|
|||
|
*
|
|||
|
* Creates an instance of SASQueryParameters.
|
|||
|
*
|
|||
|
* Only accepts required settings needed to create a SAS. For optional settings please
|
|||
|
* set corresponding properties directly, such as permissions, startsOn.
|
|||
|
*
|
|||
|
* WARNING: identifier will be ignored, permissions and expiresOn are required.
|
|||
|
*
|
|||
|
* @param blobSASSignatureValues -
|
|||
|
* @param userDelegationKeyCredential -
|
|||
|
*/function f(e,t){let a;// Stored access policies are not supported for a user delegation SAS.
|
|||
|
if(!(e=D(e)).permissions||!e.expiresOn)throw RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");let n="c",u=e.snapshotTime;e.blobName&&(n="b",e.snapshotTime?n="bs":e.versionId&&(n="bv",u=e.versionId)),e.permissions&&(a=e.blobName?(0,r.BlobSASPermissions).parse(e.permissions.toString()).toString():(0,i.ContainerSASPermissions).parse(e.permissions.toString()).toString());// Signature is generated on the un-url-encoded values.
|
|||
|
let l=[a||"",e.startsOn?(0,c.truncatedISO8061Date)(e.startsOn,!1):"",e.expiresOn?(0,c.truncatedISO8061Date)(e.expiresOn,!1):"",g(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?(0,c.truncatedISO8061Date)(t.userDelegationKey.signedStartsOn,!1):"",t.userDelegationKey.signedExpiresOn?(0,c.truncatedISO8061Date)(t.userDelegationKey.signedExpiresOn,!1):"",t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.preauthorizedAgentObjectId,void 0,e.correlationId,e.ipRange?(0,o.ipRangeToString)(e.ipRange):"",e.protocol?e.protocol:"",e.version,n,u,e.encryptionScope,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join("\n"),p=t.computeHMACSHA256(l);return new s.SASQueryParameters(e.version,p,a,void 0,void 0,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,n,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId,e.encryptionScope);}function g(e,t,r){// Container: "/blob/account/containerName"
|
|||
|
// Blob: "/blob/account/containerName/blobName"
|
|||
|
let i=[`/blob/${e}/${t}`];return r&&i.push(`/${r}`),i.join("");}function D(e){let t=e.version?e.version:u.SERVICE_VERSION;if(e.snapshotTime&&t<"2018-11-09")throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'.");if(void 0===e.blobName&&e.snapshotTime)throw RangeError("Must provide 'blobName' when providing 'snapshotTime'.");if(e.versionId&&t<"2019-10-10")throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'.");if(void 0===e.blobName&&e.versionId)throw RangeError("Must provide 'blobName' when providing 'versionId'.");if(e.permissions&&e.permissions.setImmutabilityPolicy&&t<"2020-08-04")throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission.");if(e.permissions&&e.permissions.deleteVersion&&t<"2019-10-10")throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.");if(e.permissions&&e.permissions.permanentDelete&&t<"2019-10-10")throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission.");if(e.permissions&&e.permissions.tag&&t<"2019-12-12")throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission.");if(t<"2020-02-10"&&e.permissions&&(e.permissions.move||e.permissions.execute))throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.");if(t<"2021-04-10"&&e.permissions&&e.permissions.filterByTags)throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission.");if(t<"2020-02-10"&&(e.preauthorizedAgentObjectId||e.correlationId))throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.");if(e.encryptionScope&&t<"2020-12-06")throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");return e.version=t,e;}}),parcelRequire.register("ddpK3",function(e,t){$parcel$export(e.exports,"BlobSASPermissions",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|||
|
*
|
|||
|
* This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a blob. Setting
|
|||
|
* a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all
|
|||
|
* the values are set, this should be serialized with toString and set as the permissions field on a
|
|||
|
* {@link BlobSASSignatureValues} object. It is possible to construct the permissions string without this class, but
|
|||
|
* the order of the permissions is particular and this class guarantees correctness.
|
|||
|
*/class r{constructor(){/**
|
|||
|
* Specifies Read access granted.
|
|||
|
*/this.read=!1,/**
|
|||
|
* Specifies Add access granted.
|
|||
|
*/this.add=!1,/**
|
|||
|
* Specifies Create access granted.
|
|||
|
*/this.create=!1,/**
|
|||
|
* Specifies Write access granted.
|
|||
|
*/this.write=!1,/**
|
|||
|
* Specifies Delete access granted.
|
|||
|
*/this.delete=!1,/**
|
|||
|
* Specifies Delete version access granted.
|
|||
|
*/this.deleteVersion=!1,/**
|
|||
|
* Specfies Tag access granted.
|
|||
|
*/this.tag=!1,/**
|
|||
|
* Specifies Move access granted.
|
|||
|
*/this.move=!1,/**
|
|||
|
* Specifies Execute access granted.
|
|||
|
*/this.execute=!1,/**
|
|||
|
* Specifies SetImmutabilityPolicy access granted.
|
|||
|
*/this.setImmutabilityPolicy=!1,/**
|
|||
|
* Specifies that Permanent Delete is permitted.
|
|||
|
*/this.permanentDelete=!1;}/**
|
|||
|
* Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an
|
|||
|
* Error if it encounters a character that does not correspond to a valid permission.
|
|||
|
*
|
|||
|
* @param permissions -
|
|||
|
*/static parse(e){let t=new r();for(let r of e)switch(r){case"r":t.read=!0;break;case"a":t.add=!0;break;case"c":t.create=!0;break;case"w":t.write=!0;break;case"d":t.delete=!0;break;case"x":t.deleteVersion=!0;break;case"t":t.tag=!0;break;case"m":t.move=!0;break;case"e":t.execute=!0;break;case"i":t.setImmutabilityPolicy=!0;break;case"y":t.permanentDelete=!0;break;default:throw RangeError(`Invalid permission: ${r}`);}return t;}/**
|
|||
|
* Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it
|
|||
|
* and boolean values for them.
|
|||
|
*
|
|||
|
* @param permissionLike -
|
|||
|
*/static from(e){let t=new r();return e.read&&(t.read=!0),e.add&&(t.add=!0),e.create&&(t.create=!0),e.write&&(t.write=!0),e.delete&&(t.delete=!0),e.deleteVersion&&(t.deleteVersion=!0),e.tag&&(t.tag=!0),e.move&&(t.move=!0),e.execute&&(t.execute=!0),e.setImmutabilityPolicy&&(t.setImmutabilityPolicy=!0),e.permanentDelete&&(t.permanentDelete=!0),t;}/**
|
|||
|
* Converts the given permissions to a string. Using this method will guarantee the permissions are in an
|
|||
|
* order accepted by the service.
|
|||
|
*
|
|||
|
* @returns A string which represents the BlobSASPermissions
|
|||
|
*/toString(){let e=[];return this.read&&e.push("r"),this.add&&e.push("a"),this.create&&e.push("c"),this.write&&e.push("w"),this.delete&&e.push("d"),this.deleteVersion&&e.push("x"),this.tag&&e.push("t"),this.move&&e.push("m"),this.execute&&e.push("e"),this.setImmutabilityPolicy&&e.push("i"),this.permanentDelete&&e.push("y"),e.join("");}}}),parcelRequire.register("2GvCp",function(e,t){$parcel$export(e.exports,"ContainerSASPermissions",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a container.
|
|||
|
* Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation.
|
|||
|
* Once all the values are set, this should be serialized with toString and set as the permissions field on a
|
|||
|
* {@link BlobSASSignatureValues} object. It is possible to construct the permissions string without this class, but
|
|||
|
* the order of the permissions is particular and this class guarantees correctness.
|
|||
|
*/class r{constructor(){/**
|
|||
|
* Specifies Read access granted.
|
|||
|
*/this.read=!1,/**
|
|||
|
* Specifies Add access granted.
|
|||
|
*/this.add=!1,/**
|
|||
|
* Specifies Create access granted.
|
|||
|
*/this.create=!1,/**
|
|||
|
* Specifies Write access granted.
|
|||
|
*/this.write=!1,/**
|
|||
|
* Specifies Delete access granted.
|
|||
|
*/this.delete=!1,/**
|
|||
|
* Specifies Delete version access granted.
|
|||
|
*/this.deleteVersion=!1,/**
|
|||
|
* Specifies List access granted.
|
|||
|
*/this.list=!1,/**
|
|||
|
* Specfies Tag access granted.
|
|||
|
*/this.tag=!1,/**
|
|||
|
* Specifies Move access granted.
|
|||
|
*/this.move=!1,/**
|
|||
|
* Specifies Execute access granted.
|
|||
|
*/this.execute=!1,/**
|
|||
|
* Specifies SetImmutabilityPolicy access granted.
|
|||
|
*/this.setImmutabilityPolicy=!1,/**
|
|||
|
* Specifies that Permanent Delete is permitted.
|
|||
|
*/this.permanentDelete=!1,/**
|
|||
|
* Specifies that Filter Blobs by Tags is permitted.
|
|||
|
*/this.filterByTags=!1;}/**
|
|||
|
* Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an
|
|||
|
* Error if it encounters a character that does not correspond to a valid permission.
|
|||
|
*
|
|||
|
* @param permissions -
|
|||
|
*/static parse(e){let t=new r();for(let r of e)switch(r){case"r":t.read=!0;break;case"a":t.add=!0;break;case"c":t.create=!0;break;case"w":t.write=!0;break;case"d":t.delete=!0;break;case"l":t.list=!0;break;case"t":t.tag=!0;break;case"x":t.deleteVersion=!0;break;case"m":t.move=!0;break;case"e":t.execute=!0;break;case"i":t.setImmutabilityPolicy=!0;break;case"y":t.permanentDelete=!0;break;case"f":t.filterByTags=!0;break;default:throw RangeError(`Invalid permission ${r}`);}return t;}/**
|
|||
|
* Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it
|
|||
|
* and boolean values for them.
|
|||
|
*
|
|||
|
* @param permissionLike -
|
|||
|
*/static from(e){let t=new r();return e.read&&(t.read=!0),e.add&&(t.add=!0),e.create&&(t.create=!0),e.write&&(t.write=!0),e.delete&&(t.delete=!0),e.list&&(t.list=!0),e.deleteVersion&&(t.deleteVersion=!0),e.tag&&(t.tag=!0),e.move&&(t.move=!0),e.execute&&(t.execute=!0),e.setImmutabilityPolicy&&(t.setImmutabilityPolicy=!0),e.permanentDelete&&(t.permanentDelete=!0),e.filterByTags&&(t.filterByTags=!0),t;}/**
|
|||
|
* Converts the given permissions to a string. Using this method will guarantee the permissions are in an
|
|||
|
* order accepted by the service.
|
|||
|
*
|
|||
|
* The order of the characters should be as specified here to ensure correctness.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
|
|||
|
*
|
|||
|
*/toString(){let e=[];return this.read&&e.push("r"),this.add&&e.push("a"),this.create&&e.push("c"),this.write&&e.push("w"),this.delete&&e.push("d"),this.deleteVersion&&e.push("x"),this.list&&e.push("l"),this.tag&&e.push("t"),this.move&&e.push("m"),this.execute&&e.push("e"),this.setImmutabilityPolicy&&e.push("i"),this.permanentDelete&&e.push("y"),this.filterByTags&&e.push("f"),e.join("");}}}),parcelRequire.register("kSgXk",function(e,t){$parcel$export(e.exports,"UserDelegationKeyCredential",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
class r{/**
|
|||
|
* Creates an instance of UserDelegationKeyCredential.
|
|||
|
* @param accountName -
|
|||
|
* @param userDelegationKey -
|
|||
|
*/constructor(e,t){this.accountName=e,this.userDelegationKey=t,this.key=Buffer.from(t.value,"base64");}/**
|
|||
|
* Generates a hash signature for an HTTP request or for a SAS.
|
|||
|
*
|
|||
|
* @param stringToSign -
|
|||
|
*/computeHMACSHA256(e){// console.log(`stringToSign: ${JSON.stringify(stringToSign)}`);
|
|||
|
return(0,$k14yv$crypto.createHmac)("sha256",this.key).update(e,"utf8").digest("base64");}}}),parcelRequire.register("4Lscn",function(e,t){$parcel$export(e.exports,"ipRangeToString",()=>r);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
/**
|
|||
|
* Generate SasIPRange format string. For example:
|
|||
|
*
|
|||
|
* "8.8.8.8" or "1.1.1.1-255.255.255.255"
|
|||
|
*
|
|||
|
* @param ipRange -
|
|||
|
*/function r(e){return e.end?`${e.start}-${e.end}`:e.start;}}),parcelRequire.register("aTFdr",function(e,t){$parcel$export(e.exports,"SASQueryParameters",()=>n);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r,i=parcelRequire("4Lscn"),a=parcelRequire("e7JkV");!function(e){/**
|
|||
|
* Protocol that allows HTTPS only
|
|||
|
*/e.Https="https",/**
|
|||
|
* Protocol that allows both HTTPS and HTTP
|
|||
|
*/e.HttpsAndHttp="https,http";}(r||(r={}));class n{constructor(e,t,r,i,a,n,o,s,u,c,l,p,d,m,h,x,f,g,D,y){this.version=e,this.signature=t,void 0!==r&&"string"!=typeof r?(// SASQueryParametersOptions
|
|||
|
this.permissions=r.permissions,this.services=r.services,this.resourceTypes=r.resourceTypes,this.protocol=r.protocol,this.startsOn=r.startsOn,this.expiresOn=r.expiresOn,this.ipRangeInner=r.ipRange,this.identifier=r.identifier,this.encryptionScope=r.encryptionScope,this.resource=r.resource,this.cacheControl=r.cacheControl,this.contentDisposition=r.contentDisposition,this.contentEncoding=r.contentEncoding,this.contentLanguage=r.contentLanguage,this.contentType=r.contentType,r.userDelegationKey&&(this.signedOid=r.userDelegationKey.signedObjectId,this.signedTenantId=r.userDelegationKey.signedTenantId,this.signedStartsOn=r.userDelegationKey.signedStartsOn,this.signedExpiresOn=r.userDelegationKey.signedExpiresOn,this.signedService=r.userDelegationKey.signedService,this.signedVersion=r.userDelegationKey.signedVersion,this.preauthorizedAgentObjectId=r.preauthorizedAgentObjectId,this.correlationId=r.correlationId)):(this.services=i,this.resourceTypes=a,this.expiresOn=s,this.permissions=r,this.protocol=n,this.startsOn=o,this.ipRangeInner=u,this.encryptionScope=y,this.identifier=c,this.resource=l,this.cacheControl=p,this.contentDisposition=d,this.contentEncoding=m,this.contentLanguage=h,this.contentType=x,f&&(this.signedOid=f.signedObjectId,this.signedTenantId=f.signedTenantId,this.signedStartsOn=f.signedStartsOn,this.signedExpiresOn=f.signedExpiresOn,this.signedService=f.signedService,this.signedVersion=f.signedVersion,this.preauthorizedAgentObjectId=g,this.correlationId=D));}/**
|
|||
|
* Optional. IP range allowed for this SAS.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get ipRange(){if(this.ipRangeInner)return{end:this.ipRangeInner.end,start:this.ipRangeInner.start};}/**
|
|||
|
* Encodes all SAS query parameters into a string that can be appended to a URL.
|
|||
|
*
|
|||
|
*/toString(){let e=["sv","ss","srt","spr","st","se","sip","si","ses","skoid","sktid","skt","ske","sks","skv","sr","sp","sig","rscc","rscd","rsce","rscl","rsct","saoid","scid"],t=[];for(let r of e)switch(r){case"sv":this.tryAppendQueryParameter(t,r,this.version);break;case"ss":this.tryAppendQueryParameter(t,r,this.services);break;case"srt":this.tryAppendQueryParameter(t,r,this.resourceTypes);break;case"spr":this.tryAppendQueryParameter(t,r,this.protocol);break;case"st":this.tryAppendQueryParameter(t,r,this.startsOn?(0,a.truncatedISO8061Date)(this.startsOn,!1):void 0);break;case"se":this.tryAppendQueryParameter(t,r,this.expiresOn?(0,a.truncatedISO8061Date)(this.expiresOn,!1):void 0);break;case"sip":this.tryAppendQueryParameter(t,r,this.ipRange?(0,i.ipRangeToString)(this.ipRange):void 0);break;case"si":this.tryAppendQueryParameter(t,r,this.identifier);break;case"ses":this.tryAppendQueryParameter(t,r,this.encryptionScope);break;case"skoid":this.tryAppendQueryParameter(t,r,this.signedOid);break;case"sktid":this.tryAppendQueryParameter(t,r,this.signedTenantId);break;case"skt":this.tryAppendQueryParameter(t,r,this.signedStartsOn?(0,a.truncatedISO8061Date)(this.signedStartsOn,!1):void 0);break;case"ske":this.tryAppendQueryParameter(t,r,this.signedExpiresOn?(0,a.truncatedISO8061Date)(this.signedExpiresOn,!1):void 0);break;case"sks":this.tryAppendQueryParameter(t,r,this.signedService);break;case"skv":this.tryAppendQueryParameter(t,r,this.signedVersion);break;case"sr":this.tryAppendQueryParameter(t,r,this.resource);break;case"sp":this.tryAppendQueryParameter(t,r,this.permissions);break;case"sig":this.tryAppendQueryParameter(t,r,this.signature);break;case"rscc":this.tryAppendQueryParameter(t,r,this.cacheControl);break;case"rscd":this.tryAppendQueryParameter(t,r,this.contentDisposition);break;case"rsce":this.tryAppendQueryParameter(t,r,this.contentEncoding);break;case"rscl":this.tryAppendQueryParameter(t,r,this.contentLanguage);break;case"rsct":this.tryAppendQueryParameter(t,r,this.contentType);break;case"saoid":this.tryAppendQueryParameter(t,r,this.preauthorizedAgentObjectId);break;case"scid":this.tryAppendQueryParameter(t,r,this.correlationId);}return t.join("&");}/**
|
|||
|
* A private helper method used to filter and append query key/value pairs into an array.
|
|||
|
*
|
|||
|
* @param queries -
|
|||
|
* @param key -
|
|||
|
* @param value -
|
|||
|
*/tryAppendQueryParameter(e,t,r){r&&(t=encodeURIComponent(t),r=encodeURIComponent(r),t.length>0&&r.length>0&&e.push(`${t}=${r}`));}}}),parcelRequire.register("3f6jw",function(e,t){$parcel$export(e.exports,"BlobLeaseClient",()=>c);// Copyright (c) Microsoft Corporation.
|
|||
|
// Licensed under the MIT license.
|
|||
|
var r=parcelRequire("8sP3n"),i=parcelRequire("hYmUv"),a=parcelRequire("2hiFM"),n=parcelRequire("41xRP"),o=parcelRequire("4F713"),s=parcelRequire("5MFjo"),u=parcelRequire("gXPSw");class c{/**
|
|||
|
* Creates an instance of BlobLeaseClient.
|
|||
|
* @param client - The client to make the lease operation requests.
|
|||
|
* @param leaseId - Initial proposed lease id.
|
|||
|
*/constructor(e,t){let a=new i.StorageClientContext(e.url,e.pipeline.toServiceClientOptions());this._url=e.url,void 0===e.name?(this._isContainer=!0,this._containerOrBlobOperation=new n.Container(a)):(this._isContainer=!1,this._containerOrBlobOperation=new o.Blob(a)),t||(t=(0,r.generateUuid)()),this._leaseId=t;}/**
|
|||
|
* Gets the lease Id.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get leaseId(){return this._leaseId;}/**
|
|||
|
* Gets the url.
|
|||
|
*
|
|||
|
* @readonly
|
|||
|
*/get url(){return this._url;}/**
|
|||
|
* Establishes and manages a lock on a container for delete operations, or on a blob
|
|||
|
* for write and delete operations.
|
|||
|
* The lock duration can be 15 to 60 seconds, or can be infinite.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
|
|||
|
* and
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
|
|||
|
*
|
|||
|
* @param duration - Must be between 15 to 60 seconds, or infinite (-1)
|
|||
|
* @param options - option to configure lease management operations.
|
|||
|
* @returns Response data for acquire lease operation.
|
|||
|
*/async acquireLease(e,t={}){var r,i,n,o,c,l;let{span:p,updatedOptions:d}=(0,u.createSpan)("BlobLeaseClient-acquireLease",t);if(this._isContainer&&((null===(r=t.conditions)||void 0===r?void 0:r.ifMatch)&&(null===(i=t.conditions)||void 0===i?void 0:i.ifMatch)!==s.ETagNone||(null===(n=t.conditions)||void 0===n?void 0:n.ifNoneMatch)&&(null===(o=t.conditions)||void 0===o?void 0:o.ifNoneMatch)!==s.ETagNone||(null===(c=t.conditions)||void 0===c?void 0:c.tagConditions)))throw RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");try{return await this._containerOrBlobOperation.acquireLease(Object.assign({abortSignal:t.abortSignal,duration:e,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(l=t.conditions)||void 0===l?void 0:l.tagConditions}),proposedLeaseId:this._leaseId},(0,u.convertTracingToRequestOptionsBase)(d)));}catch(e){throw p.setStatus({code:a.SpanStatusCode.ERROR,message:e.message}),e;}finally{p.end();}}/**
|
|||
|
* To change the ID of the lease.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
|
|||
|
* and
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
|
|||
|
*
|
|||
|
* @param proposedLeaseId - the proposed new lease Id.
|
|||
|
* @param options - option to configure lease management operations.
|
|||
|
* @returns Response data for change lease operation.
|
|||
|
*/async changeLease(e,t={}){var r,i,n,o,c,l;let{span:p,updatedOptions:d}=(0,u.createSpan)("BlobLeaseClient-changeLease",t);if(this._isContainer&&((null===(r=t.conditions)||void 0===r?void 0:r.ifMatch)&&(null===(i=t.conditions)||void 0===i?void 0:i.ifMatch)!==s.ETagNone||(null===(n=t.conditions)||void 0===n?void 0:n.ifNoneMatch)&&(null===(o=t.conditions)||void 0===o?void 0:o.ifNoneMatch)!==s.ETagNone||(null===(c=t.conditions)||void 0===c?void 0:c.tagConditions)))throw RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");try{let r=await this._containerOrBlobOperation.changeLease(this._leaseId,e,Object.assign({abortSignal:t.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(l=t.conditions)||void 0===l?void 0:l.tagConditions})},(0,u.convertTracingToRequestOptionsBase)(d)));return this._leaseId=e,r;}catch(e){throw p.setStatus({code:a.SpanStatusCode.ERROR,message:e.message}),e;}finally{p.end();}}/**
|
|||
|
* To free the lease if it is no longer needed so that another client may
|
|||
|
* immediately acquire a lease against the container or the blob.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
|
|||
|
* and
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
|
|||
|
*
|
|||
|
* @param options - option to configure lease management operations.
|
|||
|
* @returns Response data for release lease operation.
|
|||
|
*/async releaseLease(e={}){var t,r,i,n,o,c;let{span:l,updatedOptions:p}=(0,u.createSpan)("BlobLeaseClient-releaseLease",e);if(this._isContainer&&((null===(t=e.conditions)||void 0===t?void 0:t.ifMatch)&&(null===(r=e.conditions)||void 0===r?void 0:r.ifMatch)!==s.ETagNone||(null===(i=e.conditions)||void 0===i?void 0:i.ifNoneMatch)&&(null===(n=e.conditions)||void 0===n?void 0:n.ifNoneMatch)!==s.ETagNone||(null===(o=e.conditions)||void 0===o?void 0:o.tagConditions)))throw RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");try{return await this._containerOrBlobOperation.releaseLease(this._leaseId,Object.assign({abortSignal:e.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:null===(c=e.conditions)||void 0===c?void 0:c.tagConditions})},(0,u.convertTracingToRequestOptionsBase)(p)));}catch(e){throw l.setStatus({code:a.SpanStatusCode.ERROR,message:e.message}),e;}finally{l.end();}}/**
|
|||
|
* To renew the lease.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
|
|||
|
* and
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
|
|||
|
*
|
|||
|
* @param options - Optional option to configure lease management operations.
|
|||
|
* @returns Response data for renew lease operation.
|
|||
|
*/async renewLease(e={}){var t,r,i,n,o,c;let{span:l,updatedOptions:p}=(0,u.createSpan)("BlobLeaseClient-renewLease",e);if(this._isContainer&&((null===(t=e.conditions)||void 0===t?void 0:t.ifMatch)&&(null===(r=e.conditions)||void 0===r?void 0:r.ifMatch)!==s.ETagNone||(null===(i=e.conditions)||void 0===i?void 0:i.ifNoneMatch)&&(null===(n=e.conditions)||void 0===n?void 0:n.ifNoneMatch)!==s.ETagNone||(null===(o=e.conditions)||void 0===o?void 0:o.tagConditions)))throw RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");try{return await this._containerOrBlobOperation.renewLease(this._leaseId,Object.assign({abortSignal:e.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:null===(c=e.conditions)||void 0===c?void 0:c.tagConditions})},(0,u.convertTracingToRequestOptionsBase)(p)));}catch(e){throw l.setStatus({code:a.SpanStatusCode.ERROR,message:e.message}),e;}finally{l.end();}}/**
|
|||
|
* To end the lease but ensure that another client cannot acquire a new lease
|
|||
|
* until the current lease period has expired.
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
|
|||
|
* and
|
|||
|
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
|
|||
|
*
|
|||
|
* @param breakPeriod - Break period
|
|||
|
* @param options - Optional options to configure lease management operations.
|
|||
|
* @returns Response data for break lease operation.
|
|||
|
*/async breakLease(e,t={}){var r,i,n,o,c,l;let{span:p,updatedOptions:d}=(0,u.createSpan)("BlobLeaseClient-breakLease",t);if(this._isContainer&&((null===(r=t.conditions)||void 0===r?void 0:r.ifMatch)&&(null===(i=t.conditions)||void 0===i?void 0:i.ifMatch)!==s.ETagNone||(null===(n=t.conditions)||void 0===n?void 0:n.ifNoneMatch)&&(null===(o=t.conditions)||void 0===o?void 0:o.ifNoneMatch)!==s.ETagNone||(null===(c=t.conditions)||void 0===c?void 0:c.tagConditions)))throw RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");try{let r=Object.assign({abortSignal:t.abortSignal,breakPeriod:e,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:null===(l=t.conditions)||void 0===l?void 0:l.tagConditions})},(0,u.convertTracingToRequestOptionsBase)(d));return await this._containerOrBlobOperation.breakLease(r);}catch(e){throw p.setStatus({code:a.SpanStatusCode.ERROR,message:e.message}),e;}finally{p.end();}}}}),parcelRequire.register("41xRP",function(e,t){$parcel$export(e.exports,"Container",()=>o);/*
|
|||
|
* Copyright (c) Microsoft Corporation.
|
|||
|
* Licensed under the MIT License.
|
|||
|
*
|
|||
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|||
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|||
|
*/var r=parcelRequire("ivnR6"),i=parcelRequire("e5kiN"),a=parcelRequire("iGLpU"),n=parcelRequire("4lprA");class o{/**
|
|||
|
* Initialize a new instance of the class Container class.
|
|||
|
* @param client Reference to the service client
|
|||
|
*/constructor(e){this.client=e;}/**
|
|||
|
* creates a new container under the specified account. If the container with the same name already
|
|||
|
* exists, the operation fails
|
|||
|
* @param options The options parameters.
|
|||
|
*/create(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,u);}/**
|
|||
|
* returns all user-defined metadata and system properties for the specified container. The data
|
|||
|
* returned does not include the container's list of blobs
|
|||
|
* @param options The options parameters.
|
|||
|
*/getProperties(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,c);}/**
|
|||
|
* operation marks the specified container for deletion. The container and any blobs contained within
|
|||
|
* it are later deleted during garbage collection
|
|||
|
* @param options The options parameters.
|
|||
|
*/delete(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,l);}/**
|
|||
|
* operation sets one or more user-defined name-value pairs for the specified container.
|
|||
|
* @param options The options parameters.
|
|||
|
*/setMetadata(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,p);}/**
|
|||
|
* gets the permissions for the specified container. The permissions indicate whether container data
|
|||
|
* may be accessed publicly.
|
|||
|
* @param options The options parameters.
|
|||
|
*/getAccessPolicy(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,d);}/**
|
|||
|
* sets the permissions for the specified container. The permissions indicate whether blobs in a
|
|||
|
* container may be accessed publicly.
|
|||
|
* @param options The options parameters.
|
|||
|
*/setAccessPolicy(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,m);}/**
|
|||
|
* Restores a previously-deleted container.
|
|||
|
* @param options The options parameters.
|
|||
|
*/restore(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,h);}/**
|
|||
|
* Renames an existing container.
|
|||
|
* @param sourceContainerName Required. Specifies the name of the container to rename.
|
|||
|
* @param options The options parameters.
|
|||
|
*/rename(e,t){let i={sourceContainerName:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,x);}/**
|
|||
|
* The Batch operation allows multiple API calls to be embedded into a single HTTP request.
|
|||
|
* @param contentLength The length of the request.
|
|||
|
* @param multipartContentType Required. The value of this header must be multipart/mixed with a batch
|
|||
|
* boundary. Example header value: multipart/mixed; boundary=batch_<GUID>
|
|||
|
* @param body Initial data
|
|||
|
* @param options The options parameters.
|
|||
|
*/submitBatch(e,t,i,a){let n={contentLength:e,multipartContentType:t,body:i,options:r.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(n,f);}/**
|
|||
|
* The Filter Blobs operation enables callers to list blobs in a container whose tags match a given
|
|||
|
* search expression. Filter blobs searches within the given container.
|
|||
|
* @param options The options parameters.
|
|||
|
*/filterBlobs(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,g);}/**
|
|||
|
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
|
|||
|
* be 15 to 60 seconds, or can be infinite
|
|||
|
* @param options The options parameters.
|
|||
|
*/acquireLease(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,D);}/**
|
|||
|
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
|
|||
|
* be 15 to 60 seconds, or can be infinite
|
|||
|
* @param leaseId Specifies the current lease ID on the resource.
|
|||
|
* @param options The options parameters.
|
|||
|
*/releaseLease(e,t){let i={leaseId:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,y);}/**
|
|||
|
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
|
|||
|
* be 15 to 60 seconds, or can be infinite
|
|||
|
* @param leaseId Specifies the current lease ID on the resource.
|
|||
|
* @param options The options parameters.
|
|||
|
*/renewLease(e,t){let i={leaseId:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,b);}/**
|
|||
|
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
|
|||
|
* be 15 to 60 seconds, or can be infinite
|
|||
|
* @param options The options parameters.
|
|||
|
*/breakLease(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,v);}/**
|
|||
|
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
|
|||
|
* be 15 to 60 seconds, or can be infinite
|
|||
|
* @param leaseId Specifies the current lease ID on the resource.
|
|||
|
* @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400
|
|||
|
* (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor
|
|||
|
* (String) for a list of valid GUID string formats.
|
|||
|
* @param options The options parameters.
|
|||
|
*/changeLease(e,t,i){let a={leaseId:e,proposedLeaseId:t,options:r.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,C);}/**
|
|||
|
* [Update] The List Blobs operation returns a list of the blobs under the specified container
|
|||
|
* @param options The options parameters.
|
|||
|
*/listBlobFlatSegment(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,E);}/**
|
|||
|
* [Update] The List Blobs operation returns a list of the blobs under the specified container
|
|||
|
* @param delimiter When the request includes this parameter, the operation returns a BlobPrefix
|
|||
|
* element in the response body that acts as a placeholder for all blobs whose names begin with the
|
|||
|
* same substring up to the appearance of the delimiter character. The delimiter may be a single
|
|||
|
* character or a string.
|
|||
|
* @param options The options parameters.
|
|||
|
*/listBlobHierarchySegment(e,t){let i={delimiter:e,options:r.operationOptionsToRequestOptionsBase(t||{})};return this.client.sendOperationRequest(i,A);}/**
|
|||
|
* Returns the sku name and account kind
|
|||
|
* @param options The options parameters.
|
|||
|
*/getAccountInfo(e){let t={options:r.operationOptionsToRequestOptionsBase(e||{})};return this.client.sendOperationRequest(t,S);}}// Operation Specifications
|
|||
|
let s=new i.Serializer(a,/* isXml */!0),u={path:"/{containerName}",httpMethod:"PUT",responses:{201:{headersMapper:a.ContainerCreateHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.ContainerCreateExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.restype2],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.metadata,n.access,n.defaultEncryptionScope,n.preventEncryptionScopeOverride],isXML:!0,serializer:s},c={path:"/{containerName}",httpMethod:"GET",responses:{200:{headersMapper:a.ContainerGetPropertiesHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.ContainerGetPropertiesExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.restype2],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.leaseId],isXML:!0,serializer:s},l={path:"/{containerName}",httpMethod:"DELETE",responses:{202:{headersMapper:a.ContainerDeleteHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.ContainerDeleteExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.restype2],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince],isXML:!0,serializer:s},p={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:a.ContainerSetMetadataHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.ContainerSetMetadataExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.restype2,n.comp6],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.metadata,n.leaseId,n.ifModifiedSince],isXML:!0,serializer:s},d={path:"/{containerName}",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"SignedIdentifier"}}},serializedName:"SignedIdentifiers",xmlName:"SignedIdentifiers",xmlIsWrapped:!0,xmlElementName:"SignedIdentifier"},headersMapper:a.ContainerGetAccessPolicyHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.ContainerGetAccessPolicyExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.restype2,n.comp7],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.leaseId],isXML:!0,serializer:s},m={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:a.ContainerSetAccessPolicyHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.ContainerSetAccessPolicyExceptionHeaders}},requestBody:n.containerAcl,queryParameters:[n.timeoutInSeconds,n.restype2,n.comp7],urlParameters:[n.url],headerParameters:[n.contentType,n.accept,n.version,n.requestId,n.access,n.leaseId,n.ifModifiedSince,n.ifUnmodifiedSince],isXML:!0,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:s},h={path:"/{containerName}",httpMethod:"PUT",responses:{201:{headersMapper:a.ContainerRestoreHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.ContainerRestoreExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.restype2,n.comp8],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.deletedContainerName,n.deletedContainerVersion],isXML:!0,serializer:s},x={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:a.ContainerRenameHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.ContainerRenameExceptionHeaders}},queryParameters:[n.timeoutInSeconds,n.restype2,n.comp9],urlParameters:[n.url],headerParameters:[n.version,n.requestId,n.accept1,n.sourceContainerName,n.sourceLeaseId],isXML:!0,serializer:s},f={path:"/{containerName}",httpMethod:"POST",responses:{202:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:a.ContainerSubmitBatchHeaders},default:{bodyMapper:a.StorageError,headersMapper:a.ContainerSubmitBatchExceptionHeaders}},requestBody:n.body,queryParameters:[n.timeoutInSeconds,n.comp4,n.restype2],urlParameters:[n.url],headerParameters:[n.contentType,n.accept,n.version,n.requestId,n.contentLength,n.multipartContentType],isXML:!0,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:s},g={path:"/{containerName}",httpMethod:"GET",responses:{200:{bodyMapper:a.FilterBlobSegment,headersMapper:a.ContainerFilterBlobsHea
|
|||
|
e=>e instanceof s.HttpClientError?{statusCode:e.statusCode,result:null,headers:{},error:e}:void 0);});}function x(e,t,r=u.DefaultRetryAttempts,i=u.DefaultRetryDelay){return n(this,void 0,void 0,function*(){return yield m(e,t,e=>e.message.statusCode,r,i);});}e.exports.isSuccessStatusCode=c,e.exports.isServerErrorStatusCode=l,e.exports.isRetryableStatusCode=p,e.exports.retry=m,e.exports.retryTypedResponse=h,e.exports.retryHttpClientResponse=x;}),parcelRequire.register("hbCiU",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r];}}),Object.defineProperty(e,i,a);}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.getDownloadOptions=e.exports.getUploadOptions=void 0;let n=a(parcelRequire("lcRzN"));/**
|
|||
|
* Returns a copy of the upload options with defaults filled in.
|
|||
|
*
|
|||
|
* @param copy the original upload options
|
|||
|
*/function o(e){let t={uploadConcurrency:4,uploadChunkSize:33554432};return e&&("number"==typeof e.uploadConcurrency&&(t.uploadConcurrency=e.uploadConcurrency),"number"==typeof e.uploadChunkSize&&(t.uploadChunkSize=e.uploadChunkSize)),n.debug(`Upload concurrency: ${t.uploadConcurrency}`),n.debug(`Upload chunk size: ${t.uploadChunkSize}`),t;}/**
|
|||
|
* Returns a copy of the download options with defaults filled in.
|
|||
|
*
|
|||
|
* @param copy the original download options
|
|||
|
*/function s(e){let t={useAzureSdk:!1,concurrentBlobDownloads:!0,downloadConcurrency:8,timeoutInMs:3e4,segmentTimeoutInMs:6e5,lookupOnly:!1};e&&("boolean"==typeof e.useAzureSdk&&(t.useAzureSdk=e.useAzureSdk),"boolean"==typeof e.concurrentBlobDownloads&&(t.concurrentBlobDownloads=e.concurrentBlobDownloads),"number"==typeof e.downloadConcurrency&&(t.downloadConcurrency=e.downloadConcurrency),"number"==typeof e.timeoutInMs&&(t.timeoutInMs=e.timeoutInMs),"number"==typeof e.segmentTimeoutInMs&&(t.segmentTimeoutInMs=e.segmentTimeoutInMs),"boolean"==typeof e.lookupOnly&&(t.lookupOnly=e.lookupOnly));let r=process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS;return r&&!isNaN(Number(r))&&isFinite(Number(r))&&(t.segmentTimeoutInMs=6e4*Number(r)),n.debug(`Use Azure SDK: ${t.useAzureSdk}`),n.debug(`Download concurrency: ${t.downloadConcurrency}`),n.debug(`Request timeout (ms): ${t.timeoutInMs}`),n.debug(`Cache segment download timeout mins env var: ${process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS}`),n.debug(`Segment download timeout (ms): ${t.segmentTimeoutInMs}`),n.debug(`Lookup only: ${t.lookupOnly}`),t;}e.exports.getUploadOptions=o,e.exports.getDownloadOptions=s;}),parcelRequire.register("gTUtS",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r];}}),Object.defineProperty(e,i,a);}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r(function(t){t(e);});}return new(r||(r=Promise))(function(r,n){function o(e){try{u(i.next(e));}catch(e){n(e);}}function s(e){try{u(i.throw(e));}catch(e){n(e);}}function u(e){e.done?r(e.value):a(e.value).then(o,s);}u((i=i.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.createTar=e.exports.extractTar=e.exports.listTar=void 0;var o=parcelRequire("jlr6Q");let s=a(parcelRequire("fcBgE")),u=a($k14yv$path),c=a(parcelRequire("ju5qo"));var l=parcelRequire("78Azy");let p="win32"===process.platform;// Returns tar path and type: BSD or GNU
|
|||
|
function d(){return n(this,void 0,void 0,function*(){switch(process.platform){case"win32":{let e=yield c.getGnuTarPathOnWindows(),t=l.SystemTarPathOnWindows;if(e)return{path:e,type:l.ArchiveToolType.GNU};if((0,$k14yv$fs.existsSync)(t))return{path:t,type:l.ArchiveToolType.BSD};break;}case"darwin":{let e=yield s.which("gtar",!1);if(e)return{path:e,type:l.ArchiveToolType.GNU};return{path:yield s.which("tar",!0),type:l.ArchiveToolType.BSD};}}// Default assumption is GNU tar is present in path
|
|||
|
return{path:yield s.which("tar",!0),type:l.ArchiveToolType.GNU};});}// Return arguments for tar as per tarPath, compressionMethod, method type and os
|
|||
|
function m(e,t,r,i=""){return n(this,void 0,void 0,function*(){let a=[`"${e.path}"`],n=c.getCacheFileName(t),o="cache.tar",s=x(),d=e.type===l.ArchiveToolType.BSD&&t!==l.CompressionMethod.Gzip&&p;// Method specific args
|
|||
|
switch(r){case"create":a.push("--posix","-cf",d?o:n.replace(RegExp(`\\${u.sep}`,"g"),"/"),"--exclude",d?o:n.replace(RegExp(`\\${u.sep}`,"g"),"/"),"-P","-C",s.replace(RegExp(`\\${u.sep}`,"g"),"/"),"--files-from",l.ManifestFilename);break;case"extract":a.push("-xf",d?o:i.replace(RegExp(`\\${u.sep}`,"g"),"/"),"-P","-C",s.replace(RegExp(`\\${u.sep}`,"g"),"/"));break;case"list":a.push("-tf",d?o:i.replace(RegExp(`\\${u.sep}`,"g"),"/"),"-P");}// Platform specific args
|
|||
|
if(e.type===l.ArchiveToolType.GNU)switch(process.platform){case"win32":a.push("--force-local");break;case"darwin":a.push("--delay-directory-restore");}return a;});}// Returns commands to run tar and compression program
|
|||
|
function h(e,t,r=""){return n(this,void 0,void 0,function*(){let i;let a=yield d(),n=yield m(a,e,t,r),o="create"!==t?yield f(a,e,r):yield g(a,e),s=a.type===l.ArchiveToolType.BSD&&e!==l.CompressionMethod.Gzip&&p;return(i=s&&"create"!==t?[[...o].join(" "),[...n].join(" ")]:[[...n].join(" "),[...o].join(" ")],s)?i:[i.join(" ")];});}function x(){var e;return null!==(e=process.env.GITHUB_WORKSPACE)&&void 0!==e?e:process.cwd();}// Common function for extractTar and listTar to get the compression method
|
|||
|
function f(e,t,r){return n(this,void 0,void 0,function*(){// -d: Decompress.
|
|||
|
// unzstd is equivalent to 'zstd -d'
|
|||
|
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|||
|
// Using 30 here because we also support 32-bit self-hosted runners.
|
|||
|
let i=e.type===l.ArchiveToolType.BSD&&t!==l.CompressionMethod.Gzip&&p;switch(t){case l.CompressionMethod.Zstd:return i?["zstd -d --long=30 --force -o",l.TarFilename,r.replace(RegExp(`\\${u.sep}`,"g"),"/")]:["--use-compress-program",p?'"zstd -d --long=30"':"unzstd --long=30"];case l.CompressionMethod.ZstdWithoutLong:return i?["zstd -d --force -o",l.TarFilename,r.replace(RegExp(`\\${u.sep}`,"g"),"/")]:["--use-compress-program",p?'"zstd -d"':"unzstd"];default:return["-z"];}});}// Used for creating the archive
|
|||
|
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
|
|||
|
// zstdmt is equivalent to 'zstd -T0'
|
|||
|
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|||
|
// Using 30 here because we also support 32-bit self-hosted runners.
|
|||
|
// Long range mode is added to zstd in v1.3.2 release, so we will not use --long in older version of zstd.
|
|||
|
function g(e,t){return n(this,void 0,void 0,function*(){let r=c.getCacheFileName(t),i=e.type===l.ArchiveToolType.BSD&&t!==l.CompressionMethod.Gzip&&p;switch(t){case l.CompressionMethod.Zstd:return i?["zstd -T0 --long=30 --force -o",r.replace(RegExp(`\\${u.sep}`,"g"),"/"),l.TarFilename]:["--use-compress-program",p?'"zstd -T0 --long=30"':"zstdmt --long=30"];case l.CompressionMethod.ZstdWithoutLong:return i?["zstd -T0 --force -o",r.replace(RegExp(`\\${u.sep}`,"g"),"/"),l.TarFilename]:["--use-compress-program",p?'"zstd -T0"':"zstdmt"];default:return["-z"];}});}// Executes all commands as separate processes
|
|||
|
function D(e,t){return n(this,void 0,void 0,function*(){for(let r of e)try{yield(0,o.exec)(r,void 0,{cwd:t,env:Object.assign(Object.assign({},process.env),{MSYS:"winsymlinks:nativestrict"})});}catch(e){throw Error(`${r.split(" ")[0]} failed with error: ${null==e?void 0:e.message}`);}});}// List the contents of a tar
|
|||
|
function y(e,t){return n(this,void 0,void 0,function*(){let r=yield h(t,"list",e);yield D(r);});}// Extract a tar
|
|||
|
function b(e,t){return n(this,void 0,void 0,function*(){// Create directory to extract tar into
|
|||
|
let r=x();yield s.mkdirP(r);let i=yield h(t,"extract",e);yield D(i);});}// Create a tar
|
|||
|
function v(e,t,r){return n(this,void 0,void 0,function*(){// Write source directories to manifest.txt to avoid command length limits
|
|||
|
(0,$k14yv$fs.writeFileSync)(u.join(e,l.ManifestFilename),t.join("\n"));let i=yield h(r,"create");yield D(i,e);});}e.exports.listTar=y,e.exports.extractTar=b,e.exports.createTar=v;}),parcelRequire.register("55W4k",function(e,t){var r;$parcel$export(e.exports,"parse",()=>r,e=>r=e),r=parcelRequire("gi4xV"),parcelRequire("5e4iL");}),parcelRequire.register("gi4xV",function(e,t){e.exports=parcelRequire("hncsJ"),e.exports.async=parcelRequire("leFFm"),e.exports.stream=parcelRequire("bIDnv"),e.exports.prettyError=parcelRequire("ckX77");}),parcelRequire.register("hncsJ",function(e,t){e.exports=a;var r=parcelRequire("gEhiJ"),i=parcelRequire("ckX77");function a(e){$parcel$global.Buffer&&$parcel$global.Buffer.isBuffer(e)&&(e=e.toString("utf8"));let t=new r();try{return t.parse(e),t.finish();}catch(t){throw i(t,e);}}}),parcelRequire.register("gEhiJ",function(module,exports){let _custom;/* eslint-disable no-new-wrappers, no-eval, camelcase, operator-linebreak */module.exports=makeParserClass(parcelRequire("lTZk9")),module.exports.makeParserClass=makeParserClass;class TomlError extends Error{constructor(e){super(e),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,TomlError),this.fromTOML=!0,this.wrapped=null;}}TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t;},module.exports.TomlError=TomlError;var $lPmG1=parcelRequire("lPmG1"),$7kLtX=parcelRequire("7kLtX"),$i8y9h=parcelRequire("i8y9h"),$l5l5L=parcelRequire("l5l5L");let CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31// the last non-character in the latin1 region of unicode, except DEL
|
|||
|
,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:"\n",[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9;}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9;}function isBit(e){return e===CHAR_1||e===CHAR_0;}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7;}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN;}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN;}let _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return!!hasOwnProperty.call(e,t)||("__proto__"===t&&defineProperty(e,"__proto__",descriptor),!1);}let INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}});}function isInlineTable(e){return null!==e&&"object"==typeof e&&e[_type]===INLINE_TABLE;}let TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}});}function isTable(e){return null!==e&&"object"==typeof e&&e[_type]===TABLE;}let _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}});}function isInlineList(e){return null!==e&&"object"==typeof e&&e[_type]===INLINE_LIST;}let LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}});}function isList(e){return null!==e&&"object"==typeof e&&e[_type]===LIST;}try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom;}catch(_){/* eval require not available in transpiled bundle */}/* istanbul ignore next */let _inspect=_custom||"inspect";class BoxedBigInt{constructor(e){try{this.value=$parcel$global.BigInt.asIntN(64,e);}catch(e){/* istanbul ignore next */this.value=null;}Object.defineProperty(this,_type,{value:INTEGER});}isNaN(){return null===this.value;}/* istanbul ignore next */toString(){return String(this.value);}/* istanbul ignore next */[_inspect](){return`[BigInt: ${this.toString()}]}`;}valueOf(){return this.value;}}let INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return(/* istanbul ignore else */(Object.is(t,-0)&&(t=0),$parcel$global.BigInt&&!Number.isSafeInteger(t))?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this);}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}}));}function isInteger(e){return null!==e&&"object"==typeof e&&e[_type]===INTEGER;}let FLOAT=Symbol("float");function Float(e){/* istanbul ignore next */return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}});}function isFloat(e){return null!==e&&"object"==typeof e&&e[_type]===FLOAT;}function tomlType(e){let t=typeof e;if("object"===t){/* istanbul ignore if */if(null===e)return"null";if(e instanceof Date)return"datetime";/* istanbul ignore else */if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";/* istanbul ignore next */case TABLE:return"table";/* istanbul ignore next */case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer";}}return
|
|||
|
// then RETURNS. Last state in a production.
|
|||
|
parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"));}/* ASSIGNMENT: key = value */parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement);}recordAssignStatement(e){let t=this.ctx,r=e.key.pop();for(let r of e.key){if(hasKey(t,r)&&(!isTable(t[r])||t[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));t=t[r]=t[r]||Table();}if(hasKey(t,r))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(e.value)||isFloat(e.value)?t[r]=e.value.valueOf():t[r]=e.value,this.goto(this.parseWhitespaceToEOL);}/* ASSSIGNMENT expression, key = value possibly inside an inline table */parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword);}recordAssignKeyword(e){return this.state.resultTable?this.state.resultTable.push(e):this.state.resultTable=[e],this.goto(this.parseAssignKeywordPreDot);}parseAssignKeywordPreDot(){return this.char===CHAR_PERIOD?this.next(this.parseAssignKeywordPostDot):this.char!==CHAR_SP&&this.char!==CTRL_I?this.goto(this.parseAssignEqual):void 0;}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword);}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'));}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue);}recordAssignValue(e){return this.returnNow({key:this.state.resultTable,value:e});}/* COMMENTS: #...eol */parseComment(){do if(this.char===e.END||this.char===CTRL_J)return this.return();while(this.nextChar());}/* TABLES AND LISTS, [foo] and [[foo]] */parseTableOrList(){if(this.char!==CHAR_LSQB)return this.goto(this.parseTable);this.next(this.parseList);}/* TABLE [foo.bar.baz] */parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext);}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore);}parseTableMore(e){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,e)&&(!isTable(this.ctx[e])||this.ctx[e][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[e]=this.ctx[e]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL);}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,e)){if(isTable(this.ctx[e]))this.ctx=this.ctx[e];else if(isList(this.ctx[e]))this.ctx=this.ctx[e][this.ctx[e].length-1];else throw this.error(new TomlError("Can't redefine existing key"));}else this.ctx=this.ctx[e]=Table();return this.next(this.parseTableNext);}throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));}/* LIST [[a.b.c]] */parseList(){return this.ctx=this.obj,this.goto(this.parseListNext);}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore);}parseListMore(e){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,e)||(this.ctx[e]=List()),isInlineList(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[e])){let t=Table();this.ctx[e].push(t),this.ctx=t;}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd);}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,e)){if(isInlineList(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[e]))this.ctx=this.ctx[e][this.ctx[e].length-1];else if(isTable(this.ctx[e]))this.ctx=this.ctx[e];else throw this.error(new TomlError("Can't redefine
|
|||
|
this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow());}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char));}parseUnicodeReturn(e){try{let t=parseInt(e,16);if(t>=SURROGATE_FIRST&&t<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(t));}catch(e){throw this.error(TomlError.wrap(e));}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return();}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return();}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));}/* NUMBERS */parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan);}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart);}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger);}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf));}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);let e=Integer(this.state.buf);/* istanbul ignore if */if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"));}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow();}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow();}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);else return this.returnNow(Float(this.state.buf));}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"));}parseNumberExponent(){if(isDigit(this.char))this.consume();else if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);else return this.returnNow(Float(this.state.buf));}/* NUMBERS or DATETIMES */parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly);}parseNumberOrDateTimeOnly(){// note, if two zeros are in a row then it MUST be a date
|
|||
|
if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);else if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);else if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);else if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);else return this.returnNow(Integer(this.state.buf));}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"));}if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"));}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf));}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);let e=Integer(this.state.buf);/* istanbul ignore if */if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"));}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);let e=Integer(this.state.buf);/* istanbul ignore if */if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"));}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);let e=Integer(this.state.buf);/* istanbul ignore if */if(!e.isNaN())return this.returnNow(e);throw this.error(new TomlError("Invalid number"));}}/* DATETIME */parseDateTime(){// we enter here having just consumed the year and about to consume the hyphen
|
|||
|
if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth);}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay);}if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"));}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour);}if(this.atEndOfWord())return this.returnNow($i8y9h(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"));}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow($i8y9h(this.state.result)):this.goto(this.parseTimeHour);}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin);}if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"));}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);else throw this.error(new TomlError("Incomplete datetime"));}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),2===this.state.buf.length)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction);}else throw this.error(new TomlError("Incomplete datetime"));}parseOnlyTimeHour(){/* istanbul ignore else */if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin);}throw this.error(new TomlError("Incomplete time"));}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);else throw this.error(new TomlError("Incomplete time"));}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),2===this.state.buf.length)return this.next(this.parseOnlyTimeFractionMaybe);}else throw this.error(new TomlError("Incomplete time"));}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char!==CHAR_PERIOD)return this.return($l5l5L(this.state.result));this.state.buf="",this.next(this.parseOnlyTimeFraction);}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(0===this.state.buf.length)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow($l5l5L(this.state.result+"."+this.state.buf));}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else if(this.char===CHAR_Z)return this.consume(),this.return($lPmG1(this.state.result+this.state.buf));else if(this.atEndOfWord())return this.returnNow($7kLtX(this.state.result+this.state.buf));else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else if(1===this.state.buf.length)throw this.error(new TomlError("Expected d
|
|||
|
{if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep);}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"));}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"));}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return($lPmG1(this.state.result+this.state.buf));}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"));}/* BOOLEAN */parseBoolean(){return(/* istanbul ignore else */this.char===CHAR_t?(this.consume(),this.next(this.parseTrue_r)):this.char===CHAR_f?(this.consume(),this.next(this.parseFalse_a)):void 0);}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"));}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"));}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"));}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"));}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"));}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"));}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"));}/* INLINE LISTS */parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue);}recordInlineListValue(e){if(this.state.resultArr){let t=this.state.resultArr[_contentType],r=tomlType(e);if(t!==r)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${t} and ${r}`));}else this.state.resultArr=InlineList(tomlType(e));return isFloat(e)||isInteger(e)?this.state.resultArr.push(e.valueOf()):this.state.resultArr.push(e),this.goto(this.parseInlineListNext);}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"));}/* INLINE TABLE */parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue));}recordInlineTableValue(e){let t=this.state.resultTable,r=e.key.pop();for(let r of e.key){if(hasKey(t,r)&&(!isTable(t[r])||t[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));t=t[r]=t[r]||Table();}if(hasKey(t,r))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(e.value)||isFloat(e.value)?t[r]=e.value.valueOf():t[r]=e.value,this.goto(this.parseInlineTableNext);}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===
|
|||
|
`,t&&t.split){let i=t.split(/\n/),a=String(Math.min(i.length,e.line+3)).length,n=" ";for(;n.length<a;)n+=" ";for(let t=Math.max(0,e.line-1);t<Math.min(i.length,e.line+2);++t){let o=String(t+1);if(o.length<a&&(o=" "+o),e.line===t){r+=o+"> "+i[t]+"\n"+n+" ";for(let t=0;t<e.col;++t)r+=" ";r+="^\n";}else r+=o+": "+i[t]+"\n";}}return e.message=r+"\n",e;}e.exports=r;}),parcelRequire.register("leFFm",function(e,t){e.exports=a;var r=parcelRequire("gEhiJ"),i=parcelRequire("ckX77");function a(e,t){t||(t={});let a=0,n=t.blocksize||40960,o=new r();return new Promise((e,t)=>{setImmediate(s,a,n,e,t);});function s(t,r,a,n){if(t>=e.length)try{return a(o.finish());}catch(t){return n(i(t,e));}try{o.parse(e.slice(t,t+r)),setImmediate(s,t+r,r,a,n);}catch(t){n(i(t,e));}}}}),parcelRequire.register("bIDnv",function(e,t){e.exports=i;var r=parcelRequire("gEhiJ");function i(e){return e?a(e):n(e);}function a(e){let t=new r();return e.setEncoding("utf8"),new Promise((r,i)=>{let a;let n=!1,o=!1;function s(){if(n=!0,!a)try{r(t.finish());}catch(e){i(e);}}function u(e){o=!0,i(e);}function c(){let r;for(a=!0;null!==(r=e.read());)try{t.parse(r);}catch(e){return u(e);}/* istanbul ignore if */if(a=!1,n)return s();o||e.once("readable",c);}e.once("end",s),e.once("error",u),c();});}function n(){let e=new r();return new $k14yv$stream.Transform({objectMode:!0,transform(t,r,i){try{e.parse(t.toString(r));}catch(e){this.emit("error",e);}i();},flush(t){try{this.push(e.finish());}catch(e){this.emit("error",e);}t();}});}}),parcelRequire.register("5e4iL",function(e,t){function r(e){if(null===e)throw i("null");if(void 0===e)throw i("undefined");if("object"!=typeof e)throw i(typeof e);if("function"==typeof e.toJSON&&(e=e.toJSON()),null==e)return null;let t=l(e);if("table"!==t)throw i(t);return u("","",e);}function i(e){return Error("Can only stringify objects, not "+e);}function a(){return Error("Array values can't have mixed types");}function n(e){return Object.keys(e).filter(t=>c(e[t]));}function o(e){return Object.keys(e).filter(t=>!c(e[t]));}function s(e){let t=Array.isArray(e)?[]:Object.prototype.hasOwnProperty.call(e,"__proto__")?{["__proto__"]:void 0}:{};for(let r of Object.keys(e))!e[r]||"function"!=typeof e[r].toJSON||"toISOString"in e[r]?t[r]=e[r]:t[r]=e[r].toJSON();return t;}function u(e,t,r){i=n(r=s(r)),a=o(r);var i,a,u=[],c=t||"";i.forEach(e=>{var t=l(r[e]);"undefined"!==t&&"null"!==t&&u.push(c+p(e)+" = "+g(r[e],!0));}),u.length>0&&u.push("");var d=e&&i.length>0?t+" ":"";return a.forEach(t=>{u.push(F(e,d,t,r[t]));}),u.join("\n");}function c(e){switch(l(e)){case"undefined":case"null":case"integer":case"nan":case"float":case"boolean":case"string":case"datetime":return!0;case"array":return 0===e.length||"table"!==l(e[0]);case"table":return 0===Object.keys(e).length;/* istanbul ignore next */default:return!1;}}function l(e){if(void 0===e)return"undefined";if(null===e)return"null";if("bigint"==typeof e||Number.isInteger(e)&&!Object.is(e,-0))return"integer";if("number"==typeof e)return"float";if("boolean"==typeof e)return"boolean";if("string"==typeof e)return"string";if("toISOString"in e)return isNaN(e)?"undefined":"datetime";else if(Array.isArray(e))return"array";else return"table";}function p(e){var t=String(e);return /^[-A-Za-z0-9_]+$/.test(t)?t:d(t);}function d(e){return'"'+x(e).replace(/"/g,'\\"')+'"';}function m(e){return"'"+e+"'";}function h(e,t){for(;t.length<e;)t="0"+t;return t;}function x(e){return e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r")/* eslint-disable no-control-regex */.replace(/([\u0000-\u001f\u007f])/,e=>"\\u"+h(4,e.codePointAt(0).toString(16)));/* eslint-enable no-control-regex */}function f(e){let t=e.split(/\n/).map(e=>x(e).replace(/"(?="")/g,'\\"')).join("\n");return'"'===t.slice(-1)&&(t+="\\\n"),'"""\n'+t+'"""';}function g(e,t){let r=l(e);return"string"===r&&(t&&/\n/.test(e)?r="string-multiline":!/[\b\t\n\f\r']/.test(e)&&/"/.test(e)&&(r="string-literal")),D(e,r);}function D(e,t){switch(t||(t=l(e)),t){case"string-multiline":return f(e);case"string":re
|
|||
|
* Download a tool from an url and stream it into a file
|
|||
|
*
|
|||
|
* @param url url of tool to download
|
|||
|
* @param dest path to download tool
|
|||
|
* @param auth authorization header
|
|||
|
* @param headers other headers
|
|||
|
* @returns path to downloaded tool
|
|||
|
*/function S(e,t,r,i){return o(this,void 0,void 0,function*(){t=t||m.join(K(),D.default()),yield c.mkdirP(m.dirname(t)),u.debug(`Downloading ${e}`),u.debug(`Destination ${t}`);let a=3,n=G("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),s=G("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20),l=new b.RetryHelper(a,n,s);return yield l.execute(()=>o(this,void 0,void 0,function*(){return yield B(e,t||"",r,i);}),e=>!(e instanceof v)||!e.httpStatusCode||!(e.httpStatusCode<500)||408===e.httpStatusCode||429===e.httpStatusCode);});}function B(e,t,r,i){return o(this,void 0,void 0,function*(){if(l.existsSync(t))throw Error(`Destination file path ${t} already exists`);// Get the response headers
|
|||
|
let a=new h.HttpClient(A,[],{allowRetries:!1});r&&(u.debug("set auth"),void 0===i&&(i={}),i.authorization=r);let n=yield a.get(e,i);if(200!==n.message.statusCode){let t=new v(n.message.statusCode);throw u.debug(`Failed to download from "${e}". Code(${n.message.statusCode}) Message(${n.message.statusMessage})`),t;}// Download the response body
|
|||
|
let o=g.promisify(f.pipeline),s=G("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>n.message),p=s(),d=!1;try{return yield o(p,l.createWriteStream(t)),u.debug("download complete"),d=!0,t;}finally{// Error, delete dest before retry
|
|||
|
if(!d){u.debug("download failed");try{yield c.rmRF(t);}catch(e){u.debug(`Failed to delete '${t}'. ${e.message}`);}}}});}/**
|
|||
|
* Extract a .7z file
|
|||
|
*
|
|||
|
* @param file path to the .7z file
|
|||
|
* @param dest destination directory. Optional.
|
|||
|
* @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
|
|||
|
* problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
|
|||
|
* gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
|
|||
|
* bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
|
|||
|
* interface, it is smaller than the full command line interface, and it does support long paths. At the
|
|||
|
* time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
|
|||
|
* Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
|
|||
|
* to 7zr.exe can be pass to this function.
|
|||
|
* @returns path to the destination directory
|
|||
|
*/function N(e,t,i){return o(this,void 0,void 0,function*(){$k14yv$assert.ok(C,"extract7z() not supported on current OS"),$k14yv$assert.ok(e,'parameter "file" is required'),t=yield L(t);let a=process.cwd();if(process.chdir(t),i)try{let t=u.isDebug()?"-bb1":"-bb0",r=["x",t,"-bd","-sccUTF-8",e],a={silent:!0};yield y.exec(`"${i}"`,r,a);}finally{process.chdir(a);}else{let i=m.join(r,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),n=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),o=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),s=`& '${i}' -Source '${n}' -Target '${o}'`,u=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",s],l={silent:!0};// double-up single quotes, remove double quotes and newlines
|
|||
|
try{let e=yield c.which("powershell",!0);yield y.exec(`"${e}"`,u,l);}finally{process.chdir(a);}}return t;});}/**
|
|||
|
* Extract a compressed tar archive
|
|||
|
*
|
|||
|
* @param file path to the tar
|
|||
|
* @param dest destination directory. Optional.
|
|||
|
* @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
|
|||
|
* @returns path to the destination directory
|
|||
|
*/function F(e,t,r="xz"){return o(this,void 0,void 0,function*(){let i;if(!e)throw Error("parameter 'file' is required");// Create dest
|
|||
|
t=yield L(t),// Determine whether GNU tar
|
|||
|
u.debug("Checking tar --version");let a="";yield y.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:e=>a+=e.toString(),stderr:e=>a+=e.toString()}}),u.debug(a.trim());let n=a.toUpperCase().includes("GNU TAR");i=r instanceof Array?r:[r],u.isDebug()&&!r.includes("v")&&i.push("-v");let o=t,s=e;return C&&n&&(i.push("--force-local"),o=t.replace(/\\/g,"/"),// Technically only the dest needs to have `/` but for aesthetic consistency
|
|||
|
// convert slashes in the file arg too.
|
|||
|
s=e.replace(/\\/g,"/")),n&&(// Suppress warnings when using GNU tar to extract archives created by BSD tar
|
|||
|
i.push("--warning=no-unknown-keyword"),i.push("--overwrite")),i.push("-C",o,"-f",s),yield y.exec("tar",i),t;});}/**
|
|||
|
* Extract a xar compatible archive
|
|||
|
*
|
|||
|
* @param file path to the archive
|
|||
|
* @param dest destination directory. Optional.
|
|||
|
* @param flags flags for the xar. Optional.
|
|||
|
* @returns path to the destination directory
|
|||
|
*/function w(e,t,r=[]){return o(this,void 0,void 0,function*(){let i;$k14yv$assert.ok(E,"extractXar() not supported on current OS"),$k14yv$assert.ok(e,'parameter "file" is required'),t=yield L(t),(i=r instanceof Array?r:[r]).push("-x","-C",t,"-f",e),u.isDebug()&&i.push("-v");let a=yield c.which("xar",!0);return yield y.exec(`"${a}"`,W(i)),t;});}/**
|
|||
|
* Extract a zip
|
|||
|
*
|
|||
|
* @param file path to the zip
|
|||
|
* @param dest destination directory. Optional.
|
|||
|
* @returns path to the destination directory
|
|||
|
*/function P(e,t){return o(this,void 0,void 0,function*(){if(!e)throw Error("parameter 'file' is required");return t=yield L(t),C?yield T(e,t):yield O(e,t),t;});}function T(e,t){return o(this,void 0,void 0,function*(){// build the powershell command
|
|||
|
let r=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),i=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),a=yield c.which("pwsh",!1);// double-up single quotes, remove double quotes and newlines
|
|||
|
//To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
|
|||
|
//and the -Force flag for Expand-Archive as a fallback
|
|||
|
if(a){//attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
|
|||
|
let e=`$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ; try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${r}', '${i}', $true) } catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${r}' -DestinationPath '${i}' -Force } else { throw $_ } } ;`,t=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",e];u.debug(`Using pwsh at path: ${a}`),yield y.exec(`"${a}"`,t);}else{let e=`$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${r}' -DestinationPath '${i}' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${r}', '${i}', $true) }`,t=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",e],a=yield c.which("powershell",!0);u.debug(`Using powershell at path: ${a}`),yield y.exec(`"${a}"`,t);}});}function O(e,t){return o(this,void 0,void 0,function*(){let r=yield c.which("unzip",!0),i=[e];u.isDebug()||i.unshift("-q"),i.unshift("-o"),yield y.exec(`"${r}"`,i,{cwd:t});});}/**
|
|||
|
* Caches a directory and installs it into the tool cacheDir
|
|||
|
*
|
|||
|
* @param sourceDir the directory to cache into tools
|
|||
|
* @param tool tool name
|
|||
|
* @param version version of the tool. semver format
|
|||
|
* @param arch architecture of the tool. Optional. Defaults to machine architecture
|
|||
|
*/function R(e,t,r,i){return o(this,void 0,void 0,function*(){if(r=x.clean(r)||r,i=i||d.arch(),u.debug(`Caching tool ${t} ${r} ${i}`),u.debug(`source dir: ${e}`),!l.statSync(e).isDirectory())throw Error("sourceDir is not a directory");// Create the tool dir
|
|||
|
let a=yield j(t,r,i);// copy each child item. do not move. move can fail on Windows
|
|||
|
// due to anti-virus software having an open handle on a file.
|
|||
|
for(let t of l.readdirSync(e)){let r=m.join(e,t);yield c.cp(r,a,{recursive:!0});}return(// write .complete
|
|||
|
H(t,r,i),a);});}/**
|
|||
|
* Caches a downloaded file (GUID) and installs it
|
|||
|
* into the tool cache with a given targetName
|
|||
|
*
|
|||
|
* @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
|
|||
|
* @param targetFile the name of the file name in the tools directory
|
|||
|
* @param tool tool name
|
|||
|
* @param version version of the tool. semver format
|
|||
|
* @param arch architecture of the tool. Optional. Defaults to machine architecture
|
|||
|
*/function I(e,t,r,i,a){return o(this,void 0,void 0,function*(){if(i=x.clean(i)||i,a=a||d.arch(),u.debug(`Caching tool ${r} ${i} ${a}`),u.debug(`source file: ${e}`),!l.statSync(e).isFile())throw Error("sourceFile is not a file");// create the tool dir
|
|||
|
let n=yield j(r,i,a),o=m.join(n,t);return u.debug(`destination file ${o}`),yield c.cp(e,o),// write .complete
|
|||
|
H(r,i,a),n;});}/**
|
|||
|
* Finds the path to a tool version in the local installed tool cache
|
|||
|
*
|
|||
|
* @param toolName name of the tool
|
|||
|
* @param versionSpec version of the tool
|
|||
|
* @param arch optional arch. defaults to arch of computer
|
|||
|
*/function z(e,t,r){if(!e)throw Error("toolName parameter is required");if(!t)throw Error("versionSpec parameter is required");// attempt to resolve an explicit version
|
|||
|
if(r=r||d.arch(),!U(t)){let i=k(e,r),a=$(i,t);t=a;}// check for the explicit version in the cache
|
|||
|
let i="";if(t){t=x.clean(t)||"";let a=m.join(V(),e,t,r);u.debug(`checking cache: ${a}`),l.existsSync(a)&&l.existsSync(`${a}.complete`)?(u.debug(`Found tool in cache ${e} ${t} ${r}`),i=a):u.debug("not found");}return i;}/**
|
|||
|
* Finds the paths to all versions of a tool that are installed in the local tool cache
|
|||
|
*
|
|||
|
* @param toolName name of the tool
|
|||
|
* @param arch optional arch. defaults to arch of computer
|
|||
|
*/function k(e,t){let r=[];t=t||d.arch();let i=m.join(V(),e);if(l.existsSync(i)){let e=l.readdirSync(i);for(let a of e)if(U(a)){let e=m.join(i,a,t||"");l.existsSync(e)&&l.existsSync(`${e}.complete`)&&r.push(a);}}return r;}function M(e,t,r,i="master"){return o(this,void 0,void 0,function*(){let a=[],n=`https://api.github.com/repos/${e}/${t}/git/trees/${i}`,o=new h.HttpClient("tool-cache"),s={};r&&(u.debug("set auth"),s.authorization=r);let c=yield o.getJson(n,s);if(!c.result)return a;let l="";for(let e of c.result.tree)if("versions-manifest.json"===e.path){l=e.url;break;}s.accept="application/vnd.github.VERSION.raw";let p=yield(yield o.get(l,s)).readBody();if(p){// shouldn't be needed but protects against invalid json saved with BOM
|
|||
|
p=p.replace(/^\uFEFF/,"");try{a=JSON.parse(p);}catch(e){u.debug("Invalid json");}}return a;});}function q(e,t,r,i=d.arch()){return o(this,void 0,void 0,function*(){// wrap the internal impl
|
|||
|
let a=yield p._findMatch(e,t,r,i);return a;});}function L(e){return o(this,void 0,void 0,function*(){return e||(e=m.join(K(),D.default())),yield c.mkdirP(e),e;});}function j(e,t,r){return o(this,void 0,void 0,function*(){let i=m.join(V(),e,x.clean(t)||t,r||"");u.debug(`destination ${i}`);let a=`${i}.complete`;return yield c.rmRF(i),yield c.rmRF(a),yield c.mkdirP(i),i;});}function H(e,t,r){let i=m.join(V(),e,x.clean(t)||t,r||""),a=`${i}.complete`;l.writeFileSync(a,""),u.debug("finished caching tool");}/**
|
|||
|
* Check if version string is explicit
|
|||
|
*
|
|||
|
* @param versionSpec version string to check
|
|||
|
*/function U(e){let t=x.clean(e)||"";u.debug(`isExplicit: ${t}`);let r=null!=x.valid(t);return u.debug(`explicit? ${r}`),r;}/**
|
|||
|
* Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
|
|||
|
*
|
|||
|
* @param versions array of versions to evaluate
|
|||
|
* @param versionSpec semantic version spec to satisfy
|
|||
|
*/function $(e,t){let r="";u.debug(`evaluating ${e.length} versions`),e=e.sort((e,t)=>x.gt(e,t)?1:-1);for(let i=e.length-1;i>=0;i--){let a=e[i],n=x.satisfies(a,t);if(n){r=a;break;}}return r?u.debug(`matched: ${r}`):u.debug("match not found"),r;}/**
|
|||
|
* Gets RUNNER_TOOL_CACHE
|
|||
|
*/function V(){let e=process.env.RUNNER_TOOL_CACHE||"";return $k14yv$assert.ok(e,"Expected RUNNER_TOOL_CACHE to be defined"),e;}/**
|
|||
|
* Gets RUNNER_TEMP
|
|||
|
*/function K(){let e=process.env.RUNNER_TEMP||"";return $k14yv$assert.ok(e,"Expected RUNNER_TEMP to be defined"),e;}/**
|
|||
|
* Gets a global variable
|
|||
|
*/function G(e,t){/* eslint-disable @typescript-eslint/no-explicit-any */let r=$parcel$global[e];/* eslint-enable @typescript-eslint/no-explicit-any */return void 0!==r?r:t;}/**
|
|||
|
* Returns an array of unique values.
|
|||
|
* @param values Values to make unique.
|
|||
|
*/function W(e){return Array.from(new Set(e));}e.exports.downloadTool=S,e.exports.extract7z=N,e.exports.extractTar=F,e.exports.extractXar=w,e.exports.extractZip=P,e.exports.cacheDir=R,e.exports.cacheFile=I,e.exports.find=z,e.exports.findAllVersions=k,e.exports.getManifestFromRepo=M,e.exports.findFromManifest=q,e.exports.isExplicitVersion=U,e.exports.evaluateVersions=$;}),parcelRequire.register("eMKvA",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r(function(t){t(e);});}return new(r||(r=Promise))(function(r,n){function o(e){try{u(i.next(e));}catch(e){n(e);}}function s(e){try{u(i.throw(e));}catch(e){n(e);}}function u(e){e.done?r(e.value):a(e.value).then(o,s);}u((i=i.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports._readLinuxVersionFile=e.exports._getOsVersion=e.exports._findMatch=void 0;let o=a(parcelRequire("lJEXJ"));var s=parcelRequire("lcRzN");function u(t,r,i,a){return n(this,void 0,void 0,function*(){let n,u,c;let l=$k14yv$os.platform();for(let n of i){let i=n.version;if(s.debug(`check ${i} satisfies ${t}`),o.satisfies(i,t)&&(!r||n.stable===r)&&(c=n.files.find(t=>{s.debug(`${t.arch}===${a} && ${t.platform}===${l}`);let r=t.arch===a&&t.platform===l;if(r&&t.platform_version){let i=e.exports._getOsVersion();r=i===t.platform_version||o.satisfies(i,t.platform_version);}return r;}))){s.debug(`matched ${n.version}`),u=n;break;}}return u&&c&&(// clone since we're mutating the file list to be only the file that matches
|
|||
|
(n=Object.assign({},u)).files=[c]),n;});}function c(){// TODO: add windows and other linux, arm variants
|
|||
|
// right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
|
|||
|
let t=$k14yv$os.platform(),r="";if("darwin"===t)r=$k14yv$child_process.execSync("sw_vers -productVersion").toString();else if("linux"===t){// lsb_release process not in some containers, readfile
|
|||
|
// Run cat /etc/lsb-release
|
|||
|
// DISTRIB_ID=Ubuntu
|
|||
|
// DISTRIB_RELEASE=18.04
|
|||
|
// DISTRIB_CODENAME=bionic
|
|||
|
// DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
|
|||
|
let t=e.exports._readLinuxVersionFile();if(t){let e=t.split("\n");for(let t of e){let e=t.split("=");if(2===e.length&&("VERSION_ID"===e[0].trim()||"DISTRIB_RELEASE"===e[0].trim())){r=e[1].trim().replace(/^"/,"").replace(/"$/,"");break;}}}}return r;}function l(){let e="/etc/lsb-release",t="/etc/os-release",r="";return $k14yv$fs.existsSync(e)?r=$k14yv$fs.readFileSync(e).toString():$k14yv$fs.existsSync(t)&&(r=$k14yv$fs.readFileSync(t).toString()),r;}e.exports._findMatch=u,e.exports._getOsVersion=c,e.exports._readLinuxVersionFile=l;}),parcelRequire.register("95990",function(e,t){let r;Object.defineProperty(e.exports,"__esModule",{value:!0});var i,a,n,o=parcelRequire("4TaKt");/**
|
|||
|
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
|||
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
|||
|
*/function s(e){let t=o.getProxyUrl(new URL(e));return t?t.href:"";}(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout";})(i=e.exports.HttpCodes||(e.exports.HttpCodes={})),function(e){e.Accept="accept",e.ContentType="content-type";}(a=e.exports.Headers||(e.exports.Headers={})),function(e){e.ApplicationJson="application/json";}(n=e.exports.MediaTypes||(e.exports.MediaTypes={})),e.exports.getProxyUrl=s;let u=[i.MovedPermanently,i.ResourceMoved,i.SeeOther,i.TemporaryRedirect,i.PermanentRedirect],c=[i.BadGateway,i.ServiceUnavailable,i.GatewayTimeout],l=["OPTIONS","GET","DELETE","HEAD"],p=10,d=5;class m extends Error{constructor(e,t){super(e),this.name="HttpClientError",this.statusCode=t,Object.setPrototypeOf(this,m.prototype);}}e.exports.HttpClientError=m;class h{constructor(e){this.message=e;}readBody(){return new Promise(async(e,t)=>{let r=Buffer.alloc(0);this.message.on("data",e=>{r=Buffer.concat([r,e]);}),this.message.on("end",()=>{e(r.toString());});});}}function x(e){return"https:"===new URL(e).protocol;}e.exports.HttpClientResponse=h,e.exports.isHttps=x;class f{constructor(e,t,r){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=e,this.handlers=t||[],this.requestOptions=r,r&&(null!=r.ignoreSslError&&(this._ignoreSslError=r.ignoreSslError),this._socketTimeout=r.socketTimeout,null!=r.allowRedirects&&(this._allowRedirects=r.allowRedirects),null!=r.allowRedirectDowngrade&&(this._allowRedirectDowngrade=r.allowRedirectDowngrade),null!=r.maxRedirects&&(this._maxRedirects=Math.max(r.maxRedirects,0)),null!=r.keepAlive&&(this._keepAlive=r.keepAlive),null!=r.allowRetries&&(this._allowRetries=r.allowRetries),null!=r.maxRetries&&(this._maxRetries=r.maxRetries));}options(e,t){return this.request("OPTIONS",e,null,t||{});}get(e,t){return this.request("GET",e,null,t||{});}del(e,t){return this.request("DELETE",e,null,t||{});}post(e,t,r){return this.request("POST",e,t,r||{});}patch(e,t,r){return this.request("PATCH",e,t,r||{});}put(e,t,r){return this.request("PUT",e,t,r||{});}head(e,t){return this.request("HEAD",e,null,t||{});}sendStream(e,t,r,i){return this.request(e,t,r,i);}/**
|
|||
|
* Gets a typed object from an endpoint
|
|||
|
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
|
|||
|
*/async getJson(e,t={}){t[a.Accept]=this._getExistingOrDefaultHeader(t,a.Accept,n.ApplicationJson);let r=await this.get(e,t);return this._processResponse(r,this.requestOptions);}async postJson(e,t,r={}){let i=JSON.stringify(t,null,2);r[a.Accept]=this._getExistingOrDefaultHeader(r,a.Accept,n.ApplicationJson),r[a.ContentType]=this._getExistingOrDefaultHeader(r,a.ContentType,n.ApplicationJson);let o=await this.post(e,i,r);return this._processResponse(o,this.requestOptions);}async putJson(e,t,r={}){let i=JSON.stringify(t,null,2);r[a.Accept]=this._getExistingOrDefaultHeader(r,a.Accept,n.ApplicationJson),r[a.ContentType]=this._getExistingOrDefaultHeader(r,a.ContentType,n.ApplicationJson);let o=await this.put(e,i,r);return this._processResponse(o,this.requestOptions);}async patchJson(e,t,r={}){let i=JSON.stringify(t,null,2);r[a.Accept]=this._getExistingOrDefaultHeader(r,a.Accept,n.ApplicationJson),r[a.ContentType]=this._getExistingOrDefaultHeader(r,a.ContentType,n.ApplicationJson);let o=await this.patch(e,i,r);return this._processResponse(o,this.requestOptions);}/**
|
|||
|
* Makes a raw http request.
|
|||
|
* All other methods such as get, post, patch, and request ultimately call this.
|
|||
|
* Prefer get, del, post and patch
|
|||
|
*/async request(e,t,r,a){let n;if(this._disposed)throw Error("Client has already been disposed.");let o=new URL(t),s=this._prepareRequest(e,o,a),p=this._allowRetries&&-1!=l.indexOf(e)?this._maxRetries+1:1,d=0;for(;d<p;){// Check if it's an authentication challenge
|
|||
|
if((n=await this.requestRaw(s,r))&&n.message&&n.message.statusCode===i.Unauthorized){let e;for(let t=0;t<this.handlers.length;t++)if(this.handlers[t].canHandleAuthentication(n)){e=this.handlers[t];break;}if(e)return e.handleAuthentication(this,s,r);break;}let t=this._maxRedirects;for(;-1!=u.indexOf(n.message.statusCode)&&this._allowRedirects&&t>0;){let i=n.message.headers.location;if(!i)break;let u=new URL(i);if("https:"==o.protocol&&o.protocol!=u.protocol&&!this._allowRedirectDowngrade)throw Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");// strip authorization header if redirected to a different hostname
|
|||
|
if(// we need to finish reading the response before reassigning response
|
|||
|
// which will leak the open socket.
|
|||
|
await n.readBody(),u.hostname!==o.hostname)for(let e in a)"authorization"===e.toLowerCase()&&delete a[e];// let's make the request with the new redirectUrl
|
|||
|
s=this._prepareRequest(e,u,a),n=await this.requestRaw(s,r),t--;}if(-1==c.indexOf(n.message.statusCode))break;(d+=1)<p&&(await n.readBody(),await this._performExponentialBackoff(d));}return n;}/**
|
|||
|
* Needs to be called if keepAlive is set to true in request options.
|
|||
|
*/dispose(){this._agent&&this._agent.destroy(),this._disposed=!0;}/**
|
|||
|
* Raw request.
|
|||
|
* @param info
|
|||
|
* @param data
|
|||
|
*/requestRaw(e,t){return new Promise((r,i)=>{let a=function(e,t){e&&i(e),r(t);};this.requestRawWithCallback(e,t,a);});}/**
|
|||
|
* Raw request with callback.
|
|||
|
* @param info
|
|||
|
* @param data
|
|||
|
* @param onResult
|
|||
|
*/requestRawWithCallback(e,t,r){let i;"string"==typeof t&&(e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8"));let a=!1,n=(e,t)=>{a||(a=!0,r(e,t));},o=e.httpModule.request(e.options,e=>{n(null,new h(e));});o.on("socket",e=>{i=e;}),// If we ever get disconnected, we want the socket to timeout eventually
|
|||
|
o.setTimeout(this._socketTimeout||18e4,()=>{i&&i.end(),n(Error("Request timeout: "+e.options.path),null);}),o.on("error",function(e){// err has statusCode property
|
|||
|
// res should have headers
|
|||
|
n(e,null);}),t&&"string"==typeof t&&o.write(t,"utf8"),t&&"string"!=typeof t?(t.on("close",function(){o.end();}),t.pipe(o)):o.end();}/**
|
|||
|
* Gets an http agent. This function is useful when you need an http agent that handles
|
|||
|
* routing through a proxy server - depending upon the url and proxy environment variables.
|
|||
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
|||
|
*/getAgent(e){let t=new URL(e);return this._getAgent(t);}_prepareRequest(e,t,r){let i={};i.parsedUrl=t;let a="https:"===i.parsedUrl.protocol;i.httpModule=a?$k14yv$https:$k14yv$http;let n=a?443:80;return i.options={},i.options.host=i.parsedUrl.hostname,i.options.port=i.parsedUrl.port?parseInt(i.parsedUrl.port):n,i.options.path=(i.parsedUrl.pathname||"")+(i.parsedUrl.search||""),i.options.method=e,i.options.headers=this._mergeHeaders(r),null!=this.userAgent&&(i.options.headers["user-agent"]=this.userAgent),i.options.agent=this._getAgent(i.parsedUrl),this.handlers&&this.handlers.forEach(e=>{e.prepareRequest(i.options);}),i;}_mergeHeaders(e){let t=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{});return this.requestOptions&&this.requestOptions.headers?Object.assign({},t(this.requestOptions.headers),t(e)):t(e||{});}_getExistingOrDefaultHeader(e,t,r){let i;let a=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{});return this.requestOptions&&this.requestOptions.headers&&(i=a(this.requestOptions.headers)[t]),e[t]||i||r;}_getAgent(e){let t;let i=o.getProxyUrl(e),a=i&&i.hostname;// if agent is already assigned use that agent.
|
|||
|
if(this._keepAlive&&a&&(t=this._proxyAgent),this._keepAlive&&!a&&(t=this._agent),t)return t;let n="https:"===e.protocol,s=100;if(this.requestOptions&&(s=this.requestOptions.maxSockets||$k14yv$http.globalAgent.maxSockets),a){let e;r||(r=parcelRequire("eYDoL"));let a={maxSockets:s,keepAlive:this._keepAlive,proxy:{...((i.username||i.password)&&{proxyAuth:`${i.username}:${i.password}`}),host:i.hostname,port:i.port}},o="https:"===i.protocol;t=(e=n?o?r.httpsOverHttps:r.httpsOverHttp:o?r.httpOverHttps:r.httpOverHttp)(a),this._proxyAgent=t;}// if reusing agent across request and tunneling agent isn't assigned create a new agent
|
|||
|
if(this._keepAlive&&!t){let e={keepAlive:this._keepAlive,maxSockets:s};t=n?new $k14yv$https.Agent(e):new $k14yv$http.Agent(e),this._agent=t;}return t||(t=n?$k14yv$https.globalAgent:$k14yv$http.globalAgent),n&&this._ignoreSslError&&(// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
|
|||
|
// we have to cast it to any and change it directly
|
|||
|
t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t;}_performExponentialBackoff(e){e=Math.min(p,e);let t=d*Math.pow(2,e);return new Promise(e=>setTimeout(()=>e(),t));}static dateTimeDeserializer(e,t){if("string"==typeof t){let e=new Date(t);if(!isNaN(e.valueOf()))return e;}return t;}async _processResponse(e,t){return new Promise(async(r,a)=>{let n,o;let s=e.message.statusCode,u={statusCode:s,result:null,headers:{}};s==i.NotFound&&r(u);// get the result from the body
|
|||
|
try{(o=await e.readBody())&&o.length>0&&(n=t&&t.deserializeDates?JSON.parse(o,f.dateTimeDeserializer):JSON.parse(o),u.result=n),u.headers=e.message.headers;}catch(e){// Invalid resource (contents not json); leaving result obj null
|
|||
|
}// note that 3xx redirects are handled by the http layer.
|
|||
|
if(s>299){let e;e=n&&n.message?n.message:o&&o.length>0?o:"Failed request: ("+s+")";let t=new m(e,s);t.result=u.result,a(t);}else r(u);});}}e.exports.HttpClient=f;}),parcelRequire.register("4TaKt",function(e,t){function r(e){let t,r,a="https:"===e.protocol;return i(e)||(r=a?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY)&&(t=new URL(r)),t;}function i(e){let t;if(!e.hostname)return!1;let r=process.env.no_proxy||process.env.NO_PROXY||"";if(!r)return!1;e.port?t=Number(e.port):"http:"===e.protocol?t=80:"https:"===e.protocol&&(t=443);// Format the request hostname and hostname with port
|
|||
|
let i=[e.hostname.toUpperCase()];// Compare request host against noproxy
|
|||
|
for(let e of("number"==typeof t&&i.push(`${i[0]}:${t}`),r.split(",").map(e=>e.trim().toUpperCase()).filter(e=>e)))if(i.some(t=>t===e))return!0;return!1;}Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.getProxyUrl=r,e.exports.checkBypass=i;}),parcelRequire.register("8RSsC",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r(function(t){t(e);});}return new(r||(r=Promise))(function(r,n){function o(e){try{u(i.next(e));}catch(e){n(e);}}function s(e){try{u(i.throw(e));}catch(e){n(e);}}function u(e){e.done?r(e.value):a(e.value).then(o,s);}u((i=i.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.RetryHelper=void 0;let o=a(parcelRequire("lcRzN"));/**
|
|||
|
* Internal class for retries
|
|||
|
*/class s{constructor(e,t,r){if(e<1)throw Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(r),this.minSeconds>this.maxSeconds)throw Error("min seconds should be less than or equal to max seconds");}execute(e,t){return n(this,void 0,void 0,function*(){let r=1;for(;r<this.maxAttempts;){// Try
|
|||
|
try{break;}catch(e){if(t&&!t(e))throw e;o.info(e.message);}// Sleep
|
|||
|
let e=this.getSleepAmount();o.info(`Waiting ${e} seconds before trying again`),yield this.sleep(e),r++;}// Last attempt
|
|||
|
return yield e();});}getSleepAmount(){return Math.floor(Math.random()*(this.maxSeconds-this.minSeconds+1))+this.minSeconds;}sleep(e){return n(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,1e3*e));});}}e.exports.RetryHelper=s;}),parcelRequire.register("7h1SD",function(e,t){$parcel$export(e.exports,"findPyPyVersion",()=>s);var r=parcelRequire("5llvg"),i=parcelRequire("8wFiF"),a=parcelRequire("lJEXJ"),n=parcelRequire("lcRzN"),o=parcelRequire("4ai2V");async function s(e,t,a,o,s){let l,p,d="",m="",h=c(e);if(o&&(p=await r.getAvailablePyPyVersions())&&p.length>0){let e=r.findRelease(p,h.pythonVersion,h.pypyVersion,t,!1);e?(n.info(`Resolved as PyPy ${e.resolvedPyPyVersion} with Python (${e.resolvedPythonVersion})`),h.pythonVersion=e.resolvedPythonVersion,h.pypyVersion=e.resolvedPyPyVersion):n.info(`Failed to resolve PyPy ${h.pypyVersion} with Python (${h.pythonVersion}) from manifest`);}({installDir:l,resolvedPythonVersion:m,resolvedPyPyVersion:d}=u(h.pythonVersion,h.pypyVersion,t)),l||({installDir:l,resolvedPythonVersion:m,resolvedPyPyVersion:d}=await r.installPyPy(h.pypyVersion,h.pythonVersion,t,s,p));let x=i.IS_WINDOWS?"Scripts":"bin",f=$k14yv$path.join(l,x),g=i.IS_WINDOWS?".exe":"",D=$k14yv$path.join(i.IS_WINDOWS?l:f,`python${g}`),y=r.getPyPyBinaryPath(l);return a&&(n.exportVariable("pythonLocation",l),// https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython
|
|||
|
n.exportVariable("Python_ROOT_DIR",l),// https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2
|
|||
|
n.exportVariable("Python2_ROOT_DIR",l),// https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3
|
|||
|
n.exportVariable("Python3_ROOT_DIR",l),n.exportVariable("PKG_CONFIG_PATH",y+"/lib/pkgconfig"),n.addPath(y),n.addPath(f)),n.setOutput("python-version","pypy"+d),n.setOutput("python-path",D),{resolvedPyPyVersion:d,resolvedPythonVersion:m};}function u(e,t,r){let s="",u="",c=i.IS_WINDOWS?l(e):o.find("PyPy",e,r);if(c){// 'tc.find' finds tool based on Python version but we also need to check
|
|||
|
// whether PyPy version satisfies requested version.
|
|||
|
u=(0,i.getPyPyVersionFromPath)(c),s=(0,i.readExactPyPyVersionFile)(c);let e=a.satisfies(s,t);e||(c=null,s="",u="");}return c||n.info(`PyPy version ${e} (${t}) was not found in the local cache`),{installDir:c,resolvedPythonVersion:u,resolvedPyPyVersion:s};}function c(e){let t;let a=e.split("-").filter(e=>!!e);if(/^(pypy)(.+)/.test(a[0])){let e=a[0].replace("pypy","");a.splice(0,1,"pypy",e);}if(a.length<2||"pypy"!=a[0])throw Error("Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy<python-version>' or 'pypy-<python-version>'. See README for examples and documentation.");let n=a[1];if(t=a.length>2?r.pypyVersionToSemantic(a[2]):"x",!(0,i.validateVersion)(n)||!(0,i.validateVersion)(t))throw Error("Invalid 'version' property for PyPy. Both Python version and PyPy versions should satisfy SemVer notation. See README for examples and documentation.");if(!(0,i.validatePythonVersionFormatForPyPy)(n))throw Error("Invalid format of Python version for PyPy. Python version should be specified in format 'x.y'. See README for examples and documentation.");return{pypyVersion:t,pythonVersion:n};}function l(e){let t="";return(0,i.WINDOWS_ARCHS).forEach(r=>t=t||o.find("PyPy",e,r)),t;}}),parcelRequire.register("5llvg",function(e,t){$parcel$export(e.exports,"installPyPy",()=>u),$parcel$export(e.exports,"getAvailablePyPyVersions",()=>c),$parcel$export(e.exports,"findRelease",()=>d),$parcel$export(e.exports,"getPyPyBinaryPath",()=>m),$parcel$export(e.exports,"pypyVersionToSemantic",()=>h);var r=parcelRequire("lcRzN"),i=parcelRequire("4ai2V"),a=parcelRequire("lJEXJ"),n=parcelRequire("95990"),o=parcelRequire("jlr6Q"),s=parcelRequire("8wFiF");async function u(e,t,a,n,o){let u;if(!(o=o??(await c()))||0===o.length)throw Error("No release was found in PyPy version.json");let h=d(o,t,e,a,!1);if(!n||h&&h.foundAsset||(// check for pre-release
|
|||
|
r.info([`Stable PyPy version ${t} (${e}) with arch ${a} not found`,"Trying pre-release versions"].join($k14yv$os.EOL)),h=d(o,t,e,a,!0)),!h||!h.foundAsset)throw Error(`PyPy version ${t} (${e}) with arch ${a} not found`);let{foundAsset:x,resolvedPythonVersion:f,resolvedPyPyVersion:g}=h,D=`${x.download_url}`;r.info(`Downloading PyPy from "${D}" ...`);try{let e=await i.downloadTool(D);r.info("Extracting downloaded archive..."),u=s.IS_WINDOWS?await i.extractZip(e):await i.extractTar(e,void 0,"x");// root folder in archive can have unpredictable name so just take the first folder
|
|||
|
// downloadDir is unique folder under TEMP and can't contain any other folders
|
|||
|
let t=$parcel$interopDefault($k14yv$fs).readdirSync(u)[0],n=$k14yv$path.join(u,t),o=n;(0,s.isNightlyKeyword)(g)||(o=await i.cacheDir(n,"PyPy",f,a)),(0,s.writeExactPyPyVersionFile)(o,g);let c=m(o);return await l(c,f),await p(c),{installDir:o,resolvedPythonVersion:f,resolvedPyPyVersion:g};}catch(e){throw e instanceof Error&&(e instanceof i.HTTPError&&(403===e.httpStatusCode||429===e.httpStatusCode)?r.info(`Received HTTP status code ${e.httpStatusCode}. This usually indicates the rate limit has been exceeded`):r.info(e.message),void 0!==e.stack&&r.debug(e.stack)),e;}}async function c(){let e="https://downloads.python.org/pypy/versions.json",t=new n.HttpClient("tool-cache"),r=await t.getJson(e);if(!r.result)throw Error(`Unable to retrieve the list of available PyPy versions from '${e}'`);return r.result;}async function l(e,t){let i=a.coerce(t),n=a.major(i),o=a.minor(i),u=2===n?"":"3",c=`${n}.${o}`,l=s.IS_WINDOWS?".exe":"";r.info("Creating symlinks..."),(0,s.createSymlinkInFolder)(e,`pypy${u}${l}`,`python${n}${l}`,!0),(0,s.createSymlinkInFolder)(e,`pypy${u}${l}`,`python${l}`,!0),(0,s.createSymlinkInFolder)(e,`pypy${u}${l}`,`pypy${c}${l}`,!0);}async function p(e){r.info("Installing and updating pip");let t=$k14yv$path.join(e,"python");await o.exec(`${t} -m ensurepip`),await o.exec(`${e}/python -m pip install --ignore-installed pip`);}function d(e,t,r,i,n){let o={includePrerelease:n},u=e.filter(e=>{let n=a.satisfies(a.coerce(e.python_version),t),u=(0,s.isNightlyKeyword)(r)&&(0,s.isNightlyKeyword)(e.pypy_version),c=u||a.satisfies(h(e.pypy_version),r,o),l=e.files&&(s.IS_WINDOWS?x(e,i):f(e,i,process.platform));return n&&c&&l;});if(0===u.length)return null;let c=u.sort((e,t)=>a.compare(a.coerce(h(t.pypy_version)),a.coerce(h(e.pypy_version)))||a.compare(a.coerce(t.python_version),a.coerce(e.python_version))),l=c[0],p=s.IS_WINDOWS?g(l,i):D(l,i,process.platform);return{foundAsset:p,resolvedPythonVersion:l.python_version,resolvedPyPyVersion:l.pypy_version.trim()};}function m(e){let t=$k14yv$path.join(e,"bin");return s.IS_WINDOWS?e:t;}function h(e){let t=/(\d+\.\d+\.\d+)((?:a|b|rc))(\d*)/g;return e.replace(t,"$1-$2.$3");}function x(e,t){return t=y(t),e.files.some(e=>(0,s.WINDOWS_PLATFORMS).includes(e.platform)&&e.arch===t);}function f(e,t,r){return e.files.some(e=>e.arch===t&&e.platform===r);}function g(e,t){return t=y(t),e.files.find(e=>(0,s.WINDOWS_PLATFORMS).includes(e.platform)&&e.arch===t);}function D(e,t,r){return e.files.find(e=>e.arch===t&&e.platform===r);}function y(e){return"x32"===e&&(e="x86"),e;}}),parcelRequire.register("4r449",function(e,t){$parcel$export(e.exports,"getCacheDistributor",()=>o);var r,i=parcelRequire("9iXHK"),a=parcelRequire("9YYBR"),n=parcelRequire("dLSs4");function o(e,t,o){switch(e){case r.Pip:return new i.default(t,o);case r.Pipenv:return new a.default(t,o);case r.Poetry:return new n.default(t,o);default:throw Error(`Caching for '${e}' is not supported`);}}!function(e){e.Pip="pip",e.Pipenv="pipenv",e.Poetry="poetry";}(r||(r={}));}),parcelRequire.register("9iXHK",function(e,t){$parcel$export(e.exports,"default",()=>c);var r=parcelRequire("dJiD2"),i=parcelRequire("lcRzN"),a=parcelRequire("jlr6Q"),n=parcelRequire("cjfX9"),o=parcelRequire("8wFiF"),s=parcelRequire("8OF5p");class u extends n.default{constructor(e,t="**/requirements.txt"){super("pip",t),this.pythonVersion=e,this.cacheDependencyBackupPath=s.CACHE_DEPENDENCY_BACKUP_PATH;}async getCacheGlobalDirectories(){let e=1,t="",r="";// Add temporary fix for Windows
|
|||
|
// On windows it is necessary to execute through an exec
|
|||
|
// because the getExecOutput gives a non zero code or writes to stderr for pip 22.0.2,
|
|||
|
// or spawn must be started with the shell option enabled for getExecOutput
|
|||
|
// Related issue: https://github.com/actions/setup-python/issues/328
|
|||
|
if(o.IS_WINDOWS){let e=$parcel$interopDefault($k14yv$util).promisify($k14yv$child_process.exec);({stdout:t,stderr:r}=await e("pip cache dir"));}else({stdout:t,stderr:r,exitCode:e}=await a.getExecOutput("pip cache dir"));if(e&&r)throw Error("Could not get cache folder path for pip package manager");let n=t.trim();return n.includes("~")&&(n=$k14yv$path.join($parcel$interopDefault($k14yv$os).homedir(),n.slice(1))),i.debug(`global cache directory path is ${n}`),[n];}async computeKeys(){let e=(await r.hashFiles(this.cacheDependencyPath))||(await r.hashFiles(this.cacheDependencyBackupPath)),t="",i="";if(o.IS_LINUX){let r=await(0,o.getLinuxInfo)();t=`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-${r.osVersion}-${r.osName}-python-${this.pythonVersion}-${this.packageManager}-${e}`,i=`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-${r.osVersion}-${r.osName}-python-${this.pythonVersion}-${this.packageManager}`;}else t=`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}-${e}`,i=`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}`;return{primaryKey:t,restoreKey:[i]};}}var c=u;}),parcelRequire.register("dJiD2",function(e,t){var r=e.exports&&e.exports.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r(function(t){t(e);});}return new(r||(r=Promise))(function(r,n){function o(e){try{u(i.next(e));}catch(e){n(e);}}function s(e){try{u(i.throw(e));}catch(e){n(e);}}function u(e){e.done?r(e.value):a(e.value).then(o,s);}u((i=i.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.hashFiles=e.exports.create=void 0;var i=parcelRequire("8D3bf"),a=parcelRequire("dzfmx");/**
|
|||
|
* Constructs a globber
|
|||
|
*
|
|||
|
* @param patterns Patterns separated by newlines
|
|||
|
* @param options Glob options
|
|||
|
*/function n(e,t){return r(this,void 0,void 0,function*(){return yield i.DefaultGlobber.create(e,t);});}/**
|
|||
|
* Computes the sha256 hash of a glob
|
|||
|
*
|
|||
|
* @param patterns Patterns separated by newlines
|
|||
|
* @param options Glob options
|
|||
|
*/function o(e,t){return r(this,void 0,void 0,function*(){let r=!0;t&&"boolean"==typeof t.followSymbolicLinks&&(r=t.followSymbolicLinks);let i=yield n(e,{followSymbolicLinks:r});return a.hashFiles(i);});}e.exports.create=n,e.exports.hashFiles=o;}),parcelRequire.register("8D3bf",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r(function(t){t(e);});}return new(r||(r=Promise))(function(r,n){function o(e){try{u(i.next(e));}catch(e){n(e);}}function s(e){try{u(i.throw(e));}catch(e){n(e);}}function u(e){e.done?r(e.value):a(e.value).then(o,s);}u((i=i.apply(e,t||[])).next());});},o=e.exports&&e.exports.__asyncValues||function(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this;},t);function i(r){t[r]=e[r]&&function(t){return new Promise(function(i,n){a(i,n,(t=e[r](t)).done,t.value);});};}function a(e,t,r,i){Promise.resolve(i).then(function(t){e({value:t,done:r});},t);}},s=e.exports&&e.exports.__await||function(e){return this instanceof s?(this.v=e,this):new s(e);},u=e.exports&&e.exports.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,a=r.apply(e,t||[]),n=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this;},i;function o(e){a[e]&&(i[e]=function(t){return new Promise(function(r,i){n.push([e,t,r,i])>1||u(e,t);});});}function u(e,t){try{c(a[e](t));}catch(e){d(n[0][3],e);}}function c(e){e.value instanceof s?Promise.resolve(e.value.v).then(l,p):d(n[0][2],e);}function l(e){u("next",e);}function p(e){u("throw",e);}function d(e,t){e(t),n.shift(),n.length&&u(n[0][0],n[0][1]);}};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.DefaultGlobber=void 0;let c=a(parcelRequire("lcRzN")),l=a($k14yv$fs),p=a(parcelRequire("6m2tn")),d=a($k14yv$path),m=a(parcelRequire("2QLiE"));var h=parcelRequire("lcUKz"),x=parcelRequire("3vD1f"),f=parcelRequire("4y3HB");let g="win32"===process.platform;class D{constructor(e){this.patterns=[],this.searchPaths=[],this.options=p.getOptions(e);}getSearchPaths(){// Return a copy
|
|||
|
return this.searchPaths.slice();}glob(){var e,t;return n(this,void 0,void 0,function*(){let r=[];try{for(var i,a=o(this.globGenerator());!(i=yield a.next()).done;){let e=i.value;r.push(e);}}catch(t){e={error:t};}finally{try{i&&!i.done&&(t=a.return)&&(yield t.call(a));}finally{if(e)throw e.error;}}return r;});}globGenerator(){return u(this,arguments,function*(){// Fill in defaults options
|
|||
|
let e=p.getOptions(this.options),t=[];for(let r of this.patterns)t.push(r),e.implicitDescendants&&(r.trailingSeparator||"**"!==r.segments[r.segments.length-1])&&t.push(new x.Pattern(r.negate,!0,r.segments.concat("**")));// Push the search paths
|
|||
|
let r=[];for(let e of m.getSearchPaths(t)){c.debug(`Search path '${e}'`);// Exists?
|
|||
|
try{// Intentionally using lstat. Detection for broken symlink
|
|||
|
// will be performed later (if following symlinks).
|
|||
|
yield s(l.promises.lstat(e));}catch(e){if("ENOENT"===e.code)continue;throw e;}r.unshift(new f.SearchState(e,1));}// Search
|
|||
|
let i=[];// used to detect cycles
|
|||
|
for(;r.length;){// Pop
|
|||
|
let a=r.pop(),n=m.match(t,a.path),o=!!n||m.partialMatch(t,a.path);if(!n&&!o)continue;// Stat
|
|||
|
let u=yield s(D.stat(a,e,i));// Broken symlink, or symlink cycle detected, or no longer exists
|
|||
|
if(u){// Directory
|
|||
|
if(u.isDirectory()){// Matched
|
|||
|
if(n&h.MatchKind.Directory&&e.matchDirectories)yield yield s(a.path);else if(!o)continue;// Push the child items in reverse
|
|||
|
let t=a.level+1,i=(yield s(l.promises.readdir(a.path))).map(e=>new f.SearchState(d.join(a.path,e),t));r.push(...i.reverse());}else n&h.MatchKind.File&&(yield yield s(a.path));}}});}/**
|
|||
|
* Constructs a DefaultGlobber
|
|||
|
*/static create(e,t){return n(this,void 0,void 0,function*(){let r=new D(t);g&&(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n"));let i=e.split("\n").map(e=>e.trim());for(let e of i)!e||e.startsWith("#")||r.patterns.push(new x.Pattern(e));return r.searchPaths.push(...m.getSearchPaths(r.patterns)),r;});}static stat(e,t,r){return n(this,void 0,void 0,function*(){// Note:
|
|||
|
// `stat` returns info about the target of a symlink (or symlink chain)
|
|||
|
// `lstat` returns info about a symlink itself
|
|||
|
let i;if(t.followSymbolicLinks)try{// Use `stat` (following symlinks)
|
|||
|
i=yield l.promises.stat(e.path);}catch(r){if("ENOENT"===r.code){if(t.omitBrokenSymbolicLinks){c.debug(`Broken symlink '${e.path}'`);return;}throw Error(`No information found for the path '${e.path}'. This may indicate a broken symbolic link.`);}throw r;}else i=yield l.promises.lstat(e.path);// Note, isDirectory() returns false for the lstat of a symlink
|
|||
|
if(i.isDirectory()&&t.followSymbolicLinks){// Get the realpath
|
|||
|
let t=yield l.promises.realpath(e.path);// Fixup the traversal chain to match the item level
|
|||
|
for(;r.length>=e.level;)r.pop();// Test for a cycle
|
|||
|
if(r.some(e=>e===t)){c.debug(`Symlink cycle detected for path '${e.path}' and realpath '${t}'`);return;}// Update the traversal chain
|
|||
|
r.push(t);}return i;});}}e.exports.DefaultGlobber=D;}),parcelRequire.register("6m2tn",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.getOptions=void 0;let n=a(parcelRequire("lcRzN"));/**
|
|||
|
* Returns a copy with defaults filled in.
|
|||
|
*/function o(e){let t={followSymbolicLinks:!0,implicitDescendants:!0,matchDirectories:!0,omitBrokenSymbolicLinks:!0};return e&&("boolean"==typeof e.followSymbolicLinks&&(t.followSymbolicLinks=e.followSymbolicLinks,n.debug(`followSymbolicLinks '${t.followSymbolicLinks}'`)),"boolean"==typeof e.implicitDescendants&&(t.implicitDescendants=e.implicitDescendants,n.debug(`implicitDescendants '${t.implicitDescendants}'`)),"boolean"==typeof e.matchDirectories&&(t.matchDirectories=e.matchDirectories,n.debug(`matchDirectories '${t.matchDirectories}'`)),"boolean"==typeof e.omitBrokenSymbolicLinks&&(t.omitBrokenSymbolicLinks=e.omitBrokenSymbolicLinks,n.debug(`omitBrokenSymbolicLinks '${t.omitBrokenSymbolicLinks}'`))),t;}e.exports.getOptions=o;}),parcelRequire.register("2QLiE",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.partialMatch=e.exports.match=e.exports.getSearchPaths=void 0;let n=a(parcelRequire("d9lHn"));var o=parcelRequire("lcUKz");let s="win32"===process.platform;/**
|
|||
|
* Given an array of patterns, returns an array of paths to search.
|
|||
|
* Duplicates and paths under other included paths are filtered out.
|
|||
|
*/function u(e){// Ignore negate patterns
|
|||
|
e=e.filter(e=>!e.negate);// Create a map of all search paths
|
|||
|
let t={};for(let r of e){let e=s?r.searchPath.toUpperCase():r.searchPath;t[e]="candidate";}let r=[];for(let i of e){// Check if already included
|
|||
|
let e=s?i.searchPath.toUpperCase():i.searchPath;if("included"===t[e])continue;// Check for an ancestor search path
|
|||
|
let a=!1,o=e,u=n.dirname(o);for(;u!==o;){if(t[u]){a=!0;break;}o=u,u=n.dirname(o);}a||(r.push(i.searchPath),t[e]="included");}return r;}/**
|
|||
|
* Matches the patterns against the path
|
|||
|
*/function c(e,t){let r=o.MatchKind.None;for(let i of e)i.negate?r&=~i.match(t):r|=i.match(t);return r;}/**
|
|||
|
* Checks whether to descend further into the directory
|
|||
|
*/function l(e,t){return e.some(e=>!e.negate&&e.partialMatch(t));}e.exports.getSearchPaths=u,e.exports.match=c,e.exports.partialMatch=l;}),parcelRequire.register("d9lHn",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e};};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.safeTrimTrailingSeparator=e.exports.normalizeSeparators=e.exports.hasRoot=e.exports.hasAbsoluteRoot=e.exports.ensureAbsoluteRoot=e.exports.dirname=void 0;let o=a($k14yv$path),s=n($k14yv$assert),u="win32"===process.platform;/**
|
|||
|
* Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.
|
|||
|
*
|
|||
|
* For example, on Linux/macOS:
|
|||
|
* - `/ => /`
|
|||
|
* - `/hello => /`
|
|||
|
*
|
|||
|
* For example, on Windows:
|
|||
|
* - `C:\ => C:\`
|
|||
|
* - `C:\hello => C:\`
|
|||
|
* - `C: => C:`
|
|||
|
* - `C:hello => C:`
|
|||
|
* - `\ => \`
|
|||
|
* - `\hello => \`
|
|||
|
* - `\\hello => \\hello`
|
|||
|
* - `\\hello\world => \\hello\world`
|
|||
|
*/function c(e){// Windows UNC root, e.g. \\hello or \\hello\world
|
|||
|
if(// Normalize slashes and trim unnecessary trailing slash
|
|||
|
e=h(e),u&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(e))return e;// Get dirname
|
|||
|
let t=o.dirname(e);return u&&/^\\\\[^\\]+\\[^\\]+\\$/.test(t)&&(t=h(t)),t;}/**
|
|||
|
* Roots the path if not already rooted. On Windows, relative roots like `\`
|
|||
|
* or `C:` are expanded based on the current working directory.
|
|||
|
*/function l(e,t){// Already rooted
|
|||
|
if(s.default(e,"ensureAbsoluteRoot parameter 'root' must not be empty"),s.default(t,"ensureAbsoluteRoot parameter 'itemPath' must not be empty"),p(t))return t;// Windows
|
|||
|
if(u){// Check for itemPath like C: or C:foo
|
|||
|
if(t.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let e=process.cwd();return(// Drive letter matches cwd? Expand to cwd
|
|||
|
(s.default(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),t[0].toUpperCase()!==e[0].toUpperCase())?`${t[0]}:\\${t.substr(2)}`:// Drive only, e.g. C:
|
|||
|
2===t.length?`${t[0]}:\\${e.substr(3)}`:(e.endsWith("\\")||(e+="\\"),`${t[0]}:\\${e.substr(3)}${t.substr(2)}`));}if(m(t).match(/^\\$|^\\[^\\]/)){let e=process.cwd();return s.default(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),`${e[0]}:\\${t.substr(1)}`;}}return s.default(p(e),"ensureAbsoluteRoot parameter 'root' must have an absolute root"),e.endsWith("/")||u&&e.endsWith("\\")||(e+=o.sep),e+t;}/**
|
|||
|
* On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:
|
|||
|
* `\\hello\share` and `C:\hello` (and using alternate separator).
|
|||
|
*/function p(e){return(// Windows
|
|||
|
(s.default(e,"hasAbsoluteRoot parameter 'itemPath' must not be empty"),// Normalize separators
|
|||
|
e=m(e),u)?e.startsWith("\\\\")||/^[A-Z]:\\/i.test(e):e.startsWith("/"));}/**
|
|||
|
* On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:
|
|||
|
* `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator).
|
|||
|
*/function d(e){return(// Windows
|
|||
|
(s.default(e,"isRooted parameter 'itemPath' must not be empty"),// Normalize separators
|
|||
|
e=m(e),u)?e.startsWith("\\")||/^[A-Z]:/i.test(e):e.startsWith("/"));}/**
|
|||
|
* Removes redundant slashes and converts `/` to `\` on Windows
|
|||
|
*/function m(e){// Windows
|
|||
|
if(e=e||"",u){// Convert slashes on Windows
|
|||
|
e=e.replace(/\//g,"\\");// Remove redundant slashes
|
|||
|
let t=/^\\\\+[^\\]/.test(e);// e.g. \\hello
|
|||
|
return(t?"\\":"")+e.replace(/\\\\+/g,"\\");// preserve leading \\ for UNC
|
|||
|
}// Remove redundant slashes
|
|||
|
return e.replace(/\/\/+/g,"/");}/**
|
|||
|
* Normalizes the path separators and trims the trailing separator (when safe).
|
|||
|
* For example, `/foo/ => /foo` but `/ => /`
|
|||
|
*/function h(e){return(// Short-circuit if empty
|
|||
|
e?!// Normalize separators
|
|||
|
(e=m(e)).endsWith(o.sep)||e===o.sep||u&&/^[A-Z]:\\$/i.test(e)?e:e.substr(0,e.length-1):"");}e.exports.dirname=c,e.exports.ensureAbsoluteRoot=l,e.exports.hasAbsoluteRoot=p,e.exports.hasRoot=d,e.exports.normalizeSeparators=m,e.exports.safeTrimTrailingSeparator=h;}),parcelRequire.register("lcUKz",function(e,t){var r;Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.MatchKind=void 0,function(e){/** Not matched */e[e.None=0]="None",/** Matched if the path is a directory */e[e.Directory=1]="Directory",/** Matched if the path is a regular file */e[e.File=2]="File",/** Matched */e[e.All=3]="All";}(r=e.exports.MatchKind||(e.exports.MatchKind={}));}),parcelRequire.register("3vD1f",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e};};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Pattern=void 0;let o=a($k14yv$os),s=a($k14yv$path),u=a(parcelRequire("d9lHn")),c=n($k14yv$assert);var l=parcelRequire("8sa3G"),p=parcelRequire("lcUKz"),d=parcelRequire("4rndG");let m="win32"===process.platform;class h{constructor(e,t=!1,r,i){let a;if(/**
|
|||
|
* Indicates whether matches should be excluded from the result set
|
|||
|
*/this.negate=!1,"string"==typeof e)a=e.trim();else{// Convert to pattern
|
|||
|
r=r||[],c.default(r.length,"Parameter 'segments' must not empty");let t=h.getLiteral(r[0]);c.default(t&&u.hasAbsoluteRoot(t),"Parameter 'segments' first element must be a root path"),a=new d.Path(r).toString().trim(),e&&(a=`!${a}`);}// Negate
|
|||
|
for(;a.startsWith("!");)this.negate=!this.negate,a=a.substr(1).trim();// Normalize slashes and ensures absolute root
|
|||
|
a=h.fixupPattern(a,i),// Segments
|
|||
|
this.segments=new d.Path(a).segments,// Trailing slash indicates the pattern should only match directories, not regular files
|
|||
|
this.trailingSeparator=u.normalizeSeparators(a).endsWith(s.sep),a=u.safeTrimTrailingSeparator(a);// Search path (literal path prior to the first glob segment)
|
|||
|
let n=!1,o=this.segments.map(e=>h.getLiteral(e)).filter(e=>!n&&!(n=""===e));this.searchPath=new d.Path(o).toString(),// Root RegExp (required when determining partial match)
|
|||
|
this.rootRegExp=new RegExp(h.regExpEscape(o[0]),m?"i":""),this.isImplicitPattern=t;// Create minimatch
|
|||
|
let p={dot:!0,nobrace:!0,nocase:m,nocomment:!0,noext:!0,nonegate:!0};a=m?a.replace(/\\/g,"/"):a,this.minimatch=new l.Minimatch(a,p);}/**
|
|||
|
* Matches the pattern against the specified path
|
|||
|
*/match(e){return(// Match
|
|||
|
("**"===this.segments[this.segments.length-1]?// Normalize slashes
|
|||
|
(e=u.normalizeSeparators(e)).endsWith(s.sep)||!1!==this.isImplicitPattern||(// For example, formats like C: and C:foo on Windows are resolved to an absolute root.
|
|||
|
e=`${e}${s.sep}`):e=u.safeTrimTrailingSeparator(e),this.minimatch.match(e))?this.trailingSeparator?p.MatchKind.Directory:p.MatchKind.All:p.MatchKind.None);}/**
|
|||
|
* Indicates whether the pattern may match descendants of the specified path
|
|||
|
*/partialMatch(e){return(// matchOne does not handle root path correctly
|
|||
|
(// Normalize slashes and trim unnecessary trailing slash
|
|||
|
e=u.safeTrimTrailingSeparator(e),u.dirname(e)===e)?this.rootRegExp.test(e):this.minimatch.matchOne(e.split(m?/\\+/:/\/+/),this.minimatch.set[0],!0));}/**
|
|||
|
* Escapes glob patterns within a path
|
|||
|
*/static globEscape(e){return(m?e:e.replace(/\\/g,"\\\\")// escape '\' on Linux/macOS
|
|||
|
).replace(/(\[)(?=[^/]+\])/g,"[[]")// escape '[' when ']' follows within the path segment
|
|||
|
.replace(/\?/g,"[?]")// escape '?'
|
|||
|
.replace(/\*/g,"[*]");// escape '*'
|
|||
|
}/**
|
|||
|
* Normalizes slashes and ensures absolute root
|
|||
|
*/static fixupPattern(e,t){// Empty
|
|||
|
c.default(e,"pattern cannot be empty");// Must not contain `.` segment, unless first segment
|
|||
|
// Must not contain `..` segment
|
|||
|
let r=new d.Path(e).segments.map(e=>h.getLiteral(e));// Replace leading `.` segment
|
|||
|
if(c.default(r.every((e,t)=>("."!==e||0===t)&&".."!==e),`Invalid pattern '${e}'. Relative pathing '.' and '..' is not allowed.`),// Must not contain globs in root, e.g. Windows UNC path \\foo\b*r
|
|||
|
c.default(!u.hasRoot(e)||r[0],`Invalid pattern '${e}'. Root segment must not contain globs.`),"."===(// Normalize slashes
|
|||
|
e=u.normalizeSeparators(e))||e.startsWith(`.${s.sep}`))e=h.globEscape(process.cwd())+e.substr(1);else if("~"===e||e.startsWith(`~${s.sep}`))t=t||o.homedir(),c.default(t,"Unable to determine HOME directory"),c.default(u.hasAbsoluteRoot(t),`Expected HOME directory to be a rooted path. Actual '${t}'`),e=h.globEscape(t)+e.substr(1);else if(m&&(e.match(/^[A-Z]:$/i)||e.match(/^[A-Z]:[^\\]/i))){let t=u.ensureAbsoluteRoot("C:\\dummy-root",e.substr(0,2));e.length>2&&!t.endsWith("\\")&&(t+="\\"),e=h.globEscape(t)+e.substr(2);}else if(m&&("\\"===e||e.match(/^\\[^\\]/))){let t=u.ensureAbsoluteRoot("C:\\dummy-root","\\");t.endsWith("\\")||(t+="\\"),e=h.globEscape(t)+e.substr(1);}else e=u.ensureAbsoluteRoot(h.globEscape(process.cwd()),e);return u.normalizeSeparators(e);}/**
|
|||
|
* Attempts to unescape a pattern segment to create a literal path segment.
|
|||
|
* Otherwise returns empty string.
|
|||
|
*/static getLiteral(e){let t="";for(let r=0;r<e.length;r++){let i=e[r];// Escape
|
|||
|
if("\\"===i&&!m&&r+1<e.length){t+=e[++r];continue;}if("*"===i||"?"===i)return"";if("["===i&&r+1<e.length){let i="",a=-1;for(let t=r+1;t<e.length;t++){let r=e[t];// Escape
|
|||
|
if("\\"===r&&!m&&t+1<e.length){i+=e[++t];continue;}if("]"===r){a=t;break;}i+=r;}// Closed?
|
|||
|
if(a>=0){// Cannot convert
|
|||
|
if(i.length>1)return"";// Convert to literal
|
|||
|
if(i){t+=i,r=a;continue;}}// Otherwise fall thru
|
|||
|
}// Append
|
|||
|
t+=i;}return t;}/**
|
|||
|
* Escapes regexp special characters
|
|||
|
* https://javascript.info/regexp-escaping
|
|||
|
*/static regExpEscape(e){return e.replace(/[[\\^$.|?*+()]/g,"\\$&");}}e.exports.Pattern=h;}),parcelRequire.register("4rndG",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e};};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Path=void 0;let o=a($k14yv$path),s=a(parcelRequire("d9lHn")),u=n($k14yv$assert),c="win32"===process.platform;/**
|
|||
|
* Helper class for parsing paths into segments
|
|||
|
*/class l{/**
|
|||
|
* Constructs a Path
|
|||
|
* @param itemPath Path or array of segments
|
|||
|
*/constructor(e){// String
|
|||
|
if(this.segments=[],"string"==typeof e){// Not rooted
|
|||
|
if(u.default(e,"Parameter 'itemPath' must not be empty"),// Normalize slashes and trim unnecessary trailing slash
|
|||
|
e=s.safeTrimTrailingSeparator(e),s.hasRoot(e)){// Add all segments, while not at the root
|
|||
|
let t=e,r=s.dirname(t);for(;r!==t;){// Add the segment
|
|||
|
let e=o.basename(t);this.segments.unshift(e),// Truncate the last segment
|
|||
|
t=r,r=s.dirname(t);}// Remainder is the root
|
|||
|
this.segments.unshift(t);}else this.segments=e.split(o.sep);}else{// Must not be empty
|
|||
|
u.default(e.length>0,"Parameter 'itemPath' must not be an empty array");// Each segment
|
|||
|
for(let t=0;t<e.length;t++){let r=e[t];// Must not be empty
|
|||
|
u.default(r,"Parameter 'itemPath' must not contain any empty segments"),// Normalize slashes
|
|||
|
r=s.normalizeSeparators(e[t]),0===t&&s.hasRoot(r)?(r=s.safeTrimTrailingSeparator(r),u.default(r===s.dirname(r),"Parameter 'itemPath' root segment contains information for multiple segments")):// Must not contain slash
|
|||
|
u.default(!r.includes(o.sep),"Parameter 'itemPath' contains unexpected path separators"),this.segments.push(r);}}}/**
|
|||
|
* Converts the path to it's string representation
|
|||
|
*/toString(){// First segment
|
|||
|
let e=this.segments[0],t=e.endsWith(o.sep)||c&&/^[A-Z]:$/i.test(e);for(let r=1;r<this.segments.length;r++)t?t=!1:e+=o.sep,e+=this.segments[r];return e;}}e.exports.Path=l;}),parcelRequire.register("4y3HB",function(e,t){Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.SearchState=void 0;class r{constructor(e,t){this.path=e,this.level=t;}}e.exports.SearchState=r;}),parcelRequire.register("dzfmx",function(e,t){var r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),a=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.hasOwnProperty.call(e,a)&&r(t,e,a);return i(t,e),t;},n=e.exports&&e.exports.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r(function(t){t(e);});}return new(r||(r=Promise))(function(r,n){function o(e){try{u(i.next(e));}catch(e){n(e);}}function s(e){try{u(i.throw(e));}catch(e){n(e);}}function u(e){e.done?r(e.value):a(e.value).then(o,s);}u((i=i.apply(e,t||[])).next());});},o=e.exports&&e.exports.__asyncValues||function(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this;},t);function i(r){t[r]=e[r]&&function(t){return new Promise(function(i,n){a(i,n,(t=e[r](t)).done,t.value);});};}function a(e,t,r,i){Promise.resolve(i).then(function(t){e({value:t,done:r});},t);}};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.hashFiles=void 0;let s=a($k14yv$crypto),u=a(parcelRequire("lcRzN")),c=a($k14yv$fs),l=a($k14yv$stream),p=a($k14yv$util),d=a($k14yv$path);function m(e){var t,r,i;return n(this,void 0,void 0,function*(){let a=!1,n=null!==(i=process.env.GITHUB_WORKSPACE)&&void 0!==i?i:process.cwd(),m=s.createHash("sha256"),h=0;try{for(var x,f=o(e.globGenerator());!(x=yield f.next()).done;){let e=x.value;if(u.debug(e),!e.startsWith(`${n}${d.sep}`)){u.debug(`Ignore '${e}' since it is not under GITHUB_WORKSPACE.`);continue;}if(c.statSync(e).isDirectory()){u.debug(`Skip directory '${e}'.`);continue;}let t=s.createHash("sha256"),r=p.promisify(l.pipeline);yield r(c.createReadStream(e),t),m.write(t.digest()),h++,a||(a=!0);}}catch(e){t={error:e};}finally{try{x&&!x.done&&(r=f.return)&&(yield r.call(f));}finally{if(t)throw t.error;}}return(m.end(),a)?(u.debug(`Found ${h} files to hash.`),m.digest("hex")):(u.debug("No matches found for glob"),"");});}e.exports.hashFiles=m;}),parcelRequire.register("cjfX9",function(e,t){$parcel$export(e.exports,"default",()=>s);var r,i=parcelRequire("lSxMY"),a=parcelRequire("lcRzN"),n=parcelRequire("8OF5p");!function(e){e.STATE_CACHE_PRIMARY_KEY="cache-primary-key",e.CACHE_MATCHED_KEY="cache-matched-key",e.CACHE_PATHS="cache-paths";}(r||(r={}));class o{constructor(e,t){this.packageManager=e,this.cacheDependencyPath=t,this.CACHE_KEY_PREFIX="setup-python";}async handleLoadedCache(){}async restoreCache(){let e;let{primaryKey:t,restoreKey:o}=await this.computeKeys();if(t.endsWith("-")){let e="pip"===this.packageManager?`${this.cacheDependencyPath.split("\n").join(",")} or ${n.CACHE_DEPENDENCY_BACKUP_PATH}`:this.cacheDependencyPath.split("\n").join(",");throw Error(`No file in ${process.cwd()} matched to [${e}], make sure you have checked out the target repository`);}let s=await this.getCacheGlobalDirectories();a.saveState(r.CACHE_PATHS,s);try{e=await i.restoreCache(s,t,o);}catch(t){let e=t.message;a.info(`[warning]${e}`),a.setOutput("cache-hit",!1);return;}a.saveState(r.STATE_CACHE_PRIMARY_KEY,t),await this.handleLoadedCache(),this.handleMatchResult(e,t);}handleMatchResult(e,t){e?(a.saveState(r.CACHE_MATCHED_KEY,e),a.info(`Ca
|
|||
|
let e=new Set(),t=await r.create(this.patterns);for await(let r of t.globGenerator()){let t=$k14yv$path.dirname(r);n.debug(`Processing Poetry project at ${t}`),this.poetryProjects.add(t);let i=await this.getPoetryConfiguration(t),a=i["cache-dir"],o=i["virtualenvs.path"].replace("{cache-dir}",a);e.add(o),i["virtualenvs.in-project"]&&e.add($k14yv$path.join(t,".venv"));}return[...e];}async computeKeys(){let e=await r.hashFiles(this.patterns),t=`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}-v2-${e}`,i=void 0;return{primaryKey:t,restoreKey:i};}async handleLoadedCache(){await super.handleLoadedCache();// After the cache is loaded -- make sure virtualenvs use the correct Python version (the one that we have just installed).
|
|||
|
// This will handle invalid caches, recreating virtualenvs if necessary.
|
|||
|
let e=await i.which("python");if(e)n.debug(`pythonLocation is ${e}`);else{(0,s.logWarning)("python binaries were not found in PATH");return;}for(let t of this.poetryProjects){let{exitCode:r,stderr:i}=await a.getExecOutput("poetry",["env","use",e],{ignoreReturnCode:!0,cwd:t});r&&(0,s.logWarning)(i);}}async getPoetryConfiguration(e){let{stdout:t,stderr:r,exitCode:i}=await a.getExecOutput("poetry",["config","--list"],{cwd:e});if(i&&r)throw Error("Could not get cache folder path for poetry package manager");let n=t.trim().split("\n"),o={};for(let e of n){e=e.replace(/#.*$/gm,"");let[t,r]=e.split("=").map(e=>e.trim());o[t]=JSON.parse(r);}return o;}}var c=u;});
|
|||
|
//# sourceMappingURL=actions_python.945fba47.js.map
|