From ad0d9d874b7a98a630e01ff6ed2fe42e7cfaf919 Mon Sep 17 00:00:00 2001 From: AxiBright Date: Wed, 15 Apr 2026 19:51:45 +0800 Subject: [PATCH] vault backup: 2026-04-15 19:51:45 --- .obsidian/community-plugins.json | 2 +- .obsidian/plugins/obsidian-livesync/data.json | 170 ++++++ .obsidian/plugins/obsidian-livesync/main.js | 19 + .../plugins/obsidian-livesync/manifest.json | 10 + .../plugins/obsidian-livesync/styles.css | 487 ++++++++++++++++++ .obsidian/plugins/remotely-secure/.gitignore | 1 - .obsidian/plugins/remotely-secure/main.js | 235 --------- .../plugins/remotely-secure/manifest.json | 10 - .obsidian/plugins/remotely-secure/styles.css | 72 --- .obsidian/workspace.json | 230 +++------ 10 files changed, 756 insertions(+), 480 deletions(-) create mode 100644 .obsidian/plugins/obsidian-livesync/data.json create mode 100644 .obsidian/plugins/obsidian-livesync/main.js create mode 100644 .obsidian/plugins/obsidian-livesync/manifest.json create mode 100644 .obsidian/plugins/obsidian-livesync/styles.css delete mode 100644 .obsidian/plugins/remotely-secure/.gitignore delete mode 100644 .obsidian/plugins/remotely-secure/main.js delete mode 100644 .obsidian/plugins/remotely-secure/manifest.json delete mode 100644 .obsidian/plugins/remotely-secure/styles.css diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index 1dc2093..6934576 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -14,5 +14,5 @@ "quickadd", "obsidian-custom-attachment-location", "templater-obsidian", - "remotely-save" + "obsidian-livesync" ] \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-livesync/data.json b/.obsidian/plugins/obsidian-livesync/data.json new file mode 100644 index 0000000..aa83944 --- /dev/null +++ b/.obsidian/plugins/obsidian-livesync/data.json @@ -0,0 +1,170 @@ +{ + "remoteType": "", + "useCustomRequestHandler": false, + "couchDB_URI": "", + "couchDB_USER": "", + "couchDB_PASSWORD": "", + "couchDB_DBNAME": "", + "liveSync": true, + "syncOnSave": false, + "syncOnStart": false, + "savingDelay": 200, + "lessInformationInLog": false, + "gcDelay": 0, + "versionUpFlash": "", + "minimumChunkSize": 20, + "longLineThreshold": 250, + "showVerboseLog": false, + "suspendFileWatching": false, + "trashInsteadDelete": true, + "periodicReplication": false, + "periodicReplicationInterval": 60, + "syncOnFileOpen": false, + "encrypt": true, + "passphrase": "", + "usePathObfuscation": false, + "doNotDeleteFolder": false, + "resolveConflictsByNewerFile": false, + "batchSave": false, + "batchSaveMinimumDelay": 5, + "batchSaveMaximumDelay": 60, + "deviceAndVaultName": "", + "usePluginSettings": false, + "showOwnPlugins": false, + "showStatusOnEditor": true, + "showStatusOnStatusbar": true, + "showOnlyIconsOnEditor": false, + "hideFileWarningNotice": true, + "networkWarningStyle": "", + "usePluginSync": false, + "autoSweepPlugins": false, + "autoSweepPluginsPeriodic": false, + "notifyPluginOrSettingUpdated": false, + "checkIntegrityOnSave": false, + "batch_size": 25, + "batches_limit": 25, + "useHistory": true, + "disableRequestURI": true, + "skipOlderFilesOnSync": true, + "checkConflictOnlyOnOpen": false, + "showMergeDialogOnlyOnActive": false, + "syncInternalFiles": false, + "syncInternalFilesBeforeReplication": false, + "syncInternalFilesIgnorePatterns": "\\/node_modules\\/, \\/\\.git\\/, \\/obsidian-livesync\\/", + "syncInternalFilesTargetPatterns": "", + "syncInternalFilesInterval": 60, + "additionalSuffixOfDatabaseName": "732f4bc40af62858", + "ignoreVersionCheck": false, + "lastReadUpdates": 25, + "deleteMetadataOfDeletedFiles": false, + "syncIgnoreRegEx": "", + "syncOnlyRegEx": "", + "customChunkSize": 0, + "readChunksOnline": true, + "watchInternalFileChanges": true, + "automaticallyDeleteMetadataOfDeletedFiles": 0, + "disableMarkdownAutoMerge": false, + "writeDocumentsIfConflicted": false, + "useDynamicIterationCount": false, + "syncAfterMerge": false, + "configPassphraseStore": "", + "encryptedPassphrase": "%$VfIpgfGduB0nHyOBMAMm1I1pCOrE55EPTGe//T38LqUUVesp1pkHUeOPMwh7xL7sjGmBT3Few85IBXbYh6iAYPQr5KZTOEOtT5US9kHFPkg64KHknAmA5CvGtFRp3hGvHQL5biCWIloixB/I", + "encryptedCouchDBConnection": "%$VfIpgfGduB0nHyOBMAMm1I1pCOrE55EPTGe//T38LqUJKQS/2qfwShHkm52m6X5CiLs0CwUvzONJ65nLLRhtIjJJQOdfiTvVAyR+qpi3bSWm1QUVGMgcMxQ2jLovm9OgnCb8RV2yrFfPaybzjjkEpCBAFlbHBpi8wXE7/RSV2ctcwIKOvxa/mM1IRyq1M3kjHce/CFe5PkwPU20DC3KNuLu5S9/bu7zPt5TSpUbYrTc2Yo0yDhI3CkYD7icQaXIUmrlIZGnkJBAPFPtxOukewnwiUlJus5j5PkQEcluslTk6W+ijp2rOupvq5VLbd2PbTW20F78p7+ewovVNpm97tkuDvoB0JT55iO0pTsb/kGz5ALzo4+T0rxNVqcPUSKbIbGSTK4oAREHIt4WsMtqXWFNrlKlAYNwyUNGNpALaC2tTEjG7vPu4BkNr4WvU/72VTKwsmPQrnLNionNhombtQJfe8nFEvh9/Y4oBbAfj473BlPc6NHFOHKcQF1A2jG6loffBDOJBArmS9RE000Wm8JITDodncKShn6w3E0dQpIU2cvIjS5h3RewGUqtjvL5euCThRGVhlUXs9AXRXwIjiGLr9pqqPSRQrSFYzCFwHhJpU/DltTe8qLN1fnizRQtAsJBOMMZLwgSTBTFCXKnJ1G5NEmwkDXXcWy359/CkinceL9HukNnSvrNFbag6W/AE", + "permitEmptyPassphrase": false, + "remoteConfigurations": { + "legacy-couchdb": { + "id": "legacy-couchdb", + "name": "CouchDB Remote", + "uri": "%$VfIpgfGduB0nHyOBMAMm1I1pCOrE55EPTGe//T38LqVweN/rUNr4tQiJkNt8T+ErV6rrrfc6MNl3CvqfDS163yviwZWd1QLV263Wb3Hc1Y5/wfOICpdEakugeru88twAbxFgWI398RJEQDydW/uI6Ui72V0igw5hGq7QnGVQUEEF2EWjnA9WEz9annY7aV2KaWYSQV6WdD5/RNc=", + "isEncrypted": true + } + }, + "activeConfigurationId": "legacy-couchdb", + "useIndexedDBAdapter": false, + "useTimeouts": false, + "writeLogToTheFile": false, + "doNotPaceReplication": false, + "hashCacheMaxCount": 300, + "hashCacheMaxAmount": 50, + "concurrencyOfReadChunksOnline": 40, + "minimumIntervalOfReadChunksOnline": 50, + "hashAlg": "xxhash64", + "suspendParseReplicationResult": false, + "doNotSuspendOnFetching": false, + "useIgnoreFiles": false, + "ignoreFiles": ".gitignore", + "syncOnEditorSave": false, + "pluginSyncExtendedSetting": {}, + "syncMaxSizeInMB": 50, + "settingSyncFile": "", + "writeCredentialsForSettingSync": false, + "notifyAllSettingSyncFile": false, + "isConfigured": true, + "settingVersion": 10, + "enableCompression": false, + "accessKey": "", + "bucket": "", + "endpoint": "", + "region": "", + "secretKey": "", + "useEden": false, + "maxChunksInEden": 10, + "maxTotalLengthInEden": 1024, + "maxAgeInEden": 10, + "disableCheckingConfigMismatch": false, + "displayLanguage": "zh", + "enableChunkSplitterV2": false, + "disableWorkerForGeneratingChunks": false, + "processSmallFilesInUIThread": false, + "notifyThresholdOfRemoteStorageSize": 2000, + "usePluginSyncV2": false, + "usePluginEtc": false, + "doNotUseFixedRevisionForChunks": true, + "showLongerLogInsideEditor": false, + "sendChunksBulk": false, + "sendChunksBulkMaxSize": 1, + "useSegmenter": false, + "useAdvancedMode": false, + "usePowerUserMode": false, + "useEdgeCaseMode": false, + "enableDebugTools": false, + "suppressNotifyHiddenFilesChange": false, + "syncMinimumInterval": 2000, + "P2P_Enabled": false, + "P2P_AutoAccepting": 0, + "P2P_AppID": "self-hosted-livesync", + "P2P_roomID": "", + "P2P_passphrase": "", + "P2P_relays": "wss://exp-relay.vrtmrz.net/", + "P2P_AutoBroadcast": false, + "P2P_AutoStart": false, + "P2P_AutoSyncPeers": "", + "P2P_AutoWatchPeers": "", + "P2P_SyncOnReplication": "", + "P2P_RebuildFrom": "", + "P2P_AutoAcceptingPeers": "", + "P2P_AutoDenyingPeers": "", + "P2P_IsHeadless": false, + "P2P_DevicePeerName": "", + "P2P_turnServers": "", + "P2P_turnUsername": "", + "P2P_turnCredential": "", + "doctorProcessedVersion": "0.25.27", + "bucketCustomHeaders": "", + "couchDB_CustomHeaders": "", + "useJWT": false, + "jwtAlgorithm": "", + "jwtKey": "", + "jwtKid": "", + "jwtSub": "", + "jwtExpDuration": 5, + "useRequestAPI": false, + "bucketPrefix": "", + "chunkSplitterVersion": "v3-rabin-karp", + "E2EEAlgorithm": "v2", + "processSizeMismatchedFiles": false, + "forcePathStyle": true, + "syncInternalFileOverwritePatterns": "", + "useOnlyLocalChunk": false, + "maxMTimeForReflectEvents": 0 +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-livesync/main.js b/.obsidian/plugins/obsidian-livesync/main.js new file mode 100644 index 0000000..c7df3e4 --- /dev/null +++ b/.obsidian/plugins/obsidian-livesync/main.js @@ -0,0 +1,19 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD AND TERSER +if you want to view the source, please visit the github repository of this plugin +*/ + +"use strict";function Logger(message,level,key3){_logger(message,level,key3)}function __logger(message,baseLevel,flagsOrKey,key3){let level=baseLevel;"string"==typeof flagsOrKey?key3=flagsOrKey:void 0!==flagsOrKey&&(level|=flagsOrKey);_logger(message,level,key3)}function info(message,flagsOrKey,key3){__logger(message,LEVEL_INFO,flagsOrKey,key3)}function isMetaEntry(entry){return"children"in entry}function statusDisplay(status){return status?"EXPERIMENTAL"==status?" (Experimental)":"ALPHA"==status?" (Alpha)":"BETA"==status?" (Beta)":` (${status})`:""}function confName(key3,alt=""){var _a8,_b5;return key3 in configurationNames?`${null==(_a8=configurationNames[key3])?void 0:_a8.name}${statusDisplay(null==(_b5=configurationNames[key3])?void 0:_b5.status)}`:`${alt||""}`}function isValidLength(len){return len>=1&&len<=5}function encodeObjectAsArray(obj){if(Array.isArray(obj))return ARRAY_MARKER+encodeAnyArray(obj,!0);const objArray=[...Object.entries(obj)].flat();return OBJECT_MARKER+encodeAnyArray(objArray,!0)}function decodeObjectFromArray(str){if(str[0]==ARRAY_MARKER)return decodeAnyArray(str.substring(1));if(str[0]==OBJECT_MARKER){const arr=decodeAnyArray(str.substring(1)),entries2=[];for(let i2=0;i2{if(void 0===v2)return"u";if(null===v2)return"n";if(!1===v2)return"f";if(!0===v2)return"t";if("number"==typeof v2){const isFloat=!Number.isInteger(v2),b36=v2.toString(36),strNum=v2.toString(),expression=isFloat||b36.length>strNum.length?"n":"N",encodedStr="N"==expression?b36:strNum,len=encodedStr.length.toString(36),lenLen2=len.length;if(!isValidLength(lenLen2))throw new Error("Number length exceeds maximum encodable length of 5 in base36.");return prefixMapNumber[expression][lenLen2]+len+encodedStr}let str,prefix;if("string"==typeof v2){str=v2;prefix="s"}else{prefix="o";const objectStr=JSON.stringify(v2),containUndefined=-1!==Object.values(v2).indexOf(void 0);if(!safer||containUndefined){const objectEncoded=encodeObjectAsArray(v2);str=containUndefined||objectEncoded.lengthvoid 0!==(null==a2?void 0:a2[key3])&&void 0!==(null==b3?void 0:b3[key3])&&isObjectDifferent(null==a2?void 0:a2[key3],null==b3?void 0:b3[key3])).some(e3=>1==e3):keys3.map(key3=>isObjectDifferent(key3 in a2?a2[key3]:SYMBOL_A,key3 in b3?b3[key3]:SYMBOL_B)).some(e3=>1==e3)}return a2!==b3}function reactiveSource(initialValue){return _reactive({initialValue})}function reactive(expression,initialValue){return _reactive({expression,initialValue})}function resetTopologicalSortCacheFor(ids){ids.forEach(id=>topologicalSortCache.delete(id));topologicalSortCache.forEach((value,key3)=>{ids.includes(key3)||topologicalSortCache.delete(key3)})}function topologicalSort(startNode){if(topologicalSortCache.has(startNode.id)){const ref=topologicalSortCache.get(startNode.id);if(ref){const result2=ref.map(e3=>e3.instance.deref()).filter(e3=>e3);if(result2.length===ref.length)return result2}}const visited=new Set,sorted=[],recursionStack=new Set;(function visit(node){if(!visited.has(node)){if(recursionStack.has(node))throw new Error("Circular dependency detected!");visited.add(node);recursionStack.add(node);for(const dependant of node.dependants)visit(dependant);sorted.push(node);recursionStack.delete(node)}})(startNode);const result=sorted.reverse();topologicalSortCache.set(startNode.id,result.map(e3=>({id:e3.id,instance:new FallbackWeakRef(e3)})));return result}function _reactive({expression,initialValue,isSource}){let value,_isDirty=!1;const id=_reactiveSourceId++,changeHandlers=new Set,instance={id,dependants:new Set,_markDirty(){_isDirty||(_isDirty=!0)},markDirty(){topologicalSort(instance).forEach(node=>node._markDirty())},_rippleChanged(){changeHandlers.forEach(e3=>e3(instance))},rippleChanged(){topologicalSort(instance).forEach(node=>node._rippleChanged())},markClean(){_isDirty=!1},get isDirty(){return _isDirty},get value(){if(context&&!instance.dependants.has(context)){instance.dependants.add(context);resetTopologicalSortCacheFor([instance.id,context.id])}if(_isDirty){if(expression){const oldValue=value,newValue=expression();isObjectDifferent(oldValue,newValue)&&(value=newValue)}instance.markClean()}return value},set value(newValue){if(_isDirty&&!expression)value=newValue;else if(isObjectDifferent(value,newValue)){value=newValue;if(!_isDirty){instance.markDirty();instance.rippleChanged()}}},onChanged(handler){changeHandlers.add(handler)},offChanged(handler){changeHandlers.delete(handler)}};value=function initialize(){const previousContext=context;context=instance;const r4=expression?expression(initialValue):initialValue;context=previousContext;return r4}();return instance}function computed(expression){const v2=reactive(expression);return()=>v2.value}async function isSomeResolved(promises){return 0!=promises.length&&await Promise.race([...promises,Promise.resolve(UNRESOLVED)])!==UNRESOLVED}function fireAndForget(p2){if("function"==typeof p2)return fireAndForget(p2());p2.then(noop).catch(noop)}function yieldMicrotask(){return new Promise(res2=>queueMicrotask(res2))}function yieldAnimationFrame(){return new Promise(res2=>requestAnimationFrame(res2))}function yieldNextAnimationFrame(){return currentYieldingAnimationFrame||(currentYieldingAnimationFrame=(async()=>{const ret=await yieldAnimationFrame();currentYieldingAnimationFrame=void 0;return ret})())}function cancelableDelay(timeout,cancel2=TIMED_OUT_SIGNAL){let timer;const promise=promiseWithResolvers();timer=setTimeout(()=>{timer=void 0;promise.resolve(cancel2)},timeout);return{promise:promise.promise,cancel(){if(timer){clearTimeout(timer);timer=void 0}}}}function serialized(key3,proc){var _a8;const prev=serializedMap.get(key3),p2=promiseWithResolvers();queueCount.set(key3,(null!=(_a8=queueCount.get(key3))?_a8:0)+1);const nextTask=async()=>{try{p2.resolve(await proc())}catch(ex){p2.reject(ex)}finally{const count=queueCount.get(key3)-1;if(0===count){serializedMap.delete(key3);queueCount.delete(key3)}else queueCount.set(key3,count)}};if(prev){const newP=prev.then(()=>nextTask());serializedMap.set(key3,newP)}else serializedMap.set(key3,nextTask());return p2.promise}function shareRunningResult(key3,proc){const prev=shareSerializedMap.get(key3);if(prev)return prev;const p2=promiseWithResolvers();shareSerializedMap.set(key3,p2.promise);const task=async()=>{try{p2.resolve(await proc())}catch(ex){p2.reject(ex)}finally{shareSerializedMap.delete(key3)}};fireAndForget(()=>task());return p2.promise}function skipIfDuplicated(key3,proc){if(skipDuplicatedMap.get(key3))return Promise.resolve(null);const p2=promiseWithResolvers();skipDuplicatedMap.set(key3,p2.promise);const task=async()=>{try{p2.resolve(await proc())}catch(ex){p2.reject(ex)}finally{skipDuplicatedMap.delete(key3)}};fireAndForget(()=>task());return p2.promise}async function scheduleOnceIfDuplicated(key3,proc){if(isLockAcquired(key3)){waitingProcessMap.set(key3,proc);return Promise.resolve(void 0)}return await serialized(key3,proc).then(()=>{const nextProc=waitingProcessMap.get(key3);if(nextProc){waitingProcessMap.delete(key3);return scheduleOnceIfDuplicated(key3,nextProc)}})}function isLockAcquired(key3){var _a8;return(null!=(_a8=queueCount.get(key3))?_a8:0)>0}async function waitForSignal(id,timeout){return await globalSlipBoard.awaitNext(GENERIC_COMPATIBILITY_SIGNAL,id,{timeout})!==TIMED_OUT_SIGNAL}function sendSignal(id){globalSlipBoard.submit(GENERIC_COMPATIBILITY_SIGNAL,id)}function sendValue(id,result){globalSlipBoard.submit(GENERIC_COMPATIBILITY_VALUE,id,result)}function unwrapTaskResult(result){if("ok"in result)return result.ok;if("err"in result)return result.err;throw new Error("Argument Exception: Could not unwrap")}function isTaskWaiting(task){if(task instanceof Promise)return!1;if(task instanceof Function)return!0;throw new Error("Invalid state")}async function wrapEachProcess(key3,task){try{return{key:key3,ok:await task}}catch(ex){return{key:key3,err:ex instanceof Error?ex:new Error(`${ex}`)}}}async function*processAllTasksWithConcurrencyLimit(limit,tasks3){const nowProcessing=new Map;let idx2=0;const pendingTasks=tasks3.reverse();for(;pendingTasks.length>0||nowProcessing.size>0;){L2:for(;nowProcessing.size0;){const task=pendingTasks.pop();if(void 0===task)break L2;idx2++;const wrappedPromise=wrapEachProcess(idx2,isTaskWaiting(task)?task():task);nowProcessing.set(idx2,wrappedPromise)}const done=await Promise.race(nowProcessing.values());nowProcessing.delete(done.key);yield done}}async function mapAllTasksWithConcurrencyLimit(limit,tasks3){const results=new Map;for await(const v2 of processAllTasksWithConcurrencyLimit(limit,tasks3))results.set(v2.key,v2);return[...results.entries()].sort((a2,b3)=>a2[0]-b3[0]).map(e3=>e3[1])}function scheduleTask(key3,timeout,proc,skipIfTaskExist){if(tasks.has(key3)){if(skipIfTaskExist)return;cancelTask(key3)}const newTask=setTimeout(()=>{tasks.delete(key3);proc()},timeout);tasks.set(key3,newTask)}function cancelTask(key3){const old=tasks.get(key3);if(old){clearTimeout(old);tasks.delete(key3)}}function cancelAllTasks(){for(const v2 of tasks.keys())cancelTask(v2)}function cancelPeriodicTask(key3){if(key3 in intervals){clearInterval(intervals[key3]);delete intervals[key3]}}function cancelAllPeriodicTask(){for(const v2 in intervals)cancelPeriodicTask(v2)}function isWaitingForTimeout(key3){return waitingItems.has(key3)}function numeric(str){return isNaN(str)?str.charCodeAt(0):parseInt(str,10)}function escapeBraces(str){return str.replace(slashPattern,escSlash).replace(openPattern,escOpen).replace(closePattern,escClose).replace(commaPattern,escComma).replace(periodPattern,escPeriod)}function unescapeBraces(str){return str.replace(escSlashPattern,"\\").replace(escOpenPattern,"{").replace(escClosePattern,"}").replace(escCommaPattern,",").replace(escPeriodPattern,".")}function parseCommaParts(str){if(!str)return[""];const parts=[],m3=balanced("{","}",str);if(!m3)return str.split(",");const{pre,body,post}=m3,p2=pre.split(",");p2[p2.length-1]+="{"+body+"}";const postParts=parseCommaParts(post);if(post.length){p2[p2.length-1]+=postParts.shift();p2.push.apply(p2,postParts)}parts.push.apply(parts,p2);return parts}function expand(str,options={}){if(!str)return[];const{max:max3=EXPANSION_MAX}=options;"{}"===str.slice(0,2)&&(str="\\{\\}"+str.slice(2));return expand_(escapeBraces(str),max3,!0).map(unescapeBraces)}function embrace(str){return"{"+str+"}"}function isPadded(el){return/^-?0\d/.test(el)}function lte(i2,y2){return i2<=y2}function gte(i2,y2){return i2>=y2}function expand_(str,max3,isTop){const expansions=[],m3=balanced("{","}",str);if(!m3)return[str];const pre=m3.pre,post=m3.post.length?expand_(m3.post,max3,!1):[""];if(/\$$/.test(m3.pre))for(let k2=0;k2=0;if(!isSequence&&!isOptions)return m3.post.match(/,(?!,).*\}/)?expand_(str=m3.pre+"{"+m3.body+escClose+m3.post,max3,!0):[str];let n3,N3;if(isSequence)n3=m3.body.split(/\.\./);else{n3=parseCommaParts(m3.body);if(1===n3.length&&void 0!==n3[0]){n3=expand_(n3[0],max3,!1).map(embrace);if(1===n3.length)return post.map(p2=>m3.pre+n3[0]+p2)}}if(isSequence&&void 0!==n3[0]&&void 0!==n3[1]){const x2=numeric(n3[0]),y2=numeric(n3[1]),width=Math.max(n3[0].length,n3[1].length);let incr=3===n3.length&&void 0!==n3[2]?Math.max(Math.abs(numeric(n3[2])),1):1,test=lte;if(y20){const z2=new Array(need+1).join("0");c3=i2<0?"-"+z2+c3.slice(1):z2+c3}}}N3.push(c3)}}else{N3=[];for(let j2=0;j2Uint8Array.fromBase64(e3).buffer),len=bufItems.reduce((p2,c3)=>p2+c3.byteLength,0),joinedArray=new Uint8Array(len);let offset=0;bufItems.forEach(e3=>{joinedArray.set(new Uint8Array(e3),offset);offset+=e3.byteLength});return joinedArray.buffer}catch(ex){Logger("Base64 Decode error",LOG_LEVEL_VERBOSE);Logger(ex,LOG_LEVEL_VERBOSE);return new ArrayBuffer(0)}}function base64ToArrayBufferInternalBrowser(base64){try{const binary_string=globalThis.atob(base64),len=binary_string.length,bytes=new Uint8Array(len);for(let i2=0;i2{const blob=new Blob([buffer],{type:"application/octet-binary"}),reader=new FileReader;reader.onload=function(evt){var _a8,_b5;const dataURI=(null==(_b5=null==(_a8=evt.target)?void 0:_a8.result)?void 0:_b5.toString())||"";if(0!=buffer.byteLength&&(""==dataURI||"data:"==dataURI))return rej(new TypeError("Could not parse the encoded string"));const result=dataURI.substring(dataURI.indexOf(",")+1);res2(result)};reader.readAsDataURL(blob)})}function writeString(string){if(string.length>128)return te.encode(string);const buffer=new Uint8Array(4*string.length),length=string.length;let index6=0,chr=0,idx2=0;for(;idx2>>6;buffer[index6++]=128|63&chr}else if(chr<55296||chr>57343){buffer[index6++]=224|chr>>>12;buffer[index6++]=128|chr>>>6&63;buffer[index6++]=128|63&chr}else{chr=65536+(chr-55296<<10|string.charCodeAt(idx2++)-56320);buffer[index6++]=240|chr>>>18;buffer[index6++]=128|chr>>>12&63;buffer[index6++]=128|chr>>>6&63;buffer[index6++]=128|63&chr}}return buffer.slice(0,index6)}function readString(buffer){const length=buffer.length;if(length>128)return td.decode(buffer);let index6=0;const end=length;let string="";for(;index6>>10)+55296,56320+(1023&code))}}}string+=String.fromCharCode(...chunk)}return string}function*arrayToChunkedArray(arr,chunkLength){const source2=[...arr];for(;source2.length;){const s2=source2.splice(0,chunkLength);yield s2}}function unique(arr){return[...new Set(arr)]}function createTypedArrayReader(buffer){let offset=0;return{read(length){const result=buffer.slice(offset,offset+length);offset+=length;return result},readAll(){const result=buffer.slice(offset);offset=buffer.length;return result}}}function concatUInt8Array(arrays){const totalLength=arrays.reduce((sum2,arr)=>sum2+arr.length,0),result=new Uint8Array(totalLength);let offset=0;for(const array of arrays){result.set(array,offset);offset+=array.length}return result}function decodeToArrayBuffer(src){if(1==src.length)return _decodeToArrayBuffer(src[0]);const bufItems=src.map(e3=>_decodeToArrayBuffer(e3)),len=bufItems.reduce((p2,c3)=>p2+c3.byteLength,0),joinedArray=new Uint8Array(len);let offset=0;bufItems.forEach(e3=>{joinedArray.set(new Uint8Array(e3),offset);offset+=e3.byteLength});return joinedArray.buffer}function _decodeToArrayBuffer(src){const out=new Uint8Array(src.length),len=src.length;for(let i2=0;i2=38&&char<=126&&58!=char?char:revTable[char]}return out.buffer}function concatUInt8Array2(arrays){const length=arrays.reduce((acc,cur)=>acc+cur.length,0),result=new Uint8Array(length);let pos=0;for(const array of arrays){result.set(array,pos);pos+=array.length}return result}function decodeBinary(src){if(0==src.length)return(new Uint8Array).buffer;if("string"==typeof src){if("%"===src[0])return _decodeToArrayBuffer(src.substring(1))}else if("%"===src[0][0]){const[head2,...last]=src;return decodeToArrayBuffer([head2.substring(1),...last])}return base64ToArrayBuffer(src)}function replaceAll(str,search,replace){return"replaceAll"in String.prototype?str.replaceAll(search,replace):str.split(search).join(replace)}function replaceAllPairs(str,...fromTo){let r4=`${str}`;for(const[from,to]of fromTo)r4=replaceAll(r4,from,to);return r4}function escapeStringToHTML(str){return str?str.replace(/[<>&"'`]/g,match3=>({"<":"<",">":">","&":"&",'"':""","'":"'","`":"`"}[match3])):""}async function arrayBufferToBase64Single2(buffer){try{return await arrayBufferToBase64Single(buffer)}catch(ex){const maybeBuffer=null==globalThis?void 0:globalThis.Buffer;if("function"==typeof(null==maybeBuffer?void 0:maybeBuffer.from)){const view=buffer instanceof Uint8Array?buffer:new Uint8Array(buffer);return maybeBuffer.from(view.buffer,view.byteOffset,view.byteLength).toString("base64")}throw ex}}function versionNumberString2Number(version2){return version2.split(".").reverse().map((e3,i2)=>e3/1*1e3**i2).reduce((prev,current)=>prev+current,0)}function isValidFilenameInWidows(filename){return!/[\u0000-\u001f]|[\\":?<>|*#]/g.test(filename)&&!/(\\|\/)(COM\d|LPT\d|CON|PRN|AUX|NUL|CLOCK$)($|\.)/gi.test(filename)}function isValidFilenameInDarwin(filename){return!/[\u0000-\u001f]|[:]/g.test(filename)}function isValidFilenameInLinux(filename){return!/[\u0000-\u001f]|[:]/g.test(filename)}function isValidFilenameInAndroid(filename){return!/[\u0000-\u001f]|[\\":?<>|*#]/g.test(filename)}function isFilePath(path2){return-1===path2.indexOf(":")}function stripAllPrefixes(prefixedPath){if(isFilePath(prefixedPath))return prefixedPath;const[,body]=expandFilePathPrefix(prefixedPath);return stripAllPrefixes(body)}function addPrefix(path2,prefix){return prefix&&path2.startsWith(prefix)?path2:`${null!=prefix?prefix:""}${path2}`}function expandFilePathPrefix(path2){let[prefix,body]=path2.split(":",2);if(body)prefix+=":";else{body=prefix;prefix=""}return[prefix,body]}function expandDocumentIDPrefix(id){let[prefix,body]=id.split(":",2);if(body)prefix+=":";else{body=prefix;prefix=""}return[prefix,body]}function hashString(key3){return _hashString(key3)}async function path2id_base(filenameSrc,obfuscatePassphrase,caseInsensitive){if(filenameSrc.startsWith(PREFIX_OBFUSCATED))return`${filenameSrc}`;let filename=`${filenameSrc}`;const newPrefix=obfuscatePassphrase?PREFIX_OBFUSCATED:"";caseInsensitive&&(filename=filename.toLowerCase());let x2=filename;x2.startsWith("_")&&(x2="/"+x2);if(!obfuscatePassphrase)return newPrefix+x2;const[prefix,body]=expandFilePathPrefix(x2);if(body.startsWith(PREFIX_OBFUSCATED))return newPrefix+x2;const hashedPassphrase=await hashString(obfuscatePassphrase);return prefix+newPrefix+await hashString(`${hashedPassphrase}:${filename}`)}function id2path_base(id,entry){if(entry&&(null==entry?void 0:entry.path))return id2path_base(entry.path);if(id.startsWith(PREFIX_OBFUSCATED))throw new Error("Entry has been obfuscated!");const[prefix,body]=expandDocumentIDPrefix(id);if(body.startsWith(PREFIX_OBFUSCATED))throw new Error("Entry has been obfuscated!");return body.startsWith("/")?body.substring(1):prefix+body}function getPath(entry){return id2path_base(entry._id,entry)}function stripPrefix(prefixedPath){const[prefix,body]=prefixedPath.split(":",2);return body||prefix}function shouldBeIgnored(filename){return filename==FLAGMD_REDFLAG||filename==FLAGMD_REDFLAG2||filename==FLAGMD_REDFLAG2_HR||filename==FLAGMD_REDFLAG3||filename==FLAGMD_REDFLAG3_HR||!!filename.startsWith(PREFIXMD_LOGFILE)||!!filename.startsWith(PREFIXMD_LOGFILE_UC)}function isPlainText(filename){return!!(filename.endsWith(".md")||filename.endsWith(".txt")||filename.endsWith(".svg")||filename.endsWith(".html")||filename.endsWith(".csv")||filename.endsWith(".css")||filename.endsWith(".js")||filename.endsWith(".xml")||filename.endsWith(".canvas"))}function shouldSplitAsPlainText(filename){return!!filename.endsWith(".md")||!!filename.endsWith(".txt")||!!filename.endsWith(".canvas")}function isAccepted(path2,ignore){if(-1!==path2.indexOf("./")||-1!==path2.indexOf("../"))return!1;const patterns=ignore.map(e3=>e3.trim()).filter(e3=>e3.length>0&&!e3.startsWith("#"));let result;for(const pattern of patterns){if(pattern.endsWith("/")&&minimatch(path2,`${pattern}**`,matchOpts))return!1;const newResult=pattern.startsWith("!");(minimatch(path2,pattern,matchOpts)||!pattern.endsWith("/")&&minimatch(path2,pattern+"/**",matchOpts))&&(result=newResult)}return result}async function isAcceptedAll(path2,ignoreFiles,getList){const intermediatePaths=unique(path2.substring(0,path2.lastIndexOf("/")).split("/").reduce((p2,c3)=>[...p2,p2[p2.length-1]+"/"+c3],[""]).map(e3=>e3.substring(1))).reverse();for(const intermediatePath of intermediatePaths)for(const ignoreFile of ignoreFiles){const ignoreFilePath=intermediatePath+"/"+ignoreFile,list=await getList(ignoreFilePath);if(!1===list)continue;const result=isAccepted(path2.substring(intermediatePath.length?intermediatePath.length+1:0),list);if(void 0!==result)return result}return!0}function Semaphore(limit){let counter=0;const _limit=limit,queue2=[];return{get waiting(){return queue2.length},async tryAcquire(quantity=1,timeout){if(counter<_limit){counter+=quantity;return()=>{this.release(quantity)}}const d4=cancelableDelay(timeout,TIMED_OUT_SIGNAL),aq2=this.acquire(quantity),p2=await Promise.race([d4.promise,aq2]);if(p2===TIMED_OUT_SIGNAL){fireAndForget(()=>aq2.then(release=>release()));return!1}return p2},async acquire(quantity=1){if(counter<_limit){counter+=quantity;return()=>this.release()}const n3=promiseWithResolvers();queue2.push(n3);await n3.promise;return()=>{this.release(quantity)}},release(quantity=1){if(queue2.length>0){const next2=queue2.shift();next2&&fireAndForget(async()=>await yieldMicrotask().then(()=>next2.resolve()))}else counter>0&&(counter-=quantity)}}}function isCloudantURI(uri){return-1!==uri.indexOf(".cloudantnosqldb.")||-1!==uri.indexOf(".cloudant.com")}function isErrorOfMissingDoc(ex){return 404==(ex&&(null==ex?void 0:ex.status))}function sizeToHumanReadable(size){const units=["B","KB","MB","GB","TB"];let i2=0;for(;size>=1024&&i2{p2.then(res2).catch(ex=>isErrorOfMissingDoc(ex)?res2(def):rej(ex))})}function getDocData(doc){return"string"==typeof doc?doc:doc.join("")}function getDocDataAsArray(doc){return"string"==typeof doc?[doc]:doc}function isTextBlob(blob){return"text/plain"===blob.type}function createTextBlob(data){const d4=Array.isArray(data)?data:[data];return new Blob(d4,{endings:"transparent",type:"text/plain"})}function createBinaryBlob(data){return new Blob([data],{endings:"transparent",type:"application/octet-stream"})}function createBlob(data){return data instanceof Blob?data:data instanceof Uint8Array||data instanceof ArrayBuffer?createBinaryBlob(data):createTextBlob(data)}function isTextDocument(doc){return"plain"==doc.type||"plain"==doc.datatype||!!isPlainText(doc.path)}function readAsBlob(doc){return isTextDocument(doc)?createTextBlob(doc.data):createBinaryBlob(decodeBinary(doc.data))}function readContent(doc){return isTextDocument(doc)?getDocData(doc.data):decodeBinary(doc.data)}async function isDocContentSame(docA,docB){const blob1=createBlob(docA),blob2=createBlob(docB);if(blob1.size!=blob2.size)return!1;if(isIndexDBCmpExist)return 0===globalThis.indexedDB.cmp(await blob1.arrayBuffer(),await blob2.arrayBuffer());const length=blob1.size;let i2=0;for(;i2set2.add(e3));return set2}function escapeNewLineFromString(str){return-1===str.indexOf("\n")&&-1===str.indexOf("\r")?str:"\\f"+str.replace(/(\n|\r|\\)/g,m3=>`${map[m3]}`)}function unescapeNewLineFromString(str){return str.startsWith("\\f")?str.substring(2).replace(/(\\n|\\r|\\\\)/g,m3=>`${revMap2[m3]}`):str}function escapeMarkdownValue(value){return"string"==typeof value?replaceAllPairs(value,["|","\\|"],["`","\\`"]):value}function timeDeltaToHumanReadable(delta){const sec=delta/1e3;if(sec<60)return`${sec.toFixed(2)}s`;const min=sec/60;if(min<60)return`${min.toFixed(2)}m`;const hour=min/60;if(hour<24)return`${hour.toFixed(2)}h`;const day=hour/24;return day<365?`${day.toFixed(2)}d`:`${(day/365).toFixed(2)}y`}async function wrapException(func){try{return await func()}catch(ex){return ex instanceof Error?ex:new Error(ex)}}function isDirty(key3,value){if(previousValues.get(key3)===value)return!1;previousValues.set(key3,value);return!0}function isSensibleMargeApplicable(path2){return!!path2.endsWith(".md")}function isObjectMargeApplicable(path2){return!!path2.endsWith(".canvas")||!!path2.endsWith(".json")}function tryParseJSON(str,fallbackValue){try{return JSON.parse(str)}catch(e3){return fallbackValue}}function unorderedArrayToObject(obj){return obj.map(e3=>({[e3.id]:e3})).reduce((p2,c3)=>({...p2,...c3}),{})}function objectToUnorderedArray(obj){const entries2=Object.entries(obj);if(entries2.some(e3=>{var _a8;return e3[0]!=(null==(_a8=e3[1])?void 0:_a8.id)}))throw new Error("Item looks like not unordered array");return entries2.map(e3=>e3[1])}function generatePatchUnorderedArray(from,to){if(from.every(e3=>"object"==typeof e3&&"id"in e3)&&to.every(e3=>"object"==typeof e3&&"id"in e3)){const diff=generatePatchObj(unorderedArrayToObject(from),unorderedArrayToObject(to));return Object.keys(diff).length>0?{[MARK_ISARRAY]:diff}:{}}return{[MARK_SWAPPED]:to}}function generatePatchObj(from,to){const entries2=Object.entries(from),tempMap=new Map(entries2),ret={},newEntries=Object.entries(to);for(const[key3,value]of newEntries)if(tempMap.has(key3)){const v2=tempMap.get(key3);if(typeof v2!=typeof value||Array.isArray(v2)!==Array.isArray(value))ret[key3]={[MARK_SWAPPED]:value};else if(null===v2&&null===value);else if(null===v2&&null!==value)ret[key3]={[MARK_SWAPPED]:value};else if(null!==v2&&null===value)ret[key3]={[MARK_SWAPPED]:value};else if("object"!=typeof v2||"object"!=typeof value||Array.isArray(v2)||Array.isArray(value))if("object"==typeof v2&&"object"==typeof value&&Array.isArray(v2)&&Array.isArray(value)){const wk2=generatePatchUnorderedArray(v2,value);Object.keys(wk2).length>0&&(ret[key3]=wk2)}else"object"!=typeof v2&&"object"!=typeof value?JSON.stringify(tempMap.get(key3))!==JSON.stringify(value)&&(ret[key3]=value):JSON.stringify(tempMap.get(key3))!==JSON.stringify(value)&&(ret[key3]={[MARK_SWAPPED]:value});else{const wk2=generatePatchObj(v2,value);Object.keys(wk2).length>0&&(ret[key3]=wk2)}tempMap.delete(key3)}else{ret[key3]=value;tempMap.delete(key3)}for(const[key3]of tempMap)ret[key3]=MARK_DELETED;return ret}function applyPatch(from,patch){const ret=from,patches=Object.entries(patch);for(const[key3,value]of patches)if(value!=MARK_DELETED)if(null!==value)if("object"==typeof value){if(MARK_SWAPPED in value){ret[key3]=value[MARK_SWAPPED];continue}if(MARK_ISARRAY in value){key3 in ret||(ret[key3]=[]);if(!Array.isArray(ret[key3]))throw new Error("Patch target type is mismatched (array to something)");const appliedArray=objectToUnorderedArray(applyPatch(unorderedArrayToObject(ret[key3]),value[MARK_ISARRAY]));ret[key3]=[...appliedArray]}else{if(!(key3 in ret)){ret[key3]=value;continue}ret[key3]=applyPatch(ret[key3],value)}}else ret[key3]=value;else ret[key3]=null;else delete ret[key3];return ret}function mergeObject(objA,objB){const newEntries=Object.entries(objB),ret={...objA};if(typeof objA!=typeof objB||Array.isArray(objA)!==Array.isArray(objB))return objB;for(const[key3,v2]of newEntries)if(key3 in ret){const value=ret[key3];typeof v2!=typeof value||Array.isArray(v2)!==Array.isArray(value)?ret[key3]=v2:"object"!=typeof v2||"object"!=typeof value||Array.isArray(v2)||Array.isArray(value)?"object"==typeof v2&&"object"==typeof value&&Array.isArray(v2)&&Array.isArray(value)?ret[key3]=[...new Set([...v2,...value])]:ret[key3]=v2:ret[key3]=mergeObject(v2,value)}else ret[key3]=v2;const retSorted=Object.fromEntries(Object.entries(ret).sort((a2,b3)=>a2[0]b3[0]?1:0));return Array.isArray(objA)&&Array.isArray(objB)?Object.values(retSorted):retSorted}function flattenObject(obj,path2=[]){if("object"!=typeof obj)return[[path2.join("."),obj]];if(null===obj)return[[path2.join("."),null]];if(Array.isArray(obj))return[[path2.join("."),JSON.stringify(obj)]];const e3=Object.entries(obj),ret=[];for(const[key3,value]of e3){const p2=flattenObject(value,[...path2,key3]);ret.push(...p2)}return ret}function parseHeaderValues(strHeader){const headers={},lines=strHeader.split("\n");for(const line of lines){const[key3,value]=line.split(":",2).map(e3=>e3.trim());key3&&value&&(headers[key3]=value)}return headers}function parseCustomRegExp(regexp){return regexp.startsWith("!!")?[!0,regexp.slice(2)]:[!1,regexp]}function isValidRegExp(regexp){try{const[,exp]=parseCustomRegExp(regexp);new RegExp(exp);return!0}catch(e3){return!1}}function isInvertedRegExp(regexp){const[negate3]=parseCustomRegExp(regexp);return negate3}function parseCustomRegExpList(list,flags2,delimiter){const d4=null!=delimiter?delimiter:",";return`${null!=list?list:""}`.replace(/\n| /g,"").split(d4).filter(e3=>e3).map(e3=>new CustomRegExp(e3,flags2))}function constructCustomRegExpList(items,delimiter){return items.map(e3=>`${e3}`).join(`${delimiter}`)}function splitCustomRegExpList(list,delimiter){const d4=delimiter;return`${null!=list?list:""}`.split(d4).filter(e3=>e3)}function getFileRegExp(settings,key3){const flagCase=settings.handleFilenameCaseSensitive?"":"i";return parseCustomRegExpList(settings[key3],flagCase,"syncInternalFilesIgnorePatterns"===key3||"syncInternalFilesTargetPatterns"===key3||"syncInternalFileOverwritePatterns"===key3?",":"|[]|")}function copyTo(source2,target){for(const key3 of Object.keys(target))target[key3]=source2[key3]}function pickBucketSyncSettings(setting){return{bucket:setting.bucket,region:setting.region,endpoint:setting.endpoint,accessKey:setting.accessKey,secretKey:setting.secretKey,bucketPrefix:setting.bucketPrefix,forcePathStyle:setting.forcePathStyle,useCustomRequestHandler:setting.useCustomRequestHandler,bucketCustomHeaders:setting.bucketCustomHeaders}}function pickCouchDBSyncSettings(setting){return{couchDB_URI:setting.couchDB_URI,couchDB_USER:setting.couchDB_USER,couchDB_PASSWORD:setting.couchDB_PASSWORD,couchDB_DBNAME:setting.couchDB_DBNAME,useRequestAPI:setting.useRequestAPI,couchDB_CustomHeaders:setting.couchDB_CustomHeaders,jwtAlgorithm:setting.jwtAlgorithm,jwtExpDuration:setting.jwtExpDuration,jwtKey:setting.jwtKey,jwtKid:setting.jwtKid,jwtSub:setting.jwtSub,useJWT:setting.useJWT}}function pickEncryptionSettings(setting){return{E2EEAlgorithm:setting.E2EEAlgorithm,encrypt:setting.encrypt,passphrase:setting.passphrase,usePathObfuscation:setting.usePathObfuscation}}function pickP2PSyncSettings(setting){return{P2P_Enabled:setting.P2P_Enabled,P2P_AppID:setting.P2P_AppID,P2P_roomID:setting.P2P_roomID,P2P_passphrase:setting.P2P_passphrase,P2P_relays:setting.P2P_relays,P2P_AutoStart:setting.P2P_AutoStart,P2P_AutoBroadcast:setting.P2P_AutoBroadcast,P2P_DevicePeerName:setting.P2P_DevicePeerName||"",P2P_turnServers:setting.P2P_turnServers,P2P_turnUsername:setting.P2P_turnUsername,P2P_turnCredential:setting.P2P_turnCredential}}function compareMTime(baseMTime,targetMTime){const truncatedBaseMTime=~~(baseMTime/resolution)*resolution,truncatedTargetMTime=~~(targetMTime/resolution)*resolution;if(truncatedBaseMTime==truncatedTargetMTime)return EVEN;if(truncatedBaseMTime>truncatedTargetMTime)return BASE_IS_NEW;if(truncatedBaseMTime{const isError=msg instanceof Error;if(isError&&level<=LOG_LEVEL_VERBOSE){logFunc(msg,level,key3);return}let formattedMsg="string"==typeof msg?msg:isError?msg.message:JSON.stringify(msg);level{resolve=res2;reject=rej}),resolve,reject}}function to_array(value,n3){if(Array.isArray(value))return value;if(void 0===n3||!(Symbol.iterator in value))return Array.from(value);const array=[];for(const element2 of value){array.push(element2);if(array.length===n3)break}return array}function lifecycle_outside_component(name){if(dev_fallback_default){const error=new Error(`lifecycle_outside_component\n\`${name}(...)\` can only be used during component initialisation\nhttps://svelte.dev/e/lifecycle_outside_component`);error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function async_derived_orphan(){if(dev_fallback_default){const error=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/async_derived_orphan")}function bind_invalid_checkbox_value(){if(dev_fallback_default){const error=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function derived_references_self(){if(dev_fallback_default){const error=new Error("derived_references_self\nA derived value cannot reference itself recursively\nhttps://svelte.dev/e/derived_references_self");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/derived_references_self")}function effect_in_teardown(rune){if(dev_fallback_default){const error=new Error(`effect_in_teardown\n\`${rune}\` cannot be used inside an effect cleanup function\nhttps://svelte.dev/e/effect_in_teardown`);error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/effect_in_teardown")}function effect_in_unowned_derived(){if(dev_fallback_default){const error=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function effect_orphan(rune){if(dev_fallback_default){const error=new Error(`effect_orphan\n\`${rune}\` can only be used inside an effect (e.g. during component initialisation)\nhttps://svelte.dev/e/effect_orphan`);error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/effect_orphan")}function effect_update_depth_exceeded(){if(dev_fallback_default){const error=new Error("effect_update_depth_exceeded\nMaximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\nhttps://svelte.dev/e/effect_update_depth_exceeded");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function flush_sync_in_effect(){if(dev_fallback_default){const error=new Error("flush_sync_in_effect\nCannot use `flushSync` inside an effect\nhttps://svelte.dev/e/flush_sync_in_effect");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/flush_sync_in_effect")}function invalid_snippet(){if(dev_fallback_default){const error=new Error("invalid_snippet\nCould not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\nhttps://svelte.dev/e/invalid_snippet");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/invalid_snippet")}function props_invalid_value(key3){if(dev_fallback_default){const error=new Error(`props_invalid_value\nCannot do \`bind:${key3}={undefined}\` when \`${key3}\` has a fallback value\nhttps://svelte.dev/e/props_invalid_value`);error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/props_invalid_value")}function rune_outside_svelte(rune){if(dev_fallback_default){const error=new Error(`rune_outside_svelte\nThe \`${rune}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files\nhttps://svelte.dev/e/rune_outside_svelte`);error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/rune_outside_svelte")}function set_context_after_init(){if(dev_fallback_default){const error=new Error("set_context_after_init\n`setContext` must be called when a component first initializes, not in a subsequent effect or after an `await` expression\nhttps://svelte.dev/e/set_context_after_init");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/set_context_after_init")}function state_descriptors_fixed(){if(dev_fallback_default){const error=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function state_prototype_fixed(){if(dev_fallback_default){const error=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/state_prototype_fixed")}function state_unsafe_mutation(){if(dev_fallback_default){const error=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function svelte_boundary_reset_onerror(){if(dev_fallback_default){const error=new Error("svelte_boundary_reset_onerror\nA `` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");error.name="Svelte error";throw error}throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function await_reactivity_loss(name){dev_fallback_default?console.warn(`%c[svelte] await_reactivity_loss\n%cDetected reactivity loss when reading \`${name}\`. This happens when state is read in an async function after an earlier \`await\`\nhttps://svelte.dev/e/await_reactivity_loss`,bold,normal):console.warn("https://svelte.dev/e/await_reactivity_loss")}function await_waterfall(name,location){dev_fallback_default?console.warn(`%c[svelte] await_waterfall\n%cAn async derived, \`${name}\` (${location}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app\nhttps://svelte.dev/e/await_waterfall`,bold,normal):console.warn("https://svelte.dev/e/await_waterfall")}function hydration_attribute_changed(attribute,html2,value){dev_fallback_default?console.warn(`%c[svelte] hydration_attribute_changed\n%cThe \`${attribute}\` attribute on \`${html2}\` changed its value between server and client renders. The client value, \`${value}\`, will be ignored in favour of the server value\nhttps://svelte.dev/e/hydration_attribute_changed`,bold,normal):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function hydration_mismatch(location){dev_fallback_default?console.warn(`%c[svelte] hydration_mismatch\n%c${location?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}`:"Hydration failed because the initial UI does not match what was rendered on the server"}\nhttps://svelte.dev/e/hydration_mismatch`,bold,normal):console.warn("https://svelte.dev/e/hydration_mismatch")}function lifecycle_double_unmount(){dev_fallback_default?console.warn("%c[svelte] lifecycle_double_unmount\n%cTried to unmount a component that was not mounted\nhttps://svelte.dev/e/lifecycle_double_unmount",bold,normal):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function select_multiple_invalid_value(){dev_fallback_default?console.warn("%c[svelte] select_multiple_invalid_value\n%cThe `value` property of a `
');$$css={hash:"svelte-o3lsbg",code:".svelte-o3lsbg {box-sizing:border-box;}.logpane.svelte-o3lsbg {display:flex;height:100%;flex-direction:column;}.log.svelte-o3lsbg {overflow-y:scroll;user-select:text;-webkit-user-select:text;padding-bottom:2em;}.log.svelte-o3lsbg > pre:where(.svelte-o3lsbg) {margin:0;}.log.svelte-o3lsbg > pre.wrap-right:where(.svelte-o3lsbg) {word-break:break-all;max-width:100%;width:100%;white-space:normal;}.row.svelte-o3lsbg {display:flex;flex-direction:row;justify-content:flex-end;}.row.svelte-o3lsbg > label:where(.svelte-o3lsbg) {display:flex;align-items:center;min-width:5em;margin-right:1em;}"};delegate(["click"]);SvelteItemView=class extends import_obsidian.ItemView{async onOpen(){await super.onOpen();this.contentEl.empty();await this._dismountComponent();this.component=await this.instantiateComponent(this.contentEl)}async _dismountComponent(){if(this.component){await unmount(this.component);this.component=void 0}}async onClose(){await super.onClose();if(this.component){await unmount(this.component);this.component=void 0}}};LogPaneView=class extends SvelteItemView{constructor(leaf,plugin3){super(leaf);this.icon="view-log";this.title="";this.navigation=!1;this.plugin=plugin3}instantiateComponent(target){return mount(LogPane,{target,props:{close:()=>{this.leaf.detach()}}})}getIcon(){return"view-log"}getViewType(){return"log-log"}getDisplayText(){return $msg("logPane.title")}};secp256k1_CURVE={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt("1"),a:BigInt("0"),b:BigInt("7"),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")};var{p:P,n:N,Gx,Gy,b:_b3}=secp256k1_CURVE;lengths={publicKey:1+(L=32),publicKeyUncompressed:65,signature:64,seed:48};captureTrace=(...args)=>{"captureStackTrace"in Error&&"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(...args)};err=(message="")=>{const e3=new Error(message);captureTrace(e3,err);throw e3};isBig=n3=>"bigint"==typeof n3;isStr=s2=>"string"==typeof s2;isBytes=a2=>a2 instanceof Uint8Array||ArrayBuffer.isView(a2)&&"Uint8Array"===a2.constructor.name;abytes=(value,length,title="")=>{const bytes=isBytes(value),len=null==value?void 0:value.length,needsLen=void 0!==length;(!bytes||needsLen&&len!==length)&&err((title&&`"${title}" `)+"expected Uint8Array"+(needsLen?` of length ${length}`:"")+", got "+(bytes?`length=${len}`:"type="+typeof value));return value};u8n=len=>new Uint8Array(len);padh=(n3,pad2)=>n3.toString(16).padStart(pad2,"0");bytesToHex=b3=>Array.from(abytes(b3)).map(e3=>padh(e3,2)).join("");_ch=ch4=>ch4>=48&&ch4<=57?ch4-48:ch4>=65&&ch4<=70?ch4-55:ch4>=97&&ch4<=102?ch4-87:void 0;hexToBytes=hex=>{const e3="hex invalid";if(!isStr(hex))return err(e3);const hl=hex.length,al2=hl/2;if(hl%2)return err(e3);const array=u8n(al2);for(let ai2=0,hi=0;ai2null==globalThis?void 0:globalThis.crypto;subtle=()=>{var _a8,_b5;return null!=(_b5=null==(_a8=cr())?void 0:_a8.subtle)?_b5:err("crypto.subtle must be defined, consider polyfill")};concatBytes=(...arrs)=>{const r4=u8n(arrs.reduce((sum2,a2)=>sum2+abytes(a2).length,0));let pad2=0;arrs.forEach(a2=>{r4.set(a2,pad2);pad2+=a2.length});return r4};randomBytes=(len=L)=>cr().getRandomValues(u8n(len));big=BigInt;arange=(n3,min,max3,msg="bad number: out of range")=>isBig(n3)&&min<=n3&&n3{const r4=a2%b3;return r4>=BigInt("0")?r4:b3+r4};modN=a2=>M(a2,N);invert=(num,md)=>{(num===BigInt("0")||md<=BigInt("0"))&&err("no inverse n="+num+" mod="+md);let a2=M(num,md),b3=md,x2=BigInt("0"),y2=BigInt("1"),u2=BigInt("1"),v2=BigInt("0");for(;a2!==BigInt("0");){const q2=b3/a2,r4=b3%a2,m3=x2-u2*q2,n3=y2-v2*q2;b3=a2,a2=r4,x2=u2,y2=v2,u2=m3,v2=n3}return b3===BigInt("1")?M(x2,md):err("no inverse")};callHash=name=>{const fn=hashes[name];"function"!=typeof fn&&err("hashes."+name+" not set");return fn};apoint=p2=>p2 instanceof Point?p2:err("Point expected");koblitz=x2=>M(M(x2*x2)*x2+_b3);FpIsValid=n3=>arange(n3,BigInt("0"),P);FpIsValidNot0=n3=>arange(n3,BigInt("1"),P);FnIsValidNot0=n3=>arange(n3,BigInt("1"),N);isEven=y2=>(y2&BigInt("1"))===BigInt("0");u8of=n3=>Uint8Array.of(n3);getPrefix=y2=>u8of(isEven(y2)?2:3);lift_x=x2=>{const c3=koblitz(FpIsValidNot0(x2));let r4=BigInt("1");for(let num=c3,e3=(P+BigInt("1"))/BigInt("4");e3>BigInt("0");e3>>=BigInt("1")){e3&BigInt("1")&&(r4=r4*num%P);num=num*num%P}return M(r4*r4)===c3?r4:err("sqrt invalid")};_Point=class _Point{constructor(X2,Y2,Z2){__publicField(this,"X");__publicField(this,"Y");__publicField(this,"Z");this.X=FpIsValid(X2);this.Y=FpIsValidNot0(Y2);this.Z=FpIsValid(Z2);Object.freeze(this)}static CURVE(){return secp256k1_CURVE}static fromAffine(ap2){const{x:x2,y:y2}=ap2;return x2===BigInt("0")&&y2===BigInt("0")?I:new _Point(x2,y2,BigInt("1"))}static fromBytes(bytes){abytes(bytes);const{publicKey:comp,publicKeyUncompressed:uncomp}=lengths;let p2;const length=bytes.length,head2=bytes[0],tail=bytes.subarray(1),x2=sliceBytesNumBE(tail,0,L);if(length===comp&&(2===head2||3===head2)){let y2=lift_x(x2);const evenY=isEven(y2);isEven(big(head2))!==evenY&&(y2=M(-y2));p2=new _Point(x2,y2,BigInt("1"))}length===uncomp&&4===head2&&(p2=new _Point(x2,sliceBytesNumBE(tail,L,64),BigInt("1")));return p2?p2.assertValidity():err("bad point: not on curve")}static fromHex(hex){return _Point.fromBytes(hexToBytes(hex))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}equals(other){const{X:X1,Y:Y1,Z:Z1}=this,{X:X2,Y:Y2,Z:Z2}=apoint(other),X1Z2=M(X1*Z2),X2Z1=M(X2*Z1),Y1Z2=M(Y1*Z2),Y2Z1=M(Y2*Z1);return X1Z2===X2Z1&&Y1Z2===Y2Z1}is0(){return this.equals(I)}negate(){return new _Point(this.X,M(-this.Y),this.Z)}double(){return this.add(this)}add(other){const{X:X1,Y:Y1,Z:Z1}=this,{X:X2,Y:Y2,Z:Z2}=apoint(other),a2=BigInt("0"),b3=_b3;let X3=BigInt("0"),Y3=BigInt("0"),Z3=BigInt("0");const b32=M(b3*BigInt("3"));let t02=M(X1*X2),t12=M(Y1*Y2),t22=M(Z1*Z2),t32=M(X1+Y1),t42=M(X2+Y2);t32=M(t32*t42);t42=M(t02+t12);t32=M(t32-t42);t42=M(X1+Z1);let t52=M(X2+Z2);t42=M(t42*t52);t52=M(t02+t22);t42=M(t42-t52);t52=M(Y1+Z1);X3=M(Y2+Z2);t52=M(t52*X3);X3=M(t12+t22);t52=M(t52-X3);Z3=M(a2*t42);X3=M(b32*t22);Z3=M(X3+Z3);X3=M(t12-Z3);Z3=M(t12+Z3);Y3=M(X3*Z3);t12=M(t02+t02);t12=M(t12+t02);t22=M(a2*t22);t42=M(b32*t42);t12=M(t12+t22);t22=M(t02-t22);t22=M(a2*t22);t42=M(t42+t22);t02=M(t12*t42);Y3=M(Y3+t02);t02=M(t52*t42);X3=M(t32*X3);X3=M(X3-t02);t02=M(t32*t12);Z3=M(t52*Z3);Z3=M(Z3+t02);return new _Point(X3,Y3,Z3)}subtract(other){return this.add(apoint(other).negate())}multiply(n3,safe=!0){if(!safe&&n3===BigInt("0"))return I;FnIsValidNot0(n3);if(n3===BigInt("1"))return this;if(this.equals(G))return wNAF(n3).p;let p2=I,f4=G;for(let d4=this;n3>BigInt("0");d4=d4.double(),n3>>=BigInt("1"))n3&BigInt("1")?p2=p2.add(d4):safe&&(f4=f4.add(d4));return p2}multiplyUnsafe(scalar){return this.multiply(scalar,!1)}toAffine(){const{X:x2,Y:y2,Z:z2}=this;if(this.equals(I))return{x:BigInt("0"),y:BigInt("0")};if(z2===BigInt("1"))return{x:x2,y:y2};const iz=invert(z2,P);M(z2*iz)!==BigInt("1")&&err("inverse invalid");return{x:M(x2*iz),y:M(y2*iz)}}assertValidity(){const{x:x2,y:y2}=this.toAffine();FpIsValidNot0(x2);FpIsValidNot0(y2);return M(y2*y2)===koblitz(x2)?this:err("bad point: not on curve")}toBytes(isCompressed=!0){const{x:x2,y:y2}=this.assertValidity().toAffine(),x32b=numTo32b(x2);return isCompressed?concatBytes(getPrefix(y2),x32b):concatBytes(u8of(4),x32b,numTo32b(y2))}toHex(isCompressed){return bytesToHex(this.toBytes(isCompressed))}};__publicField(_Point,"BASE");__publicField(_Point,"ZERO");G=new(Point=_Point)(Gx,Gy,BigInt("1"));I=new Point(BigInt("0"),BigInt("1"),BigInt("0"));Point.BASE=G;Point.ZERO=I;doubleScalarMulUns=(R2,u1,u2)=>G.multiply(u1,!1).add(R2.multiply(u2,!1)).assertValidity();bytesToNumBE=b3=>big("0x"+(bytesToHex(b3)||"0"));sliceBytesNumBE=(b3,from,to)=>bytesToNumBE(b3.subarray(from,to));B256=BigInt("2")**BigInt("256");numTo32b=num=>hexToBytes(padh(arange(num,BigInt("0"),B256),64));secretKeyToScalar=secretKey2=>{const num=bytesToNumBE(abytes(secretKey2,L,"secret key"));return arange(num,BigInt("1"),N,"invalid secret key: outside of range")};0;getPublicKey=(privKey,isCompressed=!0)=>G.multiply(secretKeyToScalar(privKey)).toBytes(isCompressed);0;assertSigFormat=format2=>{null==format2||ALL_SIG.includes(format2)||err(`Signature format must be one of: ${ALL_SIG.join(", ")}`);format2===SIG_DER&&err('Signature format "der" is not supported: switch to noble-curves')};0;0;ALL_SIG=[SIG_COMPACT="compact",SIG_RECOVERED="recovered",SIG_DER="der"];hashes={hmacSha256Async:async(key3,message)=>{const s2=subtle(),k2=await s2.importKey("raw",key3,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return u8n(await s2.sign("HMAC",k2,message))},hmacSha256:void 0,sha256Async:async msg=>u8n(await subtle().digest("SHA-256",msg)),sha256:void 0};u8n(0);u8of(0);u8of(1);randomSecretKey=(seed=randomBytes(lengths.seed))=>{abytes(seed);(seed.length1024)&&err("expected 40-1024b");const num=M(bytesToNumBE(seed),N-BigInt("1"));return numTo32b(num+BigInt("1"))};(createKeygen=getPublicKey2=>seed=>{const secretKey2=randomSecretKey(seed);return{secretKey:secretKey2,publicKey:getPublicKey2(secretKey2)}})(getPublicKey);getTag=tag3=>Uint8Array.from("BIP0340/"+tag3,c3=>c3.charCodeAt(0));taggedHash=(tag3,...messages)=>{const fn=callHash("sha256"),tagH=fn(getTag(tag3));return fn(concatBytes(tagH,tagH,...messages))};taggedHashAsync=async(tag3,...messages)=>{const fn=hashes.sha256Async,tagH=await fn(getTag(tag3));return await fn(concatBytes(tagH,tagH,...messages))};extpubSchnorr=priv=>{const d_=secretKeyToScalar(priv),p2=G.multiply(d_),{x:x2,y:y2}=p2.assertValidity().toAffine();return{d:isEven(y2)?d_:modN(-d_),px:numTo32b(x2)}};bytesModN=bytes=>modN(bytesToNumBE(bytes));challenge=(...args)=>bytesModN(taggedHash("challenge",...args));challengeAsync=async(...args)=>bytesModN(await taggedHashAsync("challenge",...args));keygenSchnorr=createKeygen(pubSchnorr=secretKey2=>extpubSchnorr(secretKey2).px);prepSigSchnorr=(message,secretKey2,auxRand)=>{const{px,d:d4}=extpubSchnorr(secretKey2);return{m:abytes(message),px,d:d4,a:abytes(auxRand,L)}};extractK=rand=>{const k_=bytesModN(rand);k_===BigInt("0")&&err("sign failed: k is zero");const{px,d:d4}=extpubSchnorr(numTo32b(k_));return{rx:px,k:d4}};createSigSchnorr=(k2,px,e3,d4)=>concatBytes(px,numTo32b(modN(k2+e3*d4)));E_INVSIG="invalid signature produced";callSyncAsyncFn=(res2,later)=>res2 instanceof Promise?res2.then(later):later(res2);_verifSchnorr=(signature,message,publicKey2,challengeFn)=>{const sig=abytes(signature,64,"signature"),msg=abytes(message,void 0,"message"),pub=abytes(publicKey2,L,"publicKey");try{const x2=bytesToNumBE(pub),y2=lift_x(x2),y_=isEven(y2)?y2:M(-y2),P_=new Point(x2,y_,BigInt("1")).assertValidity(),px=numTo32b(P_.toAffine().x),r4=sliceBytesNumBE(sig,0,L);arange(r4,BigInt("1"),P);const s2=sliceBytesNumBE(sig,L,64);arange(s2,BigInt("1"),N);const i2=concatBytes(numTo32b(r4),px,msg);return callSyncAsyncFn(challengeFn(i2),e3=>{const{x:x3,y:y3}=doubleScalarMulUns(P_,s2,modN(-e3)).toAffine();return!(!isEven(y3)||x3!==r4)})}catch(error){return!1}};schnorr={keygen:keygenSchnorr,getPublicKey:pubSchnorr,sign:(message,secretKey2,auxRand=randomBytes(L))=>{const{m:m3,px,d:d4,a:a2}=prepSigSchnorr(message,secretKey2,auxRand),aux=taggedHash("aux",a2),t9=numTo32b(d4^bytesToNumBE(aux)),rand=taggedHash("nonce",t9,px,m3),{rx,k:k2}=extractK(rand),e3=challenge(rx,px,m3),sig=createSigSchnorr(k2,rx,e3,d4);verifySchnorr(sig,m3,px)||err(E_INVSIG);return sig},verify:verifySchnorr=(s2,m3,p2)=>_verifSchnorr(s2,m3,p2,challenge),signAsync:async(message,secretKey2,auxRand=randomBytes(L))=>{const{m:m3,px,d:d4,a:a2}=prepSigSchnorr(message,secretKey2,auxRand),aux=await taggedHashAsync("aux",a2),t9=numTo32b(d4^bytesToNumBE(aux)),rand=await taggedHashAsync("nonce",t9,px,m3),{rx,k:k2}=extractK(rand),e3=await challengeAsync(rx,px,m3),sig=createSigSchnorr(k2,rx,e3,d4);await verifySchnorrAsync(sig,m3,px)||err(E_INVSIG);return sig},verifyAsync:verifySchnorrAsync=async(s2,m3,p2)=>_verifSchnorr(s2,m3,p2,challengeAsync)};pwindows=Math.ceil(32)+1;precompute=()=>{const points=[];let p2=G,b3=p2;for(let w2=0;w2{const n3=p2.negate();return cnd?n3:p2};wNAF=n3=>{const comp=Gpows||(Gpows=precompute());let p2=I,f4=G;const mask=big(255),shiftBy=big(8);for(let w2=0;w2>=shiftBy;if(wbits2>128){wbits2-=256;n3+=BigInt("1")}const off=128*w2,offF=off,offP=off+Math.abs(wbits2)-1,isEven2=w2%2!=0,isNeg=wbits2<0;0===wbits2?f4=f4.add(ctneg(isEven2,comp[offF])):p2=p2.add(ctneg(isNeg,comp[offP]))}n3!==BigInt("0")&&err("invalid wnaf");return{p:p2,f:f4}};var{floor,random,sin}=Math;libName="Trystero";alloc=(n3,f4)=>Array(n3).fill(void 0).map(f4);selfId=(genId=n3=>alloc(n3,()=>{var _a8;return null!=(_a8="0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"[floor(62*random())])?_a8:""}).join(""))(20);all=Promise.all.bind(Promise);isBrowser="undefined"!=typeof window;var{entries,fromEntries,keys,values}=Object;noOp=()=>{};resetTimer=timer=>{null!==timer&&clearTimeout(timer);return null};mkErr=msg=>new Error(`${libName}: ${msg}`);toErrorMessage=(reason,fallback3)=>reason instanceof Error&&reason.message?reason.message:"string"==typeof reason&&reason?reason:toJson(null!=reason?reason:fallback3);toError=(reason,fallback3)=>reason instanceof Error?reason:mkErr(toErrorMessage(reason,fallback3));encoder=new TextEncoder;decoder=new TextDecoder;encodeBytes=txt=>encoder.encode(txt);decodeBytes=buffer=>decoder.decode(buffer);toHex=buffer=>buffer.reduce((a2,c3)=>a2+c3.toString(16).padStart(2,"0"),"");topicPath=(...parts)=>parts.join("@");shuffle=(xs,seed)=>{const a2=[...xs],rand=()=>{const x2=1e4*sin(seed++);return x2-floor(x2)};let i2=a2.length;for(;i2;){const j2=floor(rand()*i2--),tmp=a2[i2];a2[i2]=a2[j2];a2[j2]=tmp}return a2};getRelays=(config,defaults2,defaultN,deriveFromAppId=!1)=>{var _a8;return config.relayUrls||(deriveFromAppId?shuffle(defaults2,strToNum(config.appId)):defaults2).slice(0,null!=(_a8=config.relayRedundancy)?_a8:defaultN)};toJson=JSON.stringify;fromJson=s2=>{try{return JSON.parse(s2)}catch(e3){throw mkErr(`failed to parse JSON: ${s2}`)}};strToNum=(str,limit=Number.MAX_SAFE_INTEGER)=>str.split("").reduce((a2,c3)=>a2+c3.charCodeAt(0),0)%limit;socketRetryPeriods={};reconnectionLockingPromise=null;resolver=null;pauseRelayReconnection=()=>{reconnectionLockingPromise||(reconnectionLockingPromise=new Promise(resolve=>{resolver=resolve}).finally(()=>{resolver=null;reconnectionLockingPromise=null}))};resumeRelayReconnection=()=>{null==resolver||resolver()};makeSocket=(url,onMessage)=>{const client={},init3=()=>{const socket=new WebSocket(url);socket.onclose=()=>{if(reconnectionLockingPromise)reconnectionLockingPromise.then(init3);else{null!=socketRetryPeriods[url]||(socketRetryPeriods[url]=3333);setTimeout(init3,socketRetryPeriods[url]);socketRetryPeriods[url]*=2}};socket.onmessage=e3=>onMessage(String(e3.data));client.socket=socket;client.url=socket.url;client.ready=new Promise(res2=>socket.onopen=()=>{res2(client);socketRetryPeriods[url]=3333});client.send=data=>{1===socket.readyState&&socket.send(data)}};init3();return client};createRelayManager=getSocket=>{const relays={},keysByRelay=new WeakMap,keyOf=relay=>{const key3=keysByRelay.get(relay);if(!key3)throw mkErr("relay bookkeeping missing registration for relay client");return key3};return{register:(key3,relay)=>{relays[key3]=relay;keysByRelay.set(relay,key3);return relay},keyOf,scoped:()=>{const store={},forKey=key3=>{var _a8;return null!=(_a8=store[key3])?_a8:store[key3]={}};return{forKey,forRelay:relay=>forKey(keyOf(relay))}},getSockets:()=>fromEntries(entries(relays).flatMap(([key3,relay])=>{const socket=getSocket(relay);return socket?[[key3,socket]]:[]}))}};watchOnline=()=>{if(isBrowser){const controller=new AbortController;addEventListener("online",resumeRelayReconnection,{signal:controller.signal});addEventListener("offline",pauseRelayReconnection,{signal:controller.signal});return()=>controller.abort()}return noOp};strToSha1={};pack=buff=>btoa(String.fromCharCode.apply(null,Array.from(new Uint8Array(buff))));unpack=packed=>{const str=atob(packed);return new Uint8Array(str.length).map((_,i2)=>str.charCodeAt(i2)).buffer};hashWith=async(algorithm,str)=>new Uint8Array(await crypto.subtle.digest(algorithm,encodeBytes(str)));sha1=async str=>{var _a8;return null!=(_a8=strToSha1[str])?_a8:strToSha1[str]=Array.from(await hashWith("SHA-1",str)).map(b3=>b3.toString(36)).join("")};genKey=async(secret,appId,roomId)=>crypto.subtle.importKey("raw",await crypto.subtle.digest({name:"SHA-256"},encodeBytes(`${secret}:${appId}:${roomId}`)),{name:"AES-GCM"},!1,["encrypt","decrypt"]);deriveRoomNamespace=async(appId,roomId)=>toHex(await hashWith("SHA-256",`${libName}:${appId}:${roomId}`));encrypt=async(keyP,plaintext)=>{const iv=crypto.getRandomValues(new Uint8Array(16));return iv.join(",")+"$"+pack(await crypto.subtle.encrypt({name:"AES-GCM",iv},await keyP,encodeBytes(plaintext)))};decrypt=async(keyP,raw)=>{var _a8;const[iv,c3]=raw.split("$");return decodeBytes(await crypto.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(null!=(_a8=null==iv?void 0:iv.split(",").map(Number))?_a8:[])},await keyP,unpack(null!=c3?c3:"")))};OfferPool=class{constructor(makeOffer){__publicField(this,"pool",[]);__publicField(this,"pooled",new Set);__publicField(this,"leased",new Map);__publicField(this,"recycling",new Set);__publicField(this,"cleanupTimer",null);__publicField(this,"active",!1);this.makeOffer=makeOffer}get isActive(){return this.active}warmup(){this.pool=[];this.pooled.clear();alloc(20,this.makeOffer).forEach(p2=>this.push(p2));this.active=!0;this.cleanupTimer=setInterval(()=>{this.pool=this.pool.filter(peer=>{if(peer.isDead){this.pooled.delete(peer);return!1}return!0})},57333)}push(peer){if(!(peer.isDead||this.pooled.has(peer)||this.leased.has(peer))){this.pool.push(peer);this.pooled.add(peer)}}shift(n3){const peers=[];for(;peers.length0;){const peer=this.pool.shift();if(!peer)break;this.pooled.delete(peer);peers.push(peer)}return peers}claimLeased(peer){const timer=this.leased.get(peer);if(timer){resetTimer(timer);this.leased.delete(peer)}}recycle(peer){if(!peer.isDead&&!this.recycling.has(peer))if(peer.connection.remoteDescription)peer.destroy();else if(this.active){this.recycling.add(peer);peer.setHandlers({connect:noOp,close:noOp,error:noOp});peer.getOffer(!0).then(offer=>{offer&&"offer"===offer.type&&!peer.isDead&&this.active?this.push(peer):peer.destroy()}).catch(()=>peer.destroy()).finally(()=>this.recycling.delete(peer))}else peer.destroy()}reclaimLeased(peer){const timer=this.leased.get(peer);if(timer){resetTimer(timer);this.leased.delete(peer);this.recycle(peer)}}lease(peer){this.claimLeased(peer);this.leased.set(peer,setTimeout(()=>{this.leased.delete(peer);this.recycle(peer)},18e4))}checkout(n3,leaseOffers,encryptOffer){const peers=this.shift(n3),missing=Math.max(0,n3-peers.length);missing>0&&peers.push(...alloc(missing,this.makeOffer));const toRecord=async(candidate,didRetry=!1)=>{try{const offer=await encryptOffer(candidate);if(leaseOffers){this.lease(candidate);return{peer:candidate,offer,claim:()=>this.claimLeased(candidate),reclaim:()=>this.reclaimLeased(candidate)}}return{peer:candidate,offer}}catch(err3){this.claimLeased(candidate);this.pooled.delete(candidate);candidate.destroy();if(!didRetry)return toRecord(this.makeOffer(),!0);throw err3}};return all(peers.map(peer=>toRecord(peer)))}getOffers(n3,encryptOffer){return this.checkout(n3,!0,encryptOffer)}destroy(){this.active=!1;if(this.cleanupTimer){clearInterval(this.cleanupTimer);this.cleanupTimer=null}this.pool.forEach(peer=>peer.destroy());this.pool=[];this.pooled.clear();this.leased.forEach((timeout,peer)=>{resetTimer(timeout);peer.destroy()});this.leased.clear();this.recycling.forEach(peer=>peer.destroy());this.recycling.clear()}};overlapRoomPasswordErr=mkErr("incorrect password for overlapping room");createPasswordHandshake=(password,appId,roomId)=>{const hashChallenge=challenge2=>hashWith("SHA-256",`${challenge2}:${password}:${appId}:${roomId}`).then(toHex),run3=async(send,receive,isInitiator)=>{if(!password)return;if(isInitiator){const challenge2=genId(36);await send({__trystero_pw:"challenge",c:challenge2});const{data:data2}=await receive();if(!data2||"object"!=typeof data2||"response"!==data2.__trystero_pw||"string"!=typeof data2.h)throw overlapRoomPasswordErr;const expected=await hashChallenge(challenge2);if(data2.h!==expected)throw overlapRoomPasswordErr;return}const{data}=await receive();if(!data||"object"!=typeof data||"challenge"!==data.__trystero_pw||"string"!=typeof data.c)throw overlapRoomPasswordErr;await send({__trystero_pw:"response",h:await hashChallenge(data.c)})};return{run:run3,compose:userHandshake=>password||userHandshake?async(peerId,send,receive,isInitiator)=>{await run3(send,receive,isInitiator);await(null==userHandshake?void 0:userHandshake(peerId,send,receive,isInitiator))}:void 0}};outOfRangePattern=/out of range/i;rewriteMdnsCandidatesToLoopback=sdp=>sdp.replace(/ (\S+\.local) (\d+) typ host/g," 127.0.0.1 $2 typ host");peer_default=(initiator,{trickleIce,rtcConfig,rtcPolyfill,turnConfig,_test_only_mdnsHostFallbackToLoopback})=>{const pc=new(null!=rtcPolyfill?rtcPolyfill:RTCPeerConnection)({iceServers:defaultIceServers.concat(null!=turnConfig?turnConfig:[]),...rtcConfig}),handlers3={},pendingSignals=[],pendingData=[],shouldTrickleIce=!1!==trickleIce,pendingRemoteCandidates=[],pendingTracks=[];let makingOffer=!1,isSettingRemoteAnswerPending=!1,dataChannel=null,disconnectedCloseTimer=null,didEmitClose=!1;const clearDisconnectedCloseTimer=()=>disconnectedCloseTimer=resetTimer(disconnectedCloseTimer),emitClose=()=>{var _a8;if(!didEmitClose){didEmitClose=!0;clearDisconnectedCloseTimer();null==(_a8=handlers3.close)||_a8.call(handlers3)}},emitSignal=signal=>{handlers3.signal?handlers3.signal(signal):pendingSignals.push(signal)},appendSignalHandler=handler=>{const previousSignalHandler=handlers3.signal;handlers3.signal=signal=>{null==previousSignalHandler||previousSignalHandler(signal);handler(signal)};pendingSignals.length>0&&pendingSignals.splice(0).forEach(signal=>{var _a8;return null==(_a8=handlers3.signal)?void 0:_a8.call(handlers3,signal)})},normalizeSdp=sdp=>_test_only_mdnsHostFallbackToLoopback?rewriteMdnsCandidatesToLoopback(sdp):sdp,normalizeCandidate=candidate=>{if(!_test_only_mdnsHostFallbackToLoopback||"string"!=typeof candidate.candidate)return candidate;const normalizedCandidate=rewriteMdnsCandidatesToLoopback(candidate.candidate);return normalizedCandidate===candidate.candidate?candidate:{...candidate,candidate:normalizedCandidate}},localDescriptionSignal=peerConnection=>{var _a8,_b5,_c3,_d2;return{type:null!=(_b5=null==(_a8=peerConnection.localDescription)?void 0:_a8.type)?_b5:"offer",sdp:normalizeSdp(null!=(_d2=null==(_c3=peerConnection.localDescription)?void 0:_c3.sdp)?_d2:"")}},getRemoteUfrag=()=>{var _a8,_b5,_c3;const sdp=null==(_a8=pc.remoteDescription)?void 0:_a8.sdp;return sdp&&null!=(_c3=null==(_b5=sdp.match(/a=ice-ufrag:([^\s]+)/))?void 0:_b5[1])?_c3:null},getRemoteMediaSectionCount=()=>{var _a8,_b5,_c3;return(null!=(_c3=null==(_b5=null==(_a8=pc.remoteDescription)?void 0:_a8.sdp)?void 0:_b5.match(/^m=/gm))?_c3:[]).length},canApplyRemoteCandidate=candidate=>{if(!pc.remoteDescription)return!1;const remoteMLineCount=getRemoteMediaSectionCount();if("number"==typeof candidate.sdpMLineIndex&&remoteMLineCount>0&&candidate.sdpMLineIndex>=remoteMLineCount)return!1;const remoteUfrag=getRemoteUfrag();return!remoteUfrag||!candidate.usernameFragment||candidate.usernameFragment===remoteUfrag},addIceCandidateSafe=async candidate=>{try{await pc.addIceCandidate(candidate);return!0}catch(err3){if(err3 instanceof Error&&outOfRangePattern.test(err3.message)&&"number"==typeof candidate.sdpMLineIndex)return!1;throw err3}},flushPendingRemoteCandidates=async()=>{if(!pc.remoteDescription||0===pendingRemoteCandidates.length)return;const queuedCandidates=pendingRemoteCandidates.splice(0),stillPending=[];for(const candidate of queuedCandidates)canApplyRemoteCandidate(candidate)&&await addIceCandidateSafe(candidate)||stillPending.push(candidate);stillPending.length>0&&pendingRemoteCandidates.push(...stillPending)},addRemoteCandidate=async candidate=>{canApplyRemoteCandidate(candidate)&&await addIceCandidateSafe(candidate)||pendingRemoteCandidates.push(candidate)},setupDataChannel=channel=>{channel.binaryType="arraybuffer";channel.bufferedAmountLowThreshold=65535;channel.onmessage=e3=>{const data=e3.data;handlers3.data?handlers3.data(data):pendingData.push(data)};channel.onopen=()=>{var _a8;return null==(_a8=handlers3.connect)?void 0:_a8.call(handlers3)};channel.onclose=emitClose;channel.onerror=({error})=>{var _a8;return null==(_a8=handlers3.error)?void 0:_a8.call(handlers3,toError(error,"data channel error"))}},waitForIceGathering=async peerConnection=>{let timeout=null;try{await Promise.race([new Promise(res2=>{const checkState5=()=>{if("complete"===peerConnection.iceGatheringState){peerConnection.removeEventListener("icegatheringstatechange",checkState5);res2()}};peerConnection.addEventListener("icegatheringstatechange",checkState5);checkState5()}),new Promise(res2=>{timeout=setTimeout(res2,15e3)})])}finally{resetTimer(timeout)}return localDescriptionSignal(peerConnection)},emitLocalDescriptionSignal=async()=>{const signal=shouldTrickleIce?localDescriptionSignal(pc):await waitForIceGathering(pc);emitSignal(signal);return signal};if(initiator){dataChannel=pc.createDataChannel("data");setupDataChannel(dataChannel)}else pc.ondatachannel=({channel})=>{dataChannel=channel;setupDataChannel(channel)};const createOffer=async(restartIce=!1)=>{var _a8,_b5;if("closed"!==pc.connectionState)try{makingOffer=!0;if(restartIce){"stable"!==pc.signalingState&&"closed"!==pc.signalingState&&"offer"===(null==(_a8=pc.localDescription)?void 0:_a8.type)&&await pc.setLocalDescription({type:"rollback"});"function"==typeof pc.restartIce&&pc.restartIce()}await pc.setLocalDescription(restartIce?await pc.createOffer({iceRestart:!0}):void 0);return await emitLocalDescriptionSignal()}catch(err3){null==(_b5=handlers3.error)||_b5.call(handlers3,toError(err3,"failed to create local offer"))}finally{makingOffer=!1}};pc.onnegotiationneeded=async()=>createOffer(!1);pc.onicecandidate=({candidate})=>{if(!shouldTrickleIce||!candidate)return;const candidatePayload=normalizeCandidate("function"==typeof candidate.toJSON?candidate.toJSON():{candidate:candidate.candidate,sdpMid:candidate.sdpMid,sdpMLineIndex:candidate.sdpMLineIndex,usernameFragment:candidate.usernameFragment});emitSignal({type:"candidate",sdp:JSON.stringify(candidatePayload)})};pc.onconnectionstatechange=()=>{"connected"!==pc.connectionState&&"connecting"!==pc.connectionState?"disconnected"!==pc.connectionState?"failed"!==pc.connectionState&&"closed"!==pc.connectionState||emitClose():disconnectedCloseTimer||(disconnectedCloseTimer=setTimeout(()=>{disconnectedCloseTimer=null;"disconnected"===pc.connectionState&&emitClose()},5e3)):clearDisconnectedCloseTimer()};pc.ontrack=e3=>{var _a8,_b5;const stream=e3.streams[0];if(stream){if(!handlers3.track&&!handlers3.stream){pendingTracks.push({track:e3.track,stream});return}null==(_a8=handlers3.track)||_a8.call(handlers3,e3.track,stream);null==(_b5=handlers3.stream)||_b5.call(handlers3,stream)}};pc.onremovestream=e3=>{var _a8;return null==(_a8=handlers3.stream)?void 0:_a8.call(handlers3,e3.stream)};const offerPromise=initiator?new Promise(res2=>appendSignalHandler(signal=>{"offer"===signal.type&&res2(signal)})):Promise.resolve();initiator&&queueMicrotask(()=>{var _a8;makingOffer||"stable"!==pc.signalingState||pc.localDescription||"closed"===pc.connectionState||null==(_a8=pc.onnegotiationneeded)||_a8.call(pc,new Event("negotiationneeded"))});return{created:Date.now(),connection:pc,get channel(){return dataChannel},get isDead(){return"closed"===pc.connectionState},getOffer:async(restartIce=!1)=>{var _a8;if(initiator)return restartIce?createOffer(!0):"offer"===(null==(_a8=pc.localDescription)?void 0:_a8.type)?shouldTrickleIce?localDescriptionSignal(pc):waitForIceGathering(pc):offerPromise},async signal(sdp){var _a8,_b5,_c3;if("candidate"!==sdp.type){if("open"!==(null==dataChannel?void 0:dataChannel.readyState)||(null==(_b5=sdp.sdp)?void 0:_b5.includes("a=rtpmap")))try{const rtcSdp={...sdp,sdp:normalizeSdp(sdp.sdp)};if("offer"===sdp.type){if(makingOffer||"stable"!==pc.signalingState&&!isSettingRemoteAnswerPending){if(initiator)return;await all([pc.setLocalDescription({type:"rollback"}),pc.setRemoteDescription(rtcSdp)])}else await pc.setRemoteDescription(rtcSdp);await flushPendingRemoteCandidates();await pc.setLocalDescription();return await emitLocalDescriptionSignal()}if("answer"===sdp.type){isSettingRemoteAnswerPending=!0;try{await pc.setRemoteDescription(rtcSdp);await flushPendingRemoteCandidates()}finally{isSettingRemoteAnswerPending=!1}}}catch(err3){null==(_c3=handlers3.error)||_c3.call(handlers3,toError(err3,"failed to apply remote signal"))}}else try{const candidate=JSON.parse(sdp.sdp);candidate&&"object"==typeof candidate&&await addRemoteCandidate(normalizeCandidate(candidate))}catch(err3){null==(_a8=handlers3.error)||_a8.call(handlers3,toError(err3,"failed to parse remote candidate"))}},sendData:data=>null==dataChannel?void 0:dataChannel.send(data),destroy:()=>{clearDisconnectedCloseTimer();null==dataChannel||dataChannel.close();pc.close();makingOffer=!1;isSettingRemoteAnswerPending=!1;emitClose()},setHandlers:newHandlers=>{const{signal,...restHandlers}=newHandlers;Object.assign(handlers3,restHandlers);handlers3.data&&pendingData.length>0&&pendingData.splice(0).forEach(data=>{var _a8;return null==(_a8=handlers3.data)?void 0:_a8.call(handlers3,data)});signal&&appendSignalHandler(signal);(handlers3.track||handlers3.stream)&&pendingTracks.length>0&&pendingTracks.splice(0).forEach(({track,stream})=>{var _a8,_b5;null==(_a8=handlers3.track)||_a8.call(handlers3,track,stream);null==(_b5=handlers3.stream)||_b5.call(handlers3,stream)})},offerPromise,addStream:stream=>stream.getTracks().forEach(track=>pc.addTrack(track,stream)),removeStream:stream=>pc.getSenders().filter(sender=>sender.track&&stream.getTracks().includes(sender.track)).forEach(sender=>pc.removeTrack(sender)),addTrack:(track,stream)=>pc.addTrack(track,stream),removeTrack:track=>{const sender=pc.getSenders().find(s2=>s2.track===track);sender&&pc.removeTrack(sender)},replaceTrack:(oldTrack,newTrack)=>{const sender=pc.getSenders().find(s2=>s2.track===oldTrack);if(sender)return sender.replaceTrack(newTrack)}}};defaultIceServers=[...alloc(3,(_,i2)=>`stun:stun${i2||""}.l.google.com:19302`),"stun:stun.cloudflare.com:3478"].map(url=>({urls:url}));TypedArray=Object.getPrototypeOf(Uint8Array);chunkSize=16384-(payloadIndex=1+(progressIndex=1+34));internalNs=ns=>"@_"+ns;beforeUnloadRoomCleanups=new Set;cleanupActiveRoomsOnBeforeUnload=()=>beforeUnloadRoomCleanups.forEach(cleanup=>cleanup());registerBeforeUnloadCleanup=cleanup=>{beforeUnloadRoomCleanups.add(cleanup);1===beforeUnloadRoomCleanups.size&&addEventListener("beforeunload",cleanupActiveRoomsOnBeforeUnload);return()=>{beforeUnloadRoomCleanups.delete(cleanup);beforeUnloadRoomCleanups.size||removeEventListener("beforeunload",cleanupActiveRoomsOnBeforeUnload)}};toByteArray=value=>value instanceof ArrayBuffer?new Uint8Array(value):new Uint8Array(value.buffer,value.byteOffset,value.byteLength);toHandshakeErrorMessage=error=>{const message=toErrorMessage(error,"unknown error");return message.startsWith("handshake ")?message:`handshake failed: ${message}`};waitForBufferedAmountLow=(channel,timeoutMs=1e4)=>"open"!==channel.readyState||channel.bufferedAmount<=channel.bufferedAmountLowThreshold?Promise.resolve("open"===channel.readyState):new Promise(res2=>{let settled2=!1,timeout=null;const finish=didDrain=>{if(!settled2){settled2=!0;channel.removeEventListener("bufferedamountlow",onBufferLow);channel.removeEventListener("close",onCloseOrError);channel.removeEventListener("error",onCloseOrError);resetTimer(timeout);res2(didDrain)}},onBufferLow=()=>finish(!0),onCloseOrError=()=>finish(!1);channel.addEventListener("bufferedamountlow",onBufferLow);channel.addEventListener("close",onCloseOrError);channel.addEventListener("error",onCloseOrError);timeout=setTimeout(()=>finish(!1),timeoutMs);"open"===channel.readyState?channel.bufferedAmount<=channel.bufferedAmountLowThreshold&&finish(!0):finish(!1)});room_default=(onPeer,onPeerLeave,onSelfLeave,{onPeerHandshake,onHandshakeError,handshakeTimeoutMs=1e4}={})=>{const peerMap={},activePeerMap={},peerStates={},actions={},actionsCache={},pendingTransmissions={},pendingActionPayloads={},pendingPongs={},pendingStreamMetas={},pendingTrackMetas={},localStreamKeys=new WeakMap,localTrackKeys=new WeakMap,listeners={onPeerJoin:noOp,onPeerLeave:noOp,onPeerStream:noOp,onPeerTrack:noOp};let unregisterBeforeUnloadCleanup=noOp;const iterate2=(targets,f4,{includePending=!1}={})=>(targets?Array.isArray(targets)?targets:[targets]:keys(includePending?peerMap:activePeerMap)).flatMap(id=>{const peer=includePending?peerMap[id]:activePeerMap[id];if(!peer){console.warn(`${libName}: no peer with id ${id} found`);return[]}return[Promise.resolve(f4(id,peer))]}),applyMediaOp=(targets,key3,metadata,sendMeta,op)=>{const payload={k:key3,...void 0===metadata?{}:{m:metadata}};return iterate2(targets,async(id,peer)=>{await sendMeta(payload,id);op(peer)})},makeKeyGetter=map3=>item=>{let key3=map3.get(item);if(!key3){key3=genId(20);map3.set(item,key3)}return key3},getStreamKey=makeKeyGetter(localStreamKeys),getTrackKey=makeKeyGetter(localTrackKeys),getSharedMediaPeer=id=>{var _a8;return null!=(_a8=peerMap[id])?_a8:null},emitStream=(id,key3,stream,metadata)=>{var _a8,_b5;if(activePeerMap[id]){null==(_b5=null==(_a8=getSharedMediaPeer(id))?void 0:_a8.__trysteroSetRemoteStreamByKey)||_b5.call(_a8,key3,stream);listeners.onPeerStream(stream,id,metadata)}},emitTrack=(id,key3,track,stream,metadata)=>{var _a8,_b5;if(activePeerMap[id]){null==(_b5=null==(_a8=getSharedMediaPeer(id))?void 0:_a8.__trysteroSetRemoteTrackByKey)||_b5.call(_a8,key3,track,stream);listeners.onPeerTrack(track,stream,id,metadata)}},clearPeerState=(id,reason=mkErr("peer disconnected"))=>{var _a8;const state2=peerStates[id],err3=toError(reason,"peer disconnected");if(state2){resetTimer(state2.handshakeTimer);state2.pendingHandshakePayloads.length=0;state2.handshakeWaiters.splice(0).forEach(waiter=>waiter.reject(err3));delete peerStates[id]}delete peerMap[id];delete activePeerMap[id];delete pendingTransmissions[id];null==(_a8=pendingPongs[id])||_a8.splice(0).forEach(waiter=>waiter.reject(err3));delete pendingPongs[id];delete pendingStreamMetas[id];delete pendingTrackMetas[id]},exitPeer=(id,peer,reason)=>{const current=peerMap[id];if(!current)return;if(peer&¤t!==peer)return;const wasActive=Boolean(activePeerMap[id]);clearPeerState(id,reason);current.destroy();wasActive&&listeners.onPeerLeave(id);onPeerLeave(id)},makeActionInternal=(type,options={})=>{const cached=actionsCache[type];if(actions[type]&&cached){const cachedOptions=actions[type].options;if(cachedOptions.sendToPending!==Boolean(options.sendToPending)||cachedOptions.receiveWhilePending!==Boolean(options.receiveWhilePending))throw mkErr(`action type "${type}" cannot be redefined`);return cached}if(!type)throw mkErr("action type argument is required");const typeBytes=encodeBytes(type);if(typeBytes.byteLength>32)throw mkErr(`action type string "${type}" (${typeBytes.byteLength}b) exceeds byte limit (32). Hint: choose a shorter name.`);const normalizedOptions={sendToPending:Boolean(options.sendToPending),receiveWhilePending:Boolean(options.receiveWhilePending)},typeBytesPadded=new Uint8Array(32);typeBytesPadded.set(typeBytes);let nonce=0;actions[type]={onComplete:noOp,onProgress:noOp,setOnComplete:f4=>{actions[type].onComplete=f4;const pending3=pendingActionPayloads[type];if(null==pending3?void 0:pending3.length){delete pendingActionPayloads[type];pending3.forEach(({payload,peerId,metadata})=>f4(payload,peerId,metadata))}},setOnProgress:f4=>{actions[type].onProgress=f4},send:async(data,targets,meta,onProgress)=>{const dataType=typeof data;if("undefined"===dataType)throw mkErr("action data cannot be undefined");const isJson="string"!==dataType,isBlob2=data instanceof Blob,isBinary=isBlob2||data instanceof ArrayBuffer||data instanceof TypedArray,hasMeta=void 0!==meta,buffer=isBinary?toByteArray(isBlob2?await data.arrayBuffer():data):encodeBytes(isJson?toJson(data):data),metaEncoded=hasMeta?encodeBytes(toJson(meta)):null,chunkTotal=Math.ceil(buffer.byteLength/chunkSize)+(hasMeta?1:0)||1,chunks=alloc(chunkTotal,(_,i2)=>{var _a8;const isLast=i2===chunkTotal-1,isMeta=Boolean(hasMeta&&0===i2),chunk=new Uint8Array(payloadIndex+(isMeta?null!=(_a8=null==metaEncoded?void 0:metaEncoded.byteLength)?_a8:0:isLast?buffer.byteLength-chunkSize*(chunkTotal-(hasMeta?2:1)):chunkSize));chunk.set(typeBytesPadded);chunk.set([nonce>>8,255&nonce],32);chunk.set([Number(isLast)|Number(isMeta)<<1|Number(isBinary)<<2|Number(isJson)<<3],34);chunk.set([Math.round((i2+1)/chunkTotal*255)],progressIndex);chunk.set(hasMeta?isMeta?null!=metaEncoded?metaEncoded:new Uint8Array:buffer.subarray((i2-1)*chunkSize,i2*chunkSize):buffer.subarray(i2*chunkSize,(i2+1)*chunkSize),payloadIndex);return chunk});nonce=nonce+1&65535;await all(iterate2(targets,async(id,peer)=>{var _a8;const{channel}=peer;let chunkN=0;for(;chunkNchannel.bufferedAmountLowThreshold&&!await waitForBufferedAmountLow(channel))break;const currentPeer=normalizedOptions.sendToPending?peerMap[id]:activePeerMap[id];if(!currentPeer||currentPeer!==peer)break;peer.sendData(chunk);chunkN++;const progressByte=null!=(_a8=chunk[progressIndex])?_a8:255;null==onProgress||onProgress(progressByte/255,id,meta)}},{includePending:normalizedOptions.sendToPending}));return[]},options:normalizedOptions};return actionsCache[type]=[actions[type].send,actions[type].setOnComplete,actions[type].setOnProgress]},handleData=(id,data)=>{var _a8,_b5,_c3,_d2,_f,_h2,_i2,_j,_k;const state2=peerStates[id];if(!state2)return;const buffer=new Uint8Array(data),type=decodeBytes(buffer.subarray(0,32)).replaceAll("\0",""),action2=actions[type];if(!state2.isActive&&!(null==action2?void 0:action2.options.receiveWhilePending))return;const nonce=(null!=(_a8=buffer[32])?_a8:0)<<8|(null!=(_b5=buffer[33])?_b5:0),tag3=null!=(_c3=buffer[34])?_c3:0,progress=null!=(_d2=buffer[progressIndex])?_d2:0,payload=buffer.subarray(payloadIndex),isLast=Boolean(1&tag3),isMeta=Boolean(2&tag3),isBinary=Boolean(4&tag3),isJson=Boolean(8&tag3);null!=pendingTransmissions[id]||(pendingTransmissions[id]={});null!=(_f=pendingTransmissions[id])[type]||(_f[type]={});const target=null!=(_i2=(_h2=pendingTransmissions[id][type])[nonce])?_i2:_h2[nonce]={chunks:[]};isMeta?target.meta=fromJson(decodeBytes(payload)):target.chunks.push(payload);null==action2||action2.onProgress(progress/255,id,target.meta);if(!isLast)return;const full=new Uint8Array(target.chunks.reduce((a2,c3)=>a2+c3.byteLength,0));target.chunks.reduce((a2,c3)=>{full.set(c3,a2);return a2+c3.byteLength},0);delete pendingTransmissions[id][type][nonce];if(isBinary)action2?action2.onComplete(full,id,target.meta):(null!=(_j=pendingActionPayloads[type])?_j:pendingActionPayloads[type]=[]).push({payload:full,peerId:id,...void 0===target.meta?{}:{metadata:target.meta}});else{const text2=decodeBytes(full),decoded=isJson?fromJson(text2):text2;action2?action2.onComplete(decoded,id,target.meta):(null!=(_k=pendingActionPayloads[type])?_k:pendingActionPayloads[type]=[]).push({payload:decoded,peerId:id,...void 0===target.meta?{}:{metadata:target.meta}})}},leave=async()=>{await sendLeave("");await new Promise(res2=>setTimeout(res2,99));entries(peerMap).forEach(([id,peer])=>{peer.destroy();clearPeerState(id,mkErr("room left"))});unregisterBeforeUnloadCleanup();onSelfLeave()},[sendPing,getPing]=makeActionInternal(internalNs("ping")),[sendPong,getPong]=makeActionInternal(internalNs("pong")),[sendSignal2,getSignal]=makeActionInternal(internalNs("signal")),[sendStreamMeta,getStreamMeta]=makeActionInternal(internalNs("stream")),[sendTrackMeta,getTrackMeta]=makeActionInternal(internalNs("track")),[sendLeave,getLeave]=makeActionInternal(internalNs("leave"),{sendToPending:!0,receiveWhilePending:!0}),[sendHandshakeData,getHandshakeData]=makeActionInternal(internalNs("hsdata"),{sendToPending:!0,receiveWhilePending:!0}),[sendHandshakeReady,getHandshakeReady]=makeActionInternal(internalNs("hsready"),{sendToPending:!0,receiveWhilePending:!0}),maybeActivatePeer=(id,peer)=>{const state2=peerStates[id];if(!(!state2||peer&&state2.peer!==peer||state2.isActive)&&state2.didLocalHandshakePass&&state2.didReceiveRemoteReady){state2.isActive=!0;activePeerMap[id]=state2.peer;state2.handshakeTimer=resetTimer(state2.handshakeTimer);listeners.onPeerJoin(id)}},failPeerHandshake=(id,peer,reason)=>{const state2=peerStates[id];if(!state2||state2.peer!==peer)return;const error=toHandshakeErrorMessage(reason);null==onHandshakeError||onHandshakeError(id,error);exitPeer(id,peer,mkErr(error))},markLocalHandshakePassed=(id,peer)=>{const state2=peerStates[id];if(state2&&state2.peer===peer&&!state2.isActive){state2.didLocalHandshakePass=!0;sendHandshakeReady("",id).catch(err3=>failPeerHandshake(id,peer,mkErr(`failed sending handshake readiness: ${toErrorMessage(err3,"unknown send failure")}`)));maybeActivatePeer(id,peer)}},startPeerHandshake=(id,peer)=>{const state2=peerStates[id];if(!state2||state2.peer!==peer)return;state2.handshakeTimer=setTimeout(()=>failPeerHandshake(id,peer,mkErr(`handshake timed out after ${handshakeTimeoutMs}ms`)),handshakeTimeoutMs);const isInitiator=selfId{await sendHandshakeData(data,id,metadata)},()=>new Promise((resolve,reject)=>{const current=peerStates[id];if(!current||current.peer!==peer){reject(mkErr("peer disconnected during handshake"));return}const payload=current.pendingHandshakePayloads.shift();payload?resolve(payload):current.handshakeWaiters.push({resolve,reject:error=>reject(error)})}),isInitiator)).then(()=>markLocalHandshakePassed(id,peer)).catch(err3=>failPeerHandshake(id,peer,toError(err3,"handshake failed")))},toPendingMediaMeta=value=>value&&"object"==typeof value&&!Array.isArray(value)&&"string"==typeof value.k?{key:value.k,...Object.hasOwn(value,"m")?{metadata:value.m}:{}}:null;getPing((_,id)=>sendPong("",id));getPong((_,id)=>{var _a8;const queue2=pendingPongs[id];null==(_a8=null==queue2?void 0:queue2.shift())||_a8.resolve();queue2&&!queue2.length&&delete pendingPongs[id]});getSignal((sdp,id)=>{var _a8;activePeerMap[id]&&(null==(_a8=peerMap[id])||_a8.signal(sdp))});getStreamMeta((meta,id)=>{var _a8,_b5,_c3;if(!activePeerMap[id])return;const parsed=toPendingMediaMeta(meta);if(!parsed)return;(null!=(_a8=pendingStreamMetas[id])?_a8:pendingStreamMetas[id]=[]).push(parsed);const cached=null==(_c3=null==(_b5=getSharedMediaPeer(id))?void 0:_b5.__trysteroGetRemoteStreamByKey)?void 0:_c3.call(_b5,parsed.key);cached&&emitStream(id,parsed.key,cached,parsed.metadata)});getTrackMeta((meta,id)=>{var _a8,_b5,_c3;if(!activePeerMap[id])return;const parsed=toPendingMediaMeta(meta);if(!parsed)return;(null!=(_a8=pendingTrackMetas[id])?_a8:pendingTrackMetas[id]=[]).push(parsed);const cached=null==(_c3=null==(_b5=getSharedMediaPeer(id))?void 0:_b5.__trysteroGetRemoteTrackByKey)?void 0:_c3.call(_b5,parsed.key);cached&&emitTrack(id,parsed.key,cached.track,cached.stream,parsed.metadata)});getLeave((_,id)=>exitPeer(id,void 0,mkErr("peer left room")));getHandshakeData((data,id,metadata)=>{const state2=peerStates[id];if(!state2||state2.isActive)return;const payload=void 0===metadata?{data}:{data,metadata},pending3=state2.handshakeWaiters.shift();pending3?pending3.resolve(payload):state2.pendingHandshakePayloads.push(payload)});getHandshakeReady((_,id)=>{const state2=peerStates[id];if(state2&&!state2.isActive){state2.didReceiveRemoteReady=!0;maybeActivatePeer(id)}});onPeer((peer,id)=>{const existingPeer=peerMap[id];if(existingPeer){if(existingPeer===peer)return;existingPeer.destroy();clearPeerState(id,mkErr("peer replaced"))}peerMap[id]=peer;peerStates[id]={peer,isActive:!1,didLocalHandshakePass:!1,didReceiveRemoteReady:!1,handshakeTimer:null,pendingHandshakePayloads:[],handshakeWaiters:[]};peer.setHandlers({data:d4=>handleData(id,d4),stream:stream=>{var _a8;if(!activePeerMap[id])return;const next2=null==(_a8=pendingStreamMetas[id])?void 0:_a8.shift();next2&&emitStream(id,next2.key,stream,next2.metadata)},track:(track,stream)=>{var _a8;if(!activePeerMap[id])return;const next2=null==(_a8=pendingTrackMetas[id])?void 0:_a8.shift();next2&&emitTrack(id,next2.key,track,stream,next2.metadata)},signal:sdp=>{activePeerMap[id]&&sendSignal2(sdp,id)},close:()=>exitPeer(id,peer,mkErr("peer disconnected")),error:err3=>{console.error(`${libName} peer error:`,err3);exitPeer(id,peer,err3)}});startPeerHandshake(id,peer)});isBrowser&&(unregisterBeforeUnloadCleanup=registerBeforeUnloadCleanup(()=>leave().catch(noOp)));return{makeAction:type=>makeActionInternal(type),leave,ping:async id=>{if(!activePeerMap[id])throw mkErr(`no active peer with id ${id}`);const start=Date.now();await new Promise((resolve,reject)=>{var _a8;const queue2=null!=(_a8=pendingPongs[id])?_a8:pendingPongs[id]=[],clearFromQueue=()=>{const currentQueue=pendingPongs[id];if(!currentQueue)return;const i2=currentQueue.indexOf(waiter);i2>-1&¤tQueue.splice(i2,1);currentQueue.length||delete pendingPongs[id]},waiter={resolve:()=>{clearFromQueue();resolve()},reject:reason=>{clearFromQueue();reject(reason)}};queue2.push(waiter);sendPing("",id).catch(err3=>waiter.reject(toError(err3,"peer disconnected")))});return Date.now()-start},getPeers:()=>fromEntries(entries(activePeerMap).map(([id,peer])=>[id,peer.connection])),addStream:(stream,targets,meta)=>applyMediaOp(targets,getStreamKey(stream),meta,sendStreamMeta,peer=>peer.addStream(stream)),removeStream:(stream,targets)=>{iterate2(targets,(_,peer)=>peer.removeStream(stream))},addTrack:(track,stream,targets,meta)=>applyMediaOp(targets,getTrackKey(track),meta,sendTrackMeta,peer=>peer.addTrack(track,stream)),removeTrack:(track,targets)=>{iterate2(targets,(_,peer)=>peer.removeTrack(track))},replaceTrack:(oldTrack,newTrack,targets,meta)=>applyMediaOp(targets,getTrackKey(newTrack),meta,sendTrackMeta,peer=>peer.replaceTrack(oldTrack,newTrack)),onPeerJoin:f4=>{listeners.onPeerJoin=f4;keys(activePeerMap).forEach(peerId=>f4(peerId))},onPeerLeave:f4=>listeners.onPeerLeave=f4,onPeerStream:f4=>listeners.onPeerStream=f4,onPeerTrack:f4=>listeners.onPeerTrack=f4}};wrapRoomFrame=(roomToken,data)=>{const tokenBytes=encodeBytes(roomToken),frame=new Uint8Array(3+tokenBytes.byteLength+data.byteLength);frame[0]=1;frame[1]=tokenBytes.byteLength>>>8&255;frame[2]=255&tokenBytes.byteLength;frame.set(tokenBytes,3);frame.set(data,3+tokenBytes.byteLength);return frame};wrapRoomPresenceFrame=(roomToken,isPresent)=>{const tokenBytes=encodeBytes(roomToken),frame=new Uint8Array(4+tokenBytes.byteLength);frame[0]=2;frame[1]=Number(isPresent);frame[2]=tokenBytes.byteLength>>>8&255;frame[3]=255&tokenBytes.byteLength;frame.set(tokenBytes,4);return frame};unwrapFrame=data=>{var _a8,_b5,_c3,_d2;const buffer=new Uint8Array(data);if(buffer.byteLength<3)return null;if(1===buffer[0]){const tokenSize2=(null!=(_a8=buffer[1])?_a8:0)<<8|(null!=(_b5=buffer[2])?_b5:0),headerSize2=3+tokenSize2;return tokenSize2<=0||buffer.byteLength{const{connection,channel}=peer;return peer.isDead||"closed"===connection.connectionState||"failed"===connection.connectionState||"closed"===connection.iceConnectionState||"failed"===connection.iceConnectionState||"closing"===(null==channel?void 0:channel.readyState)||"closed"===(null==channel?void 0:channel.readyState)};getConnectedPeerHealth=peer=>{if(isPeerUnderlyingStale(peer))return"stale";const{channel}=peer;return channel&&"open"===channel.readyState?"live":"transient"};SharedPeerManager=class{constructor(){__publicField(this,"byApp",{});__publicField(this,"roomPresenceHandlers",{})}getMap(appId){var _a8,_b5;return null!=(_b5=(_a8=this.byApp)[appId])?_b5:_a8[appId]={}}get(appId,peerId){var _a8;return null==(_a8=this.byApp[appId])?void 0:_a8[peerId]}isPeerStale(peer){return isPeerUnderlyingStale(peer)}getHealth(peer){return this.isPeerStale(peer)?"stale":"live"}setRoomPresenceHandler(appId,handler){this.roomPresenceHandlers[appId]=handler;return()=>{this.roomPresenceHandlers[appId]===handler&&delete this.roomPresenceHandlers[appId]}}sendRoomPresence(shared,roomToken,isPresent){shared.isClosing||shared.peer.isDead||shared.peer.sendData(wrapRoomPresenceFrame(roomToken,isPresent))}clear(appId,peerId,{destroyPeer}){const map3=this.byApp[appId],shared=null==map3?void 0:map3[peerId];if(!shared||shared.isClosing)return;shared.idleTimer=resetTimer(shared.idleTimer);shared.isClosing=!0;destroyPeer&&!shared.peer.isDead&&shared.peer.destroy();const bindings=values(shared.bindings);shared.bindings={};shared.bindingsByToken={};shared.controlRoomId=null;delete map3[peerId];bindings.forEach(binding=>{var _a8,_b5;null==(_b5=(_a8=binding.handlers).close)||_b5.call(_a8);binding.pendingData.length=0;binding.pendingSendData.length=0;binding.pendingTracks.length=0});shared.remoteStreamsByKey.clear();shared.remoteTracksByKey.clear();shared.pendingDataByToken.clear();shared.remoteRoomTokens.clear();0===keys(map3).length&&delete this.byApp[appId]}register(appId,peerId,peer,idleMs){const map3=this.getMap(appId),existing=map3[peerId];if(existing){existing.idleTimer=resetTimer(existing.idleTimer);if(existing.peer===peer)return existing;this.clear(appId,peerId,{destroyPeer:!0})}const shared={appId,peerId,peer,bindings:{},bindingsByToken:{},pendingDataByToken:new Map,remoteRoomTokens:new Set,idleTimer:null,controlRoomId:null,streamOwners:new Map,trackOwners:new Map,remoteStreamsByKey:new Map,remoteTracksByKey:new Map,idleMs,isClosing:!1};peer.setHandlers({data:data=>this.dispatchData(shared,data),signal:signal=>this.dispatchSignal(shared,signal),close:()=>this.clear(appId,peerId,{destroyPeer:!1}),error:err3=>{console.error(`${libName} peer error:`,err3);this.clear(appId,peerId,{destroyPeer:!1})},track:(track,stream)=>this.dispatchTrack(shared,track,stream)});map3[peerId]=shared;return shared}bind(roomId,roomTokenPromise,shared,{onDetach}){const existingBinding=shared.bindings[roomId];if(existingBinding){shared.idleTimer=resetTimer(shared.idleTimer);return{proxy:existingBinding.proxy,isNew:!1}}const binding={roomId,roomToken:null,roomTokenPromise,handlers:{},pendingData:[],pendingSendData:[],pendingTracks:[],detach:noOp,proxy:{}},detachBinding=()=>{var _a9;if(shared.bindings[roomId]){this.pruneRoomOwnership(shared,roomId);delete shared.bindings[roomId];binding.roomToken&&shared.bindingsByToken[binding.roomToken]===binding&&delete shared.bindingsByToken[binding.roomToken];shared.controlRoomId===roomId&&(shared.controlRoomId=null!=(_a9=keys(shared.bindings)[0])?_a9:null);onDetach();this.scheduleIdleTimer(shared)}},proxy2={created:shared.peer.created,get connection(){return shared.peer.connection},get channel(){return shared.peer.channel},get isDead(){return shared.peer.isDead},getOffer:restartIce=>shared.peer.getOffer(restartIce),signal:sdp=>shared.peer.signal(sdp),sendData:data=>{binding.roomToken?shared.peer.sendData(wrapRoomFrame(binding.roomToken,data)):binding.pendingSendData.push(data)},destroy:()=>detachBinding(),setHandlers:newHandlers=>{const{signal,...rest}=newHandlers;Object.assign(binding.handlers,rest);signal&&(binding.handlers.signal=signal);this.flushBindingQueues(binding)},offerPromise:shared.peer.offerPromise,addStream:stream=>{var _a9;const owners=null!=(_a9=shared.streamOwners.get(stream))?_a9:new Set,shouldAttach=0===owners.size;owners.add(roomId);shared.streamOwners.set(stream,owners);shouldAttach&&shared.peer.addStream(stream)},removeStream:stream=>{const owners=shared.streamOwners.get(stream);if(owners){owners.delete(roomId);if(0===owners.size){shared.streamOwners.delete(stream);shared.peer.removeStream(stream)}}},addTrack:(track,stream)=>{var _a9,_b5;const entry=null!=(_a9=shared.trackOwners.get(track))?_a9:{stream,rooms:new Set},shouldAttach=0===entry.rooms.size;entry.stream=stream;entry.rooms.add(roomId);shared.trackOwners.set(track,entry);return shouldAttach?shared.peer.addTrack(track,stream):null!=(_b5=shared.peer.connection.getSenders().find(s2=>s2.track===track))?_b5:shared.peer.addTrack(track,stream)},removeTrack:track=>{const entry=shared.trackOwners.get(track);if(entry){entry.rooms.delete(roomId);if(0===entry.rooms.size){shared.trackOwners.delete(track);shared.peer.removeTrack(track)}}},replaceTrack:(oldTrack,newTrack)=>{var _a9;const oldEntry=shared.trackOwners.get(oldTrack);if(oldEntry){shared.trackOwners.delete(oldTrack);const nextEntry=null!=(_a9=shared.trackOwners.get(newTrack))?_a9:{stream:oldEntry.stream,rooms:new Set};oldEntry.rooms.forEach(room=>nextEntry.rooms.add(room));shared.trackOwners.set(newTrack,nextEntry)}return shared.peer.replaceTrack(oldTrack,newTrack)},__trysteroGetRemoteStreamByKey:key3=>shared.remoteStreamsByKey.get(key3),__trysteroSetRemoteStreamByKey:(key3,stream)=>{shared.remoteStreamsByKey.set(key3,stream)},__trysteroGetRemoteTrackByKey:key3=>shared.remoteTracksByKey.get(key3),__trysteroSetRemoteTrackByKey:(key3,track,stream)=>{shared.remoteTracksByKey.set(key3,{track,stream})}};binding.proxy=proxy2;binding.detach=detachBinding;shared.bindings[roomId]=binding;null!=shared.controlRoomId||(shared.controlRoomId=roomId);shared.idleTimer=resetTimer(shared.idleTimer);roomTokenPromise.then(roomToken=>{if(shared.isClosing||shared.bindings[roomId]!==binding)return;binding.roomToken=roomToken;shared.bindingsByToken[roomToken]=binding;const pendingData=shared.pendingDataByToken.get(roomToken);if(null==pendingData?void 0:pendingData.length){binding.pendingData.push(...pendingData);shared.pendingDataByToken.delete(roomToken)}binding.pendingSendData.splice(0).forEach(payload=>shared.peer.sendData(wrapRoomFrame(roomToken,payload)));this.flushBindingQueues(binding)});return{proxy:proxy2,isNew:!0}}pruneRoomOwnership(shared,roomIdToRemove){shared.streamOwners.forEach((rooms,stream)=>{rooms.delete(roomIdToRemove);if(0===rooms.size){shared.streamOwners.delete(stream);shared.peer.removeStream(stream)}});shared.trackOwners.forEach((entry,track)=>{entry.rooms.delete(roomIdToRemove);if(0===entry.rooms.size){shared.trackOwners.delete(track);shared.peer.removeTrack(track)}})}scheduleIdleTimer(shared){if(!(shared.isClosing||keys(shared.bindings).length>0)){shared.idleTimer=resetTimer(shared.idleTimer);shared.idleTimer=setTimeout(()=>{var _a8;const current=null==(_a8=this.byApp[shared.appId])?void 0:_a8[shared.peerId];!current||keys(current.bindings).length>0||this.clear(shared.appId,shared.peerId,{destroyPeer:!0})},shared.idleMs)}}getSignalBinding(shared){if(shared.controlRoomId){const selected=shared.bindings[shared.controlRoomId];if(null==selected?void 0:selected.handlers.signal)return selected}const fallback3=values(shared.bindings).find(binding=>Boolean(binding.handlers.signal));if(!fallback3)return null;shared.controlRoomId=fallback3.roomId;return fallback3}flushBindingQueues(binding){const{handlers:handlers3}=binding;handlers3.data&&binding.pendingData.length>0&&binding.pendingData.splice(0).forEach(payload=>{var _a8;return null==(_a8=handlers3.data)?void 0:_a8.call(handlers3,payload)});(handlers3.track||handlers3.stream)&&binding.pendingTracks.length&&binding.pendingTracks.splice(0).forEach(({track,stream})=>{var _a8,_b5;null==(_a8=handlers3.track)||_a8.call(handlers3,track,stream);null==(_b5=handlers3.stream)||_b5.call(handlers3,stream)})}dispatchData(shared,data){var _a8,_b5,_c3;const decoded=unwrapFrame(data);if(!decoded)return;if("presence"===decoded.type){decoded.isPresent?shared.remoteRoomTokens.add(decoded.roomToken):shared.remoteRoomTokens.delete(decoded.roomToken);null==(_b5=(_a8=this.roomPresenceHandlers)[shared.appId])||_b5.call(_a8,shared.peerId,decoded.roomToken,decoded.isPresent);return}const binding=shared.bindingsByToken[decoded.roomToken];if(!binding){const pending3=null!=(_c3=shared.pendingDataByToken.get(decoded.roomToken))?_c3:[];pending3.push(decoded.payload);shared.pendingDataByToken.set(decoded.roomToken,pending3);return}binding.handlers.data?binding.handlers.data(decoded.payload):binding.pendingData.push(decoded.payload)}dispatchSignal(shared,signal){var _a8,_b5,_c3;null==(_c3=null==(_a8=this.getSignalBinding(shared))?void 0:(_b5=_a8.handlers).signal)||_c3.call(_b5,signal)}dispatchTrack(shared,track,stream){values(shared.bindings).forEach(binding=>{var _a8,_b5,_c3,_d2;if(binding.handlers.track||binding.handlers.stream){null==(_b5=(_a8=binding.handlers).track)||_b5.call(_a8,track,stream);null==(_d2=(_c3=binding.handlers).stream)||_d2.call(_c3,stream)}else binding.pendingTracks.push({track,stream})})}};publishCipheredSignalingMessage=(ctx,signal,peerTopic,signalPeer,buildPayload,stillValid)=>{ctx.toCipher(signal).then(encryptedSignal=>{!ctx.isLeaving()&&stillValid()&&signalPeer(peerTopic,toJson(buildPayload(encryptedSignal.sdp)))})};makeState=()=>({status:"idle",offerPeer:null,offerId:null,offerSdp:null,offerInitPromise:null,offerAnswered:!1,offerRelays:[],offerSignalRelays:[],offerSignalBacklog:[],offerRelayTimers:[],offerExpiryTimer:null,connectedPeer:null,connectedPeerUnhealthySinceMs:null,answeringExpiryTimer:null,answeringPeer:null,pendingCandidates:{}});getState=(peerStates,peerId)=>{var _a8;return null!=(_a8=peerStates[peerId])?_a8:peerStates[peerId]=makeState()};updateStatus=state2=>{state2.connectedPeer?state2.status="connected":state2.answeringPeer?state2.status="answering":state2.offerPeer||state2.offerRelays.some(Boolean)?state2.status="offering":state2.status="idle"};clearAnswering=(state2,peer)=>{if(state2.answeringPeer===peer){state2.answeringExpiryTimer=resetTimer(state2.answeringExpiryTimer);state2.answeringPeer=null;updateStatus(state2)}};clearConnectedPeer=(state2,peerId,_reason)=>{if(state2.connectedPeer){state2.connectedPeer.isDead||state2.connectedPeer.destroy();state2.connectedPeer=null;state2.connectedPeerUnhealthySinceMs=null;updateStatus(state2)}};clearOfferRelay=(state2,relayId)=>{state2.offerRelayTimers[relayId]=resetTimer(state2.offerRelayTimers[relayId]);if(state2.offerRelays[relayId]){state2.offerRelays[relayId]=void 0;updateStatus(state2)}};clearOfferRelayIfPlaceholder=(state2,relayId)=>{"offer-placeholder"===(null==state2?void 0:state2.offerRelays[relayId])&&clearOfferRelay(state2,relayId)};hasRemoteDescription=peer=>{if(peer.isDead||"closed"===peer.connection.connectionState)return!0;try{return Boolean(peer.connection.remoteDescription)}catch(e3){return!0}};resetOfferState=(state2,offerPool)=>{const previousOfferAnswered=state2.offerAnswered;state2.offerExpiryTimer=resetTimer(state2.offerExpiryTimer);state2.offerInitPromise=null;state2.offerRelays.forEach((_,relayId)=>clearOfferRelay(state2,relayId));state2.offerRelays=[];state2.offerSignalRelays=[];state2.offerRelayTimers=[];state2.offerSignalBacklog=[];state2.offerPeer&&state2.offerPeer!==state2.connectedPeer&&(previousOfferAnswered||hasRemoteDescription(state2.offerPeer)?state2.offerPeer.isDead||state2.offerPeer.destroy():offerPool.recycle(state2.offerPeer));state2.offerPeer=null;state2.offerId=null;state2.offerSdp=null;state2.offerAnswered=!1;updateStatus(state2)};scheduleAnsweringExpiry=(ctx,state2,peerId,peer)=>{resetTimer(state2.answeringExpiryTimer);state2.answeringExpiryTimer=setTimeout(()=>{const current=ctx.peerStates[peerId];if(current&&!current.connectedPeer&¤t.answeringPeer===peer){peer.destroy();clearAnswering(current,peer)}},23333)};flushBufferedCandidates=async(state2,peer,offerId)=>{const bufferKeys=offerId?[offerId,"__legacy__"]:["__legacy__"];for(const key3 of bufferKeys){const buffered=state2.pendingCandidates[key3];if(null==buffered?void 0:buffered.length){delete state2.pendingCandidates[key3];for(const candidate of buffered)await peer.signal(candidate)}}};scheduleOfferExpiry=(ctx,state2,peerId,ttlMs=57333)=>{resetTimer(state2.offerExpiryTimer);const offerId=state2.offerId;state2.offerExpiryTimer=setTimeout(()=>{const current=ctx.peerStates[peerId];current&&!current.connectedPeer&¤t.offerId===offerId&&resetOfferState(current,ctx.offerPool)},ttlMs)};ensureOffer=(ctx,state2,peerId,relayId)=>{if(state2.offerPeer&&state2.offerId&&state2.offerSdp)return Promise.resolve({peer:state2.offerPeer,offer:state2.offerSdp,offerId:state2.offerId});if(state2.offerInitPromise)return state2.offerInitPromise;state2.offerInitPromise=(async()=>{const firstOffer=(await ctx.offerPool.checkout(1,!1,ctx.encryptOffer))[0];if(!firstOffer)throw mkErr("failed to allocate offer peer");const{peer,offer}=firstOffer;state2.offerPeer=peer;state2.offerId=genId(12);state2.offerSdp=offer;state2.offerAnswered=!1;state2.offerSignalBacklog=[];updateStatus(state2);const onOfferPeerClosedOrError=()=>{state2.offerPeer!==peer||state2.connectedPeer||resetOfferState(state2,ctx.offerPool);ctx.disconnectPeer(peer,peerId)};peer.setHandlers({connect:()=>ctx.connectPeer(peer,peerId,relayId),signal:signal=>{if(state2.offerPeer===peer){state2.offerSignalBacklog.push(signal);state2.offerSignalRelays.forEach(sendSignal2=>null==sendSignal2?void 0:sendSignal2(signal))}},close:onOfferPeerClosedOrError,error:onOfferPeerClosedOrError});scheduleOfferExpiry(ctx,state2,peerId);return{peer,offer,offerId:state2.offerId}})().finally(()=>state2.offerInitPromise=null);return state2.offerInitPromise};handleAnnouncement=async(ctx,relayId,peerId,shared,signalPeer)=>{var _a8;if(shared){ctx.attachSharedPeerToRoom(peerId,shared);return}const state2=ctx.peerStates[peerId];if(!state2||state2.connectedPeer||state2.answeringPeer||state2.offerAnswered){clearOfferRelayIfPlaceholder(state2,relayId);return}if("offer-placeholder"!==state2.offerRelays[relayId])return;const[peerTopic,offerInfo]=await all([sha1(topicPath(ctx.rootTopicPlaintext,peerId)),ensureOffer(ctx,state2,peerId,relayId)]);if(ctx.isLeaving())return;if(state2.connectedPeer||state2.answeringPeer||state2.offerAnswered||"offer-placeholder"!==state2.offerRelays[relayId]){clearOfferRelayIfPlaceholder(state2,relayId);return}state2.offerRelayTimers[relayId]=resetTimer(state2.offerRelayTimers[relayId]);state2.offerRelays[relayId]=!0;updateStatus(state2);state2.offerRelayTimers[relayId]=setTimeout(()=>prunePendingOffer(ctx,peerId,relayId),.9*(null!=(_a8=ctx.announceIntervals[relayId])?_a8:ctx.announceIntervalMs));let didSendOffer=!1;state2.offerSignalRelays[relayId]=signal=>{didSendOffer&&(ctx.isLeaving()||state2.connectedPeer||state2.offerPeer!==offerInfo.peer||state2.offerId!==offerInfo.offerId||"candidate"!==signal.type||publishCipheredSignalingMessage(ctx,signal,peerTopic,signalPeer,sdp=>({peerId:selfId,offerId:offerInfo.offerId,candidate:sdp}),()=>!state2.connectedPeer&&state2.offerPeer===offerInfo.peer&&state2.offerId===offerInfo.offerId))};signalPeer(peerTopic,toJson({peerId:selfId,offerId:offerInfo.offerId,offer:offerInfo.offer}));didSendOffer=!0;state2.offerSignalBacklog.forEach(signal=>{var _a9,_b5;return null==(_b5=(_a9=state2.offerSignalRelays)[relayId])?void 0:_b5.call(_a9,signal)})};handleOffer=async(ctx,relayId,peerId,offer,offerId,hasOutgoingOfferHint,signalPeer)=>{var _a8;const state2=getState(ctx.peerStates,peerId);if(state2.answeringPeer||state2.offerAnswered)return;const hasTrackedOutgoingOffer=Boolean(state2.offerPeer||state2.offerRelays.some(Boolean));if((hasTrackedOutgoingOffer||hasOutgoingOfferHint)&&selfId{clearAnswering(state2,answerPeer);ctx.disconnectPeer(answerPeer,peerId)};answerPeer.setHandlers({connect:()=>ctx.connectPeer(answerPeer,peerId,relayId),close:onAnswerPeerClosedOrError,error:onAnswerPeerClosedOrError});let plainOffer;try{plainOffer=await ctx.toPlain({type:"offer",sdp:offer})}catch(e3){clearAnswering(state2,answerPeer);null==(_a8=ctx.onJoinError)||_a8.call(ctx,{error:"incorrect room password when decrypting offer",appId:ctx.appId,peerId,roomId:ctx.roomId});return}if(answerPeer.isDead){clearAnswering(state2,answerPeer);return}const peerTopic=await sha1(topicPath(ctx.rootTopicPlaintext,peerId));if(!ctx.isLeaving()){answerPeer.setHandlers({signal:signal=>{ctx.isLeaving()||state2.answeringPeer!==answerPeer||answerPeer.isDead||"answer"!==signal.type&&"candidate"!==signal.type||publishCipheredSignalingMessage(ctx,signal,peerTopic,signalPeer,sdp=>{const payloadToSend={peerId:selfId};"answer"===signal.type?payloadToSend.answer=sdp:payloadToSend.candidate=sdp;offerId&&(payloadToSend.offerId=offerId);return payloadToSend},()=>state2.answeringPeer===answerPeer&&!answerPeer.isDead)}});await answerPeer.signal(plainOffer);await flushBufferedCandidates(state2,answerPeer,offerId)}};handleCandidate=async(ctx,peerId,candidate,offerId,peer)=>{var _a8,_b5,_c3,_d2;let plainCandidate;try{plainCandidate=await ctx.toPlain({type:"candidate",sdp:candidate})}catch(e3){return}const state2=getState(ctx.peerStates,peerId),offerPeerMatch=offerId&&(null==state2?void 0:state2.offerPeer)&&state2.offerId===offerId?state2.offerPeer:null,answeringPeer=null!=(_a8=null==state2?void 0:state2.answeringPeer)?_a8:null,fallbackOfferPeer=!offerId&&(null==state2?void 0:state2.offerPeer)?state2.offerPeer:null,targetPeer=peer&&!peer.isDead?peer:null!=(_b5=null!=offerPeerMatch?offerPeerMatch:answeringPeer)?_b5:fallbackOfferPeer;if(!targetPeer||targetPeer.isDead){const pendingKey=null!=offerId?offerId:"__legacy__";(null!=(_d2=(_c3=state2.pendingCandidates)[pendingKey])?_d2:_c3[pendingKey]=[]).push(plainCandidate);return}targetPeer.signal(plainCandidate)};handleAnswer=async(ctx,relayId,peerId,answer,offerId,peer)=>{var _a8;let plainAnswer;try{plainAnswer=await ctx.toPlain({type:"answer",sdp:answer})}catch(e3){null==(_a8=ctx.onJoinError)||_a8.call(ctx,{error:"incorrect room password when decrypting answer",appId:ctx.appId,peerId,roomId:ctx.roomId});return}if(peer){ctx.offerPool.claimLeased(peer);peer.setHandlers({connect:()=>ctx.connectPeer(peer,peerId,relayId),close:()=>ctx.disconnectPeer(peer,peerId)});peer.signal(plainAnswer)}else{const state2=ctx.peerStates[peerId];if(!state2||!state2.offerPeer||state2.offerAnswered||offerId&&state2.offerId&&offerId!==state2.offerId||state2.offerPeer.isDead)return;state2.offerAnswered=!0;scheduleOfferExpiry(ctx,state2,peerId,23333);state2.offerPeer.signal(plainAnswer)}};prunePendingOffer=(ctx,peerId,relayId)=>{const state2=ctx.peerStates[peerId];state2&&!state2.connectedPeer&&state2.offerRelays[relayId]&&clearOfferRelay(state2,relayId)};createSignalHandler=ctx=>relayId=>async(topic,msg,signalPeer)=>{var _a8;if(ctx.isLeaving())return;const payload="string"==typeof msg?fromJson(msg):msg,peerId="string"==typeof payload.peerId?payload.peerId:"",offer=payload.offer,answer=payload.answer,candidate=payload.candidate,offerId=payload.offerId,peer=payload.peer,hasOutgoingOfferHint=!0===payload.hasOutgoingOffer;if(peerId===selfId)return;const state2=ctx.peerStates[peerId],connectedPeer=null==state2?void 0:state2.connectedPeer;if(connectedPeer&&state2){const health=getConnectedPeerHealth(connectedPeer);if("live"===health){state2.connectedPeerUnhealthySinceMs=null;return}if("stale"===health)clearConnectedPeer(state2);else{const nowMs=Date.now(),unhealthySinceMs=null!=(_a8=state2.connectedPeerUnhealthySinceMs)?_a8:nowMs;state2.connectedPeerUnhealthySinceMs=unhealthySinceMs;if(nowMs-unhealthySinceMs<7533)return;clearConnectedPeer(state2)}}let shared=ctx.sharedPeers.get(ctx.appId,peerId);if(shared&&"stale"===ctx.sharedPeers.getHealth(shared.peer)){ctx.sharedPeers.clear(ctx.appId,peerId,{destroyPeer:!0});shared=void 0}const isAnnouncement=Boolean(peerId&&!offer&&!answer&&!candidate);if(isAnnouncement&&!shared){const announcePeerState=getState(ctx.peerStates,peerId),shouldLeadOffer=selfId{const occupiedRooms={},roomRegistrations={},roomIdsByToken={},roomPresenceHandlerCleanups={},sharedPeers=new SharedPeerManager,hasActiveRooms=()=>values(occupiedRooms).some(rooms=>keys(rooms).length>0),getRoomRegistrations=appId=>{var _a8;return null!=(_a8=roomRegistrations[appId])?_a8:roomRegistrations[appId]={}},getRoomIdsByToken=appId=>{var _a8;return null!=(_a8=roomIdsByToken[appId])?_a8:roomIdsByToken[appId]={}},advertiseRoomPresence=(shared,roomToken,isPresent)=>{"live"===sharedPeers.getHealth(shared.peer)&&sharedPeers.sendRoomPresence(shared,roomToken,isPresent)},advertiseKnownRoomsToShared=(appId,shared)=>{var _a8;entries(null!=(_a8=roomRegistrations[appId])?_a8:{}).forEach(([roomId,registration])=>{const{roomToken,roomTokenPromise}=registration;roomToken?advertiseRoomPresence(shared,roomToken,!0):roomTokenPromise.then(token=>{var _a9;(null==(_a9=roomRegistrations[appId])?void 0:_a9[roomId])===registration&®istration.roomToken===token&&(sharedPeers.get(appId,shared.peerId)!==shared||shared.isClosing||advertiseRoomPresence(shared,token,!0))})})},advertiseRoomPresenceToAll=(appId,roomToken,isPresent)=>values(sharedPeers.getMap(appId)).forEach(shared=>advertiseRoomPresence(shared,roomToken,isPresent)),ensureRoomPresenceHandler=appId=>{roomPresenceHandlerCleanups[appId]||(roomPresenceHandlerCleanups[appId]=sharedPeers.setRoomPresenceHandler(appId,(peerId,roomToken,isPresent)=>{var _a8,_b5,_c3;if(!isPresent)return;const shared=sharedPeers.get(appId,peerId),roomId=null==(_a8=roomIdsByToken[appId])?void 0:_a8[roomToken];shared&&roomId&&(null==(_c3=null==(_b5=roomRegistrations[appId])?void 0:_b5[roomId])||_c3.attachSharedPeerToRoom(peerId,shared))}))},cleanupRoomPresenceHandler=appId=>{var _a8;if(!(occupiedRooms[appId]&&keys(occupiedRooms[appId]).length>0)){null==(_a8=roomPresenceHandlerCleanups[appId])||_a8.call(roomPresenceHandlerCleanups);delete roomPresenceHandlerCleanups[appId];delete roomRegistrations[appId];delete roomIdsByToken[appId]}};let didInit=!1,initPromises=[],offerPool=null,cleanupWatchOnline=noOp;return(config,roomId,callbacks)=>{var _a8,_b5,_c3,_d2;if(!config)throw mkErr("requires a config map as the first argument");if(callbacks&&"object"!=typeof callbacks)throw mkErr("third argument must be a callbacks object");const{appId}=config,onJoinError=null==callbacks?void 0:callbacks.onJoinError,onPeerHandshake=null==callbacks?void 0:callbacks.onPeerHandshake,handshakeTimeoutMs=null==callbacks?void 0:callbacks.handshakeTimeoutMs;if(!appId)throw mkErr("config map is missing appId field");if(!roomId)throw mkErr("roomId argument required");if(void 0!==handshakeTimeoutMs&&(!Number.isFinite(handshakeTimeoutMs)||handshakeTimeoutMs<=0))throw mkErr("handshakeTimeoutMs must be a positive number");if(null==(_a8=occupiedRooms[appId])?void 0:_a8[roomId])return occupiedRooms[appId][roomId];ensureRoomPresenceHandler(appId);const rootTopicPlaintext=topicPath(libName,appId,roomId),rootTopicP=sha1(rootTopicPlaintext),selfTopicP=sha1(topicPath(rootTopicPlaintext,selfId)),key3=genKey(null!=(_b5=config.password)?_b5:"",appId,roomId),roomNamespacePromise=deriveRoomNamespace(appId,roomId),sharedPeerIdleMs=null!=(_c3=config._test_only_sharedPeerIdleMs)?_c3:123333;let didLeaveRoom=!1;const withKey=f4=>async signal=>({type:signal.type,sdp:await f4(key3,signal.sdp)}),toPlain=withKey(decrypt),toCipher=withKey(encrypt),sharedPeerMap=sharedPeers.getMap(appId);offerPool||(offerPool=new OfferPool(()=>peer_default(!0,config)));const pool2=offerPool,encryptOffer=async peer=>{const plainOffer=await peer.getOffer(Date.now()-peer.created>57333);if(!plainOffer||"offer"!==plainOffer.type)throw mkErr("failed to get offer for peer");return(await toCipher(plainOffer)).sdp},attachSharedPeerToRoom=(peerId,shared)=>{const state2=getState(ctx.peerStates,peerId);state2.answeringExpiryTimer=resetTimer(state2.answeringExpiryTimer);state2.answeringPeer=null;const{proxy:proxy2,isNew}=sharedPeers.bind(roomId,roomNamespacePromise,shared,{onDetach:()=>{const current=ctx.peerStates[peerId];if((null==current?void 0:current.connectedPeer)===shared.peer){current.connectedPeer=null;current.connectedPeerUnhealthySinceMs=null;updateStatus(current)}}});state2.connectedPeer=shared.peer;state2.connectedPeerUnhealthySinceMs=null;updateStatus(state2);isNew&&onPeerConnect(proxy2,peerId);resetOfferState(state2,pool2)},ctx={appId,roomId,config,peerStates:{},rootTopicPlaintext,rootTopicP,selfTopicP,toPlain,toCipher,isLeaving:()=>didLeaveRoom,onJoinError,sharedPeers,offerPool:pool2,encryptOffer,initPeer:peer_default,connectPeer:(peer,peerId,_relayId)=>{if(didLeaveRoom){peer.destroy();return}const state2=getState(ctx.peerStates,peerId);if(state2.connectedPeer){const shared2=sharedPeerMap[peerId];if(shared2&&state2.connectedPeer===shared2.peer&&shared2.bindings[roomId])return;state2.connectedPeer===peer||peer.isDead||peer.destroy();return}let shared=sharedPeerMap[peerId];if(shared&&"stale"===sharedPeers.getHealth(shared.peer)){sharedPeers.clear(appId,peerId,{destroyPeer:!0});shared=void 0}if(shared&&shared.peer!==peer){peer.isDead||peer.destroy();attachSharedPeerToRoom(peerId,shared);return}const isNewShared=!shared;shared||(shared=sharedPeers.register(appId,peerId,peer,sharedPeerIdleMs));attachSharedPeerToRoom(peerId,shared);isNewShared&&advertiseKnownRoomsToShared(appId,shared)},disconnectPeer:(peer,peerId)=>{if(didLeaveRoom)return;const state2=ctx.peerStates[peerId];(null==state2?void 0:state2.connectedPeer)===peer&&clearConnectedPeer(state2)},attachSharedPeerToRoom,announceIntervals:[],announceIntervalMs:5333},handleMessage=createSignalHandler(ctx);if(!didInit){const initRes=init3(config);pool2.warmup();initPromises=(Array.isArray(initRes)?initRes:[initRes]).map(value=>Promise.resolve(value));didInit=!0;cleanupWatchOnline=config.manualRelayReconnection?noOp:watchOnline()}ctx.announceIntervals=initPromises.map(()=>5333);const announceAttemptCounts=initPromises.map(()=>0),announceTimeouts=[],unsubFns=initPromises.map(async(relayP,i2)=>subscribe2(await relayP,await rootTopicP,await selfTopicP,handleMessage(i2),n3=>pool2.getOffers(n3,encryptOffer)));all([rootTopicP,selfTopicP]).then(([rootTopic,selfTopic])=>{if(didLeaveRoom)return;const queueAnnounce=async(relay,i2)=>{var _a9,_b6;if(didLeaveRoom)return;const ms=await announce(relay,rootTopic,selfTopic);if(didLeaveRoom)return;"number"==typeof ms&&(ctx.announceIntervals[i2]=ms);const announceAttempt=null!=(_a9=announceAttemptCounts[i2])?_a9:0;announceAttemptCounts[i2]=announceAttempt+1;const currentInterval=null!=(_b6=ctx.announceIntervals[i2])?_b6:5333,warmupDelay=announceWarmupIntervalsMs[announceAttempt],nextAnnounceDelayMs="number"==typeof warmupDelay?Math.min(currentInterval,warmupDelay):currentInterval;announceTimeouts[i2]=setTimeout(()=>{queueAnnounce(relay,i2)},nextAnnounceDelayMs)};unsubFns.forEach(async(didSub,i2)=>{await didSub;if(didLeaveRoom)return;const relay=await initPromises[i2];relay&&!didLeaveRoom&&queueAnnounce(relay,i2)})});let onPeerConnect=noOp;const{compose}=createPasswordHandshake(null!=(_d2=config.password)?_d2:"",appId,roomId),composedPeerHandshake=compose(onPeerHandshake),roomOptions={...composedPeerHandshake?{onPeerHandshake:composedPeerHandshake}:{},...void 0===handshakeTimeoutMs?{}:{handshakeTimeoutMs},onHandshakeError:(peerId,error)=>null==onJoinError?void 0:onJoinError({error:error.replace(/^handshake failed: /,""),appId,peerId,roomId})};null!=occupiedRooms[appId]||(occupiedRooms[appId]={});const appRoomRegistrations=getRoomRegistrations(appId),joinedRoom=room_default(f4=>onPeerConnect=f4,id=>{if(didLeaveRoom)return;const state2=ctx.peerStates[id];if(null==state2?void 0:state2.connectedPeer){state2.connectedPeer=null;updateStatus(state2)}},()=>{var _a9,_b6;didLeaveRoom=!0;onPeerConnect=noOp;const registration=null==(_a9=roomRegistrations[appId])?void 0:_a9[roomId];if(null==registration?void 0:registration.roomToken){advertiseRoomPresenceToAll(appId,registration.roomToken,!1);null==(_b6=roomIdsByToken[appId])||delete _b6[registration.roomToken];roomIdsByToken[appId]&&!keys(roomIdsByToken[appId]).length&&delete roomIdsByToken[appId]}if(roomRegistrations[appId]){delete roomRegistrations[appId][roomId];keys(roomRegistrations[appId]).length||delete roomRegistrations[appId]}entries(ctx.peerStates).forEach(([peerId,state2])=>{state2.answeringExpiryTimer=resetTimer(state2.answeringExpiryTimer);if(state2.connectedPeer&&!state2.connectedPeer.isDead){const shared=sharedPeerMap[peerId];shared&&shared.peer===state2.connectedPeer||state2.connectedPeer.destroy()}state2.answeringPeer&&!state2.answeringPeer.isDead&&state2.answeringPeer.destroy();resetOfferState(state2,pool2);state2.connectedPeer=null;state2.answeringPeer=null;updateStatus(state2)});if(occupiedRooms[appId]){delete occupiedRooms[appId][roomId];0===keys(occupiedRooms[appId]).length&&delete occupiedRooms[appId]}announceTimeouts.forEach(resetTimer);unsubFns.forEach(async f4=>{(await f4)()});if(!hasActiveRooms()){didInit=!1;pool2.destroy();offerPool=null;cleanupWatchOnline();cleanupRoomPresenceHandler(appId)}},roomOptions),roomRegistration={roomToken:null,roomTokenPromise:roomNamespacePromise,attachSharedPeerToRoom};appRoomRegistrations[roomId]=roomRegistration;roomNamespacePromise.then(roomToken=>{var _a9;if(!didLeaveRoom&&(null==(_a9=roomRegistrations[appId])?void 0:_a9[roomId])===roomRegistration){roomRegistration.roomToken=roomToken;getRoomIdsByToken(appId)[roomToken]=roomId;values(sharedPeerMap).forEach(shared=>{shared.remoteRoomTokens.has(roomToken)&&attachSharedPeerToRoom(shared.peerId,shared)});advertiseRoomPresenceToAll(appId,roomToken,!0)}});return occupiedRooms[appId][roomId]=joinedRoom}};relayManager=createRelayManager(client=>client.socket);var{secretKey,publicKey}=schnorr.keygen();pubkey=toHex(publicKey);subIdToTopic={};msgHandlers={};kindCache={};now2=()=>Math.floor(Date.now()/1e3);topicToKind=topic=>{var _a8;return null!=(_a8=kindCache[topic])?_a8:kindCache[topic]=strToNum(topic,1e4)+2e4};createEvent=async(topic,content)=>{const payload={kind:topicToKind(topic),tags:[["x",topic]],created_at:now2(),content,pubkey},id=await hashWith("SHA-256",toJson([0,payload.pubkey,payload.created_at,payload.kind,payload.tags,payload.content]));return toJson(["EVENT",{...payload,id:toHex(id),sig:toHex(await schnorr.signAsync(id,secretKey))}])};subscribe=(subId,topic)=>{subIdToTopic[subId]=topic;return toJson(["REQ",subId,{kinds:[topicToKind(topic)],since:now2(),["#x"]:[topic]}])};unsubscribe=subId=>{delete subIdToTopic[subId];return toJson(["CLOSE",subId])};joinRoom=strategy_default({init:config=>getRelays(config,defaultRelayUrls,5,!0).map(url=>{const client=relayManager.register(url,makeSocket(url,data=>{var _a8,_b5;const[msgType,subId,payload,relayMsg]=fromJson(data);if("EVENT"!==msgType){const prefix=`${libName}: relay failure from ${client.url} - `;"NOTICE"===msgType?console.warn(prefix+subId):"OK"!==msgType||payload||console.warn(prefix+relayMsg);return}payload&&"object"==typeof payload&&"content"in payload&&(null==(_b5=msgHandlers[subId])||_b5.call(msgHandlers,null!=(_a8=subIdToTopic[subId])?_a8:"",String(payload.content)))}));return client.ready}),subscribe:(client,rootTopic,selfTopic,onMessage)=>{const rootSubId=genId(64),selfSubId=genId(64);msgHandlers[rootSubId]=msgHandlers[selfSubId]=(topic,data)=>{onMessage(topic,data,async(peerTopic,signal)=>{client.send(await createEvent(peerTopic,signal))})};client.send(subscribe(rootSubId,rootTopic));client.send(subscribe(selfSubId,selfTopic));return()=>{client.send(unsubscribe(rootSubId));client.send(unsubscribe(selfSubId));delete msgHandlers[rootSubId];delete msgHandlers[selfSubId]}},announce:async(client,rootTopic)=>client.send(await createEvent(rootTopic,toJson({peerId:selfId})))});getRelaySockets=relayManager.getSockets;defaultRelayUrls=["aaa-api.freefrom.space/v1/ws","antiprimal.net/hot","api.freefrom.space/v1/ws","bagus.my/nostrrelay/0","basspistol.org","bcast.seutoba.com.br","bucket.coracle.social","chorus.almostmachines.dev","chorus.pjv.me","communities.nos.social","freelay.sovbit.host","ftp.halifax.rwth-aachen.de/nostr","hol.is","hornetstorage.net/relay","inbox.mycelium.social","inner.sebastix.social","kanagrovv-pyramid.kozow.com","khatru.nostrver.se","koru.bitcointxoko.org","librerelay.aaroniumii.com","nos.lol","nostr-01.uid.ovh","nostr-01.yakihonne.com","nostr-03.dorafactory.org","nostr-relay.corb.net","nostr.data.haus","nostr.islandarea.net","nostr.klabo.world","nostr.l484.com","nostr.red5d.dev","nostr.robosats.org","nostr.sathoarder.com","nostr.self-determined.de","nostr.tac.lol","nostr.tegila.com.br","nostr.vulpem.com","nostrue.com","orly.musiquay.org","payments.u4er.net/nostr","purplerelay.com","relay-can.zombi.cloudrodion.com","relay-rpi.edufeed.org","relay.agorist.space","relay.angor.io","relay.artio.inf.unibe.ch","relay.binaryrobot.com","relay.bitcoindistrict.org","relay.damus.io","relay.degmods.com","relay.fountain.fm","relay.froth.zone","relay.guggero.org","relay.kcbitcoiners.com","relay.libernet.app","relay.lnau.net","relay.lumina.rocks","relay.mostr.pub","relay.mostro.network","relay.nosto.re","relay.nostr.place","relay.nostrdice.com","relay.notoshi.win","relay.nuts.cash","relay.orangepill.ovh","relay.satlantis.io","relay.sigit.io","relay.toastr.net","relay02.lnfi.network","relay2.angor.io","santo.iguanatech.net","schnorr.me","slick.mjex.me","social.amanah.eblessing.co","staging.yabu.me","strfry.openhoofd.nl","strfry.shock.network","talon.quest","testing.gathr.gives","testnet-relay.samt.st","top.testrelay.top","x.kojira.io","yabu.me/v2"].map(url=>"wss://"+url);ResponsePreventedError=class extends Error{constructor(message){super(`Response prevented: ${message}`)}};DeviceDecisions=(DeviceDecisions2=>{DeviceDecisions2.ACCEPT="accepted";DeviceDecisions2.REJECT="rejected";DeviceDecisions2.IGNORE="ignore";return DeviceDecisions2})(DeviceDecisions||{});StoredMapLike=class{constructor(store,prefix=""){this._cache=new Map;this._prefix="";this._store=store}addPrefix(key3){return`${this._prefix}-${key3}`}async get(key3){if(this._cache.has(key3))return this._cache.get(key3);const value=await this._store.get(this.addPrefix(key3));void 0!==value&&this._cache.set(key3,value);return value}async set(key3,value){try{const ret=await this._store.set(this.addPrefix(key3),value);this._cache.set(key3,value);return ret}catch(e3){this._cache.delete(key3);throw e3}}async delete(key3){try{const ret=await this._store.delete(this.addPrefix(key3));this._cache.delete(key3);return ret}catch(e3){this._cache.delete(key3);throw e3}}async has(key3){return!!this._cache.has(key3)||(await this._store.keys(this.addPrefix(key3),key3)).length>0}};TrysteroReplicatorP2PClient=class{constructor(server,connectedPeerId){this._prevSeq=0;this.waitingInvocations=new Map;this.invocationTimeouts=new Map;this._server=server;this._connectedPeerId=connectedPeerId;this._remoteDB=this._bindRemoteDB()}get remoteDB(){return this._remoteDB}_bindRemoteDB(){return{info:this.bindRemoteFunction("info"),changes:this.bindRemoteFunction("changes"),revsDiff:this.bindRemoteFunction("revsDiff"),bulkDocs:this.bindRemoteFunction("bulkDocs"),bulkGet:this.bindRemoteFunction("bulkGet",4e4),put:this.bindRemoteFunction("put"),get:this.bindRemoteFunction("get")}}get __send(){var _a8;return null==(_a8=this._server)?void 0:_a8.__send.bind(this._server)}generateNewSeq(){const seq=Math.floor(115*Math.random())+1+this._prevSeq;if(!this.waitingInvocations.has(seq)){this._prevSeq=seq%~~(Number.MAX_SAFE_INTEGER/2);return seq}return this.generateNewSeq()}_sendRPC(type,args,timeout=3e4){if(!this.__send)throw new Error("Not connected to any room");const seq=this.generateNewSeq(),p2=promiseWithResolver();this.waitingInvocations.set(seq,p2);const request2={type,direction:"request",seq,args};timeout&&timeout>0&&this.invocationTimeouts.set(seq,setTimeout(()=>{if(this.waitingInvocations.has(seq)){this.waitingInvocations.delete(seq);p2.reject(new Error(`Invocation Timed out: ${type} (${seq}) (Timeout: ${timeout}ms)`))}this.invocationTimeouts.delete(seq)},timeout));this.__send(request2,this._connectedPeerId);return p2.promise}__onResponse(data){const seq=data.seq,type=data.type;if(this.invocationTimeouts.has(seq)){clearTimeout(this.invocationTimeouts.get(seq));this.invocationTimeouts.delete(seq)}const p2=this.waitingInvocations.get(seq);if(p2){this.waitingInvocations.delete(seq);if(data.error){p2.reject(data.error);Logger(`Invoking remote function [ DONE] : ${type} (${seq}) : (Error)`,LOG_LEVEL_VERBOSE)}else p2.resolve(data.data)}else Logger(`Invoking remote function [ERROR] : ${type} (${seq}) : No Handler left. Possibly timed out`,LOG_LEVEL_VERBOSE)}bindRemoteFunction(type,timeout=3e4){return async(...args)=>{if(!this.__send)throw new Error("Not connected to any room");return await this._sendRPC(type,args,timeout)}}async invokeRemoteFunction(type,args,timeout=3e4){if(!this.__send)throw new Error("Not connected to any room");return await this._sendRPC(type,args,timeout)}bindRemoteObjectFunctions(key3,timeout=3e4){return async(...args)=>{if(!this.__send)throw new Error("Not connected to any room");return await this._sendRPC(`${key3.toString()}`,args,timeout)}}async invokeRemoteObjectFunction(key3,args,timeout=3e4){if(!this.__send)throw new Error("Not connected to any room");return await this._sendRPC(`${key3.toString()}`,args,timeout)}close(){this._remoteDB=void 0;this._server=void 0}};epochFNV1a=2166136261;c1=3432918353;c2=461845907;r1=15;r2=13;m=5;n=3864292196;new TextEncoder;Computed=class{constructor(params){Object.defineProperty(this,"_previousArgs",{enumerable:!0,configurable:!0,writable:!0,value:null});Object.defineProperty(this,"_previousResult",{enumerable:!0,configurable:!0,writable:!0,value:null});Object.defineProperty(this,"_evaluation",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_isEqual",{enumerable:!0,configurable:!0,writable:!0,value:(a2,b3)=>this._areArgsEqual(a2,b3)});Object.defineProperty(this,"_shouldForceUpdate",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_updating",{enumerable:!0,configurable:!0,writable:!0,value:Promise.resolve()});this._evaluation=params.evaluation;this._shouldForceUpdate=params.requiresUpdate||(()=>!1);params.isEqual&&(this._isEqual=params.isEqual)}updateValue(...args){return new Promise((resolve,reject)=>{this._updating=this._updating.then(async()=>{try{if(!await this._shouldForceUpdate(args,this._previousArgs,this._previousResult)&&this._previousArgs&&this._isEqual(args,this._previousArgs))return resolve(!1);try{this._previousResult=await this._evaluation(...args)}catch(error){const err3=error instanceof Error?error:new Error(String(error));this._previousResult=err3}finally{this._previousArgs=args}return resolve(!0)}catch(error){return reject(error)}})})}reset(){this._previousArgs=null;this._previousResult=null}async update(...args){await this.updateValue(...args);return this}get value(){if(this._previousResult instanceof Error)throw this._previousResult;return this._previousResult}_areArgsEqual(args1,args2){return JSON.stringify(args1)===JSON.stringify(args2)}};EVENT_SERVER_STATUS="p2p-server-status";EVENT_ADVERTISEMENT_RECEIVED="p2p-advertisement-received";EVENT_DEVICE_LEAVED="p2p-device-leaved";EVENT_REQUEST_STATUS="p2p-request-status";EVENT_P2P_REPLICATOR_STATUS="p2p-replicator-status";TrysteroReplicatorP2PServer=class{constructor(env,_serverPeerId=selfId){this.assignedFunctions=new Map;this.clients=new Map;this._bindingObjects=[];this._knownAdvertisements=new Map;this.temporaryAcceptedPeers=new Map;this._acceptablePeers=new Computed({evaluation:settings=>{var _a8;return`${null!=(_a8=null==settings?void 0:settings.P2P_AutoAcceptingPeers)?_a8:""}`.split(",").map(e3=>e3.trim()).filter(e3=>!!e3).map(e3=>e3.startsWith("~")?new RegExp(e3.substring(1),"i"):new RegExp(`^${e3}$`,"i"))}});this._shouldDenyPeers=new Computed({evaluation:settings=>{var _a8;return`${null!=(_a8=null==settings?void 0:settings.P2P_AutoDenyingPeers)?_a8:""}`.split(",").map(e3=>e3.trim()).filter(e3=>!!e3).map(e3=>e3.startsWith("~")?new RegExp(e3.substring(1),"i"):new RegExp(`^${e3}$`,"i"))}});this.activePeer=new Map;this._env=env;this._serverPeerId=_serverPeerId;eventHub.onEvent(EVENT_PLATFORM_UNLOADED,()=>{this.shutdown()});this.acceptedPeers=new StoredMapLike(this._env.simpleStore,"p2p-device-decisions")}get isDisposed(){return!this._room}get isServing(){return void 0!==this._room}async ensureLeaved(){var _a8;if(this._room){try{await(null==(_a8=this._room)?void 0:_a8.leave())}catch(ex){Logger("Some error has been occurred while leaving the room, but possibly can be ignored",LOG_LEVEL_VERBOSE);Logger(ex,LOG_LEVEL_VERBOSE)}this._room=void 0;eventHub.emitEvent("p2p-disconnected")}}async setRoom(room){var _a8;await(null==(_a8=this._room)?void 0:_a8.leave());this._room=room}async shutdown(){try{await this.close();await this.ensureLeaved()}catch(ex){Logger("Some error has been occurred while shutting down the server",LOG_LEVEL_INFO);Logger(ex,LOG_LEVEL_VERBOSE)}}async dispatchConnectionStatus(){const adsTasks=[...this.knownAdvertisements].map(async e3=>{const isAccepted2=await this.acceptedPeers.get(e3.name),isTemporaryAccepted=this.temporaryAcceptedPeers.get(e3.peerId);return{...e3,isAccepted:isAccepted2,isTemporaryAccepted}}),ads=await Promise.all(adsTasks);eventHub.emitEvent(EVENT_SERVER_STATUS,{isConnected:this.isServing,knownAdvertisements:ads,serverPeerId:this.serverPeerId})}async makeDecision(decision){decision.decision?decision.isTemporary?this.temporaryAcceptedPeers.set(decision.peerId,!0):await this.acceptedPeers.set(decision.name,!0):decision.isTemporary?this.temporaryAcceptedPeers.set(decision.peerId,!1):await this.acceptedPeers.set(decision.name,!1);await this.dispatchConnectionStatus()}async revokeDecision(decision){this.temporaryAcceptedPeers.delete(decision.peerId);await this.acceptedPeers.delete(decision.name);await this.dispatchConnectionStatus()}get room(){return this._room}get serverPeerId(){return this._serverPeerId}get db(){return this._env.db}get confirm(){return this._env.confirm}get settings(){return this._env.settings}get isEnabled(){return this.settings.P2P_Enabled}get deviceInfo(){return{currentPeerId:this._serverPeerId,name:this._env.deviceName,platform:this._env.platform,version:"0.0.0"}}sendAdvertisement(peerId){if(!this.isEnabled)return;const devInfo=this.deviceInfo,data={peerId:devInfo.currentPeerId,name:devInfo.name,platform:devInfo.platform};if(this._sendAdvertisement){Logger(`peerId: ${this.serverPeerId} Sending Advertisement to ${null!=peerId?peerId:"All"}`,LOG_LEVEL_VERBOSE);this._sendAdvertisement(data,peerId)}}get knownAdvertisements(){return[...this._knownAdvertisements.values()]}onAdvertisement(data,peerId){if(this.isEnabled){Logger(`Advertisement from ${peerId}`,LOG_LEVEL_VERBOSE);if(peerId!==this.serverPeerId&&data.peerId!==this.serverPeerId&&data.name!==this.deviceInfo.name&&data.peerId===peerId){this._knownAdvertisements.set(peerId,data);this.dispatchConnectionStatus();eventHub.emitEvent(EVENT_ADVERTISEMENT_RECEIVED,data)}}}confirmUserToAccept(peerId){return shareRunningResult(`confirmUserToAccept-${peerId}`,()=>this._confirmUserToAccept(peerId))}_confirmUserToAccept(peerId){const peerInfo=this._knownAdvertisements.get(peerId);if(!peerInfo)throw new Error("Unknown Peer");const peerName=peerInfo.name,message=`Are you sure to establish connection to ${peerName} (${peerId})?\nYou can chose as follows:\n- Accept: Accept all connections from this peer.\n- Ignore: Reject all connections from this peer.\n- Accept Temporarily: Accept the connection for this session only.\n- Ignore Temporarily: Reject the connection for this session only.\n\n>[!INFO] You can revoke your decision from the Peer-to-Peer Replicator Pane.`;return this.confirm.askSelectStringDialogue(message,["Accept","Ignore","Accept Temporarily","Ignore Temporarily"],{title:"P2P Connection Request",defaultAction:"Ignore Temporarily",timeout:30}).then(decision=>{if("Accept Temporarily"===decision){this.temporaryAcceptedPeers.set(peerId,!0);this.dispatchConnectionStatus();return!0}if("Ignore Temporarily"===decision){this.temporaryAcceptedPeers.set(peerId,!1);this.dispatchConnectionStatus();return!1}if("Accept"===decision){this.temporaryAcceptedPeers.delete(peerId);this.acceptedPeers.set(peerName,!0);this.dispatchConnectionStatus();return!0}if("Ignore"===decision){this.temporaryAcceptedPeers.delete(peerId);this.acceptedPeers.set(peerName,!1);this.dispatchConnectionStatus();return!1}throw new ResponsePreventedError("User Accepting failed")})}async isAcceptablePeer(peerId){if(!this.isEnabled)return;const peerInfo=this._knownAdvertisements.get(peerId);if(!peerInfo)return!1;const peerName=peerInfo.name;if(this.temporaryAcceptedPeers.has(peerId))return this.temporaryAcceptedPeers.get(peerId);const accepted=await this.acceptedPeers.get(peerName);if(null!=accepted)return accepted;const isAcceptable=(await this._acceptablePeers.update(this.settings)).value.some(e3=>e3.test(peerName)),isDeny=(await this._shouldDenyPeers.update(this.settings)).value.some(e3=>e3.test(peerName));if(isAcceptable){if(isDeny)return!1;this.temporaryAcceptedPeers.set(peerId,!0);this.dispatchConnectionStatus();return!0}return!this.settings.P2P_IsHeadless&&await this.confirmUserToAccept(peerId)}async __send(data,peerId){if(this.isEnabled)if(await this.isAcceptablePeer(peerId)){if(this.___send)return await this.___send(data,peerId);Logger("Cannot send response, no send function")}else{Logger(`Invalid Message to ${peerId}`,LOG_LEVEL_VERBOSE);Logger(data,LOG_LEVEL_VERBOSE)}}async processArrivedRPC(data,peerId){if(this.isEnabled){if(!data.type.startsWith("!")&&!await this.isAcceptablePeer(peerId))throw new Error(`Not acceptable peer ${peerId}`);if("response"===data.direction)this.__onResponse(data,peerId);else{if("request"!==data.direction)throw new Error(`Invalid Message from ${peerId}`);await this.__onRequest(data,peerId)}}}onAfterJoinRoom(){Logger("Initializing...",LOG_LEVEL_VERBOSE);const room=this.room;if(!room)throw new Error("This server has been already disconnected");const[send,arrived]=room.makeAction("rpc");this.___send=send;arrived((data,peerId)=>{this.processArrivedRPC(data,peerId).catch(e3=>{Logger(e3.message,LOG_LEVEL_INFO);Logger(e3,LOG_LEVEL_VERBOSE)})});const[adSend,adArrived]=room.makeAction("ad");this._sendAdvertisement=adSend;adArrived((data,peerId)=>{this.onAdvertisement(data,peerId)});room.onPeerJoin(peerId=>{const peer=room.getPeers()[peerId];this.activePeer.set(peerId,peer);this.sendAdvertisement(peerId)});room.onPeerLeave(peerId=>{this._knownAdvertisements.delete(peerId);const peerConn=this.activePeer.get(peerId);if(peerConn){peerConn.close();this.activePeer.delete(peerId)}eventHub.emitEvent(EVENT_DEVICE_LEAVED,peerId);this.dispatchConnectionStatus()});eventHub.emitEvent("p2p-connected");this.dispatchConnectionStatus()}async startService(bindings=[]){if(!this.isEnabled){Logger($msg("P2P.NotEnabled"),LOG_LEVEL_NOTICE);return}const servingDB=createHostingDB(this._env);this._bindingObjects=[...bindings,servingDB];this._bindingObjects.forEach(b3=>{this.serveObject(b3)});await this.sendAdvertisement()}async start(bindings=[]){const passphraseNumbers=mixedHash(this.settings.P2P_passphrase,0),passphrase=passphraseNumbers[0].toString(36)+passphraseNumbers[1].toString(36);await this.shutdown();if(!this.settings.P2P_Enabled){Logger($msg("P2P.NotEnabled"),LOG_LEVEL_NOTICE);return}const relays=this.settings.P2P_relays.split(",").filter(e3=>e3.trim().length>0),turnServers=this.settings.P2P_turnServers.split(",").map(e3=>e3.trim()).filter(e3=>e3.length>0),rtcPolyfill=globalThis.RTCPeerConnection,options={relayUrls:relays,appId:this.settings.P2P_AppID,password:passphrase,manualRelayReconnection:!0,..."function"==typeof rtcPolyfill?{rtcPolyfill}:{},turnConfig:turnServers.length>0?[{urls:turnServers,username:this.settings.P2P_turnUsername,credential:this.settings.P2P_turnCredential}]:[]},room=joinRoom(options,this.settings.P2P_roomID);await this.setRoom(room);this.onAfterJoinRoom();this.dispatchConnectionStatus();await this.startService(bindings)}serveFunction(type,func){this.assignedFunctions.set(type,func)}serveObject(obj){Object.keys(obj).forEach(key3=>{if(key3.toString().startsWith("_"))return;const func=obj[key3].bind(obj);this.assignedFunctions.set(key3.toString(),func)})}__onResponse(data,peerId){const peer=this.clients.get(peerId);peer?peer.__onResponse(data):Logger(`Response from unknown peer ${peerId}`,LOG_LEVEL_VERBOSE)}async __onRequest(data,peerId){try{const func=this.assignedFunctions.get(data.type);if("function"!=typeof func)throw new Error(`Cannot serve function ${data.type}, no function provided or I am only a client`);const r4=await Promise.resolve(func.apply(this,data.args));await this.__send({type:data.type,seq:data.seq,direction:"response",data:r4},peerId)}catch(e3){if(e3 instanceof ResponsePreventedError){Logger(`Serving function: [FAILED] ${data.type}: Response prevented.`,LOG_LEVEL_VERBOSE);return}Logger(`Serving function: [FAILED] ${data.type} sending back the failure information`,LOG_LEVEL_VERBOSE);Logger(e3 instanceof Error?e3.message:e3,LOG_LEVEL_VERBOSE);await this.__send({type:data.type,seq:data.seq,direction:"response",data:void 0,error:e3},peerId)}}async close(){var _a8,_b5;this.assignedFunctions.clear();const peers=null!=(_b5=null==(_a8=this.room)?void 0:_a8.getPeers())?_b5:{};this.clients.forEach(client=>client.close());this.clients.clear();for(const[,peer]of Object.entries(peers))peer.close();await this.ensureLeaved();this._knownAdvertisements.clear();await this.dispatchConnectionStatus()}getConnection(peerId){if(this.clients.has(peerId))return this.clients.get(peerId);if(!this._knownAdvertisements.has(peerId))throw new Error(`Unknown Peer ${peerId}`);const client=new TrysteroReplicatorP2PClient(this,peerId);this.clients.set(peerId,client);return client}};P2PLogCollector=class{constructor(){this.p2pReplicationResult=new Map;this.p2pReplicationLine=reactiveSource("");eventHub.onEvent(EVENT_ADVERTISEMENT_RECEIVED,data=>{this.p2pReplicationResult.set(data.peerId,{peerId:data.peerId,peerName:data.name,fetching:{current:0,max:0,isActive:!1},sending:{current:0,max:0,isActive:!1}});this.updateP2PReplicationLine()});eventHub.onEvent("p2p-connected",()=>{this.p2pReplicationResult.clear();this.updateP2PReplicationLine()});eventHub.onEvent("p2p-disconnected",()=>{this.p2pReplicationResult.clear();this.updateP2PReplicationLine()});eventHub.onEvent(EVENT_DEVICE_LEAVED,peerId=>{this.p2pReplicationResult.delete(peerId);this.updateP2PReplicationLine()});eventHub.onEvent("p2p-replicator-progress",data=>{const prev=this.p2pReplicationResult.get(data.peerId)||{peerId:data.peerId,peerName:data.peerName,fetching:{current:0,max:0,isActive:!1},sending:{current:0,max:0,isActive:!1}};"fetching"in data&&(data.fetching.isActive?prev.fetching=data.fetching:prev.fetching.isActive=!1);"sending"in data&&(data.sending.isActive?prev.sending=data.sending:prev.sending.isActive=!1);this.p2pReplicationResult.set(data.peerId,prev);this.updateP2PReplicationLine()})}updateP2PReplicationLine(){const p2pReplicationResultX=[...this.p2pReplicationResult.values()].sort((a2,b3)=>a2.peerId.localeCompare(b3.peerId)),renderProgress=(current,max3)=>current==max3?`${current}`:`${current} (${max3})`,line=p2pReplicationResultX.map(e3=>`${e3.fetching.isActive||e3.sending.isActive?"⚡":"💤"} ${e3.peerName} ↑ ${renderProgress(e3.sending.current,e3.sending.max)} ↓ ${renderProgress(e3.fetching.current,e3.fetching.max)} `).join("\n");this.p2pReplicationLine.value=line}};LiveSyncError=class _LiveSyncError extends Error{constructor(message,options){super(message);this.name=this.constructor.name;(null==options?void 0:options.cause)&&(this.cause=options.cause instanceof Error?options.cause:new Error(`${options.cause}`));void 0!==(null==options?void 0:options.status)&&(this.overrideStatus=options.status)}get status(){return void 0!==this.overrideStatus?this.overrideStatus:this.cause&&"status"in this.cause?this.cause.status:500}static isCausedBy(error,errorClass){return!!error&&(error instanceof errorClass||!!error.cause&&_LiveSyncError.isCausedBy(error.cause,errorClass))}static fromError(error){if(error instanceof this)return error;const instance=new this(`${this.name}: ${null==error?void 0:error.message}`,{cause:error});(null==error?void 0:error.stack)?instance.stack=error.stack:instance.stack=(new Error).stack;return instance}};CHeader="h:";PSCHeader="ps:";ICHeaderLength=(ICHeader="i:").length;ICXHeader="ix:";PersistentMap=class{flush(){this._save()}_save(){localStorage.setItem(this._key,JSON.stringify([...this._map.entries()]))}_load(suppliedEntries=[]){var _a8;try{const savedSource=null!=(_a8=localStorage.getItem(this._key))?_a8:"",sourceToParse=""===savedSource?"[]":savedSource,obj=JSON.parse(sourceToParse);this._map=new Map([...obj,...suppliedEntries])}catch(ex){console.log(`Map read error : ${this._key}`);console.dir(ex);this._map=new Map([...suppliedEntries])}return Promise.resolve()}_queueSave(){this._setCount--;if(this._setCount<0){this._setCount=100;scheduleTask(`save-map-${this._key}`,0,()=>this._save())}scheduleTask(`save-map-${this._key}`,150,()=>this._save())}delete(key3){const ret=this._map.delete(key3);this._queueSave();return ret}has(key3){return this._map.has(key3)}set(key3,value){this._map.set(key3,value);this._queueSave();return this}clear(){this._map=new Map;this._save()}get(key3,defValue){const v2=this._map.get(key3);return void 0===v2?defValue:v2}constructor(key3,entries2){Object.defineProperty(this,"_setCount",{enumerable:!0,configurable:!0,writable:!0,value:100});Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_key",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this._key=key3;this._map=new Map(null!=entries2?entries2:[]);this._load(entries2)}};BasicHeaderGenerator=class{constructor(){this._header=new Computed({evaluation:source2=>{if("username"in source2){const userNameAndPassword=source2.username&&source2.password?`${source2.username}:${source2.password}`:"";return`Basic ${btoa(userNameAndPassword)}`}return""}})}async getBasicHeader(auth){return(await this._header.update(auth)).value}};JWTTokenGenerator=class{constructor(){this._currentCryptoKey=new Computed({evaluation:async auth=>await this._importKey(auth)});this._jwt=new Computed({evaluation:async params=>{const buff=`${btoa(JSON.stringify(params.header))}.${btoa(JSON.stringify(params.payload))}`.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),key3=(await this._currentCryptoKey.update(params.credentials)).value;let token="";if("ES256"==params.header.alg||"ES512"==params.header.alg){const digestAlg="ES256"==params.header.alg?"SHA-256":"SHA-512",jwt=await crypto.subtle.sign({name:"ECDSA",hash:{name:digestAlg}},key3,writeString(buff));token=(await arrayBufferToBase64Single2(jwt)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}else{if("HS256"!=params.header.alg&&"HS512"!=params.header.alg)throw new Error("JWT algorithm is not supported.");{const jwt=await crypto.subtle.sign({name:"HMAC",hash:{name:params.header.alg}},key3,writeString(buff));token=(await arrayBufferToBase64Single2(jwt)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}}return{...params,token:`${buff}.${token}`}}});this._jwtParams=new Computed({evaluation(source2){const kid=source2.jwtKid||void 0;if(""==(source2.jwtSub||"").trim())throw new Error("JWT sub is empty");const algorithm=source2.jwtAlgorithm||"";if(!algorithm)throw new Error("JWT algorithm is not configured.");if("HS256"!=algorithm&&"HS512"!=algorithm&&"ES256"!=algorithm&&"ES512"!=algorithm)throw new Error("JWT algorithm is not supported.");const header={alg:source2.jwtAlgorithm||"HS256",typ:"JWT",kid},iat=~~((new Date).getTime()/1e3);return{header,payload:{exp:iat+60*(source2.jwtExpDuration||5),iat,sub:source2.jwtSub||"","_couchdb.roles":["_admin"]},credentials:source2}},requiresUpdate(args,previousArgs,previous){if(!previous||previous instanceof Error)return!0;const margin20p=.1*(previous.payload.exp-previous.payload.iat),margin=Math.min(10,Math.max(margin20p,60)),d4=~~((new Date).getTime()/1e3)+margin;return previous.payload.exp{const authHeaderGen=new AuthorizationHeaderGenerator,requestParam={url:`${baseUri}/${path2}`,method:method||(body?"PUT":"GET"),headers:{authorization:await authHeaderGen.getAuthorizationHeader(credentials),origin:origin2,...customHeaders},contentType:"application/json",body:body?JSON.stringify(body):void 0};return await(0,import_obsidian.requestUrl)(requestParam)};recentLogEntries=reactiveSource([]);(function setGlobalLogFunction(logger2){_logger=logger2})(globalLogFunction=(message,level,key3)=>{const entry={message:message instanceof Error?new LiveSyncError("[Error Logged]: "+message.message,{cause:message}):message,level,key:key3};recentLogEntries.value=[...recentLogEntries.value,entry]});recentLogs=[];ModuleLog=class extends AbstractObsidianModule{constructor(){super(...arguments);this.statusLog=reactiveSource("");this.activeFileStatus=reactiveSource("");this.notifies={};this.p2pLogCollector=new P2PLogCollector;this.nextFrameQueue=void 0;this.logLines=[]}observeForLogs(){function padLeftSpComputed(numI,mark){const formatted=reactiveSource("");let timer,maxLen=1;numI.onChanged(numX=>{const num=numX.value,numLen=`${Math.abs(num)}`.length+1;maxLen=maxLen{formatted.value="";maxLen=1},3e3));formatted.value=` ${mark}${`${padSpaces}${num}`.slice(-maxLen)}`});return computed(()=>formatted.value)}const padSpaces=" ".repeat(10),labelReplication=padLeftSpComputed(this.services.replication.replicationResultCount,"📥"),labelDBCount=padLeftSpComputed(this.services.replication.databaseQueueCount,"📄"),labelStorageCount=padLeftSpComputed(this.services.replication.storageApplyingCount,"💾"),labelChunkCount=padLeftSpComputed(collectingChunks,"🧩"),labelPluginScanCount=padLeftSpComputed(pluginScanningCount,"🔌"),labelConflictProcessCount=padLeftSpComputed(this.services.conflict.conflictProcessQueueCount,"🔩"),labelHiddenFilesCount=padLeftSpComputed(reactive(()=>hiddenFilesEventCount.value-hiddenFilesProcessingCount.value),"⚙️"),queueCountLabelX=reactive(()=>`${labelReplication()}${labelDBCount()}${labelStorageCount()}${labelChunkCount()}${labelPluginScanCount()}${labelHiddenFilesCount()}${labelConflictProcessCount()}`),queueCountLabel=()=>queueCountLabelX.value,requestingStatLabel=computed(()=>0!=this.services.API.requestCount.value-this.services.API.responseCount.value?"📲 ":""),replicationStatLabel=computed(()=>{const e3=this.services.replicator.replicationStatics.value,sent=e3.sent,arrived=e3.arrived,maxPullSeq=e3.maxPullSeq,maxPushSeq=e3.maxPushSeq,lastSyncPullSeq=e3.lastSyncPullSeq,lastSyncPushSeq=e3.lastSyncPushSeq;let pushLast="",pullLast="",w2="";const labels={CONNECTED:"⚡",JOURNAL_SEND:"📦↑",JOURNAL_RECEIVE:"📦↓"};switch(e3.syncStatus){case"CLOSED":case"COMPLETED":case"NOT_CONNECTED":w2="⏹";break;case"STARTED":w2="🌀";break;case"PAUSED":w2="💤";break;case"CONNECTED":case"JOURNAL_SEND":case"JOURNAL_RECEIVE":w2=labels[e3.syncStatus]||"⚡";pushLast=0==lastSyncPushSeq?"":lastSyncPushSeq>=maxPushSeq?" (LIVE)":` (${maxPushSeq-lastSyncPushSeq})`;pullLast=0==lastSyncPullSeq?"":lastSyncPullSeq>=maxPullSeq?" (LIVE)":` (${maxPullSeq-lastSyncPullSeq})`;break;case"ERRORED":w2="⚠";break;default:w2="?"}return{w:w2,sent,pushLast,arrived,pullLast}}),labelProc=padLeftSpComputed(this.services.fileProcessing.processing,"⏳"),labelPend=padLeftSpComputed(this.services.fileProcessing.totalQueued,"🛫"),labelInBatchDelay=padLeftSpComputed(this.services.fileProcessing.batched,"📬"),waitingLabel=computed(()=>`${labelProc()}${labelPend()}${labelInBatchDelay()}`),statusLineLabel=computed(()=>{const{w:w2,sent,pushLast,arrived,pullLast}=replicationStatLabel(),queued=queueCountLabel(),waiting=waitingLabel(),networkActivity=requestingStatLabel(),p2p=this.p2pLogCollector.p2pReplicationLine.value;return{message:`${networkActivity}Sync: ${w2} ↑ ${sent}${pushLast} ↓ ${arrived}${pullLast}${waiting}${queued}${""==p2p?"":"\n"+p2p}`}}),statusBarLabels=reactive(()=>{const scheduleMessage=this.services.appLifecycle.isReloadingScheduled()?"WARNING! RESTARTING OBSIDIAN IS SCHEDULED!\n":"",{message}=statusLineLabel(),fileStatus=this.activeFileStatus.value,status=scheduleMessage+this.statusLog.value;return{message:`${message}${fileStatus&&this.settings.hideFileWarningNotice?" ⛔ SKIP":""}`,status}});this.statusBarLabels=statusBarLabels;const applyToDisplay=throttle(label2=>{this.applyStatusBarText()},20);statusBarLabels.onChanged(label2=>applyToDisplay(label2.value));this.activeFileStatus.onChanged(()=>this.updateMessageArea())}_everyOnload(){eventHub.onEvent("leaf-active-changed",()=>this.onActiveLeafChange());eventHub.onceEvent(EVENT_LAYOUT_READY,()=>this.onActiveLeafChange());eventHub.onEvent(EVENT_ON_UNRESOLVED_ERROR,()=>this.updateMessageArea());return Promise.resolve(!0)}adjustStatusDivPosition(){const mdv=this.app.workspace.getMostRecentLeaf();if(mdv&&this.statusDiv){this.statusDiv.remove();const container=mdv.view.containerEl;container.insertBefore(this.statusDiv,container.lastChild)}}async getActiveFileStatus(){const reason=[],reasonWarn=[],thisFile=this.app.workspace.getActiveFile();if(!thisFile)return"";if(isValidPath(thisFile.path)){const validOnWindows=isValidFilenameInWidows(thisFile.name),validOnDarwin=isValidFilenameInDarwin(thisFile.name),validOnAndroid=isValidFilenameInAndroid(thisFile.name),labels=[];validOnWindows||labels.push("🪟");validOnDarwin||labels.push("🍎");validOnAndroid||labels.push("🤖");labels.length>0&&reasonWarn.push("Some platforms may be unable to process this file correctly: "+labels.join(" "))}else reason.push("This file has an invalid path under the current settings");this.services.vault.shouldCheckCaseInsensitively()&&(await this.core.storageAccess.getFiles()).map(e3=>e3.path).filter(e3=>e3.toLowerCase()==thisFile.path.toLowerCase()).length>1&&reason.push("There are multiple files with the same name (case-insensitive match)");await this.services.vault.isTargetFile(thisFile.path)||reason.push("This file is ignored by the ignore rules");this.services.vault.isFileSizeTooLarge(thisFile.stat.size)&&reason.push("This file size exceeds the configured limit");return[reason.length>0?"Not synchronised: "+reason.join(", "):"",reasonWarn.length>0?"Warning: "+reasonWarn.join(", "):""].filter(e3=>e3).join("\n")}async setFileStatus(){const fileStatus=await this.getActiveFileStatus();this.activeFileStatus.value=fileStatus}async updateMessageArea(){var _a8,_b5;if(!this.messageArea)return;const showStatusOnEditor=null!=(_b5=null==(_a8=this.settings)?void 0:_a8.showStatusOnEditor)&&_b5;this.statusDiv&&(this.statusDiv.style.display=showStatusOnEditor?"":"none");if(!showStatusOnEditor){this.messageArea.innerText="";return}const messageLines=[],fileStatus=this.activeFileStatus.value;fileStatus&&!this.settings.hideFileWarningNotice&&messageLines.push(fileStatus);const stringMessages=(await this.services.appLifecycle.getUnresolvedMessages()).flat().filter(e3=>e3).filter(m3=>"string"==typeof m3),networkMessages=stringMessages.filter(m3=>m3.startsWith(MARK_LOG_NETWORK_ERROR)),otherMessages=stringMessages.filter(m3=>!m3.startsWith(MARK_LOG_NETWORK_ERROR));messageLines.push(...otherMessages);this.settings.networkWarningStyle!==NetworkWarningStyles_ICON&&this.settings.networkWarningStyle!==NetworkWarningStyles_HIDDEN?messageLines.push(...networkMessages):this.settings.networkWarningStyle===NetworkWarningStyles_ICON&&networkMessages.length>0&&messageLines.push("🔗❌");this.messageArea.innerText=messageLines.map(e3=>`⚠️ ${e3}`).join("\n")}onActiveLeafChange(){fireAndForget(async()=>{this.adjustStatusDivPosition();await this.setFileStatus()})}applyStatusBarText(){if(!this.nextFrameQueue){this.nextFrameQueue=requestAnimationFrame(()=>{var _a8,_b5,_c3,_d2;this.nextFrameQueue=void 0;const{message,status}=this.statusBarLabels.value,newMsg=message;let newLog=(null==(_a8=this.settings)?void 0:_a8.showOnlyIconsOnEditor)?"":status;const moduleTagEnd=newLog.indexOf(`]${MARK_LOG_SEPARATOR}`);-1!=moduleTagEnd&&(newLog=newLog.substring(moduleTagEnd+MARK_LOG_SEPARATOR.length+1));null==(_b5=this.statusBar)||_b5.setText(newMsg.split("\n")[0]);this.statusDiv&&(this.statusDiv.style.display=(null==(_c3=this.settings)?void 0:_c3.showStatusOnEditor)?"":"none");if((null==(_d2=this.settings)?void 0:_d2.showStatusOnEditor)&&this.statusDiv){if(this.settings.showLongerLogInsideEditor){const now3=(new Date).getTime();this.logLines=this.logLines.filter(e3=>e3.ttl>now3);const minimumNext=this.logLines.reduce((a2,b3)=>a20&&setTimeout(()=>this.applyStatusBarText(),minimumNext-now3);const recentLogs2=this.logLines.map(e3=>e3.message).reverse().join("\n");isDirty("recentLogs",recentLogs2)&&(this.logHistory.innerText=recentLogs2)}isDirty("newMsg",newMsg)&&(this.statusLine.innerText=newMsg);isDirty("newLog",newLog)&&(this.logMessage.innerText=newLog)}});scheduleTask("log-hide",3e3,()=>{this.statusLog.value=""})}}_allStartOnUnload(){var _a8;this.statusDiv&&this.statusDiv.remove();null==(_a8=document.querySelectorAll(".livesync-status"))||_a8.forEach(e3=>e3.remove());return Promise.resolve(!0)}_everyOnloadStart(){(0,import_obsidian.addIcon)("view-log",'\n \n \n ');this.addRibbonIcon("view-log",$msg("moduleLog.showLog"),()=>{this.services.API.showWindow("log-log")}).addClass("livesync-ribbon-showlog");this.addCommand({id:"view-log",name:"Show log",callback:()=>{this.services.API.showWindow("log-log")}});this.registerView("log-log",leaf=>new LogPaneView(leaf,this.plugin));return Promise.resolve(!0)}_everyOnloadAfterLoadSettings(){var _a8,_b5,_c3;recentLogEntries.onChanged(entries2=>{if(0===entries2.value.length)return;const newEntries=[...entries2.value];recentLogEntries.value=[];newEntries.forEach(e3=>this.__addLog(e3.message,e3.level,e3.key))});eventHub.onEvent("file-renamed",data=>{this.setFileStatus()});document.querySelectorAll(".livesync-status").forEach(e3=>e3.remove());this.observeForLogs();this.statusDiv=this.app.workspace.containerEl.createDiv({cls:"livesync-status"});this.statusLine=this.statusDiv.createDiv({cls:"livesync-status-statusline"});this.messageArea=this.statusDiv.createDiv({cls:"livesync-status-messagearea"});this.logMessage=this.statusDiv.createDiv({cls:"livesync-status-logmessage"});this.logHistory=this.statusDiv.createDiv({cls:"livesync-status-loghistory"});this.statusDiv.style.display=(null==(_a8=this.settings)?void 0:_a8.showStatusOnEditor)?"":"none";eventHub.onEvent(EVENT_LAYOUT_READY,()=>this.adjustStatusDivPosition());if(null==(_b5=this.settings)?void 0:_b5.showStatusOnStatusbar){this.statusBar=this.services.API.addStatusBarItem();null==(_c3=this.statusBar)||_c3.addClass("syncstatusbar")}this.adjustStatusDivPosition();return Promise.resolve(!0)}writeLogToTheFile(now3,vaultName,newMessage){fireAndForget(()=>serialized("writeLog",async()=>{const time2=now3.toISOString().split("T")[0],logDate=`${PREFIXMD_LOGFILE}${time2}.md`;await this.core.storageAccess.isExists(normalizePath(logDate))||await this.core.storageAccess.appendHiddenFile(normalizePath(logDate),"```\n");await this.core.storageAccess.appendHiddenFile(normalizePath(logDate),vaultName+":"+newMessage+"\n")}))}__addLog(message,level=LOG_LEVEL_INFO,key3=""){var _a8,_b5,_c3,_d2,_e2,_f;if(level==LOG_LEVEL_DEBUG)return;if(level<=LOG_LEVEL_INFO&&this.settings&&this.settings.lessInformationInLog)return;if(this.settings&&!this.settings.showVerboseLog&&level==LOG_LEVEL_VERBOSE)return;const vaultName=this.services.vault.getVaultName(),now3=new Date,timestamp=now3.toLocaleString();let errorInfo="";if(message instanceof Error)if(message instanceof LiveSyncError)errorInfo=`${null==(_a8=message.cause)?void 0:_a8.name}:${null==(_b5=message.cause)?void 0:_b5.message}\n[StackTrace]: ${message.stack}\n[CausedBy]: ${null==(_c3=message.cause)?void 0:_c3.stack}`;else{const thisStack=(new Error).stack;errorInfo=`${message.name}:${message.message}\n[StackTrace]: ${message.stack}\n[LogCallStack]: ${thisStack}`}const messageContent="string"==typeof message?message:message instanceof Error?`${errorInfo}`:JSON.stringify(message,null,2),newMessage=timestamp+"->"+messageContent;message instanceof Error?console.error(vaultName+":"+newMessage):level>=LOG_LEVEL_INFO?console.log(vaultName+":"+newMessage):console.debug(vaultName+":"+newMessage);(null==(_d2=this.settings)?void 0:_d2.showOnlyIconsOnEditor)||(this.statusLog.value=messageContent);(null==(_e2=this.settings)?void 0:_e2.writeLogToTheFile)&&this.writeLogToTheFile(now3,vaultName,newMessage);addLog(newMessage);this.logLines.push({ttl:now3.getTime()+3e3,message:newMessage});if(level>=LOG_LEVEL_NOTICE){key3||(key3=messageContent);if(key3 in this.notifies){(null==(_f=this.notifies[key3].notice.noticeEl)?void 0:_f.isShown())||(this.notifies[key3].notice=new import_obsidian.Notice(messageContent,0));cancelTask(`notify-${key3}`);if(key3==messageContent){this.notifies[key3].count++;this.notifies[key3].notice.setMessage(`(${this.notifies[key3].count}):${messageContent}`)}else this.notifies[key3].notice.setMessage(`${messageContent}`)}else{const notify=new import_obsidian.Notice(messageContent,0);this.notifies[key3]={count:0,notice:notify}}const timeout=5e3;key3.startsWith("keepalive-")&&-1===messageContent.indexOf("  ")||scheduleTask(`notify-${key3}`,timeout,()=>{const notify=this.notifies[key3].notice;delete this.notifies[key3];try{notify.hide()}catch(e3){}})}}onBindFunction(core,services){services.API.addLog.setHandler(globalLogFunction);services.appLifecycle.onInitialise.addHandler(this._everyOnloadStart.bind(this));services.appLifecycle.onSettingLoaded.addHandler(this._everyOnloadAfterLoadSettings.bind(this));services.appLifecycle.onLoaded.addHandler(this._everyOnload.bind(this));services.appLifecycle.onBeforeUnload.addHandler(this._allStartOnUnload.bind(this))}};noticeIndex=0;LiveSyncCommands=class{constructor(plugin3,core){this._verbose=(msg,key3)=>{this._log(msg,LOG_LEVEL_VERBOSE,key3)};this._info=(msg,key3)=>{this._log(msg,LOG_LEVEL_INFO,key3)};this._notice=(msg,key3)=>{this._log(msg,LOG_LEVEL_NOTICE,key3)};this._progress=(prefix="",level=LOG_LEVEL_NOTICE)=>{const key3="keepalive-progress-"+noticeIndex++;return{log:msg=>{this._log(prefix+msg,level,key3)},once:msg=>{this._log(prefix+msg,level)},done:(msg="Done")=>{this._log(prefix+msg+"  ",level,key3)}}};this._debug=(msg,key3)=>{this._log(msg,LOG_LEVEL_VERBOSE,key3)};this.plugin=plugin3;this.core=core;this.onBindFunction(this.core,this.core.services);this._log=createInstanceLogFunction(this.constructor.name,this.services.API);__$checkInstanceBinding(this)}get app(){return this.plugin.app}get settings(){return this.core.settings}get localDatabase(){return this.core.localDatabase}get services(){return this.core.services}async path2id(filename,prefix){return await this.services.path.path2id(filename,prefix)}getPath(entry){return this.services.path.getPath(entry)}_isMainReady(){return this.services.appLifecycle.isReady()}_isMainSuspended(){return this.services.appLifecycle.isSuspended()}_isDatabaseReady(){return this.services.database.isDatabaseReady()}onBindFunction(core,services){}};PeriodicProcessor=class{constructor(core,process2){this._timer=void 0;this._core=core;this._process=process2;eventHub.onceEvent("plugin-unloaded",()=>{this.disable()})}async process(){try{await this._process()}catch(ex){Logger(ex)}}enable(interval){this.disable();0!=interval&&(this._timer=this._core.services.API.setInterval(()=>fireAndForget(async()=>{var _a8,_b5;await this.process();(null==(_b5=null==(_a8=this._core.services)?void 0:_a8.control)?void 0:_b5.hasUnloaded())&&this.disable()}),interval))}disable(){if(void 0!==this._timer){this._core.services.API.clearInterval(this._timer);this._timer=void 0}}};root_12=from_html('
Just for a minute, please!
',1);root_4=from_html('');root_6=from_html(" ");root_5=from_html('
');root_10=from_html('');root_2=from_html('
',1);root2=from_html('

',1);$$css2={hash:"svelte-1ah3y1j",code:".spacer.svelte-1ah3y1j {flex-grow:1;}.infos.svelte-1ah3y1j {display:flex;justify-content:space-between;margin:4px 0.5em;}.deleted.svelte-1ah3y1j {text-decoration:line-through;}.svelte-1ah3y1j {box-sizing:border-box;}.scroller.svelte-1ah3y1j {display:flex;flex-direction:column;overflow-y:scroll;max-height:60vh;user-select:text;-webkit-user-select:text;}.json-source.svelte-1ah3y1j {white-space:pre;height:auto;overflow:auto;min-height:var(--font-ui-medium);flex-grow:1;}"};delegate(["click"]);JsonResolveModal=class extends import_obsidian.Modal{constructor(app,filename,docs,callback,nameA,nameB,defaultSelect,keepOrder,hideLocal,title="Conflicted Setting"){super(app);this.title="Conflicted Setting";this.callback=callback;this.filename=filename;this.docs=docs;this.nameA=nameA||"";this.nameB=nameB||"";this.keepOrder=keepOrder||!1;this.defaultSelect=defaultSelect||"";this.title=title;this.hideLocal=null!=hideLocal&&hideLocal;waitForSignal(`cancel-internal-conflict:${filename}`).then(()=>this.close())}async UICallback(keepRev,mergedStr){this.callback&&await this.callback(keepRev,mergedStr);this.close();this.callback=void 0}onOpen(){const{contentEl}=this;this.titleEl.setText(this.title);contentEl.empty();null==this.component&&(this.component=mount(JsonResolvePane,{target:contentEl,props:{docs:this.docs,filename:this.filename,nameA:this.nameA,nameB:this.nameB,defaultSelect:this.defaultSelect,keepOrder:this.keepOrder,hideLocal:this.hideLocal,callback:(keepRev,mergedStr)=>this.UICallback(keepRev,mergedStr)}}))}onClose(){const{contentEl}=this;contentEl.empty();null!=this.callback&&this.callback(void 0);if(null!=this.component){unmount(this.component);this.component=void 0}}};PaceMaker=class{constructor(interval){Object.defineProperty(this,"_interval",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_minimumNext",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this._interval=interval}changeInterval(interval){if(interval!==this._interval){this._interval=interval;this._minimumNext=void 0}}mark(now3=Date.now()){void 0===this._minimumNext?this._minimumNext=now3+this._interval:this._minimumNext=Math.max(this._minimumNext+this._interval,now3+this._interval)}_getPaced(doMark){const now3=Date.now(),prevMinimum=this._minimumNext;doMark&&this.mark(now3);if(void 0!==prevMinimum){const shouldWait=prevMinimum-now3;if(shouldWait>0)return new Promise(resolve=>setTimeout(()=>{resolve()},shouldWait))}return Promise.resolve()}get paced(){return this._getPaced(!0)}get pacedSinceMark(){return this._getPaced(!1)}};NOT_AVAILABLE=Symbol("NotAvailable");READY_PICK_SIGNAL=Symbol("lockReady");READY_POST_SIGNAL=Symbol("lockFull");DISPOSE_ERROR="Inbox has been disposed";SyncInbox=class{constructor(capacity){Object.defineProperty(this,"_capacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_buffer",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_writeIdx",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_readIdx",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_wrapAroundCount",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_disposedPromise",{enumerable:!0,configurable:!0,writable:!0,value:promiseWithResolvers()});if(capacity<=0)throw new Error("Capacity must be greater than 0");this._capacity=~~capacity;let i2=256;for(;i20}get isDisposed(){return this._isDisposed}get onDisposed(){return this._disposedPromise.promise}__fixIdx(){if(this._readIdx>this._wrapAroundCount){this._readIdx=this._readIdx&this._wrapAroundCount;this._writeIdx=this._writeIdx&this._wrapAroundCount}}get state(){return{processed:this._writeIdx,size:this.size,free:this.free,isFull:this.isFull,isRunningOut:this.isRunningOut,isReady:this.isReady}}dispose(){this._readIdx=0;this._writeIdx=0;this._capacity=0;this._buffer.length=1;this._buffer[0]=void 0;this._wrapAroundCount=1;this._isDisposed=!0;this._disposedPromise.resolve()}__onPosted(){this.__onProgress()}__onPicked(){this.__onProgress()}__onProgress(){this.__fixIdx()}tryPost(item){if(this.isFull)return!1;this._writeIdx++;this._buffer[this._writeIdx&this._wrapAroundCount]=item;this.__onPosted();return!0}tryCancelPost(){if(0==this.size)return NOT_AVAILABLE;const pointingIdx=this._writeIdx&this._wrapAroundCount,item=this._buffer[pointingIdx];this._buffer[pointingIdx]=void 0;this._writeIdx--;this.__fixIdx();return item}tryPick(){if(this.isRunningOut)return NOT_AVAILABLE;this._readIdx++;const pointingIdx=this._readIdx&this._wrapAroundCount,item=this._buffer[pointingIdx];this._buffer[pointingIdx]=void 0;this.__onPicked();return item}};Inbox=class extends SyncInbox{constructor(capacity){super(capacity);Object.defineProperty(this,"_lockFull",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_lockReady",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _waitForFree(){for(;0==this.free;){this._lockFull||(this._lockFull=promiseWithResolvers());return await this._lockFull.promise}return READY_POST_SIGNAL}_notifyFree(){var _a8;null==(_a8=this._lockFull)||_a8.resolve(READY_POST_SIGNAL);this._lockFull=void 0}async _waitForReady(){for(;this.isRunningOut;){this._lockReady||(this._lockReady=promiseWithResolvers());return await this._lockReady.promise}return READY_PICK_SIGNAL}_notifyReady(){var _a8;null==(_a8=this._lockReady)||_a8.resolve(READY_PICK_SIGNAL);this._lockReady=void 0}__onPosted(){super.__onPosted();this._notifyReady()}__onPicked(){super.__onPicked();this._notifyFree()}dispose(){super.dispose();if(this._lockFull){this._lockFull.reject(new Error(DISPOSE_ERROR));this._lockFull=void 0}if(this._lockReady){this._lockReady.reject(new Error(DISPOSE_ERROR));this._lockReady=void 0}}async post(item,timeout,cancellation){if(this._isDisposed)throw new Error(DISPOSE_ERROR);do{if(cancellation&&cancellation.length>0&&await isSomeResolved(cancellation))return!1;if(this.tryPost(item))return!0;let p2;const tasks3=[this._waitForFree(),...timeout?[(p2=cancelableDelay(timeout)).promise]:[],...cancellation||[]],r4=await Promise.race(tasks3);null==p2||p2.cancel();if(r4!==READY_POST_SIGNAL)return!1}while(!this._isDisposed);return!1}async pick(timeout,cancellation){if(this._isDisposed)throw new Error(DISPOSE_ERROR);do{if(cancellation&&cancellation.length>0&&await isSomeResolved(cancellation))return NOT_AVAILABLE;const item=this.tryPick();if(item!==NOT_AVAILABLE)return item;let p2;const tasks3=[this._waitForReady(),...timeout?[(p2=cancelableDelay(timeout)).promise]:[],...cancellation||[]],r4=await Promise.race(tasks3);null==p2||p2.cancel();if(r4!==READY_PICK_SIGNAL)return NOT_AVAILABLE}while(!this.isDisposed);return NOT_AVAILABLE}};(function(ClerkState2){ClerkState2.IDLE="idle";ClerkState2.DISPOSED="disposed";ClerkState2.WORKING="working";ClerkState2.STALLED="not-started"})(ClerkState||(ClerkState={}));SENTINEL_FINISHED=Symbol("finished");SENTINEL_FLUSH=Symbol("flush");ClerkBase=class{get state(){return this._state}constructor(params){Object.defineProperty(this,"_inbox",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:ClerkState.STALLED});Object.defineProperty(this,"_totalProcessed",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_totalSuccess",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_totalFailed",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_totalFetched",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_disposePromise",{enumerable:!0,configurable:!0,writable:!0,value:promiseWithResolvers()});Object.defineProperty(this,"_onProgress",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const{name,assigned}=params;this._inbox=assigned;this._name=null!=name?name:this.constructor.name;yieldMicrotask().then(()=>this._mainLoop());this._inbox.onDisposed.then(()=>this.dispose())}get stateDetail(){const hasStarted=0!=this._totalFetched,hasAnyUnprocessed=this._totalFetched!=this._totalProcessed,isBusy=0!=this._inbox.state.size||hasAnyUnprocessed;return{totalFetched:this._totalFetched,inboxDetail:this._inbox.state,totalProcessed:this._totalProcessed,state:this._state,hasStarted,isBusy}}onProgress(){var _a8;try{null==(_a8=this._onProgress)||_a8.call(this,this.stateDetail)}catch(e3){}}setOnProgress(callback){this._onProgress=callback}async _mainLoop(){var _a8;this._state=ClerkState.STALLED;this.onProgress();await yieldMicrotask();do{this._state=ClerkState.IDLE;this.onProgress();try{const item=await this._inbox.pick(void 0,[this._disposePromise.promise]);if(item===SENTINEL_FLUSH||item===SENTINEL_FINISHED){await(null==(_a8=this._onSentinel)?void 0:_a8.call(this,item));continue}if(item===NOT_AVAILABLE){if(this._inbox.isDisposed){this._state=ClerkState.DISPOSED;break}continue}this._totalFetched++;this._state=ClerkState.WORKING;this.onProgress();try{await this._onPick(item);this._totalSuccess++}catch(ex){this._totalFailed++;Logger("Error on processing job on clerk");Logger(ex,LOG_LEVEL_VERBOSE)}this._totalProcessed++;this.onProgress()}catch(ex){if(ex instanceof Error&&ex.message!==DISPOSE_ERROR){Logger("Error on picking item on clerk");Logger(ex,LOG_LEVEL_VERBOSE)}}}while(!this._inbox.isDisposed&&!this._disposed);this._state=ClerkState.IDLE;this._disposed?this._state=ClerkState.DISPOSED:this.dispose();this.onProgress()}dispose(){this._disposePromise.resolve();this._disposed=!0;this._state=ClerkState.DISPOSED}get onDisposed(){return this._disposePromise.promise}};Clerk=class extends ClerkBase{async _onPick(item){return await this._job(item)}constructor(params){super(params);Object.defineProperty(this,"_job",{enumerable:!0,configurable:!0,writable:!0,value:void 0});this._job=params.job}};ClerkGroup=class{constructor(params){var _a8;Object.defineProperty(this,"_clerks",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_nameBase",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_assigned",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_hiredCount",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_job",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_instantiate",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const{assigned,job,instantiate,initialMemberCount}=params;this._assigned=assigned;this._instantiate=instantiate;this._job=job;this._nameBase=null!=(_a8=params.name)?_a8:this.constructor.name;this._clerks=[];for(let i2=0;i20)for(let i2=0;i2clerk.stateDetail),totalFetched=states.reduce((acc,state2)=>acc+state2.totalFetched,0),totalProcessed=states.reduce((acc,state2)=>acc+state2.totalProcessed,0),isBusy=states.some(state2=>state2.isBusy),hasStarted=states.some(state2=>state2.hasStarted);return{totalFetched,totalProcessed,inboxDetail:this._assigned.state,isBusy,hasStarted,state:ClerkState.IDLE}}get freeMembers(){return this._clerks.filter(clerk=>clerk.state===ClerkState.IDLE).length}dispose(){this._clerks.forEach(clerk=>clerk.dispose())}};Notifier=class{constructor(){Object.defineProperty(this,"_p",{enumerable:!0,configurable:!0,writable:!0,value:promiseWithResolvers()});Object.defineProperty(this,"isUsed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}notify(){if(this.isUsed){this.isUsed=!1;this._p.promise.finally(noop);this._p.resolve();this._p=promiseWithResolvers()}}get nextNotify(){this.isUsed=!0;return this._p.promise}};allRunningProcessors=new Set([]);QueueProcessor=class{get nowProcessing(){return this.processingEntities}get totalNowProcessing(){var _a8;return this.nowProcessing+((null==(_a8=this._pipeTo)?void 0:_a8.totalNowProcessing)||0)}get remaining(){return this._queue.length+this.processingEntities+this.waitingEntries}get totalRemaining(){var _a8;return this.remaining+((null==(_a8=this._pipeTo)?void 0:_a8.totalRemaining)||0)}updateStatus(setFunc){setFunc();this._updateReactiveSource()}suspend(){this._isSuspended=!0;this._hub.emitEvent("tickSuspended");return this}resume(){this._isSuspended=!1;this._hub.emitEvent("tickResumed");return this}resumePipeLine(){var _a8;null==(_a8=this._pipeTo)||_a8.resumePipeLine();this.resume();return this}startPipeline(){this.root.resumePipeLine();return this}get root(){return void 0===this._root?this:this._root}_initEventHub(){this._hub.onEvent("tickResumed",()=>this._run())}async _waitFor(keys3,timeout){const items=keys3.map(key3=>{const p2=promiseWithResolvers(),releaser=this._hub.onEvent(key3,()=>{p2.resolve(key3)});p2.promise=p2.promise.finally(()=>{releaser()});return p2}),timer=timeout?cancelableDelay(timeout):void 0,tasks3=[...items.map(i2=>i2.promise),...timer?[timer.promise]:[]],ret=await Promise.race(tasks3);items.forEach(i2=>i2.resolve(void 0));return ret}_triggerTickDelay(){this._delayTimer||(this._delayTimer=setTimeout(()=>{this._hub.emitEvent("tickDelayTimeout");this._delayTimer=void 0}))}_clearTickDelay(){if(this._delayTimer){clearTimeout(this._delayTimer);this._delayTimer=void 0}}_notifyIfIdle(){return this.root.__notifyIfIdle()}__notifyIfIdle(){0!=this._processCount||this._canCollectBatch()||this._hub.emitEvent("idle");this._pipeTo&&this._pipeTo.__notifyIfIdle()}_onTick(){if(this._canCollectBatch())if(this._nextProcessNeedsImmediate){this._clearTickDelay();this._nextProcessNeedsImmediate=!1;this._hub.emitEvent("tickImmediate")}else if(this._queue.length>this.yieldThreshold){this._clearTickDelay();this._hub.emitEvent("yielded")}else{if(!this.delay){this._clearTickDelay();this._hub.emitEvent("tickDelayTimeout");return}this._delayTimer||this._triggerTickDelay()}else{this._notifyIfIdle();this._clearTickDelay();this._hub.emitEvent("tickEmpty")}}constructor(processor,params,items,enqueueProcessor){var _a8,_b5,_c3,_d2,_e2,_f,_g;Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:[]});Object.defineProperty(this,"_processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_enqueueProcessor",{enumerable:!0,configurable:!0,writable:!0,value:(queue2,entity)=>(queue2.push(entity),queue2)});Object.defineProperty(this,"_isSuspended",{enumerable:!0,configurable:!0,writable:!0,value:!0});Object.defineProperty(this,"_nextProcessNeedsImmediate",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_pipeTo",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_remainingReactiveSource",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_totalRemainingReactiveSource",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_processingEntitiesReactiveSource",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_keepResultUntilDownstreamConnected",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_keptResult",{enumerable:!0,configurable:!0,writable:!0,value:[]});Object.defineProperty(this,"_runOnUpdateBatch",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}});Object.defineProperty(this,"concurrentLimit",{enumerable:!0,configurable:!0,writable:!0,value:1});Object.defineProperty(this,"batchSize",{enumerable:!0,configurable:!0,writable:!0,value:1});Object.defineProperty(this,"yieldThreshold",{enumerable:!0,configurable:!0,writable:!0,value:1});Object.defineProperty(this,"delay",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"maintainDelay",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"interval",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"processingEntities",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"waitingEntries",{enumerable:!0,configurable:!0,writable:!0,value:0});Object.defineProperty(this,"_hub",{enumerable:!0,configurable:!0,writable:!0,value:new EventHub});Object.defineProperty(this,"_delayTimer",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_intervalPaceMaker",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_processingBatches",{enumerable:!0,configurable:!0,writable:!0,value:new Set});Object.defineProperty(this,"addProcessingBatch",{enumerable:!0,configurable:!0,writable:!0,value:value=>{const r4=this._processingBatches.add(value);this._updateBatchProcessStatus();return r4}});Object.defineProperty(this,"deleteProcessingBatch",{enumerable:!0,configurable:!0,writable:!0,value:value=>{const r4=this._processingBatches.delete(value);this._updateBatchProcessStatus();return r4}});Object.defineProperty(this,"_processing",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_collected",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_clerks",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_processCount",{enumerable:!0,configurable:!0,writable:!0,value:0});this._root=this;this._processor=processor;this.batchSize=null!=(_a8=null==params?void 0:params.batchSize)?_a8:1;this.yieldThreshold=null!=(_c3=null!=(_b5=null==params?void 0:params.yieldThreshold)?_b5:null==params?void 0:params.batchSize)?_c3:0;this.concurrentLimit=null!=(_d2=null==params?void 0:params.concurrentLimit)?_d2:1;this.delay=null!=(_e2=null==params?void 0:params.delay)?_e2:0;this.maintainDelay=null!=(_f=null==params?void 0:params.maintainDelay)&&_f;this.interval=null!=(_g=null==params?void 0:params.interval)?_g:0;(null==params?void 0:params.keepResultUntilDownstreamConnected)&&(this._keepResultUntilDownstreamConnected=params.keepResultUntilDownstreamConnected);(null==params?void 0:params.remainingReactiveSource)&&(this._remainingReactiveSource=null==params?void 0:params.remainingReactiveSource);(null==params?void 0:params.totalRemainingReactiveSource)&&(this._totalRemainingReactiveSource=null==params?void 0:params.totalRemainingReactiveSource);(null==params?void 0:params.processingEntitiesReactiveSource)&&(this._processingEntitiesReactiveSource=null==params?void 0:params.processingEntitiesReactiveSource);void 0!==(null==params?void 0:params.suspended)&&(this._isSuspended=null==params?void 0:params.suspended);enqueueProcessor&&this.replaceEnqueueProcessor(enqueueProcessor);void 0!==(null==params?void 0:params.pipeTo)&&this.pipeTo(params.pipeTo);this._intervalPaceMaker=new PaceMaker(this.interval);items&&this.enqueueAll(items);allRunningProcessors.add(this);this._initClerks();this._initEventHub();this.resume()}replaceEnqueueProcessor(processor){this._enqueueProcessor=processor;return this}modifyQueue(processor){this._queue=processor(this._queue);this._onTick()}clearQueue(){this._queue=[];this._onTick()}onUpdateProgress(proc){this._runOnUpdateBatch=proc;return this}pipeTo(pipeTo){this._pipeTo=pipeTo;this._pipeTo._root=this.root;if(this._keptResult.length>0){const temp=[...this._keptResult];this._keptResult=[];this._pipeTo.enqueueAll(temp)}return pipeTo}isIdle(){return this._isIdle()&&(!this._pipeTo||this._pipeTo.isIdle())}_isIdle(){return 0==this.totalRemaining}async _waitForIdle(){if(this._isSuspended)return Promise.resolve();if(this._isIdle())return Promise.resolve();do{const r4=await this._waitFor(["tickEmpty","tick","tickSuspended","suspended","idle"]);if("tickSuspended"===r4)break;if("suspended"==r4)break;if("tickEmpty"==r4)break;if("idle"==r4)break}while(!this._isIdle());return Promise.resolve()}idleDetectors(){const thisPromise=this._waitForIdle();return this._pipeTo?[thisPromise,...this._pipeTo.idleDetectors()]:[thisPromise]}get isSuspended(){var _a8;return this._isSuspended||(null==(_a8=this._pipeTo)?void 0:_a8.isSuspended)||!1}_updateReactiveSource(){this.root.updateReactiveSource()}updateReactiveSource(){this._pipeTo&&this._pipeTo.updateReactiveSource();this._remainingReactiveSource&&(this._remainingReactiveSource.value=this.remaining);this._totalRemainingReactiveSource&&(this._totalRemainingReactiveSource.value=this.totalRemaining);this._processingEntitiesReactiveSource&&(this._processingEntitiesReactiveSource.value=this.nowProcessing)}_updateBatchProcessStatus(){this._updateReactiveSource();this._runOnUpdateBatch()}_collectBatch(){return this._queue.splice(0,this.batchSize)}_canCollectBatch(){return 0!==this._queue.length}enqueue(entity){this._queue=this._enqueueProcessor(this._queue,entity);this._updateBatchProcessStatus();this._onTick();return this}enqueueAll(entities){let queue2=this._queue;for(const v2 of entities)queue2=this._enqueueProcessor(queue2,v2);this._queue=queue2;this._updateBatchProcessStatus();this._onTick();return this}requestNextFlush(){this._nextProcessNeedsImmediate=!0;this._onTick()}async _waitForSuspended(){}flush(){if(this._isSuspended)return Promise.resolve(!1);this.requestNextFlush();return this.waitForAllDownstream()}async waitForAllDownstream(timeout){const baseTasks=[];timeout&&baseTasks.push(delay(timeout,RESULT_TIMED_OUT));do{const idleTasks=this.idleDetectors(),tasks3=[...baseTasks,Promise.all(idleTasks)];if(await Promise.race(tasks3)===RESULT_TIMED_OUT)return!1}while(!this.isIdle());return!0}waitForAllProcessed(timeout){this.root.startPipeline();return this.root.waitForAllDownstream(timeout)}async waitForAllDoneAndTerminate(timeout){this.root.startPipeline();const r4=await this.root.waitForAllDownstream(timeout);this.terminateAll();return r4}async _runProcessor(items){const ret=await this._processor(items);ret&&(this._pipeTo?this._pipeTo.enqueueAll(ret):this._keepResultUntilDownstreamConnected&&this._keptResult.push(...ret))}async*pump(){do{const ticked=await this._waitFor(["tickImmediate","yielded","tickSuspended","tickDelayTimeout","tickSuspended"]);L2:do{const items=this._collectBatch();if(0==items.length)break L2;yield items}while(this._canCollectBatch());if("tickSuspended"==ticked)break}while(!this._isSuspended)}_initClerks(){this._collected=new Inbox(2*this.concurrentLimit);this._clerks=new ClerkGroup({assigned:this._collected,job:async items=>{const batchLength=items.length;this.updateStatus(()=>{this.processingEntities+=batchLength;this.waitingEntries-=batchLength});await this._intervalPaceMaker.paced;this._processCount++;try{await this._runProcessor(items)}catch(ex){Logger("Processor error!");Logger(ex,LOG_LEVEL_VERBOSE)}this.updateStatus(()=>{this.processingEntities-=batchLength});this._processCount--;0==this._processCount&&this._notifyIfIdle()},initialMemberCount:this.concurrentLimit,instantiate:params=>new Clerk(params)})}async _process(){if(!this._processing&&!this._isSuspended)try{this._processing=!0;do{const batchPump=this.pump();for await(const batch of batchPump){if(!batch||0===batch.length){this._hub.emitEvent("tickEmpty");continue}const batchLength=batch.length;this.updateStatus(()=>{this.waitingEntries+=batchLength});await this._collected.post(batch)}}while(!this._isSuspended);this._hub.emitEvent("suspended")}finally{this._processing=!1}}_run(){this._isSuspended||this._processing||fireAndForget(()=>this._process())}terminateAll(){this.root.terminate()}terminate(){if(this._pipeTo){this._pipeTo.terminate();this._pipeTo=void 0}this._isSuspended=!0;this._enqueueProcessor=()=>[];this._processor=()=>Promise.resolve([]);this.clearQueue();this._hub.emitEvent("tickSuspended");this._hub.emitEvent("tickSuspended");this._hub.emitEvent("tickSuspended");this._collected.dispose();this._clerks.dispose();this._queue.length=0;allRunningProcessors.delete(this)}};HiddenFileSync=class extends LiveSyncCommands{constructor(){super(...arguments);this.periodicInternalFileScanProcessor=new PeriodicProcessor(this.core,async()=>this.isThisModuleEnabled()&&this._isDatabaseReady()&&await this.scanAllStorageChanges(!1));this.semaphore=Semaphore(10);this.conflictResolutionProcessor=new QueueProcessor(async paths=>{var _a8,_b5,_c3;const path2=paths[0];sendSignal(`cancel-internal-conflict:${path2}`);try{const id=await this.path2id(path2,ICHeader),doc=await this.localDatabase.getRaw(id,{conflicts:!0});if(void 0===doc._conflicts)return[];if(0==doc._conflicts.length)return[];this._log(`Hidden file conflicted:${path2}`);const conflicts=doc._conflicts.sort((a2,b3)=>Number(a2.split("-")[0])-Number(b3.split("-")[0])),revA=doc._rev,revB=conflicts[0];if(path2.endsWith(".json")){const conflictedRev=conflicts[0],conflictedRevNo=Number(conflictedRev.split("-")[0]),commonBase=null!=(_c3=null==(_b5=null==(_a8=(await this.localDatabase.getRaw(id,{revs_info:!0}))._revs_info)?void 0:_a8.filter(e3=>"available"==e3.status&&Number(e3.rev.split("-")[0])r4.test(stripAllPrefixes(path2)))){this._log(`Overwrite rule applied for conflicted hidden file: ${path2}`,LOG_LEVEL_INFO);await this.resolveByNewerEntry(id,path2,doc,revA,revB);return[]}return[{path:path2,revA,revB,id,doc}]}await this.resolveByNewerEntry(id,path2,doc,revA,revB);return[]}catch(ex){this._log(`Failed to resolve conflict (Hidden): ${path2}`);this._log(ex,LOG_LEVEL_VERBOSE);return[]}},{suspended:!1,batchSize:1,concurrentLimit:5,delay:10,keepResultUntilDownstreamConnected:!0,yieldThreshold:10,pipeTo:new QueueProcessor(async results=>{const{id,doc,path:path2,revA,revB}=results[0],prefixedPath=addPrefix(path2,ICHeader),docAMerge=await this.localDatabase.getDBEntry(prefixedPath,{rev:revA}),docBMerge=await this.localDatabase.getDBEntry(prefixedPath,{rev:revB});0==docAMerge||0==docBMerge?await this.resolveByNewerEntry(id,path2,doc,revA,revB):await this.showJSONMergeDialogAndMerge(docAMerge,docBMerge)&&this.conflictResolutionProcessor.enqueue(path2)},{suspended:!1,batchSize:1,concurrentLimit:1,delay:10,keepResultUntilDownstreamConnected:!1,yieldThreshold:10})});this.cacheFileRegExps=new Map;this.cacheCustomisationSyncIgnoredFiles=new Map;this.queuedNotificationFiles=new Set}isThisModuleEnabled(){return this.core.settings.syncInternalFiles}get kvDB(){return this.core.kvDB}getConflictedDoc(path2,rev3){return this.core.localDatabase.managers.conflictManager.getConflictedDoc(path2,rev3)}onunload(){var _a8;null==(_a8=this.periodicInternalFileScanProcessor)||_a8.disable()}onload(){this.services.API.addCommand({id:"livesync-sync-internal",name:"(re)initialise hidden files between storage and database",callback:()=>{this.isReady()&&this.initialiseInternalFileSync("safe",!0)}});this.services.API.addCommand({id:"livesync-scaninternal-storage",name:"Scan hidden file changes on the storage",callback:()=>{this.isReady()&&this.scanAllStorageChanges(!0)}});this.services.API.addCommand({id:"livesync-scaninternal-database",name:"Scan hidden file changes on the local database",callback:()=>{this.isReady()&&this.scanAllDatabaseChanges(!0)}});this.services.API.addCommand({id:"livesync-internal-scan-offline-changes",name:"Scan and apply all offline hidden-file changes",callback:()=>{this.isReady()&&this.applyOfflineChanges(!0)}});eventHub.onEvent(EVENT_SETTING_SAVED,()=>{this.updateSettingCache()})}async _everyOnDatabaseInitialized(showNotice){this._fileInfoLastProcessed=await autosaveCache(this.kvDB,"hidden-file-lastProcessed");this._databaseInfoLastProcessed=await autosaveCache(this.kvDB,"hidden-file-lastProcessed-database");this._fileInfoLastKnown=await autosaveCache(this.kvDB,"hidden-file-lastKnown");if(this.isThisModuleEnabled())if(0==this._fileInfoLastProcessed.size&&0==this._fileInfoLastProcessed.size){this._log("No cache found. Performing startup scan.",LOG_LEVEL_VERBOSE);await this.performStartupScan(!0)}else await this.performStartupScan(showNotice);return!0}async _everyBeforeReplicate(showNotice){this.isThisModuleEnabled()&&this._isDatabaseReady()&&this.settings.syncInternalFilesBeforeReplication&&!this.settings.watchInternalFileChanges&&await this.scanAllStorageChanges(showNotice);return!0}_everyOnloadAfterLoadSettings(){this.updateSettingCache();return Promise.resolve(!0)}updateSettingCache(){this.cacheCustomisationSyncIgnoredFiles.clear();this.cacheFileRegExps.clear()}isReady(){return!!this._isMainReady&&!this._isMainSuspended()&&!!this.isThisModuleEnabled()}async performStartupScan(showNotice){await this.applyOfflineChanges(showNotice)}async _everyOnResumeProcess(){var _a8;null==(_a8=this.periodicInternalFileScanProcessor)||_a8.disable();if(this._isMainSuspended())return!0;this.isThisModuleEnabled()&&await this.performStartupScan(!1);this.periodicInternalFileScanProcessor.enable(this.isThisModuleEnabled()&&this.settings.syncInternalFilesInterval?1e3*this.settings.syncInternalFilesInterval:0);return!0}_everyRealizeSettingSyncMode(){var _a8;null==(_a8=this.periodicInternalFileScanProcessor)||_a8.disable();if(this._isMainSuspended())return Promise.resolve(!0);if(!this.services.appLifecycle.isReady())return Promise.resolve(!0);this.periodicInternalFileScanProcessor.enable(this.isThisModuleEnabled()&&this.settings.syncInternalFilesInterval?1e3*this.settings.syncInternalFilesInterval:0);this.cacheFileRegExps.clear();return Promise.resolve(!0)}async _anyProcessOptionalFileEvent(path2){return this.isReady()&&await this.trackStorageFileModification(path2)||!1}_anyGetOptionalConflictCheckMethod(path2){if(isInternalMetadata(path2)){this.queueConflictCheck(path2);return Promise.resolve(!0)}return Promise.resolve(!1)}async _anyProcessOptionalSyncFiles(doc){if(isInternalMetadata(doc._id)){if(this.isThisModuleEnabled()){const unprefixedPath=stripAllPrefixes(this.getPath(doc));if(!await this.isTargetFile(stripAllPrefixes(unprefixedPath))){this._log(`Skipped processing sync file:${unprefixedPath} (Not Hidden File Sync target)`,LOG_LEVEL_VERBOSE);return!0}await this.processReplicationResult(doc)||this._log(`Failed to process sync file:${unprefixedPath}`,LOG_LEVEL_NOTICE)}return!0}return!1}async loadFileWithInfo(path2){var _a8,_b5;const stat=await this.core.storageAccess.statHidden(path2);if(!stat)return{name:null!=(_a8=path2.split("/").pop())?_a8:"",path:path2,stat:{size:0,mtime:0,ctime:0,type:"file"},isInternal:!0,deleted:!0,body:createBlob(new Uint8Array(0))};const content=await this.core.storageAccess.readHiddenFileAuto(path2);return{name:null!=(_b5=path2.split("/").pop())?_b5:"",path:path2,stat,isInternal:!0,deleted:!1,body:createBlob(content)}}statToKey(stat){var _a8,_b5;return`${null!=(_a8=null==stat?void 0:stat.mtime)?_a8:0}-${null!=(_b5=null==stat?void 0:stat.size)?_b5:0}`}docToKey(doc){return`${doc.mtime}-${doc.size}-${doc._rev}-${doc._deleted||doc.deleted?"-0":"-1"}`}async fileToStatKey(file,stat=null){stat||(stat=await this.core.storageAccess.statHidden(file));return this.statToKey(stat)}updateLastProcessedFile(file,keySrc){const key3="string"==typeof keySrc?keySrc:this.statToKey(keySrc),splitted=key3.split("-");"0"!=splitted[0]&&this._fileInfoLastKnown.set(file,Number(splitted[0]));this._fileInfoLastProcessed.set(file,key3)}async updateLastProcessedAsActualFile(file,stat){stat||(stat=await this.core.storageAccess.statHidden(file));this._fileInfoLastProcessed.set(file,this.statToKey(stat))}resetLastProcessedFile(targetFiles){if(targetFiles)for(const key3 of targetFiles)this._fileInfoLastProcessed.delete(key3);else{this._log("Delete all processed mark.",LOG_LEVEL_VERBOSE);this._fileInfoLastProcessed.clear()}}getLastProcessedFileMTime(file){return this._fileInfoLastKnown.get(file)||0}getLastProcessedFileKey(file){return this._fileInfoLastProcessed.get(file)}getLastProcessedDatabaseKey(file){return this._databaseInfoLastProcessed.get(file)}updateLastProcessedDatabase(file,keySrc){const key3="string"==typeof keySrc?keySrc:this.docToKey(keySrc);this._databaseInfoLastProcessed.set(file,key3)}updateLastProcessed(path2,db,stat){this.updateLastProcessedDatabase(path2,db);this.updateLastProcessedFile(path2,this.statToKey(stat));const dbMTime=getComparingMTime(db),storageMTime=getComparingMTime(stat);0==dbMTime||0==storageMTime?this.services.path.unmarkChanges(path2):this.services.path.markChangesAreSame(path2,getComparingMTime(db),getComparingMTime(stat))}updateLastProcessedDeletion(path2,db){this.services.path.unmarkChanges(path2);db&&this.updateLastProcessedDatabase(path2,db);this.updateLastProcessedFile(path2,this.statToKey(null))}async ensureDir(path2){await this.core.storageAccess.isExistsIncludeHidden(path2)||await this.core.storageAccess.ensureDir(path2)}async writeFile(path2,data,opt){await this.core.storageAccess.writeHiddenFileAuto(path2,data,opt);return await this.core.storageAccess.statHidden(path2)}async __removeFile(path2){try{if(!await this.core.storageAccess.isExistsIncludeHidden(path2))return"ALREADY";if(await this.core.storageAccess.removeHidden(path2))return"OK"}catch(ex){this._log(`Failed to remove file:${path2}`);this._log(ex,LOG_LEVEL_VERBOSE)}return!1}async triggerEvent(path2){try{await this.core.storageAccess.triggerHiddenFile(path2)}catch(ex){this._log("Failed to call internal API(reconcileInternalFile)",LOG_LEVEL_VERBOSE);this._log(ex,LOG_LEVEL_VERBOSE)}}async updateLastProcessedAsActualDatabase(file,doc){const dbPath=addPrefix(file,ICHeader);doc||(doc=await this.localDatabase.getDBEntryMeta(dbPath));doc&&this._databaseInfoLastProcessed.set(file,this.docToKey(doc))}resetLastProcessedDatabase(targetFiles){if(targetFiles)for(const key3 of targetFiles)this._databaseInfoLastProcessed.delete(key3);else{this._log("Delete all processed mark.",LOG_LEVEL_VERBOSE);this._databaseInfoLastProcessed.clear()}}async adoptCurrentStorageFilesAsProcessed(targetFiles){const allFiles=await this.scanInternalFileNames(),files=targetFiles?allFiles.filter(e3=>targetFiles.some(t9=>-1!==e3.indexOf(t9))):allFiles;for(const file of files)await this.updateLastProcessedAsActualFile(file)}async adoptCurrentDatabaseFilesAsProcessed(targetFiles){const allFiles=await this.getAllDatabaseFiles(),files=targetFiles?allFiles.filter(e3=>targetFiles.some(t9=>-1!==e3.path.indexOf(t9))):allFiles;for(const file of files){const path2=stripAllPrefixes(this.getPath(file));await this.updateLastProcessedAsActualDatabase(path2,file)}}async serializedForEvent(file,fn){hiddenFilesEventCount.value++;const rel=await this.semaphore.acquire();try{return await serialized(`hidden-file-event:${file}`,async()=>{hiddenFilesProcessingCount.value++;try{return await fn()}finally{hiddenFilesProcessingCount.value--}})}finally{rel();hiddenFilesEventCount.value--}}async useStorageFiles(files,showNotice=!1,onlyNew=!1){return await this.trackScannedStorageChanges(files,showNotice,onlyNew,!0)}async trackScannedStorageChanges(processFiles,showNotice=!1,onlyNew=!1,forceWriteAll=!1,includeDeleted=!0){const logLevel=getLogLevel(showNotice),p2=this._progress("[⚙ Storage -> DB ]\n",logLevel),notifyProgress=onlyInNTimes(100,progress=>p2.log(`${progress}/${processFiles.length}`)),processes=processFiles.map(async(file,i2)=>{try{await this.trackStorageFileModification(file,onlyNew,forceWriteAll,includeDeleted);notifyProgress()}catch(ex){p2.once(`Failed to process storage change file:${file}`);this._log(ex,LOG_LEVEL_VERBOSE)}});await Promise.all(processes);p2.done()}async scanAllStorageChanges(showNotice=!1,onlyNew=!1,forceWriteAll=!1,includeDeleted=!0){return await skipIfDuplicated("scanAllStorageChanges",async()=>{const logLevel=getLogLevel(showNotice),p2=this._progress("[⚙ Scanning Storage -> DB ]\n",logLevel);p2.log("Scanning storage files...");const knownNames=[...this._fileInfoLastProcessed.keys()],existNames=await this.scanInternalFileNames(),files=new Set([...knownNames,...existNames]);this._log(`Known/Exist ${knownNames.length}/${existNames.length}, Totally ${files.size} files.`,LOG_LEVEL_VERBOSE);const taskNameAndMeta=[...files].map(async e3=>[e3,await this.core.storageAccess.statHidden(e3)]),processFiles=(await Promise.all(taskNameAndMeta)).filter(([path2,stat])=>!!forceWriteAll||this.getLastProcessedFileKey(path2)!=this.statToKey(stat)).map(([path2,stat])=>path2),staticsMessage=`[Storage hidden file statics]\nKnown files: ${knownNames.length}\nActual files: ${existNames.length}\nAll files: ${files.size}\nOffline Changed files: ${processFiles.length}`;p2.once(staticsMessage);await this.trackScannedStorageChanges(processFiles,showNotice,onlyNew,forceWriteAll,includeDeleted);p2.done()})}async trackStorageFileModification(path2,onlyNew=!1,forceWrite=!1,includeDeleted=!0){if(!await this.isTargetFile(path2)){this._log(`Storage file tracking: Hidden file skipped: ${path2} is filtered out by the defined patterns.`,LOG_LEVEL_VERBOSE);return!1}try{return await this.serializedForEvent(path2,async()=>{let stat=await this.core.storageAccess.statHidden(path2);if(null!=stat&&"file"!=stat.type)return!1;const key3=await this.fileToStatKey(path2,stat),lastKey=this.getLastProcessedFileKey(path2);if(lastKey==key3){this._log(`${path2} Already processed.`,LOG_LEVEL_DEBUG);return!0}const cache2=await this.loadFileWithInfo(path2);if(getComparingMTime(cache2.stat)!=getComparingMTime(stat)){this._log(`Hidden file:${path2} is changed.`,LOG_LEVEL_VERBOSE);stat=cache2.stat}this.updateLastProcessedFile(path2,stat);const lastIsNotFound=!lastKey||lastKey.endsWith("-0-0"),nowIsNotFound=cache2.deleted,type=lastIsNotFound&&nowIsNotFound?"invalid":nowIsNotFound?"delete":"modified";if("invalid"==type)return!1;const storageMTimeActual=getComparingMTime(stat),storageMTime=0==storageMTimeActual?this.getLastProcessedFileMTime(path2):storageMTimeActual;if(onlyNew){const prefixedFileName=addPrefix(path2,ICHeader),filesOnDB=await this.localDatabase.getDBEntryMeta(prefixedFileName);if(compareMTime(storageMTime,getComparingMTime(filesOnDB,includeDeleted))!=TARGET_IS_NEW){this._log(`Hidden file:${path2} is not new.`,LOG_LEVEL_VERBOSE);filesOnDB&&stat&&this.updateLastProcessed(path2,filesOnDB,stat);return!0}}if("delete"==type){this._log(`Deletion detected: ${path2}`);return await this.deleteInternalFileOnDatabase(path2,forceWrite)}if("modified"==type){this._log(`Modification detected:${path2}`,LOG_LEVEL_VERBOSE);const result=await this.storeInternalFileToDatabase(cache2,forceWrite),resultText=void 0===result?"Nothing changed":result?"Updated":"Failed";this._log(`${resultText}: ${path2} ${resultText}`,LOG_LEVEL_VERBOSE);return result}})}catch(ex){this._log(`Failed to process hidden file:${path2}`);this._log(ex,LOG_LEVEL_VERBOSE)}return!0}queueConflictCheck(path2){this.conflictResolutionProcessor.enqueue(path2)}async resolveConflictOnInternalFiles(){const conflicted=this.localDatabase.findEntries(ICHeader,"i;",{conflicts:!0});this.conflictResolutionProcessor.suspend();try{for await(const doc of conflicted)"_conflicts"in doc&&isInternalMetadata(doc._id)&&this.conflictResolutionProcessor.enqueue(doc.path)}catch(ex){this._log("something went wrong on resolving all conflicted internal files");this._log(ex,LOG_LEVEL_VERBOSE)}await this.conflictResolutionProcessor.startPipeline().waitForAllProcessed()}async resolveByNewerEntry(id,path2,currentDoc,currentRev,conflictedRev){var _a8;const conflictedDoc=await this.localDatabase.getRaw(id,{rev:conflictedRev}),delRev=getComparingMTime(currentDoc,!0){this._log("Opening data-merging dialog",LOG_LEVEL_VERBOSE);const docs=[docA,docB],strippedPath=stripAllPrefixes(docA.path),storageFilePath=strippedPath,storeFilePath=strippedPath,displayFilename=`${storeFilePath}`;new JsonResolveModal(this.app,storageFilePath,[docA,docB],async(keep,result)=>{var _a8,_b5;try{let needFlush=!1;if(!result&&!keep){this._log(`Skipped merging: ${displayFilename}`);res2(!1);return}if(result||keep)for(const doc of docs)if(doc._rev!=keep&&await this.localDatabase.deleteDBEntry(this.getPath(doc),{rev:doc._rev})){this._log(`Conflicted revision has been deleted: ${displayFilename}`);needFlush=!0}if(!keep&&result){await this.core.storageAccess.isExistsIncludeHidden(storageFilePath)||await this.core.storageAccess.ensureDir(storageFilePath);const stat=await this.writeFile(storageFilePath,result);if(!stat)throw new Error("Stat failed");const mtime=getComparingMTime(stat);await this.storeInternalFileToDatabase({path:storageFilePath,mtime,ctime:null!=(_a8=null==stat?void 0:stat.ctime)?_a8:mtime,size:null!=(_b5=null==stat?void 0:stat.size)?_b5:0},!0);await this.triggerEvent(storageFilePath);this._log(`STORAGE <-- DB:${displayFilename}: written (hidden,merged)`)}needFlush&&(await this.extractInternalFileFromDatabase(storeFilePath,!1)?this._log(`STORAGE --\x3e DB:${displayFilename}: extracted (hidden,merged)`):this._log(`STORAGE --\x3e DB:${displayFilename}: extracted (hidden,merged) Failed`));res2(!0)}catch(ex){this._log("Could not merge conflicted json");this._log(ex,LOG_LEVEL_VERBOSE);res2(!1)}}).open()})}getDocProps(doc){const id=doc._id,shortenedId=id.substring(0,10),prefixedPath=this.getPath(doc),path2=stripAllPrefixes(prefixedPath),rev3=doc._rev,revDisplay=rev3?displayRev(rev3):"0-NOREVS",shortenedPath=path2.substring(0,10);return{id,rev:rev3,revDisplay,prefixedPath,path:path2,isDeleted:doc._deleted||doc.deleted||!1,shortenedId,shortenedPath}}async processReplicationResult(doc){const info3=this.getDocProps(doc),path2=info3.path,headerLine=`Tracking DB ${info3.path} (${info3.revDisplay}) :`,ret=await this.trackDatabaseFileModification(path2,headerLine);this._log(`${headerLine} Done: ${info3.shortenedId})`,LOG_LEVEL_VERBOSE);return ret}parseRegExpSettings(){const regExpKey=`${this.core.settings.syncInternalFilesTargetPatterns}||${this.core.settings.syncInternalFilesIgnorePatterns}`;let ignoreFilter,targetFilter;if(this.cacheFileRegExps.has(regExpKey)){const cached=this.cacheFileRegExps.get(regExpKey);ignoreFilter=cached[1];targetFilter=cached[0]}else{ignoreFilter=getFileRegExp(this.core.settings,"syncInternalFilesIgnorePatterns");targetFilter=getFileRegExp(this.core.settings,"syncInternalFilesTargetPatterns");this.cacheFileRegExps.clear();this.cacheFileRegExps.set(regExpKey,[targetFilter,ignoreFilter])}return{ignoreFilter,targetFilter}}isTargetFileInPatterns(path2){const{ignoreFilter,targetFilter}=this.parseRegExpSettings();if(ignoreFilter&&ignoreFilter.length>0)for(const pattern of ignoreFilter)if(pattern.test(path2))return!1;if(targetFilter&&targetFilter.length>0){for(const pattern of targetFilter)if(pattern.test(path2))return!0;return!1}return!0}getCustomisationSynchronizationIgnoredFiles(){const configDir=this.services.API.getSystemConfigDir(),key3=JSON.stringify(this.settings.pluginSyncExtendedSetting)+`||${this.settings.usePluginSync}||${configDir}`;if(this.cacheCustomisationSyncIgnoredFiles.has(key3))return this.cacheCustomisationSyncIgnoredFiles.get(key3);this.cacheCustomisationSyncIgnoredFiles.clear();const synchronisedInConfigSync=this.settings.usePluginSync?Object.values(this.settings.pluginSyncExtendedSetting).filter(e3=>e3.mode==MODE_SELECTIVE||e3.mode==MODE_PAUSED).map(e3=>e3.files).flat().map(e3=>`${configDir}/${e3}`.toLowerCase()):[];this.cacheCustomisationSyncIgnoredFiles.set(key3,synchronisedInConfigSync);return synchronisedInConfigSync}isNotIgnoredByCustomisationSync(path2){return!this.getCustomisationSynchronizationIgnoredFiles().some(e3=>path2.startsWith(e3))}isHiddenFileSyncHandlingPath(path2){return path2.startsWith(".")&&!path2.startsWith(".trash")}async isTargetFile(path2){return!!(this.isTargetFileInPatterns(path2)&&this.isNotIgnoredByCustomisationSync(path2)&&this.isHiddenFileSyncHandlingPath(path2))&&!await this.services.vault.isIgnoredByIgnoreFile(path2)}async trackScannedDatabaseChange(processFiles,showNotice=!1,onlyNew=!1,forceWriteAll=!1,includeDeletion=!0){const logLevel=getLogLevel(showNotice),p2=this._progress("[⚙ DB -> Storage ]\n",logLevel),notifyProgress=onlyInNTimes(100,progress=>p2.log(`${progress}/${processFiles.length}`)),processes=processFiles.map(async file=>{try{const path2=stripAllPrefixes(this.getPath(file));await this.isTargetFile(path2)?await this.trackDatabaseFileModification(path2,"[Hidden file scan]",!forceWriteAll,onlyNew,file,includeDeletion):this._log(`Database file tracking: Hidden file skipped: ${path2} is filtered out by the defined patterns.`,LOG_LEVEL_VERBOSE);notifyProgress()}catch(ex){this._log(`Failed to process storage change file:${file}`,logLevel);this._log(ex,LOG_LEVEL_VERBOSE)}});await Promise.all(processes);p2.done()}async applyOfflineChanges(showNotice){const logLevel=getLogLevel(showNotice);return await serialized("applyOfflineChanges",async()=>{const p2=this._progress("[⚙ Apply untracked changes ]\n",logLevel);this._log("Track changes.",logLevel);p2.log("Enumerating local files...");const currentStorageFiles=await this.scanInternalFileNames();p2.log("Enumerating database files...");const currentDatabaseFiles=await this.getAllDatabaseFiles(),allDatabaseMap=Object.fromEntries(currentDatabaseFiles.map(e3=>[stripAllPrefixes(this.getPath(e3)),e3])),currentDatabaseFileNames=[...Object.keys(allDatabaseMap)],untrackedLocal=currentStorageFiles.filter(e3=>!this._fileInfoLastProcessed.has(e3)),untrackedDatabase=currentDatabaseFileNames.filter(e3=>!this._databaseInfoLastProcessed.has(e3)),bothUntracked=untrackedLocal.filter(e3=>-1!==untrackedDatabase.indexOf(e3));p2.log("Applying untracked changes...");const stat=`Tracking statics:\nLocal files: ${currentStorageFiles.length}\nDatabase files: ${currentDatabaseFileNames.length}\nUntracked local files: ${untrackedLocal.length}\nUntracked database files: ${untrackedDatabase.length}\nCommon untracked files: ${bothUntracked.length}`;p2.once(stat);const semaphores2=Semaphore(10),notifyProgress=onlyInNTimes(25,progress=>p2.log(`${progress}/${bothUntracked.length}`)),allProcesses=bothUntracked.map(async file=>{notifyProgress();const rel=await semaphores2.acquire();try{const fileStat=await this.core.storageAccess.statHidden(file);if(null==fileStat){this._log(`Unexpected error: Failed to stat file during applyOfflineChange :${file}`);return}const dbInfo=allDatabaseMap[file];if(dbInfo.deleted||dbInfo._deleted)return;const diff=compareMTime(getComparingMTime(fileStat),getComparingMTime(dbInfo));diff==BASE_IS_NEW?await this.trackStorageFileModification(file,!0):diff==TARGET_IS_NEW?await this.trackDatabaseFileModification(file,"[Apply]",!0,!0,dbInfo):diff==EVEN&&this.updateLastProcessed(file,dbInfo,fileStat)}finally{rel()}});await Promise.all(allProcesses);await this.scanAllStorageChanges(showNotice);await this.scanAllDatabaseChanges(showNotice);p2.done()})}async scanAllDatabaseChanges(showNotice=!1,onlyNew=!1,forceWriteAll=!1,includeDeletion=!0){return await skipIfDuplicated("scanAllDatabaseChanges",async()=>{const databaseFiles=await this.getAllDatabaseFiles(),files=databaseFiles.filter(e3=>{const doc=e3,key3=this.docToKey(doc),path2=stripAllPrefixes(this.getPath(doc));return this.getLastProcessedDatabaseKey(path2)!=key3}),logLevel=getLogLevel(showNotice),staticsMessage=`[Database hidden file statics]\nAll files: ${databaseFiles.length}\nOffline Changed files: ${files.length}`;this._log(staticsMessage,logLevel,"scan-changes");return await this.trackScannedDatabaseChange(files,showNotice,onlyNew,forceWriteAll,includeDeletion)})}async useDatabaseFiles(files,showNotice=!1,onlyNew=!1){const logLevel=getLogLevel(showNotice),p2=this._progress("[⚙ Scanning DB -> Storage ]\n",logLevel);p2.log("Scanning database files...");const notifyProgress=onlyInNTimes(25,progress=>p2.log(`${progress}/${files.length}`)),processFiles=files.map(async file=>{try{const path2=stripAllPrefixes(this.getPath(file));await this.trackDatabaseFileModification(path2,"[Scanning]",!0,onlyNew,file);notifyProgress()}catch(ex){this._log(`Failed to process database changes:${file}`);this._log(ex,LOG_LEVEL_VERBOSE)}});await Promise.all(processFiles);p2.done();return!0}async trackDatabaseFileModification(path2,headerLine,preventDoubleProcess=!1,onlyNew=!1,meta=!1,includeDeletion=!0){return await this.serializedForEvent(path2,async()=>{try{const prefixedPath=addPrefix(path2,ICHeader),docMeta=meta||await this.localDatabase.getDBEntryMeta(prefixedPath,{conflicts:!0},!0);if(!1===docMeta){this._log(`${headerLine}: Failed to read detail of ${path2}`);throw new Error(`Failed to read detail ${path2}`)}if(docMeta._conflicts&&docMeta._conflicts.length>0){this.conflictResolutionProcessor.enqueue(path2);this._log(`${headerLine} Hidden file conflicted, enqueued to resolve`);return!0}await this.extractInternalFileFromDatabase(path2,!1,docMeta,preventDoubleProcess,onlyNew,includeDeletion)&&this._log(`${headerLine} Hidden file processed`)}catch(ex){this._log(`${headerLine} Failed to process hidden file`);this._log(ex,LOG_LEVEL_VERBOSE)}return!0})}notifyConfigChange(){const updatedFolders=[...this.queuedNotificationFiles];this.queuedNotificationFiles.clear();try{const manifests=Object.values(this.app.plugins.manifests),enabledPlugins=this.app.plugins.enabledPlugins,modifiedManifests=manifests.filter(e3=>enabledPlugins.has(e3.id)).filter(e3=>{var _a8;return updatedFolders.indexOf(null!=(_a8=null==e3?void 0:e3.dir)?_a8:"")>=0});for(const manifest of modifiedManifests){const updatePluginId=manifest.id,updatePluginName=manifest.name;this.core.confirm.askInPopup(`updated-${updatePluginId}`,`Files in ${updatePluginName} has been updated!\nPress {HERE} to reload ${updatePluginName}, or press elsewhere to dismiss this message.`,anchor=>{anchor.text="HERE";anchor.addEventListener("click",()=>{fireAndForget(async()=>{this._log(`Unloading plugin: ${updatePluginName}`,LOG_LEVEL_NOTICE,"plugin-reload-"+updatePluginId);await this.app.plugins.unloadPlugin(updatePluginId);await this.app.plugins.loadPlugin(updatePluginId);this._log(`Plugin reloaded: ${updatePluginName}`,LOG_LEVEL_NOTICE,"plugin-reload-"+updatePluginId)})})})}}catch(ex){this._log("Error on checking plugin status.");this._log(ex,LOG_LEVEL_VERBOSE)}updatedFolders.indexOf(this.services.API.getSystemConfigDir())>=0&&(this.services.appLifecycle.isReloadingScheduled()||this.core.confirm.askInPopup("updated-any-hidden","Some setting files have been modified\nPress {HERE} to schedule a reload of Obsidian, or press elsewhere to dismiss this message.",anchor=>{anchor.text="HERE";anchor.addEventListener("click",()=>{this.services.appLifecycle.scheduleRestart()})}))}queueNotification(key3){if(this.settings.suppressNotifyHiddenFilesChange)return;const configDir=this.services.API.getSystemConfigDir();if(!key3.startsWith(configDir))return;const dirName=key3.split("/").slice(0,-1).join("/");this.queuedNotificationFiles.add(dirName);scheduleTask("notify-config-change",1e3,()=>{this.notifyConfigChange()})}async rebuildMerging(showNotice,targetFiles=!1){const logLevel=getLogLevel(showNotice),p2=this._progress("[⚙ Rebuild by Merge ]\n",logLevel);this._log("Rebuilding hidden files from the storage and the local database.",logLevel);p2.log("Enumerating local files...");const currentStorageFilesAll=await this.scanInternalFileNames(),currentStorageFiles=targetFiles?currentStorageFilesAll.filter(e3=>targetFiles.some(f4=>f4==e3)):currentStorageFilesAll;p2.log("Enumerating database files...");const allDatabaseFiles=await this.getAllDatabaseFiles(),allDatabaseMap=new Map(allDatabaseFiles.map(e3=>[stripAllPrefixes(this.getPath(e3)),e3])),currentDatabaseFiles=targetFiles?allDatabaseFiles.filter(e3=>targetFiles.some(f4=>f4==stripAllPrefixes(this.getPath(e3)))):allDatabaseFiles,allFileNames=new Set([...currentStorageFiles,...currentDatabaseFiles.map(e3=>stripAllPrefixes(this.getPath(e3)))]),storageToDatabase=[],databaseToStorage=[],eachProgress=onlyInNTimes(100,progress=>p2.log(`Checking ${progress}/${allFileNames.size}`));for(const file of allFileNames){eachProgress();const mtimeStorage=getComparingMTime(await this.core.storageAccess.statHidden(file)),dbEntry=allDatabaseMap.get(file),diff=compareMTime(mtimeStorage,getComparingMTime(dbEntry));diff==BASE_IS_NEW?storageToDatabase.push(file):diff==TARGET_IS_NEW?databaseToStorage.push(dbEntry):diff==EVEN&&storageToDatabase.push(file)}p2.once(`Storage to Database: ${storageToDatabase.length} files\n Database to Storage: ${databaseToStorage.length} files`);this.resetLastProcessedDatabase(targetFiles);this.resetLastProcessedFile(targetFiles);const processes=[this.useStorageFiles(storageToDatabase,showNotice,!1),this.useDatabaseFiles(databaseToStorage,showNotice,!1)];p2.log("Start processing...");await Promise.all(processes);p2.done();return[...allFileNames]}async rebuildFromStorage(showNotice,targetFiles=!1,onlyNew=!1){const logLevel=getLogLevel(showNotice);this._verbose("Rebuilding hidden files from the storage.");this._log("Rebuilding hidden files from the storage.",logLevel);const p2=this._progress("[⚙ Rebuild by Storage ]\n",logLevel);p2.log("Enumerating local files...");const currentFilesAll=await this.scanInternalFileNames(),currentFiles=targetFiles?currentFilesAll.filter(e3=>targetFiles.some(f4=>f4==e3)):currentFilesAll;p2.once(`Storage to Database: ${currentFiles.length} files.`);p2.log("Start processing...");this.resetLastProcessedFile(targetFiles);await this.useStorageFiles(currentFiles,showNotice,onlyNew);p2.done();return currentFiles}async getAllDatabaseFiles(){const allFiles=(await this.localDatabase.allDocsRaw({startkey:ICHeader,endkey:"i;",include_docs:!0})).rows.filter(e3=>isInternalMetadata(e3.id)).map(e3=>e3.doc),files=[];for(const file of allFiles)await this.isTargetFile(stripAllPrefixes(this.getPath(file)))&&files.push(file);return files}async rebuildFromDatabase(showNotice,targetFiles=!1,onlyNew=!1){const logLevel=getLogLevel(showNotice);this._verbose("Rebuilding hidden files from the local database.");const p2=this._progress("[⚙ Rebuild by Database ]\n",logLevel);p2.log("Enumerating database files...");const allFiles=await this.getAllDatabaseFiles(),currentFiles=targetFiles?allFiles.filter(e3=>targetFiles.some(f4=>f4==stripAllPrefixes(this.getPath(e3)))):allFiles;p2.once(`Database to Storage: ${currentFiles.length} files.`);this.resetLastProcessedDatabase(targetFiles);p2.log("Start processing...");await this.useDatabaseFiles(currentFiles,showNotice,onlyNew);p2.done();return currentFiles}async initialiseInternalFileSync(direction,showMessage,targetFilesSrc=!1){const logLevel=showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,p2=this._progress("[⚙ Initialise]\n",logLevel);p2.log("Initialising hidden files sync...");const targetFiles=!!targetFilesSrc&&targetFilesSrc.map(e3=>stripAllPrefixes(e3));if("pushForce"==direction||"push"==direction){const onlyNew="push"==direction;p2.log("Started: Storage --\x3e Database "+(onlyNew?"(Only New)":""));const updatedFiles=await this.rebuildFromStorage(showMessage,targetFiles,onlyNew);await this.adoptCurrentStorageFilesAsProcessed(updatedFiles);await this.adoptCurrentDatabaseFilesAsProcessed(updatedFiles);await this.scanAllStorageChanges(showMessage,!0,!1);await this.scanAllDatabaseChanges(showMessage,!0,!1)}if("pullForce"==direction||"pull"==direction){const onlyNew="pull"==direction;p2.log("Started: Database --\x3e Storage "+(onlyNew?"(Only New)":""));const updatedFiles=(await this.rebuildFromDatabase(showMessage,targetFiles,onlyNew)).map(e3=>stripAllPrefixes(this.getPath(e3)));await this.adoptCurrentStorageFilesAsProcessed(updatedFiles);await this.adoptCurrentDatabaseFilesAsProcessed(updatedFiles);await this.scanAllDatabaseChanges(showMessage,!0,!1);await this.scanAllStorageChanges(showMessage,!0,!1)}if("safe"==direction){p2.log("Started: Database <--\x3e Storage (by modified date)");const updatedFiles=await this.rebuildMerging(showMessage,targetFiles);await this.adoptCurrentStorageFilesAsProcessed(updatedFiles);await this.adoptCurrentDatabaseFilesAsProcessed(updatedFiles);await this.scanAllStorageChanges(showMessage,!0,!1);await this.scanAllDatabaseChanges(showMessage,!0,!1)}p2.done()}async __loadBaseSaveData(file,includeContent=!0){const prefixedFileName=addPrefix(file,ICHeader),id=await this.path2id(prefixedFileName,ICHeader);try{const old=includeContent?await this.localDatabase.getDBEntry(prefixedFileName,void 0,!1,!0):await this.localDatabase.getDBEntryMeta(prefixedFileName,{conflicts:!0},!0);return!1===old?{_id:id,data:[],path:prefixedFileName,mtime:0,ctime:0,datatype:"newnote",children:[],size:0,deleted:!1,type:"newnote",eden:{}}:old}catch(ex){this._log("Getting base save data failed");this._log(ex,LOG_LEVEL_VERBOSE);return!1}}async storeInternalFileToDatabase(file,forceWrite=!1){const storeFilePath=stripAllPrefixes(file.path),storageFilePath=file.path;if(await this.services.vault.isIgnoredByIgnoreFile(storageFilePath))return;const prefixedFileName=addPrefix(storeFilePath,ICHeader);return await serialized("file-"+prefixedFileName,async()=>{try{const fileInfo="stat"in file&&"body"in file?file:await this.loadFileWithInfo(storeFilePath);if(fileInfo.deleted)throw new Error(`Hidden file:${storeFilePath} is deleted. This should not be occurred.`);const baseData=await this.__loadBaseSaveData(storeFilePath,!0);if(!1===baseData)throw new Error("Failed to load base data");if(baseData._rev&&!forceWrite&&await isDocContentSame(readAsBlob(baseData),fileInfo.body)){this.updateLastProcessed(storeFilePath,baseData,fileInfo.stat);return}const saveData={...baseData,data:fileInfo.body,mtime:fileInfo.stat.mtime,size:fileInfo.stat.size,children:[],deleted:!1,type:baseData.datatype},ret=await this.localDatabase.putDBEntry(saveData);if(ret&&ret.ok){saveData._rev=ret.rev;this.updateLastProcessed(storeFilePath,saveData,fileInfo.stat)}const success=ret&&ret.ok;this._log(`STORAGE --\x3e DB:${storageFilePath}: (hidden) ${success?"Done":"Failed"}`);return success}catch(ex){this._log(`STORAGE --\x3e DB:${storageFilePath}: (hidden) Failed`);this._log(ex,LOG_LEVEL_VERBOSE);return!1}})}async deleteInternalFileOnDatabase(filenameSrc,forceWrite=!1){const storeFilePath=filenameSrc,storageFilePath=filenameSrc,displayFileName=filenameSrc,prefixedFileName=addPrefix(storeFilePath,ICHeader),mtime=(new Date).getTime();if(!await this.services.vault.isIgnoredByIgnoreFile(storageFilePath))return await serialized("file-"+prefixedFileName,async()=>{try{const baseData=await this.__loadBaseSaveData(storeFilePath,!1);if(!1===baseData)throw new Error("Failed to load base data during deleting");if(void 0!==baseData._conflicts)for(const conflictRev of baseData._conflicts){await this.localDatabase.removeRevision(baseData._id,conflictRev);this._log(`STORAGE -x> DB: ${displayFileName}: (hidden) conflict removed ${baseData._rev} => ${conflictRev}`,LOG_LEVEL_VERBOSE)}if(baseData.deleted){this._log(`STORAGE -x> DB: ${displayFileName}: (hidden) already deleted`,LOG_LEVEL_VERBOSE);this.updateLastProcessedDeletion(storeFilePath,baseData);return!0}const saveData={...baseData,mtime,size:0,children:[],deleted:!0,type:baseData.datatype},ret=await this.localDatabase.putRaw(saveData);if(ret&&ret.ok){this._log(`STORAGE -x> DB: ${displayFileName}: (hidden) Done`);saveData._rev=ret.rev;this.updateLastProcessedDeletion(storeFilePath,saveData);return!0}this._log(`STORAGE -x> DB: ${displayFileName}: (hidden) Failed`);return!1}catch(ex){this._log(`STORAGE -x> DB: ${displayFileName}: (hidden) Failed`);this._log(ex,LOG_LEVEL_VERBOSE);return!1}})}async extractInternalFileFromDatabase(storageFilePath,force=!1,metaEntry,preventDoubleProcess=!0,onlyNew=!1,includeDeletion=!0){const prefixedFileName=addPrefix(storageFilePath,ICHeader);if(!await this.services.vault.isIgnoredByIgnoreFile(storageFilePath))return await serialized("file-"+prefixedFileName,async()=>{var _a8,_b5;try{const metaOnDB=metaEntry||await this.localDatabase.getDBEntryMeta(prefixedFileName,{conflicts:!0},!0);if(!1===metaOnDB)throw new Error(`File not found on database.:${storageFilePath}`);if(null==(_a8=null==metaOnDB?void 0:metaOnDB._conflicts)?void 0:_a8.length){this._log(`Hidden file ${storageFilePath} has conflicted revisions, to keep in safe, writing to storage has been prevented`,LOG_LEVEL_INFO);return!1}if(preventDoubleProcess){const key3=this.docToKey(metaOnDB);if(this.getLastProcessedDatabaseKey(storageFilePath)==key3&&!force){this._log(`STORAGE <-- DB: ${storageFilePath}: skipped (hidden, overwrite${force?", force":""}) (Previously processed)`);return}}if(onlyNew){const dbMTime=getComparingMTime(metaOnDB,includeDeletion),storageStat=await this.core.storageAccess.statHidden(storageFilePath),storageMTimeActual=null!=(_b5=null==storageStat?void 0:storageStat.mtime)?_b5:0;if(compareMTime(0==storageMTimeActual?this.getLastProcessedFileMTime(storageFilePath):storageMTimeActual,dbMTime)!=TARGET_IS_NEW){this._log(`STORAGE <-- DB: ${storageFilePath}: skipped (hidden, overwrite${force?", force":""}) (Not new)`);this.updateLastProcessedDatabase(storageFilePath,metaOnDB);storageStat&&this.updateLastProcessedFile(storageFilePath,storageStat);return}}if(metaOnDB.deleted||metaOnDB._deleted){const result=await this.__deleteFile(storageFilePath);if("OK"==result){this.updateLastProcessedDeletion(storageFilePath,metaOnDB);return!0}if("ALREADY"==result){this.updateLastProcessedDatabase(storageFilePath,metaOnDB);return!0}return!1}{const fileOnDB=await this.localDatabase.getDBEntryFromMeta(metaOnDB,!1,!0);if(!1===fileOnDB)throw new Error(`Failed to read file from database:${storageFilePath}`);const resultStat=await this.__writeFile(storageFilePath,fileOnDB,force);if(resultStat){this.updateLastProcessed(storageFilePath,metaOnDB,resultStat);this.queueNotification(storageFilePath);this._log(`STORAGE <-- DB: ${storageFilePath}: written (hidden, overwrite${force?", force":""}) Done`);return!0}}return!1}catch(ex){this._log(`STORAGE <-- DB: ${storageFilePath}: written (hidden, overwrite${force?", force":""}) Failed`);this._log(ex,LOG_LEVEL_VERBOSE);return!1}})}async __checkIsNeedToWriteFile(storageFilePath,content){try{const storageContent=await this.core.storageAccess.readHiddenFileAuto(storageFilePath);return!await isDocContentSame(storageContent,content)}catch(ex){this._log(`Cannot check the content of ${storageFilePath}`);this._log(ex,LOG_LEVEL_VERBOSE);return!0}}async __writeFile(storageFilePath,fileOnDB,force){try{const statBefore=await this.core.storageAccess.statHidden(storageFilePath),isExist=null!=statBefore,writeContent=readContent(fileOnDB);await this.ensureDir(storageFilePath);if(!(force||!isExist||isExist&&await this.__checkIsNeedToWriteFile(storageFilePath,writeContent))){this._log(`STORAGE <-- DB: ${storageFilePath}: skipped (hidden) Not changed`,LOG_LEVEL_DEBUG);return statBefore}const writeResultStat=await this.writeFile(storageFilePath,writeContent,{mtime:fileOnDB.mtime,ctime:fileOnDB.ctime});if(null==writeResultStat){this._log(`STORAGE <-- DB: ${storageFilePath}: written (hidden,new${force?", force":""}) Failed (writeResult)`);return!1}this._log(`STORAGE <-- DB: ${storageFilePath}: written (hidden, overwrite${force?", force":""})`);return writeResultStat}catch(ex){this._log(`STORAGE <-- DB: ${storageFilePath}: written (hidden, overwrite${force?", force":""}) Failed`);this._log(ex,LOG_LEVEL_VERBOSE);return!1}}async __deleteFile(storageFilePath){const result=await this.__removeFile(storageFilePath);if(!1===result){this._log(`STORAGE [!DETAILS]-\n> This feature allows you to synchronize all hidden files without any user interaction.\n> To enable this feature, you should choose one of the following options:\n${opt.enableFetch?"> - Fetch: Use the files stored from other devices. Choose this option if you have already configured hidden file synchronization on those devices and wish to accept their files.\n":""}${opt.enableOverwrite?"> - Overwrite: Use the files from this device. Select this option if you want to overwrite the files stored on other devices.\n":""}> - Merge: Merge the files from this device with those on other devices. Choose this option if you wish to combine files from multiple sources.\n> However, please be reminded that merging may cause conflicts if the files are not identical. Additionally, this process may occur within the same folder, potentially breaking your plug-in or theme settings that comprise multiple files.\n\n\n> [!IMPORTANT]\n> Please keep in mind that enabling this feature alongside customisation sync may override certain behaviors.`,choices=[];(null==opt?void 0:opt.enableFetch)&&choices.push("Fetch");(null==opt?void 0:opt.enableOverwrite)&&choices.push("Overwrite");choices.push("Merge");choices.push("Disable");const ret=await this.core.confirm.confirmWithMessage("Hidden file sync",message,choices,"Disable",40);"Fetch"==ret?await this.configureHiddenFileSync("FETCH"):"Overwrite"==ret?await this.configureHiddenFileSync("OVERWRITE"):"Merge"==ret?await this.configureHiddenFileSync("MERGE"):"Disable"==ret&&await this.configureHiddenFileSync("DISABLE_HIDDEN")}_allSuspendExtraSync(){if(this.core.settings.syncInternalFiles){this._log("Hidden file synchronization have been temporarily disabled. Please enable them after the fetching, if you need them.",LOG_LEVEL_NOTICE);this.core.settings.syncInternalFiles=!1}return Promise.resolve(!0)}async _allConfigureOptionalSyncFeature(mode){await this.configureHiddenFileSync(mode);return!0}async configureHiddenFileSync(mode){if("FETCH"==mode||"OVERWRITE"==mode||"MERGE"==mode||"DISABLE"==mode||"DISABLE_HIDDEN"==mode)if("DISABLE"!=mode&&"DISABLE_HIDDEN"!=mode){this._log("Gathering files for enabling Hidden File Sync",LOG_LEVEL_NOTICE);"FETCH"==mode?await this.initialiseInternalFileSync("pullForce",!0):"OVERWRITE"==mode?await this.initialiseInternalFileSync("pushForce",!0):"MERGE"==mode&&await this.initialiseInternalFileSync("safe",!0);await this.core.services.setting.applyPartial({useAdvancedMode:!0,syncInternalFiles:!0},!0);this._log("Done! Restarting the app is strongly recommended!",LOG_LEVEL_NOTICE)}else await this.core.services.setting.applyPartial({syncInternalFiles:!1},!0)}async scanInternalFileNames(){const findRoot=this.app.vault.getRoot().path;return await this.getFiles(findRoot,path2=>this.isTargetFile(path2))}async scanInternalFiles(){var _a8,_b5,_c3,_d2,_e2,_f;const files=(await this.scanInternalFileNames()).map(async e3=>({path:e3,stat:await this.core.storageAccess.statHidden(e3)})),result=[];for(const f4 of files){const w2=await f4;if(await this.services.vault.isIgnoredByIgnoreFile(w2.path))continue;const mtime=null!=(_b5=null==(_a8=w2.stat)?void 0:_a8.mtime)?_b5:0,ctime=null!=(_d2=null==(_c3=w2.stat)?void 0:_c3.ctime)?_d2:mtime,size=null!=(_f=null==(_e2=w2.stat)?void 0:_e2.size)?_f:0;result.push({...w2,mtime,ctime,size})}return result}async getFiles(path2,checkFunction){let w2;try{w2=await this.app.vault.adapter.list(path2)}catch(ex){this._log(`Could not traverse(HiddenSync):${path2}`,LOG_LEVEL_INFO);this._log(ex,LOG_LEVEL_VERBOSE);return[]}let files=[];for(const file of w2.files)await checkFunction(file)&&files.push(file);for(const v2 of w2.folders)await checkFunction(v2)&&(files=files.concat(await this.getFiles(v2,checkFunction)));return files}onBindFunction(core,services){services.appLifecycle.onSettingLoaded.addHandler(this._everyOnloadAfterLoadSettings.bind(this));services.fileProcessing.processOptionalFileEvent.addHandler(this._anyProcessOptionalFileEvent.bind(this));services.conflict.getOptionalConflictCheckMethod.addHandler(this._anyGetOptionalConflictCheckMethod.bind(this));services.replication.processOptionalSynchroniseResult.addHandler(this._anyProcessOptionalSyncFiles.bind(this));services.setting.onRealiseSetting.addHandler(this._everyRealizeSettingSyncMode.bind(this));services.appLifecycle.onResuming.addHandler(this._everyOnResumeProcess.bind(this));services.replication.onBeforeReplicate.addHandler(this._everyBeforeReplicate.bind(this));services.databaseEvents.onDatabaseInitialised.addHandler(this._everyOnDatabaseInitialized.bind(this));services.setting.suspendExtraSync.addHandler(this._allSuspendExtraSync.bind(this));services.setting.suggestOptionalFeatures.addHandler(this._allAskUsingOptionalSyncFeature.bind(this));services.setting.enableOptionalFeature.addHandler(this._allConfigureOptionalSyncFeature.bind(this));services.vault.isTargetFileInExtra.addHandler(this.isTargetFile.bind(this))}};t=new Uint8Array([0,97,115,109,1,0,0,0,1,48,8,96,3,127,127,127,0,96,3,127,127,127,1,127,96,2,127,127,0,96,2,127,126,0,96,1,127,1,127,96,1,127,1,126,96,3,127,127,126,1,126,96,3,126,127,127,1,126,3,11,10,1,1,2,0,4,6,7,3,0,5,5,3,1,0,1,7,85,9,3,109,101,109,2,0,5,120,120,104,51,50,0,0,6,105,110,105,116,51,50,0,2,8,117,112,100,97,116,101,51,50,0,3,8,100,105,103,101,115,116,51,50,0,4,5,120,120,104,54,52,0,5,6,105,110,105,116,54,52,0,7,8,117,112,100,97,116,101,54,52,0,8,8,100,105,103,101,115,116,54,52,0,9,10,211,23,10,242,1,1,4,127,32,0,32,1,106,33,3,32,1,65,16,79,4,127,32,3,65,16,107,33,6,32,2,65,168,136,141,161,2,106,33,3,32,2,65,247,148,175,175,120,106,33,4,32,2,65,177,243,221,241,121,107,33,5,3,64,32,0,40,2,0,65,247,148,175,175,120,108,32,3,106,65,13,119,65,177,243,221,241,121,108,33,3,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,32,4,106,65,13,119,65,177,243,221,241,121,108,33,4,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,32,2,106,65,13,119,65,177,243,221,241,121,108,33,2,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,32,5,106,65,13,119,65,177,243,221,241,121,108,33,5,32,0,65,4,106,34,0,32,6,77,13,0,11,32,2,65,12,119,32,5,65,18,119,106,32,4,65,7,119,106,32,3,65,1,119,106,5,32,2,65,177,207,217,178,1,106,11,32,1,106,32,0,32,1,65,15,113,16,1,11,146,1,0,32,1,32,2,106,33,2,3,64,32,1,65,4,106,32,2,75,69,4,64,32,1,40,2,0,65,189,220,202,149,124,108,32,0,106,65,17,119,65,175,214,211,190,2,108,33,0,32,1,65,4,106,33,1,12,1,11,11,3,64,32,1,32,2,79,69,4,64,32,1,45,0,0,65,177,207,217,178,1,108,32,0,106,65,11,119,65,177,243,221,241,121,108,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,65,15,118,32,0,115,65,247,148,175,175,120,108,34,0,32,0,65,13,118,115,65,189,220,202,149,124,108,34,0,32,0,65,16,118,115,11,63,0,32,0,65,8,106,32,1,65,168,136,141,161,2,106,54,2,0,32,0,65,12,106,32,1,65,247,148,175,175,120,106,54,2,0,32,0,65,16,106,32,1,54,2,0,32,0,65,20,106,32,1,65,177,243,221,241,121,107,54,2,0,11,211,4,1,6,127,32,1,32,2,106,33,6,32,0,65,24,106,33,5,32,0,65,40,106,40,2,0,33,3,32,0,32,0,40,2,0,32,2,106,54,2,0,32,0,65,4,106,34,4,32,4,40,2,0,32,2,65,16,79,32,0,40,2,0,65,16,79,114,114,54,2,0,32,2,32,3,106,65,16,73,4,64,32,3,32,5,106,32,1,32,2,252,10,0,0,32,0,65,40,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,5,106,32,1,65,16,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,40,2,0,32,5,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,12,106,34,3,40,2,0,32,5,65,4,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,16,106,34,3,40,2,0,32,5,65,8,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,20,106,34,3,40,2,0,32,5,65,12,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,3,32,4,54,2,0,32,0,65,40,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,32,6,65,16,107,77,4,64,32,6,65,16,107,33,8,32,0,65,8,106,40,2,0,33,2,32,0,65,12,106,40,2,0,33,3,32,0,65,16,106,40,2,0,33,4,32,0,65,20,106,40,2,0,33,7,3,64,32,1,40,2,0,65,247,148,175,175,120,108,32,2,106,65,13,119,65,177,243,221,241,121,108,33,2,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,32,3,106,65,13,119,65,177,243,221,241,121,108,33,3,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,32,4,106,65,13,119,65,177,243,221,241,121,108,33,4,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,32,7,106,65,13,119,65,177,243,221,241,121,108,33,7,32,1,65,4,106,34,1,32,8,77,13,0,11,32,0,65,8,106,32,2,54,2,0,32,0,65,12,106,32,3,54,2,0,32,0,65,16,106,32,4,54,2,0,32,0,65,20,106,32,7,54,2,0,11,32,1,32,6,73,4,64,32,5,32,1,32,6,32,1,107,34,1,252,10,0,0,32,0,65,40,106,32,1,54,2,0,11,11,97,1,1,127,32,0,65,16,106,40,2,0,33,1,32,0,65,4,106,40,2,0,4,127,32,1,65,12,119,32,0,65,20,106,40,2,0,65,18,119,106,32,0,65,12,106,40,2,0,65,7,119,106,32,0,65,8,106,40,2,0,65,1,119,106,5,32,1,65,177,207,217,178,1,106,11,32,0,40,2,0,106,32,0,65,24,106,32,0,65,40,106,40,2,0,16,1,11,157,4,2,1,127,3,126,32,0,32,1,106,33,3,32,1,65,32,79,4,126,32,3,65,32,107,33,3,32,2,66,135,149,175,175,152,182,222,155,158,127,124,66,207,214,211,190,210,199,171,217,66,124,33,4,32,2,66,207,214,211,190,210,199,171,217,66,124,33,5,32,2,66,0,124,33,6,32,2,66,135,149,175,175,152,182,222,155,158,127,125,33,2,3,64,32,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,4,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,4,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,5,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,5,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,6,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,2,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,2,32,0,65,8,106,34,0,32,3,77,13,0,11,32,6,66,12,137,32,2,66,18,137,124,32,5,66,7,137,124,32,4,66,1,137,124,32,4,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,5,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,6,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,2,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,5,32,2,66,197,207,217,178,241,229,186,234,39,124,11,32,1,173,124,32,0,32,1,65,31,113,16,6,11,137,2,0,32,1,32,2,106,33,2,3,64,32,1,65,8,106,32,2,77,4,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,27,137,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,33,0,32,1,65,8,106,33,1,12,1,11,11,32,1,65,4,106,32,2,77,4,64,32,1,53,2,0,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,23,137,66,207,214,211,190,210,199,171,217,66,126,66,249,243,221,241,153,246,153,171,22,124,33,0,32,1,65,4,106,33,1,11,3,64,32,1,32,2,73,4,64,32,1,49,0,0,66,197,207,217,178,241,229,186,234,39,126,32,0,133,66,11,137,66,135,149,175,175,152,182,222,155,158,127,126,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,66,33,136,32,0,133,66,207,214,211,190,210,199,171,217,66,126,34,0,32,0,66,29,136,133,66,249,243,221,241,153,246,153,171,22,126,34,0,32,0,66,32,136,133,11,88,0,32,0,65,8,106,32,1,66,135,149,175,175,152,182,222,155,158,127,124,66,207,214,211,190,210,199,171,217,66,124,55,3,0,32,0,65,16,106,32,1,66,207,214,211,190,210,199,171,217,66,124,55,3,0,32,0,65,24,106,32,1,55,3,0,32,0,65,32,106,32,1,66,135,149,175,175,152,182,222,155,158,127,125,55,3,0,11,132,5,2,3,127,4,126,32,1,32,2,106,33,5,32,0,65,40,106,33,4,32,0,65,200,0,106,40,2,0,33,3,32,0,32,0,41,3,0,32,2,173,124,55,3,0,32,2,32,3,106,65,32,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,200,0,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,32,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,41,3,0,32,4,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,16,106,34,3,41,3,0,32,4,65,8,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,24,106,34,3,41,3,0,32,4,65,16,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,32,106,34,3,41,3,0,32,4,65,24,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,3,32,6,55,3,0,32,0,65,200,0,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,65,32,106,32,5,77,4,64,32,5,65,32,107,33,2,32,0,65,8,106,41,3,0,33,6,32,0,65,16,106,41,3,0,33,7,32,0,65,24,106,41,3,0,33,8,32,0,65,32,106,41,3,0,33,9,3,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,6,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,7,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,7,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,8,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,8,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,32,9,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,9,32,1,65,8,106,34,1,32,2,77,13,0,11,32,0,65,8,106,32,6,55,3,0,32,0,65,16,106,32,7,55,3,0,32,0,65,24,106,32,8,55,3,0,32,0,65,32,106,32,9,55,3,0,11,32,1,32,5,73,4,64,32,4,32,1,32,5,32,1,107,34,1,252,10,0,0,32,0,65,200,0,106,32,1,54,2,0,11,11,200,2,1,5,126,32,0,65,24,106,41,3,0,33,1,32,0,41,3,0,34,2,66,32,90,4,126,32,0,65,8,106,41,3,0,34,3,66,1,137,32,0,65,16,106,41,3,0,34,4,66,7,137,124,32,1,66,12,137,32,0,65,32,106,41,3,0,34,5,66,18,137,124,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,4,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,1,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,32,5,66,207,214,211,190,210,199,171,217,66,126,66,0,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,227,220,202,149,252,206,242,245,133,127,124,5,32,1,66,197,207,217,178,241,229,186,234,39,124,11,32,2,124,32,0,65,40,106,32,2,66,31,131,167,16,6,11]);hashFunc=str=>fallbackMixedHashEach(str);!async function initHashFunc(){try{const{h32ToString}=await e();hashFunc=h32ToString;Logger("xxhash for plugin initialised",LOG_LEVEL_VERBOSE)}catch(ex){Logger("Could not initialise xxhash. fallback...",LOG_LEVEL_VERBOSE);Logger(ex);hashFunc=str=>fallbackMixedHashEach(str)}}();globalSlipBoard2=globalSlipBoard;import_diff_match_patch2=__toESM(require_diff_match_patch(),1);ConflictResolveModal=class extends import_obsidian.Modal{constructor(app,filename,diff,pluginPickMode,remoteName){super(app);this.response=CANCELLED;this.isClosed=!1;this.consumed=!1;this.title="Conflicting changes";this.pluginPickMode=!1;this.localName="Base";this.remoteName="Conflicted";this.result=diff;this.filename=filename;this.pluginPickMode=pluginPickMode||!1;if(this.pluginPickMode){this.title="Pick a version";this.remoteName=`${remoteName||"Remote"}`;this.localName="Local"}}onOpen(){const{contentEl}=this;globalSlipBoard2.submit("conflict-resolved",this.filename,CANCELLED);this.offEvent&&this.offEvent();this.offEvent=eventHub.onEvent("conflict-cancelled",path2=>{path2===this.filename&&this.sendResponse(CANCELLED)});this.titleEl.setText(this.title);contentEl.empty();contentEl.createEl("span",{text:this.filename});const div=contentEl.createDiv("");div.addClass("op-scrollable");div.addClass("ls-dialog");let diff="";for(const v2 of this.result.diff){const x1=v2[0],x2=v2[1];x1==import_diff_match_patch2.DIFF_DELETE?diff+=""+escapeStringToHTML(x2).replace(/\n/g,"\n")+"":x1==import_diff_match_patch2.DIFF_EQUAL?diff+=""+escapeStringToHTML(x2).replace(/\n/g,"\n")+"":x1==import_diff_match_patch2.DIFF_INSERT&&(diff+=""+escapeStringToHTML(x2).replace(/\n/g,"\n")+"")}const div2=contentEl.createDiv("");div2.addClass("ls-dialog");const date1=new Date(this.result.left.mtime).toLocaleString()+(this.result.left.deleted?" (Deleted)":""),date2=new Date(this.result.right.mtime).toLocaleString()+(this.result.right.deleted?" (Deleted)":"");div2.innerHTML=`${this.localName}: ${date1}
\n${this.remoteName}: ${date2}
`;contentEl.createEl("button",{text:`Use ${this.localName}`},e3=>e3.addEventListener("click",()=>this.sendResponse(this.result.right.rev))).style.marginRight="4px";contentEl.createEl("button",{text:`Use ${this.remoteName}`},e3=>e3.addEventListener("click",()=>this.sendResponse(this.result.left.rev))).style.marginRight="4px";this.pluginPickMode||(contentEl.createEl("button",{text:"Concat both"},e3=>e3.addEventListener("click",()=>this.sendResponse(LEAVE_TO_SUBSEQUENT))).style.marginRight="4px");contentEl.createEl("button",{text:this.pluginPickMode?"Cancel":"Not now"},e3=>e3.addEventListener("click",()=>this.sendResponse(CANCELLED))).style.marginRight="4px";diff=diff.replace(/\n/g,"
");diff.length>102400?div.innerText="(Too large diff to display)":div.innerHTML=diff}sendResponse(result){this.response=result;this.close()}onClose(){const{contentEl}=this;contentEl.empty();this.offEvent&&this.offEvent();if(!this.consumed){this.consumed=!0;globalSlipBoard2.submit("conflict-resolved",this.filename,this.response)}}async waitForResult(){await delay(100);return await globalSlipBoard2.awaitNext("conflict-resolved",this.filename)}};(function enable_legacy_mode_flag(){legacy_mode_flag=!0})();root_3=from_html("");root_62=from_html('');root_7=from_html('');root_8=from_html('');root_42=from_html(' ',1);root_9=from_html(' ',1);root_11=from_html('');root_122=from_html('');root_22=from_html(' ',1);root_13=from_html(' ',1);root_132=from_html(' All the same or non-existent ',1);$$css3={hash:"svelte-14nm4oc",code:'.spacer.svelte-14nm4oc {min-width:1px;flex-grow:1;}button.svelte-14nm4oc {margin:2px 4px;min-width:3em;max-width:4em;}button.svelte-14nm4oc:disabled {border:none;box-shadow:none;background-color:transparent;visibility:collapse;}button.svelte-14nm4oc:disabled:hover {border:none;box-shadow:none;background-color:transparent;visibility:collapse;}span.message.svelte-14nm4oc {color:var(--text-muted);font-size:var(--font-ui-smaller);padding:0 1em;line-height:var(--line-height-tight);}\n /* span.messages {\n display: flex;\n flex-direction: column;\n align-items: center;\n } */.is-mobile .spacer.svelte-14nm4oc {margin-left:auto;}.chip-wrap.svelte-14nm4oc {display:flex;gap:2px;flex-direction:column;justify-content:center;align-items:flex-start;}.chip.svelte-14nm4oc {display:inline-block;border-radius:2px;font-size:0.8em;padding:0 4px;margin:0 2px;border-color:var(--tag-border-color);background-color:var(--tag-background);color:var(--tag-color);}.chip.svelte-14nm4oc:empty {display:none;}.chip.svelte-14nm4oc:not(:empty)::before {min-width:1.8em;display:inline-block;}.chip.content.svelte-14nm4oc:not(:empty)::before {content:"📄: ";}.chip.version.svelte-14nm4oc:not(:empty)::before {content:"🏷️: ";}.chip.modified.svelte-14nm4oc:not(:empty)::before {content:"📅: ";}'};root_14=from_html('');root_23=from_html(" ");root_32=from_html('
No Items.
');root_82=from_html('
');root_63=from_html('
');root_52=from_html('

');root_133=from_html('
');root_15=from_html('
');root_18=from_html('
');root_16=from_html('
Other files
');root_112=from_html('
MAIN
DATA
',1);root_19=from_html('
');root_92=from_html('
',1);root_43=from_html('

Plugins

',1);root_21=from_html("");root_20=from_html('

Maintenance Commands

');root3=from_html('
',1);$$css4={hash:"svelte-10jah2g",code:".buttonsWrap.svelte-10jah2g {padding-bottom:4px;}h3.svelte-10jah2g {position:sticky;top:0;background-color:var(--modal-background);}.labelrow.svelte-10jah2g {margin-left:0.4em;display:flex;justify-content:flex-start;align-items:center;border-top:1px solid var(--background-modifier-border);padding:4px;flex-wrap:wrap;}.filerow.svelte-10jah2g {margin-left:1.25em;display:flex;justify-content:flex-start;align-items:center;padding-right:4px;flex-wrap:wrap;}.filerow.hideeven.svelte-10jah2g:has(.even),\n .labelrow.hideeven.svelte-10jah2g:has(.even) {display:none;}.noterow.svelte-10jah2g {min-height:2em;display:flex;}button.status.svelte-10jah2g {flex-grow:0;margin:2px 4px;min-width:3em;max-width:4em;}.statusnote.svelte-10jah2g {display:flex;justify-content:flex-end;padding-right:var(--size-4-12);align-items:center;min-width:10em;flex-grow:1;}.list.svelte-10jah2g {overflow-y:auto;}.title.svelte-10jah2g {color:var(--text-normal);font-size:var(--font-ui-medium);line-height:var(--line-height-tight);margin-right:auto;}.body.svelte-10jah2g {\n /* margin-left: 0.4em; */margin-left:auto;display:flex;justify-content:flex-start;align-items:center;\n /* flex-wrap: wrap; */}.filetitle.svelte-10jah2g {color:var(--text-normal);font-size:var(--font-ui-medium);line-height:var(--line-height-tight);margin-right:auto;}.buttons.svelte-10jah2g {display:flex;flex-direction:row;justify-content:flex-end;margin-top:8px;flex-wrap:wrap;}.buttons.svelte-10jah2g > button:where(.svelte-10jah2g) {margin-left:4px;width:auto;}label.svelte-10jah2g {display:flex;justify-content:center;align-items:center;}label.svelte-10jah2g > span:where(.svelte-10jah2g) {margin-right:0.25em;}.is-mobile .title.svelte-10jah2g,\n .is-mobile .filetitle.svelte-10jah2g {width:100%;}.center.svelte-10jah2g {display:flex;justify-content:center;align-items:center;min-height:3em;}.maintenancerow.svelte-10jah2g {display:flex;justify-content:flex-end;align-items:center;}.maintenancerow.svelte-10jah2g label:where(.svelte-10jah2g) {margin-right:0.5em;margin-left:0.5em;}.loading.svelte-10jah2g {transition:height 0.25s ease-in-out;transition-delay:4ms;overflow-y:hidden;flex-shrink:0;display:flex;justify-content:flex-start;align-items:center;}.loading.svelte-10jah2g:empty {height:0px;transition:height 0.25s ease-in-out;transition-delay:1s;}.loading.svelte-10jah2g:not(:empty) {height:2em;transition:height 0.25s ease-in-out;transition-delay:0;}"};PluginDialogModal=class extends import_obsidian.Modal{isOpened(){return null!=this.component}constructor(app,plugin3){super(app);this.plugin=plugin3}onOpen(){const{contentEl}=this;this.contentEl.style.overflow="auto";this.contentEl.style.display="flex";this.contentEl.style.flexDirection="column";this.titleEl.setText("Customization Sync (Beta3)");this.component||(this.component=mount(PluginPane,{target:contentEl,props:{plugin:this.plugin,core:this.plugin.core}}))}onClose(){if(this.component){unmount(this.component);this.component=void 0}}};d="​";d2="\n";DUMMY_HEAD=serialize({category:"CONFIG",name:"migrated",files:[],mtime:0,term:"-",displayName:"MIRAGED"});DUMMY_END=d+d2+"‌";pluginList=writable([]);pluginIsEnumerating=writable(!1);pluginV2Progress=writable(0);pluginManifestStore=writable(pluginManifests=new Map);PluginDataExDisplayV2=class{constructor(data){this.files=[];this.documentPath=`${data.documentPath}`;this.category=`${data.category}`;this.name=`${data.name}`;this.term=`${data.term}`;this.files=[...data.files];this.confKey=`${categoryToFolder(this.category,this.term)}${this.name}`;this.applyLoadedManifest()}async setFile(file){const old=this.files.find(e3=>e3.filename==file.filename);if(old){if(old.mtime==file.mtime&&await isDocContentSame(old.data,file.data))return;this.files=this.files.filter(e3=>e3.filename!=file.filename)}this.files.push(file);"manifest.json"==file.filename&&this.applyLoadedManifest()}deleteFile(filename){this.files=this.files.filter(e3=>e3.filename!=filename)}applyLoadedManifest(){const manifest=pluginManifests.get(this.confKey);if(manifest){this._displayName=manifest.name;"PLUGIN_MAIN"!=this.category&&"THEME"!=this.category||(this._version=null==manifest?void 0:manifest.version)}}get displayName(){return this._displayName||this.name}get version(){return this._version}get mtime(){return~~this.files.reduce((a2,b3)=>a2+b3.mtime,0)/this.files.length}};ConfigSync=class extends LiveSyncCommands{constructor(plugin3,core){super(plugin3,core);this.pluginDialog=void 0;this.periodicPluginSweepProcessor=new PeriodicProcessor(this.core,async()=>await this.scanAllConfigFiles(!1));this.pluginList=[];this.addRibbonIcon=this.services.API.addRibbonIcon.bind(this.services.API);this.pluginScanProcessor=new QueueProcessor(async v2=>{const plugin3=v2[0];if(this.useV2){await this.migrateV1ToV2(!1,plugin3);return[]}const path2=plugin3.path||this.getPath(plugin3),oldEntry=this.pluginList.find(e3=>e3.documentPath==path2);if(oldEntry&&oldEntry.mtime==plugin3.mtime)return[];try{const pluginData=await this.loadPluginData(path2);if(pluginData){let newList=[...this.pluginList];newList=newList.filter(x2=>x2.documentPath!=pluginData.documentPath);newList.push(pluginData);this.pluginList=newList;pluginList.set(newList)}return[]}catch(ex){this._log(`Something happened at enumerating customization :${path2}`,LOG_LEVEL_NOTICE);this._log(ex,LOG_LEVEL_VERBOSE)}return[]},{suspended:!1,batchSize:1,concurrentLimit:10,delay:100,yieldThreshold:10,maintainDelay:!1,totalRemainingReactiveSource:pluginScanningCount}).startPipeline();this.pluginScanProcessorV2=new QueueProcessor(async v2=>{const plugin3=v2[0],path2=plugin3.path||this.getPath(plugin3),oldEntry=this.pluginList.find(e3=>e3.documentPath==path2);if(oldEntry&&oldEntry.mtime==plugin3.mtime)return[];try{const pluginData=await this.loadPluginData(path2);if(pluginData){let newList=[...this.pluginList];newList=newList.filter(x2=>x2.documentPath!=pluginData.documentPath);newList.push(pluginData);this.pluginList=newList;pluginList.set(newList)}return[]}catch(ex){this._log(`Something happened at enumerating customization :${path2}`,LOG_LEVEL_NOTICE);this._log(ex,LOG_LEVEL_VERBOSE)}return[]},{suspended:!1,batchSize:1,concurrentLimit:10,delay:100,yieldThreshold:10,maintainDelay:!1,totalRemainingReactiveSource:pluginScanningCount}).startPipeline();this.loadedManifest_mTime=new Map;this.updatingV2Count=0;this.recentProcessedInternalFiles=[];pluginScanningCount.onChanged(e3=>{const total=e3.value;pluginIsEnumerating.set(0!=total)})}get configDir(){return this.core.services.API.getSystemConfigDir()}get kvDB(){return this.core.kvDB}get useV2(){return this.core.settings.usePluginSyncV2}get useSyncPluginEtc(){return this.core.settings.usePluginEtc}isThisModuleEnabled(){return this.core.settings.usePluginSync}showPluginSyncModal(){if(this.isThisModuleEnabled())if(this.pluginDialog)this.pluginDialog.open();else{this.pluginDialog=new PluginDialogModal(this.app,this.plugin);this.pluginDialog.open()}}hidePluginSyncModal(){if(null!=this.pluginDialog){this.pluginDialog.close();this.pluginDialog=void 0}}onunload(){var _a8;this.hidePluginSyncModal();null==(_a8=this.periodicPluginSweepProcessor)||_a8.disable()}onload(){(0,import_obsidian.addIcon)("custom-sync",'\n \n ');this.services.API.addCommand({id:"livesync-plugin-dialog-ex",name:"Show customization sync dialog",callback:()=>{this.showPluginSyncModal()}});this.addRibbonIcon("custom-sync",$msg("cmdConfigSync.showCustomizationSync"),()=>{this.showPluginSyncModal()}).addClass("livesync-ribbon-showcustom");eventHub.onEvent(EVENT_REQUEST_OPEN_PLUGIN_SYNC_DIALOG2,()=>this.showPluginSyncModal())}getFileCategory(filePath){return 2==filePath.split("/").length&&filePath.endsWith(".json")?"CONFIG":4==filePath.split("/").length&&filePath.startsWith(`${this.configDir}/themes/`)?"THEME":filePath.startsWith(`${this.configDir}/snippets/`)&&filePath.endsWith(".css")?"SNIPPET":filePath.startsWith(`${this.configDir}/plugins/`)?filePath.endsWith("/styles.css")||filePath.endsWith("/manifest.json")||filePath.endsWith("/main.js")?"PLUGIN_MAIN":filePath.endsWith("/data.json")?"PLUGIN_DATA":this.useV2&&this.useSyncPluginEtc?"PLUGIN_ETC":"":""}isTargetPath(filePath){return!!filePath.startsWith(this.configDir)&&""!=this.getFileCategory(filePath)}async _everyOnDatabaseInitialized(showNotice){if(!this.isThisModuleEnabled())return!0;try{this._log("Scanning customizations...");await this.scanAllConfigFiles(showNotice);this._log("Scanning customizations : done")}catch(ex){this._log("Scanning customizations : failed");this._log(ex,LOG_LEVEL_VERBOSE)}return!0}async _everyBeforeReplicate(showNotice){if(!this.isThisModuleEnabled())return!0;if(this.settings.autoSweepPlugins){await this.scanAllConfigFiles(showNotice);return!0}return!0}async _everyOnResumeProcess(){if(!this.isThisModuleEnabled())return!0;if(this._isMainSuspended())return!0;this.settings.autoSweepPlugins&&await this.scanAllConfigFiles(!1);this.periodicPluginSweepProcessor.enable(this.settings.autoSweepPluginsPeriodic&&!this.settings.watchInternalFileChanges?6e4:0);return!0}_everyAfterResumeProcess(){const q2=activeDocument.querySelector(".livesync-ribbon-showcustom");null==q2||q2.toggleClass("sls-hidden",!this.isThisModuleEnabled());return Promise.resolve(!0)}async reloadPluginList(showMessage){this.pluginList=[];this.loadedManifest_mTime.clear();pluginList.set(this.pluginList);await this.updatePluginList(showMessage)}async loadPluginData(path2){const wx=await this.localDatabase.getDBEntry(path2,void 0,!1,!1);if(wx){const data=deserialize(getDocDataAsArray(wx.data),{}),xFiles=[];let missingHash=!1;for(const file of data.files){const work={...file,data:[]};if(!file.hash){const hash3=digestHash(getDocDataAsArray(work.data));file.hash=hash3;missingHash=!0}work.data=[file.hash];xFiles.push(work)}if(missingHash){this._log(`Digest created for ${path2} to improve checking`,LOG_LEVEL_VERBOSE);wx.data=serialize(data);fireAndForget(()=>this.localDatabase.putDBEntry(createSavingEntryFromLoadedEntry(wx)))}return{...data,documentPath:this.getPath(wx),files:xFiles}}return!1}filenameToUnifiedKey(path2,termOverRide){const term=termOverRide||this.services.setting.getDeviceAndVaultName(),category=this.getFileCategory(path2),name="CONFIG"==category||"SNIPPET"==category?path2.split("/").slice(-1)[0]:"PLUGIN_ETC"==category?path2.split("/").slice(-2).join("/"):path2.split("/").slice(-2)[0];return`${ICXHeader}${term}/${category}/${name}.md`}filenameWithUnifiedKey(path2,termOverRide){const term=termOverRide||this.services.setting.getDeviceAndVaultName(),category=this.getFileCategory(path2),name="CONFIG"==category||"SNIPPET"==category?path2.split("/").slice(-1)[0]:path2.split("/").slice(-2)[0],baseName="CONFIG"==category||"SNIPPET"==category?name:path2.split("/").slice(3).join("/");return`${ICXHeader}${term}/${category}/${name}%${baseName}`}unifiedKeyPrefixOfTerminal(termOverRide){const term=termOverRide||this.services.setting.getDeviceAndVaultName();return`${ICXHeader}${term}/`}parseUnifiedPath(unifiedPath){const[device,category,...rest]=stripAllPrefixes(unifiedPath).split("/"),relativePath=rest.join("/"),[key3,filename]=relativePath.split("%");return{device,category,key:key3,filename,pathV1:unifiedPath.split("%")[0]+".md"}}async createPluginDataExFileV2(unifiedPathV2,loaded){const{category,key:key3,filename,device}=this.parseUnifiedPath(unifiedPathV2);if(!loaded){const d4=await this.localDatabase.getDBEntry(unifiedPathV2);if(!d4){this._log(`The file ${unifiedPathV2} is not found`,LOG_LEVEL_VERBOSE);return!1}if(!isLoadedEntry(d4)){this._log(`The file ${unifiedPathV2} is not a note`,LOG_LEVEL_VERBOSE);return!1}loaded=d4}const confKey=`${categoryToFolder(category,device)}${key3}`,relativeFilename=`${categoryToFolder(category,"")}${"CONFIG"==category||"SNIPPET"==category?"":key3+"/"}${filename}`.substring(1),dataSrc=getDocData(loaded.data),dataStart=dataSrc.indexOf(DUMMY_END),data=dataSrc.substring(dataStart+DUMMY_END.length),file={...loaded,hash:"",data:[base64ToString(data)],filename:relativeFilename,displayName:filename};if("manifest.json"==filename)if(this.loadedManifest_mTime.get(confKey)!=file.mtime&&null==pluginManifests.get(confKey)){try{const parsedManifest=JSON.parse(base64ToString(data));setManifest(confKey,parsedManifest);this.pluginList.filter(e3=>e3 instanceof PluginDataExDisplayV2&&e3.confKey==confKey).forEach(e3=>e3.applyLoadedManifest());pluginList.set(this.pluginList)}catch(ex){this._log(`The file ${loaded.path} seems to manifest, but could not be decoded as JSON`,LOG_LEVEL_VERBOSE);this._log(ex,LOG_LEVEL_VERBOSE)}this.loadedManifest_mTime.set(confKey,file.mtime)}else{this.pluginList.filter(e3=>e3 instanceof PluginDataExDisplayV2&&e3.confKey==confKey).forEach(e3=>e3.applyLoadedManifest());pluginList.set(this.pluginList)}return file}createPluginDataFromV2(unifiedPathV2){const{category,device,key:key3,pathV1}=this.parseUnifiedPath(unifiedPathV2);if(""!=category)return new PluginDataExDisplayV2({documentPath:pathV1,category,name:key3,term:`${device}`,files:[],mtime:0})}async updatePluginListV2(showMessage,unifiedFilenameWithKey){try{this.updatingV2Count++;pluginV2Progress.set(this.updatingV2Count);const{pathV1}=this.parseUnifiedPath(unifiedFilenameWithKey),oldEntry=this.pluginList.find(e3=>e3.documentPath==pathV1);let entry;if(oldEntry&&oldEntry instanceof PluginDataExDisplayV2)oldEntry instanceof PluginDataExDisplayV2&&(entry=oldEntry);else{const newEntry=this.createPluginDataFromV2(unifiedFilenameWithKey);newEntry&&(entry=newEntry)}if(!entry)return;const file=await this.createPluginDataExFileV2(unifiedFilenameWithKey);if(file)await entry.setFile(file);else{entry.deleteFile(unifiedFilenameWithKey);0==entry.files.length&&(this.pluginList=this.pluginList.filter(e3=>e3.documentPath!=pathV1))}const newList=this.pluginList.filter(e3=>e3.documentPath!=entry.documentPath);newList.push(entry);this.pluginList=newList;scheduleTask("updatePluginListV2",100,()=>{pluginList.set(this.pluginList)})}finally{this.updatingV2Count--;pluginV2Progress.set(this.updatingV2Count)}}async migrateV1ToV2(showMessage,entry){var _a8;const v1Path=entry.path;this._log(`Migrating ${entry.path} to V2`,showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);if(entry.deleted){this._log(`The entry ${v1Path} is already deleted`,LOG_LEVEL_VERBOSE);return}if(!v1Path.endsWith(".md")&&!v1Path.startsWith(ICXHeader)){this._log(`The entry ${v1Path} is not a customisation sync binder`,LOG_LEVEL_VERBOSE);return}if(-1!==v1Path.indexOf("%")){this._log(`The entry ${v1Path} is already migrated`,LOG_LEVEL_VERBOSE);return}const loadedEntry=await this.localDatabase.getDBEntry(v1Path);if(!loadedEntry){this._log(`The entry ${v1Path} is not found`,LOG_LEVEL_VERBOSE);return}const pluginData=deserialize(getDocDataAsArray(loadedEntry.data),{}),prefixPath=v1Path.slice(0,-3)+"%",category=pluginData.category;for(const f4 of pluginData.files){const stripTable={CONFIG:0,THEME:2,SNIPPET:1,PLUGIN_MAIN:2,PLUGIN_DATA:2,PLUGIN_ETC:2},deletePrefixCount=null!=(_a8=null==stripTable?void 0:stripTable[category])?_a8:1,relativeFilename=f4.filename.split("/").slice(deletePrefixCount).join("/"),v2Path=prefixPath+relativeFilename;this._log(`Migrating ${v1Path} / ${relativeFilename} to ${v2Path}`,LOG_LEVEL_VERBOSE);const newId=await this.services.path.path2id(v2Path),data=createBlob([DUMMY_HEAD,DUMMY_END,...getDocDataAsArray(f4.data)]),saving={...loadedEntry,_rev:void 0,_id:newId,path:v2Path,data,datatype:"plain",type:"plain",children:[],eden:{}},r4=await this.core.localDatabase.putDBEntry(saving);if(r4&&r4.ok){this._log(`Migrated ${v1Path} / ${f4.filename} to ${v2Path}`,LOG_LEVEL_INFO);await this.deleteConfigOnDatabase(v1Path)?this._log(`Deleted ${v1Path} successfully`,LOG_LEVEL_INFO):this._log(`Failed to delete ${v1Path}`,LOG_LEVEL_NOTICE)}}}async updatePluginList(showMessage,updatedDocumentPath){if(this.isThisModuleEnabled()){try{this.updatingV2Count++;pluginV2Progress.set(this.updatingV2Count);const updatedDocumentId=updatedDocumentPath?await this.path2id(updatedDocumentPath):"",plugins=updatedDocumentPath?this.localDatabase.findEntries(updatedDocumentId,updatedDocumentId+"􏿿",{include_docs:!0,key:updatedDocumentId,limit:1}):this.localDatabase.findEntries(ICXHeader+"",`${ICXHeader}􏿿`,{include_docs:!0});for await(const v2 of plugins){if(v2.deleted||v2._deleted)continue;if(-1!==v2.path.indexOf("%")){fireAndForget(()=>this.updatePluginListV2(showMessage,v2.path));continue}const path2=v2.path||this.getPath(v2);updatedDocumentPath&&updatedDocumentPath!=path2||this.pluginScanProcessor.enqueue(v2)}}finally{pluginIsEnumerating.set(!1);this.updatingV2Count--;pluginV2Progress.set(this.updatingV2Count)}pluginIsEnumerating.set(!1)}else{this.pluginScanProcessor.clearQueue();this.pluginList=[];pluginList.set(this.pluginList)}}async compareUsingDisplayData(dataA,dataB,compareEach=!1){const loadFile=async data=>{if(data instanceof PluginDataExDisplayV2||compareEach)return data.files[0];const loadDoc=await this.localDatabase.getDBEntry(data.documentPath);if(!loadDoc)return!1;const pluginData=deserialize(getDocDataAsArray(loadDoc.data),{});pluginData.documentPath=data.documentPath;const file=pluginData.files[0];return{...loadDoc,...file,datatype:"newnote"}},fileA=await loadFile(dataA),fileB=await loadFile(dataB);this._log(`Comparing: ${dataA.documentPath} <-> ${dataB.documentPath}`,LOG_LEVEL_VERBOSE);if(!fileA||!fileB){this._log(`Could not load ${dataA.name} for comparison: ${fileA?"":dataA.term}${fileB?"":dataB.term}`,LOG_LEVEL_NOTICE);return!1}let path2=stripAllPrefixes(fileA.path.split("/").slice(-1).join("/"));-1!==path2.indexOf("%")&&(path2=path2.split("%")[1]);if(fileA.path.endsWith(".json"))return serialized("config:merge-data",()=>new Promise(res2=>{this._log("Opening data-merging dialog",LOG_LEVEL_VERBOSE);new JsonResolveModal(this.app,path2,[fileA,fileB],async(keep,result)=>{if(null==result)return res2(!1);try{res2(await this.applyData(dataA,result))}catch(ex){this._log("Could not apply merged file");this._log(ex,LOG_LEVEL_VERBOSE);res2(!1)}},"Local",`${dataB.term}`,"B",!0,!0,"Difference between local and remote").open()}));{const dmp=new import_diff_match_patch.diff_match_patch;let docAData=getDocData(fileA.data),docBData=getDocData(fileB.data);"plain"!=(null==fileA?void 0:fileA.datatype)&&(docAData=base64ToString(docAData));"plain"!=(null==fileB?void 0:fileB.datatype)&&(docBData=base64ToString(docBData));const diffMap=dmp.diff_linesToChars_(docAData,docBData),diff=dmp.diff_main(diffMap.chars1,diffMap.chars2,!1);dmp.diff_charsToLines_(diff,diffMap.lineArray);dmp.diff_cleanupSemantic(diff);const diffResult={left:{rev:"A",...fileA,data:docAData},right:{rev:"B",...fileB,data:docBData},diff},d4=new ConflictResolveModal(this.app,path2,diffResult,!0,dataB.term);d4.open();const ret=await d4.waitForResult();if(ret===CANCELLED)return!1;if(ret===LEAVE_TO_SUBSEQUENT)return!1;const resultContent="A"==ret?docAData:"B"==ret?docBData:void 0;return!!resultContent&&await this.applyData(dataA,resultContent)}}async applyDataV2(data,content){const baseDir=this.configDir;try{if(content){const filename=data.files[0].filename;this._log(`Applying ${filename} of ${data.displayName||data.name}..`);const path2=`${baseDir}/${filename}`;await this.core.storageAccess.ensureDir(path2);await this.core.storageAccess.writeHiddenFileAuto(path2,content);await this.storeCustomisationFileV2(path2,this.services.setting.getDeviceAndVaultName())}else{const files=data.files;for(const f4 of files){const stat={mtime:f4.mtime,ctime:f4.ctime},path2=`${baseDir}/${f4.filename}`;this._log(`Applying ${f4.filename} of ${data.displayName||data.name}..`);await this.core.storageAccess.ensureDir(path2);if("newnote"==f4.datatype){let oldData;try{oldData=await this.core.storageAccess.readHiddenFileBinary(path2)}catch(ex){this._log(`Could not read the file ${f4.filename}`,LOG_LEVEL_VERBOSE);this._log(ex,LOG_LEVEL_VERBOSE);oldData=new ArrayBuffer(0)}const content2=base64ToArrayBuffer(f4.data);if(await isDocContentSame(oldData,content2)){this._log(`The file ${f4.filename} is already up-to-date`,LOG_LEVEL_VERBOSE);continue}await this.core.storageAccess.writeHiddenFileAuto(path2,content2,stat)}else{let oldData;try{oldData=await this.core.storageAccess.readHiddenFileText(path2)}catch(ex){this._log(`Could not read the file ${f4.filename}`,LOG_LEVEL_VERBOSE);this._log(ex,LOG_LEVEL_VERBOSE);oldData=""}const content2=getDocData(f4.data);if(await isDocContentSame(oldData,content2)){this._log(`The file ${f4.filename} is already up-to-date`,LOG_LEVEL_VERBOSE);continue}await this.core.storageAccess.writeHiddenFileAuto(path2,content2,stat)}this._log(`Applied ${f4.filename} of ${data.displayName||data.name}..`);await this.storeCustomisationFileV2(path2,this.services.setting.getDeviceAndVaultName())}}}catch(ex){this._log(`Applying ${data.displayName||data.name}.. Failed`,LOG_LEVEL_NOTICE);this._log(ex,LOG_LEVEL_VERBOSE);return!1}return!0}async applyData(data,content){this._log(`Applying ${data.displayName||data.name}..`);if(data instanceof PluginDataExDisplayV2)return this.applyDataV2(data,content);const baseDir=this.configDir;try{if(!data.documentPath)throw"InternalError: Document path not exist";const dx=await this.localDatabase.getDBEntry(data.documentPath);if(0==dx)throw"Not found on database";const loadedData=deserialize(getDocDataAsArray(dx.data),{});for(const f4 of loadedData.files){this._log(`Applying ${f4.filename} of ${data.displayName||data.name}..`);try{const path2=`${baseDir}/${f4.filename}`;await this.core.storageAccess.ensureDir(path2);if(content)await this.core.storageAccess.writeHiddenFileAuto(path2,content);else{const dt=decodeBinary(f4.data);await this.core.storageAccess.writeHiddenFileAuto(path2,dt)}this._log(`Applying ${f4.filename} of ${data.displayName||data.name}.. Done`)}catch(ex){this._log(`Applying ${f4.filename} of ${data.displayName||data.name}.. Failed`);this._log(ex,LOG_LEVEL_VERBOSE)}}const uPath=`${baseDir}/${loadedData.files[0].filename}`;await this.storeCustomizationFiles(uPath);await this.updatePluginList(!0,uPath);await delay(100);this._log(`Config ${data.displayName||data.name} has been applied`,LOG_LEVEL_NOTICE);if("PLUGIN_DATA"==data.category||"PLUGIN_MAIN"==data.category){const manifests=Object.values(this.app.plugins.manifests),enabledPlugins=this.app.plugins.enabledPlugins,pluginManifest=manifests.find(manifest=>enabledPlugins.has(manifest.id)&&manifest.dir==`${baseDir}/plugins/${data.name}`);if(pluginManifest){this._log(`Unloading plugin: ${pluginManifest.name}`,LOG_LEVEL_NOTICE,"plugin-reload-"+pluginManifest.id);await this.app.plugins.unloadPlugin(pluginManifest.id);await this.app.plugins.loadPlugin(pluginManifest.id);this._log(`Plugin reloaded: ${pluginManifest.name}`,LOG_LEVEL_NOTICE,"plugin-reload-"+pluginManifest.id)}}else"CONFIG"==data.category&&this.services.appLifecycle.askRestart();return!0}catch(ex){this._log(`Applying ${data.displayName||data.name}.. Failed`);this._log(ex,LOG_LEVEL_VERBOSE);return!1}}async deleteData(data){try{if(data.documentPath){const delList=[];if(this.useV2){const deleteList=this.pluginList.filter(e3=>e3.documentPath==data.documentPath).filter(e3=>e3 instanceof PluginDataExDisplayV2).map(e3=>e3.files).flat();for(const e3 of deleteList)delList.push(e3.path)}delList.push(data.documentPath);const p2=delList.map(async e3=>{await this.deleteConfigOnDatabase(e3);await this.updatePluginList(!1,e3)});await Promise.allSettled(p2);this._log(`Deleted: ${data.category}/${data.name} of ${data.category} (${delList.length} items)`,LOG_LEVEL_NOTICE)}return!0}catch(ex){this._log(`Failed to delete: ${data.documentPath}`,LOG_LEVEL_NOTICE);this._log(ex,LOG_LEVEL_VERBOSE);return!1}}async _anyModuleParsedReplicationResultItem(docs){if(!docs._id.startsWith(ICXHeader))return!1;this.isThisModuleEnabled()&&await this.updatePluginList(!1,docs.path?docs.path:this.getPath(docs));if(this.isThisModuleEnabled()&&this.core.settings.notifyPluginOrSettingUpdated&&(!this.pluginDialog||this.pluginDialog&&!this.pluginDialog.isOpened())){const fragment=createFragment(doc=>{doc.createEl("span",void 0,a2=>{a2.appendText("Some configuration has been arrived, Press ");a2.appendChild(a2.createEl("a",void 0,anchor=>{anchor.text="HERE";anchor.addEventListener("click",()=>{this.showPluginSyncModal()})}));a2.appendText(" to open the config sync dialog , or press elsewhere to dismiss this message.")})}),updatedPluginKey="popupUpdated-plugins";scheduleTask(updatedPluginKey,1e3,async()=>{var _a8;const popup=await memoIfNotExist(updatedPluginKey,()=>new import_obsidian.Notice(fragment,0));(null==(_a8=null==popup?void 0:popup.noticeEl)?void 0:_a8.isShown())||memoObject(updatedPluginKey,new import_obsidian.Notice(fragment,0));scheduleTask(updatedPluginKey+"-close",2e4,()=>{var _a9;const popup2=retrieveMemoObject(updatedPluginKey);if(popup2){(null==(_a9=null==popup2?void 0:popup2.noticeEl)?void 0:_a9.isShown())&&popup2.hide();disposeMemoObject(updatedPluginKey)}})})}return!0}async _everyRealizeSettingSyncMode(){var _a8;null==(_a8=this.periodicPluginSweepProcessor)||_a8.disable();if(!this._isMainReady)return!0;if(!this._isMainSuspended())return!0;if(!this.isThisModuleEnabled())return!0;this.settings.autoSweepPlugins&&await this.scanAllConfigFiles(!1);this.periodicPluginSweepProcessor.enable(this.settings.autoSweepPluginsPeriodic&&!this.settings.watchInternalFileChanges?6e4:0);return!0}async makeEntryFromFile(path2){const stat=await this.core.storageAccess.statHidden(path2);let version2,displayName;if(!stat)return!1;const contentBin=await this.core.storageAccess.readHiddenFileBinary(path2);let content;try{content=await arrayBufferToBase64(contentBin);if(path2.toLowerCase().endsWith("/manifest.json")){const v2=readString(new Uint8Array(contentBin));try{const json=JSON.parse(v2);"version"in json&&(version2=`${json.version}`);"name"in json&&(displayName=`${json.name}`)}catch(ex){this._log(`Configuration sync data: ${path2} looks like manifest, but could not read the version`,LOG_LEVEL_INFO);this._log(ex,LOG_LEVEL_VERBOSE)}}}catch(ex){this._log(`The file ${path2} could not be encoded`);this._log(ex,LOG_LEVEL_VERBOSE);return!1}const mtime=stat.mtime;return{filename:path2.substring(this.configDir.length+1),data:content,mtime,size:stat.size,version:version2,displayName}}async storeCustomisationFileV2(path2,term,force=!1){const vf=this.filenameWithUnifiedKey(path2,term);return await serialized(`plugin-${vf}`,async()=>{const prefixedFileName=vf,id=await this.path2id(prefixedFileName),stat=await this.core.storageAccess.statHidden(path2);if(!stat)return!1;const mtime=stat.mtime,content=await this.core.storageAccess.readHiddenFileBinary(path2),contentBlob=createBlob([DUMMY_HEAD,DUMMY_END,...await arrayBufferToBase64(content)]);try{const old=await this.localDatabase.getDBEntryMeta(prefixedFileName,void 0,!1);let saveData;if(!1===old)saveData={_id:id,path:prefixedFileName,data:contentBlob,mtime,ctime:mtime,datatype:"plain",size:contentBlob.size,children:[],deleted:!1,type:"plain",eden:{}};else{if(this.services.path.isMarkedAsSameChanges(prefixedFileName,[old.mtime,mtime+1])==EVEN){this._log(`STORAGE --\x3e DB:${prefixedFileName}: (config) Skipped (Already checked the same)`,LOG_LEVEL_DEBUG);return}const docXDoc=await this.localDatabase.getDBEntryFromMeta(old,!1,!1);if(0==docXDoc)throw"Could not load the document";const dataSrc=getDocData(docXDoc.data),dataStart=dataSrc.indexOf(DUMMY_END),oldContent=dataSrc.substring(dataStart+DUMMY_END.length),oldContentArray=base64ToArrayBuffer(oldContent);if(await isDocContentSame(oldContentArray,content)){this._log(`STORAGE --\x3e DB:${prefixedFileName}: (config) Skipped (the same content)`,LOG_LEVEL_VERBOSE);this.services.path.markChangesAreSame(prefixedFileName,old.mtime,mtime+1);return!0}saveData={...old,data:contentBlob,mtime,size:contentBlob.size,datatype:"plain",children:[],deleted:!1,type:"plain"}}const ret=await this.localDatabase.putDBEntry(saveData);this._log(`STORAGE --\x3e DB:${prefixedFileName}: (config) Done`);fireAndForget(()=>this.updatePluginListV2(!1,this.filenameWithUnifiedKey(path2)));return ret}catch(ex){this._log(`STORAGE --\x3e DB:${prefixedFileName}: (config) Failed`);this._log(ex,LOG_LEVEL_VERBOSE);return!1}})}async storeCustomizationFiles(path2,termOverRide){const term=termOverRide||this.services.setting.getDeviceAndVaultName();if(""==term){this._log("We have to configure the device name",LOG_LEVEL_NOTICE);return}if(this.useV2)return await this.storeCustomisationFileV2(path2,term);const vf=this.filenameToUnifiedKey(path2,term);return await serialized(`plugin-${vf}`,async()=>{const category=this.getFileCategory(path2);let mtime=0,fileTargets=[];const name="CONFIG"==category||"SNIPPET"==category?path2.split("/").reverse()[0]:path2.split("/").reverse()[1],parentPath=path2.split("/").slice(0,-1).join("/"),prefixedFileName=this.filenameToUnifiedKey(path2,term),id=await this.path2id(prefixedFileName),dt={category,files:[],name,mtime:0,term};if("CONFIG"==category||"SNIPPET"==category||"PLUGIN_ETC"==category||"PLUGIN_DATA"==category){fileTargets=[path2];"PLUGIN_ETC"==category&&(dt.displayName=path2.split("/").slice(-1).join("/"))}else"PLUGIN_MAIN"==category?fileTargets=["manifest.json","main.js","styles.css"].map(e3=>`${parentPath}/${e3}`):"THEME"==category&&(fileTargets=["manifest.json","theme.css"].map(e3=>`${parentPath}/${e3}`));for(const target of fileTargets){const data=await this.makeEntryFromFile(target);if(0!=data){data.version&&(dt.version=data.version);data.displayName&&(dt.displayName=data.displayName);mtime=0==mtime?data.mtime:(data.mtime+mtime)/2;dt.files.push(data)}else this._log(`Config: skipped (Possibly is not exist): ${target} `,LOG_LEVEL_VERBOSE)}dt.mtime=mtime;if(0==dt.files.length){this._log(`Nothing left: deleting.. ${path2}`);await this.deleteConfigOnDatabase(prefixedFileName);await this.updatePluginList(!1,prefixedFileName);return}const content=createTextBlob(serialize(dt));try{const old=await this.localDatabase.getDBEntryMeta(prefixedFileName,void 0,!1);let saveData;if(!1===old)saveData={_id:id,path:prefixedFileName,data:content,mtime,ctime:mtime,datatype:"newnote",size:content.size,children:[],deleted:!1,type:"newnote",eden:{}};else{if(old.mtime==mtime)return!0;const oldC=await this.localDatabase.getDBEntryFromMeta(old,!1,!1);if(oldC){const d4=await deserialize(getDocDataAsArray(oldC.data),{});if(d4.files.length==dt.files.length){const diffs=d4.files.map(previous=>({prev:previous,curr:dt.files.find(e3=>e3.filename==previous.filename)})).map(async e3=>{var _a8,_b5;try{return await isDocContentSame(null!=(_b5=null==(_a8=e3.curr)?void 0:_a8.data)?_b5:[],e3.prev.data)}catch(e4){return!1}});if((await Promise.all(diffs)).every(e3=>1==e3)){this._log(`STORAGE --\x3e DB:${prefixedFileName}: (config) Skipped (Same content)`,LOG_LEVEL_VERBOSE);return!0}}}saveData={...old,data:content,mtime,size:content.size,datatype:"newnote",children:[],deleted:!1,type:"newnote"}}const ret=await this.localDatabase.putDBEntry(saveData);await this.updatePluginList(!1,saveData.path);this._log(`STORAGE --\x3e DB:${prefixedFileName}: (config) Done`);return ret}catch(ex){this._log(`STORAGE --\x3e DB:${prefixedFileName}: (config) Failed`);this._log(ex,LOG_LEVEL_VERBOSE);return!1}})}async _anyProcessOptionalFileEvent(path2){return await this.watchVaultRawEventsAsync(path2)}async watchVaultRawEventsAsync(path2){if(!this._isMainReady)return!1;if(this._isMainSuspended())return!1;if(!this.isThisModuleEnabled())return!1;const stat=await this.core.storageAccess.statHidden(path2);if(stat&&"file"!=stat.type)return!1;const configDir=normalizePath(this.configDir);if(Object.values(this.settings.pluginSyncExtendedSetting).filter(e3=>e3.mode!=MODE_SELECTIVE&&e3.mode!=MODE_SHINY).map(e3=>e3.files).flat().map(e3=>`${configDir}/${e3}`.toLowerCase()).some(e3=>e3.startsWith(path2.toLowerCase()))){this._log(`Customization file skipped: ${path2}`,LOG_LEVEL_VERBOSE);return!1}const storageMTime=~~((stat&&stat.mtime||0)/1e3),key3=`${path2}-${storageMTime}`;if(this.recentProcessedInternalFiles.contains(key3))return!0;this.recentProcessedInternalFiles=[key3,...this.recentProcessedInternalFiles].slice(0,100);scheduleTask(this.filenameToUnifiedKey(path2),100,async()=>{await this.storeCustomizationFiles(path2)});return!0}async scanAllConfigFiles(showMessage){await shareRunningResult("scanAllConfigFiles",async()=>{var _a8;const logLevel=showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO;this._log("Scanning customizing files.",logLevel,"scan-all-config");const term=this.services.setting.getDeviceAndVaultName();if(""==term){this._log("We have to configure the device name",LOG_LEVEL_NOTICE);return}const filesAll=await this.scanInternalFiles();if(this.useV2){const filesAllUnified=filesAll.filter(e3=>this.isTargetPath(e3)).map(e3=>[this.filenameWithUnifiedKey(e3,term),e3]),localFileMap=new Map(filesAllUnified.map(e3=>[e3[0],e3[1]])),prefix=this.unifiedKeyPrefixOfTerminal(term),entries2=this.localDatabase.findEntries(prefix+"",`${prefix}􏿿`,{include_docs:!0}),tasks3=[],semaphore=Semaphore(10);for await(const item of entries2)-1===item.path.indexOf("%")&&tasks3.push(async()=>{const releaser=await semaphore.acquire();try{const unifiedFilenameWithKey=`${item._id}`,localPath=localFileMap.get(unifiedFilenameWithKey);if(localPath){await this.storeCustomisationFileV2(localPath,term);localFileMap.delete(unifiedFilenameWithKey)}else await this.deleteConfigOnDatabase(unifiedFilenameWithKey)}catch(ex){this._log(`scanAllConfigFiles - Error: ${item._id}`,LOG_LEVEL_VERBOSE);this._log(ex,LOG_LEVEL_VERBOSE)}finally{releaser()}});await Promise.all(tasks3.map(e3=>e3()));const taskExtra=[];for(const[,filePath]of localFileMap)taskExtra.push(async()=>{const releaser=await semaphore.acquire();try{await this.storeCustomisationFileV2(filePath,term)}catch(ex){this._log(`scanAllConfigFiles - Error: ${filePath}`,LOG_LEVEL_VERBOSE);this._log(ex,LOG_LEVEL_VERBOSE)}finally{releaser()}});await Promise.all(taskExtra.map(e3=>e3()));fireAndForget(()=>this.updatePluginList(!1))}else{const files=filesAll.filter(e3=>this.isTargetPath(e3)).map(e3=>({key:this.filenameToUnifiedKey(e3),file:e3})),virtualPathsOfLocalFiles=[...new Set(files.map(e3=>e3.key))];let deleteCandidate=(await this.localDatabase.allDocsRaw({startkey:ICXHeader+"",endkey:`${ICXHeader}􏿿`,include_docs:!0})).rows.map(e3=>e3.doc).filter(e3=>!e3.deleted).map(e3=>this.getPath(e3)).filter(e3=>e3.startsWith(`${ICXHeader}${term}/`));for(const vp of virtualPathsOfLocalFiles){const p2=null==(_a8=files.find(e3=>e3.key==vp))?void 0:_a8.file;if(p2){await this.storeCustomizationFiles(p2);deleteCandidate=deleteCandidate.filter(e3=>e3!=vp)}else this._log(`scanAllConfigFiles - File not found: ${vp}`,LOG_LEVEL_VERBOSE)}for(const vp of deleteCandidate)await this.deleteConfigOnDatabase(vp);fireAndForget(()=>this.updatePluginList(!1))}})}async deleteConfigOnDatabase(prefixedFileName,forceWrite=!1){const mtime=(new Date).getTime();return await serialized("file-x-"+prefixedFileName,async()=>{try{const old=await this.localDatabase.getDBEntryMeta(prefixedFileName,void 0,!1);let saveData;if(!1===old){this._log(`STORAGE -x> DB:${prefixedFileName}: (config) already deleted (Not found on database)`);return!0}if(old.deleted){this._log(`STORAGE -x> DB:${prefixedFileName}: (config) already deleted`);return!0}saveData={...old,mtime,size:0,children:[],deleted:!0,type:"newnote"};await this.localDatabase.putRaw(saveData);await this.updatePluginList(!1,prefixedFileName);this._log(`STORAGE -x> DB:${prefixedFileName}: (config) Done`);return!0}catch(ex){this._log(`STORAGE -x> DB:${prefixedFileName}: (config) Failed`);this._log(ex,LOG_LEVEL_VERBOSE);return!1}})}async scanInternalFiles(){return(await this.getFiles(this.configDir,2)).filter(e3=>e3.startsWith(".")).filter(e3=>!e3.startsWith(".trash"))}async _allAskUsingOptionalSyncFeature(opt){await this.__askHiddenFileConfiguration(opt);return!0}async __askHiddenFileConfiguration(opt){const choices=[];choices.push("Yes, Enable it");choices.push("No, Disable it");choices.push("Later");const ret=await this.core.confirm.askSelectStringDialogue("Would you like to enable **Customization sync**?\n\n> [!DETAILS]-\n> This feature allows you to sync your customisations -- such as configurations, themes, snippets, and plugins -- across your devices in a fully controlled manner, unlike the fully automatic behaviour of hidden file synchronisation.\n> \n> You may use this feature alongside hidden file synchronisation. When both features are enabled, items configured as `Automatic` in this feature will be managed by **hidden file synchronisation**.\n> Do not worry, you will be prompted to enable or keep disabled **hidden file synchronisation** after this dialogue.\n",choices,{defaultAction:"Later",timeout:40,title:"Customisation sync"});"Yes, Enable it"==ret?await this.configureHiddenFileSync("CUSTOMIZE"):"No, Disable it"==ret&&await this.configureHiddenFileSync("DISABLE_CUSTOM")}_anyGetOptionalConflictCheckMethod(path2){return isPluginMetadata(path2)||isCustomisationSyncMetadata(path2)?Promise.resolve("newer"):Promise.resolve(!1)}_allSuspendExtraSync(){if(this.core.settings.usePluginSync||this.core.settings.autoSweepPlugins){this._log("Customisation sync have been temporarily disabled. Please enable them after the fetching, if you need them.",LOG_LEVEL_NOTICE);this.core.settings.usePluginSync=!1;this.core.settings.autoSweepPlugins=!1}return Promise.resolve(!0)}async _allConfigureOptionalSyncFeature(mode){await this.configureHiddenFileSync(mode);return!0}async configureHiddenFileSync(mode){if("DISABLE"!=mode){if("CUSTOMIZE"==mode){if(!this.services.setting.getDeviceAndVaultName()){let name=await this.core.confirm.askString("Device name","Please set this device name","desktop");if(!name){name=import_obsidian.Platform.isAndroidApp?"android-app":import_obsidian.Platform.isIosApp?"ios":import_obsidian.Platform.isMacOS?"macos":import_obsidian.Platform.isMobileApp?"mobile-app":import_obsidian.Platform.isMobile?"mobile":import_obsidian.Platform.isSafari?"safari":import_obsidian.Platform.isDesktop?"desktop":import_obsidian.Platform.isDesktopApp?"desktop-app":"unknown";name+=Math.random().toString(36).slice(-4)}this.services.setting.setDeviceAndVaultName(name)}await this.core.services.setting.applyPartial({usePluginSync:!0,useAdvancedMode:!0},!0);await this.scanAllConfigFiles(!0)}}else await this.core.services.setting.applyPartial({usePluginSync:!1},!0)}async getFiles(path2,lastDepth){if(-1==lastDepth)return[];let w2;try{w2=await this.app.vault.adapter.list(path2)}catch(ex){this._log(`Could not traverse(ConfigSync):${path2}`,LOG_LEVEL_INFO);this._log(ex,LOG_LEVEL_VERBOSE);return[]}let files=[...w2.files];for(const v2 of w2.folders)files=files.concat(await this.getFiles(v2,lastDepth-1));return files}onBindFunction(core,services){services.fileProcessing.processOptionalFileEvent.addHandler(this._anyProcessOptionalFileEvent.bind(this));services.conflict.getOptionalConflictCheckMethod.addHandler(this._anyGetOptionalConflictCheckMethod.bind(this));services.replication.processVirtualDocument.addHandler(this._anyModuleParsedReplicationResultItem.bind(this));services.setting.onRealiseSetting.addHandler(this._everyRealizeSettingSyncMode.bind(this));services.appLifecycle.onResuming.addHandler(this._everyOnResumeProcess.bind(this));services.appLifecycle.onResumed.addHandler(this._everyAfterResumeProcess.bind(this));services.replication.onBeforeReplicate.addHandler(this._everyBeforeReplicate.bind(this));services.databaseEvents.onDatabaseInitialised.addHandler(this._everyOnDatabaseInitialized.bind(this));services.setting.suspendExtraSync.addHandler(this._allSuspendExtraSync.bind(this));services.setting.suggestOptionalFeatures.addHandler(this._allAskUsingOptionalSyncFeature.bind(this));services.setting.enableOptionalFeature.addHandler(this._allConfigureOptionalSyncFeature.bind(this))}};PREFIX_TRENCH="trench";idx=0;series=`${Date.now()}`;indexes=new Map;inProgress=new Set;failed=new Map;Trench=class{constructor(db,flushExistItems=!0){Object.defineProperty(this,"_db",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"_flushTask",{enumerable:!0,configurable:!0,writable:!0,value:void 0});Object.defineProperty(this,"concealing",{enumerable:!0,configurable:!0,writable:!0,value:new Map});this._db=db;flushExistItems&&(this._flushTask=(async()=>{const keys3=await db.keys(`${PREFIX_TRENCH}-ephemeral`,`${PREFIX_TRENCH}-ephemeral.`);for(const key3 of keys3)await db.delete(key3)})())}async eraseAllEphemerals(){const keys3=await this._db.keys(`${PREFIX_TRENCH}-ephemeral`,`${PREFIX_TRENCH}-ephemeral.`);for(const key3 of keys3)await this._db.delete(key3)}async eraseAllPermanences(){const keys3=await this._db.keys(`${PREFIX_TRENCH}-permanent`,`${PREFIX_TRENCH}-permanent.`);for(const key3 of keys3)await this._db.delete(key3)}conceal(obj){const key3=generateId("ephemeral");this.concealing.set(key3,obj);this._db.set(key3,obj).then(async e3=>{this.concealing.has(key3)?this.concealing.delete(key3):await this._db.delete(key3)});return key3}async bury(key3){this.concealing.has(key3)&&this.concealing.delete(key3);await this._db.delete(key3)}async expose(key3){if(this.concealing.has(key3)){const value=this.concealing.get(key3);this.concealing.delete(key3);return value}const obj=await this._db.get(key3);await this._db.delete(key3);return obj}_evacuate(storeTask,key3){return async()=>{if(this._flushTask){await this._flushTask;this._flushTask=void 0}await storeTask;const item=await this._db.get(key3);await this._db.delete(key3);return item}}evacuatePromise(task){const key3=generateId("ephemeral"),storeTask=(async()=>{const data=await task;await this._db.set(key3,data)})();return this._evacuate(storeTask,key3)}evacuate(obj){if(obj instanceof Promise)return this.evacuatePromise(obj);const key3=generateId("ephemeral"),storeTask=this._db.set(key3,obj);return this._evacuate(storeTask,key3)}async _queue(type,key3,obj,index6){var _a8;if(void 0===index6){index6=null!=(_a8=indexes.get(key3))?_a8:0;indexes.set(key3,index6+1)}const storeKey=createId(type,key3,index6);await this._db.set(storeKey,obj)}async _dequeue(type,key3){const range4=createRange(type,key3),keys3=(await this._db.keys(range4[0],range4[1])).filter(e3=>!inProgress.has(e3));if(0!==keys3.length)return await this.expose(keys3[0])}async _dequeueWithCommit(type,key3){const range4=createRange(type,key3),keysAll=await this._db.keys(range4[0],range4[1]),keys3=keysAll.filter(e3=>!inProgress.has(e3));if(0===keys3.length)return;const storeKey=keys3[0];inProgress.add(storeKey);const previousFailed=failed.get(storeKey)||0,value=await this._db.get(storeKey);return{key:storeKey,value,cancelCount:previousFailed,pendingItems:keysAll.length-1,commit:async()=>{await this._db.delete(storeKey);failed.delete(storeKey);inProgress.delete(storeKey)},cancel:()=>{failed.set(storeKey,(failed.get(storeKey)||0)+1);inProgress.delete(storeKey)}}}queue(key3,obj,index6){return this._queue("ephemeral",key3,obj,index6)}dequeue(key3){return this._dequeue("ephemeral",key3)}dequeueWithCommit(key3){return this._dequeueWithCommit("ephemeral",key3)}queuePermanent(key3,obj,index6){return this._queue("permanent",key3,obj,index6)}dequeuePermanent(key3){return this._dequeue("permanent",key3)}dequeuePermanentWithCommit(key3){return this._dequeueWithCommit("permanent",key3)}};measures=new Map;root_17=from_html('
 
');root4=from_html('

TESTING BENCH: Self-hosted LiveSync

Module Checks

Synchronisation Result Status

 

Performance test

',1);$$css5={hash:"svelte-fa4ppj",code:".svelte-fa4ppj {box-sizing:border-box;}"};TestPaneView=class extends import_obsidian.ItemView{constructor(leaf,plugin3,moduleDev){super(leaf);this.icon="view-log";this.title="Self-hosted LiveSync Test and Results";this.navigation=!0;this.plugin=plugin3;this.moduleDev=moduleDev}getIcon(){return"view-log"}getViewType(){return"ols-pane-test"}getDisplayText(){return"Self-hosted LiveSync Test and Results"}async onOpen(){this.component=new TestPane({target:this.contentEl,props:{plugin:this.plugin,moduleDev:this.moduleDev}});await Promise.resolve()}async onClose(){var _a8;null==(_a8=this.component)||_a8.$destroy();await Promise.resolve()}};ModuleDev=class extends AbstractObsidianModule{constructor(){super(...arguments);this.testResults=writable([])}_everyOnloadStart(){__onMissingTranslation(()=>{});return Promise.resolve(!0)}async onMissingTranslation(key3){const outFile=`missing-translation-${(new Date).toISOString().split("T")[0]}.jsonl`,piece=JSON.stringify({[key3]:{}}),writePiece=piece.substring(1,piece.length-1)+",";try{await this.core.storageAccess.ensureDir(this.app.vault.configDir+"/ls-debug/");await this.core.storageAccess.appendHiddenFile(this.app.vault.configDir+"/ls-debug/"+outFile,writePiece+"\n")}catch(ex){this._log(`Could not write ${outFile}`,LOG_LEVEL_VERBOSE);this._log(`Missing translation: ${writePiece}`,LOG_LEVEL_VERBOSE);this._log(ex,LOG_LEVEL_VERBOSE)}}_everyOnloadAfterLoadSettings(){if(!this.settings.enableDebugTools)return Promise.resolve(!0);this.onMissingTranslation=this.onMissingTranslation.bind(this);__onMissingTranslation(key3=>{this.onMissingTranslation(key3)});eventHub.onEvent("document-stub-created",detail=>{fireAndForget(async()=>{const stub=detail.stub,toc2=detail.toc,stubDocX=Object.entries(stub).map(([key3,value])=>[`## ${key3}`,Object.entries(value).map(([key22,value2])=>[`### ${key22}`,[...value2.entries()].map(([key32,value3])=>{var _a8;const isObsolete=value3.is_obsolete?" (obsolete)":"",desc=null!=(_a8=value3.desc)?_a8:"";return`#### ${key32}${isObsolete}\n${value3.key?"Setting key: "+value3.key+"\n":""}${desc}\n`})].flat()).flat()].flat()).flat(),stubDocMD="\n| Icon | Description |\n| :---: | ----------------------------------------------------------------- |\n"+[...toc2.values()].map(e3=>`${e3}`).join("\n")+"\n\n"+stubDocX.join("\n");await this.core.storageAccess.writeHiddenFileAuto(this.app.vault.configDir+"/ls-debug/stub-doc.md",stubDocMD)})});this.plugin;this.registerView("ols-pane-test",leaf=>new TestPaneView(leaf,this.plugin,this));this.addCommand({id:"view-test",name:"Open Test dialogue",callback:()=>{this.services.API.showWindow("ols-pane-test")}});return Promise.resolve(!0)}async _everyOnLayoutReady(){if(!this.settings.enableDebugTools)return Promise.resolve(!0);this.addCommand({id:"test-create-conflict",name:"Create conflict",callback:async()=>{const filename="test-create-conflict.md";if(await this.core.databaseFileAccess.store({name:filename,path:filename,body:new Blob(["# Test create conflict\n\n"],{type:"text/markdown"}),stat:{ctime:(new Date).getTime(),mtime:(new Date).getTime(),size:24,type:"file"}})){const id=await this.services.path.path2id(filename),f4=await this.core.localDatabase.getRaw(id);console.log(f4);console.log(f4._rev);const revConflict=f4._rev.split("-")[0]+"-"+(parseInt(f4._rev.split("-")[1])+1).toString();console.log(await this.core.localDatabase.bulkDocsRaw([f4],{new_edits:!1}));console.log(await this.core.localDatabase.bulkDocsRaw([{...f4,_rev:revConflict}],{new_edits:!1}))}}});await delay(1);return!0}_addTestResult(name,key3,result,summary,message){const logLine=`${name}: ${key3} ${null!=summary?summary:""}`;this.testResults.update(results=>{results.push([result,logLine,null!=message?message:""]);return results})}_everyModuleTest(){return this.settings.enableDebugTools?this.testDone():Promise.resolve(!0)}onBindFunction(core,services){services.appLifecycle.onLayoutReady.addHandler(this._everyOnLayoutReady.bind(this));services.appLifecycle.onInitialise.addHandler(this._everyOnloadStart.bind(this));services.appLifecycle.onSettingLoaded.addHandler(this._everyOnloadAfterLoadSettings.bind(this));services.test.test.addHandler(this._everyModuleTest.bind(this));services.test.addTestResult.setHandler(this._addTestResult.bind(this))}};ModuleInteractiveConflictResolver=class extends AbstractObsidianModule{_everyOnloadStart(){this.addCommand({id:"livesync-conflictcheck",name:"Pick a file to resolve conflict",callback:async()=>{await this.pickFileForResolve()}});this.addCommand({id:"livesync-all-conflictcheck",name:"Resolve all conflicted files",callback:async()=>{await this.allConflictCheck()}});return Promise.resolve(!0)}async _anyResolveConflictByUI(filename,conflictCheckResult){return await serialized("conflict-resolve-ui",async()=>{this._log("Merge:open conflict dialog",LOG_LEVEL_VERBOSE);const dialog=new ConflictResolveModal(this.app,filename,conflictCheckResult);dialog.open();const selected=await dialog.waitForResult();if(selected===CANCELLED){this._log(`Merge: Cancelled ${filename}`,LOG_LEVEL_INFO);return!1}const testDoc=await this.localDatabase.getDBEntry(filename,{conflicts:!0},!1,!0,!0);if(!1===testDoc){this._log(`Merge: Could not read ${filename} from the local database`,LOG_LEVEL_VERBOSE);return!1}if(!testDoc._conflicts){this._log(`Merge: Nothing to do ${filename}`,LOG_LEVEL_VERBOSE);return!1}const toDelete=selected;if(toDelete===LEAVE_TO_SUBSEQUENT){const p2=conflictCheckResult.diff.map(e3=>e3[1]).join(""),delRev=testDoc._conflicts[0];if(!await this.core.databaseFileAccess.storeContent(filename,p2)){this._log(`Concatenated content cannot be stored:${filename}`,LOG_LEVEL_NOTICE);return!1}if(await this.services.conflict.resolveByDeletingRevision(filename,delRev,"UI Concatenated")==MISSING_OR_ERROR){this._log(`Concatenated saved, but cannot delete conflicted revisions: ${filename}, (${displayRev(delRev)})`,LOG_LEVEL_NOTICE);return!1}}else{if("string"!=typeof toDelete){this._log(`Merge: Something went wrong: ${filename}, (${toDelete})`,LOG_LEVEL_NOTICE);return!1}if(await this.services.conflict.resolveByDeletingRevision(filename,toDelete,"UI Selected")==MISSING_OR_ERROR){this._log(`Merge: Something went wrong: ${filename}, (${toDelete})`,LOG_LEVEL_NOTICE);return!1}}this.settings.syncAfterMerge&&!this.services.appLifecycle.isSuspended()&&await this.services.replication.replicateByEvent();await this.services.conflict.queueCheckFor(filename);return!1})}async allConflictCheck(){for(;await this.pickFileForResolve(););}async pickFileForResolve(){const notes=[];for await(const doc of this.localDatabase.findAllDocs({conflicts:!0}))"_conflicts"in doc&¬es.push({id:doc._id,path:this.getPath(doc),dispPath:this.getPathWithoutPrefix(doc),mtime:doc.mtime});notes.sort((a2,b3)=>b3.mtime-a2.mtime);const notesList=notes.map(e3=>e3.dispPath);if(0==notesList.length){this._log("There are no conflicted documents",LOG_LEVEL_NOTICE);return!1}const target=await this.core.confirm.askSelectString("File to resolve conflict",notesList);if(target){const targetItem=notes.find(e3=>e3.dispPath==target);await this.services.conflict.queueCheckFor(targetItem.path);await this.services.conflict.ensureAllProcessed();return!0}return!1}async _allScanStat(){const notes=[];this._log("Checking conflicted files",LOG_LEVEL_VERBOSE);try{for await(const doc of this.localDatabase.findAllDocs({conflicts:!0}))"_conflicts"in doc&¬es.push({path:this.getPath(doc),mtime:doc.mtime});if(notes.length>0){this.core.confirm.askInPopup("conflicting-detected-on-safety",'Some files have been left conflicted! Press {HERE} to resolve them, or you can do it later by "Pick a file to resolve conflict',anchor=>{anchor.text="HERE";anchor.addEventListener("click",()=>{fireAndForget(()=>this.allConflictCheck())})});this._log('Some files have been left conflicted! Please resolve them by "Pick a file to resolve conflict". The list is written in the log.',LOG_LEVEL_VERBOSE);for(const note of notes)this._log(`Conflicted: ${note.path}`)}else this._log("There are no conflicting files",LOG_LEVEL_VERBOSE)}catch(e3){this._log(`Error while scanning conflicted files: ${e3}`,LOG_LEVEL_NOTICE);this._log(e3,LOG_LEVEL_VERBOSE);return!1}return!0}onBindFunction(core,services){services.appLifecycle.onScanningStartupIssues.addHandler(this._allScanStat.bind(this));services.appLifecycle.onInitialise.addHandler(this._everyOnloadStart.bind(this));services.conflict.resolveByUserInteraction.addHandler(this._anyResolveConflictByUI.bind(this))}};ModuleObsidianEvents=class extends AbstractObsidianModule{constructor(){super(...arguments);this.hasFocus=!0;this.isLastHidden=!1;this._totalProcessingCount=void 0}_everyOnloadStart(){this.plugin.registerEvent(this.app.vault.on("rename",(file,oldPath)=>{eventHub.emitEvent("file-renamed",{newPath:file.path,old:oldPath})}));this.plugin.registerEvent(this.app.workspace.on("active-leaf-change",()=>eventHub.emitEvent("leaf-active-changed")));return Promise.resolve(!0)}__performAppReload(){this.services.appLifecycle.performRestart()}swapSaveCommand(){var _a8,_b5;this._log("Modifying callback of the save command",LOG_LEVEL_VERBOSE);const saveCommandDefinition=null==(_b5=null==(_a8=this.app.commands)?void 0:_a8.commands)?void 0:_b5["editor:save-file"],save2=null==saveCommandDefinition?void 0:saveCommandDefinition.callback;if("function"==typeof save2){this.initialCallback=save2;saveCommandDefinition.callback=()=>{scheduleTask("syncOnEditorSave",250,()=>{if(this.services.control.hasUnloaded()){this._log("Unload and remove the handler.",LOG_LEVEL_VERBOSE);saveCommandDefinition.callback=this.initialCallback;this.initialCallback=void 0}else if(this.settings.syncOnEditorSave){this._log("Sync on Editor Save.",LOG_LEVEL_VERBOSE);fireAndForget(()=>this.services.replication.replicateByEvent())}});save2()}}const _this=this;window.CodeMirrorAdapter?window.CodeMirrorAdapter.commands.save=()=>{_this.app.commands.executeCommandById("editor:save-file")}:this._log("CodeMirrorAdapter is not available")}registerWatchEvents(){this.setHasFocus=this.setHasFocus.bind(this);this.watchWindowVisibility=this.watchWindowVisibility.bind(this);this.watchWorkspaceOpen=this.watchWorkspaceOpen.bind(this);this.watchOnline=this.watchOnline.bind(this);this.plugin.registerEvent(this.app.workspace.on("file-open",this.watchWorkspaceOpen));this.plugin.registerDomEvent(document,"visibilitychange",this.watchWindowVisibility);this.plugin.registerDomEvent(window,"focus",()=>this.setHasFocus(!0));this.plugin.registerDomEvent(window,"blur",()=>this.setHasFocus(!1));this.plugin.registerDomEvent(window,"online",this.watchOnline);this.plugin.registerDomEvent(window,"offline",this.watchOnline)}setHasFocus(hasFocus){this.hasFocus=hasFocus;this.watchWindowVisibility()}watchWindowVisibility(){scheduleTask("watch-window-visibility",100,()=>fireAndForget(()=>this.watchWindowVisibilityAsync()))}watchOnline(){scheduleTask("watch-online",500,()=>fireAndForget(()=>this.watchOnlineAsync()))}async watchOnlineAsync(){if(navigator.onLine&&this.localDatabase.needScanning){this.localDatabase.needScanning=!1;await this.services.vault.scanVault()}}async watchWindowVisibilityAsync(){if(this.settings.suspendFileWatching)return;if(!this.settings.isConfigured)return;if(!this.services.appLifecycle.isReady())return;if(this.isLastHidden&&!this.hasFocus)return;const isHidden=document.hidden;if(this.isLastHidden!==isHidden){this.isLastHidden=isHidden;await this.services.fileProcessing.commitPendingFileEvents();if(isHidden)await this.services.appLifecycle.onSuspending();else{if(this.services.appLifecycle.isSuspended())return;if(!this.hasFocus)return;await this.services.appLifecycle.onResuming();await this.services.appLifecycle.onResumed()}}}watchWorkspaceOpen(file){this.settings.suspendFileWatching||this.settings.isConfigured&&this.services.appLifecycle.isReady()&&file&&scheduleTask("watch-workspace-open",500,()=>fireAndForget(()=>this.watchWorkspaceOpenAsync(file)))}async watchWorkspaceOpenAsync(file){if(!this.settings.suspendFileWatching&&this.settings.isConfigured&&this.services.appLifecycle.isReady()){await this.services.fileProcessing.commitPendingFileEvents();if(null!=file){this.settings.syncOnFileOpen&&!this.services.appLifecycle.isSuspended()&&await this.services.replication.replicateByEvent();await this.services.conflict.queueCheckForIfOpen(file.path)}}}_everyOnLayoutReady(){this.swapSaveCommand();this.registerWatchEvents();return Promise.resolve(!0)}_askReload(message){this.services.appLifecycle.isReloadingScheduled()?this._log("Reloading is already scheduled",LOG_LEVEL_VERBOSE):scheduleTask("configReload",250,async()=>{const ret=await this.core.confirm.askSelectStringDialogue(message||"Do you want to restart and reload Obsidian now?",["Yes, schedule a restart after stabilisation","Yes, restart immediately","No, Leave it to me"],{defaultAction:"No, Leave it to me"});"Yes, restart immediately"==ret?this.__performAppReload():"Yes, schedule a restart after stabilisation"==ret&&this.services.appLifecycle.scheduleRestart()})}_scheduleAppReload(){if(!this._totalProcessingCount){const __tick=reactiveSource(0);this._totalProcessingCount=reactive(()=>{const dbCount=this.services.replication.databaseQueueCount.value,replicationCount=this.services.replication.replicationResultCount.value,storageApplyingCount=this.services.replication.storageApplyingCount.value,chunkCount=collectingChunks.value,pluginScanCount=pluginScanningCount.value,hiddenFilesCount=hiddenFilesEventCount.value+hiddenFilesProcessingCount.value,conflictProcessCount=this.services.conflict.conflictProcessQueueCount.value;__tick.value;return dbCount+replicationCount+storageApplyingCount+chunkCount+pluginScanCount+hiddenFilesCount+conflictProcessCount+0+0});this.plugin.registerInterval(setInterval(()=>{__tick.value++},1e3));let stableCheck=3;this._totalProcessingCount.onChanged(e3=>{if(0==e3.value){stableCheck--<=0&&this.__performAppReload();this._log(`Obsidian will be restarted soon! (Within ${stableCheck} seconds)`,LOG_LEVEL_NOTICE,"restart-notice")}else stableCheck=3})}}_isReloadingScheduled(){return void 0!==this._totalProcessingCount}onBindFunction(core,services){services.appLifecycle.onLayoutReady.addHandler(this._everyOnLayoutReady.bind(this));services.appLifecycle.onInitialise.addHandler(this._everyOnloadStart.bind(this));services.appLifecycle.askRestart.setHandler(this._askReload.bind(this));services.appLifecycle.scheduleRestart.setHandler(this._scheduleAppReload.bind(this));services.appLifecycle.isReloadingScheduled.setHandler(this._isReloadingScheduled.bind(this))}};checkRemoteVersion=async(db,migrate,barrier=12)=>{try{const versionInfo=await db.get("obsydian_livesync_version");if("versioninfo"!=versionInfo.type)return!1;const version2=versionInfo.version;if(version2{const vi={_id:"obsydian_livesync_version",version:barrier,type:"versioninfo"},versionInfo=await resolveWithIgnoreKnownError(db.get("obsydian_livesync_version"),vi);if("versioninfo"!=versionInfo.type)return!1;vi._rev=versionInfo._rev;await db.put(vi);return!0};checkSyncInfo=async db=>{try{const syncinfo=await db.get(SYNCINFO_ID);console.log(syncinfo);return!0}catch(ex){if(isErrorOfMissingDoc(ex)){const randomStrSrc="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",temp=[...Array(30)].map(_e2=>Math.floor(Math.random()*randomStrSrc.length)).map(e3=>randomStrSrc[e3]).join(""),newSyncInfo={_id:SYNCINFO_ID,type:"syncinfo",data:temp};return!!await db.put(newSyncInfo)}console.dir(ex);return!1}};SELECTOR_COMPROMISED_CHUNK_1={selector:{_id:{$lt:"h:"},type:"leaf"}};SELECTOR_COMPROMISED_CHUNK_2={selector:{_id:{$gt:"h;"},type:"leaf"}};webcrypto2=globalThis.crypto;SALT=(new TextEncoder).encode("fancySyncForYou!");previousPassphrase="";_nonceV3=new Uint32Array(1);bufV3=new Uint8Array(12);previousDecryptionPassphrase="";UNDEFINED=Symbol("undefined");webcrypto3=globalThis.crypto;IV_LENGTH=12;HKDF_SALT_LENGTH=32;PBKDF2_SALT_LENGTH=32;gcmTagLength=128;HKDF_ENCRYPTED_PREFIX="%=";HKDF_SALTED_ENCRYPTED_PREFIX="%$";deriveMasterKey=function memoWithMap(bufferLength,fn,keyFunction){if(bufferLength<=0)throw new Error("Buffer length must be greater than 0");const cache2=new Map,getKey3=args=>args.length>0&&"string"==typeof args[0]?args[0]:JSON.stringify(args,(key3,value)=>void 0===value?UNDEFINED:value);return function(...args){const key3=keyFunction?keyFunction(args):getKey3(args);if(cache2.has(key3)){const hitPromise=cache2.get(key3);cache2.delete(key3);cache2.set(key3,hitPromise);return hitPromise}const newPromise=fn(...args);cache2.set(key3,newPromise);newPromise.catch(()=>{cache2.get(key3)===newPromise&&cache2.delete(key3)});if(cache2.size>bufferLength){const oldestKey=cache2.keys().next().value;oldestKey&&cache2.delete(oldestKey)}return newPromise}}(10,async(passphrase,pbkdf2Salt)=>{const binaryPassphrase=writeString(passphrase),keyMaterial=await webcrypto3.subtle.importKey("raw",binaryPassphrase,{name:"PBKDF2",length:256},!1,["deriveKey"]),masterKeyRaw=await webcrypto3.subtle.deriveKey({name:"PBKDF2",salt:pbkdf2Salt,iterations:31e4,hash:"SHA-256"},keyMaterial,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),masterKeyBuffer=await webcrypto3.subtle.exportKey("raw",masterKeyRaw);return await webcrypto3.subtle.importKey("raw",masterKeyBuffer,{name:"HKDF"},!1,["deriveKey"])},([passphrase,salt])=>`${passphrase}-${uint8ArrayToHexString(salt)}`);webcrypto4=globalThis.crypto;ENCRYPT_V1_PREFIX_PROBABLY="[";ENCRYPT_V2_PREFIX="%";ENCRYPT_V3_PREFIX="%~";KeyBuffs=new Map;decKeyBuffs=new Map;KEY_RECYCLE_COUNT=100;nonceBuffer=new Uint32Array(1);webcrypto5=globalThis.crypto;keyGCCount=5*KEY_RECYCLE_COUNT;decKeyIdx=0;decKeyMin=0;SYMBOL_USED=Symbol("used");SYMBOL_END_OF_DATA=Symbol("endOfData");workerStreams=new Map;writers=new Map;responseBuf=new Map;writerPromise=Promise.resolve();tasks2=new Map;workers=[];key2=0;roundRobinIdx=0;encrypt4=function encryptWorker(input,passphrase,autoCalculateIterations){return encryptionOnWorker({type:"encrypt",input,passphrase,autoCalculateIterations})};decrypt4=function decryptWorker(input,passphrase,autoCalculateIterations){return encryptionOnWorker({type:"decrypt",input,passphrase,autoCalculateIterations})};encryptHKDF=encryptHKDFWorker;decryptHKDF=function decryptHKDFWorker(input,passphrase,pbkdf2Salt){return encryptionHKDFOnWorker({type:"decryptHKDF",input,passphrase,pbkdf2Salt})};Encrypt_HKDF_Header="%=";Encrypt_OLD_Header="%";EncryptionVersions_UNENCRYPTED=0,EncryptionVersions_ENCRYPTED=1,EncryptionVersions_HKDF=2,EncryptionVersions_UNKNOWN=99;ENCRYPTED_META_PREFIX="/\\:";MESSAGE_FALLBACK_DECRYPT_FAILED="Failed to decrypt the data with V1 method. Cannot encrypt with HKDF.";ENCRYPTION_HKDF_FAILED="Encryption with HKDF failed.";DECRYPTION_HKDF_FAILED="Decryption with HKDF failed.";DECRYPTION_FALLBACK_FAILED="Decryption with fallback failed.";preprocessOutgoing=async doc=>await Promise.resolve(doc);enableEncryption=(db,passphrase,useDynamicIterationCount,migrationDecrypt,getPBKDF2Salt,algorithm)=>{const decrypted=new Map,incoming=doc=>algorithm===E2EEAlgorithms.V2?incomingEncryptHKDF(doc,passphrase,useDynamicIterationCount,getPBKDF2Salt):incomingEncryptV1(doc,passphrase,useDynamicIterationCount);preprocessOutgoing=incoming;db.transform({incoming,outgoing:doc=>algorithm!==E2EEAlgorithms.ForceV1?outgoingDecryptHKDF(doc,0,0,passphrase,useDynamicIterationCount,getPBKDF2Salt):outgoingDecryptV1(doc,migrationDecrypt,decrypted,passphrase,useDynamicIterationCount)})};EDEN_ENCRYPTED_KEY="h:++encrypted";EDEN_ENCRYPTED_KEY_HKDF="h:++encrypted-hkdf";LiveSyncAbstractReplicator=class{constructor(env){this.syncStatus="NOT_CONNECTED";this.docArrived=0;this.docSent=0;this.lastSyncPullSeq=0;this.maxPullSeq=0;this.lastSyncPushSeq=0;this.maxPushSeq=0;this.nodeid="";this.remoteLocked=!1;this.remoteCleaned=!1;this.remoteLockedAndDeviceNotAccepted=!1;this.tweakSettingsMismatched=!1;this.updateInfo=()=>{this.env.services.replicator.replicationStatics.value={sent:this.docSent,arrived:this.docArrived,maxPullSeq:this.maxPullSeq,maxPushSeq:this.maxPushSeq,lastSyncPullSeq:this.lastSyncPullSeq,lastSyncPushSeq:this.lastSyncPushSeq,syncStatus:this.syncStatus}};this.env=env}get database(){return this.env.services.database.localDatabase}get rawDatabase(){return this.env.services.database.localDatabase.localDatabase}get currentSettings(){return this.env.services.setting.currentSettings()}sendChunks(setting,remoteDB,showResult,fromSeq){return Promise.resolve(!0)}async ensurePBKDF2Salt(setting,showMessage=!1,useCache=!0){try{const hash3=await this.getReplicationPBKDF2Salt(setting,!useCache);if(0==hash3.length)throw new Error("PBKDF2 salt (Security Seed) is empty");Logger(`PBKDF2 salt (Security Seed): ${await arrayBufferToBase64Single2(hash3)}`,LOG_LEVEL_VERBOSE);return!0}catch(ex){Logger("Failed to obtain PBKDF2 salt (Security Seed) for replication",showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);Logger(ex,LOG_LEVEL_VERBOSE);return!1}}async initializeDatabaseForReplication(){const db=this.rawDatabase;try{const nodeinfo=await resolveWithIgnoreKnownError(db.get(NODEINFO_DOCID),{_id:NODEINFO_DOCID,type:"nodeinfo",nodeid:"",v20220607:!0});if(""==nodeinfo.nodeid){nodeinfo.nodeid=Math.random().toString(36).slice(-10);await db.put(nodeinfo)}this.nodeid=nodeinfo.nodeid;return!0}catch(ex){Logger(ex)}return!1}};_handlers=new Map;SyncParamsHandlerError=class extends LiveSyncError{};SyncParamsFetchError=class extends SyncParamsHandlerError{};SyncParamsNotFoundError=class extends SyncParamsHandlerError{};SyncParamsUpdateError=class extends SyncParamsHandlerError{};currentVersionRange={min:0,max:2400,current:2};selectorOnDemandPull={selector:{type:{$ne:"leaf"}}};LiveSyncCouchDBReplicator=class extends LiveSyncAbstractReplicator{get isChunkSendingSupported(){return!0}isMobile(){return this.env.services.API.isMobile()}constructor(env){super(env);this.env=env;this.initializeDatabaseForReplication();this.rawDatabase.on("close",()=>{this.closeReplication()})}getInitialSyncParameters(setting){return Promise.resolve({...DEFAULT_SYNC_PARAMETERS,protocolVersion:2})}async getSyncParameters(setting){try{const downloadedSyncParams=await this.fetchRemoteDocument(setting,"_local/obsidian_livesync_sync_parameters");if(!downloadedSyncParams)throw new SyncParamsNotFoundError("Sync parameters not found on remote server");return downloadedSyncParams}catch(ex){Logger("Could not retrieve remote sync parameters",LOG_LEVEL_INFO);throw SyncParamsFetchError.fromError(ex)}}async putSyncParameters(setting,params){try{const ret=await this.putRemoteDocument(setting,params);if(ret.ok)return!0;throw new SyncParamsUpdateError(`Could not store remote sync parameters: ${JSON.stringify(ret)}`)}catch(ex){Logger("Could not store remote sync parameters",LOG_LEVEL_INFO);throw SyncParamsUpdateError.fromError(ex)}}async getReplicationPBKDF2Salt(setting,refresh){const manager=createSyncParamsHanderForServer(`${setting.couchDB_URI}/${setting.couchDB_DBNAME}`,{put:params=>this.putSyncParameters(setting,params),get:()=>this.getSyncParameters(setting),create:()=>this.getInitialSyncParameters(setting)});return await manager.getPBKDF2Salt(refresh)}async migrate(from,to){Logger(`Database updated from ${from} to ${to}`,LOG_LEVEL_NOTICE);return Promise.resolve(!0)}terminateSync(){if(this.controller){this.controller.abort();this.controller=void 0}}async openReplication(setting,keepAlive,showResult,ignoreCleanLock){await this.initializeDatabaseForReplication();if(!keepAlive)return this.openOneShotReplication(setting,showResult,!1,"sync",ignoreCleanLock);this.openContinuousReplication(setting,showResult,!1)}replicationActivated(showResult){this.syncStatus="CONNECTED";this.updateInfo();Logger("Replication activated",showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"sync")}async replicationChangeDetected(e3,showResult,docSentOnStart,docArrivedOnStart){try{if("pull"==e3.direction){await this.env.services.replication.parseSynchroniseResult(e3.change.docs);this.docArrived+=e3.change.docs.length}else this.docSent+=e3.change.docs.length;if(showResult){const maxPullSeq=this.maxPullSeq,maxPushSeq=this.maxPushSeq,lastSyncPullSeq=this.lastSyncPullSeq,lastSyncPushSeq=this.lastSyncPushSeq,pushLast=0==lastSyncPushSeq?"":lastSyncPushSeq>=maxPushSeq?" (LIVE)":` (${maxPushSeq-lastSyncPushSeq})`,pullLast=0==lastSyncPullSeq?"":lastSyncPullSeq>=maxPullSeq?" (LIVE)":` (${maxPullSeq-lastSyncPullSeq})`;Logger(`↑${this.docSent-docSentOnStart}${pushLast} ↓${this.docArrived-docArrivedOnStart}${pullLast}`,LOG_LEVEL_NOTICE,"sync")}this.updateInfo()}catch(ex){Logger("Replication callback error",LOG_LEVEL_NOTICE,"sync");Logger(ex,LOG_LEVEL_VERBOSE)}}replicationCompleted(showResult){this.syncStatus="COMPLETED";this.updateInfo();Logger("Replication completed",showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,showResult?"sync":"");this.terminateSync()}replicationDenied(e3){this.syncStatus="ERRORED";this.updateInfo();this.terminateSync();Logger("Replication denied",LOG_LEVEL_NOTICE,"sync");Logger(e3,LOG_LEVEL_VERBOSE)}replicationErrored(e3){this.syncStatus="ERRORED";this.terminateSync();this.updateInfo();Logger("Replication error",LOG_LEVEL_NOTICE,"sync");Logger(e3,LOG_LEVEL_VERBOSE)}replicationPaused(){this.syncStatus="PAUSED";this.updateInfo();Logger("Replication paused",LOG_LEVEL_VERBOSE,"sync")}async processSync(syncHandler,showResult,docSentOnStart,docArrivedOnStart,syncMode,retrying,reportCancelledAsDone=!0){const controller=new AbortController;this.controller&&this.controller.abort();this.controller=controller;const gen=genReplication(syncHandler,controller.signal);try{for await(const[type,e3]of gen){const releaser=await globalConcurrencyController.tryAcquire(1,3e6);if(!1===releaser){Logger("Replication stopped for busy.",showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"sync");return"FAILED"}releaser();switch(type){case"change":if("direction"in e3){"pull"==e3.direction?this.lastSyncPullSeq=Number(`${e3.change.last_seq}`.split("-")[0]):this.lastSyncPushSeq=Number(`${e3.change.last_seq}`.split("-")[0]);await this.replicationChangeDetected(e3,showResult,docSentOnStart,docArrivedOnStart)}else if("pullOnly"==syncMode){this.lastSyncPullSeq=Number(`${e3.last_seq}`.split("-")[0]);await this.replicationChangeDetected({direction:"pull",change:e3},showResult,docSentOnStart,docArrivedOnStart)}else if("pushOnly"==syncMode){this.lastSyncPushSeq=Number(`${e3.last_seq}`.split("-")[0]);this.updateInfo();await this.replicationChangeDetected({direction:"push",change:e3},showResult,docSentOnStart,docArrivedOnStart)}if(retrying&&this.docSent-docSentOnStart+(this.docArrived-docArrivedOnStart)>2*this.originalSetting.batch_size)return"NEED_RESURRECT";break;case"complete":this.replicationCompleted(showResult);return"DONE";case"active":this.replicationActivated(showResult);break;case"denied":this.replicationDenied(e3);return"FAILED";case"error":this.replicationErrored(e3);Logger("Replication stopped.",showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"sync");if(this.env.services.remote.hadLastPostFailedBySize){if(e3&&413==(null==e3?void 0:e3.status)){Logger("Something went wrong during synchronisation. Please check the log!",LOG_LEVEL_NOTICE);return"FAILED"}return"NEED_RETRY"}Logger("Replication error",LOG_LEVEL_NOTICE,"sync");Logger(e3,LOG_LEVEL_VERBOSE);return"FAILED";case"paused":this.replicationPaused();break;case"finally":break;default:Logger(`Unexpected synchronization status:${JSON.stringify(e3)}`)}}return reportCancelledAsDone?"DONE":"CANCELLED"}catch(ex){Logger("Unexpected synchronization exception");Logger(ex,LOG_LEVEL_VERBOSE);return"FAILED"}finally{this.terminateSync();this.controller=void 0}}getEmptyMaxEntry(remoteID){return{_id:`_local/max_seq_on_chunk-${remoteID}`,maxSeq:0,remoteID,seqStatusMap:{},_rev:void 0}}async getLastTransferredSeqOfChunks(localDB,remoteID){const prevMax={_id:`_local/max_seq_on_chunk-${remoteID}`,maxSeq:0,remoteID,seqStatusMap:{},_rev:void 0},previous_max_seq_on_chunk=await wrapException(()=>localDB.get(prevMax._id));return previous_max_seq_on_chunk instanceof Error?prevMax:previous_max_seq_on_chunk}async updateMaxTransferredSeqOnChunks(localDB,remoteID,seqStatusMap){const newMax={_id:"_local/max_seq_on_chunk",maxSeq:0,remoteID,seqStatusMap,_rev:void 0},seqs=Object.keys(seqStatusMap).map(e3=>Number(e3));let maxSeq=0;for(const seq of seqs){if(!seqStatusMap[seq])break;maxSeq=seq}Logger(`Updating max seq on chunk to ${maxSeq}`,LOG_LEVEL_VERBOSE);newMax.maxSeq=maxSeq;const previous_max_seq_on_chunk=await wrapException(()=>localDB.get(newMax._id));if(previous_max_seq_on_chunk instanceof Error)delete newMax._rev;else{newMax._rev=previous_max_seq_on_chunk._rev;newMax.seqStatusMap={...previous_max_seq_on_chunk.seqStatusMap,...seqStatusMap}}await wrapException(()=>localDB.put(newMax));return newMax}async sendChunks(setting,remoteDB,showResult,fromSeq){const trench=new Trench(this.env.services.keyValueDB.openSimpleStore("sc-"),!1);await trench.eraseAllEphemerals();if(!remoteDB){const d4=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"==typeof d4){Logger($msg("liveSyncReplicator.couldNotConnectToRemoteDb",{d:d4}),showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"fetch");return!1}remoteDB=d4.db}await this.checkReplicationConnectivity(setting,!1,!1,!1,!1);Logger("Bulk sending chunks to remote database...",showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"fetch");const remoteMilestone=await remoteDB.get(MILESTONE_DOCID),remoteID=null==remoteMilestone?void 0:remoteMilestone.created,localDB=this.rawDatabase,te5=new TextEncoder;Logger($msg("liveSyncReplicator.checkingLastSyncPoint"),showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"fetch");this.syncStatus="CONNECTED";const prev=await this.getLastTransferredSeqOfChunks(localDB,remoteID),seq=null!=fromSeq?fromSeq:prev.maxSeq,localScannedDocs=[],sentMap={},diffChunks=localDB.changes({since:seq,live:!1,include_docs:!0,return_docs:!1,selector:{type:"leaf"}}).on("change",e3=>{const numSeq=Number(e3.seq);prev.seqStatusMap[numSeq]||localScannedDocs.push({id:e3.id,seq:Number(e3.seq)})});await diffChunks;localScannedDocs.sort((a2,b3)=>a2.seq-b3.seq);const idSeqMap=Object.fromEntries(localScannedDocs.map(e3=>[e3.id,e3.seq]));for(const checkDocs of arrayToChunkedArray(localScannedDocs,250)){const remoteDocs=await remoteDB.allDocs({keys:checkDocs.map(e3=>e3.id),include_docs:!1}),remoteDocMap=Object.fromEntries(remoteDocs.rows.map(e3=>[e3.key,"error"in e3?e3.error:e3.value])),sendDocs=checkDocs.filter(e3=>"not_found"==remoteDocMap[e3.id]),sentDocs=checkDocs.filter(e3=>"not_found"!=remoteDocMap[e3.id]);sendDocs.forEach(e3=>sentMap[e3.seq]=!1);sentDocs.forEach(e3=>sentMap[e3.seq]=!0);const sendDocsMap=Object.fromEntries(sendDocs.map(e3=>[e3.id,e3.seq]));if(sendDocs.length>0){const localDocs=await localDB.allDocs({keys:sendDocs.map(e3=>e3.id),include_docs:!0});await trench.queue("send-chunks",localDocs.rows.filter(e3=>"id"in e3).map(e3=>({seq:sendDocsMap[e3.id],doc:e3.doc,id:e3.id})))}}let bulkDocs2=[],bulkDocsSizeBytes=0,bulkDocsSizeCount=0,maxSeq=0;const maxBatchSizeBytes=1024*setting.sendChunksBulkMaxSize*1024,semaphore=Semaphore(4);let sendingDocs=0,sentDocsCount=0;const sendChunks=async(bulkDocs3,bulkDocsSize,seq2)=>{Logger(`Sending ${bulkDocs3.length} (${bulkDocsSize} => ${sizeToHumanReadable(bulkDocsSize)} in plain) chunks to remote database...`,LOG_LEVEL_VERBOSE);const releaser=await semaphore.acquire(1);sendingDocs+=bulkDocs3.length;Logger(`↑ Uploading chunks \n${sendingDocs}/(${sentDocsCount} done)`,showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"send");try{const uploadBulkDocTasks=bulkDocs3.map(e3=>preprocessOutgoing(e3)),uploadBulkDocs=await Promise.all(uploadBulkDocTasks);await remoteDB.bulkDocs(uploadBulkDocs,{new_edits:!1});uploadBulkDocs.forEach(e3=>sentMap[idSeqMap[e3._id]]=!0);await this.updateMaxTransferredSeqOnChunks(localDB,remoteID,sentMap);sentDocsCount+=bulkDocs3.length;Logger(`↑ Uploading chunks \n${sendingDocs}/(${sentDocsCount} done)`,showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"send")}catch(ex){Logger("Bulk sending failed.",showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"send");Logger(ex,LOG_LEVEL_VERBOSE);return!1}finally{releaser()}return!0},tasks3=[];for(;;){const nowSendChunks=await trench.dequeue("send-chunks");if(!nowSendChunks||0==nowSendChunks.length)break;for(const chunk of nowSendChunks){const jsonLength=te5.encode(JSON.stringify(chunk.doc)).byteLength+32;if((bulkDocsSizeBytes+jsonLength>maxBatchSizeBytes||bulkDocsSizeCount+1>200)&&bulkDocs2.length>0){tasks3.push(sendChunks([...bulkDocs2],bulkDocsSizeBytes));bulkDocs2=[];bulkDocsSizeBytes=0;bulkDocsSizeCount=0}bulkDocs2.push(chunk.doc);maxSeq=chunk.seq;bulkDocsSizeBytes+=jsonLength;bulkDocsSizeCount+=1}bulkDocs2.length>0&&tasks3.push(sendChunks([...bulkDocs2],bulkDocsSizeBytes));if((await Promise.all(tasks3.map(async e3=>{try{await e3}catch(ex){Logger("Bulk sending failed.",showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"send");Logger(ex,LOG_LEVEL_VERBOSE);return!1}}))).some(e3=>!1===e3))return!1}return!0}async openOneShotReplication(setting,showResult,retrying,syncMode,ignoreCleanLock=!1){if(!1===await this.ensurePBKDF2Salt(setting,showResult,!retrying))return!1;const next2=await shareRunningResult("oneShotReplication",async()=>{if(this.controller){Logger($msg("liveSyncReplicator.replicationInProgress"),showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"sync");return!1}const localDB=this.rawDatabase;Logger($msg("liveSyncReplicator.oneShotSyncBegin",{syncMode}));const ret=await this.checkReplicationConnectivity(setting,!1,retrying,showResult,ignoreCleanLock);if(!1===ret){Logger($msg("liveSyncReplicator.couldNotConnectToServer"),showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"sync");return!1}this.maxPullSeq=Number(`${ret.info.update_seq}`.split("-")[0]);this.maxPushSeq=Number(`${(await localDB.info()).update_seq}`.split("-")[0]);showResult&&Logger($msg("liveSyncReplicator.checkingLastSyncPoint"),LOG_LEVEL_NOTICE,"sync");const{db,syncOptionBase}=ret;this.syncStatus="STARTED";this.updateInfo();const docArrivedOnStart=this.docArrived,docSentOnStart=this.docSent;retrying||(this.originalSetting=setting);this.terminateSync();const syncHandler="sync"==syncMode?localDB.sync(db,{...syncOptionBase}):"pullOnly"==syncMode?localDB.replicate.from(db,{...syncOptionBase,...setting.readChunksOnline?selectorOnDemandPull:{}}):"pushOnly"==syncMode?localDB.replicate.to(db,{...syncOptionBase}):void 0,syncResult=await this.processSync(syncHandler,showResult,docSentOnStart,docArrivedOnStart,syncMode,retrying,!1);if("DONE"==syncResult)return!0;if("CANCELLED"==syncResult)return!1;if("FAILED"==syncResult)return!1;if("NEED_RESURRECT"==syncResult){this.terminateSync();return async()=>await this.openOneShotReplication(this.originalSetting,showResult,!1,syncMode,ignoreCleanLock)}if("NEED_RETRY"==syncResult){const tempSetting=JSON.parse(JSON.stringify(setting));tempSetting.batch_size=Math.ceil(tempSetting.batch_size/2)+2;tempSetting.batches_limit=Math.ceil(tempSetting.batches_limit/2)+2;if(tempSetting.batch_size<=5&&tempSetting.batches_limit<=5){Logger($msg("liveSyncReplicator.cantReplicateLowerValue"),showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);return!1}Logger($msg("liveSyncReplicator.retryLowerBatchSize",{batch_size:tempSetting.batch_size.toString(),batches_limit:tempSetting.batches_limit.toString()}),showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);return async()=>await this.openOneShotReplication(tempSetting,showResult,!0,syncMode,ignoreCleanLock)}return!1});return"boolean"==typeof next2?next2:await next2()}replicateAllToServer(setting,showingNotice){return this.openOneShotReplication(setting,null!=showingNotice&&showingNotice,!1,"pushOnly")}replicateAllFromServer(setting,showingNotice){return this.openOneShotReplication(setting,null!=showingNotice&&showingNotice,!1,"pullOnly")}async checkReplicationConnectivity(setting,keepAlive,skipCheck,showResult,ignoreCleanLock=!1){if(""!=setting.versionUpFlash){Logger($msg("Replicator.Message.VersionUpFlash"),LOG_LEVEL_NOTICE);return!1}const uri=setting.couchDB_URI+(""==setting.couchDB_DBNAME?"":"/"+setting.couchDB_DBNAME);if(this.controller){Logger("Another replication running.");return!1}const dbRet=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"==typeof dbRet){Logger($msg("liveSyncReplicator.couldNotConnectToURI",{uri,dbRet}),showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);return!1}if(!skipCheck){if(!await checkRemoteVersion(dbRet.db,this.migrate.bind(this),12)){Logger($msg("liveSyncReplicator.remoteDbCorrupted"),LOG_LEVEL_NOTICE);return!1}this.remoteCleaned=!1;this.remoteLocked=!1;this.remoteLockedAndDeviceNotAccepted=!1;this.tweakSettingsMismatched=!1;this.preferredTweakValue=void 0;const progress=`${dbRet.info.update_seq}`,info3={app_version:this.env.services.API.getAppVersion(),plugin_version:this.env.services.API.getPluginVersion(),vault_name:this.env.services.vault.vaultName(),device_name:this.env.services.vault.getVaultName(),progress},ensure=await ensureDatabaseIsCompatible(dbRet.db,setting,this.nodeid,currentVersionRange,info3);if("INCOMPATIBLE"==ensure){Logger("The remote database has no compatibility with the running version. Please upgrade the plugin.",LOG_LEVEL_NOTICE);return!1}if("NODE_LOCKED"==ensure){Logger("The remote database has been rebuilt or corrupted since we have synchronized last time. Fetch rebuilt DB, explicit unlocking or chunk clean-up is required.",LOG_LEVEL_NOTICE);this.remoteLockedAndDeviceNotAccepted=!0;this.remoteLocked=!0;return!1}if("LOCKED"==ensure)this.remoteLocked=!0;else if("NODE_CLEANED"==ensure){if(!ignoreCleanLock){Logger("The remote database has been cleaned up. Fetch rebuilt DB, explicit unlocking or chunk clean-up is required.",LOG_LEVEL_NOTICE);this.remoteLockedAndDeviceNotAccepted=!0;this.remoteLocked=!0;this.remoteCleaned=!0;return!1}this.remoteLocked=!0}else if("OK"==ensure);else if("MISMATCHED"==ensure[0]){Logger("Configuration mismatching between the clients has been detected. This can be harmful or extra capacity consumption. We have to make these value unified. When replication is initiated manually via the command palette or ribbon, a dialogue box will open to address this.",LOG_LEVEL_NOTICE);this.tweakSettingsMismatched=!0;this.preferredTweakValue=ensure[1];return!1}}const syncOptionBase={batches_limit:setting.batches_limit,batch_size:setting.batch_size,push:{}};setting.readChunksOnline&&(syncOptionBase.pull={...selectorOnDemandPull});const syncOption=keepAlive?{live:!0,retry:!0,heartbeat:!setting.useTimeouts&&3e4,...syncOptionBase}:{...syncOptionBase};return{db:dbRet.db,info:dbRet.info,syncOptionBase,syncOption}}async openContinuousReplication(setting,showResult,retrying){const next2=await shareRunningResult("continuousReplication",async()=>{if(this.controller){Logger($msg("liveSyncReplicator.replicationInProgress"),showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);return!1}const localDB=this.rawDatabase;Logger($msg("liveSyncReplicator.beforeLiveSync"));if(await this.openOneShotReplication(setting,showResult,!1,"pullOnly")){Logger($msg("liveSyncReplicator.liveSyncBegin"));const ret=await this.checkReplicationConnectivity(setting,!0,!0,showResult);if(!1===ret){Logger($msg("liveSyncReplicator.couldNotConnectToServer"),showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);return!1}showResult&&Logger($msg("liveSyncReplicator.checkingLastSyncPoint"),LOG_LEVEL_NOTICE,"sync");const{db,syncOption}=ret;this.syncStatus="STARTED";this.maxPullSeq=Number(`${ret.info.update_seq}`.split("-")[0]);this.maxPushSeq=Number(`${(await localDB.info()).update_seq}`.split("-")[0]);this.updateInfo();const docArrivedOnStart=this.docArrived,docSentOnStart=this.docSent;retrying||(this.originalSetting=setting);this.terminateSync();const syncHandler=localDB.sync(db,{...syncOption}),syncMode="sync",syncResult=await this.processSync(syncHandler,showResult,docSentOnStart,docArrivedOnStart,syncMode,retrying);if("DONE"==syncResult)return!0;if("FAILED"==syncResult)return!1;if("NEED_RESURRECT"==syncResult){this.terminateSync();return async()=>await this.openContinuousReplication(this.originalSetting,showResult,!1)}if("NEED_RETRY"==syncResult){const tempSetting=JSON.parse(JSON.stringify(setting));tempSetting.batch_size=Math.ceil(tempSetting.batch_size/2)+2;tempSetting.batches_limit=Math.ceil(tempSetting.batches_limit/2)+2;if(tempSetting.batch_size<=5&&tempSetting.batches_limit<=5){Logger($msg("liveSyncReplicator.cantReplicateLowerValue"),showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);return!1}Logger($msg("liveSyncReplicator.retryLowerBatchSize",{batch_size:tempSetting.batch_size.toString(),batches_limit:tempSetting.batches_limit.toString()}),showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);return async()=>await this.openContinuousReplication(tempSetting,showResult,!0)}}return!1});return"boolean"==typeof next2?next2:await next2()}closeReplication(){if(this.controller){this.controller.abort();this.controller=void 0;this.syncStatus="CLOSED";Logger($msg("liveSyncReplicator.replicationClosed"));this.updateInfo()}}async tryResetRemoteDatabase(setting){this.closeReplication();const con=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"!=typeof con){try{await con.db.destroy();Logger($msg("liveSyncReplicator.remoteDbDestroyed"),LOG_LEVEL_NOTICE);await this.tryCreateRemoteDatabase(setting)}catch(ex){Logger($msg("liveSyncReplicator.remoteDbDestroyError"),LOG_LEVEL_NOTICE);Logger(ex,LOG_LEVEL_NOTICE)}clearHandlers();await this.ensurePBKDF2Salt(setting,!0,!1)}}async tryCreateRemoteDatabase(setting){this.closeReplication();if("string"!=typeof await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0)){clearHandlers();await this.ensurePBKDF2Salt(setting,!0,!1);Logger($msg("liveSyncReplicator.remoteDbCreatedOrConnected"),LOG_LEVEL_NOTICE)}}async markRemoteLocked(setting,locked,lockByClean){const uri=setting.couchDB_URI+(""==setting.couchDB_DBNAME?"":"/"+setting.couchDB_DBNAME),dbRet=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"==typeof dbRet){Logger($msg("liveSyncReplicator.couldNotConnectToURI",{uri,dbRet}),LOG_LEVEL_NOTICE);return}if(!await checkRemoteVersion(dbRet.db,this.migrate.bind(this),12)){Logger($msg("liveSyncReplicator.remoteDbCorrupted"),LOG_LEVEL_NOTICE);return}const defInitPoint={_id:MILESTONE_DOCID,type:"milestoneinfo",created:new Date/1,locked,cleaned:lockByClean,accepted_nodes:[this.nodeid],node_chunk_info:{[this.nodeid]:currentVersionRange},node_info:{},tweak_values:{}},remoteMilestone={...defInitPoint,...await resolveWithIgnoreKnownError(dbRet.db.get(MILESTONE_DOCID),defInitPoint)};remoteMilestone.node_chunk_info={...defInitPoint.node_chunk_info,...remoteMilestone.node_chunk_info};remoteMilestone.accepted_nodes=[this.nodeid];remoteMilestone.locked=locked;remoteMilestone.cleaned=remoteMilestone.cleaned||lockByClean;Logger($msg(locked?"liveSyncReplicator.lockRemoteDb":"liveSyncReplicator.unlockRemoteDb"),LOG_LEVEL_NOTICE);await dbRet.db.put(remoteMilestone)}async markRemoteResolved(setting){const uri=setting.couchDB_URI+(""==setting.couchDB_DBNAME?"":"/"+setting.couchDB_DBNAME),dbRet=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"==typeof dbRet){Logger($msg("liveSyncReplicator.couldNotConnectToURI",{uri,dbRet}),LOG_LEVEL_NOTICE);return}if(!await checkRemoteVersion(dbRet.db,this.migrate.bind(this),12)){Logger($msg("liveSyncReplicator.remoteDbCorrupted"),LOG_LEVEL_NOTICE);return}const defInitPoint={_id:MILESTONE_DOCID,type:"milestoneinfo",created:new Date/1,locked:!1,accepted_nodes:[this.nodeid],node_info:{},node_chunk_info:{[this.nodeid]:currentVersionRange},tweak_values:{}},remoteMilestone={...defInitPoint,...await resolveWithIgnoreKnownError(dbRet.db.get(MILESTONE_DOCID),defInitPoint)};remoteMilestone.node_chunk_info={...defInitPoint.node_chunk_info,...remoteMilestone.node_chunk_info};remoteMilestone.accepted_nodes=Array.from(new Set([...remoteMilestone.accepted_nodes,this.nodeid]));Logger($msg("liveSyncReplicator.markDeviceResolved"),LOG_LEVEL_NOTICE);(await dbRet.db.put(remoteMilestone)).ok?Logger($msg("liveSyncReplicator.remoteDbMarkedResolved"),LOG_LEVEL_VERBOSE):Logger($msg("liveSyncReplicator.couldNotMarkResolveRemoteDb"),LOG_LEVEL_NOTICE)}connectRemoteCouchDBWithSetting(settings,isMobile,performSetup=!1,skipInfo=!1){if(settings.encrypt&&""==settings.passphrase&&!settings.permitEmptyPassphrase)return"Empty passphrases cannot be used without explicit permission";const customHeaders=parseHeaderValues(settings.couchDB_CustomHeaders),auth=settings.useJWT?{jwtAlgorithm:settings.jwtAlgorithm,jwtKey:settings.jwtKey,jwtExpDuration:settings.jwtExpDuration,jwtKid:settings.jwtKid,jwtSub:settings.jwtSub,type:"jwt"}:{username:settings.couchDB_USER,password:settings.couchDB_PASSWORD,type:"basic"};return this.env.services.remote.connect(settings.couchDB_URI+(""==settings.couchDB_DBNAME?"":"/"+settings.couchDB_DBNAME),auth,settings.disableRequestURI||isMobile,settings.encrypt?settings.passphrase:settings.encrypt,settings.useDynamicIterationCount,performSetup,skipInfo,settings.enableCompression,customHeaders,settings.useRequestAPI,async()=>await this.getReplicationPBKDF2Salt(settings))}async _ensureConnection(settings){const ret=await this.connectRemoteCouchDBWithSetting(settings,this.isMobile(),!1,!0);if("string"==typeof ret)throw new Error(`${$msg("liveSyncReplicator.couldNotConnectToServer")}:${ret}`);return ret.db}async fetchRemoteDocument(settings,id,db){try{const connDB=null!=db?db:await this._ensureConnection(settings);return await connDB.get(id)}catch(ex){if("status"in ex&&404==ex.status)return!1;throw ex}}async putRemoteDocument(settings,doc,db){const connDB=null!=db?db:await this._ensureConnection(settings);return await connDB.put(doc)}async fetchRemoteChunks(missingChunks,showResult){const ret=await this.connectRemoteCouchDBWithSetting(this.currentSettings,this.isMobile(),!1,!0);if("string"==typeof ret){Logger(`${$msg("liveSyncReplicator.couldNotConnectToServer")} ${ret} `,showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"fetch");return!1}const remoteChunks=await ret.db.allDocs({keys:missingChunks,include_docs:!0});if(remoteChunks.rows.some(e3=>"error"in e3)){Logger("Some chunks are not exists both on remote and local database.",showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"fetch");Logger(`Missing chunks: ${missingChunks.join(",")}`,LOG_LEVEL_VERBOSE);Logger(`Error chunks: ${remoteChunks.rows.filter(e3=>"error"in e3).map(e3=>e3.key).join(",")}`,LOG_LEVEL_VERBOSE);return!1}return remoteChunks.rows.map(e3=>e3.doc)}async tryConnectRemote(setting,showResult=!0){const db=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"==typeof db){Logger($msg("liveSyncReplicator.couldNotConnectTo",{uri:setting.couchDB_URI,name:setting.couchDB_DBNAME,db}),LOG_LEVEL_NOTICE);return!1}Logger(`Connected to ${db.info.db_name} successfully`,LOG_LEVEL_NOTICE);return!0}async resetRemoteTweakSettings(setting){const uri=setting.couchDB_URI+(""==setting.couchDB_DBNAME?"":"/"+setting.couchDB_DBNAME),dbRet=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"!=typeof dbRet)if(await checkRemoteVersion(dbRet.db,this.migrate.bind(this),12))try{const remoteMilestone=await dbRet.db.get(MILESTONE_DOCID);remoteMilestone.tweak_values={};await dbRet.db.put(remoteMilestone);Logger("tweak values on the remote database have been cleared",LOG_LEVEL_VERBOSE)}catch(ex){Logger("Could not retrieve remote milestone",LOG_LEVEL_NOTICE);throw ex}else Logger($msg("liveSyncReplicator.remoteDbCorrupted"),LOG_LEVEL_NOTICE);else Logger($msg("liveSyncReplicator.couldNotConnectToURI",{uri,dbRet}),LOG_LEVEL_NOTICE)}async setPreferredRemoteTweakSettings(setting){const uri=setting.couchDB_URI+(""==setting.couchDB_DBNAME?"":"/"+setting.couchDB_DBNAME),dbRet=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"!=typeof dbRet)if(await checkRemoteVersion(dbRet.db,this.migrate.bind(this),12))try{const remoteMilestone=await dbRet.db.get(MILESTONE_DOCID);remoteMilestone.tweak_values[DEVICE_ID_PREFERRED]=extractObject(TweakValuesTemplate,{...setting});await dbRet.db.put(remoteMilestone);Logger("Preferred tweak values has been registered",LOG_LEVEL_VERBOSE)}catch(ex){Logger("Could not retrieve remote milestone",LOG_LEVEL_NOTICE);throw ex}else Logger($msg("liveSyncReplicator.remoteDbCorrupted"),LOG_LEVEL_NOTICE);else Logger($msg("liveSyncReplicator.couldNotConnectToURI",{uri,dbRet}),LOG_LEVEL_NOTICE)}async getRemotePreferredTweakValues(setting){var _a8;const uri=setting.couchDB_URI+(""==setting.couchDB_DBNAME?"":"/"+setting.couchDB_DBNAME),dbRet=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"==typeof dbRet){Logger($msg("liveSyncReplicator.couldNotConnectToURI",{uri,dbRet}),LOG_LEVEL_NOTICE);return!1}if(!await checkRemoteVersion(dbRet.db,this.migrate.bind(this),12)){Logger($msg("liveSyncReplicator.remoteDbCorrupted"),LOG_LEVEL_NOTICE);return!1}try{const remoteMilestone=await dbRet.db.get(MILESTONE_DOCID);if(!remoteMilestone)throw new Error("Remote milestone not found");return(null==(_a8=null==remoteMilestone?void 0:remoteMilestone.tweak_values)?void 0:_a8[DEVICE_ID_PREFERRED])||!1}catch(ex){Logger("Could not retrieve remote milestone",LOG_LEVEL_NOTICE);Logger(ex,LOG_LEVEL_VERBOSE);return!1}}async compactRemote(setting){const uri=setting.couchDB_URI+(""==setting.couchDB_DBNAME?"":"/"+setting.couchDB_DBNAME),dbRet=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"==typeof dbRet){Logger($msg("liveSyncReplicator.couldNotConnectToURI",{uri,dbRet}),LOG_LEVEL_NOTICE);return!1}return(await dbRet.db.compact({interval:1e3})).ok}async getRemoteStatus(setting){var _a8;const dbRet=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"==typeof dbRet){Logger($msg("liveSyncReplicator.couldNotConnectToURI",{uri:setting.couchDB_URI+(""==setting.couchDB_DBNAME?"":"/"+setting.couchDB_DBNAME),dbRet}),LOG_LEVEL_NOTICE);return!1}const info3=await dbRet.db.info();return{...info3,estimatedSize:(null==(_a8=null==info3?void 0:info3.sizes)?void 0:_a8.file)||0}}async countCompromisedChunks(setting=this.currentSettings){const dbRet=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"==typeof dbRet){Logger($msg("liveSyncReplicator.couldNotConnectToURI",{uri:setting.couchDB_URI+(""==setting.couchDB_DBNAME?"":"/"+setting.couchDB_DBNAME),dbRet}),LOG_LEVEL_NOTICE);return!1}return await countCompromisedChunks(dbRet.db)}async getConnectedDeviceList(setting=this.currentSettings){const dbRet=await this.connectRemoteCouchDBWithSetting(setting,this.isMobile(),!0);if("string"==typeof dbRet){Logger($msg("liveSyncReplicator.couldNotConnectToURI",{uri:setting.couchDB_URI+(""==setting.couchDB_DBNAME?"":"/"+setting.couchDB_DBNAME),dbRet}),LOG_LEVEL_NOTICE);return!1}const milestoneDoc=await dbRet.db.get(MILESTONE_DOCID);if(!milestoneDoc){Logger("Could not retrieve remote milestone",LOG_LEVEL_NOTICE);return!1}return{node_info:milestoneDoc.node_info,accepted_nodes:milestoneDoc.accepted_nodes||[]}}};OnDialogSettingsDefault={configPassphrase:"",preset:"",syncMode:"ONEVENTS",dummy:0,deviceAndVaultName:""};SettingInformation={liveSync:{name:"Sync Mode"},couchDB_URI:{name:"Server URI",placeHolder:"https://........"},couchDB_USER:{name:"Username",desc:"username"},couchDB_PASSWORD:{name:"Password",desc:"password",isHidden:!0},couchDB_DBNAME:{name:"Database Name"},passphrase:{name:"Passphrase",desc:"Encryption passphrase. If changed, you should overwrite the server's database with the new (encrypted) files.",isHidden:!0},showStatusOnEditor:{name:"Show status inside the editor",desc:"Requires restart of Obsidian."},showOnlyIconsOnEditor:{name:"Show status as icons only"},showStatusOnStatusbar:{name:"Show status on the status bar",desc:"Requires restart of Obsidian."},lessInformationInLog:{name:"Show only notifications",desc:"Disables logging, only shows notifications. Please disable if you report an issue."},showVerboseLog:{name:"Verbose Log",desc:"Show verbose log. Please enable if you report an issue."},hashCacheMaxCount:{name:"Memory cache size (by total items)"},hashCacheMaxAmount:{name:"Memory cache size (by total characters)",desc:"(Mega chars)"},writeCredentialsForSettingSync:{name:"Write credentials in the file",desc:"(Not recommended) If set, credentials will be stored in the file."},notifyAllSettingSyncFile:{name:"Notify all setting files"},configPassphrase:{name:"Passphrase of sensitive configuration items",desc:"This passphrase will not be copied to another device. It will be set to `Default` until you configure it again."},configPassphraseStore:{name:"Encrypting sensitive configuration items"},syncOnSave:{name:"Sync on Save",desc:"Starts synchronisation when a file is saved."},syncOnEditorSave:{name:"Sync on Editor Save",desc:"When you save a file in the editor, start a sync automatically"},syncOnFileOpen:{name:"Sync on File Open",desc:"Forces the file to be synced when opened."},syncOnStart:{name:"Sync on Startup",desc:"Automatically Sync all files when opening Obsidian."},syncAfterMerge:{name:"Sync after merging file",desc:"Sync automatically after merging files"},trashInsteadDelete:{name:"Use the trash bin",desc:"Move remotely deleted files to the trash, instead of deleting."},doNotDeleteFolder:{name:"Keep empty folder",desc:"Should we keep folders that don't have any files inside?"},resolveConflictsByNewerFile:{name:"(BETA) Always overwrite with a newer file",desc:"Testing only - Resolve file conflicts by syncing newer copies of the file, this can overwrite modified files. Be Warned."},checkConflictOnlyOnOpen:{name:"Delay conflict resolution of inactive files",desc:"Should we only check for conflicts when a file is opened?"},showMergeDialogOnlyOnActive:{name:"Delay merge conflict prompt for inactive files.",desc:"Should we prompt you about conflicting files when a file is opened?"},disableMarkdownAutoMerge:{name:"Always prompt merge conflicts",desc:"Should we prompt you for every single merge, even if we can safely merge automatcially?"},writeDocumentsIfConflicted:{name:"Apply Latest Change if Conflicting",desc:"Enable this option to automatically apply the most recent change to documents even when it conflicts"},syncInternalFilesInterval:{name:"Scan hidden files periodically",desc:"Seconds, 0 to disable"},batchSave:{name:"Batch database update",desc:"Reducing the frequency with which on-disk changes are reflected into the DB"},readChunksOnline:{name:"Fetch chunks on demand",desc:"(ex. Read chunks online) If this option is enabled, LiveSync reads chunks online directly instead of replicating them locally. Increasing Custom chunk size is recommended."},syncMaxSizeInMB:{name:"Maximum file size",desc:"(MB) If this is set, changes to local and remote files that are larger than this will be skipped. If the file becomes smaller again, a newer one will be used."},useIgnoreFiles:{name:"(Beta) Use ignore files",desc:"If this is set, changes to local files which are matched by the ignore files will be skipped. Remote changes are determined using local ignore files."},ignoreFiles:{name:"Ignore files",desc:"Comma separated `.gitignore, .dockerignore`"},batch_size:{name:"Batch size",desc:"Number of changes to sync at a time. Defaults to 50. Minimum is 2."},batches_limit:{name:"Batch limit",desc:"Number of batches to process at a time. Defaults to 40. Minimum is 2. This along with batch size controls how many docs are kept in memory at a time."},useTimeouts:{name:"Use timeouts instead of heartbeats",desc:"If this option is enabled, PouchDB will hold the connection open for 60 seconds, and if no change arrives in that time, close and reopen the socket, instead of holding it open indefinitely. Useful when a proxy limits request duration but can increase resource usage."},concurrencyOfReadChunksOnline:{name:"Batch size of on-demand fetching"},minimumIntervalOfReadChunksOnline:{name:"The delay for consecutive on-demand fetches"},suspendFileWatching:{name:"Suspend file watching",desc:"Stop watching for file changes."},suspendParseReplicationResult:{name:"Suspend database reflecting",desc:"Stop reflecting database changes to storage files."},writeLogToTheFile:{name:"Write logs into the file",desc:"Warning! This will have a serious impact on performance. And the logs will not be synchronised under the default name. Please be careful with logs; they often contain your confidential information."},deleteMetadataOfDeletedFiles:{name:"Do not keep metadata of deleted files."},useIndexedDBAdapter:{name:"(Obsolete) Use an old adapter for compatibility",desc:"Before v0.17.16, we used an old adapter for the local database. Now the new adapter is preferred. However, it needs local database rebuilding. Please disable this toggle when you have enough time. If leave it enabled, also while fetching from the remote database, you will be asked to disable this.",obsolete:!0},watchInternalFileChanges:{name:"Scan changes on customization sync",desc:"Do not use internal API"},doNotSuspendOnFetching:{name:"Fetch database with previous behaviour"},disableCheckingConfigMismatch:{name:"Do not check configuration mismatch before replication"},usePluginSync:{name:"Enable customization sync"},autoSweepPlugins:{name:"Scan customization automatically",desc:"Scan customization before replicating."},autoSweepPluginsPeriodic:{name:"Scan customization periodically",desc:"Scan customization every 1 minute."},notifyPluginOrSettingUpdated:{name:"Notify customized",desc:"Notify when other device has newly customized."},remoteType:{name:"Active Remote Type",desc:"Remote server type"},endpoint:{name:"Endpoint URL",placeHolder:"https://........"},accessKey:{name:"Access Key"},secretKey:{name:"Secret Key",isHidden:!0},region:{name:"Region",placeHolder:"auto"},bucket:{name:"Bucket Name"},useCustomRequestHandler:{name:"Use Custom HTTP Handler",desc:"Enable this if your Object Storage doesn't support CORS"},maxChunksInEden:{name:"Maximum Incubating Chunks",desc:"The maximum number of chunks that can be incubated within the document. Chunks exceeding this number will immediately graduate to independent chunks."},maxTotalLengthInEden:{name:"Maximum Incubating Chunk Size",desc:"The maximum total size of chunks that can be incubated within the document. Chunks exceeding this size will immediately graduate to independent chunks."},maxAgeInEden:{name:"Maximum Incubation Period",desc:"The maximum duration for which chunks can be incubated within the document. Chunks exceeding this period will graduate to independent chunks."},settingSyncFile:{name:"Filename",desc:"Save settings to a markdown file. You will be notified when new settings arrive. You can set different files by the platform."},preset:{name:"Presets",desc:"Apply preset configuration"},syncMode:{name:"Sync Mode"},periodicReplicationInterval:{name:"Periodic Sync interval",desc:"Interval (sec)"},syncInternalFilesBeforeReplication:{name:"Scan for hidden files before replication"},automaticallyDeleteMetadataOfDeletedFiles:{name:"Delete old metadata of deleted files on start-up",desc:"(Days passed, 0 to disable automatic-deletion)"},additionalSuffixOfDatabaseName:{name:"Database suffix",desc:"LiveSync could not handle multiple vaults which have same name without different prefix, This should be automatically configured."},hashAlg:{name:(null==(_a6=configurationNames.hashAlg)?void 0:_a6.name)||"",desc:"xxhash64 is the current default."},deviceAndVaultName:{name:"Device name",desc:"Unique name between all synchronized devices. To edit this setting, please disable customization sync once."},displayLanguage:{name:"Display Language",desc:'Not all messages have been translated. And, please revert to "Default" when reporting errors.'},enableChunkSplitterV2:{name:"Use splitting-limit-capped chunk splitter",desc:"If enabled, chunks will be split into no more than 100 items. However, dedupe is slightly weaker."},disableWorkerForGeneratingChunks:{name:"Do not split chunks in the background",desc:"If disabled(toggled), chunks will be split on the UI thread (Previous behaviour)."},processSmallFilesInUIThread:{name:"Process small files in the foreground",desc:"If enabled, the file under 1kb will be processed in the UI thread."},batchSaveMinimumDelay:{name:"Minimum delay for batch database updating",desc:"Seconds. Saving to the local database will be delayed until this value after we stop typing or saving."},batchSaveMaximumDelay:{name:"Maximum delay for batch database updating",desc:"Saving will be performed forcefully after this number of seconds."},notifyThresholdOfRemoteStorageSize:{name:"Notify when the estimated remote storage size exceeds on start up",desc:"MB (0 to disable)."},usePluginSyncV2:{name:"Enable per-file customization sync",desc:"If enabled, efficient per-file customization sync will be used. A minor migration is required when enabling this feature, and all devices must be updated to v0.23.18. Enabling this feature will result in losing compatibility with older versions."},handleFilenameCaseSensitive:{name:"Handle files as Case-Sensitive",desc:"If this enabled, All files are handled as case-Sensitive (Previous behaviour)."},doNotUseFixedRevisionForChunks:{name:"Compute revisions for chunks",desc:"If this enabled, all chunks will be stored with the revision made from its content."},sendChunksBulkMaxSize:{name:"Maximum size of chunks to send in one request",desc:"MB"},useAdvancedMode:{name:"Enable advanced features"},usePowerUserMode:{name:"Enable poweruser features"},useEdgeCaseMode:{name:"Enable edge case treatment features"},enableDebugTools:{name:"Enable Developers' Debug Tools.",desc:"While enabled, it causes very performance impact but debugging replication testing and other features will be enabled. Please disable this if you have not read the source code. Requires restart of Obsidian."},suppressNotifyHiddenFilesChange:{name:"Suppress notification of hidden files change",desc:"If enabled, the notification of hidden files change will be suppressed."},syncMinimumInterval:{name:"Minimum interval for syncing",desc:"The minimum interval for automatic synchronisation on event."},useRequestAPI:{name:"Use Request API to avoid `inevitable` CORS problem",desc:"If enabled, the request API will be used to avoid `inevitable` CORS problems. This is a workaround and may not work in all cases. PLEASE READ THE DOCUMENTATION BEFORE USING THIS OPTION. This is a less-secure option."},hideFileWarningNotice:{name:"Show status icon instead of file warnings banner",desc:"If enabled, the ⛔ icon will be shown inside the status instead of the file warnings banner. No details will be shown."},networkWarningStyle:{name:"Network warning style",desc:"How to display network errors when the sync server is unreachable."},bucketPrefix:{name:"File prefix on the bucket",desc:"Effectively a directory. Should end with `/`. e.g., `vault-name/`."},chunkSplitterVersion:{name:"Chunk Splitter",desc:"Now we can choose how to split the chunks; V3 is the most efficient. If you have troubled, please make this Default or Legacy."},processSizeMismatchedFiles:{name:"Process files even if seems to be corrupted",desc:"You can enable this setting to process the files with size mismatches, these files can be created by some APIs or integrations."},forcePathStyle:{name:"Enable forcePathStyle",desc:"If enabled, the forcePathStyle option will be used for bucket operations."},P2P_AutoBroadcast:{name:"Automatically broadcast changes to connected peers",desc:"If enabled, changes will be automatically broadcasted to all connected peers. Notified peers will start fetching the changes."},P2P_AutoStart:{name:"Automatically start P2P connection on launch",desc:"If enabled, the P2P connection will be automatically started when the application launches."},P2P_Enabled:{name:"Enable P2P Synchronization"},maxMTimeForReflectEvents:{name:"Maximum file modification time for reflected file events",desc:"Files with modification times greater than this value (in seconds since the Unix epoch) will not have their events reflected. Set to 0 to disable this limit."}};setLevelClass=(el,level)=>{switch(level){case LEVEL_POWER_USER:el.addClass("sls-setting-poweruser");break;case LEVEL_ADVANCED:el.addClass("sls-setting-advanced");break;case LEVEL_EDGE_CASE:el.addClass("sls-setting-edgecase");break;default:}};LiveSyncSetting=class _LiveSyncSetting extends import_obsidian.Setting{constructor(containerEl){super(containerEl);this.watchDirtyKeys=[];this.holdValue=!1;this.descBuf="";this.nameBuf="";this.placeHolderBuf="";this.hasPassword=!1;this.updateHandlers=new Set;this.prevStatus={};_LiveSyncSetting.env.settingComponents.push(this)}_createDocStub(key3,value){var _a8,_b5,_c3,_d2;{const paneName=findAttrFromParent(this.settingEl,"data-pane"),panelName=findAttrFromParent(this.settingEl,"data-panel");createStub("string"==typeof this.nameBuf?this.nameBuf:null!=(_b5=null==(_a8=this.nameBuf.textContent)?void 0:_a8.toString())?_b5:"",key3,"string"==typeof value?value:null!=(_d2=null==(_c3=value.textContent)?void 0:_c3.toString())?_d2:"",panelName,paneName)}}setDesc(desc){this.descBuf=desc;this._createDocStub("desc",desc);super.setDesc(desc);return this}setName(name){this.nameBuf=name;this._createDocStub("name",name);super.setName(name);return this}setAuto(key3,opt){this.autoWireSetting(key3,opt);return this}autoWireSetting(key3,opt){const conf=getConfig(key3);if(!conf)return;const name=`${conf.name}${statusDisplay(conf.status)}`;this.setName(name);conf.desc&&this.setDesc(conf.desc);this._createDocStub("key",key3);conf.obsolete&&this._createDocStub("is_obsolete","true");conf.level&&this._createDocStub("level",conf.level);this.holdValue=(null==opt?void 0:opt.holdValue)||this.holdValue;this.selfKey=key3;(conf.obsolete||(null==opt?void 0:opt.obsolete))&&this.settingEl.toggleClass("sls-setting-obsolete",!0);(null==opt?void 0:opt.onUpdate)&&this.addOnUpdate(opt.onUpdate);const stat=this._getComputedStatus();!1===stat.visibility&&this.settingEl.toggleClass("sls-setting-hidden",!stat.visibility);return conf}autoWireComponent(component2,conf,opt){this.placeHolderBuf=(null==conf?void 0:conf.placeHolder)||(null==opt?void 0:opt.placeHolder)||"";(null==conf?void 0:conf.level)==LEVEL_ADVANCED?this.settingEl.toggleClass("sls-setting-advanced",!0):(null==conf?void 0:conf.level)==LEVEL_POWER_USER&&this.settingEl.toggleClass("sls-setting-poweruser",!0);this.placeHolderBuf&&component2 instanceof import_obsidian.TextComponent&&component2.setPlaceholder(this.placeHolderBuf);(null==opt?void 0:opt.onUpdate)&&this.addOnUpdate(opt.onUpdate)}async commitValue(value){const key3=this.selfKey;if(void 0!==key3&&value!=_LiveSyncSetting.env.editingSettings[key3]){_LiveSyncSetting.env.editingSettings[key3]=value;this.holdValue||await _LiveSyncSetting.env.saveSettings([key3])}_LiveSyncSetting.env.requestUpdate()}autoWireText(key3,opt){const conf=this.autoWireSetting(key3,opt);this.addText(text2=>{this.autoWiredComponent=text2;const setValue=wrapMemo(value=>{text2.setValue(value)});this.invalidateValue=()=>setValue(`${_LiveSyncSetting.env.editingSettings[key3]}`);this.invalidateValue();text2.onChange(async value=>{await this.commitValue(value)});if(null==opt?void 0:opt.isPassword){text2.inputEl.setAttribute("type","password");this.hasPassword=!0}this.autoWireComponent(this.autoWiredComponent,conf,opt)});return this}autoWireTextArea(key3,opt){const conf=this.autoWireSetting(key3,opt);this.addTextArea(text2=>{this.autoWiredComponent=text2;const setValue=wrapMemo(value=>{text2.setValue(value)});this.invalidateValue=()=>setValue(`${_LiveSyncSetting.env.editingSettings[key3]}`);this.invalidateValue();text2.onChange(async value=>{await this.commitValue(value)});if(null==opt?void 0:opt.isPassword){text2.inputEl.setAttribute("type","password");this.hasPassword=!0}this.autoWireComponent(this.autoWiredComponent,conf,opt)});return this}autoWireNumeric(key3,opt){const conf=this.autoWireSetting(key3,opt);this.addText(text2=>{this.autoWiredComponent=text2;void 0!==opt.clampMin&&text2.inputEl.setAttribute("min",`${opt.clampMin}`);void 0!==opt.clampMax&&text2.inputEl.setAttribute("max",`${opt.clampMax}`);let lastError=!1;const setValue=wrapMemo(value=>{text2.setValue(value)});this.invalidateValue=()=>{lastError||setValue(`${_LiveSyncSetting.env.editingSettings[key3]}`)};this.invalidateValue();text2.onChange(async TextValue=>{var _a8,_b5;const value=Number(TextValue);let hasError=!1;isNaN(value)&&(hasError=!0);void 0!==opt.clampMax&&opt.clampMaxvalue&&(opt.acceptZero&&0==value||(hasError=!0));if(hasError){this.setTooltip($msg("liveSyncSetting.valueShouldBeInRange",{min:(null==(_a8=opt.clampMin)?void 0:_a8.toString())||"~",max:(null==(_b5=opt.clampMax)?void 0:_b5.toString())||"~"}));text2.inputEl.toggleClass("sls-item-invalid-value",!0);lastError=!0;return!1}lastError=!1;this.setTooltip("");text2.inputEl.toggleClass("sls-item-invalid-value",!1);await this.commitValue(value)});text2.inputEl.setAttr("type","number");this.autoWireComponent(this.autoWiredComponent,conf,opt)});return this}autoWireToggle(key3,opt){const conf=this.autoWireSetting(key3,opt);this.addToggle(toggle=>{this.autoWiredComponent=toggle;const setValue=wrapMemo(value=>{toggle.setValue((null==opt?void 0:opt.invert)?!value:value)});this.invalidateValue=()=>{var _a8;return setValue(null!=(_a8=_LiveSyncSetting.env.editingSettings[key3])&&_a8)};this.invalidateValue();toggle.onChange(async value=>{await this.commitValue((null==opt?void 0:opt.invert)?!value:value)});this.autoWireComponent(this.autoWiredComponent,conf,opt)});return this}autoWireDropDown(key3,opt){const conf=this.autoWireSetting(key3,opt);this.addDropdown(dropdown=>{this.autoWiredComponent=dropdown;const setValue=wrapMemo(value=>{dropdown.setValue(value)});dropdown.addOptions(opt.options);this.invalidateValue=()=>setValue(_LiveSyncSetting.env.editingSettings[key3]||"");this.invalidateValue();dropdown.onChange(async value=>{await this.commitValue(value)});this.autoWireComponent(this.autoWiredComponent,conf,opt)});return this}addApplyButton(keys3,text2){this.addButton(button=>{this.applyButtonComponent=button;this.watchDirtyKeys=unique([...keys3,...this.watchDirtyKeys]);button.setButtonText(null!=text2?text2:$msg("liveSyncSettings.btnApply"));button.onClick(async()=>{await _LiveSyncSetting.env.saveSettings(keys3);_LiveSyncSetting.env.reloadAllSettings()});_LiveSyncSetting.env.requestUpdate()});return this}addOnUpdate(func){this.updateHandlers.add(func);return this}_getComputedStatus(){let newConf={};for(const handler of this.updateHandlers)newConf={...newConf,...handler()};return newConf}_applyOnUpdateHandlers(){if(this.updateHandlers.size>0){const newConf=this._getComputedStatus(),keys3=Object.keys(newConf);for(const k2 of keys3)if(!(k2 in this.prevStatus)||this.prevStatus[k2]!=newConf[k2])switch(k2){case"visibility":this.settingEl.toggleClass("sls-setting-hidden",!newConf[k2]);this.prevStatus[k2]=newConf[k2];break;case"classes":break;case"disabled":this.setDisabled(newConf[k2]||!1);this.settingEl.toggleClass("sls-setting-disabled",newConf[k2]||!1);this.prevStatus[k2]=newConf[k2];break;case"isCta":{const component2=this.autoWiredComponent;component2 instanceof import_obsidian.ButtonComponent&&(newConf[k2]?component2.setCta():component2.removeCta());this.prevStatus[k2]=newConf[k2]}break;case"isWarning":{const component2=this.autoWiredComponent;component2 instanceof import_obsidian.ButtonComponent&&newConf[k2]&&component2.setWarning();this.prevStatus[k2]=newConf[k2]}break}}}_onUpdate(){var _a8,_b5;if(this.applyButtonComponent){const isDirty2=_LiveSyncSetting.env.isSomeDirty(this.watchDirtyKeys);this.applyButtonComponent.setDisabled(!isDirty2);isDirty2?this.applyButtonComponent.setCta():this.applyButtonComponent.removeCta()}this.selfKey&&!_LiveSyncSetting.env.isDirty(this.selfKey)&&this.invalidateValue&&this.invalidateValue();if(this.holdValue&&this.selfKey){const isDirty2=_LiveSyncSetting.env.isDirty(this.selfKey),alt=isDirty2?$msg("liveSyncSetting.originalValue",{value:String(null!=(_b5=null==(_a8=_LiveSyncSetting.env.initialSettings)?void 0:_a8[this.selfKey])?_b5:"")}):"";this.controlEl.toggleClass("sls-item-dirty",isDirty2);if(!this.hasPassword){this.nameEl.toggleClass("sls-item-dirty-help",isDirty2);this.setTooltip(alt,{delay:10,placement:"right"})}}this._applyOnUpdateHandlers()}};AutoClosableModal=class extends import_obsidian.Modal{_closeByUnload(){eventHub.off("plugin-unloaded",this._closeByUnload);this.close()}constructor(app){super(app);this._closeByUnload=this._closeByUnload.bind(this);eventHub.once("plugin-unloaded",this._closeByUnload)}onClose(){eventHub.off("plugin-unloaded",this._closeByUnload)}};InputStringDialog=class extends AutoClosableModal{constructor(app,title,key3,placeholder,isPassword,onSubmit){super(app);this.result=!1;this.isManuallyClosed=!1;this.isPassword=!1;this.onSubmit=onSubmit;this.title=title;this.placeholder=placeholder;this.key=key3;this.isPassword=isPassword}onOpen(){const{contentEl}=this;this.titleEl.setText(this.title);const formEl=contentEl.createDiv();new import_obsidian.Setting(formEl).setName(this.key).setClass(this.isPassword?"password-input":"normal-input").addText(text2=>text2.onChange(value=>{this.result=value}));new import_obsidian.Setting(formEl).addButton(btn=>btn.setButtonText("Ok").setCta().onClick(()=>{this.isManuallyClosed=!0;this.close()})).addButton(btn=>btn.setButtonText("Cancel").setCta().onClick(()=>{this.close()}))}onClose(){super.onClose();const{contentEl}=this;contentEl.empty();this.isManuallyClosed?this.onSubmit(this.result):this.onSubmit(!1)}};PopoverSelectString=class extends import_obsidian.FuzzySuggestModal{constructor(app,note,placeholder,getItemsFun,callback){super(app);this.callback=()=>{};this.getItemsFun=()=>["yes","no"];this._app=app;this.setPlaceholder((null!=placeholder?placeholder:"y/n) ")+note);getItemsFun&&(this.getItemsFun=getItemsFun);this.callback=callback}getItems(){return this.getItemsFun()}getItemText(item){return item}onChooseItem(item,evt){var _a8;null==(_a8=this.callback)||_a8.call(this,item);this.callback=void 0}onClose(){setTimeout(()=>{if(this.callback){this.callback("");this.callback=void 0}},100)}};MessageBox=class extends AutoClosableModal{constructor(plugin3,title,contentMd,buttons,defaultAction,timeout,wideButton,onSubmit){super(plugin3.app);this.result=!1;this.isManuallyClosed=!1;this.timer=void 0;this.plugin=plugin3;this.title=title;this.contentMd=contentMd;this.buttons=buttons;this.onSubmit=onSubmit;this.defaultAction=defaultAction;this.timeout=timeout;this.wideButton=wideButton;this.timeout&&(this.timer=setInterval(()=>{var _a8,_b5;if(void 0!==this.timeout){this.timeout--;if(this.timeout<0){if(this.timer){clearInterval(this.timer);null==(_a8=this.defaultButtonComponent)||_a8.setButtonText(`${defaultAction}`);this.timer=void 0}this.result=defaultAction;this.isManuallyClosed=!0;this.close()}else null==(_b5=this.defaultButtonComponent)||_b5.setButtonText(`( ${this.timeout} ) ${defaultAction}`)}},1e3))}onOpen(){const{contentEl}=this;this.titleEl.setText(this.title);const div=contentEl.createDiv();div.style.userSelect="text";div.style.webkitUserSelect="text";import_obsidian.MarkdownRenderer.render(this.plugin.app,this.contentMd,div,"/",this.plugin);const buttonSetting=new import_obsidian.Setting(contentEl),labelWrapper=contentEl.createDiv();labelWrapper.addClass("sls-dialogue-note-wrapper");labelWrapper.createEl("label",{text:"To stop the countdown, tap anywhere on the dialogue"}).addClass("sls-dialogue-note-countdown");if(!this.timeout||!this.timer){labelWrapper.empty();labelWrapper.style.display="none"}buttonSetting.infoEl.style.display="none";buttonSetting.controlEl.style.flexWrap="wrap";if(this.wideButton){buttonSetting.controlEl.style.flexDirection="column";buttonSetting.controlEl.style.alignItems="center";buttonSetting.controlEl.style.justifyContent="center";buttonSetting.controlEl.style.flexGrow="1"}contentEl.addEventListener("click",()=>{var _a8;if(this.timer){labelWrapper.empty();labelWrapper.style.display="none";clearInterval(this.timer);this.timer=void 0;null==(_a8=this.defaultButtonComponent)||_a8.setButtonText(`${this.defaultAction}`)}});for(const button of this.buttons)buttonSetting.addButton(btn=>{btn.setButtonText(button).onClick(()=>{this.isManuallyClosed=!0;this.result=button;if(this.timer){clearInterval(this.timer);this.timer=void 0}this.close()});if(button==this.defaultAction){this.defaultButtonComponent=btn;btn.setCta()}if(this.wideButton){btn.buttonEl.style.flexGrow="1";btn.buttonEl.style.width="100%"}return btn})}onClose(){super.onClose();const{contentEl}=this;contentEl.empty();if(this.timer){clearInterval(this.timer);this.timer=void 0}this.isManuallyClosed?this.onSubmit(this.result):this.onSubmit(!1)}};askYesNo=(app,message)=>new Promise(res2=>{new PopoverSelectString(app,message,void 0,void 0,result=>res2(result)).open()});askSelectString=(app,message,items)=>{const getItemsFun=()=>items;return new Promise(res2=>{new PopoverSelectString(app,message,"",getItemsFun,result=>res2(result)).open()})};askString=(app,title,key3,placeholder,isPassword=!1)=>new Promise(res2=>{new InputStringDialog(app,title,key3,placeholder,isPassword,result=>res2(result)).open()});getHttpHandlerExtensionConfiguration=runtimeConfig=>({setHttpHandler(handler){runtimeConfig.httpHandler=handler},httpHandler:()=>runtimeConfig.httpHandler,updateHttpClientConfig(key3,value){var _a8;null==(_a8=runtimeConfig.httpHandler)||_a8.updateHttpClientConfig(key3,value)},httpHandlerConfigs:()=>runtimeConfig.httpHandler.httpHandlerConfigs()});resolveHttpHandlerRuntimeConfig=httpHandlerExtensionConfiguration=>({httpHandler:httpHandlerExtensionConfiguration.httpHandler()});(function(EndpointURLScheme2){EndpointURLScheme2.HTTP="http";EndpointURLScheme2.HTTPS="https"})(EndpointURLScheme||(EndpointURLScheme={}));(function(AlgorithmId2){AlgorithmId2.MD5="md5";AlgorithmId2.CRC32="crc32";AlgorithmId2.CRC32C="crc32c";AlgorithmId2.SHA1="sha1";AlgorithmId2.SHA256="sha256"})(AlgorithmId||(AlgorithmId={}));SMITHY_CONTEXT_KEY="__smithy_context";HttpRequest=class _HttpRequest{constructor(options){__publicField(this,"method");__publicField(this,"protocol");__publicField(this,"hostname");__publicField(this,"port");__publicField(this,"path");__publicField(this,"query");__publicField(this,"headers");__publicField(this,"username");__publicField(this,"password");__publicField(this,"fragment");__publicField(this,"body");this.method=options.method||"GET";this.hostname=options.hostname||"localhost";this.port=options.port;this.query=options.query||{};this.headers=options.headers||{};this.body=options.body;this.protocol=options.protocol?":"!==options.protocol.slice(-1)?`${options.protocol}:`:options.protocol:"https:";this.path=options.path?"/"!==options.path.charAt(0)?`/${options.path}`:options.path:"/";this.username=options.username;this.password=options.password;this.fragment=options.fragment}static clone(request2){const cloned=new _HttpRequest({...request2,headers:{...request2.headers}});cloned.query&&(cloned.query=cloneQuery(cloned.query));return cloned}static isInstance(request2){if(!request2)return!1;const req=request2;return"method"in req&&"protocol"in req&&"hostname"in req&&"path"in req&&"object"==typeof req.query&&"object"==typeof req.headers}clone(){return _HttpRequest.clone(this)}};HttpResponse=class{constructor(options){__publicField(this,"statusCode");__publicField(this,"reason");__publicField(this,"headers");__publicField(this,"body");this.statusCode=options.statusCode;this.reason=options.reason;this.headers=options.headers||{};this.body=options.body}static isInstance(response){if(!response)return!1;const resp=response;return"number"==typeof resp.statusCode&&"object"==typeof resp.headers}};addExpectContinueMiddlewareOptions={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0};getAddExpectContinuePlugin=options=>({applyToStack:clientStack=>{clientStack.add(addExpectContinueMiddleware(options),addExpectContinueMiddlewareOptions)}});(function(ChecksumAlgorithm2){ChecksumAlgorithm2.MD5="MD5";ChecksumAlgorithm2.CRC32="CRC32";ChecksumAlgorithm2.CRC32C="CRC32C";ChecksumAlgorithm2.CRC64NVME="CRC64NVME";ChecksumAlgorithm2.SHA1="SHA1";ChecksumAlgorithm2.SHA256="SHA256"})(ChecksumAlgorithm||(ChecksumAlgorithm={}));(function(ChecksumLocation2){ChecksumLocation2.HEADER="header";ChecksumLocation2.TRAILER="trailer"})(ChecksumLocation||(ChecksumLocation={}));DEFAULT_CHECKSUM_ALGORITHM=ChecksumAlgorithm.CRC32;getDateHeader=response=>{var _a8,_b5,_c3;return HttpResponse.isInstance(response)?null!=(_c3=null==(_a8=response.headers)?void 0:_a8.date)?_c3:null==(_b5=response.headers)?void 0:_b5.Date:void 0};getSkewCorrectedDate=systemClockOffset=>new Date(Date.now()+systemClockOffset);isClockSkewed=(clockTime,systemClockOffset)=>Math.abs(getSkewCorrectedDate(systemClockOffset).getTime()-clockTime)>=3e5;getUpdatedSystemClockOffset=(clockTime,currentSystemClockOffset)=>{const clockTimeInMs=Date.parse(clockTime);return isClockSkewed(clockTimeInMs,currentSystemClockOffset)?clockTimeInMs-Date.now():currentSystemClockOffset};throwSigningPropertyError=(name,property)=>{if(!property)throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);return property};validateSigningProperties=async signingProperties=>{var _a8,_b5,_c3;const context2=throwSigningPropertyError("context",signingProperties.context),config=throwSigningPropertyError("config",signingProperties.config),authScheme=null==(_c3=null==(_b5=null==(_a8=context2.endpointV2)?void 0:_a8.properties)?void 0:_b5.authSchemes)?void 0:_c3[0],signerFunction=throwSigningPropertyError("signer",config.signer);return{config,signer:await signerFunction(authScheme),signingRegion:null==signingProperties?void 0:signingProperties.signingRegion,signingRegionSet:null==signingProperties?void 0:signingProperties.signingRegionSet,signingName:null==signingProperties?void 0:signingProperties.signingName}};AwsSdkSigV4Signer=class{async sign(httpRequest,identity,signingProperties){var _a8,_b5,_c3,_d2;if(!HttpRequest.isInstance(httpRequest))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const validatedProps=await validateSigningProperties(signingProperties),{config,signer}=validatedProps;let{signingRegion,signingName}=validatedProps;const handlerExecutionContext=signingProperties.context;if(null!=(_b5=null==(_a8=null==handlerExecutionContext?void 0:handlerExecutionContext.authSchemes)?void 0:_a8.length)&&_b5){const[first,second]=handlerExecutionContext.authSchemes;if("sigv4a"===(null==first?void 0:first.name)&&"sigv4"===(null==second?void 0:second.name)){signingRegion=null!=(_c3=null==second?void 0:second.signingRegion)?_c3:signingRegion;signingName=null!=(_d2=null==second?void 0:second.signingName)?_d2:signingName}}return await signer.sign(httpRequest,{signingDate:getSkewCorrectedDate(config.systemClockOffset),signingRegion,signingService:signingName})}errorHandler(signingProperties){return error=>{var _a8;const serverTime=null!=(_a8=error.ServerTime)?_a8:getDateHeader(error.$response);if(serverTime){const config=throwSigningPropertyError("config",signingProperties.config),initialSystemClockOffset=config.systemClockOffset;config.systemClockOffset=getUpdatedSystemClockOffset(serverTime,config.systemClockOffset);config.systemClockOffset!==initialSystemClockOffset&&error.$metadata&&(error.$metadata.clockSkewCorrected=!0)}throw error}}successHandler(httpResponse,signingProperties){const dateHeader=getDateHeader(httpResponse);if(dateHeader){const config=throwSigningPropertyError("config",signingProperties.config);config.systemClockOffset=getUpdatedSystemClockOffset(dateHeader,config.systemClockOffset)}}};AwsSdkSigV4ASigner=class extends AwsSdkSigV4Signer{async sign(httpRequest,identity,signingProperties){var _a8,_b5;if(!HttpRequest.isInstance(httpRequest))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config,signer,signingRegion,signingRegionSet,signingName}=await validateSigningProperties(signingProperties),configResolvedSigningRegionSet=await(null==(_a8=config.sigv4aSigningRegionSet)?void 0:_a8.call(config)),multiRegionOverride=(null!=(_b5=null!=configResolvedSigningRegionSet?configResolvedSigningRegionSet:signingRegionSet)?_b5:[signingRegion]).join(",");return await signer.sign(httpRequest,{signingDate:getSkewCorrectedDate(config.systemClockOffset),signingRegion:multiRegionOverride,signingService:signingName})}};getSmithyContext=context2=>context2.__smithy_context||(context2.__smithy_context={});normalizeProvider=input=>{if("function"==typeof input)return input;const promisified=Promise.resolve(input);return()=>promisified};resolveAuthOptions=(candidateAuthOptions,authSchemePreference)=>{if(!authSchemePreference||0===authSchemePreference.length)return candidateAuthOptions;const preferredAuthOptions=[];for(const preferredSchemeName of authSchemePreference)for(const candidateAuthOption of candidateAuthOptions)candidateAuthOption.schemeId.split("#")[1]===preferredSchemeName&&preferredAuthOptions.push(candidateAuthOption);for(const candidateAuthOption of candidateAuthOptions)preferredAuthOptions.find(({schemeId})=>schemeId===candidateAuthOption.schemeId)||preferredAuthOptions.push(candidateAuthOption);return preferredAuthOptions};httpAuthSchemeMiddleware=(config,mwOptions)=>(next2,context2)=>async args=>{var _a8;const options=config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config,context2,args.input)),authSchemePreference=config.authSchemePreference?await config.authSchemePreference():[],resolvedOptions=resolveAuthOptions(options,authSchemePreference),authSchemes=convertHttpAuthSchemesToMap(config.httpAuthSchemes),smithyContext=getSmithyContext(context2),failureReasons=[];for(const option of resolvedOptions){const scheme=authSchemes.get(option.schemeId);if(!scheme){failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);continue}const identityProvider=scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));if(!identityProvider){failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties={},signingProperties={}}=(null==(_a8=option.propertiesExtractor)?void 0:_a8.call(option,config,context2))||{};option.identityProperties=Object.assign(option.identityProperties||{},identityProperties);option.signingProperties=Object.assign(option.signingProperties||{},signingProperties);smithyContext.selectedHttpAuthScheme={httpAuthOption:option,identity:await identityProvider(option.identityProperties),signer:scheme.signer};break}if(!smithyContext.selectedHttpAuthScheme)throw new Error(failureReasons.join("\n"));return next2(args)};httpAuthSchemeEndpointRuleSetMiddlewareOptions={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};getHttpAuthSchemeEndpointRuleSetPlugin=(config,{httpAuthSchemeParametersProvider,identityProviderConfigProvider})=>({applyToStack:clientStack=>{clientStack.addRelativeTo(httpAuthSchemeMiddleware(config,{httpAuthSchemeParametersProvider,identityProviderConfigProvider}),httpAuthSchemeEndpointRuleSetMiddlewareOptions)}});defaultErrorHandler=signingProperties=>error=>{throw error};defaultSuccessHandler=(httpResponse,signingProperties)=>{};httpSigningMiddleware=config=>(next2,context2)=>async args=>{if(!HttpRequest.isInstance(args.request))return next2(args);const scheme=getSmithyContext(context2).selectedHttpAuthScheme;if(!scheme)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties={}},identity,signer}=scheme,output=await next2({...args,request:await signer.sign(args.request,identity,signingProperties)}).catch((signer.errorHandler||defaultErrorHandler)(signingProperties));(signer.successHandler||defaultSuccessHandler)(output.response,signingProperties);return output};httpSigningMiddlewareOptions={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"};getHttpSigningPlugin=config=>({applyToStack:clientStack=>{clientStack.addRelativeTo(httpSigningMiddleware(),httpSigningMiddlewareOptions)}});normalizeProvider2=input=>{if("function"==typeof input)return input;const promisified=Promise.resolve(input);return()=>promisified};makePagedClientRequest=async(CommandCtor,client,input,withCommand=_=>_,...args)=>{var _a8;let command=new CommandCtor(input);command=null!=(_a8=withCommand(command))?_a8:command;return await client.send(command,...args)};get3=(fromObject,path2)=>{let cursor=fromObject;const pathComponents=path2.split(".");for(const step of pathComponents){if(!cursor||"object"!=typeof cursor)return;cursor=cursor[step]}return cursor};chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";alphabetByEncoding=Object.entries(chars).reduce((acc,[i2,c3])=>{acc[c3]=Number(i2);return acc},{});alphabetByValue=chars.split("");bitsPerLetter=6;bitsPerByte=8;maxLetterValue=63;fromBase64=input=>{let totalByteLength=input.length/4*3;"=="===input.slice(-2)?totalByteLength-=2:"="===input.slice(-1)&&totalByteLength--;const out=new ArrayBuffer(totalByteLength),dataView=new DataView(out);for(let i2=0;i2>=bitsPerLetter;const chunkOffset=i2/4*3;bits2>>=bitLength%bitsPerByte;const byteLength=Math.floor(bitLength/bitsPerByte);for(let k2=0;k2>offset)}}return new Uint8Array(out)};init_dist_es();init_dist_es();Uint8ArrayBlobAdapter=class _Uint8ArrayBlobAdapter extends Uint8Array{static fromString(source2,encoding="utf-8"){if("string"==typeof source2)return"base64"===encoding?_Uint8ArrayBlobAdapter.mutate(fromBase64(source2)):_Uint8ArrayBlobAdapter.mutate(fromUtf8(source2));throw new Error(`Unsupported conversion from ${typeof source2} to Uint8ArrayBlobAdapter.`)}static mutate(source2){Object.setPrototypeOf(source2,_Uint8ArrayBlobAdapter.prototype);return source2}transformToString(encoding="utf-8"){return"base64"===encoding?toBase64(this):toUtf8(this)}};ReadableStreamRef="function"==typeof ReadableStream?ReadableStream:function(){};ChecksumStream=class extends ReadableStreamRef{};isReadableStream=stream=>{var _a8;return"function"==typeof ReadableStream&&((null==(_a8=null==stream?void 0:stream.constructor)?void 0:_a8.name)===ReadableStream.name||stream instanceof ReadableStream)};createChecksumStream=({expectedChecksum,checksum,source:source2,checksumSourceLocation,base64Encoder})=>{var _a8,_b5;if(!isReadableStream(source2))throw new Error(`@smithy/util-stream: unsupported source type ${null!=(_b5=null==(_a8=null==source2?void 0:source2.constructor)?void 0:_a8.name)?_b5:source2} in ChecksumStream.`);const encoder2=null!=base64Encoder?base64Encoder:toBase64;if("function"!=typeof TransformStream)throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");const transform2=new TransformStream({start(){},async transform(chunk,controller){checksum.update(chunk);controller.enqueue(chunk)},async flush(controller){const digest=await checksum.digest(),received=encoder2(digest);if(expectedChecksum!==received){const error=new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`);controller.error(error)}else controller.terminate()}});source2.pipeThrough(transform2);const readable2=transform2.readable;Object.setPrototypeOf(readable2,ChecksumStream.prototype);return readable2};ByteArrayCollector=class{constructor(allocByteArray){__publicField(this,"allocByteArray");__publicField(this,"byteLength",0);__publicField(this,"byteArrays",[]);this.allocByteArray=allocByteArray}push(byteArray){this.byteArrays.push(byteArray);this.byteLength+=byteArray.byteLength}flush(){if(1===this.byteArrays.length){const bytes=this.byteArrays[0];this.reset();return bytes}const aggregation=this.allocByteArray(this.byteLength);let cursor=0;for(let i2=0;i2new Uint8Array(size2))];let mode=-1;const pull=async controller=>{const{value,done}=await reader.read(),chunk=value;if(done){if(-1!==mode){const remainder=flush(buffers,mode);sizeOf(remainder)>0&&controller.enqueue(remainder)}controller.close()}else{const chunkMode=modeOf(chunk,!1);if(mode!==chunkMode){mode>=0&&controller.enqueue(flush(buffers,mode));mode=chunkMode}if(-1===mode){controller.enqueue(chunk);return}const chunkSize2=sizeOf(chunk);bytesSeen+=chunkSize2;const bufferSize=sizeOf(buffers[mode]);if(chunkSize2>=size&&0===bufferSize)controller.enqueue(chunk);else{const newSize=merge(buffers,mode,chunk);if(!streamBufferingLoggedWarning&&bytesSeen>2*size){streamBufferingLoggedWarning=!0;null==logger2||logger2.warn(`@smithy/util-stream - stream chunk size ${chunkSize2} is below threshold of ${size}, automatically buffering.`)}newSize>=size?controller.enqueue(flush(buffers,mode)):await pull(controller)}}};return new ReadableStream({pull})};getAwsChunkedEncodingStream=(readableStream,options)=>{const{base64Encoder,bodyLengthChecker,checksumAlgorithmFn,checksumLocationName,streamHasher}=options,checksumRequired=void 0!==base64Encoder&&void 0!==bodyLengthChecker&&void 0!==checksumAlgorithmFn&&void 0!==checksumLocationName&&void 0!==streamHasher,digest=checksumRequired?streamHasher(checksumAlgorithmFn,readableStream):void 0,reader=readableStream.getReader();return new ReadableStream({async pull(controller){const{value,done}=await reader.read();if(done){controller.enqueue("0\r\n");if(checksumRequired){const checksum=base64Encoder(await digest);controller.enqueue(`${checksumLocationName}:${checksum}\r\n`);controller.enqueue("\r\n")}controller.close()}else controller.enqueue(`${(bodyLengthChecker(value)||0).toString(16)}\r\n${value}\r\n`)}})};escapeUri=uri=>encodeURIComponent(uri).replace(/[!'()*]/g,hexEncode);hexEncode=c3=>`%${c3.charCodeAt(0).toString(16).toUpperCase()}`;keepAliveSupport={supported:void 0};FetchHttpHandler=class _FetchHttpHandler{constructor(options){__publicField(this,"config");__publicField(this,"configProvider");if("function"==typeof options)this.configProvider=options().then(opts=>opts||{});else{this.config=null!=options?options:{};this.configProvider=Promise.resolve(this.config)}void 0===keepAliveSupport.supported&&(keepAliveSupport.supported=Boolean("undefined"!=typeof Request&&"keepalive"in createRequest("https://[::1]")))}static create(instanceOrOptions){return"function"==typeof(null==instanceOrOptions?void 0:instanceOrOptions.handle)?instanceOrOptions:new _FetchHttpHandler(instanceOrOptions)}destroy(){}async handle(request2,{abortSignal,requestTimeout:requestTimeout2}={}){var _a8,_b5,_c3;this.config||(this.config=await this.configProvider);const requestTimeoutInMs=null!=requestTimeout2?requestTimeout2:this.config.requestTimeout,keepAlive=!0===this.config.keepAlive,credentials=this.config.credentials;if(null==abortSignal?void 0:abortSignal.aborted){const abortError=buildAbortError(abortSignal);return Promise.reject(abortError)}let path2=request2.path;const queryString=buildQueryString(request2.query||{});queryString&&(path2+=`?${queryString}`);request2.fragment&&(path2+=`#${request2.fragment}`);let auth="";null==request2.username&&null==request2.password||(auth=`${null!=(_a8=request2.username)?_a8:""}:${null!=(_b5=request2.password)?_b5:""}@`);const{port,method}=request2,url=`${request2.protocol}//${auth}${request2.hostname}${port?`:${port}`:""}${path2}`,body="GET"===method||"HEAD"===method?void 0:request2.body,requestOptions={body,headers:new Headers(request2.headers),method,credentials};(null==(_c3=this.config)?void 0:_c3.cache)&&(requestOptions.cache=this.config.cache);body&&(requestOptions.duplex="half");"undefined"!=typeof AbortController&&(requestOptions.signal=abortSignal);keepAliveSupport.supported&&(requestOptions.keepalive=keepAlive);"function"==typeof this.config.requestInit&&Object.assign(requestOptions,this.config.requestInit(request2));let removeSignalEventListener=()=>{};const fetchRequest=createRequest(url,requestOptions),raceOfPromises=[fetch(fetchRequest).then(response=>{const fetchHeaders=response.headers,transformedHeaders={};for(const pair of fetchHeaders.entries())transformedHeaders[pair[0]]=pair[1];return null!=response.body?{response:new HttpResponse({headers:transformedHeaders,reason:response.statusText,statusCode:response.status,body:response.body})}:response.blob().then(body2=>({response:new HttpResponse({headers:transformedHeaders,reason:response.statusText,statusCode:response.status,body:body2})}))}),requestTimeout(requestTimeoutInMs)];abortSignal&&raceOfPromises.push(new Promise((resolve,reject)=>{const onAbort=()=>{const abortError=buildAbortError(abortSignal);reject(abortError)};if("function"==typeof abortSignal.addEventListener){const signal=abortSignal;signal.addEventListener("abort",onAbort,{once:!0});removeSignalEventListener=()=>signal.removeEventListener("abort",onAbort)}else abortSignal.onabort=onAbort}));return Promise.race(raceOfPromises).finally(removeSignalEventListener)}updateHttpClientConfig(key3,value){this.config=void 0;this.configProvider=this.configProvider.then(config=>{config[key3]=value;return config})}httpHandlerConfigs(){var _a8;return null!=(_a8=this.config)?_a8:{}}};streamCollector=async stream=>{var _a8;return"function"==typeof Blob&&stream instanceof Blob||"Blob"===(null==(_a8=stream.constructor)?void 0:_a8.name)?void 0!==Blob.prototype.arrayBuffer?new Uint8Array(await stream.arrayBuffer()):collectBlob(stream):collectStream(stream)};SHORT_TO_HEX={};HEX_TO_SHORT={};for(let i2=0;i2<256;i2++){let encodedByte=i2.toString(16).toLowerCase();1===encodedByte.length&&(encodedByte=`0${encodedByte}`);SHORT_TO_HEX[i2]=encodedByte;HEX_TO_SHORT[encodedByte]=i2}init_dist_es();sdkStreamMixin=stream=>{var _a8,_b5;if(!isBlobInstance(stream)&&!isReadableStream(stream)){const name=(null==(_b5=null==(_a8=null==stream?void 0:stream.__proto__)?void 0:_a8.constructor)?void 0:_b5.name)||stream;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`)}let transformed=!1;const transformToByteArray=async()=>{if(transformed)throw new Error("The stream has already been transformed.");transformed=!0;return await streamCollector(stream)},blobToWebStream=blob=>{if("function"!=typeof blob.stream)throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return blob.stream()};return Object.assign(stream,{transformToByteArray,transformToString:async encoding=>{const buf=await transformToByteArray();if("base64"===encoding)return toBase64(buf);if("hex"===encoding)return toHex2(buf);if(void 0===encoding||"utf8"===encoding||"utf-8"===encoding)return toUtf8(buf);if("function"==typeof TextDecoder)return new TextDecoder(encoding).decode(buf);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(transformed)throw new Error("The stream has already been transformed.");transformed=!0;if(isBlobInstance(stream))return blobToWebStream(stream);if(isReadableStream(stream))return stream;throw new Error(`Cannot transform payload to web stream, got ${stream}`)}})};isBlobInstance=stream=>"function"==typeof Blob&&stream instanceof Blob;collectBody=async(streamBody=new Uint8Array,context2)=>{if(streamBody instanceof Uint8Array)return Uint8ArrayBlobAdapter.mutate(streamBody);if(!streamBody)return Uint8ArrayBlobAdapter.mutate(new Uint8Array);const fromContext=context2.streamCollector(streamBody);return Uint8ArrayBlobAdapter.mutate(await fromContext)};deref=schemaRef=>"function"==typeof schemaRef?schemaRef():schemaRef;operation=(namespace,name,traits,input,output)=>({name,namespace,traits,input,output});schemaDeserializationMiddleware=config=>(next2,context2)=>async args=>{var _a8,_b5,_c3,_d2;const{response}=await next2(args),{operationSchema}=getSmithyContext(context2),[,ns,n3,t9,i2,o2]=null!=operationSchema?operationSchema:[];try{return{response,output:await config.protocol.deserializeResponse(operation(ns,n3,t9,i2,o2),{...config,...context2},response)}}catch(error){Object.defineProperty(error,"$response",{value:response,enumerable:!1,writable:!1,configurable:!1});if(!("$metadata"in error)){const hint="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{error.message+="\n "+hint}catch(e3){context2.logger&&"NoOpLogger"!==(null==(_b5=null==(_a8=context2.logger)?void 0:_a8.constructor)?void 0:_b5.name)?null==(_d2=null==(_c3=context2.logger)?void 0:_c3.warn)||_d2.call(_c3,hint):console.warn(hint)}void 0!==error.$responseBodyText&&error.$response&&(error.$response.body=error.$responseBodyText);try{if(HttpResponse.isInstance(response)){const{headers={}}=response,headerEntries=Object.entries(headers);error.$metadata={httpStatusCode:response.statusCode,requestId:findHeader(/^x-[\w-]+-request-?id$/,headerEntries),extendedRequestId:findHeader(/^x-[\w-]+-id-2$/,headerEntries),cfId:findHeader(/^x-[\w-]+-cf-id$/,headerEntries)}}}catch(e3){}}throw error}};findHeader=(pattern,headers)=>(headers.find(([k2])=>k2.match(pattern))||[void 0,void 0])[1];parseUrl=url=>{if("string"==typeof url)return parseUrl(new URL(url));const{hostname,pathname,port,protocol,search}=url;let query3;search&&(query3=parseQueryString(search));return{hostname,port:port?parseInt(port):void 0,protocol,path:pathname,query:query3}};toEndpointV1=endpoint=>{if("object"==typeof endpoint){if("url"in endpoint){const v1Endpoint=parseUrl(endpoint.url);if(endpoint.headers){v1Endpoint.headers={};for(const[name,values2]of Object.entries(endpoint.headers))v1Endpoint.headers[name.toLowerCase()]=values2.join(", ")}return v1Endpoint}return endpoint}return parseUrl(endpoint)};schemaSerializationMiddleware=config=>(next2,context2)=>async args=>{const{operationSchema}=getSmithyContext(context2),[,ns,n3,t9,i2,o2]=null!=operationSchema?operationSchema:[],endpoint=context2.endpointV2?async()=>toEndpointV1(context2.endpointV2):config.endpoint,request2=await config.protocol.serializeRequest(operation(ns,n3,t9,i2,o2),args.input,{...config,...context2,endpoint});return next2({...args,request:request2})};deserializerMiddlewareOption={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0};serializerMiddlewareOption={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};traitsCache=[];anno_it=Symbol.for("@smithy/nor-struct-it"),anno_ns=Symbol.for("@smithy/ns");simpleSchemaCacheN=[];simpleSchemaCacheS={};_NormalizedSchema=class _NormalizedSchema{constructor(ref,memberName){__publicField(this,"ref");__publicField(this,"memberName");__publicField(this,"symbol",_NormalizedSchema.symbol);__publicField(this,"name");__publicField(this,"schema");__publicField(this,"_isMemberSchema");__publicField(this,"traits");__publicField(this,"memberTraits");__publicField(this,"normalizedTraits");var _a8;this.ref=ref;this.memberName=memberName;const traitStack=[];let _ref=ref,schema=ref;this._isMemberSchema=!1;for(;isMemberSchema(_ref);){traitStack.push(_ref[1]);_ref=_ref[0];schema=deref(_ref);this._isMemberSchema=!0}if(traitStack.length>0){this.memberTraits={};for(let i2=traitStack.length-1;i2>=0;--i2){const traitSet=traitStack[i2];Object.assign(this.memberTraits,translateTraits(traitSet))}}else this.memberTraits=0;if(schema instanceof _NormalizedSchema){const computedMemberTraits=this.memberTraits;Object.assign(this,schema);this.memberTraits=Object.assign({},computedMemberTraits,schema.getMemberTraits(),this.getMemberTraits());this.normalizedTraits=void 0;this.memberName=null!=memberName?memberName:schema.memberName;return}this.schema=deref(schema);if(isStaticSchema(this.schema)){this.name=`${this.schema[1]}#${this.schema[2]}`;this.traits=this.schema[3]}else{this.name=null!=(_a8=this.memberName)?_a8:String(schema);this.traits=0}if(this._isMemberSchema&&!memberName)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](lhs){const isPrototype=this.prototype.isPrototypeOf(lhs);return isPrototype||"object"!=typeof lhs||null===lhs?isPrototype:lhs.symbol===this.symbol}static of(ref){const keyAble="function"==typeof ref||"object"==typeof ref&&null!==ref;if("number"==typeof ref){if(simpleSchemaCacheN[ref])return simpleSchemaCacheN[ref]}else if("string"==typeof ref){if(simpleSchemaCacheS[ref])return simpleSchemaCacheS[ref]}else if(keyAble&&ref[anno_ns])return ref[anno_ns];const sc=deref(ref);if(sc instanceof _NormalizedSchema)return sc;if(isMemberSchema(sc)){const[ns2,traits]=sc;if(ns2 instanceof _NormalizedSchema){Object.assign(ns2.getMergedTraits(),translateTraits(traits));return ns2}throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref,null,2)}.`)}const ns=new _NormalizedSchema(sc);return keyAble?ref[anno_ns]=ns:"string"==typeof sc?simpleSchemaCacheS[sc]=ns:"number"==typeof sc?simpleSchemaCacheN[sc]=ns:ns}getSchema(){const sc=this.schema;return Array.isArray(sc)&&0===sc[0]?sc[4]:sc}getName(withNamespace=!1){const{name}=this;return!withNamespace&&name&&name.includes("#")?name.split("#")[1]:name||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const sc=this.getSchema();return"number"==typeof sc?sc>=64&&sc<128:1===sc[0]}isMapSchema(){const sc=this.getSchema();return"number"==typeof sc?sc>=128&&sc<=255:2===sc[0]}isStructSchema(){const sc=this.getSchema();if("object"!=typeof sc)return!1;const id=sc[0];return 3===id||-3===id||4===id}isUnionSchema(){const sc=this.getSchema();return"object"==typeof sc&&4===sc[0]}isBlobSchema(){const sc=this.getSchema();return 21===sc||42===sc}isTimestampSchema(){const sc=this.getSchema();return"number"==typeof sc&&sc>=4&&sc<=7}isUnitSchema(){return"unit"===this.getSchema()}isDocumentSchema(){return 15===this.getSchema()}isStringSchema(){return 0===this.getSchema()}isBooleanSchema(){return 2===this.getSchema()}isNumericSchema(){return 1===this.getSchema()}isBigIntegerSchema(){return 17===this.getSchema()}isBigDecimalSchema(){return 19===this.getSchema()}isStreaming(){const{streaming}=this.getMergedTraits();return!!streaming||42===this.getSchema()}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){var _a8;return null!=(_a8=this.normalizedTraits)?_a8:this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()}}getMemberTraits(){return translateTraits(this.memberTraits)}getOwnTraits(){return translateTraits(this.traits)}getKeySchema(){var _a8;const[isDoc,isMap]=[this.isDocumentSchema(),this.isMapSchema()];if(!isDoc&&!isMap)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const schema=this.getSchema();return member([isDoc?15:null!=(_a8=schema[4])?_a8:0,0],"key")}getValueSchema(){const sc=this.getSchema(),[isDoc,isMap,isList]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],memberSchema="number"==typeof sc?63&sc:sc&&"object"==typeof sc&&(isMap||isList)?sc[3+sc[0]]:isDoc?15:void 0;if(null!=memberSchema)return member([memberSchema,0],isMap?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(memberName){const struct=this.getSchema();if(this.isStructSchema()&&struct[4].includes(memberName)){const i2=struct[4].indexOf(memberName),memberSchema=struct[5][i2];return member(isMemberSchema(memberSchema)?memberSchema:[memberSchema,0],memberName)}if(this.isDocumentSchema())return member([15,0],memberName);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${memberName}.`)}getMemberSchemas(){const buffer={};try{for(const[k2,v2]of this.structIterator())buffer[k2]=v2}catch(ignored){}return buffer}getEventStreamMember(){if(this.isStructSchema())for(const[memberName,memberSchema]of this.structIterator())if(memberSchema.isStreaming()&&memberSchema.isStructSchema())return memberName;return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const struct=this.getSchema(),z2=struct[4].length;let it=struct[anno_it];if(it&&z2===it.length)yield*it;else{it=Array(z2);for(let i2=0;i2Array.isArray(sc)&&2===sc.length;isStaticSchema=sc=>Array.isArray(sc)&&sc.length>=5;_TypeRegistry=class _TypeRegistry{constructor(namespace,schemas=new Map,exceptions=new Map){__publicField(this,"namespace");__publicField(this,"schemas");__publicField(this,"exceptions");this.namespace=namespace;this.schemas=schemas;this.exceptions=exceptions}static for(namespace){_TypeRegistry.registries.has(namespace)||_TypeRegistry.registries.set(namespace,new _TypeRegistry(namespace));return _TypeRegistry.registries.get(namespace)}copyFrom(other){const{schemas,exceptions}=this;for(const[k2,v2]of other.schemas)schemas.has(k2)||schemas.set(k2,v2);for(const[k2,v2]of other.exceptions)exceptions.has(k2)||exceptions.set(k2,v2)}register(shapeId,schema){const qualifiedName=this.normalizeShapeId(shapeId);for(const r4 of[this,_TypeRegistry.for(qualifiedName.split("#")[0])])r4.schemas.set(qualifiedName,schema)}getSchema(shapeId){const id=this.normalizeShapeId(shapeId);if(!this.schemas.has(id))throw new Error(`@smithy/core/schema - schema not found for ${id}`);return this.schemas.get(id)}registerError(es,ctor){const $error=es,ns=$error[1];for(const r4 of[this,_TypeRegistry.for(ns)]){r4.schemas.set(ns+"#"+$error[2],$error);r4.exceptions.set($error,ctor)}}getErrorCtor(es){const $error=es;return this.exceptions.has($error)?this.exceptions.get($error):_TypeRegistry.for($error[1]).exceptions.get($error)}getBaseException(){for(const exceptionKey of this.exceptions.keys())if(Array.isArray(exceptionKey)){const[,ns,name]=exceptionKey,id=ns+"#"+name;if(id.startsWith("smithy.ts.sdk.synthetic.")&&id.endsWith("ServiceException"))return exceptionKey}}find(predicate){return[...this.schemas.values()].find(predicate)}clear(){this.schemas.clear();this.exceptions.clear()}normalizeShapeId(shapeId){return shapeId.includes("#")?shapeId:this.namespace+"#"+shapeId}};__publicField(_TypeRegistry,"registries",new Map);TypeRegistry=_TypeRegistry;expectNumber=value=>{if(null!=value){if("string"==typeof value){const parsed=parseFloat(value);if(!Number.isNaN(parsed)){String(parsed)!==String(value)&&logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));return parsed}}if("number"==typeof value)return value;throw new TypeError(`Expected number, got ${typeof value}: ${value}`)}};MAX_FLOAT=Math.ceil(2**127*(2-2**-23));expectFloat32=value=>{const expected=expectNumber(value);if(void 0!==expected&&!Number.isNaN(expected)&&expected!==1/0&&expected!==-1/0&&Math.abs(expected)>MAX_FLOAT)throw new TypeError(`Expected 32-bit float, got ${value}`);return expected};expectLong=value=>{if(null!=value){if(Number.isInteger(value)&&!Number.isNaN(value))return value;throw new TypeError(`Expected integer, got ${typeof value}: ${value}`)}};expectShort=value=>expectSizedInt(value,16);expectByte=value=>expectSizedInt(value,8);expectSizedInt=(value,size)=>{const expected=expectLong(value);if(void 0!==expected&&castInt(expected,size)!==expected)throw new TypeError(`Expected ${size}-bit integer, got ${value}`);return expected};castInt=(value,size)=>{switch(size){case 32:return Int32Array.of(value)[0];case 16:return Int16Array.of(value)[0];case 8:return Int8Array.of(value)[0]}};strictParseFloat32=value=>expectFloat32("string"==typeof value?parseNumber(value):value);NUMBER_REGEX=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;parseNumber=value=>{const matches=value.match(NUMBER_REGEX);if(null===matches||matches[0].length!==value.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(value)};strictParseShort=value=>expectShort("string"==typeof value?parseNumber(value):value);strictParseByte=value=>expectByte("string"==typeof value?parseNumber(value):value);stackTraceWarning=message=>String(new TypeError(message).stack||message).split("\n").slice(0,5).filter(s2=>!s2.includes("stackTraceWarning")).join("\n");logger={warn:console.warn};DAYS=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];MONTHS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/);IMF_FIXDATE=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);RFC_850_DATE=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);ASC_TIME=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);parseRfc7231DateTime=value=>{if(null==value)return;if("string"!=typeof value)throw new TypeError("RFC-7231 date-times must be expressed as strings");let match3=IMF_FIXDATE.exec(value);if(match3){const[_,dayStr,monthStr,yearStr,hours,minutes,seconds,fractionalMilliseconds]=match3;return buildDate(strictParseShort(stripLeadingZeroes(yearStr)),parseMonthByShortName(monthStr),parseDateValue(dayStr,"day",1,31),{hours,minutes,seconds,fractionalMilliseconds})}match3=RFC_850_DATE.exec(value);if(match3){const[_,dayStr,monthStr,yearStr,hours,minutes,seconds,fractionalMilliseconds]=match3;return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr),parseMonthByShortName(monthStr),parseDateValue(dayStr,"day",1,31),{hours,minutes,seconds,fractionalMilliseconds}))}match3=ASC_TIME.exec(value);if(match3){const[_,monthStr,dayStr,hours,minutes,seconds,fractionalMilliseconds,yearStr]=match3;return buildDate(strictParseShort(stripLeadingZeroes(yearStr)),parseMonthByShortName(monthStr),parseDateValue(dayStr.trimLeft(),"day",1,31),{hours,minutes,seconds,fractionalMilliseconds})}throw new TypeError("Invalid RFC-7231 date-time value")};buildDate=(year2,month,day,time2)=>{const adjustedMonth=month-1;validateDayOfMonth(year2,adjustedMonth,day);return new Date(Date.UTC(year2,adjustedMonth,day,parseDateValue(time2.hours,"hour",0,23),parseDateValue(time2.minutes,"minute",0,59),parseDateValue(time2.seconds,"seconds",0,60),parseMilliseconds(time2.fractionalMilliseconds)))};parseTwoDigitYear=value=>{const thisYear=(new Date).getUTCFullYear(),valueInThisCentury=100*Math.floor(thisYear/100)+strictParseShort(stripLeadingZeroes(value));return valueInThisCenturyinput.getTime()-(new Date).getTime()>15768e8?new Date(Date.UTC(input.getUTCFullYear()-100,input.getUTCMonth(),input.getUTCDate(),input.getUTCHours(),input.getUTCMinutes(),input.getUTCSeconds(),input.getUTCMilliseconds())):input;parseMonthByShortName=value=>{const monthIdx=MONTHS.indexOf(value);if(monthIdx<0)throw new TypeError(`Invalid month: ${value}`);return monthIdx+1};DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31];validateDayOfMonth=(year2,month,day)=>{let maxDays=DAYS_IN_MONTH[month];1===month&&isLeapYear(year2)&&(maxDays=29);if(day>maxDays)throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year2}: ${day}`)};isLeapYear=year2=>year2%4==0&&(year2%100!=0||year2%400==0);parseDateValue=(value,type,lower,upper)=>{const dateVal=strictParseByte(stripLeadingZeroes(value));if(dateValupper)throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);return dateVal};parseMilliseconds=value=>null==value?0:1e3*strictParseFloat32("0."+value);stripLeadingZeroes=value=>{let idx2=0;for(;idx2i2.toString(16).padStart(2,"0"));v4=()=>{if(randomUUID)return randomUUID();const rnds=new Uint8Array(16);crypto.getRandomValues(rnds);rnds[6]=15&rnds[6]|64;rnds[8]=63&rnds[8]|128;return decimalToHex[rnds[0]]+decimalToHex[rnds[1]]+decimalToHex[rnds[2]]+decimalToHex[rnds[3]]+"-"+decimalToHex[rnds[4]]+decimalToHex[rnds[5]]+"-"+decimalToHex[rnds[6]]+decimalToHex[rnds[7]]+"-"+decimalToHex[rnds[8]]+decimalToHex[rnds[9]]+"-"+decimalToHex[rnds[10]]+decimalToHex[rnds[11]]+decimalToHex[rnds[12]]+decimalToHex[rnds[13]]+decimalToHex[rnds[14]]+decimalToHex[rnds[15]]};(LazyJsonString=function LazyJsonString2(val){return Object.assign(new String(val),{deserializeJSON:()=>JSON.parse(String(val)),toString:()=>String(val),toJSON:()=>String(val)})}).from=object=>object&&"object"==typeof object&&(object instanceof LazyJsonString||"deserializeJSON"in object)?object:"string"==typeof object||Object.getPrototypeOf(object)===String.prototype?LazyJsonString(String(object)):LazyJsonString(JSON.stringify(object));LazyJsonString.fromObject=LazyJsonString.from;ddd="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?";mmm="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)";time="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?";RFC3339_WITH_OFFSET2=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/);IMF_FIXDATE2=new RegExp(`^${ddd}, (\\d?\\d) ${mmm} (\\d{4}) ${time} GMT$`);RFC_850_DATE2=new RegExp(`^${ddd}, (\\d?\\d)-${mmm}-(\\d\\d) ${time} GMT$`);ASC_TIME2=new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time} (\\d{4})$`);months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];_parseEpochTimestamp=value=>{if(null==value)return;let num=NaN;if("number"==typeof value)num=value;else if("string"==typeof value){if(!/^-?\d*\.?\d+$/.test(value))throw new TypeError("parseEpochTimestamp - numeric string invalid.");num=Number.parseFloat(value)}else"object"==typeof value&&1===value.tag&&(num=value.value);if(isNaN(num)||Math.abs(num)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*num))};_parseRfc3339DateTimeWithOffset=value=>{if(null==value)return;if("string"!=typeof value)throw new TypeError("RFC3339 timestamps must be strings");const matches=RFC3339_WITH_OFFSET2.exec(value);if(!matches)throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);const[,yearStr,monthStr,dayStr,hours,minutes,seconds,,ms,offsetStr]=matches;range3(monthStr,1,12);range3(dayStr,1,31);range3(hours,0,23);range3(minutes,0,59);range3(seconds,0,60);const date2=new Date(Date.UTC(Number(yearStr),Number(monthStr)-1,Number(dayStr),Number(hours),Number(minutes),Number(seconds),Number(ms)?Math.round(1e3*parseFloat(`0.${ms}`)):0));date2.setUTCFullYear(Number(yearStr));if("Z"!=offsetStr.toUpperCase()){const[,sign2,offsetH,offsetM]=/([+-])(\d\d):(\d\d)/.exec(offsetStr)||[void 0,"+",0,0],scalar="-"===sign2?1:-1;date2.setTime(date2.getTime()+scalar*(60*Number(offsetH)*60*1e3+60*Number(offsetM)*1e3))}return date2};_parseRfc7231DateTime=value=>{if(null==value)return;if("string"!=typeof value)throw new TypeError("RFC7231 timestamps must be strings.");let day,month,year2,hour,minute,second,fraction,matches;if(matches=IMF_FIXDATE2.exec(value))[,day,month,year2,hour,minute,second,fraction]=matches;else if(matches=RFC_850_DATE2.exec(value)){[,day,month,year2,hour,minute,second,fraction]=matches;year2=(Number(year2)+1900).toString()}else(matches=ASC_TIME2.exec(value))&&([,month,day,hour,minute,second,fraction,year2]=matches);if(year2&&second){const timestamp=Date.UTC(Number(year2),months.indexOf(month),Number(day),Number(hour),Number(minute),Number(second),fraction?Math.round(1e3*parseFloat(`0.${fraction}`)):0);range3(day,1,31);range3(hour,0,23);range3(minute,0,59);range3(second,0,60);const date2=new Date(timestamp);date2.setUTCFullYear(Number(year2));return date2}throw new TypeError(`Invalid RFC7231 date-time value ${value}.`)};splitHeader=value=>{const z2=value.length,values2=[];let prevChar,withinQuotes=!1,anchor=0;for(let i2=0;i2{const z3=(v2=v2.trim()).length;if(z3<2)return v2;'"'===v2[0]&&'"'===v2[z3-1]&&(v2=v2.slice(1,z3-1));return v2.replace(/\\"/g,'"')})};format=/^-?\d*(\.\d+)?$/;NumericValue=class _NumericValue{constructor(string,type){__publicField(this,"string");__publicField(this,"type");this.string=string;this.type=type;if(!format.test(string))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](object){if(!object||"object"!=typeof object)return!1;const _nv=object;return _NumericValue.prototype.isPrototypeOf(object)||"bigDecimal"===_nv.type&&format.test(_nv.string)}};SerdeContext=class{constructor(){__publicField(this,"serdeContext")}setSerdeContext(serdeContext){this.serdeContext=serdeContext}};HttpProtocol=class extends SerdeContext{constructor(options){var _a8;super();__publicField(this,"options");__publicField(this,"compositeErrorRegistry");this.options=options;this.compositeErrorRegistry=TypeRegistry.for(options.defaultNamespace);for(const etr of null!=(_a8=options.errorTypeRegistries)?_a8:[])this.compositeErrorRegistry.copyFrom(etr)}getRequestType(){return HttpRequest}getResponseType(){return HttpResponse}setSerdeContext(serdeContext){this.serdeContext=serdeContext;this.serializer.setSerdeContext(serdeContext);this.deserializer.setSerdeContext(serdeContext);this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(serdeContext)}updateServiceEndpoint(request2,endpoint){if("url"in endpoint){request2.protocol=endpoint.url.protocol;request2.hostname=endpoint.url.hostname;request2.port=endpoint.url.port?Number(endpoint.url.port):void 0;request2.path=endpoint.url.pathname;request2.fragment=endpoint.url.hash||void 0;request2.username=endpoint.url.username||void 0;request2.password=endpoint.url.password||void 0;request2.query||(request2.query={});for(const[k2,v2]of endpoint.url.searchParams.entries())request2.query[k2]=v2;if(endpoint.headers)for(const[name,values2]of Object.entries(endpoint.headers))request2.headers[name]=values2.join(", ");return request2}request2.protocol=endpoint.protocol;request2.hostname=endpoint.hostname;request2.port=endpoint.port?Number(endpoint.port):void 0;request2.path=endpoint.path;request2.query={...endpoint.query};if(endpoint.headers)for(const[name,value]of Object.entries(endpoint.headers))request2.headers[name]=value;return request2}setHostPrefix(request2,operationSchema,input){var _a8,_b5,_c3;if(null==(_a8=this.serdeContext)?void 0:_a8.disableHostPrefix)return;const inputNs=NormalizedSchema.of(operationSchema.input),opTraits=translateTraits(null!=(_b5=operationSchema.traits)?_b5:{});if(opTraits.endpoint){let hostPrefix=null==(_c3=opTraits.endpoint)?void 0:_c3[0];if("string"==typeof hostPrefix){const hostLabelInputs=[...inputNs.structIterator()].filter(([,member2])=>member2.getMergedTraits().hostLabel);for(const[name]of hostLabelInputs){const replacement=input[name];if("string"!=typeof replacement)throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`);hostPrefix=hostPrefix.replace(`{${name}}`,replacement)}request2.hostname=hostPrefix+request2.hostname}}}deserializeMetadata(output){var _a8,_b5;return{httpStatusCode:output.statusCode,requestId:null!=(_b5=null!=(_a8=output.headers["x-amzn-requestid"])?_a8:output.headers["x-amzn-request-id"])?_b5:output.headers["x-amz-request-id"],extendedRequestId:output.headers["x-amz-id-2"],cfId:output.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream,requestSchema,initialRequest}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream,requestSchema,initialRequest})}async deserializeEventStream({response,responseSchema,initialResponseContainer}){return(await this.loadEventStreamCapability()).deserializeEventStream({response,responseSchema,initialResponseContainer})}async loadEventStreamCapability(){const{EventStreamSerde:EventStreamSerde2}=await Promise.resolve().then(()=>(init_event_streams(),event_streams_exports));return new EventStreamSerde2({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(schema,context2,response,arg4,arg5){return[]}getEventStreamMarshaller(){const context2=this.serdeContext;if(!context2.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return context2.eventStreamMarshaller}};HttpBindingProtocol=class extends HttpProtocol{async serializeRequest(operationSchema,_input,context2){var _a8,_b5;const input={...null!=_input?_input:{}},serializer=this.serializer,query3={},headers={},endpoint=await context2.endpoint(),ns=NormalizedSchema.of(null==operationSchema?void 0:operationSchema.input),payloadMemberNames=[],payloadMemberSchemas=[];let payload,hasNonHttpBindingMember=!1;const request2=new HttpRequest({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:query3,headers,body:void 0});if(endpoint){this.updateServiceEndpoint(request2,endpoint);this.setHostPrefix(request2,operationSchema,input);const opTraits=translateTraits(operationSchema.traits);if(opTraits.http){request2.method=opTraits.http[0];const[path2,search]=opTraits.http[1].split("?");"/"==request2.path?request2.path=path2:request2.path+=path2;const traitSearchParams=new URLSearchParams(null!=search?search:"");Object.assign(query3,Object.fromEntries(traitSearchParams))}}for(const[memberName,memberNs]of ns.structIterator()){const memberTraits=null!=(_a8=memberNs.getMergedTraits())?_a8:{},inputMemberValue=input[memberName];if(null!=inputMemberValue||memberNs.isIdempotencyToken())if(memberTraits.httpPayload){if(memberNs.isStreaming())memberNs.isStructSchema()?input[memberName]&&(payload=await this.serializeEventStream({eventStream:input[memberName],requestSchema:ns})):payload=inputMemberValue;else{serializer.write(memberNs,inputMemberValue);payload=serializer.flush()}delete input[memberName]}else if(memberTraits.httpLabel){serializer.write(memberNs,inputMemberValue);const replacement=serializer.flush();request2.path.includes(`{${memberName}+}`)?request2.path=request2.path.replace(`{${memberName}+}`,replacement.split("/").map(extendedEncodeURIComponent).join("/")):request2.path.includes(`{${memberName}}`)&&(request2.path=request2.path.replace(`{${memberName}}`,extendedEncodeURIComponent(replacement)));delete input[memberName]}else if(memberTraits.httpHeader){serializer.write(memberNs,inputMemberValue);headers[memberTraits.httpHeader.toLowerCase()]=String(serializer.flush());delete input[memberName]}else if("string"==typeof memberTraits.httpPrefixHeaders){for(const[key3,val]of Object.entries(inputMemberValue)){const amalgam=memberTraits.httpPrefixHeaders+key3;serializer.write([memberNs.getValueSchema(),{httpHeader:amalgam}],val);headers[amalgam.toLowerCase()]=serializer.flush()}delete input[memberName]}else if(memberTraits.httpQuery||memberTraits.httpQueryParams){this.serializeQuery(memberNs,inputMemberValue,query3);delete input[memberName]}else{hasNonHttpBindingMember=!0;payloadMemberNames.push(memberName);payloadMemberSchemas.push(memberNs)}else if(memberTraits.httpLabel&&(request2.path.includes(`{${memberName}+}`)||request2.path.includes(`{${memberName}}`)))throw new Error(`No value provided for input HTTP label: ${memberName}.`)}if(hasNonHttpBindingMember&&input){const[namespace,name]=(null!=(_b5=ns.getName(!0))?_b5:"#Unknown").split("#"),requiredMembers=ns.getSchema()[6],payloadSchema=[3,namespace,name,ns.getMergedTraits(),payloadMemberNames,payloadMemberSchemas,void 0];requiredMembers?payloadSchema[6]=requiredMembers:payloadSchema.pop();serializer.write(payloadSchema,input);payload=serializer.flush()}request2.headers=headers;request2.query=query3;request2.body=payload;return request2}serializeQuery(ns,data,query3){const serializer=this.serializer,traits=ns.getMergedTraits();if(traits.httpQueryParams){for(const[key3,val]of Object.entries(data))if(!(key3 in query3)){const valueSchema=ns.getValueSchema();Object.assign(valueSchema.getMergedTraits(),{...traits,httpQuery:key3,httpQueryParams:void 0});this.serializeQuery(valueSchema,val,query3)}}else if(ns.isListSchema()){const sparse=!!ns.getMergedTraits().sparse,buffer=[];for(const item of data){serializer.write([ns.getValueSchema(),traits],item);const serializable=serializer.flush();(sparse||void 0!==serializable)&&buffer.push(serializable)}query3[traits.httpQuery]=buffer}else{serializer.write([ns,traits],data);query3[traits.httpQuery]=serializer.flush()}}async deserializeResponse(operationSchema,context2,response){const deserializer=this.deserializer,ns=NormalizedSchema.of(operationSchema.output),dataObject={};if(response.statusCode>=300){const bytes=await collectBody(response.body,context2);bytes.byteLength>0&&Object.assign(dataObject,await deserializer.read(15,bytes));await this.handleError(operationSchema,context2,response,dataObject,this.deserializeMetadata(response));throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const header in response.headers){const value=response.headers[header];delete response.headers[header];response.headers[header.toLowerCase()]=value}const nonHttpBindingMembers=await this.deserializeHttpMessage(ns,context2,response,dataObject);if(nonHttpBindingMembers.length){const bytes=await collectBody(response.body,context2);if(bytes.byteLength>0){const dataFromBody=await deserializer.read(ns,bytes);for(const member2 of nonHttpBindingMembers)null!=dataFromBody[member2]&&(dataObject[member2]=dataFromBody[member2])}}else nonHttpBindingMembers.discardResponseBody&&await collectBody(response.body,context2);dataObject.$metadata=this.deserializeMetadata(response);return dataObject}async deserializeHttpMessage(schema,context2,response,arg4,arg5){let dataObject;dataObject=arg4 instanceof Set?arg5:arg4;let discardResponseBody=!0;const deserializer=this.deserializer,ns=NormalizedSchema.of(schema),nonHttpBindingMembers=[];for(const[memberName,memberSchema]of ns.structIterator()){const memberTraits=memberSchema.getMemberTraits();if(memberTraits.httpPayload){discardResponseBody=!1;if(memberSchema.isStreaming()){const isEventStream=memberSchema.isStructSchema();dataObject[memberName]=isEventStream?await this.deserializeEventStream({response,responseSchema:ns}):sdkStreamMixin(response.body)}else if(response.body){const bytes=await collectBody(response.body,context2);bytes.byteLength>0&&(dataObject[memberName]=await deserializer.read(memberSchema,bytes))}}else if(memberTraits.httpHeader){const key3=String(memberTraits.httpHeader).toLowerCase(),value=response.headers[key3];if(null!=value)if(memberSchema.isListSchema()){const headerListValueSchema=memberSchema.getValueSchema();headerListValueSchema.getMergedTraits().httpHeader=key3;let sections;sections=headerListValueSchema.isTimestampSchema()&&4===headerListValueSchema.getSchema()?splitEvery(value,",",2):splitHeader(value);const list=[];for(const section of sections)list.push(await deserializer.read(headerListValueSchema,section.trim()));dataObject[memberName]=list}else dataObject[memberName]=await deserializer.read(memberSchema,value)}else if(void 0!==memberTraits.httpPrefixHeaders){dataObject[memberName]={};for(const[header,value]of Object.entries(response.headers))if(header.startsWith(memberTraits.httpPrefixHeaders)){const valueSchema=memberSchema.getValueSchema();valueSchema.getMergedTraits().httpHeader=header;dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)]=await deserializer.read(valueSchema,value)}}else memberTraits.httpResponseCode?dataObject[memberName]=response.statusCode:nonHttpBindingMembers.push(memberName)}nonHttpBindingMembers.discardResponseBody=discardResponseBody;return nonHttpBindingMembers}};init_dist_es();FromStringShapeDeserializer=class extends SerdeContext{constructor(settings){super();__publicField(this,"settings");this.settings=settings}read(_schema,data){var _a8,_b5;const ns=NormalizedSchema.of(_schema);if(ns.isListSchema())return splitHeader(data).map(item=>this.read(ns.getValueSchema(),item));if(ns.isBlobSchema())return(null!=(_b5=null==(_a8=this.serdeContext)?void 0:_a8.base64Decoder)?_b5:fromBase64)(data);if(ns.isTimestampSchema())switch(determineTimestampFormat(ns,this.settings)){case 5:return _parseRfc3339DateTimeWithOffset(data);case 6:return _parseRfc7231DateTime(data);case 7:return _parseEpochTimestamp(data);default:console.warn("Missing timestamp format, parsing value with Date constructor:",data);return new Date(data)}if(ns.isStringSchema()){const mediaType=ns.getMergedTraits().mediaType;let intermediateValue=data;if(mediaType){ns.getMergedTraits().httpHeader&&(intermediateValue=this.base64ToUtf8(intermediateValue));("application/json"===mediaType||mediaType.endsWith("+json"))&&(intermediateValue=LazyJsonString.from(intermediateValue));return intermediateValue}}return ns.isNumericSchema()?Number(data):ns.isBigIntegerSchema()?BigInt(data):ns.isBigDecimalSchema()?new NumericValue(data,"bigDecimal"):ns.isBooleanSchema()?"true"===String(data).toLowerCase():data}base64ToUtf8(base64String){var _a8,_b5,_c3,_d2;return(null!=(_b5=null==(_a8=this.serdeContext)?void 0:_a8.utf8Encoder)?_b5:toUtf8)((null!=(_d2=null==(_c3=this.serdeContext)?void 0:_c3.base64Decoder)?_d2:fromBase64)(base64String))}};init_dist_es();HttpInterceptingShapeDeserializer=class extends SerdeContext{constructor(codecDeserializer,codecSettings){super();__publicField(this,"codecDeserializer");__publicField(this,"stringDeserializer");this.codecDeserializer=codecDeserializer;this.stringDeserializer=new FromStringShapeDeserializer(codecSettings)}setSerdeContext(serdeContext){this.stringDeserializer.setSerdeContext(serdeContext);this.codecDeserializer.setSerdeContext(serdeContext);this.serdeContext=serdeContext}read(schema,data){var _a8,_b5,_c3,_d2;const ns=NormalizedSchema.of(schema),traits=ns.getMergedTraits(),toString=null!=(_b5=null==(_a8=this.serdeContext)?void 0:_a8.utf8Encoder)?_b5:toUtf8;if(traits.httpHeader||traits.httpResponseCode)return this.stringDeserializer.read(ns,toString(data));if(traits.httpPayload){if(ns.isBlobSchema()){const toBytes=null!=(_d2=null==(_c3=this.serdeContext)?void 0:_c3.utf8Decoder)?_d2:fromUtf8;return"string"==typeof data?toBytes(data):data}if(ns.isStringSchema())return"byteLength"in data?toString(data):data}return this.codecDeserializer.read(ns,data)}};ToStringShapeSerializer=class extends SerdeContext{constructor(settings){super();__publicField(this,"settings");__publicField(this,"stringBuffer","");this.settings=settings}write(schema,value){var _a8,_b5,_c3,_d2;const ns=NormalizedSchema.of(schema);switch(typeof value){case"object":if(null===value){this.stringBuffer="null";return}if(ns.isTimestampSchema()){if(!(value instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(!0)}`);switch(determineTimestampFormat(ns,this.settings)){case 5:this.stringBuffer=value.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=dateToUtcString(value);break;case 7:this.stringBuffer=String(value.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",value);this.stringBuffer=String(value.getTime()/1e3)}return}if(ns.isBlobSchema()&&"byteLength"in value){this.stringBuffer=(null!=(_b5=null==(_a8=this.serdeContext)?void 0:_a8.base64Encoder)?_b5:toBase64)(value);return}if(ns.isListSchema()&&Array.isArray(value)){let buffer="";for(const item of value){this.write([ns.getValueSchema(),ns.getMergedTraits()],item);const headerItem=this.flush();""!==buffer&&(buffer+=", ");buffer+=ns.getValueSchema().isTimestampSchema()?headerItem:quoteHeader(headerItem)}this.stringBuffer=buffer;return}this.stringBuffer=JSON.stringify(value,null,2);break;case"string":const mediaType=ns.getMergedTraits().mediaType;let intermediateValue=value;if(mediaType){("application/json"===mediaType||mediaType.endsWith("+json"))&&(intermediateValue=LazyJsonString.from(intermediateValue));if(ns.getMergedTraits().httpHeader){this.stringBuffer=(null!=(_d2=null==(_c3=this.serdeContext)?void 0:_c3.base64Encoder)?_d2:toBase64)(intermediateValue.toString());return}}this.stringBuffer=value;break;default:ns.isIdempotencyToken()?this.stringBuffer=v4():this.stringBuffer=String(value)}}flush(){const buffer=this.stringBuffer;this.stringBuffer="";return buffer}};HttpInterceptingShapeSerializer=class{constructor(codecSerializer,codecSettings,stringSerializer=new ToStringShapeSerializer(codecSettings)){__publicField(this,"codecSerializer");__publicField(this,"stringSerializer");__publicField(this,"buffer");this.codecSerializer=codecSerializer;this.stringSerializer=stringSerializer}setSerdeContext(serdeContext){this.codecSerializer.setSerdeContext(serdeContext);this.stringSerializer.setSerdeContext(serdeContext)}write(schema,value){const ns=NormalizedSchema.of(schema),traits=ns.getMergedTraits();if(!(traits.httpHeader||traits.httpLabel||traits.httpQuery))return this.codecSerializer.write(ns,value);this.stringSerializer.write(ns,value);this.buffer=this.stringSerializer.flush()}flush(){if(void 0!==this.buffer){const buffer=this.buffer;this.buffer=void 0;return buffer}return this.codecSerializer.flush()}};DefaultIdentityProviderConfig=class{constructor(config){__publicField(this,"authSchemes",new Map);for(const[key3,value]of Object.entries(config))void 0!==value&&this.authSchemes.set(key3,value)}getIdentityProvider(schemeId){return this.authSchemes.get(schemeId)}};isIdentityExpired=(()=>function isIdentityExpired2(identity){return doesIdentityRequireRefresh(identity)&&identity.expiration.getTime()-Date.now()<3e5})();doesIdentityRequireRefresh=identity=>void 0!==identity.expiration;memoizeIdentityProvider=(provider,isExpired,requiresRefresh)=>{if(void 0===provider)return;const normalizedProvider="function"!=typeof provider?async()=>Promise.resolve(provider):provider;let resolved,pending3,hasResult,isConstant=!1;const coalesceProvider=async options=>{pending3||(pending3=normalizedProvider(options));try{resolved=await pending3;hasResult=!0;isConstant=!1}finally{pending3=void 0}return resolved};return void 0===isExpired?async options=>{hasResult&&!(null==options?void 0:options.forceRefresh)||(resolved=await coalesceProvider(options));return resolved}:async options=>{hasResult&&!(null==options?void 0:options.forceRefresh)||(resolved=await coalesceProvider(options));if(isConstant)return resolved;if(!requiresRefresh(resolved)){isConstant=!0;return resolved}if(isExpired(resolved)){await coalesceProvider(options);return resolved}return resolved}};Error;memoize=(provider,isExpired,requiresRefresh)=>{let resolved,pending3,hasResult,isConstant=!1;const coalesceProvider=async()=>{pending3||(pending3=provider());try{resolved=await pending3;hasResult=!0;isConstant=!1}finally{pending3=void 0}return resolved};return void 0===isExpired?async options=>{hasResult&&!(null==options?void 0:options.forceRefresh)||(resolved=await coalesceProvider());return resolved}:async options=>{hasResult&&!(null==options?void 0:options.forceRefresh)||(resolved=await coalesceProvider());if(isConstant)return resolved;if(requiresRefresh&&!requiresRefresh(resolved)){isConstant=!0;return resolved}if(isExpired(resolved)){await coalesceProvider();return resolved}return resolved}};resolveAwsSdkSigV4AConfig=config=>{config.sigv4aSigningRegionSet=normalizeProvider2(config.sigv4aSigningRegionSet);return config};AMZ_DATE_HEADER=(AMZ_DATE_QUERY_PARAM="X-Amz-Date").toLowerCase();GENERATED_HEADERS=["authorization",AMZ_DATE_HEADER,"date"];SIGNATURE_HEADER="X-Amz-Signature".toLowerCase();TOKEN_HEADER="X-Amz-Security-Token".toLowerCase();ALWAYS_UNSIGNABLE_HEADERS={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0};PROXY_HEADER_PATTERN=/^proxy-/;SEC_HEADER_PATTERN=/^sec-/;EVENT_ALGORITHM_IDENTIFIER="AWS4-HMAC-SHA256-PAYLOAD";init_dist_es();signingKeyCache={};cacheQueue=[];createScope=(shortDate,region,service)=>`${shortDate}/${region}/${service}/aws4_request`;getSigningKey=async(sha256Constructor,credentials,shortDate,region,service)=>{const cacheKey=`${shortDate}:${region}:${service}:${toHex2(await hmac(sha256Constructor,credentials.secretAccessKey,credentials.accessKeyId))}:${credentials.sessionToken}`;if(cacheKey in signingKeyCache)return signingKeyCache[cacheKey];cacheQueue.push(cacheKey);for(;cacheQueue.length>50;)delete signingKeyCache[cacheQueue.shift()];let key3=`AWS4${credentials.secretAccessKey}`;for(const signable of[shortDate,region,service,"aws4_request"])key3=await hmac(sha256Constructor,key3,signable);return signingKeyCache[cacheKey]=key3};hmac=(ctor,secret,data)=>{const hash3=new ctor(secret);hash3.update(toUint8Array(data));return hash3.digest()};getCanonicalHeaders=({headers},unsignableHeaders,signableHeaders)=>{const canonical={};for(const headerName of Object.keys(headers).sort()){if(null==headers[headerName])continue;const canonicalHeaderName=headerName.toLowerCase();(canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS||(null==unsignableHeaders?void 0:unsignableHeaders.has(canonicalHeaderName))||PROXY_HEADER_PATTERN.test(canonicalHeaderName)||SEC_HEADER_PATTERN.test(canonicalHeaderName))&&(!signableHeaders||signableHeaders&&!signableHeaders.has(canonicalHeaderName))||(canonical[canonicalHeaderName]=headers[headerName].trim().replace(/\s+/g," "))}return canonical};isArrayBuffer=arg=>"function"==typeof ArrayBuffer&&arg instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(arg);init_dist_es();getPayloadHash=async({headers,body},hashConstructor)=>{for(const headerName of Object.keys(headers))if("x-amz-content-sha256"===headerName.toLowerCase())return headers[headerName];if(null==body)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if("string"==typeof body||ArrayBuffer.isView(body)||isArrayBuffer(body)){const hashCtor=new hashConstructor;hashCtor.update(toUint8Array(body));return toHex2(await hashCtor.digest())}return"UNSIGNED-PAYLOAD"};init_dist_es();HeaderFormatter=class{format(headers){const chunks=[];for(const headerName of Object.keys(headers)){const bytes=fromUtf8(headerName);chunks.push(Uint8Array.from([bytes.byteLength]),bytes,this.formatHeaderValue(headers[headerName]))}const out=new Uint8Array(chunks.reduce((carry,bytes)=>carry+bytes.byteLength,0));let position=0;for(const chunk of chunks){out.set(chunk,position);position+=chunk.byteLength}return out}formatHeaderValue(header){switch(header.type){case"boolean":return Uint8Array.from([header.value?0:1]);case"byte":return Uint8Array.from([2,header.value]);case"short":const shortView=new DataView(new ArrayBuffer(3));shortView.setUint8(0,3);shortView.setInt16(1,header.value,!1);return new Uint8Array(shortView.buffer);case"integer":const intView=new DataView(new ArrayBuffer(5));intView.setUint8(0,4);intView.setInt32(1,header.value,!1);return new Uint8Array(intView.buffer);case"long":const longBytes=new Uint8Array(9);longBytes[0]=5;longBytes.set(header.value.bytes,1);return longBytes;case"binary":const binView=new DataView(new ArrayBuffer(3+header.value.byteLength));binView.setUint8(0,6);binView.setUint16(1,header.value.byteLength,!1);const binBytes=new Uint8Array(binView.buffer);binBytes.set(header.value,3);return binBytes;case"string":const utf8Bytes=fromUtf8(header.value),strView=new DataView(new ArrayBuffer(3+utf8Bytes.byteLength));strView.setUint8(0,7);strView.setUint16(1,utf8Bytes.byteLength,!1);const strBytes=new Uint8Array(strView.buffer);strBytes.set(utf8Bytes,3);return strBytes;case"timestamp":const tsBytes=new Uint8Array(9);tsBytes[0]=8;tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes,1);return tsBytes;case"uuid":if(!UUID_PATTERN.test(header.value))throw new Error(`Invalid UUID received: ${header.value}`);const uuidBytes=new Uint8Array(17);uuidBytes[0]=9;uuidBytes.set(fromHex(header.value.replace(/\-/g,"")),1);return uuidBytes}}};(function(HEADER_VALUE_TYPE3){HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3.boolTrue=0]="boolTrue";HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3.boolFalse=1]="boolFalse";HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3.byte=2]="byte";HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3.short=3]="short";HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3.integer=4]="integer";HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3.long=5]="long";HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3.byteArray=6]="byteArray";HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3.string=7]="string";HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3.timestamp=8]="timestamp";HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3.uuid=9]="uuid"})(HEADER_VALUE_TYPE||(HEADER_VALUE_TYPE={}));UUID_PATTERN=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;Int64=class _Int64{constructor(bytes){__publicField(this,"bytes");this.bytes=bytes;if(8!==bytes.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(number){if(number>0x8000000000000000||number<-0x8000000000000000)throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);const bytes=new Uint8Array(8);for(let i2=7,remaining=Math.abs(Math.round(number));i2>-1&&remaining>0;i2--,remaining/=256)bytes[i2]=remaining;number<0&&negate(bytes);return new _Int64(bytes)}valueOf(){const bytes=this.bytes.slice(0),negative=128&bytes[0];negative&&negate(bytes);return parseInt(toHex2(bytes),16)*(negative?-1:1)}toString(){return String(this.valueOf())}};hasHeader=(soughtHeader,headers)=>{soughtHeader=soughtHeader.toLowerCase();for(const headerName of Object.keys(headers))if(soughtHeader===headerName.toLowerCase())return!0;return!1};moveHeadersToQuery=(request2,options={})=>{var _a8,_b5;const{headers,query:query3={}}=HttpRequest.clone(request2);for(const name of Object.keys(headers)){const lname=name.toLowerCase();if("x-amz-"===lname.slice(0,6)&&!(null==(_a8=options.unhoistableHeaders)?void 0:_a8.has(lname))||(null==(_b5=options.hoistableHeaders)?void 0:_b5.has(lname))){query3[name]=headers[name];delete headers[name]}}return{...request2,headers,query:query3}};prepareRequest=request2=>{request2=HttpRequest.clone(request2);for(const headerName of Object.keys(request2.headers))GENERATED_HEADERS.indexOf(headerName.toLowerCase())>-1&&delete request2.headers[headerName];return request2};getCanonicalQuery=({query:query3={}})=>{const keys3=[],serialized2={};for(const key3 of Object.keys(query3)){if(key3.toLowerCase()===SIGNATURE_HEADER)continue;const encodedKey=escapeUri(key3);keys3.push(encodedKey);const value=query3[key3];"string"==typeof value?serialized2[encodedKey]=`${encodedKey}=${escapeUri(value)}`:Array.isArray(value)&&(serialized2[encodedKey]=value.slice(0).reduce((encoded,value2)=>encoded.concat([`${encodedKey}=${escapeUri(value2)}`]),[]).sort().join("&"))}return keys3.sort().map(key3=>serialized2[key3]).filter(serialized3=>serialized3).join("&")};iso8601=time2=>toDate(time2).toISOString().replace(/\.\d{3}Z$/,"Z");toDate=time2=>"number"==typeof time2?new Date(1e3*time2):"string"==typeof time2?Number(time2)?new Date(1e3*Number(time2)):new Date(time2):time2;init_dist_es();SignatureV4Base=class{constructor({applyChecksum,credentials,region,service,sha256,uriEscapePath=!0}){__publicField(this,"service");__publicField(this,"regionProvider");__publicField(this,"credentialProvider");__publicField(this,"sha256");__publicField(this,"uriEscapePath");__publicField(this,"applyChecksum");this.service=service;this.sha256=sha256;this.uriEscapePath=uriEscapePath;this.applyChecksum="boolean"!=typeof applyChecksum||applyChecksum;this.regionProvider=normalizeProvider(region);this.credentialProvider=normalizeProvider(credentials)}createCanonicalRequest(request2,canonicalHeaders,payloadHash){const sortedHeaders=Object.keys(canonicalHeaders).sort();return`${request2.method}\n${this.getCanonicalPath(request2)}\n${getCanonicalQuery(request2)}\n${sortedHeaders.map(name=>`${name}:${canonicalHeaders[name]}`).join("\n")}\n\n${sortedHeaders.join(";")}\n${payloadHash}`}async createStringToSign(longDate,credentialScope,canonicalRequest,algorithmIdentifier){const hash3=new this.sha256;hash3.update(toUint8Array(canonicalRequest));return`${algorithmIdentifier}\n${longDate}\n${credentialScope}\n${toHex2(await hash3.digest())}`}getCanonicalPath({path:path2}){if(this.uriEscapePath){const normalizedPathSegments=[];for(const pathSegment of path2.split("/"))0!==(null==pathSegment?void 0:pathSegment.length)&&"."!==pathSegment&&(".."===pathSegment?normalizedPathSegments.pop():normalizedPathSegments.push(pathSegment));const normalizedPath=`${(null==path2?void 0:path2.startsWith("/"))?"/":""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length>0&&(null==path2?void 0:path2.endsWith("/"))?"/":""}`;return escapeUri(normalizedPath).replace(/%2F/g,"/")}return path2}validateResolvedCredentials(credentials){if("object"!=typeof credentials||"string"!=typeof credentials.accessKeyId||"string"!=typeof credentials.secretAccessKey)throw new Error("Resolved credential object is not valid")}formatDate(now3){const longDate=iso8601(now3).replace(/[\-:]/g,"");return{longDate,shortDate:longDate.slice(0,8)}}getCanonicalHeaderList(headers){return Object.keys(headers).sort().join(";")}};init_dist_es();SignatureV4=class extends SignatureV4Base{constructor({applyChecksum,credentials,region,service,sha256,uriEscapePath=!0}){super({applyChecksum,credentials,region,service,sha256,uriEscapePath});__publicField(this,"headerFormatter",new HeaderFormatter)}async presign(originalRequest,options={}){const{signingDate=new Date,expiresIn=3600,unsignableHeaders,unhoistableHeaders,signableHeaders,hoistableHeaders,signingRegion,signingService}=options,credentials=await this.credentialProvider();this.validateResolvedCredentials(credentials);const region=null!=signingRegion?signingRegion:await this.regionProvider(),{longDate,shortDate}=this.formatDate(signingDate);if(expiresIn>604800)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const scope=createScope(shortDate,region,null!=signingService?signingService:this.service),request2=moveHeadersToQuery(prepareRequest(originalRequest),{unhoistableHeaders,hoistableHeaders});credentials.sessionToken&&(request2.query["X-Amz-Security-Token"]=credentials.sessionToken);request2.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256";request2.query["X-Amz-Credential"]=`${credentials.accessKeyId}/${scope}`;request2.query[AMZ_DATE_QUERY_PARAM]=longDate;request2.query["X-Amz-Expires"]=expiresIn.toString(10);const canonicalHeaders=getCanonicalHeaders(request2,unsignableHeaders,signableHeaders);request2.query["X-Amz-SignedHeaders"]=this.getCanonicalHeaderList(canonicalHeaders);request2.query["X-Amz-Signature"]=await this.getSignature(longDate,scope,this.getSigningKey(credentials,region,shortDate,signingService),this.createCanonicalRequest(request2,canonicalHeaders,await getPayloadHash(originalRequest,this.sha256)));return request2}async sign(toSign,options){return"string"==typeof toSign?this.signString(toSign,options):toSign.headers&&toSign.payload?this.signEvent(toSign,options):toSign.message?this.signMessage(toSign,options):this.signRequest(toSign,options)}async signEvent({headers,payload},{signingDate=new Date,priorSignature,signingRegion,signingService}){const region=null!=signingRegion?signingRegion:await this.regionProvider(),{shortDate,longDate}=this.formatDate(signingDate),scope=createScope(shortDate,region,null!=signingService?signingService:this.service),hashedPayload=await getPayloadHash({headers:{},body:payload},this.sha256),hash3=new this.sha256;hash3.update(headers);const hashedHeaders=toHex2(await hash3.digest()),stringToSign=[EVENT_ALGORITHM_IDENTIFIER,longDate,scope,priorSignature,hashedHeaders,hashedPayload].join("\n");return this.signString(stringToSign,{signingDate,signingRegion:region,signingService})}async signMessage(signableMessage,{signingDate=new Date,signingRegion,signingService}){return this.signEvent({headers:this.headerFormatter.format(signableMessage.message.headers),payload:signableMessage.message.body},{signingDate,signingRegion,signingService,priorSignature:signableMessage.priorSignature}).then(signature=>({message:signableMessage.message,signature}))}async signString(stringToSign,{signingDate=new Date,signingRegion,signingService}={}){const credentials=await this.credentialProvider();this.validateResolvedCredentials(credentials);const region=null!=signingRegion?signingRegion:await this.regionProvider(),{shortDate}=this.formatDate(signingDate),hash3=new this.sha256(await this.getSigningKey(credentials,region,shortDate,signingService));hash3.update(toUint8Array(stringToSign));return toHex2(await hash3.digest())}async signRequest(requestToSign,{signingDate=new Date,signableHeaders,unsignableHeaders,signingRegion,signingService}={}){const credentials=await this.credentialProvider();this.validateResolvedCredentials(credentials);const region=null!=signingRegion?signingRegion:await this.regionProvider(),request2=prepareRequest(requestToSign),{longDate,shortDate}=this.formatDate(signingDate),scope=createScope(shortDate,region,null!=signingService?signingService:this.service);request2.headers[AMZ_DATE_HEADER]=longDate;credentials.sessionToken&&(request2.headers[TOKEN_HEADER]=credentials.sessionToken);const payloadHash=await getPayloadHash(request2,this.sha256);!hasHeader("x-amz-content-sha256",request2.headers)&&this.applyChecksum&&(request2.headers["x-amz-content-sha256"]=payloadHash);const canonicalHeaders=getCanonicalHeaders(request2,unsignableHeaders,signableHeaders),signature=await this.getSignature(longDate,scope,this.getSigningKey(credentials,region,shortDate,signingService),this.createCanonicalRequest(request2,canonicalHeaders,payloadHash));request2.headers.authorization=`AWS4-HMAC-SHA256 Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`;return request2}async getSignature(longDate,credentialScope,keyPromise,canonicalRequest){const stringToSign=await this.createStringToSign(longDate,credentialScope,canonicalRequest,"AWS4-HMAC-SHA256"),hash3=new this.sha256(await keyPromise);hash3.update(toUint8Array(stringToSign));return toHex2(await hash3.digest())}getSigningKey(credentials,region,shortDate,service){return getSigningKey(this.sha256,credentials,shortDate,region,service||this.service)}};resolveAwsSdkSigV4Config=config=>{let resolvedCredentials,inputCredentials=config.credentials,isUserSupplied=!!config.credentials;Object.defineProperty(config,"credentials",{set(credentials){credentials&&credentials!==inputCredentials&&credentials!==resolvedCredentials&&(isUserSupplied=!0);inputCredentials=credentials;const memoizedProvider=normalizeCredentialProvider(config,{credentials:inputCredentials,credentialDefaultProvider:config.credentialDefaultProvider}),boundProvider=bindCallerConfig(config,memoizedProvider);if(isUserSupplied&&!boundProvider.attributed){const isCredentialObject="object"==typeof inputCredentials&&null!==inputCredentials;resolvedCredentials=async options=>{const attributedCreds=await boundProvider(options);return!isCredentialObject||attributedCreds.$source&&0!==Object.keys(attributedCreds.$source).length?attributedCreds:setCredentialFeature(attributedCreds,"CREDENTIALS_CODE","e")};resolvedCredentials.memoized=boundProvider.memoized;resolvedCredentials.configBound=boundProvider.configBound;resolvedCredentials.attributed=!0}else resolvedCredentials=boundProvider},get:()=>resolvedCredentials,enumerable:!0,configurable:!0});config.credentials=inputCredentials;const{signingEscapePath=!0,systemClockOffset=config.systemClockOffset||0,sha256}=config;let signer;signer=config.signer?normalizeProvider2(config.signer):config.regionInfoProvider?()=>normalizeProvider2(config.region)().then(async region=>[await config.regionInfoProvider(region,{useFipsEndpoint:await config.useFipsEndpoint(),useDualstackEndpoint:await config.useDualstackEndpoint()})||{},region]).then(([regionInfo,region])=>{const{signingRegion,signingService}=regionInfo;config.signingRegion=config.signingRegion||signingRegion||region;config.signingName=config.signingName||signingService||config.serviceId;const params={...config,credentials:config.credentials,region:config.signingRegion,service:config.signingName,sha256,uriEscapePath:signingEscapePath};return new(config.signerConstructor||SignatureV4)(params)}):async authScheme=>{const signingRegion=(authScheme=Object.assign({},{name:"sigv4",signingName:config.signingName||config.defaultSigningName,signingRegion:await normalizeProvider2(config.region)(),properties:{}},authScheme)).signingRegion,signingService=authScheme.signingName;config.signingRegion=config.signingRegion||signingRegion;config.signingName=config.signingName||signingService||config.serviceId;const params={...config,credentials:config.credentials,region:config.signingRegion,service:config.signingName,sha256,uriEscapePath:signingEscapePath};return new(config.signerConstructor||SignatureV4)(params)};return Object.assign(config,{systemClockOffset,signingEscapePath,signer})};TEXT_ENCODER="function"==typeof TextEncoder?new TextEncoder:null;calculateBodyLength=body=>{if("string"==typeof body){if(TEXT_ENCODER)return TEXT_ENCODER.encode(body).byteLength;let len=body.length;for(let i2=len-1;i2>=0;i2--){const code=body.charCodeAt(i2);code>127&&code<=2047?len++:code>2047&&code<=65535&&(len+=2);code>=56320&&code<=57343&&i2--}return len}if("number"==typeof body.byteLength)return body.byteLength;if("number"==typeof body.size)return body.size;throw new Error(`Body Length computation failed for ${body}`)};getAllAliases=(name,aliases)=>{const _aliases=[];name&&_aliases.push(name);if(aliases)for(const alias of aliases)_aliases.push(alias);return _aliases};getMiddlewareNameWithAliases=(name,aliases)=>`${name||"anonymous"}${aliases&&aliases.length>0?` (a.k.a. ${aliases.join(",")})`:""}`;constructStack=()=>{let absoluteEntries=[],relativeEntries=[],identifyOnResolve=!1;const entriesNameSet=new Set,sort=entries2=>entries2.sort((a2,b3)=>stepWeights[b3.step]-stepWeights[a2.step]||priorityWeights[b3.priority||"normal"]-priorityWeights[a2.priority||"normal"]),removeByName=toRemove=>{let isRemoved=!1;const filterCb=entry=>{const aliases=getAllAliases(entry.name,entry.aliases);if(aliases.includes(toRemove)){isRemoved=!0;for(const alias of aliases)entriesNameSet.delete(alias);return!1}return!0};absoluteEntries=absoluteEntries.filter(filterCb);relativeEntries=relativeEntries.filter(filterCb);return isRemoved},removeByReference=toRemove=>{let isRemoved=!1;const filterCb=entry=>{if(entry.middleware===toRemove){isRemoved=!0;for(const alias of getAllAliases(entry.name,entry.aliases))entriesNameSet.delete(alias);return!1}return!0};absoluteEntries=absoluteEntries.filter(filterCb);relativeEntries=relativeEntries.filter(filterCb);return isRemoved},cloneTo=toStack=>{var _a8;absoluteEntries.forEach(entry=>{toStack.add(entry.middleware,{...entry})});relativeEntries.forEach(entry=>{toStack.addRelativeTo(entry.middleware,{...entry})});null==(_a8=toStack.identifyOnResolve)||_a8.call(toStack,stack2.identifyOnResolve());return toStack},expandRelativeMiddlewareList=from=>{const expandedMiddlewareList=[];from.before.forEach(entry=>{0===entry.before.length&&0===entry.after.length?expandedMiddlewareList.push(entry):expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry))});expandedMiddlewareList.push(from);from.after.reverse().forEach(entry=>{0===entry.before.length&&0===entry.after.length?expandedMiddlewareList.push(entry):expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry))});return expandedMiddlewareList},getMiddlewareList=(debug2=!1)=>{const normalizedAbsoluteEntries=[],normalizedRelativeEntries=[],normalizedEntriesNameMap={};absoluteEntries.forEach(entry=>{const normalizedEntry={...entry,before:[],after:[]};for(const alias of getAllAliases(normalizedEntry.name,normalizedEntry.aliases))normalizedEntriesNameMap[alias]=normalizedEntry;normalizedAbsoluteEntries.push(normalizedEntry)});relativeEntries.forEach(entry=>{const normalizedEntry={...entry,before:[],after:[]};for(const alias of getAllAliases(normalizedEntry.name,normalizedEntry.aliases))normalizedEntriesNameMap[alias]=normalizedEntry;normalizedRelativeEntries.push(normalizedEntry)});normalizedRelativeEntries.forEach(entry=>{if(entry.toMiddleware){const toMiddleware=normalizedEntriesNameMap[entry.toMiddleware];if(void 0===toMiddleware){if(debug2)return;throw new Error(`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name,entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`)}"after"===entry.relation&&toMiddleware.after.push(entry);"before"===entry.relation&&toMiddleware.before.push(entry)}});return sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList,expandedMiddlewareList)=>{wholeList.push(...expandedMiddlewareList);return wholeList},[])},stack2={add:(middleware,options={})=>{const{name,override,aliases:_aliases}=options,entry={step:"initialize",priority:"normal",middleware,...options},aliases=getAllAliases(name,_aliases);if(aliases.length>0){if(aliases.some(alias=>entriesNameSet.has(alias))){if(!override)throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name,_aliases)}'`);for(const alias of aliases){const toOverrideIndex=absoluteEntries.findIndex(entry2=>{var _a8;return entry2.name===alias||(null==(_a8=entry2.aliases)?void 0:_a8.some(a2=>a2===alias))});if(-1===toOverrideIndex)continue;const toOverride=absoluteEntries[toOverrideIndex];if(toOverride.step!==entry.step||entry.priority!==toOverride.priority)throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name,toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name,_aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.`);absoluteEntries.splice(toOverrideIndex,1)}}for(const alias of aliases)entriesNameSet.add(alias)}absoluteEntries.push(entry)},addRelativeTo:(middleware,options)=>{const{name,override,aliases:_aliases}=options,entry={middleware,...options},aliases=getAllAliases(name,_aliases);if(aliases.length>0){if(aliases.some(alias=>entriesNameSet.has(alias))){if(!override)throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name,_aliases)}'`);for(const alias of aliases){const toOverrideIndex=relativeEntries.findIndex(entry2=>{var _a8;return entry2.name===alias||(null==(_a8=entry2.aliases)?void 0:_a8.some(a2=>a2===alias))});if(-1===toOverrideIndex)continue;const toOverride=relativeEntries[toOverrideIndex];if(toOverride.toMiddleware!==entry.toMiddleware||toOverride.relation!==entry.relation)throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name,toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name,_aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.`);relativeEntries.splice(toOverrideIndex,1)}}for(const alias of aliases)entriesNameSet.add(alias)}relativeEntries.push(entry)},clone:()=>cloneTo(constructStack()),use:plugin3=>{plugin3.applyToStack(stack2)},remove:toRemove=>"string"==typeof toRemove?removeByName(toRemove):removeByReference(toRemove),removeByTag:toRemove=>{let isRemoved=!1;const filterCb=entry=>{const{tags,name,aliases:_aliases}=entry;if(tags&&tags.includes(toRemove)){const aliases=getAllAliases(name,_aliases);for(const alias of aliases)entriesNameSet.delete(alias);isRemoved=!0;return!1}return!0};absoluteEntries=absoluteEntries.filter(filterCb);relativeEntries=relativeEntries.filter(filterCb);return isRemoved},concat:from=>{var _a8,_b5;const cloned=cloneTo(constructStack());cloned.use(from);cloned.identifyOnResolve(identifyOnResolve||cloned.identifyOnResolve()||null!=(_b5=null==(_a8=from.identifyOnResolve)?void 0:_a8.call(from))&&_b5);return cloned},applyToStack:cloneTo,identify:()=>getMiddlewareList(!0).map(mw=>{var _a8;const step=null!=(_a8=mw.step)?_a8:mw.relation+" "+mw.toMiddleware;return getMiddlewareNameWithAliases(mw.name,mw.aliases)+" - "+step}),identifyOnResolve(toggle){"boolean"==typeof toggle&&(identifyOnResolve=toggle);return identifyOnResolve},resolve:(handler,context2)=>{for(const middleware of getMiddlewareList().map(entry=>entry.middleware).reverse())handler=middleware(handler,context2);identifyOnResolve&&console.log(stack2.identify());return handler}};return stack2};stepWeights={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1};priorityWeights={high:3,normal:2,low:1};Client=class{constructor(config){__publicField(this,"config");__publicField(this,"middlewareStack",constructStack());__publicField(this,"initConfig");__publicField(this,"handlers");this.config=config;const{protocol,protocolSettings}=config;protocolSettings&&"function"==typeof protocol&&(config.protocol=new protocol(protocolSettings))}send(command,optionsOrCb,cb2){const options="function"!=typeof optionsOrCb?optionsOrCb:void 0,callback="function"==typeof optionsOrCb?optionsOrCb:cb2;let handler;if(void 0===options&&!0===this.config.cacheMiddleware){this.handlers||(this.handlers=new WeakMap);const handlers3=this.handlers;if(handlers3.has(command.constructor))handler=handlers3.get(command.constructor);else{handler=command.resolveMiddleware(this.middlewareStack,this.config,options);handlers3.set(command.constructor,handler)}}else{delete this.handlers;handler=command.resolveMiddleware(this.middlewareStack,this.config,options)}if(!callback)return handler(command).then(result=>result.output);handler(command).then(result=>callback(null,result.output),err3=>callback(err3)).catch(()=>{})}destroy(){var _a8,_b5,_c3;null==(_c3=null==(_b5=null==(_a8=this.config)?void 0:_a8.requestHandler)?void 0:_b5.destroy)||_c3.call(_b5);delete this.handlers}};SENSITIVE_STRING="***SensitiveInformation***";Command=class{constructor(){__publicField(this,"middlewareStack",constructStack());__publicField(this,"schema")}static classBuilder(){return new ClassBuilder}resolveMiddlewareWithContext(clientStack,configuration,options,{middlewareFn,clientName,commandName,inputFilterSensitiveLog,outputFilterSensitiveLog,smithyContext,additionalContext,CommandCtor}){for(const mw of middlewareFn.bind(this)(CommandCtor,clientStack,configuration,options))this.middlewareStack.use(mw);const stack2=clientStack.concat(this.middlewareStack),{logger:logger2}=configuration,handlerExecutionContext={logger:logger2,clientName,commandName,inputFilterSensitiveLog,outputFilterSensitiveLog,[SMITHY_CONTEXT_KEY]:{commandInstance:this,...smithyContext},...additionalContext},{requestHandler}=configuration;return stack2.resolve(request2=>requestHandler.handle(request2.request,options||{}),handlerExecutionContext)}};ClassBuilder=class{constructor(){__publicField(this,"_init",()=>{});__publicField(this,"_ep",{});__publicField(this,"_middlewareFn",()=>[]);__publicField(this,"_commandName","");__publicField(this,"_clientName","");__publicField(this,"_additionalContext",{});__publicField(this,"_smithyContext",{});__publicField(this,"_inputFilterSensitiveLog");__publicField(this,"_outputFilterSensitiveLog");__publicField(this,"_serializer",null);__publicField(this,"_deserializer",null);__publicField(this,"_operationSchema")}init(cb2){this._init=cb2}ep(endpointParameterInstructions){this._ep=endpointParameterInstructions;return this}m(middlewareSupplier){this._middlewareFn=middlewareSupplier;return this}s(service,operation2,smithyContext={}){this._smithyContext={service,operation:operation2,...smithyContext};return this}c(additionalContext={}){this._additionalContext=additionalContext;return this}n(clientName,commandName){this._clientName=clientName;this._commandName=commandName;return this}f(inputFilter=_=>_,outputFilter=_=>_){this._inputFilterSensitiveLog=inputFilter;this._outputFilterSensitiveLog=outputFilter;return this}ser(serializer){this._serializer=serializer;return this}de(deserializer){this._deserializer=deserializer;return this}sc(operation2){this._operationSchema=operation2;this._smithyContext.operationSchema=operation2;return this}build(){const closure=this;let CommandRef;return CommandRef=class extends Command{constructor(...[input]){super();__publicField(this,"input");__publicField(this,"serialize",closure._serializer);__publicField(this,"deserialize",closure._deserializer);this.input=null!=input?input:{};closure._init(this);this.schema=closure._operationSchema}static getEndpointParameterInstructions(){return closure._ep}resolveMiddleware(stack2,configuration,options){var _a8,_b5,_c3,_d2;const op=closure._operationSchema,input=null!=(_a8=null==op?void 0:op[4])?_a8:null==op?void 0:op.input,output=null!=(_b5=null==op?void 0:op[5])?_b5:null==op?void 0:op.output;return this.resolveMiddlewareWithContext(stack2,configuration,options,{CommandCtor:CommandRef,middlewareFn:closure._middlewareFn,clientName:closure._clientName,commandName:closure._commandName,inputFilterSensitiveLog:null!=(_c3=closure._inputFilterSensitiveLog)?_c3:op?schemaLogFilter.bind(null,input):_=>_,outputFilterSensitiveLog:null!=(_d2=closure._outputFilterSensitiveLog)?_d2:op?schemaLogFilter.bind(null,output):_=>_,smithyContext:closure._smithyContext,additionalContext:closure._additionalContext})}}}};createAggregatedClient=(commands2,Client2,options)=>{for(const[command,CommandCtor]of Object.entries(commands2)){const methodImpl=async function(args,optionsOrCb,cb2){const command2=new CommandCtor(args);if("function"==typeof optionsOrCb)this.send(command2,optionsOrCb);else{if("function"!=typeof cb2)return this.send(command2,optionsOrCb);if("object"!=typeof optionsOrCb)throw new Error("Expected http options but got "+typeof optionsOrCb);this.send(command2,optionsOrCb||{},cb2)}},methodName=(command[0].toLowerCase()+command.slice(1)).replace(/Command$/,"");Client2.prototype[methodName]=methodImpl}const{paginators:paginators2={},waiters:waiters2={}}=null!=options?options:{};for(const[paginatorName,paginatorFn]of Object.entries(paginators2))void 0===Client2.prototype[paginatorName]&&(Client2.prototype[paginatorName]=function(commandInput={},paginationConfiguration,...rest){return paginatorFn({...paginationConfiguration,client:this},commandInput,...rest)});for(const[waiterName,waiterFn]of Object.entries(waiters2))void 0===Client2.prototype[waiterName]&&(Client2.prototype[waiterName]=async function(commandInput={},waiterConfiguration,...rest){let config=waiterConfiguration;"number"==typeof waiterConfiguration&&(config={maxWaitTime:waiterConfiguration});return waiterFn({...config,client:this},commandInput,...rest)})};ServiceException=class _ServiceException extends Error{constructor(options){super(options.message);__publicField(this,"$fault");__publicField(this,"$response");__publicField(this,"$retryable");__publicField(this,"$metadata");Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype);this.name=options.name;this.$fault=options.$fault;this.$metadata=options.$metadata}static isInstance(value){if(!value)return!1;const candidate=value;return _ServiceException.prototype.isPrototypeOf(candidate)||Boolean(candidate.$fault)&&Boolean(candidate.$metadata)&&("client"===candidate.$fault||"server"===candidate.$fault)}static[Symbol.hasInstance](instance){if(!instance)return!1;const candidate=instance;return this===_ServiceException?_ServiceException.isInstance(instance):!!_ServiceException.isInstance(instance)&&(candidate.name&&this.name?this.prototype.isPrototypeOf(instance)||candidate.name===this.name:this.prototype.isPrototypeOf(instance))}};decorateServiceException=(exception,additions={})=>{Object.entries(additions).filter(([,v2])=>void 0!==v2).forEach(([k2,v2])=>{null!=exception[k2]&&""!==exception[k2]||(exception[k2]=v2)});const message=exception.message||exception.Message||"UnknownError";exception.message=message;delete exception.Message;return exception};loadConfigsForDefaultMode=mode=>{switch(mode){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}};knownAlgorithms=Object.values(AlgorithmId);getChecksumConfiguration2=runtimeConfig=>{var _a8;const checksumAlgorithms=[];for(const id in AlgorithmId){const algorithmId=AlgorithmId[id];void 0!==runtimeConfig[algorithmId]&&checksumAlgorithms.push({algorithmId:()=>algorithmId,checksumConstructor:()=>runtimeConfig[algorithmId]})}for(const[id,ChecksumCtor]of Object.entries(null!=(_a8=runtimeConfig.checksumAlgorithms)?_a8:{}))checksumAlgorithms.push({algorithmId:()=>id,checksumConstructor:()=>ChecksumCtor});return{addChecksumAlgorithm(algo2){var _a9;runtimeConfig.checksumAlgorithms=null!=(_a9=runtimeConfig.checksumAlgorithms)?_a9:{};const id=algo2.algorithmId(),ctor=algo2.checksumConstructor();knownAlgorithms.includes(id)?runtimeConfig.checksumAlgorithms[id.toUpperCase()]=ctor:runtimeConfig.checksumAlgorithms[id]=ctor;checksumAlgorithms.push(algo2)},checksumAlgorithms:()=>checksumAlgorithms}};resolveChecksumRuntimeConfig2=clientConfig=>{const runtimeConfig={};clientConfig.checksumAlgorithms().forEach(checksumAlgorithm=>{const id=checksumAlgorithm.algorithmId();knownAlgorithms.includes(id)&&(runtimeConfig[id]=checksumAlgorithm.checksumConstructor())});return runtimeConfig};getRetryConfiguration=runtimeConfig=>({setRetryStrategy(retryStrategy){runtimeConfig.retryStrategy=retryStrategy},retryStrategy:()=>runtimeConfig.retryStrategy});resolveRetryRuntimeConfig=retryStrategyConfiguration=>{const runtimeConfig={};runtimeConfig.retryStrategy=retryStrategyConfiguration.retryStrategy();return runtimeConfig};getDefaultExtensionConfiguration=runtimeConfig=>Object.assign(getChecksumConfiguration2(runtimeConfig),getRetryConfiguration(runtimeConfig));resolveDefaultRuntimeConfig=config=>Object.assign(resolveChecksumRuntimeConfig2(config),resolveRetryRuntimeConfig(config));getValueFromTextNode=obj=>{for(const key3 in obj)obj.hasOwnProperty(key3)&&void 0!==obj[key3]["#text"]?obj[key3]=obj[key3]["#text"]:"object"==typeof obj[key3]&&null!==obj[key3]&&(obj[key3]=getValueFromTextNode(obj[key3]));return obj};NoOpLogger=class{trace(){}debug(){}info(){}warn(){}error(){}};ProtocolLib=class{constructor(queryCompat=!1){__publicField(this,"queryCompat");__publicField(this,"errorRegistry");this.queryCompat=queryCompat}resolveRestContentType(defaultContentType,inputSchema){const members=inputSchema.getMemberSchemas(),httpPayloadMember=Object.values(members).find(m3=>!!m3.getMergedTraits().httpPayload);return httpPayloadMember?httpPayloadMember.getMergedTraits().mediaType||(httpPayloadMember.isStringSchema()?"text/plain":httpPayloadMember.isBlobSchema()?"application/octet-stream":defaultContentType):!inputSchema.isUnitSchema()&&Object.values(members).find(m3=>{const{httpQuery,httpQueryParams,httpHeader,httpLabel,httpPrefixHeaders}=m3.getMergedTraits();return!(httpQuery||httpQueryParams||httpHeader||httpLabel||void 0!==httpPrefixHeaders)})?defaultContentType:void 0}async getErrorSchemaOrThrowBaseException(errorIdentifier,defaultNamespace,response,dataObject,metadata,getErrorSchema){var _a8,_b5,_c3,_d2,_e2,_f,_g,_h2,_i2;let errorName=errorIdentifier;errorIdentifier.includes("#")&&([,errorName]=errorIdentifier.split("#"));const errorMetadata={$metadata:metadata,$fault:response.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:null!=(_a8=null==getErrorSchema?void 0:getErrorSchema(this.errorRegistry,errorName))?_a8:this.errorRegistry.getSchema(errorIdentifier),errorMetadata}}catch(e3){dataObject.message=null!=(_c3=null!=(_b5=dataObject.message)?_b5:dataObject.Message)?_c3:"UnknownError";const synthetic=this.errorRegistry,baseExceptionSchema=synthetic.getBaseException();if(baseExceptionSchema){const ErrorCtor=null!=(_d2=synthetic.getErrorCtor(baseExceptionSchema))?_d2:Error;throw this.decorateServiceException(Object.assign(new ErrorCtor({name:errorName}),errorMetadata),dataObject)}const d4=dataObject,message=null!=(_i2=null!=(_g=null!=(_e2=null==d4?void 0:d4.message)?_e2:null==d4?void 0:d4.Message)?_g:null==(_f=null==d4?void 0:d4.Error)?void 0:_f.Message)?_i2:null==(_h2=null==d4?void 0:d4.Error)?void 0:_h2.message;throw this.decorateServiceException(Object.assign(new Error(message),{name:errorName},errorMetadata),dataObject)}}compose(composite,errorIdentifier,defaultNamespace){let namespace=defaultNamespace;errorIdentifier.includes("#")&&([namespace]=errorIdentifier.split("#"));const staticRegistry=TypeRegistry.for(namespace),defaultSyntheticRegistry=TypeRegistry.for("smithy.ts.sdk.synthetic."+defaultNamespace);composite.copyFrom(staticRegistry);composite.copyFrom(defaultSyntheticRegistry);this.errorRegistry=composite}decorateServiceException(exception,additions={}){var _a8,_b5,_c3,_d2,_e2,_f,_g;if(this.queryCompat){const msg=null!=(_a8=exception.Message)?_a8:additions.Message,error=decorateServiceException(exception,additions);msg&&(error.message=msg);error.Error={...error.Error,Type:null==(_b5=error.Error)?void 0:_b5.Type,Code:null==(_c3=error.Error)?void 0:_c3.Code,Message:null!=(_g=null!=(_f=null==(_d2=error.Error)?void 0:_d2.message)?_f:null==(_e2=error.Error)?void 0:_e2.Message)?_g:msg};const reqId=error.$metadata.requestId;reqId&&(error.RequestId=reqId);return error}return decorateServiceException(exception,additions)}setQueryCompatError(output,response){var _a8;const queryErrorHeader=null==(_a8=response.headers)?void 0:_a8["x-amzn-query-error"];if(void 0!==output&&null!=queryErrorHeader){const[Code,Type]=queryErrorHeader.split(";"),entries2=Object.entries(output),Error2={Code,Type};Object.assign(output,Error2);for(const[k2,v2]of entries2)Error2["message"===k2?"Message":k2]=v2;delete Error2.__type;output.Error=Error2}}queryCompatOutput(queryCompatErrorData,errorData){queryCompatErrorData.Error&&(errorData.Error=queryCompatErrorData.Error);queryCompatErrorData.Type&&(errorData.Type=queryCompatErrorData.Type);queryCompatErrorData.Code&&(errorData.Code=queryCompatErrorData.Code)}findQueryCompatibleError(registry,errorName){try{return registry.getSchema(errorName)}catch(e3){return registry.find(schema=>{var _a8;return(null==(_a8=NormalizedSchema.of(schema).getMergedTraits().awsQueryError)?void 0:_a8[0])===errorName})}}};SerdeContextConfig=class{constructor(){__publicField(this,"serdeContext")}setSerdeContext(serdeContext){this.serdeContext=serdeContext}};UnionSerde=class{constructor(from,to){__publicField(this,"from");__publicField(this,"to");__publicField(this,"keys");this.from=from;this.to=to;this.keys=new Set(Object.keys(this.from).filter(k2=>"__type"!==k2))}mark(key3){this.keys.delete(key3)}hasUnknown(){return 1===this.keys.size&&0===Object.keys(this.to).length}writeUnknown(){if(this.hasUnknown()){const k2=this.keys.values().next().value,v2=this.from[k2];this.to.$unknown=[k2,v2]}}};init_dist_es();ATTR_ESCAPE_RE=/[&<>"]/g;ATTR_ESCAPE_MAP={"&":"&","<":"<",">":">",'"':"""};ELEMENT_ESCAPE_RE=/[&"'<>\r\n\u0085\u2028]/g;ELEMENT_ESCAPE_MAP={"&":"&",'"':""","'":"'","<":"<",">":">","\r":" ","\n":" ","…":"…","\u2028":"
"};XmlText=class{constructor(value){__publicField(this,"value");this.value=value}toString(){return escapeElement(""+this.value)}};XmlNode=class _XmlNode{constructor(name,children=[]){__publicField(this,"name");__publicField(this,"children");__publicField(this,"attributes",{});this.name=name;this.children=children}static of(name,childText,withName){const node=new _XmlNode(name);void 0!==childText&&node.addChildNode(new XmlText(childText));void 0!==withName&&node.withName(withName);return node}withName(name){this.name=name;return this}addAttribute(name,value){this.attributes[name]=value;return this}addChildNode(child2){this.children.push(child2);return this}removeAttribute(name){delete this.attributes[name];return this}n(name){this.name=name;return this}c(child2){this.children.push(child2);return this}a(name,value){null!=value&&(this.attributes[name]=value);return this}cc(input,field,withName=field){if(null!=input[field]){const node=_XmlNode.of(field,input[field]).withName(withName);this.c(node)}}l(input,listName,memberName,valueProvider){null!=input[listName]&&valueProvider().map(node=>{node.withName(memberName);this.c(node)})}lc(input,listName,memberName,valueProvider){if(null!=input[listName]){const nodes=valueProvider(),containerNode=new _XmlNode(memberName);nodes.map(node=>{containerNode.c(node)});this.c(containerNode)}}toString(){const hasChildren=Boolean(this.children.length);let xmlText=`<${this.name}`;const attributes=this.attributes;for(const attributeName of Object.keys(attributes)){const attribute=attributes[attributeName];null!=attribute&&(xmlText+=` ${attributeName}="${escapeAttribute(""+attribute)}"`)}return xmlText+(hasChildren?`>${this.children.map(c3=>c3.toString()).join("")}`:"/>")}};init_dist_es();XmlShapeDeserializer=class extends SerdeContextConfig{constructor(settings){super();__publicField(this,"settings");__publicField(this,"stringDeserializer");this.settings=settings;this.stringDeserializer=new FromStringShapeDeserializer(settings)}setSerdeContext(serdeContext){this.serdeContext=serdeContext;this.stringDeserializer.setSerdeContext(serdeContext)}read(schema,bytes,key3){var _a8,_b5;const ns=NormalizedSchema.of(schema),memberSchemas=ns.getMemberSchemas();if(ns.isStructSchema()&&ns.isMemberSchema()&&Object.values(memberSchemas).find(memberNs=>!!memberNs.getMemberTraits().eventPayload)){const output={},memberName=Object.keys(memberSchemas)[0];memberSchemas[memberName].isBlobSchema()?output[memberName]=bytes:output[memberName]=this.read(memberSchemas[memberName],bytes);return output}const xmlString=(null!=(_b5=null==(_a8=this.serdeContext)?void 0:_a8.utf8Encoder)?_b5:toUtf8)(bytes),parsedObject=this.parseXml(xmlString);return this.readSchema(schema,key3?parsedObject[key3]:parsedObject)}readSchema(_schema,value){var _a8,_b5,_c3,_d2,_e2,_f;const ns=NormalizedSchema.of(_schema);if(ns.isUnitSchema())return;const traits=ns.getMergedTraits();if(ns.isListSchema()&&!Array.isArray(value))return this.readSchema(ns,[value]);if(null==value)return value;if("object"==typeof value){const flat=!!traits.xmlFlattened;if(ns.isListSchema()){const listValue=ns.getValueSchema(),buffer2=[],sourceKey=null!=(_a8=listValue.getMergedTraits().xmlName)?_a8:"member",source2=flat?value:(null!=(_b5=value[0])?_b5:value)[sourceKey];if(null==source2)return buffer2;const sourceArray=Array.isArray(source2)?source2:[source2];for(const v2 of sourceArray)buffer2.push(this.readSchema(listValue,v2));return buffer2}const buffer={};if(ns.isMapSchema()){const keyNs=ns.getKeySchema(),memberNs=ns.getValueSchema();let entries2;entries2=flat?Array.isArray(value)?value:[value]:Array.isArray(value.entry)?value.entry:[value.entry];const keyProperty=null!=(_c3=keyNs.getMergedTraits().xmlName)?_c3:"key",valueProperty=null!=(_d2=memberNs.getMergedTraits().xmlName)?_d2:"value";for(const entry of entries2){const key3=entry[keyProperty],value2=entry[valueProperty];buffer[key3]=this.readSchema(memberNs,value2)}return buffer}if(ns.isStructSchema()){const union=ns.isUnionSchema();let unionSerde;union&&(unionSerde=new UnionSerde(value,buffer));for(const[memberName,memberSchema]of ns.structIterator()){const memberTraits=memberSchema.getMergedTraits(),xmlObjectKey=memberTraits.httpPayload?null!=(_f=memberTraits.xmlName)?_f:memberSchema.getName():null!=(_e2=memberSchema.getMemberTraits().xmlName)?_e2:memberName;union&&unionSerde.mark(xmlObjectKey);null!=value[xmlObjectKey]&&(buffer[memberName]=this.readSchema(memberSchema,value[xmlObjectKey]))}union&&unionSerde.writeUnknown();return buffer}if(ns.isDocumentSchema())return value;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns.getName(!0)}`)}return ns.isListSchema()?[]:ns.isMapSchema()||ns.isStructSchema()?{}:this.stringDeserializer.read(ns,value)}parseXml(xml){if(xml.length){let parsedObj;try{parsedObj=parseXML(xml)}catch(e3){e3&&"object"==typeof e3&&Object.defineProperty(e3,"$responseBodyText",{value:xml});throw e3}const textNodeName="#text",key3=Object.keys(parsedObj)[0],parsedObjToReturn=parsedObj[key3];if(parsedObjToReturn[textNodeName]){parsedObjToReturn[key3]=parsedObjToReturn[textNodeName];delete parsedObjToReturn[textNodeName]}return getValueFromTextNode(parsedObjToReturn)}return{}}};loadRestXmlErrorCode=(output,data)=>{var _a8;return void 0!==(null==(_a8=null==data?void 0:data.Error)?void 0:_a8.Code)?data.Error.Code:void 0!==(null==data?void 0:data.Code)?data.Code:404==output.statusCode?"NotFound":void 0};XmlShapeSerializer=class extends SerdeContextConfig{constructor(settings){super();__publicField(this,"settings");__publicField(this,"stringBuffer");__publicField(this,"byteBuffer");__publicField(this,"buffer");this.settings=settings}write(schema,value){var _a8,_b5;const ns=NormalizedSchema.of(schema);if(ns.isStringSchema()&&"string"==typeof value)this.stringBuffer=value;else if(ns.isBlobSchema())this.byteBuffer="byteLength"in value?value:(null!=(_b5=null==(_a8=this.serdeContext)?void 0:_a8.base64Decoder)?_b5:fromBase64)(value);else{this.buffer=this.writeStruct(ns,value,void 0);const traits=ns.getMergedTraits();traits.httpPayload&&!traits.xmlName&&this.buffer.withName(ns.getName())}}flush(){var _a8;if(void 0!==this.byteBuffer){const bytes=this.byteBuffer;delete this.byteBuffer;return bytes}if(void 0!==this.stringBuffer){const str=this.stringBuffer;delete this.stringBuffer;return str}const buffer=this.buffer;this.settings.xmlNamespace&&((null==(_a8=null==buffer?void 0:buffer.attributes)?void 0:_a8.xmlns)||buffer.addAttribute("xmlns",this.settings.xmlNamespace));delete this.buffer;return buffer.toString()}writeStruct(ns,value,parentXmlns){var _a8,_b5,_c3,_d2;const traits=ns.getMergedTraits(),name=ns.isMemberSchema()&&!traits.httpPayload?null!=(_a8=ns.getMemberTraits().xmlName)?_a8:ns.getMemberName():null!=(_b5=traits.xmlName)?_b5:ns.getName();if(!name||!ns.isStructSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(!0)}.`);const structXmlNode=XmlNode.of(name),[xmlnsAttr,xmlns]=this.getXmlnsAttribute(ns,parentXmlns);for(const[memberName,memberSchema]of ns.structIterator()){const val=value[memberName];if(null!=val||memberSchema.isIdempotencyToken()){if(memberSchema.getMergedTraits().xmlAttribute){structXmlNode.addAttribute(null!=(_c3=memberSchema.getMergedTraits().xmlName)?_c3:memberName,this.writeSimple(memberSchema,val));continue}if(memberSchema.isListSchema())this.writeList(memberSchema,val,structXmlNode,xmlns);else if(memberSchema.isMapSchema())this.writeMap(memberSchema,val,structXmlNode,xmlns);else if(memberSchema.isStructSchema())structXmlNode.addChildNode(this.writeStruct(memberSchema,val,xmlns));else{const memberNode=XmlNode.of(null!=(_d2=memberSchema.getMergedTraits().xmlName)?_d2:memberSchema.getMemberName());this.writeSimpleInto(memberSchema,val,memberNode,xmlns);structXmlNode.addChildNode(memberNode)}}}const{$unknown}=value;if($unknown&&ns.isUnionSchema()&&Array.isArray($unknown)&&1===Object.keys(value).length){const[k2,v2]=$unknown,node=XmlNode.of(k2);if("string"!=typeof v2){if(!(value instanceof XmlNode||value instanceof XmlText))throw new Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");structXmlNode.addChildNode(value)}this.writeSimpleInto(0,v2,node,xmlns);structXmlNode.addChildNode(node)}xmlns&&structXmlNode.addAttribute(xmlnsAttr,xmlns);return structXmlNode}writeList(listMember,array,container,parentXmlns){var _a8;if(!listMember.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(!0)}`);const listTraits=listMember.getMergedTraits(),listValueSchema=listMember.getValueSchema(),listValueTraits=listValueSchema.getMergedTraits(),sparse=!!listValueTraits.sparse,flat=!!listTraits.xmlFlattened,[xmlnsAttr,xmlns]=this.getXmlnsAttribute(listMember,parentXmlns),writeItem=(container2,value)=>{var _a9,_b5,_c3,_d2;if(listValueSchema.isListSchema())this.writeList(listValueSchema,Array.isArray(value)?value:[value],container2,xmlns);else if(listValueSchema.isMapSchema())this.writeMap(listValueSchema,value,container2,xmlns);else if(listValueSchema.isStructSchema()){const struct=this.writeStruct(listValueSchema,value,xmlns);container2.addChildNode(struct.withName(flat?null!=(_a9=listTraits.xmlName)?_a9:listMember.getMemberName():null!=(_b5=listValueTraits.xmlName)?_b5:"member"))}else{const listItemNode=XmlNode.of(flat?null!=(_c3=listTraits.xmlName)?_c3:listMember.getMemberName():null!=(_d2=listValueTraits.xmlName)?_d2:"member");this.writeSimpleInto(listValueSchema,value,listItemNode,xmlns);container2.addChildNode(listItemNode)}};if(flat)for(const value of array)(sparse||null!=value)&&writeItem(container,value);else{const listNode=XmlNode.of(null!=(_a8=listTraits.xmlName)?_a8:listMember.getMemberName());xmlns&&listNode.addAttribute(xmlnsAttr,xmlns);for(const value of array)(sparse||null!=value)&&writeItem(listNode,value);container.addChildNode(listNode)}}writeMap(mapMember,map3,container,parentXmlns,containerIsMap=!1){var _a8,_b5,_c3,_d2;if(!mapMember.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(!0)}`);const mapTraits=mapMember.getMergedTraits(),mapKeySchema=mapMember.getKeySchema(),keyTag=null!=(_a8=mapKeySchema.getMergedTraits().xmlName)?_a8:"key",mapValueSchema=mapMember.getValueSchema(),mapValueTraits=mapValueSchema.getMergedTraits(),valueTag=null!=(_b5=mapValueTraits.xmlName)?_b5:"value",sparse=!!mapValueTraits.sparse,flat=!!mapTraits.xmlFlattened,[xmlnsAttr,xmlns]=this.getXmlnsAttribute(mapMember,parentXmlns),addKeyValue=(entry,key3,val)=>{const keyNode=XmlNode.of(keyTag,key3),[keyXmlnsAttr,keyXmlns]=this.getXmlnsAttribute(mapKeySchema,xmlns);keyXmlns&&keyNode.addAttribute(keyXmlnsAttr,keyXmlns);entry.addChildNode(keyNode);let valueNode=XmlNode.of(valueTag);mapValueSchema.isListSchema()?this.writeList(mapValueSchema,val,valueNode,xmlns):mapValueSchema.isMapSchema()?this.writeMap(mapValueSchema,val,valueNode,xmlns,!0):mapValueSchema.isStructSchema()?valueNode=this.writeStruct(mapValueSchema,val,xmlns):this.writeSimpleInto(mapValueSchema,val,valueNode,xmlns);entry.addChildNode(valueNode)};if(flat){for(const[key3,val]of Object.entries(map3))if(sparse||null!=val){const entry=XmlNode.of(null!=(_c3=mapTraits.xmlName)?_c3:mapMember.getMemberName());addKeyValue(entry,key3,val);container.addChildNode(entry)}}else{let mapNode;if(!containerIsMap){mapNode=XmlNode.of(null!=(_d2=mapTraits.xmlName)?_d2:mapMember.getMemberName());xmlns&&mapNode.addAttribute(xmlnsAttr,xmlns);container.addChildNode(mapNode)}for(const[key3,val]of Object.entries(map3))if(sparse||null!=val){const entry=XmlNode.of("entry");addKeyValue(entry,key3,val);(containerIsMap?container:mapNode).addChildNode(entry)}}}writeSimple(_schema,value){var _a8,_b5;if(null===value)throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");const ns=NormalizedSchema.of(_schema);let nodeContents=null;if(value&&"object"==typeof value)if(ns.isBlobSchema())nodeContents=(null!=(_b5=null==(_a8=this.serdeContext)?void 0:_a8.base64Encoder)?_b5:toBase64)(value);else{if(!(ns.isTimestampSchema()&&value instanceof Date)){if(ns.isBigDecimalSchema()&&value)return value instanceof NumericValue?value.string:String(value);throw ns.isMapSchema()||ns.isListSchema()?new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."):new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(!0)}`)}switch(determineTimestampFormat(ns,this.settings)){case 5:nodeContents=value.toISOString().replace(".000Z","Z");break;case 6:nodeContents=dateToUtcString(value);break;case 7:nodeContents=String(value.getTime()/1e3);break;default:console.warn("Missing timestamp format, using http date",value);nodeContents=dateToUtcString(value);break}}(ns.isBooleanSchema()||ns.isNumericSchema()||ns.isBigIntegerSchema()||ns.isBigDecimalSchema())&&(nodeContents=String(value));ns.isStringSchema()&&(nodeContents=void 0===value&&ns.isIdempotencyToken()?v4():String(value));if(null===nodeContents)throw new Error(`Unhandled schema-value pair ${ns.getName(!0)}=${value}`);return nodeContents}writeSimpleInto(_schema,value,into,parentXmlns){const nodeContents=this.writeSimple(_schema,value),ns=NormalizedSchema.of(_schema),content=new XmlText(nodeContents),[xmlnsAttr,xmlns]=this.getXmlnsAttribute(ns,parentXmlns);xmlns&&into.addAttribute(xmlnsAttr,xmlns);into.addChildNode(content)}getXmlnsAttribute(ns,parentXmlns){var _a8;const traits=ns.getMergedTraits(),[prefix,xmlns]=null!=(_a8=traits.xmlNamespace)?_a8:[];return xmlns&&xmlns!==parentXmlns?[prefix?`xmlns:${prefix}`:"xmlns",xmlns]:[void 0,void 0]}};XmlCodec=class extends SerdeContextConfig{constructor(settings){super();__publicField(this,"settings");this.settings=settings}createSerializer(){const serializer=new XmlShapeSerializer(this.settings);serializer.setSerdeContext(this.serdeContext);return serializer}createDeserializer(){const deserializer=new XmlShapeDeserializer(this.settings);deserializer.setSerdeContext(this.serdeContext);return deserializer}};AwsRestXmlProtocol=class extends HttpBindingProtocol{constructor(options){super(options);__publicField(this,"codec");__publicField(this,"serializer");__publicField(this,"deserializer");__publicField(this,"mixin",new ProtocolLib);const settings={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:options.xmlNamespace,serviceNamespace:options.defaultNamespace};this.codec=new XmlCodec(settings);this.serializer=new HttpInterceptingShapeSerializer(this.codec.createSerializer(),settings);this.deserializer=new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(),settings);this.compositeErrorRegistry}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(operationSchema,input,context2){const request2=await super.serializeRequest(operationSchema,input,context2),inputSchema=NormalizedSchema.of(operationSchema.input);if(!request2.headers["content-type"]){const contentType=this.mixin.resolveRestContentType(this.getDefaultContentType(),inputSchema);contentType&&(request2.headers["content-type"]=contentType)}"string"!=typeof request2.body||request2.headers["content-type"]!==this.getDefaultContentType()||request2.body.startsWith("'+request2.body);return request2}async deserializeResponse(operationSchema,context2,response){return super.deserializeResponse(operationSchema,context2,response)}async handleError(operationSchema,context2,response,dataObject,metadata){var _a8,_b5,_c3,_d2,_e2,_f,_g,_h2,_i2,_j,_k;const errorIdentifier=null!=(_a8=loadRestXmlErrorCode(response,dataObject))?_a8:"Unknown";this.mixin.compose(this.compositeErrorRegistry,errorIdentifier,this.options.defaultNamespace);if(dataObject.Error&&"object"==typeof dataObject.Error)for(const key3 of Object.keys(dataObject.Error)){dataObject[key3]=dataObject.Error[key3];"message"===key3.toLowerCase()&&(dataObject.message=dataObject.Error[key3])}dataObject.RequestId&&!metadata.requestId&&(metadata.requestId=dataObject.RequestId);const{errorSchema,errorMetadata}=await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier,this.options.defaultNamespace,response,dataObject,metadata),ns=NormalizedSchema.of(errorSchema),message=null!=(_g=null!=(_f=null!=(_e2=null!=(_d2=null==(_b5=dataObject.Error)?void 0:_b5.message)?_d2:null==(_c3=dataObject.Error)?void 0:_c3.Message)?_e2:dataObject.message)?_f:dataObject.Message)?_g:"UnknownError",exception=new(null!=(_h2=this.compositeErrorRegistry.getErrorCtor(errorSchema))?_h2:Error)(message);await this.deserializeHttpMessage(errorSchema,context2,response,dataObject);const output={};for(const[name,member2]of ns.structIterator()){const target=null!=(_i2=member2.getMergedTraits().xmlName)?_i2:name,value=null!=(_k=null==(_j=dataObject.Error)?void 0:_j[target])?_k:dataObject[target];output[name]=this.codec.createDeserializer().readSchema(member2,value)}throw this.mixin.decorateServiceException(Object.assign(exception,errorMetadata,{$fault:ns.getMergedTraits().error,message},output),dataObject)}getDefaultContentType(){return"application/xml"}hasUnstructuredPayloadBinding(ns){for(const[,member2]of ns.structIterator())if(member2.getMergedTraits().httpPayload)return!(member2.isStructSchema()||member2.isMapSchema()||member2.isListSchema());return!1}};getChecksumAlgorithmForRequest=(input,{requestChecksumRequired,requestAlgorithmMember,requestChecksumCalculation})=>requestAlgorithmMember?input[requestAlgorithmMember]?input[requestAlgorithmMember]:void 0:"WHEN_SUPPORTED"===requestChecksumCalculation||requestChecksumRequired?DEFAULT_CHECKSUM_ALGORITHM:void 0;getChecksumLocationName=algorithm=>algorithm===ChecksumAlgorithm.MD5?"content-md5":`x-amz-checksum-${algorithm.toLowerCase()}`;hasHeader2=(header,headers)=>{const soughtHeader=header.toLowerCase();for(const headerName of Object.keys(headers))if(soughtHeader===headerName.toLowerCase())return!0;return!1};hasHeaderWithPrefix=(headerPrefix,headers)=>{const soughtHeaderPrefix=headerPrefix.toLowerCase();for(const headerName of Object.keys(headers))if(headerName.toLowerCase().startsWith(soughtHeaderPrefix))return!0;return!1};isStreaming=body=>void 0!==body&&"string"!=typeof body&&!ArrayBuffer.isView(body)&&!isArrayBuffer(body);__assign=function(){__assign=Object.assign||function __assign2(t9){var s2,i2,n3,p2;for(i2=1,n3=arguments.length;i2(new TextEncoder).encode(input);fromUtf83="undefined"!=typeof Buffer&&Buffer.from?function(input){return Buffer.from(input,"utf8")}:fromUtf82;AwsCrc32c=function(){function AwsCrc32c2(){this.crc32c=new Crc32c}AwsCrc32c2.prototype.update=function(toHash){isEmptyData(toHash)||this.crc32c.update(convertToBuffer(toHash))};AwsCrc32c2.prototype.digest=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a8){return[2,numToUint8(this.crc32c.digest())]})})};AwsCrc32c2.prototype.reset=function(){this.crc32c=new Crc32c};return AwsCrc32c2}();Crc32c=function(){function Crc32c2(){this.checksum=4294967295}Crc32c2.prototype.update=function(data){var e_1,_a8,data_1,data_1_1,byte;try{for(data_1_1=(data_1=__values(data)).next();!data_1_1.done;data_1_1=data_1.next()){byte=data_1_1.value;this.checksum=this.checksum>>>8^lookupTable[255&(this.checksum^byte)]}}catch(e_1_1){e_1={error:e_1_1}}finally{try{data_1_1&&!data_1_1.done&&(_a8=data_1.return)&&_a8.call(data_1)}finally{if(e_1)throw e_1.error}}return this};Crc32c2.prototype.digest=function(){return(4294967295^this.checksum)>>>0};return Crc32c2}();lookupTable=uint32ArrayFrom([0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697]);generateCRC64NVMETable=()=>{const tables=new Array(8);for(let slice=0;slice<8;slice++){const table2=new Array(512);for(let i2=0;i2<256;i2++){let crc2=BigInt(i2);for(let j2=0;j2<8*(slice+1);j2++)crc2&BigInt("1")?crc2=crc2>>BigInt("1")^BigInt("0x9a6c9329ac4bc9b5"):crc2>>=BigInt("1");table2[2*i2]=Number(crc2>>BigInt("32")&BigInt("0xffffffff"));table2[2*i2+1]=Number(crc2&BigInt("0xffffffff"))}tables[slice]=new Uint32Array(table2)}return tables};ensureTablesInitialized=()=>{if(!CRC64_NVME_REVERSED_TABLE){CRC64_NVME_REVERSED_TABLE=generateCRC64NVMETable();[t0,t1,t2,t3,t4,t5,t6,t7]=CRC64_NVME_REVERSED_TABLE}};Crc64Nvme=class{constructor(){__publicField(this,"c1",0);__publicField(this,"c2",0);ensureTablesInitialized();this.reset()}update(data){const len=data.length;let i2=0,crc1=this.c1,crc2=this.c2;for(;i2+8<=len;){const idx0=(255&(crc2^data[i2++]))<<1,idx1=(255&(crc2>>>8^data[i2++]))<<1,idx2=(255&(crc2>>>16^data[i2++]))<<1,idx3=(255&(crc2>>>24^data[i2++]))<<1,idx4=(255&(crc1^data[i2++]))<<1,idx5=(255&(crc1>>>8^data[i2++]))<<1,idx6=(255&(crc1>>>16^data[i2++]))<<1,idx7=(255&(crc1>>>24^data[i2++]))<<1;crc1=t7[idx0]^t6[idx1]^t5[idx2]^t4[idx3]^t3[idx4]^t2[idx5]^t1[idx6]^t0[idx7];crc2=t7[idx0+1]^t6[idx1+1]^t5[idx2+1]^t4[idx3+1]^t3[idx4+1]^t2[idx5+1]^t1[idx6+1]^t0[idx7+1]}for(;i2>>8|(255&crc1)<<24)>>>0;crc1=crc1>>>8^t0[idx2];crc2^=t0[idx2+1];i2++}this.c1=crc1;this.c2=crc2}async digest(){const c12=4294967295^this.c1,c22=4294967295^this.c2;return new Uint8Array([c12>>>24,c12>>>16&255,c12>>>8&255,255&c12,c22>>>24,c22>>>16&255,c22>>>8&255,255&c22])}reset(){this.c1=4294967295;this.c2=4294967295}};AwsCrc32=function(){function AwsCrc322(){this.crc32=new Crc32}AwsCrc322.prototype.update=function(toHash){isEmptyData(toHash)||this.crc32.update(convertToBuffer(toHash))};AwsCrc322.prototype.digest=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a8){return[2,numToUint8(this.crc32.digest())]})})};AwsCrc322.prototype.reset=function(){this.crc32=new Crc32};return AwsCrc322}();Crc32=function(){function Crc322(){this.checksum=4294967295}Crc322.prototype.update=function(data){var e_1,_a8,data_1,data_1_1,byte;try{for(data_1_1=(data_1=__values(data)).next();!data_1_1.done;data_1_1=data_1.next()){byte=data_1_1.value;this.checksum=this.checksum>>>8^lookupTable2[255&(this.checksum^byte)]}}catch(e_1_1){e_1={error:e_1_1}}finally{try{data_1_1&&!data_1_1.done&&(_a8=data_1.return)&&_a8.call(data_1)}finally{if(e_1)throw e_1.error}}return this};Crc322.prototype.digest=function(){return(4294967295^this.checksum)>>>0};return Crc322}();lookupTable2=uint32ArrayFrom([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);getCrc32ChecksumAlgorithmFunction=()=>AwsCrc32;CLIENT_SUPPORTED_ALGORITHMS=[ChecksumAlgorithm.CRC32,ChecksumAlgorithm.CRC32C,ChecksumAlgorithm.CRC64NVME,ChecksumAlgorithm.SHA1,ChecksumAlgorithm.SHA256];PRIORITY_ORDER_ALGORITHMS=[ChecksumAlgorithm.SHA256,ChecksumAlgorithm.SHA1,ChecksumAlgorithm.CRC32,ChecksumAlgorithm.CRC32C,ChecksumAlgorithm.CRC64NVME];selectChecksumAlgorithmFunction=(checksumAlgorithm,config)=>{var _a8,_b5,_c3,_d2,_f,_g;const{checksumAlgorithms={}}=config;switch(checksumAlgorithm){case ChecksumAlgorithm.MD5:return null!=(_a8=null==checksumAlgorithms?void 0:checksumAlgorithms.MD5)?_a8:config.md5;case ChecksumAlgorithm.CRC32:return null!=(_b5=null==checksumAlgorithms?void 0:checksumAlgorithms.CRC32)?_b5:getCrc32ChecksumAlgorithmFunction();case ChecksumAlgorithm.CRC32C:return null!=(_c3=null==checksumAlgorithms?void 0:checksumAlgorithms.CRC32C)?_c3:AwsCrc32c;case ChecksumAlgorithm.CRC64NVME:return null!=(_d2=null==checksumAlgorithms?void 0:checksumAlgorithms.CRC64NVME)?_d2:Crc64Nvme;case ChecksumAlgorithm.SHA1:return null!=(_f=null==checksumAlgorithms?void 0:checksumAlgorithms.SHA1)?_f:config.sha1;case ChecksumAlgorithm.SHA256:return null!=(_g=null==checksumAlgorithms?void 0:checksumAlgorithms.SHA256)?_g:config.sha256;default:if(null==checksumAlgorithms?void 0:checksumAlgorithms[checksumAlgorithm])return checksumAlgorithms[checksumAlgorithm];throw new Error(`The checksum algorithm "${checksumAlgorithm}" is not supported by the client. Select one of ${CLIENT_SUPPORTED_ALGORITHMS}, or provide an implementation to the client constructor checksums field.`)}};init_dist_es();stringHasher=(checksumAlgorithmFn,body)=>{const hash3=new checksumAlgorithmFn;hash3.update(toUint8Array(body||""));return hash3.digest()};flexibleChecksumsMiddlewareOptions={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0};flexibleChecksumsMiddleware=(config,middlewareConfig)=>(next2,context2)=>async args=>{if(!HttpRequest.isInstance(args.request))return next2(args);if(hasHeaderWithPrefix("x-amz-checksum-",args.request.headers))return next2(args);const{request:request2,input}=args,{body:requestBody,headers}=request2,{base64Encoder,streamHasher}=config,{requestChecksumRequired,requestAlgorithmMember}=middlewareConfig,requestChecksumCalculation=await config.requestChecksumCalculation(),requestAlgorithmMemberName=null==requestAlgorithmMember?void 0:requestAlgorithmMember.name,requestAlgorithmMemberHttpHeader=null==requestAlgorithmMember?void 0:requestAlgorithmMember.httpHeader;if(requestAlgorithmMemberName&&!input[requestAlgorithmMemberName]&&("WHEN_SUPPORTED"===requestChecksumCalculation||requestChecksumRequired)){input[requestAlgorithmMemberName]=DEFAULT_CHECKSUM_ALGORITHM;requestAlgorithmMemberHttpHeader&&(headers[requestAlgorithmMemberHttpHeader]=DEFAULT_CHECKSUM_ALGORITHM)}const checksumAlgorithm=getChecksumAlgorithmForRequest(input,{requestChecksumRequired,requestAlgorithmMember:null==requestAlgorithmMember?void 0:requestAlgorithmMember.name,requestChecksumCalculation});let updatedBody=requestBody,updatedHeaders=headers;if(checksumAlgorithm){switch(checksumAlgorithm){case ChecksumAlgorithm.CRC32:setFeature(context2,"FLEXIBLE_CHECKSUMS_REQ_CRC32","U");break;case ChecksumAlgorithm.CRC32C:setFeature(context2,"FLEXIBLE_CHECKSUMS_REQ_CRC32C","V");break;case ChecksumAlgorithm.CRC64NVME:setFeature(context2,"FLEXIBLE_CHECKSUMS_REQ_CRC64","W");break;case ChecksumAlgorithm.SHA1:setFeature(context2,"FLEXIBLE_CHECKSUMS_REQ_SHA1","X");break;case ChecksumAlgorithm.SHA256:setFeature(context2,"FLEXIBLE_CHECKSUMS_REQ_SHA256","Y");break}const checksumLocationName=getChecksumLocationName(checksumAlgorithm),checksumAlgorithmFn=selectChecksumAlgorithmFunction(checksumAlgorithm,config);if(isStreaming(requestBody)){const{getAwsChunkedEncodingStream:getAwsChunkedEncodingStream2,bodyLengthChecker}=config;updatedBody=getAwsChunkedEncodingStream2("number"==typeof config.requestStreamBufferSize&&config.requestStreamBufferSize>=8192?createBufferedReadable(requestBody,config.requestStreamBufferSize,context2.logger):requestBody,{base64Encoder,bodyLengthChecker,checksumLocationName,checksumAlgorithmFn,streamHasher});updatedHeaders={...headers,"content-encoding":headers["content-encoding"]?`${headers["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":headers["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":checksumLocationName};delete updatedHeaders["content-length"]}else if(!hasHeader2(checksumLocationName,headers)){const rawChecksum=await stringHasher(checksumAlgorithmFn,requestBody);updatedHeaders={...headers,[checksumLocationName]:base64Encoder(rawChecksum)}}}try{return await next2({...args,request:{...request2,headers:updatedHeaders,body:updatedBody}})}catch(e3){if(e3 instanceof Error&&"InvalidChunkSizeError"===e3.name)try{e3.message.endsWith(".")||(e3.message+=".");e3.message+=" Set [requestStreamBufferSize=number e.g. 65_536] in client constructor to instruct AWS SDK to buffer your input stream."}catch(ignored){}throw e3}};flexibleChecksumsInputMiddlewareOptions={name:"flexibleChecksumsInputMiddleware",toMiddleware:"serializerMiddleware",relation:"before",tags:["BODY_CHECKSUM"],override:!0};flexibleChecksumsInputMiddleware=(config,middlewareConfig)=>(next2,context2)=>async args=>{const input=args.input,{requestValidationModeMember}=middlewareConfig,requestChecksumCalculation=await config.requestChecksumCalculation(),responseChecksumValidation=await config.responseChecksumValidation();switch(requestChecksumCalculation){case"WHEN_REQUIRED":setFeature(context2,"FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED","a");break;case"WHEN_SUPPORTED":setFeature(context2,"FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED","Z");break}switch(responseChecksumValidation){case"WHEN_REQUIRED":setFeature(context2,"FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED","c");break;case"WHEN_SUPPORTED":setFeature(context2,"FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED","b");break}requestValidationModeMember&&!input[requestValidationModeMember]&&"WHEN_SUPPORTED"===responseChecksumValidation&&(input[requestValidationModeMember]="ENABLED");return next2(args)};getChecksumAlgorithmListForResponse=(responseAlgorithms=[])=>{const validChecksumAlgorithms=[];let i2=PRIORITY_ORDER_ALGORITHMS.length;for(const algorithm of responseAlgorithms){const priority=PRIORITY_ORDER_ALGORITHMS.indexOf(algorithm);-1!==priority?validChecksumAlgorithms[priority]=algorithm:validChecksumAlgorithms[i2++]=algorithm}return validChecksumAlgorithms.filter(Boolean)};isChecksumWithPartNumber=checksum=>{const lastHyphenIndex=checksum.lastIndexOf("-");if(-1!==lastHyphenIndex){const numberPart=checksum.slice(lastHyphenIndex+1);if(!numberPart.startsWith("0")){const number=parseInt(numberPart,10);if(!isNaN(number)&&number>=1&&number<=1e4)return!0}}return!1};getChecksum=async(body,{checksumAlgorithmFn,base64Encoder})=>base64Encoder(await stringHasher(checksumAlgorithmFn,body));validateChecksumFromResponse=async(response,{config,responseAlgorithms,logger:logger2})=>{const checksumAlgorithms=getChecksumAlgorithmListForResponse(responseAlgorithms),{body:responseBody,headers:responseHeaders}=response;for(const algorithm of checksumAlgorithms){const responseHeader=getChecksumLocationName(algorithm),checksumFromResponse=responseHeaders[responseHeader];if(checksumFromResponse){let checksumAlgorithmFn;try{checksumAlgorithmFn=selectChecksumAlgorithmFunction(algorithm,config)}catch(error){if(algorithm===ChecksumAlgorithm.CRC64NVME){null==logger2||logger2.warn(`Skipping ${ChecksumAlgorithm.CRC64NVME} checksum validation: ${error.message}`);continue}throw error}const{base64Encoder}=config;if(isStreaming(responseBody)){response.body=createChecksumStream({expectedChecksum:checksumFromResponse,checksumSourceLocation:responseHeader,checksum:new checksumAlgorithmFn,source:responseBody,base64Encoder});return}const checksum=await getChecksum(responseBody,{checksumAlgorithmFn,base64Encoder});if(checksum===checksumFromResponse)break;throw new Error(`Checksum mismatch: expected "${checksum}" but received "${checksumFromResponse}" in response header "${responseHeader}".`)}}};flexibleChecksumsResponseMiddlewareOptions={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0};flexibleChecksumsResponseMiddleware=(config,middlewareConfig)=>(next2,context2)=>async args=>{var _a8;if(!HttpRequest.isInstance(args.request))return next2(args);const input=args.input,result=await next2(args),response=result.response,{requestValidationModeMember,responseAlgorithms}=middlewareConfig;if(requestValidationModeMember&&"ENABLED"===input[requestValidationModeMember]){const{clientName,commandName}=context2,customChecksumAlgorithms=Object.keys(null!=(_a8=config.checksumAlgorithms)?_a8:{}).filter(algorithm=>{const responseHeader=getChecksumLocationName(algorithm);return void 0!==response.headers[responseHeader]}),algoList=getChecksumAlgorithmListForResponse([...null!=responseAlgorithms?responseAlgorithms:[],...customChecksumAlgorithms]);if("S3Client"===clientName&&"GetObjectCommand"===commandName&&algoList.every(algorithm=>{const responseHeader=getChecksumLocationName(algorithm),checksumFromResponse=response.headers[responseHeader];return!checksumFromResponse||isChecksumWithPartNumber(checksumFromResponse)}))return result;await validateChecksumFromResponse(response,{config,responseAlgorithms:algoList,logger:context2.logger})}return result};getFlexibleChecksumsPlugin=(config,middlewareConfig)=>({applyToStack:clientStack=>{clientStack.add(flexibleChecksumsMiddleware(config,middlewareConfig),flexibleChecksumsMiddlewareOptions);clientStack.addRelativeTo(flexibleChecksumsInputMiddleware(config,middlewareConfig),flexibleChecksumsInputMiddlewareOptions);clientStack.addRelativeTo(flexibleChecksumsResponseMiddleware(config,middlewareConfig),flexibleChecksumsResponseMiddlewareOptions)}});resolveFlexibleChecksumsConfig=input=>{var _a8;const{requestChecksumCalculation,responseChecksumValidation,requestStreamBufferSize}=input;return Object.assign(input,{requestChecksumCalculation:normalizeProvider(null!=requestChecksumCalculation?requestChecksumCalculation:"WHEN_SUPPORTED"),responseChecksumValidation:normalizeProvider(null!=responseChecksumValidation?responseChecksumValidation:"WHEN_SUPPORTED"),requestStreamBufferSize:Number(null!=requestStreamBufferSize?requestStreamBufferSize:0),checksumAlgorithms:null!=(_a8=input.checksumAlgorithms)?_a8:{}})};hostHeaderMiddleware=options=>next2=>async args=>{if(!HttpRequest.isInstance(args.request))return next2(args);const{request:request2}=args,{handlerProtocol=""}=options.requestHandler.metadata||{};if(handlerProtocol.indexOf("h2")>=0&&!request2.headers[":authority"]){delete request2.headers.host;request2.headers[":authority"]=request2.hostname+(request2.port?":"+request2.port:"")}else if(!request2.headers.host){let host=request2.hostname;null!=request2.port&&(host+=`:${request2.port}`);request2.headers.host=host}return next2(args)};hostHeaderMiddlewareOptions={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0};getHostHeaderPlugin=options=>({applyToStack:clientStack=>{clientStack.add(hostHeaderMiddleware(options),hostHeaderMiddlewareOptions)}});loggerMiddleware=()=>(next2,context2)=>async args=>{var _a8,_b5;try{const response=await next2(args),{clientName,commandName,logger:logger2,dynamoDbDocumentClientOptions={}}=context2,{overrideInputFilterSensitiveLog,overrideOutputFilterSensitiveLog}=dynamoDbDocumentClientOptions,inputFilterSensitiveLog=null!=overrideInputFilterSensitiveLog?overrideInputFilterSensitiveLog:context2.inputFilterSensitiveLog,outputFilterSensitiveLog=null!=overrideOutputFilterSensitiveLog?overrideOutputFilterSensitiveLog:context2.outputFilterSensitiveLog,{$metadata,...outputWithoutMetadata}=response.output;null==(_a8=null==logger2?void 0:logger2.info)||_a8.call(logger2,{clientName,commandName,input:inputFilterSensitiveLog(args.input),output:outputFilterSensitiveLog(outputWithoutMetadata),metadata:$metadata});return response}catch(error){const{clientName,commandName,logger:logger2,dynamoDbDocumentClientOptions={}}=context2,{overrideInputFilterSensitiveLog}=dynamoDbDocumentClientOptions,inputFilterSensitiveLog=null!=overrideInputFilterSensitiveLog?overrideInputFilterSensitiveLog:context2.inputFilterSensitiveLog;null==(_b5=null==logger2?void 0:logger2.error)||_b5.call(logger2,{clientName,commandName,input:inputFilterSensitiveLog(args.input),error,metadata:error.$metadata});throw error}};loggerMiddlewareOptions={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0};getLoggerPlugin=options=>({applyToStack:clientStack=>{clientStack.add(loggerMiddleware(),loggerMiddlewareOptions)}});recursionDetectionMiddlewareOptions={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"};recursionDetectionMiddleware=()=>next2=>async args=>next2(args);getRecursionDetectionPlugin=options=>({applyToStack:clientStack=>{clientStack.add(recursionDetectionMiddleware(),recursionDetectionMiddlewareOptions)}});CONTENT_LENGTH_HEADER="content-length";DECODED_CONTENT_LENGTH_HEADER="x-amz-decoded-content-length";checkContentLengthHeaderMiddlewareOptions={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0};getCheckContentLengthHeaderPlugin=unused=>({applyToStack:clientStack=>{clientStack.add(checkContentLengthHeader(),checkContentLengthHeaderMiddlewareOptions)}});regionRedirectEndpointMiddleware=config=>(next2,context2)=>async args=>{const originalRegion=await config.region(),regionProviderRef=config.region;let unlock=()=>{};if(context2.__s3RegionRedirect){Object.defineProperty(config,"region",{writable:!1,value:async()=>context2.__s3RegionRedirect});unlock=()=>Object.defineProperty(config,"region",{writable:!0,value:regionProviderRef})}try{const result=await next2(args);if(context2.__s3RegionRedirect){unlock();if(originalRegion!==await config.region())throw new Error("Region was not restored following S3 region redirect.")}return result}catch(e3){unlock();throw e3}};regionRedirectEndpointMiddlewareOptions={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};regionRedirectMiddlewareOptions={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0};getRegionRedirectMiddlewarePlugin=clientConfig=>({applyToStack:clientStack=>{clientStack.add(regionRedirectMiddleware(clientConfig),regionRedirectMiddlewareOptions);clientStack.addRelativeTo(regionRedirectEndpointMiddleware(clientConfig),regionRedirectEndpointMiddlewareOptions)}});s3ExpiresMiddleware=config=>(next2,context2)=>async args=>{var _a8;const result=await next2(args),{response}=result;if(HttpResponse.isInstance(response)&&response.headers.expires){response.headers.expiresstring=response.headers.expires;try{parseRfc7231DateTime(response.headers.expires)}catch(e3){null==(_a8=context2.logger)||_a8.warn(`AWS SDK Warning for ${context2.clientName}::${context2.commandName} response parsing (${response.headers.expires}): ${e3}`);delete response.headers.expires}}return result};s3ExpiresMiddlewareOptions={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"};getS3ExpiresMiddlewarePlugin=clientConfig=>({applyToStack:clientStack=>{clientStack.addRelativeTo(s3ExpiresMiddleware(),s3ExpiresMiddlewareOptions)}});_S3ExpressIdentityCache=class _S3ExpressIdentityCache{constructor(data={}){__publicField(this,"data");__publicField(this,"lastPurgeTime",Date.now());this.data=data}get(key3){const entry=this.data[key3];if(entry)return entry}set(key3,entry){this.data[key3]=entry;return entry}delete(key3){delete this.data[key3]}async purgeExpired(){const now3=Date.now();if(!(this.lastPurgeTime+_S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>now3))for(const key3 in this.data){const entry=this.data[key3];if(!entry.isRefreshing){const credential=await entry.identity;credential.expiration&&credential.expiration.getTime(){var _a8,_b5,_c3,_d2;if((null!=(_b5=null==(_a8=identity.expiration)?void 0:_a8.getTime())?_b5:0){cache2.set(key3,new S3ExpressIdentityCacheEntry(Promise.resolve(id)))})}return identity}):cache2.set(key3,new S3ExpressIdentityCacheEntry(this.getIdentity(key3))).identity}async getIdentity(key3){var _a8,_b5;await this.cache.purgeExpired().catch(error=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+error)});const session=await this.createSessionFn(key3);if(!(null==(_a8=session.Credentials)?void 0:_a8.AccessKeyId)||!(null==(_b5=session.Credentials)?void 0:_b5.SecretAccessKey))throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:session.Credentials.AccessKeyId,secretAccessKey:session.Credentials.SecretAccessKey,sessionToken:session.Credentials.SessionToken,expiration:session.Credentials.Expiration?new Date(session.Credentials.Expiration):void 0}}};__publicField(_S3ExpressIdentityProviderImpl,"REFRESH_WINDOW_MS",6e4);S3ExpressIdentityProviderImpl=_S3ExpressIdentityProviderImpl;(function(SelectorType2){SelectorType2.ENV="env";SelectorType2.CONFIG="shared config entry"})(SelectorType||(SelectorType={}));SESSION_TOKEN_HEADER=(SESSION_TOKEN_QUERY_PARAM="X-Amz-S3session-Token").toLowerCase();SignatureV4S3Express=class extends SignatureV4{async signWithCredentials(requestToSign,credentials,options){const credentialsWithoutSessionToken=getCredentialsWithoutSessionToken(credentials);requestToSign.headers[SESSION_TOKEN_HEADER]=credentials.sessionToken;setSingleOverride(this,credentialsWithoutSessionToken);return this.signRequest(requestToSign,null!=options?options:{})}async presignWithCredentials(requestToSign,credentials,options){var _a8;const credentialsWithoutSessionToken=getCredentialsWithoutSessionToken(credentials);delete requestToSign.headers[SESSION_TOKEN_HEADER];requestToSign.headers[SESSION_TOKEN_QUERY_PARAM]=credentials.sessionToken;requestToSign.query=null!=(_a8=requestToSign.query)?_a8:{};requestToSign.query[SESSION_TOKEN_QUERY_PARAM]=credentials.sessionToken;setSingleOverride(this,credentialsWithoutSessionToken);return this.presign(requestToSign,options)}};s3ExpressMiddleware=options=>(next2,context2)=>async args=>{var _a8,_b5,_c3,_d2,_e2;if(context2.endpointV2){const endpoint=context2.endpointV2,isS3ExpressAuth="sigv4-s3express"===(null==(_c3=null==(_b5=null==(_a8=endpoint.properties)?void 0:_a8.authSchemes)?void 0:_b5[0])?void 0:_c3.name);if("S3Express"===(null==(_d2=endpoint.properties)?void 0:_d2.backend)||"Directory"===(null==(_e2=endpoint.properties)?void 0:_e2.bucketType)){setFeature(context2,"S3_EXPRESS_BUCKET","J");context2.isS3ExpressBucket=!0}if(isS3ExpressAuth){const requestBucket=args.input.Bucket;if(requestBucket){const s3ExpressIdentity=await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(),{Bucket:requestBucket});context2.s3ExpressIdentity=s3ExpressIdentity;HttpRequest.isInstance(args.request)&&s3ExpressIdentity.sessionToken&&(args.request.headers[SESSION_TOKEN_HEADER]=s3ExpressIdentity.sessionToken)}}}return next2(args)};s3ExpressMiddlewareOptions={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0};getS3ExpressPlugin=options=>({applyToStack:clientStack=>{clientStack.add(s3ExpressMiddleware(options),s3ExpressMiddlewareOptions)}});signS3Express=async(s3ExpressIdentity,signingOptions,request2,sigV4MultiRegionSigner)=>{const signedRequest=await sigV4MultiRegionSigner.signWithCredentials(request2,s3ExpressIdentity,{});if(signedRequest.headers["X-Amz-Security-Token"]||signedRequest.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return signedRequest};defaultErrorHandler2=signingProperties=>error=>{throw error};defaultSuccessHandler2=(httpResponse,signingProperties)=>{};s3ExpressHttpSigningMiddleware=config=>(next2,context2)=>async args=>{if(!HttpRequest.isInstance(args.request))return next2(args);const scheme=getSmithyContext(context2).selectedHttpAuthScheme;if(!scheme)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties={}},identity,signer}=scheme;let request2;request2=context2.s3ExpressIdentity?await signS3Express(context2.s3ExpressIdentity,0,args.request,await config.signer()):await signer.sign(args.request,identity,signingProperties);const output=await next2({...args,request:request2}).catch((signer.errorHandler||defaultErrorHandler2)(signingProperties));(signer.successHandler||defaultSuccessHandler2)(output.response,signingProperties);return output};getS3ExpressHttpSigningPlugin=config=>({applyToStack:clientStack=>{clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config),httpSigningMiddlewareOptions)}});resolveS3Config=(input,{session})=>{const[s3ClientProvider,CreateSessionCommandCtor]=session,{forcePathStyle,useAccelerateEndpoint,disableMultiregionAccessPoints,followRegionRedirects,s3ExpressIdentityProvider,bucketEndpoint,expectContinueHeader}=input;return Object.assign(input,{forcePathStyle:null!=forcePathStyle&&forcePathStyle,useAccelerateEndpoint:null!=useAccelerateEndpoint&&useAccelerateEndpoint,disableMultiregionAccessPoints:null!=disableMultiregionAccessPoints&&disableMultiregionAccessPoints,followRegionRedirects:null!=followRegionRedirects&&followRegionRedirects,s3ExpressIdentityProvider:null!=s3ExpressIdentityProvider?s3ExpressIdentityProvider:new S3ExpressIdentityProviderImpl(async key3=>s3ClientProvider().send(new CreateSessionCommandCtor({Bucket:key3}))),bucketEndpoint:null!=bucketEndpoint&&bucketEndpoint,expectContinueHeader:null!=expectContinueHeader?expectContinueHeader:2097152})};THROW_IF_EMPTY_BODY={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0};throw200ExceptionsMiddleware=config=>(next2,context2)=>async args=>{const result=await next2(args),{response}=result;if(!HttpResponse.isInstance(response))return result;const{statusCode,body:sourceBody}=response;if(statusCode<200||statusCode>=300)return result;if("function"!=typeof(null==sourceBody?void 0:sourceBody.stream)&&"function"!=typeof(null==sourceBody?void 0:sourceBody.pipe)&&"function"!=typeof(null==sourceBody?void 0:sourceBody.tee))return result;let bodyCopy=sourceBody,body=sourceBody;!sourceBody||"object"!=typeof sourceBody||sourceBody instanceof Uint8Array||([bodyCopy,body]=await splitStream(sourceBody));response.body=body;const bodyBytes=await collectBody2(bodyCopy,{streamCollector:async stream=>headStream(stream,3e3)});"function"==typeof(null==bodyCopy?void 0:bodyCopy.destroy)&&bodyCopy.destroy();const bodyStringTail=config.utf8Encoder(bodyBytes.subarray(bodyBytes.length-16));if(0===bodyBytes.length&&THROW_IF_EMPTY_BODY[context2.commandName]){const err3=new Error("S3 aborted request");err3.name="InternalError";throw err3}bodyStringTail&&bodyStringTail.endsWith("")&&(response.statusCode=400);return result};collectBody2=(streamBody=new Uint8Array,context2)=>streamBody instanceof Uint8Array?Promise.resolve(streamBody):context2.streamCollector(streamBody)||Promise.resolve(new Uint8Array);throw200ExceptionsMiddlewareOptions={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0};getThrow200ExceptionsPlugin=config=>({applyToStack:clientStack=>{clientStack.addRelativeTo(throw200ExceptionsMiddleware(config),throw200ExceptionsMiddlewareOptions)}});validate=str=>"string"==typeof str&&0===str.indexOf("arn:")&&str.split(":").length>=6;bucketEndpointMiddlewareOptions={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};validateBucketNameMiddlewareOptions={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0};getValidateBucketNamePlugin=options=>({applyToStack:clientStack=>{clientStack.add(validateBucketNameMiddleware(options),validateBucketNameMiddlewareOptions);clientStack.addRelativeTo(bucketEndpointMiddleware(options),bucketEndpointMiddlewareOptions)}});S3RestXmlProtocol=class extends AwsRestXmlProtocol{async serializeRequest(operationSchema,input,context2){var _a8;const request2=await super.serializeRequest(operationSchema,input,context2),ns=NormalizedSchema.of(operationSchema.input);let bucketMemberIndex=0;const requiredMemberCount=null!=(_a8=ns.getSchema()[6])?_a8:0;if(input&&"object"==typeof input)for(const[memberName,memberNs]of ns.structIterator()){if(++bucketMemberIndex>requiredMemberCount)break;if("Bucket"===memberName){if(!input.Bucket&&memberNs.getMergedTraits().httpLabel)throw new Error("No value provided for input HTTP label: Bucket.");break}}return request2}};DEFAULT_UA_APP_ID=void 0;EndpointCache=class{constructor({size,params}){__publicField(this,"capacity");__publicField(this,"data",new Map);__publicField(this,"parameters",[]);this.capacity=null!=size?size:50;params&&(this.parameters=params)}get(endpointParams,resolver2){const key3=this.hash(endpointParams);if(!1===key3)return resolver2();if(!this.data.has(key3)){if(this.data.size>this.capacity+10){const keys3=this.data.keys();let i2=0;for(;;){const{value,done}=keys3.next();this.data.delete(value);if(done||++i2>10)break}}this.data.set(key3,resolver2())}return this.data.get(key3)}size(){return this.data.size}hash(endpointParams){var _a8;let buffer="";const{parameters}=this;if(0===parameters.length)return!1;for(const param of parameters){const val=String(null!=(_a8=endpointParams[param])?_a8:"");if(val.includes("|;"))return!1;buffer+=val+"|;"}return buffer}};IP_V4_REGEX=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$");isIpAddress=value=>IP_V4_REGEX.test(value)||value.startsWith("[")&&value.endsWith("]");VALID_HOST_LABEL_REGEX=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$");isValidHostLabel=(value,allowSubDomains=!1)=>{if(!allowSubDomains)return VALID_HOST_LABEL_REGEX.test(value);const labels=value.split(".");for(const label2 of labels)if(!isValidHostLabel(label2))return!1;return!0};customEndpointFunctions={};EndpointError=class extends Error{constructor(message){super(message);this.name="EndpointError"}};booleanEquals=(value1,value2)=>value1===value2;getAttrPathList=path2=>{const parts=path2.split("."),pathList=[];for(const part of parts){const squareBracketIndex=part.indexOf("[");if(-1!==squareBracketIndex){if(part.indexOf("]")!==part.length-1)throw new EndpointError(`Path: '${path2}' does not end with ']'`);const arrayIndex=part.slice(squareBracketIndex+1,-1);if(Number.isNaN(parseInt(arrayIndex)))throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path2}'`);0!==squareBracketIndex&&pathList.push(part.slice(0,squareBracketIndex));pathList.push(arrayIndex)}else pathList.push(part)}return pathList};getAttr=(value,path2)=>getAttrPathList(path2).reduce((acc,index6)=>{if("object"!=typeof acc)throw new EndpointError(`Index '${index6}' in '${path2}' not found in '${JSON.stringify(value)}'`);return Array.isArray(acc)?acc[parseInt(index6)]:acc[index6]},value);isSet=value=>null!=value;not=value=>!value;DEFAULT_PORTS={[EndpointURLScheme.HTTP]:80,[EndpointURLScheme.HTTPS]:443};endpointFunctions={booleanEquals,getAttr,isSet,isValidHostLabel,not,parseURL:value=>{const whatwgURL=(()=>{try{if(value instanceof URL)return value;if("object"==typeof value&&"hostname"in value){const{hostname:hostname2,port,protocol:protocol2="",path:path2="",query:query3={}}=value,url=new URL(`${protocol2}//${hostname2}${port?`:${port}`:""}${path2}`);url.search=Object.entries(query3).map(([k2,v2])=>`${k2}=${v2}`).join("&");return url}return new URL(value)}catch(error){return null}})();if(!whatwgURL){console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);return null}const urlString=whatwgURL.href,{host,hostname,pathname,protocol,search}=whatwgURL;if(search)return null;const scheme=protocol.slice(0,-1);if(!Object.values(EndpointURLScheme).includes(scheme))return null;const isIp=isIpAddress(hostname);return{scheme,authority:`${host}${urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`)||"string"==typeof value&&value.includes(`${host}:${DEFAULT_PORTS[scheme]}`)?`:${DEFAULT_PORTS[scheme]}`:""}`,path:pathname,normalizedPath:pathname.endsWith("/")?pathname:`${pathname}/`,isIp}},stringEquals:(value1,value2)=>value1===value2,substring:(input,start,stop,reverse)=>start>=stop||input.lengthencodeURIComponent(value).replace(/[!*'()]/g,c3=>`%${c3.charCodeAt(0).toString(16).toUpperCase()}`)};evaluateTemplate=(template,options)=>{const evaluatedTemplateArr=[],templateContext={...options.endpointParams,...options.referenceRecord};let currentIndex=0;for(;currentIndex({...options.endpointParams,...options.referenceRecord}[ref]);evaluateExpression=(obj,keyName,options)=>{if("string"==typeof obj)return evaluateTemplate(obj,options);if(obj.fn)return group.callFunction(obj,options);if(obj.ref)return getReferenceValue(obj,options);throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`)};callFunction=({fn,argv},options)=>{const evaluatedArgs=argv.map(arg=>["boolean","number"].includes(typeof arg)?arg:group.evaluateExpression(arg,"arg",options)),fnSegments=fn.split(".");return fnSegments[0]in customEndpointFunctions&&null!=fnSegments[1]?customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs):endpointFunctions[fn](...evaluatedArgs)};group={evaluateExpression,callFunction};evaluateCondition=({assign:assign2,...fnArgs},options)=>{var _a8,_b5;if(assign2&&assign2 in options.referenceRecord)throw new EndpointError(`'${assign2}' is already defined in Reference Record.`);const value=callFunction(fnArgs,options);null==(_b5=null==(_a8=options.logger)?void 0:_a8.debug)||_b5.call(_a8,`endpoints evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`);return{result:""===value||!!value,...null!=assign2&&{toAssign:{name:assign2,value}}}};evaluateConditions=(conditions=[],options)=>{var _a8,_b5;const conditionsReferenceRecord={};for(const condition of conditions){const{result,toAssign}=evaluateCondition(condition,{...options,referenceRecord:{...options.referenceRecord,...conditionsReferenceRecord}});if(!result)return{result};if(toAssign){conditionsReferenceRecord[toAssign.name]=toAssign.value;null==(_b5=null==(_a8=options.logger)?void 0:_a8.debug)||_b5.call(_a8,`endpoints assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`)}}return{result:!0,referenceRecord:conditionsReferenceRecord}};getEndpointHeaders=(headers,options)=>Object.entries(headers).reduce((acc,[headerKey,headerVal])=>({...acc,[headerKey]:headerVal.map(headerValEntry=>{const processedExpr=evaluateExpression(headerValEntry,"Header value entry",options);if("string"!=typeof processedExpr)throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);return processedExpr})}),{});getEndpointProperties=(properties,options)=>Object.entries(properties).reduce((acc,[propertyKey,propertyVal])=>({...acc,[propertyKey]:group2.getEndpointProperty(propertyVal,options)}),{});getEndpointProperty=(property,options)=>{if(Array.isArray(property))return property.map(propertyEntry=>getEndpointProperty(propertyEntry,options));switch(typeof property){case"string":return evaluateTemplate(property,options);case"object":if(null===property)throw new EndpointError(`Unexpected endpoint property: ${property}`);return group2.getEndpointProperties(property,options);case"boolean":return property;default:throw new EndpointError("Unexpected endpoint property type: "+typeof property)}};group2={getEndpointProperty,getEndpointProperties};getEndpointUrl=(endpointUrl,options)=>{const expression=evaluateExpression(endpointUrl,"Endpoint URL",options);if("string"==typeof expression)try{return new URL(expression)}catch(error){console.error(`Failed to construct URL with ${expression}`,error);throw error}throw new EndpointError("Endpoint URL must be a string, got "+typeof expression)};evaluateEndpointRule=(endpointRule,options)=>{var _a8,_b5;const{conditions,endpoint}=endpointRule,{result,referenceRecord}=evaluateConditions(conditions,options);if(!result)return;const endpointRuleOptions={...options,referenceRecord:{...options.referenceRecord,...referenceRecord}},{url,properties,headers}=endpoint;null==(_b5=null==(_a8=options.logger)?void 0:_a8.debug)||_b5.call(_a8,`endpoints Resolving endpoint from template: ${toDebugString(endpoint)}`);return{...null!=headers&&{headers:getEndpointHeaders(headers,endpointRuleOptions)},...null!=properties&&{properties:getEndpointProperties(properties,endpointRuleOptions)},url:getEndpointUrl(url,endpointRuleOptions)}};evaluateErrorRule=(errorRule,options)=>{const{conditions,error}=errorRule,{result,referenceRecord}=evaluateConditions(conditions,options);if(result)throw new EndpointError(evaluateExpression(error,"Error",{...options,referenceRecord:{...options.referenceRecord,...referenceRecord}}))};evaluateRules=(rules,options)=>{for(const rule of rules)if("endpoint"===rule.type){const endpointOrUndefined=evaluateEndpointRule(rule,options);if(endpointOrUndefined)return endpointOrUndefined}else if("error"===rule.type)evaluateErrorRule(rule,options);else{if("tree"!==rule.type)throw new EndpointError(`Unknown endpoint rule: ${rule}`);{const endpointOrUndefined=group3.evaluateTreeRule(rule,options);if(endpointOrUndefined)return endpointOrUndefined}}throw new EndpointError("Rules evaluation failed")};evaluateTreeRule=(treeRule,options)=>{const{conditions,rules}=treeRule,{result,referenceRecord}=evaluateConditions(conditions,options);if(result)return group3.evaluateRules(rules,{...options,referenceRecord:{...options.referenceRecord,...referenceRecord}})};group3={evaluateRules,evaluateTreeRule};resolveEndpoint=(ruleSetObject,options)=>{var _a8,_b5,_c3,_d2,_e2;const{endpointParams,logger:logger2}=options,{parameters,rules}=ruleSetObject;null==(_b5=null==(_a8=options.logger)?void 0:_a8.debug)||_b5.call(_a8,`endpoints Initial EndpointParams: ${toDebugString(endpointParams)}`);const paramsWithDefault=Object.entries(parameters).filter(([,v2])=>null!=v2.default).map(([k2,v2])=>[k2,v2.default]);if(paramsWithDefault.length>0)for(const[paramKey,paramDefaultValue]of paramsWithDefault)endpointParams[paramKey]=null!=(_c3=endpointParams[paramKey])?_c3:paramDefaultValue;const requiredParams=Object.entries(parameters).filter(([,v2])=>v2.required).map(([k2])=>k2);for(const requiredParam of requiredParams)if(null==endpointParams[requiredParam])throw new EndpointError(`Missing required parameter: '${requiredParam}'`);const endpoint=evaluateRules(rules,{endpointParams,logger:logger2,referenceRecord:{}});null==(_e2=null==(_d2=options.logger)?void 0:_d2.debug)||_e2.call(_d2,`endpoints Resolved endpoint: ${toDebugString(endpoint)}`);return endpoint};selectedPartitionsInfo={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],version:"1.1"};getUserAgentPrefix=()=>"";awsEndpointFunctions={isVirtualHostableS3Bucket:isVirtualHostableS3Bucket=(value,allowSubDomains=!1)=>{if(allowSubDomains){for(const label2 of value.split("."))if(!isVirtualHostableS3Bucket(label2))return!1;return!0}return!(!isValidHostLabel(value)||value.length<3||value.length>63||value!==value.toLowerCase()||isIpAddress(value))},parseArn:value=>{const segments=value.split(":");if(segments.length<6)return null;const[arn,partition2,service,region,accountId,...resourcePath]=segments;return"arn"!==arn||""===partition2||""===service||""===resourcePath.join(":")?null:{partition:partition2,service,region,accountId,resourceId:resourcePath.map(resource=>resource.split("/")).flat()}},partition:value=>{const{partitions}=selectedPartitionsInfo;for(const partition2 of partitions){const{regions,outputs}=partition2;for(const[region,regionData]of Object.entries(regions))if(region===value)return{...outputs,...regionData}}for(const partition2 of partitions){const{regionRegex,outputs}=partition2;if(new RegExp(regionRegex).test(value))return{...outputs}}const DEFAULT_PARTITION=partitions.find(partition2=>"aws"===partition2.id);if(!DEFAULT_PARTITION)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...DEFAULT_PARTITION.outputs}}};customEndpointFunctions.aws=awsEndpointFunctions;(function(RETRY_MODES2){RETRY_MODES2.STANDARD="standard";RETRY_MODES2.ADAPTIVE="adaptive"})(RETRY_MODES||(RETRY_MODES={}));DEFAULT_RETRY_MODE=RETRY_MODES.STANDARD;THROTTLING_ERROR_CODES=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"];TRANSIENT_ERROR_CODES=["TimeoutError","RequestTimeout","RequestTimeoutException"];TRANSIENT_ERROR_STATUS_CODES=[500,502,503,504];NODEJS_TIMEOUT_ERROR_CODES=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"];NODEJS_NETWORK_ERROR_CODES=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"];isRetryableByTrait=error=>void 0!==(null==error?void 0:error.$retryable);isClockSkewCorrectedError=error=>{var _a8;return null==(_a8=error.$metadata)?void 0:_a8.clockSkewCorrected};isBrowserNetworkError=error=>!!(error&&error instanceof TypeError)&&new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]).has(error.message);isThrottlingError=error=>{var _a8,_b5;return 429===(null==(_a8=error.$metadata)?void 0:_a8.httpStatusCode)||THROTTLING_ERROR_CODES.includes(error.name)||1==(null==(_b5=error.$retryable)?void 0:_b5.throttling)};isTransientError=(error,depth=0)=>{var _a8;return isRetryableByTrait(error)||isClockSkewCorrectedError(error)||TRANSIENT_ERROR_CODES.includes(error.name)||NODEJS_TIMEOUT_ERROR_CODES.includes((null==error?void 0:error.code)||"")||NODEJS_NETWORK_ERROR_CODES.includes((null==error?void 0:error.code)||"")||TRANSIENT_ERROR_STATUS_CODES.includes((null==(_a8=error.$metadata)?void 0:_a8.httpStatusCode)||0)||isBrowserNetworkError(error)||void 0!==error.cause&&depth<=10&&isTransientError(error.cause,depth+1)};isServerError=error=>{var _a8;if(void 0!==(null==(_a8=error.$metadata)?void 0:_a8.httpStatusCode)){const statusCode=error.$metadata.httpStatusCode;return 500<=statusCode&&statusCode<=599&&!isTransientError(error)}return!1};_DefaultRateLimiter=class _DefaultRateLimiter{constructor(options){__publicField(this,"beta");__publicField(this,"minCapacity");__publicField(this,"minFillRate");__publicField(this,"scaleConstant");__publicField(this,"smooth");__publicField(this,"currentCapacity",0);__publicField(this,"enabled",!1);__publicField(this,"lastMaxRate",0);__publicField(this,"measuredTxRate",0);__publicField(this,"requestCount",0);__publicField(this,"fillRate");__publicField(this,"lastThrottleTime");__publicField(this,"lastTimestamp",0);__publicField(this,"lastTxRateBucket");__publicField(this,"maxCapacity");__publicField(this,"timeWindow",0);var _a8,_b5,_c3,_d2,_e2;this.beta=null!=(_a8=null==options?void 0:options.beta)?_a8:.7;this.minCapacity=null!=(_b5=null==options?void 0:options.minCapacity)?_b5:1;this.minFillRate=null!=(_c3=null==options?void 0:options.minFillRate)?_c3:.5;this.scaleConstant=null!=(_d2=null==options?void 0:options.scaleConstant)?_d2:.4;this.smooth=null!=(_e2=null==options?void 0:options.smooth)?_e2:.8;const currentTimeInSeconds=this.getCurrentTimeInSeconds();this.lastThrottleTime=currentTimeInSeconds;this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds());this.fillRate=this.minFillRate;this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(amount){if(this.enabled){this.refillTokenBucket();if(amount>this.currentCapacity){const delay2=(amount-this.currentCapacity)/this.fillRate*1e3;await new Promise(resolve=>_DefaultRateLimiter.setTimeoutFn(resolve,delay2))}this.currentCapacity=this.currentCapacity-amount}}refillTokenBucket(){const timestamp=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=timestamp;return}const fillAmount=(timestamp-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+fillAmount);this.lastTimestamp=timestamp}updateClientSendingRate(response){let calculatedRate;this.updateMeasuredRate();if(isThrottlingError(response)){const rateToUse=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=rateToUse;this.calculateTimeWindow();this.lastThrottleTime=this.getCurrentTimeInSeconds();calculatedRate=this.cubicThrottle(rateToUse);this.enableTokenBucket()}else{this.calculateTimeWindow();calculatedRate=this.cubicSuccess(this.getCurrentTimeInSeconds())}const newRate=Math.min(calculatedRate,2*this.measuredTxRate);this.updateTokenBucketRate(newRate)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(rateToUse){return this.getPrecise(rateToUse*this.beta)}cubicSuccess(timestamp){return this.getPrecise(this.scaleConstant*Math.pow(timestamp-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(newRate){this.refillTokenBucket();this.fillRate=Math.max(newRate,this.minFillRate);this.maxCapacity=Math.max(newRate,this.minCapacity);this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const t9=this.getCurrentTimeInSeconds(),timeBucket=Math.floor(2*t9)/2;this.requestCount++;if(timeBucket>this.lastTxRateBucket){const currentRate=this.requestCount/(timeBucket-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(currentRate*this.smooth+this.measuredTxRate*(1-this.smooth));this.requestCount=0;this.lastTxRateBucket=timeBucket}}getPrecise(num){return parseFloat(num.toFixed(8))}};__publicField(_DefaultRateLimiter,"setTimeoutFn",setTimeout);DefaultRateLimiter=_DefaultRateLimiter;getDefaultRetryBackoffStrategy=()=>{let delayBase=100;return{computeNextBackoffDelay:attempts=>Math.floor(Math.min(2e4,Math.random()*2**attempts*delayBase)),setDelayBase:delay2=>{delayBase=delay2}}};createDefaultRetryToken=({retryDelay,retryCount,retryCost})=>({getRetryCount:()=>retryCount,getRetryDelay:()=>Math.min(2e4,retryDelay),getRetryCost:()=>retryCost});StandardRetryStrategy=class{constructor(maxAttempts){__publicField(this,"maxAttempts");__publicField(this,"mode",RETRY_MODES.STANDARD);__publicField(this,"capacity",500);__publicField(this,"retryBackoffStrategy",getDefaultRetryBackoffStrategy());__publicField(this,"maxAttemptsProvider");this.maxAttempts=maxAttempts;this.maxAttemptsProvider="function"==typeof maxAttempts?maxAttempts:async()=>maxAttempts}async acquireInitialRetryToken(retryTokenScope){return createDefaultRetryToken({retryDelay:100,retryCount:0})}async refreshRetryTokenForRetry(token,errorInfo){const maxAttempts=await this.getMaxAttempts();if(this.shouldRetry(token,errorInfo,maxAttempts)){const errorType=errorInfo.errorType;this.retryBackoffStrategy.setDelayBase("THROTTLING"===errorType?500:100);const delayFromErrorType=this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()),retryDelay=errorInfo.retryAfterHint?Math.max(errorInfo.retryAfterHint.getTime()-Date.now()||0,delayFromErrorType):delayFromErrorType,capacityCost=this.getCapacityCost(errorType);this.capacity-=capacityCost;return createDefaultRetryToken({retryDelay,retryCount:token.getRetryCount()+1,retryCost:capacityCost})}throw new Error("No retry token available")}recordSuccess(token){var _a8;this.capacity=Math.max(500,this.capacity+(null!=(_a8=token.getRetryCost())?_a8:1))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(error){console.warn("Max attempts provider could not resolve. Using default of 3");return 3}}shouldRetry(tokenToRenew,errorInfo,maxAttempts){return tokenToRenew.getRetryCount()+1=this.getCapacityCost(errorInfo.errorType)&&this.isRetryableError(errorInfo.errorType)}getCapacityCost(errorType){return"TRANSIENT"===errorType?10:5}isRetryableError(errorType){return"THROTTLING"===errorType||"TRANSIENT"===errorType}};AdaptiveRetryStrategy=class{constructor(maxAttemptsProvider,options){__publicField(this,"maxAttemptsProvider");__publicField(this,"rateLimiter");__publicField(this,"standardRetryStrategy");__publicField(this,"mode",RETRY_MODES.ADAPTIVE);this.maxAttemptsProvider=maxAttemptsProvider;const{rateLimiter}=null!=options?options:{};this.rateLimiter=null!=rateLimiter?rateLimiter:new DefaultRateLimiter;this.standardRetryStrategy=new StandardRetryStrategy(maxAttemptsProvider)}async acquireInitialRetryToken(retryTokenScope){await this.rateLimiter.getSendToken();return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope)}async refreshRetryTokenForRetry(tokenToRenew,errorInfo){this.rateLimiter.updateClientSendingRate(errorInfo);return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew,errorInfo)}recordSuccess(token){this.rateLimiter.updateClientSendingRate({});this.standardRetryStrategy.recordSuccess(token)}};ConfiguredRetryStrategy=class extends StandardRetryStrategy{constructor(maxAttempts,computeNextBackoffDelay=100){super("function"==typeof maxAttempts?maxAttempts:async()=>maxAttempts);__publicField(this,"computeNextBackoffDelay");this.computeNextBackoffDelay="number"==typeof computeNextBackoffDelay?()=>computeNextBackoffDelay:computeNextBackoffDelay}async refreshRetryTokenForRetry(tokenToRenew,errorInfo){const token=await super.refreshRetryTokenForRetry(tokenToRenew,errorInfo);token.getRetryDelay=()=>this.computeNextBackoffDelay(token.getRetryCount());return token}};ACCOUNT_ID_ENDPOINT_REGEX=/\d{12}\.ddb/;UA_NAME_ESCAPE_REGEX=/[^!$%&'*+\-.^_`|~\w]/g;UA_VALUE_ESCAPE_REGEX=/[^!$%&'*+\-.^_`|~\w#]/g;BYTE_LIMIT=1024;userAgentMiddleware=options=>(next2,context2)=>async args=>{var _a8,_b5,_c3,_d2;const{request:request2}=args;if(!HttpRequest.isInstance(request2))return next2(args);const{headers}=request2,userAgent=(null==(_a8=null==context2?void 0:context2.userAgent)?void 0:_a8.map(escapeUserAgent))||[],defaultUserAgent2=(await options.defaultUserAgentProvider()).map(escapeUserAgent);await checkFeatures(context2,options,args);const awsContext=context2;defaultUserAgent2.push(`m/${encodeFeatures(Object.assign({},null==(_b5=context2.__smithy_context)?void 0:_b5.features,null==(_c3=awsContext.__aws_sdk_context)?void 0:_c3.features))}`);const customUserAgent=(null==(_d2=null==options?void 0:options.customUserAgent)?void 0:_d2.map(escapeUserAgent))||[],appId=await options.userAgentAppId();appId&&defaultUserAgent2.push(escapeUserAgent(["app",`${appId}`]));const prefix=getUserAgentPrefix(),sdkUserAgentValue=(prefix?[prefix]:[]).concat([...defaultUserAgent2,...userAgent,...customUserAgent]).join(" "),normalUAValue=[...defaultUserAgent2.filter(section=>section.startsWith("aws-sdk-")),...customUserAgent].join(" ");if("browser"!==options.runtime){normalUAValue&&(headers["x-amz-user-agent"]=headers["x-amz-user-agent"]?`${headers["user-agent"]} ${normalUAValue}`:normalUAValue);headers["user-agent"]=sdkUserAgentValue}else headers["x-amz-user-agent"]=sdkUserAgentValue;return next2({...args,request:request2})};escapeUserAgent=userAgentPair=>{var _a8;const name=userAgentPair[0].split("/").map(part=>part.replace(UA_NAME_ESCAPE_REGEX,"-")).join("/"),version2=null==(_a8=userAgentPair[1])?void 0:_a8.replace(UA_VALUE_ESCAPE_REGEX,"-"),prefixSeparatorIndex=name.indexOf("/"),prefix=name.substring(0,prefixSeparatorIndex);let uaName=name.substring(prefixSeparatorIndex+1);"api"===prefix&&(uaName=uaName.toLowerCase());return[prefix,uaName,version2].filter(item=>item&&item.length>0).reduce((acc,item,index6)=>{switch(index6){case 0:return item;case 1:return`${acc}/${item}`;default:return`${acc}#${item}`}},"")};getUserAgentMiddlewareOptions={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0};getUserAgentPlugin=config=>({applyToStack:clientStack=>{clientStack.add(userAgentMiddleware(config),getUserAgentMiddlewareOptions)}});validRegions=new Set;checkRegion=(region,check=isValidHostLabel)=>{if(validRegions.has(region)||check(region))validRegions.add(region);else{if("*"!==region)throw new Error(`Region not accepted: region="${region}" is not a valid hostname component.`);console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.')}};isFipsRegion=region=>"string"==typeof region&&(region.startsWith("fips-")||region.endsWith("-fips"));getRealRegion=region=>isFipsRegion(region)?["fips-aws-global","aws-fips"].includes(region)?"us-east-1":region.replace(/fips-(dkr-|prod-)?|-fips/,""):region;resolveRegionConfig=input=>{const{region,useFipsEndpoint}=input;if(!region)throw new Error("Region is missing");return Object.assign(input,{region:async()=>{const providedRegion="function"==typeof region?await region():region,realRegion=getRealRegion(providedRegion);checkRegion(realRegion);return realRegion},useFipsEndpoint:async()=>{const providedRegion="string"==typeof region?region:await region();return!!isFipsRegion(providedRegion)||("function"!=typeof useFipsEndpoint?Promise.resolve(!!useFipsEndpoint):useFipsEndpoint())}})};resolveEventStreamSerdeConfig=input=>Object.assign(input,{eventStreamMarshaller:input.eventStreamSerdeProvider(input)});CONTENT_LENGTH_HEADER2="content-length";contentLengthMiddlewareOptions={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0};getContentLengthPlugin=options=>({applyToStack:clientStack=>{clientStack.add(contentLengthMiddleware(options.bodyLengthChecker),contentLengthMiddlewareOptions)}});resolveParamsForS3=async endpointParams=>{const bucket=(null==endpointParams?void 0:endpointParams.Bucket)||"";"string"==typeof endpointParams.Bucket&&(endpointParams.Bucket=bucket.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?")));if(isArnBucketName(bucket)){if(!0===endpointParams.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!isDnsCompatibleBucketName(bucket)||-1!==bucket.indexOf(".")&&!String(endpointParams.Endpoint).startsWith("http:")||bucket.toLowerCase()!==bucket||bucket.length<3)&&(endpointParams.ForcePathStyle=!0);if(endpointParams.DisableMultiRegionAccessPoints){endpointParams.disableMultiRegionAccessPoints=!0;endpointParams.DisableMRAP=!0}return endpointParams};DOMAIN_PATTERN=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/;IP_ADDRESS_PATTERN=/(\d+\.){3}\d+/;DOTS_PATTERN=/\.\./;isDnsCompatibleBucketName=bucketName=>DOMAIN_PATTERN.test(bucketName)&&!IP_ADDRESS_PATTERN.test(bucketName)&&!DOTS_PATTERN.test(bucketName);isArnBucketName=bucketName=>{const[arn,partition2,service,,,bucket]=bucketName.split(":"),isArn="arn"===arn&&bucketName.split(":").length>=6,isValidArn=Boolean(isArn&&partition2&&service&&bucket);if(isArn&&!isValidArn)throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`);return isValidArn};createConfigValueProvider=(configKey,canonicalEndpointParamKey,config,isClientContextParam=!1)=>{const configProvider=async()=>{var _a8,_b5;let configValue;if(isClientContextParam){const clientContextParams=config.clientContextParams,nestedValue=null==clientContextParams?void 0:clientContextParams[configKey];configValue=null!=(_a8=null!=nestedValue?nestedValue:config[configKey])?_a8:config[canonicalEndpointParamKey]}else configValue=null!=(_b5=config[configKey])?_b5:config[canonicalEndpointParamKey];return"function"==typeof configValue?configValue():configValue};return"credentialScope"===configKey||"CredentialScope"===canonicalEndpointParamKey?async()=>{var _a8;const credentials="function"==typeof config.credentials?await config.credentials():config.credentials;return null!=(_a8=null==credentials?void 0:credentials.credentialScope)?_a8:null==credentials?void 0:credentials.CredentialScope}:"accountId"===configKey||"AccountId"===canonicalEndpointParamKey?async()=>{var _a8;const credentials="function"==typeof config.credentials?await config.credentials():config.credentials;return null!=(_a8=null==credentials?void 0:credentials.accountId)?_a8:null==credentials?void 0:credentials.AccountId}:"endpoint"===configKey||"endpoint"===canonicalEndpointParamKey?async()=>{if(!1===config.isCustomEndpoint)return;const endpoint=await configProvider();if(endpoint&&"object"==typeof endpoint){if("url"in endpoint)return endpoint.url.href;if("hostname"in endpoint){const{protocol,hostname,port,path:path2}=endpoint;return`${protocol}//${hostname}${port?":"+port:""}${path2}`}}return endpoint}:configProvider};getEndpointFromConfig=async serviceId=>{};toEndpointV12=endpoint=>{if("object"==typeof endpoint){if("url"in endpoint){const v1Endpoint=parseUrl(endpoint.url);if(endpoint.headers){v1Endpoint.headers={};for(const[name,values2]of Object.entries(endpoint.headers))v1Endpoint.headers[name.toLowerCase()]=values2.join(", ")}return v1Endpoint}return endpoint}return parseUrl(endpoint)};getEndpointFromInstructions=async(commandInput,instructionsSupplier,clientConfig,context2)=>{if(!clientConfig.isCustomEndpoint){let endpointFromConfig;endpointFromConfig=clientConfig.serviceConfiguredEndpoint?await clientConfig.serviceConfiguredEndpoint():await getEndpointFromConfig(clientConfig.serviceId);if(endpointFromConfig){clientConfig.endpoint=()=>Promise.resolve(toEndpointV12(endpointFromConfig));clientConfig.isCustomEndpoint=!0}}const endpointParams=await resolveParams(commandInput,instructionsSupplier,clientConfig);if("function"!=typeof clientConfig.endpointProvider)throw new Error("config.endpointProvider is not set.");const endpoint=clientConfig.endpointProvider(endpointParams,context2);if(clientConfig.isCustomEndpoint&&clientConfig.endpoint){const customEndpoint=await clientConfig.endpoint();if(null==customEndpoint?void 0:customEndpoint.headers){null!=endpoint.headers||(endpoint.headers={});for(const[name,value]of Object.entries(customEndpoint.headers))endpoint.headers[name]=Array.isArray(value)?value:[value]}}return endpoint};resolveParams=async(commandInput,instructionsSupplier,clientConfig)=>{var _a8;const endpointParams={},instructions=(null==(_a8=null==instructionsSupplier?void 0:instructionsSupplier.getEndpointParameterInstructions)?void 0:_a8.call(instructionsSupplier))||{};for(const[name,instruction]of Object.entries(instructions))switch(instruction.type){case"staticContextParams":endpointParams[name]=instruction.value;break;case"contextParams":endpointParams[name]=commandInput[instruction.name];break;case"clientContextParams":case"builtInParams":endpointParams[name]=await createConfigValueProvider(instruction.name,name,clientConfig,"builtInParams"!==instruction.type)();break;case"operationContextParams":endpointParams[name]=instruction.get(commandInput);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(instruction))}0===Object.keys(instructions).length&&Object.assign(endpointParams,clientConfig);"s3"===String(clientConfig.serviceId).toLowerCase()&&await resolveParamsForS3(endpointParams);return endpointParams};endpointMiddleware=({config,instructions})=>(next2,context2)=>async args=>{var _a8,_b5,_c3;config.isCustomEndpoint&&setFeature2(context2,"ENDPOINT_OVERRIDE","N");const endpoint=await getEndpointFromInstructions(args.input,{getEndpointParameterInstructions:()=>instructions},{...config},context2);context2.endpointV2=endpoint;context2.authSchemes=null==(_a8=endpoint.properties)?void 0:_a8.authSchemes;const authScheme=null==(_b5=context2.authSchemes)?void 0:_b5[0];if(authScheme){context2.signing_region=authScheme.signingRegion;context2.signing_service=authScheme.signingName;const smithyContext=getSmithyContext(context2),httpAuthOption=null==(_c3=null==smithyContext?void 0:smithyContext.selectedHttpAuthScheme)?void 0:_c3.httpAuthOption;httpAuthOption&&(httpAuthOption.signingProperties=Object.assign(httpAuthOption.signingProperties||{},{signing_region:authScheme.signingRegion,signingRegion:authScheme.signingRegion,signing_service:authScheme.signingName,signingName:authScheme.signingName,signingRegionSet:authScheme.signingRegionSet},authScheme.properties))}return next2({...args})};endpointMiddlewareOptions={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"};getEndpointPlugin=(config,instructions)=>({applyToStack:clientStack=>{clientStack.addRelativeTo(endpointMiddleware({config,instructions}),endpointMiddlewareOptions)}});resolveEndpointConfig=input=>{var _a8;const tls=null==(_a8=input.tls)||_a8,{endpoint,useDualstackEndpoint,useFipsEndpoint}=input,customEndpointProvider=null!=endpoint?async()=>toEndpointV12(await normalizeProvider(endpoint)()):void 0,isCustomEndpoint=!!endpoint,resolvedConfig=Object.assign(input,{endpoint:customEndpointProvider,tls,isCustomEndpoint,useDualstackEndpoint:normalizeProvider(null!=useDualstackEndpoint&&useDualstackEndpoint),useFipsEndpoint:normalizeProvider(null!=useFipsEndpoint&&useFipsEndpoint)});let configuredEndpointPromise;resolvedConfig.serviceConfiguredEndpoint=async()=>{input.serviceId&&!configuredEndpointPromise&&(configuredEndpointPromise=getEndpointFromConfig(input.serviceId));return configuredEndpointPromise};return resolvedConfig};asSdkError=error=>error instanceof Error?error:error instanceof Object?Object.assign(new Error,error):"string"==typeof error?new Error(error):new Error(`AWS SDK error wrapper for ${error}`);resolveRetryConfig=input=>{var _a8;const{retryStrategy,retryMode}=input,maxAttempts=normalizeProvider(null!=(_a8=input.maxAttempts)?_a8:3);let controller=retryStrategy?Promise.resolve(retryStrategy):void 0;const getDefault=async()=>await normalizeProvider(retryMode)()===RETRY_MODES.ADAPTIVE?new AdaptiveRetryStrategy(maxAttempts):new StandardRetryStrategy(maxAttempts);return Object.assign(input,{maxAttempts,retryStrategy:()=>null!=controller?controller:controller=getDefault()})};isStreamingPayload=request2=>(null==request2?void 0:request2.body)instanceof ReadableStream;retryMiddleware=options=>(next2,context2)=>async args=>{var _a8;let retryStrategy=await options.retryStrategy();const maxAttempts=await options.maxAttempts();if(!isRetryStrategyV2(retryStrategy)){(null==retryStrategy?void 0:retryStrategy.mode)&&(context2.userAgent=[...context2.userAgent||[],["cfg/retry-mode",retryStrategy.mode]]);return retryStrategy.retry(next2,args)}{let retryToken=await retryStrategy.acquireInitialRetryToken(context2.partition_id),lastError=new Error,attempts=0,totalRetryDelay=0;const{request:request2}=args,isRequest=HttpRequest.isInstance(request2);isRequest&&(request2.headers["amz-sdk-invocation-id"]=v4());for(;;)try{isRequest&&(request2.headers["amz-sdk-request"]=`attempt=${attempts+1}; max=${maxAttempts}`);const{response,output}=await next2(args);retryStrategy.recordSuccess(retryToken);output.$metadata.attempts=attempts+1;output.$metadata.totalRetryDelay=totalRetryDelay;return{response,output}}catch(e3){const retryErrorInfo=getRetryErrorInfo(e3);lastError=asSdkError(e3);if(isRequest&&isStreamingPayload(request2)){null==(_a8=context2.logger instanceof NoOpLogger?console:context2.logger)||_a8.warn("An error was encountered in a non-retryable streaming request.");throw lastError}try{retryToken=await retryStrategy.refreshRetryTokenForRetry(retryToken,retryErrorInfo)}catch(refreshError){lastError.$metadata||(lastError.$metadata={});lastError.$metadata.attempts=attempts+1;lastError.$metadata.totalRetryDelay=totalRetryDelay;throw lastError}attempts=retryToken.getRetryCount();const delay2=retryToken.getRetryDelay();totalRetryDelay+=delay2;await new Promise(resolve=>setTimeout(resolve,delay2))}}};isRetryStrategyV2=retryStrategy=>void 0!==retryStrategy.acquireInitialRetryToken&&void 0!==retryStrategy.refreshRetryTokenForRetry&&void 0!==retryStrategy.recordSuccess;getRetryErrorInfo=error=>{const errorInfo={error,errorType:getRetryErrorType(error)},retryAfterHint=getRetryAfterHint(error.$response);retryAfterHint&&(errorInfo.retryAfterHint=retryAfterHint);return errorInfo};getRetryErrorType=error=>isThrottlingError(error)?"THROTTLING":isTransientError(error)?"TRANSIENT":isServerError(error)?"SERVER_ERROR":"CLIENT_ERROR";retryMiddlewareOptions={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};getRetryPlugin=options=>({applyToStack:clientStack=>{clientStack.add(retryMiddleware(options),retryMiddlewareOptions)}});getRetryAfterHint=response=>{if(!HttpResponse.isInstance(response))return;const retryAfterHeaderName=Object.keys(response.headers).find(key3=>"retry-after"===key3.toLowerCase());if(!retryAfterHeaderName)return;const retryAfter=response.headers[retryAfterHeaderName],retryAfterSeconds=Number(retryAfter);return Number.isNaN(retryAfterSeconds)?new Date(retryAfter):new Date(1e3*retryAfterSeconds)};SignatureV4MultiRegion=class{constructor(options){__publicField(this,"sigv4aSigner");__publicField(this,"sigv4Signer");__publicField(this,"signerOptions");this.sigv4Signer=new SignatureV4S3Express(options);this.signerOptions=options}static sigv4aDependency(){return"none"}async sign(requestToSign,options={}){return"*"===options.signingRegion?this.getSigv4aSigner().sign(requestToSign,options):this.sigv4Signer.sign(requestToSign,options)}async signWithCredentials(requestToSign,credentials,options={}){if("*"===options.signingRegion){this.getSigv4aSigner();throw new Error('signWithCredentials with signingRegion \'*\' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt')}return this.sigv4Signer.signWithCredentials(requestToSign,credentials,options)}async presign(originalRequest,options={}){if("*"===options.signingRegion){this.getSigv4aSigner();throw new Error('presign with signingRegion \'*\' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt')}return this.sigv4Signer.presign(originalRequest,options)}async presignWithCredentials(originalRequest,credentials,options={}){if("*"===options.signingRegion)throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(originalRequest,credentials,options)}getSigv4aSigner(){if(!this.sigv4aSigner){const CrtSignerV4=null,JsSigV4aSigner=null;if("node"===this.signerOptions.runtime){if(!CrtSignerV4&&!JsSigV4aSigner)throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(CrtSignerV4&&"function"==typeof CrtSignerV4)this.sigv4aSigner=new CrtSignerV4({...this.signerOptions,signingAlgorithm:1});else{if(!JsSigV4aSigner||"function"!=typeof JsSigV4aSigner)throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");this.sigv4aSigner=new JsSigV4aSigner({...this.signerOptions})}}else{if(!JsSigV4aSigner||"function"!=typeof JsSigV4aSigner)throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new JsSigV4aSigner({...this.signerOptions})}}return this.sigv4aSigner}};cs="required",ct="type",cu="rules",cv="conditions",cw="fn",cx="argv",cy="ref",cz="assign",cA="url",cB="properties",cC="backend",cD="authSchemes",cE="disableDoubleEncoding",cF="signingName",cG="signingRegion",cH="headers",cI="signingRegionSet";c=!0,d3="isSet",e2="booleanEquals",f="error",g="aws.partition",h="stringEquals",i="getAttr",j="name",k="substring",l="bucketSuffix",m2="parseURL",n2="endpoint",o="tree",p="aws.isVirtualHostableS3Bucket",q="{url#scheme}://{Bucket}.{url#authority}{url#path}",r3="not",s="accessPointSuffix",t8="{url#scheme}://{url#authority}{url#path}",u="hardwareType",v="regionPrefix",w="bucketAliasSuffix",x="outpostId",y="isValidHostLabel",z="sigv4a",A="s3-outposts",B="s3",C2="{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",D="https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",E="https://{Bucket}.s3.{partitionResult#dnsSuffix}",F="aws.parseArn",G2="bucketArn",H="arnType",J="s3-object-lambda",K="accesspoint",L3="accessPointName",M2="{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",N2="mrapPartition",O="outpostType",P2="arnPrefix",Q="{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",R="https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",S="https://s3.{partitionResult#dnsSuffix}",T={[cs]:!1,[ct]:"string"},U={[cs]:!0,default:!1,[ct]:"boolean"},V={[cs]:!1,[ct]:"boolean"},W2={[cw]:e2,[cx]:[{[cy]:"Accelerate"},!0]},X={[cw]:e2,[cx]:[{[cy]:"UseFIPS"},!0]},Y={[cw]:e2,[cx]:[{[cy]:"UseDualStack"},!0]},Z={[cw]:d3,[cx]:[{[cy]:"Endpoint"}]},aa={[cw]:g,[cx]:[{[cy]:"Region"}],[cz]:"partitionResult"},ab={[cw]:h,[cx]:[{[cw]:i,[cx]:[{[cy]:"partitionResult"},j]},"aws-cn"]},ac={[cw]:d3,[cx]:[{[cy]:"Bucket"}]},ad={[cy]:"Bucket"},ae={[cv]:[W2],[f]:"S3Express does not support S3 Accelerate.",[ct]:f},af={[cv]:[Z,{[cw]:m2,[cx]:[{[cy]:"Endpoint"}],[cz]:"url"}],[cu]:[{[cv]:[{[cw]:d3,[cx]:[{[cy]:"DisableS3ExpressSessionAuth"}]},{[cw]:e2,[cx]:[{[cy]:"DisableS3ExpressSessionAuth"},!0]}],[cu]:[{[cv]:[{[cw]:e2,[cx]:[{[cw]:i,[cx]:[{[cy]:"url"},"isIp"]},!0]}],[cu]:[{[cv]:[{[cw]:"uriEncode",[cx]:[ad],[cz]:"uri_encoded_bucket"}],[cu]:[{[n2]:{[cA]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[cB]:{[cC]:"S3Express",[cD]:[{[cE]:!0,[j]:"sigv4",[cF]:"s3express",[cG]:"{Region}"}]},[cH]:{}},[ct]:n2}],[ct]:o}],[ct]:o},{[cv]:[{[cw]:p,[cx]:[ad,!1]}],[cu]:[{[n2]:{[cA]:q,[cB]:{[cC]:"S3Express",[cD]:[{[cE]:!0,[j]:"sigv4",[cF]:"s3express",[cG]:"{Region}"}]},[cH]:{}},[ct]:n2}],[ct]:o},{[f]:"S3Express bucket name is not a valid virtual hostable name.",[ct]:f}],[ct]:o},{[cv]:[{[cw]:e2,[cx]:[{[cw]:i,[cx]:[{[cy]:"url"},"isIp"]},!0]}],[cu]:[{[cv]:[{[cw]:"uriEncode",[cx]:[ad],[cz]:"uri_encoded_bucket"}],[cu]:[{[n2]:{[cA]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[cB]:{[cC]:"S3Express",[cD]:[{[cE]:!0,[j]:"sigv4-s3express",[cF]:"s3express",[cG]:"{Region}"}]},[cH]:{}},[ct]:n2}],[ct]:o}],[ct]:o},{[cv]:[{[cw]:p,[cx]:[ad,!1]}],[cu]:[{[n2]:{[cA]:q,[cB]:{[cC]:"S3Express",[cD]:[{[cE]:!0,[j]:"sigv4-s3express",[cF]:"s3express",[cG]:"{Region}"}]},[cH]:{}},[ct]:n2}],[ct]:o},{[f]:"S3Express bucket name is not a valid virtual hostable name.",[ct]:f}],[ct]:o},ag={[cw]:m2,[cx]:[{[cy]:"Endpoint"}],[cz]:"url"},ah={[cw]:e2,[cx]:[{[cw]:i,[cx]:[{[cy]:"url"},"isIp"]},!0]},ai={[cy]:"url"},aj={[cw]:"uriEncode",[cx]:[ad],[cz]:"uri_encoded_bucket"},ak={[cC]:"S3Express",[cD]:[{[cE]:!0,[j]:"sigv4",[cF]:"s3express",[cG]:"{Region}"}]},al={},am={[cw]:p,[cx]:[ad,!1]},an={[f]:"S3Express bucket name is not a valid virtual hostable name.",[ct]:f},ao={[cw]:d3,[cx]:[{[cy]:"UseS3ExpressControlEndpoint"}]},ap={[cw]:e2,[cx]:[{[cy]:"UseS3ExpressControlEndpoint"},!0]},aq={[cw]:r3,[cx]:[Z]},ar={[cw]:e2,[cx]:[{[cy]:"UseDualStack"},!1]},as={[cw]:e2,[cx]:[{[cy]:"UseFIPS"},!1]},at={[f]:"Unrecognized S3Express bucket name format.",[ct]:f},au={[cw]:r3,[cx]:[ac]},av={[cy]:u},aw={[cv]:[aq],[f]:"Expected a endpoint to be specified but no endpoint was found",[ct]:f},ax={[cD]:[{[cE]:!0,[j]:z,[cF]:A,[cI]:["*"]},{[cE]:!0,[j]:"sigv4",[cF]:A,[cG]:"{Region}"}]},ay={[cw]:e2,[cx]:[{[cy]:"ForcePathStyle"},!1]},az={[cy]:"ForcePathStyle"},aA={[cw]:e2,[cx]:[{[cy]:"Accelerate"},!1]},aB={[cw]:h,[cx]:[{[cy]:"Region"},"aws-global"]},aC={[cD]:[{[cE]:!0,[j]:"sigv4",[cF]:B,[cG]:"us-east-1"}]},aD={[cw]:r3,[cx]:[aB]},aE={[cw]:e2,[cx]:[{[cy]:"UseGlobalEndpoint"},!0]},aF={[cA]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[cB]:{[cD]:[{[cE]:!0,[j]:"sigv4",[cF]:B,[cG]:"{Region}"}]},[cH]:{}},aG={[cD]:[{[cE]:!0,[j]:"sigv4",[cF]:B,[cG]:"{Region}"}]},aH={[cw]:e2,[cx]:[{[cy]:"UseGlobalEndpoint"},!1]},aI={[cA]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",[cB]:aG,[cH]:{}},aJ={[cA]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",[cB]:aG,[cH]:{}},aK={[cA]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[cB]:aG,[cH]:{}},aL={[cw]:e2,[cx]:[{[cw]:i,[cx]:[ai,"isIp"]},!1]},aM={[cA]:C2,[cB]:aG,[cH]:{}},aN={[cA]:q,[cB]:aG,[cH]:{}},aO={[n2]:aN,[ct]:n2},aP={[cA]:D,[cB]:aG,[cH]:{}},aQ={[cA]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",[cB]:aG,[cH]:{}},aR={[f]:"Invalid region: region was not a valid DNS name.",[ct]:f},aS={[cy]:G2},aT={[cy]:H},aU={[cw]:i,[cx]:[aS,"service"]},aV={[cy]:L3},aW={[cv]:[Y],[f]:"S3 Object Lambda does not support Dual-stack",[ct]:f},aX={[cv]:[W2],[f]:"S3 Object Lambda does not support S3 Accelerate",[ct]:f},aY={[cv]:[{[cw]:d3,[cx]:[{[cy]:"DisableAccessPoints"}]},{[cw]:e2,[cx]:[{[cy]:"DisableAccessPoints"},!0]}],[f]:"Access points are not supported for this operation",[ct]:f},aZ={[cv]:[{[cw]:d3,[cx]:[{[cy]:"UseArnRegion"}]},{[cw]:e2,[cx]:[{[cy]:"UseArnRegion"},!1]},{[cw]:r3,[cx]:[{[cw]:h,[cx]:[{[cw]:i,[cx]:[aS,"region"]},"{Region}"]}]}],[f]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",[ct]:f},ba={[cw]:i,[cx]:[{[cy]:"bucketPartition"},j]},bb={[cw]:i,[cx]:[aS,"accountId"]},bc={[cD]:[{[cE]:!0,[j]:"sigv4",[cF]:J,[cG]:"{bucketArn#region}"}]},bd={[f]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",[ct]:f},be={[f]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",[ct]:f},bf={[f]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",[ct]:f},bg={[f]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",[ct]:f},bh={[f]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",[ct]:f},bi={[f]:"Invalid ARN: Expected a resource of the format `accesspoint:` but no name was provided",[ct]:f},bj={[cD]:[{[cE]:!0,[j]:"sigv4",[cF]:B,[cG]:"{bucketArn#region}"}]},bk={[cD]:[{[cE]:!0,[j]:z,[cF]:A,[cI]:["*"]},{[cE]:!0,[j]:"sigv4",[cF]:A,[cG]:"{bucketArn#region}"}]},bl={[cw]:F,[cx]:[ad]},bm={[cA]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[cB]:aG,[cH]:{}},bn={[cA]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[cB]:aG,[cH]:{}},bo={[cA]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[cB]:aG,[cH]:{}},bp={[cA]:Q,[cB]:aG,[cH]:{}},bq={[cA]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[cB]:aG,[cH]:{}},br={[cy]:"UseObjectLambdaEndpoint"},bs={[cD]:[{[cE]:!0,[j]:"sigv4",[cF]:J,[cG]:"{Region}"}]},bt={[cA]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[cB]:aG,[cH]:{}},bu={[cA]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",[cB]:aG,[cH]:{}},bv={[cA]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[cB]:aG,[cH]:{}},bw={[cA]:t8,[cB]:aG,[cH]:{}},bx={[cA]:"https://s3.{Region}.{partitionResult#dnsSuffix}",[cB]:aG,[cH]:{}},by=[{[cy]:"Region"}],bz=[{[cy]:"Endpoint"}],bA=[ad],bB=[W2],bC=[Z,ag],bD=[{[cw]:d3,[cx]:[{[cy]:"DisableS3ExpressSessionAuth"}]},{[cw]:e2,[cx]:[{[cy]:"DisableS3ExpressSessionAuth"},!0]}],bE=[aj],bF=[am],bG=[aa],bH=[X,Y],bI=[X,ar],bJ=[as,Y],bK=[as,ar],bL=[{[cw]:k,[cx]:[ad,6,14,!0],[cz]:"s3expressAvailabilityZoneId"},{[cw]:k,[cx]:[ad,14,16,!0],[cz]:"s3expressAvailabilityZoneDelim"},{[cw]:h,[cx]:[{[cy]:"s3expressAvailabilityZoneDelim"},"--"]}],bM=[{[cv]:[X,Y],[n2]:{[cA]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[cB]:ak,[cH]:{}},[ct]:n2},{[cv]:bI,[n2]:{[cA]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[cB]:ak,[cH]:{}},[ct]:n2},{[cv]:bJ,[n2]:{[cA]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[cB]:ak,[cH]:{}},[ct]:n2},{[cv]:bK,[n2]:{[cA]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[cB]:ak,[cH]:{}},[ct]:n2}],bN=[{[cw]:k,[cx]:[ad,6,15,!0],[cz]:"s3expressAvailabilityZoneId"},{[cw]:k,[cx]:[ad,15,17,!0],[cz]:"s3expressAvailabilityZoneDelim"},{[cw]:h,[cx]:[{[cy]:"s3expressAvailabilityZoneDelim"},"--"]}],bO=[{[cw]:k,[cx]:[ad,6,19,!0],[cz]:"s3expressAvailabilityZoneId"},{[cw]:k,[cx]:[ad,19,21,!0],[cz]:"s3expressAvailabilityZoneDelim"},{[cw]:h,[cx]:[{[cy]:"s3expressAvailabilityZoneDelim"},"--"]}],bP=[{[cw]:k,[cx]:[ad,6,20,!0],[cz]:"s3expressAvailabilityZoneId"},{[cw]:k,[cx]:[ad,20,22,!0],[cz]:"s3expressAvailabilityZoneDelim"},{[cw]:h,[cx]:[{[cy]:"s3expressAvailabilityZoneDelim"},"--"]}],bQ=[{[cw]:k,[cx]:[ad,6,26,!0],[cz]:"s3expressAvailabilityZoneId"},{[cw]:k,[cx]:[ad,26,28,!0],[cz]:"s3expressAvailabilityZoneDelim"},{[cw]:h,[cx]:[{[cy]:"s3expressAvailabilityZoneDelim"},"--"]}],bR=[{[cv]:[X,Y],[n2]:{[cA]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[cB]:{[cC]:"S3Express",[cD]:[{[cE]:!0,[j]:"sigv4-s3express",[cF]:"s3express",[cG]:"{Region}"}]},[cH]:{}},[ct]:n2},{[cv]:bI,[n2]:{[cA]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[cB]:{[cC]:"S3Express",[cD]:[{[cE]:!0,[j]:"sigv4-s3express",[cF]:"s3express",[cG]:"{Region}"}]},[cH]:{}},[ct]:n2},{[cv]:bJ,[n2]:{[cA]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",[cB]:{[cC]:"S3Express",[cD]:[{[cE]:!0,[j]:"sigv4-s3express",[cF]:"s3express",[cG]:"{Region}"}]},[cH]:{}},[ct]:n2},{[cv]:bK,[n2]:{[cA]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[cB]:{[cC]:"S3Express",[cD]:[{[cE]:!0,[j]:"sigv4-s3express",[cF]:"s3express",[cG]:"{Region}"}]},[cH]:{}},[ct]:n2}],bS=[ad,0,7,!0],bT=[{[cw]:k,[cx]:[ad,7,15,!0],[cz]:"s3expressAvailabilityZoneId"},{[cw]:k,[cx]:[ad,15,17,!0],[cz]:"s3expressAvailabilityZoneDelim"},{[cw]:h,[cx]:[{[cy]:"s3expressAvailabilityZoneDelim"},"--"]}],bU=[{[cw]:k,[cx]:[ad,7,16,!0],[cz]:"s3expressAvailabilityZoneId"},{[cw]:k,[cx]:[ad,16,18,!0],[cz]:"s3expressAvailabilityZoneDelim"},{[cw]:h,[cx]:[{[cy]:"s3expressAvailabilityZoneDelim"},"--"]}],bV=[{[cw]:k,[cx]:[ad,7,20,!0],[cz]:"s3expressAvailabilityZoneId"},{[cw]:k,[cx]:[ad,20,22,!0],[cz]:"s3expressAvailabilityZoneDelim"},{[cw]:h,[cx]:[{[cy]:"s3expressAvailabilityZoneDelim"},"--"]}],bW=[{[cw]:k,[cx]:[ad,7,21,!0],[cz]:"s3expressAvailabilityZoneId"},{[cw]:k,[cx]:[ad,21,23,!0],[cz]:"s3expressAvailabilityZoneDelim"},{[cw]:h,[cx]:[{[cy]:"s3expressAvailabilityZoneDelim"},"--"]}],bX=[{[cw]:k,[cx]:[ad,7,27,!0],[cz]:"s3expressAvailabilityZoneId"},{[cw]:k,[cx]:[ad,27,29,!0],[cz]:"s3expressAvailabilityZoneDelim"},{[cw]:h,[cx]:[{[cy]:"s3expressAvailabilityZoneDelim"},"--"]}],bY=[ac],bZ=[{[cw]:y,[cx]:[{[cy]:x},!1]}],ca=[{[cw]:h,[cx]:[{[cy]:v},"beta"]}],cb=["*"],cc=[{[cw]:y,[cx]:[{[cy]:"Region"},!1]}],cd=[{[cw]:h,[cx]:[{[cy]:"Region"},"us-east-1"]}],ce=[{[cw]:h,[cx]:[aT,K]}],cf=[{[cw]:i,[cx]:[aS,"resourceId[1]"],[cz]:L3},{[cw]:r3,[cx]:[{[cw]:h,[cx]:[aV,""]}]}],cg=[aS,"resourceId[1]"],ch=[Y],ci=[{[cw]:r3,[cx]:[{[cw]:h,[cx]:[{[cw]:i,[cx]:[aS,"region"]},""]}]}],cj=[{[cw]:r3,[cx]:[{[cw]:d3,[cx]:[{[cw]:i,[cx]:[aS,"resourceId[2]"]}]}]}],ck=[aS,"resourceId[2]"],cl=[{[cw]:g,[cx]:[{[cw]:i,[cx]:[aS,"region"]}],[cz]:"bucketPartition"}],cm=[{[cw]:h,[cx]:[ba,{[cw]:i,[cx]:[{[cy]:"partitionResult"},j]}]}],cn=[{[cw]:y,[cx]:[{[cw]:i,[cx]:[aS,"region"]},!0]}],co=[{[cw]:y,[cx]:[bb,!1]}],cp=[{[cw]:y,[cx]:[aV,!1]}],cq=[X],cr2=[{[cw]:y,[cx]:[{[cy]:"Region"},!0]}];ruleSet={version:"1.0",parameters:{Bucket:T,Region:T,UseFIPS:U,UseDualStack:U,Endpoint:T,ForcePathStyle:U,Accelerate:U,UseGlobalEndpoint:U,UseObjectLambdaEndpoint:V,Key:T,Prefix:T,CopySource:T,DisableAccessPoints:V,DisableMultiRegionAccessPoints:U,UseArnRegion:V,UseS3ExpressControlEndpoint:V,DisableS3ExpressSessionAuth:V},[cu]:[{[cv]:[{[cw]:d3,[cx]:by}],[cu]:[{[cv]:[W2,X],error:"Accelerate cannot be used with FIPS",[ct]:f},{[cv]:[Y,Z],error:"Cannot set dual-stack in combination with a custom endpoint.",[ct]:f},{[cv]:[Z,X],error:"A custom endpoint cannot be combined with FIPS",[ct]:f},{[cv]:[Z,W2],error:"A custom endpoint cannot be combined with S3 Accelerate",[ct]:f},{[cv]:[X,aa,ab],error:"Partition does not support FIPS",[ct]:f},{[cv]:[ac,{[cw]:k,[cx]:[ad,0,6,c],[cz]:l},{[cw]:h,[cx]:[{[cy]:l},"--x-s3"]}],[cu]:[ae,af,{[cv]:[ao,ap],[cu]:[{[cv]:bG,[cu]:[{[cv]:[aj,aq],[cu]:[{[cv]:bH,endpoint:{[cA]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[cB]:ak,[cH]:al},[ct]:n2},{[cv]:bI,endpoint:{[cA]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[cB]:ak,[cH]:al},[ct]:n2},{[cv]:bJ,endpoint:{[cA]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[cB]:ak,[cH]:al},[ct]:n2},{[cv]:bK,endpoint:{[cA]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[cB]:ak,[cH]:al},[ct]:n2}],[ct]:o}],[ct]:o}],[ct]:o},{[cv]:bF,[cu]:[{[cv]:bG,[cu]:[{[cv]:bD,[cu]:[{[cv]:bL,[cu]:bM,[ct]:o},{[cv]:bN,[cu]:bM,[ct]:o},{[cv]:bO,[cu]:bM,[ct]:o},{[cv]:bP,[cu]:bM,[ct]:o},{[cv]:bQ,[cu]:bM,[ct]:o},at],[ct]:o},{[cv]:bL,[cu]:bR,[ct]:o},{[cv]:bN,[cu]:bR,[ct]:o},{[cv]:bO,[cu]:bR,[ct]:o},{[cv]:bP,[cu]:bR,[ct]:o},{[cv]:bQ,[cu]:bR,[ct]:o},at],[ct]:o}],[ct]:o},an],[ct]:o},{[cv]:[ac,{[cw]:k,[cx]:bS,[cz]:s},{[cw]:h,[cx]:[{[cy]:s},"--xa-s3"]}],[cu]:[ae,af,{[cv]:bF,[cu]:[{[cv]:bG,[cu]:[{[cv]:bD,[cu]:[{[cv]:bT,[cu]:bM,[ct]:o},{[cv]:bU,[cu]:bM,[ct]:o},{[cv]:bV,[cu]:bM,[ct]:o},{[cv]:bW,[cu]:bM,[ct]:o},{[cv]:bX,[cu]:bM,[ct]:o},at],[ct]:o},{[cv]:bT,[cu]:bR,[ct]:o},{[cv]:bU,[cu]:bR,[ct]:o},{[cv]:bV,[cu]:bR,[ct]:o},{[cv]:bW,[cu]:bR,[ct]:o},{[cv]:bX,[cu]:bR,[ct]:o},at],[ct]:o}],[ct]:o},an],[ct]:o},{[cv]:[au,ao,ap],[cu]:[{[cv]:bG,[cu]:[{[cv]:bC,endpoint:{[cA]:t8,[cB]:ak,[cH]:al},[ct]:n2},{[cv]:bH,endpoint:{[cA]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[cB]:ak,[cH]:al},[ct]:n2},{[cv]:bI,endpoint:{[cA]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}",[cB]:ak,[cH]:al},[ct]:n2},{[cv]:bJ,endpoint:{[cA]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}",[cB]:ak,[cH]:al},[ct]:n2},{[cv]:bK,endpoint:{[cA]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}",[cB]:ak,[cH]:al},[ct]:n2}],[ct]:o}],[ct]:o},{[cv]:[ac,{[cw]:k,[cx]:[ad,49,50,c],[cz]:u},{[cw]:k,[cx]:[ad,8,12,c],[cz]:v},{[cw]:k,[cx]:bS,[cz]:w},{[cw]:k,[cx]:[ad,32,49,c],[cz]:x},{[cw]:g,[cx]:by,[cz]:"regionPartition"},{[cw]:h,[cx]:[{[cy]:w},"--op-s3"]}],[cu]:[{[cv]:bZ,[cu]:[{[cv]:bF,[cu]:[{[cv]:[{[cw]:h,[cx]:[av,"e"]}],[cu]:[{[cv]:ca,[cu]:[aw,{[cv]:bC,endpoint:{[cA]:"https://{Bucket}.ec2.{url#authority}",[cB]:ax,[cH]:al},[ct]:n2}],[ct]:o},{endpoint:{[cA]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[cB]:ax,[cH]:al},[ct]:n2}],[ct]:o},{[cv]:[{[cw]:h,[cx]:[av,"o"]}],[cu]:[{[cv]:ca,[cu]:[aw,{[cv]:bC,endpoint:{[cA]:"https://{Bucket}.op-{outpostId}.{url#authority}",[cB]:ax,[cH]:al},[ct]:n2}],[ct]:o},{endpoint:{[cA]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[cB]:ax,[cH]:al},[ct]:n2}],[ct]:o},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',[ct]:f}],[ct]:o},{error:"Invalid Outposts Bucket alias - it must be a valid bucket name.",[ct]:f}],[ct]:o},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",[ct]:f}],[ct]:o},{[cv]:bY,[cu]:[{[cv]:[Z,{[cw]:r3,[cx]:[{[cw]:d3,[cx]:[{[cw]:m2,[cx]:bz}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",[ct]:f},{[cv]:[ay,am],[cu]:[{[cv]:bG,[cu]:[{[cv]:cc,[cu]:[{[cv]:[W2,ab],error:"S3 Accelerate cannot be used in this region",[ct]:f},{[cv]:[Y,X,aA,aq,aB],endpoint:{[cA]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[Y,X,aA,aq,aD,aE],[cu]:[{endpoint:aF,[ct]:n2}],[ct]:o},{[cv]:[Y,X,aA,aq,aD,aH],endpoint:aF,[ct]:n2},{[cv]:[ar,X,aA,aq,aB],endpoint:{[cA]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[ar,X,aA,aq,aD,aE],[cu]:[{endpoint:aI,[ct]:n2}],[ct]:o},{[cv]:[ar,X,aA,aq,aD,aH],endpoint:aI,[ct]:n2},{[cv]:[Y,as,W2,aq,aB],endpoint:{[cA]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[Y,as,W2,aq,aD,aE],[cu]:[{endpoint:aJ,[ct]:n2}],[ct]:o},{[cv]:[Y,as,W2,aq,aD,aH],endpoint:aJ,[ct]:n2},{[cv]:[Y,as,aA,aq,aB],endpoint:{[cA]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[Y,as,aA,aq,aD,aE],[cu]:[{endpoint:aK,[ct]:n2}],[ct]:o},{[cv]:[Y,as,aA,aq,aD,aH],endpoint:aK,[ct]:n2},{[cv]:[ar,as,aA,Z,ag,ah,aB],endpoint:{[cA]:C2,[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[ar,as,aA,Z,ag,aL,aB],endpoint:{[cA]:q,[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[ar,as,aA,Z,ag,ah,aD,aE],[cu]:[{[cv]:cd,endpoint:aM,[ct]:n2},{endpoint:aM,[ct]:n2}],[ct]:o},{[cv]:[ar,as,aA,Z,ag,aL,aD,aE],[cu]:[{[cv]:cd,endpoint:aN,[ct]:n2},aO],[ct]:o},{[cv]:[ar,as,aA,Z,ag,ah,aD,aH],endpoint:aM,[ct]:n2},{[cv]:[ar,as,aA,Z,ag,aL,aD,aH],endpoint:aN,[ct]:n2},{[cv]:[ar,as,W2,aq,aB],endpoint:{[cA]:D,[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[ar,as,W2,aq,aD,aE],[cu]:[{[cv]:cd,endpoint:aP,[ct]:n2},{endpoint:aP,[ct]:n2}],[ct]:o},{[cv]:[ar,as,W2,aq,aD,aH],endpoint:aP,[ct]:n2},{[cv]:[ar,as,aA,aq,aB],endpoint:{[cA]:E,[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[ar,as,aA,aq,aD,aE],[cu]:[{[cv]:cd,endpoint:{[cA]:E,[cB]:aG,[cH]:al},[ct]:n2},{endpoint:aQ,[ct]:n2}],[ct]:o},{[cv]:[ar,as,aA,aq,aD,aH],endpoint:aQ,[ct]:n2}],[ct]:o},aR],[ct]:o}],[ct]:o},{[cv]:[Z,ag,{[cw]:h,[cx]:[{[cw]:i,[cx]:[ai,"scheme"]},"http"]},{[cw]:p,[cx]:[ad,c]},ay,as,ar,aA],[cu]:[{[cv]:bG,[cu]:[{[cv]:cc,[cu]:[aO],[ct]:o},aR],[ct]:o}],[ct]:o},{[cv]:[ay,{[cw]:F,[cx]:bA,[cz]:G2}],[cu]:[{[cv]:[{[cw]:i,[cx]:[aS,"resourceId[0]"],[cz]:H},{[cw]:r3,[cx]:[{[cw]:h,[cx]:[aT,""]}]}],[cu]:[{[cv]:[{[cw]:h,[cx]:[aU,J]}],[cu]:[{[cv]:ce,[cu]:[{[cv]:cf,[cu]:[aW,aX,{[cv]:ci,[cu]:[aY,{[cv]:cj,[cu]:[aZ,{[cv]:cl,[cu]:[{[cv]:bG,[cu]:[{[cv]:cm,[cu]:[{[cv]:cn,[cu]:[{[cv]:[{[cw]:h,[cx]:[bb,""]}],error:"Invalid ARN: Missing account id",[ct]:f},{[cv]:co,[cu]:[{[cv]:cp,[cu]:[{[cv]:bC,endpoint:{[cA]:M2,[cB]:bc,[cH]:al},[ct]:n2},{[cv]:cq,endpoint:{[cA]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[cB]:bc,[cH]:al},[ct]:n2},{endpoint:{[cA]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",[cB]:bc,[cH]:al},[ct]:n2}],[ct]:o},bd],[ct]:o},be],[ct]:o},bf],[ct]:o},bg],[ct]:o}],[ct]:o}],[ct]:o},bh],[ct]:o},{error:"Invalid ARN: bucket ARN is missing a region",[ct]:f}],[ct]:o},bi],[ct]:o},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",[ct]:f}],[ct]:o},{[cv]:ce,[cu]:[{[cv]:cf,[cu]:[{[cv]:ci,[cu]:[{[cv]:ce,[cu]:[{[cv]:ci,[cu]:[aY,{[cv]:cj,[cu]:[aZ,{[cv]:cl,[cu]:[{[cv]:bG,[cu]:[{[cv]:[{[cw]:h,[cx]:[ba,"{partitionResult#name}"]}],[cu]:[{[cv]:cn,[cu]:[{[cv]:[{[cw]:h,[cx]:[aU,B]}],[cu]:[{[cv]:co,[cu]:[{[cv]:cp,[cu]:[{[cv]:bB,error:"Access Points do not support S3 Accelerate",[ct]:f},{[cv]:bH,endpoint:{[cA]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[cB]:bj,[cH]:al},[ct]:n2},{[cv]:bI,endpoint:{[cA]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[cB]:bj,[cH]:al},[ct]:n2},{[cv]:bJ,endpoint:{[cA]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[cB]:bj,[cH]:al},[ct]:n2},{[cv]:[as,ar,Z,ag],endpoint:{[cA]:M2,[cB]:bj,[cH]:al},[ct]:n2},{[cv]:bK,endpoint:{[cA]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",[cB]:bj,[cH]:al},[ct]:n2}],[ct]:o},bd],[ct]:o},be],[ct]:o},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",[ct]:f}],[ct]:o},bf],[ct]:o},bg],[ct]:o}],[ct]:o}],[ct]:o},bh],[ct]:o}],[ct]:o}],[ct]:o},{[cv]:[{[cw]:y,[cx]:[aV,c]}],[cu]:[{[cv]:ch,error:"S3 MRAP does not support dual-stack",[ct]:f},{[cv]:cq,error:"S3 MRAP does not support FIPS",[ct]:f},{[cv]:bB,error:"S3 MRAP does not support S3 Accelerate",[ct]:f},{[cv]:[{[cw]:e2,[cx]:[{[cy]:"DisableMultiRegionAccessPoints"},c]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",[ct]:f},{[cv]:[{[cw]:g,[cx]:by,[cz]:N2}],[cu]:[{[cv]:[{[cw]:h,[cx]:[{[cw]:i,[cx]:[{[cy]:N2},j]},{[cw]:i,[cx]:[aS,"partition"]}]}],[cu]:[{endpoint:{[cA]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",[cB]:{[cD]:[{[cE]:c,name:z,[cF]:B,[cI]:cb}]},[cH]:al},[ct]:n2}],[ct]:o},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",[ct]:f}],[ct]:o}],[ct]:o},{error:"Invalid Access Point Name",[ct]:f}],[ct]:o},bi],[ct]:o},{[cv]:[{[cw]:h,[cx]:[aU,A]}],[cu]:[{[cv]:ch,error:"S3 Outposts does not support Dual-stack",[ct]:f},{[cv]:cq,error:"S3 Outposts does not support FIPS",[ct]:f},{[cv]:bB,error:"S3 Outposts does not support S3 Accelerate",[ct]:f},{[cv]:[{[cw]:d3,[cx]:[{[cw]:i,[cx]:[aS,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",[ct]:f},{[cv]:[{[cw]:i,[cx]:cg,[cz]:x}],[cu]:[{[cv]:bZ,[cu]:[aZ,{[cv]:cl,[cu]:[{[cv]:bG,[cu]:[{[cv]:cm,[cu]:[{[cv]:cn,[cu]:[{[cv]:co,[cu]:[{[cv]:[{[cw]:i,[cx]:ck,[cz]:O}],[cu]:[{[cv]:[{[cw]:i,[cx]:[aS,"resourceId[3]"],[cz]:L3}],[cu]:[{[cv]:[{[cw]:h,[cx]:[{[cy]:O},K]}],[cu]:[{[cv]:bC,endpoint:{[cA]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",[cB]:bk,[cH]:al},[ct]:n2},{endpoint:{[cA]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",[cB]:bk,[cH]:al},[ct]:n2}],[ct]:o},{error:"Expected an outpost type `accesspoint`, found {outpostType}",[ct]:f}],[ct]:o},{error:"Invalid ARN: expected an access point name",[ct]:f}],[ct]:o},{error:"Invalid ARN: Expected a 4-component resource",[ct]:f}],[ct]:o},be],[ct]:o},bf],[ct]:o},bg],[ct]:o}],[ct]:o}],[ct]:o},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",[ct]:f}],[ct]:o},{error:"Invalid ARN: The Outpost Id was not set",[ct]:f}],[ct]:o},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",[ct]:f}],[ct]:o},{error:"Invalid ARN: No ARN type specified",[ct]:f}],[ct]:o},{[cv]:[{[cw]:k,[cx]:[ad,0,4,!1],[cz]:P2},{[cw]:h,[cx]:[{[cy]:P2},"arn:"]},{[cw]:r3,[cx]:[{[cw]:d3,[cx]:[bl]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",[ct]:f},{[cv]:[{[cw]:e2,[cx]:[az,c]},bl],error:"Path-style addressing cannot be used with ARN buckets",[ct]:f},{[cv]:bE,[cu]:[{[cv]:bG,[cu]:[{[cv]:[aA],[cu]:[{[cv]:[Y,aq,X,aB],endpoint:{[cA]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[Y,aq,X,aD,aE],[cu]:[{endpoint:bm,[ct]:n2}],[ct]:o},{[cv]:[Y,aq,X,aD,aH],endpoint:bm,[ct]:n2},{[cv]:[ar,aq,X,aB],endpoint:{[cA]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[ar,aq,X,aD,aE],[cu]:[{endpoint:bn,[ct]:n2}],[ct]:o},{[cv]:[ar,aq,X,aD,aH],endpoint:bn,[ct]:n2},{[cv]:[Y,aq,as,aB],endpoint:{[cA]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[Y,aq,as,aD,aE],[cu]:[{endpoint:bo,[ct]:n2}],[ct]:o},{[cv]:[Y,aq,as,aD,aH],endpoint:bo,[ct]:n2},{[cv]:[ar,Z,ag,as,aB],endpoint:{[cA]:Q,[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[ar,Z,ag,as,aD,aE],[cu]:[{[cv]:cd,endpoint:bp,[ct]:n2},{endpoint:bp,[ct]:n2}],[ct]:o},{[cv]:[ar,Z,ag,as,aD,aH],endpoint:bp,[ct]:n2},{[cv]:[ar,aq,as,aB],endpoint:{[cA]:R,[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[ar,aq,as,aD,aE],[cu]:[{[cv]:cd,endpoint:{[cA]:R,[cB]:aG,[cH]:al},[ct]:n2},{endpoint:bq,[ct]:n2}],[ct]:o},{[cv]:[ar,aq,as,aD,aH],endpoint:bq,[ct]:n2}],[ct]:o},{error:"Path-style addressing cannot be used with S3 Accelerate",[ct]:f}],[ct]:o}],[ct]:o}],[ct]:o},{[cv]:[{[cw]:d3,[cx]:[br]},{[cw]:e2,[cx]:[br,c]}],[cu]:[{[cv]:bG,[cu]:[{[cv]:cr2,[cu]:[aW,aX,{[cv]:bC,endpoint:{[cA]:t8,[cB]:bs,[cH]:al},[ct]:n2},{[cv]:cq,endpoint:{[cA]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",[cB]:bs,[cH]:al},[ct]:n2},{endpoint:{[cA]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",[cB]:bs,[cH]:al},[ct]:n2}],[ct]:o},aR],[ct]:o}],[ct]:o},{[cv]:[au],[cu]:[{[cv]:bG,[cu]:[{[cv]:cr2,[cu]:[{[cv]:[X,Y,aq,aB],endpoint:{[cA]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[X,Y,aq,aD,aE],[cu]:[{endpoint:bt,[ct]:n2}],[ct]:o},{[cv]:[X,Y,aq,aD,aH],endpoint:bt,[ct]:n2},{[cv]:[X,ar,aq,aB],endpoint:{[cA]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[X,ar,aq,aD,aE],[cu]:[{endpoint:bu,[ct]:n2}],[ct]:o},{[cv]:[X,ar,aq,aD,aH],endpoint:bu,[ct]:n2},{[cv]:[as,Y,aq,aB],endpoint:{[cA]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[as,Y,aq,aD,aE],[cu]:[{endpoint:bv,[ct]:n2}],[ct]:o},{[cv]:[as,Y,aq,aD,aH],endpoint:bv,[ct]:n2},{[cv]:[as,ar,Z,ag,aB],endpoint:{[cA]:t8,[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[as,ar,Z,ag,aD,aE],[cu]:[{[cv]:cd,endpoint:bw,[ct]:n2},{endpoint:bw,[ct]:n2}],[ct]:o},{[cv]:[as,ar,Z,ag,aD,aH],endpoint:bw,[ct]:n2},{[cv]:[as,ar,aq,aB],endpoint:{[cA]:S,[cB]:aC,[cH]:al},[ct]:n2},{[cv]:[as,ar,aq,aD,aE],[cu]:[{[cv]:cd,endpoint:{[cA]:S,[cB]:aG,[cH]:al},[ct]:n2},{endpoint:bx,[ct]:n2}],[ct]:o},{[cv]:[as,ar,aq,aD,aH],endpoint:bx,[ct]:n2}],[ct]:o},aR],[ct]:o}],[ct]:o}],[ct]:o},{error:"A region must be set when sending requests to S3.",[ct]:f}]};cache=new EndpointCache({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]});defaultEndpointResolver=(endpointParams,context2={})=>cache.get(endpointParams,()=>resolveEndpoint(ruleSet,{endpointParams,logger:context2.logger}));customEndpointFunctions.aws=awsEndpointFunctions;defaultS3HttpAuthSchemeParametersProvider=(defaultHttpAuthSchemeParametersProvider=>async(config,context2,input)=>{var _a8,_b5,_c3;if(!input)throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");const defaultParameters=await defaultHttpAuthSchemeParametersProvider(config,context2),instructionsFn=null==(_c3=null==(_b5=null==(_a8=getSmithyContext(context2))?void 0:_a8.commandInstance)?void 0:_b5.constructor)?void 0:_c3.getEndpointParameterInstructions;if(!instructionsFn)throw new Error(`getEndpointParameterInstructions() is not defined on '${context2.commandName}'`);const endpointParameters=await resolveParams(input,{getEndpointParameterInstructions:instructionsFn},config);return Object.assign(defaultParameters,endpointParameters)})(async(config,context2,input)=>({operation:getSmithyContext(context2).operation,region:await normalizeProvider(config.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}));defaultS3HttpAuthSchemeProvider=((defaultEndpointResolver2,defaultHttpAuthSchemeResolver,createHttpAuthOptionFunctions)=>authParameters=>{var _a8;const authSchemes=null==(_a8=defaultEndpointResolver2(authParameters).properties)?void 0:_a8.authSchemes;if(!authSchemes)return defaultHttpAuthSchemeResolver(authParameters);const options=[];for(const scheme of authSchemes){const{name:resolvedName,properties={},...rest}=scheme,name=resolvedName.toLowerCase();resolvedName!==name&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);let schemeId;if("sigv4a"===name){schemeId="aws.auth#sigv4a";const sigv4Present=authSchemes.find(s2=>{const name2=s2.name.toLowerCase();return"sigv4a"!==name2&&name2.startsWith("sigv4")});if("none"===SignatureV4MultiRegion.sigv4aDependency()&&sigv4Present)continue}else{if(!name.startsWith("sigv4"))throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);schemeId="aws.auth#sigv4"}const createOption=createHttpAuthOptionFunctions[schemeId];if(!createOption)throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);const option=createOption(authParameters);option.schemeId=schemeId;option.signingProperties={...option.signingProperties||{},...rest,...properties};options.push(option)}return options})(defaultEndpointResolver,authParameters=>{const options=[];switch(authParameters.operation){default:options.push(createAwsAuthSigv4HttpAuthOption(authParameters));options.push(createAwsAuthSigv4aHttpAuthOption(authParameters))}return options},{"aws.auth#sigv4":createAwsAuthSigv4HttpAuthOption,"aws.auth#sigv4a":createAwsAuthSigv4aHttpAuthOption});resolveHttpAuthSchemeConfig=config=>{var _a8;const config_0=resolveAwsSdkSigV4Config(config),config_1=resolveAwsSdkSigV4AConfig(config_0);return Object.assign(config_1,{authSchemePreference:normalizeProvider(null!=(_a8=config.authSchemePreference)?_a8:[])})};resolveClientEndpointParameters=options=>{var _a8,_b5,_c3,_d2,_e2,_f,_g;return Object.assign(options,{useFipsEndpoint:null!=(_a8=options.useFipsEndpoint)&&_a8,useDualstackEndpoint:null!=(_b5=options.useDualstackEndpoint)&&_b5,forcePathStyle:null!=(_c3=options.forcePathStyle)&&_c3,useAccelerateEndpoint:null!=(_d2=options.useAccelerateEndpoint)&&_d2,useGlobalEndpoint:null!=(_e2=options.useGlobalEndpoint)&&_e2,disableMultiregionAccessPoints:null!=(_f=options.disableMultiregionAccessPoints)&&_f,defaultSigningName:"s3",clientContextParams:null!=(_g=options.clientContextParams)?_g:{}})};commonParams={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};S3ServiceException=class _S3ServiceException extends ServiceException{constructor(options){super(options);Object.setPrototypeOf(this,_S3ServiceException.prototype)}};NoSuchUpload=class _NoSuchUpload extends S3ServiceException{constructor(opts){super({name:"NoSuchUpload",$fault:"client",...opts});__publicField(this,"name","NoSuchUpload");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_NoSuchUpload.prototype)}};AccessDenied=class _AccessDenied extends S3ServiceException{constructor(opts){super({name:"AccessDenied",$fault:"client",...opts});__publicField(this,"name","AccessDenied");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_AccessDenied.prototype)}};ObjectNotInActiveTierError=class _ObjectNotInActiveTierError extends S3ServiceException{constructor(opts){super({name:"ObjectNotInActiveTierError",$fault:"client",...opts});__publicField(this,"name","ObjectNotInActiveTierError");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_ObjectNotInActiveTierError.prototype)}};BucketAlreadyExists=class _BucketAlreadyExists extends S3ServiceException{constructor(opts){super({name:"BucketAlreadyExists",$fault:"client",...opts});__publicField(this,"name","BucketAlreadyExists");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_BucketAlreadyExists.prototype)}};BucketAlreadyOwnedByYou=class _BucketAlreadyOwnedByYou extends S3ServiceException{constructor(opts){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...opts});__publicField(this,"name","BucketAlreadyOwnedByYou");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_BucketAlreadyOwnedByYou.prototype)}};NoSuchBucket=class _NoSuchBucket extends S3ServiceException{constructor(opts){super({name:"NoSuchBucket",$fault:"client",...opts});__publicField(this,"name","NoSuchBucket");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_NoSuchBucket.prototype)}};InvalidObjectState=class _InvalidObjectState extends S3ServiceException{constructor(opts){super({name:"InvalidObjectState",$fault:"client",...opts});__publicField(this,"name","InvalidObjectState");__publicField(this,"$fault","client");__publicField(this,"StorageClass");__publicField(this,"AccessTier");Object.setPrototypeOf(this,_InvalidObjectState.prototype);this.StorageClass=opts.StorageClass;this.AccessTier=opts.AccessTier}};NoSuchKey=class _NoSuchKey extends S3ServiceException{constructor(opts){super({name:"NoSuchKey",$fault:"client",...opts});__publicField(this,"name","NoSuchKey");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_NoSuchKey.prototype)}};NotFound=class _NotFound extends S3ServiceException{constructor(opts){super({name:"NotFound",$fault:"client",...opts});__publicField(this,"name","NotFound");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_NotFound.prototype)}};EncryptionTypeMismatch=class _EncryptionTypeMismatch extends S3ServiceException{constructor(opts){super({name:"EncryptionTypeMismatch",$fault:"client",...opts});__publicField(this,"name","EncryptionTypeMismatch");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_EncryptionTypeMismatch.prototype)}};InvalidRequest=class _InvalidRequest extends S3ServiceException{constructor(opts){super({name:"InvalidRequest",$fault:"client",...opts});__publicField(this,"name","InvalidRequest");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_InvalidRequest.prototype)}};InvalidWriteOffset=class _InvalidWriteOffset extends S3ServiceException{constructor(opts){super({name:"InvalidWriteOffset",$fault:"client",...opts});__publicField(this,"name","InvalidWriteOffset");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_InvalidWriteOffset.prototype)}};TooManyParts=class _TooManyParts extends S3ServiceException{constructor(opts){super({name:"TooManyParts",$fault:"client",...opts});__publicField(this,"name","TooManyParts");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_TooManyParts.prototype)}};IdempotencyParameterMismatch=class _IdempotencyParameterMismatch extends S3ServiceException{constructor(opts){super({name:"IdempotencyParameterMismatch",$fault:"client",...opts});__publicField(this,"name","IdempotencyParameterMismatch");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_IdempotencyParameterMismatch.prototype)}};ObjectAlreadyInActiveTierError=class _ObjectAlreadyInActiveTierError extends S3ServiceException{constructor(opts){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...opts});__publicField(this,"name","ObjectAlreadyInActiveTierError");__publicField(this,"$fault","client");Object.setPrototypeOf(this,_ObjectAlreadyInActiveTierError.prototype)}};_AC="AccelerateConfiguration";_ACL="AccessControlList";_ACLn="AnalyticsConfigurationList";_ACP="AccessControlPolicy";_ACT="AccessControlTranslation";_ACn="AnalyticsConfiguration";_AIMU="AbortIncompleteMultipartUpload";_AR="AcceptRanges";_AS="AbacStatus";_AT="AccessTier";_B="Bucket";_BA="BucketArn";_BET="BlockedEncryptionTypes";_BGR="BypassGovernanceRetention";_BKE="BucketKeyEnabled";_BLS="BucketLoggingStatus";_BP="BytesProcessed";_BPA="BlockPublicAcls";_BPP="BlockPublicPolicy";_BR="BucketRegion";_BRy="BytesReturned";_BS="BytesScanned";_Bo="Body";_Bu="Buckets";_C="Checksum";_CA="ChecksumAlgorithm";_CBC="CreateBucketConfiguration";_CC="CacheControl";_CCRC="ChecksumCRC32";_CCRCC="ChecksumCRC32C";_CCRCNVME="ChecksumCRC64NVME";_CC_="Cache-Control";_CD_="Content-Disposition";_CDo="ContentDisposition";_CE_="Content-Encoding";_CEo="ContentEncoding";_CL="ContentLanguage";_CL_="Content-Language";_CL__="Content-Length";_CLo="ContentLength";_CM="Content-MD5";_CMD="ContentMD5";_CMUo="CompleteMultipartUpload";_COR="CopyObjectResult";_CORSC="CORSConfiguration";_CPR="CopyPartResult";_CPom="CommonPrefixes";_CR="ContentRange";_CR_="Content-Range";_CS="CopySource";_CSHA="ChecksumSHA1";_CSHAh="ChecksumSHA256";_CSIM="CopySourceIfMatch";_CSIMS="CopySourceIfModifiedSince";_CSINM="CopySourceIfNoneMatch";_CSIUS="CopySourceIfUnmodifiedSince";_CSSSECA="CopySourceSSECustomerAlgorithm";_CSSSECK="CopySourceSSECustomerKey";_CSVI="CopySourceVersionId";_CSo="ConfigurationState";_CT="ChecksumType";_CT_="Content-Type";_CTo="ContentType";_CTon="ContinuationToken";_Cr="Credentials";_D="Days";_DM="DeleteMarker";_DMR="DeleteMarkerReplication";_DMe="DeleteMarkers";_DN="DisplayName";_DRe="DefaultRetention";_DRes="DestinationResult";_De="Delete";_Deli="Delimiter";_Des="Destination";_E="Expiration";_EBC="EventBridgeConfiguration";_EBO="ExpectedBucketOwner";_EC="EncryptionConfiguration";_EDr="ErrorDocument";_EM="ErrorMessage";_EOR="ExistingObjectReplication";_ES="ExpiresString";_ESBO="ExpectedSourceBucketOwner";_ET="EncryptionType";_ETa="ETag";_ETn="EncodingType";_ETx="ExpressionType";_En="Encryption";_Err="Error";_Ev="Events";_Ex="Expires";_F="Filter";_FD="FieldDelimiter";_FR="FilterRule";_G="Grants";_GBMCR="GetBucketMetadataConfigurationResult";_GBMTCR="GetBucketMetadataTableConfigurationResult";_GFC="GrantFullControl";_GJP="GlacierJobParameters";_GR="GrantRead";_GRACP="GrantReadACP";_GW="GrantWrite";_GWACP="GrantWriteACP";_I="Id";_IC="InventoryConfiguration";_ICL="InventoryConfigurationList";_IDn="IndexDocument";_IM="IfMatch";_IMS_="If-Modified-Since";_IM_="If-Match";_INM="IfNoneMatch";_INM_="If-None-Match";_IPA="IgnorePublicAcls";_IS="InputSerialization";_IT="IsTruncated";_ITC="IntelligentTieringConfiguration";_ITCL="IntelligentTieringConfigurationList";_ITCR="InventoryTableConfigurationResult";_ITCn="InventoryTableConfiguration";_IUS="IfUnmodifiedSince";_IUS_="If-Unmodified-Since";_In="Initiator";_JTC="JournalTableConfiguration";_JTCR="JournalTableConfigurationResult";_K="Key";_KM="KeyMarker";_L="Location";_LBRi="ListBucketResult";_LC="LocationConstraint";_LCi="LifecycleConfiguration";_LE="LoggingEnabled";_LH="LegalHold";_LM="LastModified";_LM_="Last-Modified";_M="Metadata";_MC="MetadataConfiguration";_MCL="MetricsConfigurationList";_MCR="MetadataConfigurationResult";_MCe="MetricsConfiguration";_ME="MetadataEntry";_MK="MaxKeys";_MM="MissingMeta";_MP="MaxParts";_MTC="MetadataTableConfiguration";_MTCR="MetadataTableConfigurationResult";_MU="MultipartUpload";_N="Name";_NC="NotificationConfiguration";_NCT="NextContinuationToken";_ND="NoncurrentDays";_NKM="NextKeyMarker";_NNV="NewerNoncurrentVersions";_NPNM="NextPartNumberMarker";_NVE="NoncurrentVersionExpiration";_NVTo="NoncurrentVersionTransition";_O="Owner";_OC="OwnershipControls";_OE="ObjectEncryption";_OL="OutputLocation";_OLC="ObjectLockConfiguration";_OLLHS="ObjectLockLegalHoldStatus";_OLM="ObjectLockMode";_OLRUD="ObjectLockRetainUntilDate";_OO="ObjectOwnership";_OOA="OptionalObjectAttributes";_OSGT="ObjectSizeGreaterThan";_OSLT="ObjectSizeLessThan";_OSu="OutputSerialization";_P="Prefix";_PABC="PublicAccessBlockConfiguration";_PC="PartsCount";_PN="PartNumber";_PNM="PartNumberMarker";_PP="PartitionedPrefix";_PS="PolicyStatus";_Pa="Parts";_Pe="Permission";_QC="QuoteCharacter";_QCue="QueueConfiguration";_QEC="QuoteEscapeCharacter";_R="Rules";_RART="RedirectAllRequestsTo";_RC="RequestCharged";_RCC="ResponseCacheControl";_RCD="ResponseContentDisposition";_RCE="ResponseContentEncoding";_RCL="ResponseContentLanguage";_RCT="ResponseContentType";_RCe="ReplicationConfiguration";_RD="RecordDelimiter";_RE="ResponseExpires";_REe="RecordExpiration";_RM="ReplicaModifications";_RP="RequestPayer";_RPB="RestrictPublicBuckets";_RPC="RequestPaymentConfiguration";_RPe="RequestProgress";_RR="RoutingRules";_RRes="RestoreRequest";_RS="ReplicationStatus";_RSe="RestoreStatus";_RT="ReplicationTime";_Ra="Range";_Re="Restore";_Ret="Retention";_Ru="Rule";_S="Status";_SA="StartAfter";_SAK="SecretAccessKey";_SBD="S3BucketDestination";_SC="StorageClass";_SCA="StorageClassAnalysis";_SK="SSE-KMS";_SKEO="SseKmsEncryptedObjects";_SP="SelectParameters";_SPi="SimplePrefix";_SSC="SourceSelectionCriteria";_SSE="ServerSideEncryption";_SSEC="ServerSideEncryptionConfiguration";_SSECA="SSECustomerAlgorithm";_SSECK="SSECustomerKey";_SSECKMD="SSECustomerKeyMD5";_SSEKMSEC="SSEKMSEncryptionContext";_SSEKMSKI="SSEKMSKeyId";_ST="SessionToken";_STD="S3TablesDestination";_STDR="S3TablesDestinationResult";_Si="Size";_T="Tags";_TA="TableArn";_TBA="TableBucketArn";_TC="TagCount";_TCop="TopicConfiguration";_TDMOS="TransitionDefaultMinimumObjectSize";_TG="TargetGrants";_TN="TableNamespace";_TNa="TableName";_TOKF="TargetObjectKeyFormat";_TS="TagSet";_Ta="Tag";_Tag="Tagging";_Ty="Type";_UI="UploadId";_UIM="UploadIdMarker";_UM="UserMetadata";_V="Value";_VC="VersioningConfiguration";_VI="VersionId";_VIM="VersionIdMarker";_WC="WebsiteConfiguration";_WRL="WebsiteRedirectLocation";_ar="accept-ranges";_c2="client";_ct="continuation-token";_d="delimiter";_e="error";_eP="eventPayload";_en="endpoint";_et="encoding-type";_h="http";_hC="httpChecksum";_hE="httpError";_hH="httpHeader";_hL="hostLabel";_hP="httpPayload";_hPH="httpPrefixHeaders";_hQ="httpQuery";_hi="http://www.w3.org/2001/XMLSchema-instance";_i="id";_iT="idempotencyToken";_km="key-marker";_mk="max-keys";_p="prefix";_pN="partNumber";_rcc="response-cache-control";_rcd="response-content-disposition";_rce="response-content-encoding";_rcl="response-content-language";_rct="response-content-type";_re="response-expires";_st="streaming";_uI="uploadId";_vI="versionId";_xA="xmlAttribute";_xF="xmlFlattened";_xN="xmlName";_xNm="xmlNamespace";_xaa="x-amz-acl";_xaad="x-amz-abort-date";_xaari="x-amz-abort-rule-id";_xaba="x-amz-bucket-arn";_xabgr="x-amz-bypass-governance-retention";_xabolt="x-amz-bucket-object-lock-token";_xaca="x-amz-checksum-algorithm";_xacc="x-amz-checksum-crc32";_xacc_="x-amz-checksum-crc32c";_xacc__="x-amz-checksum-crc64nvme";_xacm="x-amz-checksum-mode";_xacs="x-amz-checksum-sha1";_xacs_="x-amz-checksum-sha256";_xacsim="x-amz-copy-source-if-match";_xacsims="x-amz-copy-source-if-modified-since";_xacsinm="x-amz-copy-source-if-none-match";_xacsius="x-amz-copy-source-if-unmodified-since";_xacssseca="x-amz-copy-source-server-side-encryption-customer-algorithm";_xacssseck="x-amz-copy-source-server-side-encryption-customer-key";_xacssseckM="x-amz-copy-source-server-side-encryption-customer-key-MD5";_xacsvi="x-amz-copy-source-version-id";_xact="x-amz-checksum-type";_xadm="x-amz-delete-marker";_xae="x-amz-expiration";_xaebo="x-amz-expected-bucket-owner";_xagfc="x-amz-grant-full-control";_xagr="x-amz-grant-read";_xagra="x-amz-grant-read-acp";_xagw="x-amz-grant-write";_xagwa="x-amz-grant-write-acp";_xam="x-amz-meta-";_xamm="x-amz-missing-meta";_xampc="x-amz-mp-parts-count";_xaollh="x-amz-object-lock-legal-hold";_xaolm="x-amz-object-lock-mode";_xaolrud="x-amz-object-lock-retain-until-date";_xaooa="x-amz-optional-object-attributes";_xar="x-amz-restore";_xarc="x-amz-request-charged";_xarp="x-amz-request-payer";_xars="x-amz-replication-status";_xasc="x-amz-storage-class";_xasca="x-amz-sdk-checksum-algorithm";_xasebo="x-amz-source-expected-bucket-owner";_xasse="x-amz-server-side-encryption";_xasseakki="x-amz-server-side-encryption-aws-kms-key-id";_xassebke="x-amz-server-side-encryption-bucket-key-enabled";_xassec="x-amz-server-side-encryption-context";_xasseca="x-amz-server-side-encryption-customer-algorithm";_xasseck="x-amz-server-side-encryption-customer-key";_xasseckM="x-amz-server-side-encryption-customer-key-MD5";_xat="x-amz-tagging";_xatc="x-amz-tagging-count";_xatdmos="x-amz-transition-default-minimum-object-size";_xavi="x-amz-version-id";_xawrl="x-amz-website-redirect-location";n0="com.amazonaws.s3";S3ServiceException$=[-3,"smithy.ts.sdk.synthetic.com.amazonaws.s3","S3ServiceException",0,[],[]];(_s_registry=TypeRegistry.for("smithy.ts.sdk.synthetic.com.amazonaws.s3")).registerError(S3ServiceException$,S3ServiceException);n0_registry=TypeRegistry.for(n0);AccessDenied$=[-3,n0,"AccessDenied",{[_e]:_c2,[_hE]:403},[],[]];n0_registry.registerError(AccessDenied$,AccessDenied);BucketAlreadyExists$=[-3,n0,"BucketAlreadyExists",{[_e]:_c2,[_hE]:409},[],[]];n0_registry.registerError(BucketAlreadyExists$,BucketAlreadyExists);BucketAlreadyOwnedByYou$=[-3,n0,"BucketAlreadyOwnedByYou",{[_e]:_c2,[_hE]:409},[],[]];n0_registry.registerError(BucketAlreadyOwnedByYou$,BucketAlreadyOwnedByYou);EncryptionTypeMismatch$=[-3,n0,"EncryptionTypeMismatch",{[_e]:_c2,[_hE]:400},[],[]];n0_registry.registerError(EncryptionTypeMismatch$,EncryptionTypeMismatch);IdempotencyParameterMismatch$=[-3,n0,"IdempotencyParameterMismatch",{[_e]:_c2,[_hE]:400},[],[]];n0_registry.registerError(IdempotencyParameterMismatch$,IdempotencyParameterMismatch);InvalidObjectState$=[-3,n0,"InvalidObjectState",{[_e]:_c2,[_hE]:403},[_SC,_AT],[0,0]];n0_registry.registerError(InvalidObjectState$,InvalidObjectState);InvalidRequest$=[-3,n0,"InvalidRequest",{[_e]:_c2,[_hE]:400},[],[]];n0_registry.registerError(InvalidRequest$,InvalidRequest);InvalidWriteOffset$=[-3,n0,"InvalidWriteOffset",{[_e]:_c2,[_hE]:400},[],[]];n0_registry.registerError(InvalidWriteOffset$,InvalidWriteOffset);NoSuchBucket$=[-3,n0,"NoSuchBucket",{[_e]:_c2,[_hE]:404},[],[]];n0_registry.registerError(NoSuchBucket$,NoSuchBucket);NoSuchKey$=[-3,n0,"NoSuchKey",{[_e]:_c2,[_hE]:404},[],[]];n0_registry.registerError(NoSuchKey$,NoSuchKey);NoSuchUpload$=[-3,n0,"NoSuchUpload",{[_e]:_c2,[_hE]:404},[],[]];n0_registry.registerError(NoSuchUpload$,NoSuchUpload);NotFound$=[-3,n0,"NotFound",{[_e]:_c2},[],[]];n0_registry.registerError(NotFound$,NotFound);ObjectAlreadyInActiveTierError$=[-3,n0,"ObjectAlreadyInActiveTierError",{[_e]:_c2,[_hE]:403},[],[]];n0_registry.registerError(ObjectAlreadyInActiveTierError$,ObjectAlreadyInActiveTierError);ObjectNotInActiveTierError$=[-3,n0,"ObjectNotInActiveTierError",{[_e]:_c2,[_hE]:403},[],[]];n0_registry.registerError(ObjectNotInActiveTierError$,ObjectNotInActiveTierError);TooManyParts$=[-3,n0,"TooManyParts",{[_e]:_c2,[_hE]:400},[],[]];n0_registry.registerError(TooManyParts$,TooManyParts);errorTypeRegistries=[_s_registry,n0_registry];CopySourceSSECustomerKey=[0,n0,_CSSSECK,8,0];NonEmptyKmsKeyArnString=[0,n0,"NonEmptyKmsKeyArnString",8,0];SessionCredentialValue=[0,n0,"SessionCredentialValue",8,0];SSECustomerKey=[0,n0,_SSECK,8,0];SSEKMSEncryptionContext=[0,n0,_SSEKMSEC,8,0];SSEKMSKeyId=[0,n0,_SSEKMSKI,8,0];StreamingBlob=[0,n0,"StreamingBlob",{[_st]:1},42];AbacStatus$=[3,n0,_AS,0,[_S],[0]];AbortIncompleteMultipartUpload$=[3,n0,_AIMU,0,["DaysAfterInitiation"],[1]];AbortMultipartUploadOutput$=[3,n0,"AbortMultipartUploadOutput",0,[_RC],[[0,{[_hH]:_xarc}]]];AbortMultipartUploadRequest$=[3,n0,"AbortMultipartUploadRequest",0,[_B,_K,_UI,_RP,_EBO,"IfMatchInitiatedTime"],[[0,1],[0,1],[0,{[_hQ]:_uI}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}],[6,{[_hH]:"x-amz-if-match-initiated-time"}]],3];AccelerateConfiguration$=[3,n0,_AC,0,[_S],[0]];AccessControlPolicy$=[3,n0,_ACP,0,[_G,_O],[[()=>Grants,{[_xN]:_ACL}],()=>Owner$]];AccessControlTranslation$=[3,n0,_ACT,0,[_O],[0],1];AnalyticsAndOperator$=[3,n0,"AnalyticsAndOperator",0,[_P,_T],[0,[()=>TagSet,{[_xF]:1,[_xN]:_Ta}]]];AnalyticsConfiguration$=[3,n0,_ACn,0,[_I,_SCA,_F],[0,()=>StorageClassAnalysis$,[()=>AnalyticsFilter$,0]],2];AnalyticsExportDestination$=[3,n0,"AnalyticsExportDestination",0,[_SBD],[()=>AnalyticsS3BucketDestination$],1];AnalyticsS3BucketDestination$=[3,n0,"AnalyticsS3BucketDestination",0,["Format",_B,"BucketAccountId",_P],[0,0,0,0],2];BlockedEncryptionTypes$=[3,n0,_BET,0,[_ET],[[()=>EncryptionTypeList,{[_xF]:1}]]];Bucket$=[3,n0,_B,0,[_N,"CreationDate",_BR,_BA],[0,4,0,0]];BucketInfo$=[3,n0,"BucketInfo",0,["DataRedundancy",_Ty],[0,0]];BucketLifecycleConfiguration$=[3,n0,"BucketLifecycleConfiguration",0,[_R],[[()=>LifecycleRules,{[_xF]:1,[_xN]:_Ru}]],1];BucketLoggingStatus$=[3,n0,_BLS,0,[_LE],[[()=>LoggingEnabled$,0]]];Checksum$=[3,n0,_C,0,[_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh,_CT],[0,0,0,0,0,0]];CommonPrefix$=[3,n0,"CommonPrefix",0,[_P],[0]];CompletedMultipartUpload$=[3,n0,"CompletedMultipartUpload",0,[_Pa],[[()=>CompletedPartList,{[_xF]:1,[_xN]:"Part"}]]];CompletedPart$=[3,n0,"CompletedPart",0,[_ETa,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh,_PN],[0,0,0,0,0,0,1]];CompleteMultipartUploadOutput$=[3,n0,"CompleteMultipartUploadOutput",{[_xN]:"CompleteMultipartUploadResult"},[_L,_B,_K,_E,_ETa,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh,_CT,_SSE,_VI,_SSEKMSKI,_BKE,_RC],[0,0,0,[0,{[_hH]:_xae}],0,0,0,0,0,0,0,[0,{[_hH]:_xasse}],[0,{[_hH]:_xavi}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[2,{[_hH]:_xassebke}],[0,{[_hH]:_xarc}]]];CompleteMultipartUploadRequest$=[3,n0,"CompleteMultipartUploadRequest",0,[_B,_K,_UI,_MU,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh,_CT,"MpuObjectSize",_RP,_EBO,_IM,_INM,_SSECA,_SSECK,_SSECKMD],[[0,1],[0,1],[0,{[_hQ]:_uI}],[()=>CompletedMultipartUpload$,{[_hP]:1,[_xN]:_CMUo}],[0,{[_hH]:_xacc}],[0,{[_hH]:_xacc_}],[0,{[_hH]:_xacc__}],[0,{[_hH]:_xacs}],[0,{[_hH]:_xacs_}],[0,{[_hH]:_xact}],[1,{[_hH]:"x-amz-mp-object-size"}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_IM_}],[0,{[_hH]:_INM_}],[0,{[_hH]:_xasseca}],[()=>SSECustomerKey,{[_hH]:_xasseck}],[0,{[_hH]:_xasseckM}]],3];Condition$=[3,n0,"Condition",0,["HttpErrorCodeReturnedEquals","KeyPrefixEquals"],[0,0]];ContinuationEvent$=[3,n0,"ContinuationEvent",0,[],[]];CopyObjectOutput$=[3,n0,"CopyObjectOutput",0,[_COR,_E,_CSVI,_VI,_SSE,_SSECA,_SSECKMD,_SSEKMSKI,_SSEKMSEC,_BKE,_RC],[[()=>CopyObjectResult$,16],[0,{[_hH]:_xae}],[0,{[_hH]:_xacsvi}],[0,{[_hH]:_xavi}],[0,{[_hH]:_xasse}],[0,{[_hH]:_xasseca}],[0,{[_hH]:_xasseckM}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[()=>SSEKMSEncryptionContext,{[_hH]:_xassec}],[2,{[_hH]:_xassebke}],[0,{[_hH]:_xarc}]]];CopyObjectRequest$=[3,n0,"CopyObjectRequest",0,[_B,_CS,_K,"ACL",_CC,_CA,_CDo,_CEo,_CL,_CTo,_CSIM,_CSIMS,_CSINM,_CSIUS,_Ex,_GFC,_GR,_GRACP,_GWACP,_IM,_INM,_M,"MetadataDirective","TaggingDirective",_SSE,_SC,_WRL,_SSECA,_SSECK,_SSECKMD,_SSEKMSKI,_SSEKMSEC,_BKE,_CSSSECA,_CSSSECK,"CopySourceSSECustomerKeyMD5",_RP,_Tag,_OLM,_OLRUD,_OLLHS,_EBO,_ESBO],[[0,1],[0,{[_hH]:"x-amz-copy-source"}],[0,1],[0,{[_hH]:_xaa}],[0,{[_hH]:_CC_}],[0,{[_hH]:_xaca}],[0,{[_hH]:_CD_}],[0,{[_hH]:_CE_}],[0,{[_hH]:_CL_}],[0,{[_hH]:_CT_}],[0,{[_hH]:_xacsim}],[4,{[_hH]:_xacsims}],[0,{[_hH]:_xacsinm}],[4,{[_hH]:_xacsius}],[4,{[_hH]:_Ex}],[0,{[_hH]:_xagfc}],[0,{[_hH]:_xagr}],[0,{[_hH]:_xagra}],[0,{[_hH]:_xagwa}],[0,{[_hH]:_IM_}],[0,{[_hH]:_INM_}],[128,{[_hPH]:_xam}],[0,{[_hH]:"x-amz-metadata-directive"}],[0,{[_hH]:"x-amz-tagging-directive"}],[0,{[_hH]:_xasse}],[0,{[_hH]:_xasc}],[0,{[_hH]:_xawrl}],[0,{[_hH]:_xasseca}],[()=>SSECustomerKey,{[_hH]:_xasseck}],[0,{[_hH]:_xasseckM}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[()=>SSEKMSEncryptionContext,{[_hH]:_xassec}],[2,{[_hH]:_xassebke}],[0,{[_hH]:_xacssseca}],[()=>CopySourceSSECustomerKey,{[_hH]:_xacssseck}],[0,{[_hH]:_xacssseckM}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xat}],[0,{[_hH]:_xaolm}],[5,{[_hH]:_xaolrud}],[0,{[_hH]:_xaollh}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xasebo}]],3];CopyObjectResult$=[3,n0,_COR,0,[_ETa,_LM,_CT,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh],[0,4,0,0,0,0,0,0]];CopyPartResult$=[3,n0,_CPR,0,[_ETa,_LM,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh],[0,4,0,0,0,0,0]];CORSConfiguration$=[3,n0,_CORSC,0,["CORSRules"],[[()=>CORSRules,{[_xF]:1,[_xN]:"CORSRule"}]],1];CORSRule$=[3,n0,"CORSRule",0,["AllowedMethods","AllowedOrigins","ID","AllowedHeaders","ExposeHeaders","MaxAgeSeconds"],[[64,{[_xF]:1,[_xN]:"AllowedMethod"}],[64,{[_xF]:1,[_xN]:"AllowedOrigin"}],0,[64,{[_xF]:1,[_xN]:"AllowedHeader"}],[64,{[_xF]:1,[_xN]:"ExposeHeader"}],1],2];CreateBucketConfiguration$=[3,n0,_CBC,0,[_LC,_L,_B,_T],[0,()=>LocationInfo$,()=>BucketInfo$,[()=>TagSet,0]]];CreateBucketMetadataConfigurationRequest$=[3,n0,"CreateBucketMetadataConfigurationRequest",0,[_B,_MC,_CMD,_CA,_EBO],[[0,1],[()=>MetadataConfiguration$,{[_hP]:1,[_xN]:_MC}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];CreateBucketMetadataTableConfigurationRequest$=[3,n0,"CreateBucketMetadataTableConfigurationRequest",0,[_B,_MTC,_CMD,_CA,_EBO],[[0,1],[()=>MetadataTableConfiguration$,{[_hP]:1,[_xN]:_MTC}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];CreateBucketOutput$=[3,n0,"CreateBucketOutput",0,[_L,_BA],[[0,{[_hH]:_L}],[0,{[_hH]:_xaba}]]];CreateBucketRequest$=[3,n0,"CreateBucketRequest",0,[_B,"ACL",_CBC,_GFC,_GR,_GRACP,_GW,_GWACP,"ObjectLockEnabledForBucket",_OO,"BucketNamespace"],[[0,1],[0,{[_hH]:_xaa}],[()=>CreateBucketConfiguration$,{[_hP]:1,[_xN]:_CBC}],[0,{[_hH]:_xagfc}],[0,{[_hH]:_xagr}],[0,{[_hH]:_xagra}],[0,{[_hH]:_xagw}],[0,{[_hH]:_xagwa}],[2,{[_hH]:"x-amz-bucket-object-lock-enabled"}],[0,{[_hH]:"x-amz-object-ownership"}],[0,{[_hH]:"x-amz-bucket-namespace"}]],1];CreateMultipartUploadOutput$=[3,n0,"CreateMultipartUploadOutput",{[_xN]:"InitiateMultipartUploadResult"},["AbortDate","AbortRuleId",_B,_K,_UI,_SSE,_SSECA,_SSECKMD,_SSEKMSKI,_SSEKMSEC,_BKE,_RC,_CA,_CT],[[4,{[_hH]:_xaad}],[0,{[_hH]:_xaari}],[0,{[_xN]:_B}],0,0,[0,{[_hH]:_xasse}],[0,{[_hH]:_xasseca}],[0,{[_hH]:_xasseckM}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[()=>SSEKMSEncryptionContext,{[_hH]:_xassec}],[2,{[_hH]:_xassebke}],[0,{[_hH]:_xarc}],[0,{[_hH]:_xaca}],[0,{[_hH]:_xact}]]];CreateMultipartUploadRequest$=[3,n0,"CreateMultipartUploadRequest",0,[_B,_K,"ACL",_CC,_CDo,_CEo,_CL,_CTo,_Ex,_GFC,_GR,_GRACP,_GWACP,_M,_SSE,_SC,_WRL,_SSECA,_SSECK,_SSECKMD,_SSEKMSKI,_SSEKMSEC,_BKE,_RP,_Tag,_OLM,_OLRUD,_OLLHS,_EBO,_CA,_CT],[[0,1],[0,1],[0,{[_hH]:_xaa}],[0,{[_hH]:_CC_}],[0,{[_hH]:_CD_}],[0,{[_hH]:_CE_}],[0,{[_hH]:_CL_}],[0,{[_hH]:_CT_}],[4,{[_hH]:_Ex}],[0,{[_hH]:_xagfc}],[0,{[_hH]:_xagr}],[0,{[_hH]:_xagra}],[0,{[_hH]:_xagwa}],[128,{[_hPH]:_xam}],[0,{[_hH]:_xasse}],[0,{[_hH]:_xasc}],[0,{[_hH]:_xawrl}],[0,{[_hH]:_xasseca}],[()=>SSECustomerKey,{[_hH]:_xasseck}],[0,{[_hH]:_xasseckM}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[()=>SSEKMSEncryptionContext,{[_hH]:_xassec}],[2,{[_hH]:_xassebke}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xat}],[0,{[_hH]:_xaolm}],[5,{[_hH]:_xaolrud}],[0,{[_hH]:_xaollh}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xaca}],[0,{[_hH]:_xact}]],2];CreateSessionOutput$=[3,n0,"CreateSessionOutput",{[_xN]:"CreateSessionResult"},[_Cr,_SSE,_SSEKMSKI,_SSEKMSEC,_BKE],[[()=>SessionCredentials$,{[_xN]:_Cr}],[0,{[_hH]:_xasse}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[()=>SSEKMSEncryptionContext,{[_hH]:_xassec}],[2,{[_hH]:_xassebke}]],1];CreateSessionRequest$=[3,n0,"CreateSessionRequest",0,[_B,"SessionMode",_SSE,_SSEKMSKI,_SSEKMSEC,_BKE],[[0,1],[0,{[_hH]:"x-amz-create-session-mode"}],[0,{[_hH]:_xasse}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[()=>SSEKMSEncryptionContext,{[_hH]:_xassec}],[2,{[_hH]:_xassebke}]],1];CSVInput$=[3,n0,"CSVInput",0,["FileHeaderInfo","Comments",_QEC,_RD,_FD,_QC,"AllowQuotedRecordDelimiter"],[0,0,0,0,0,0,2]];CSVOutput$=[3,n0,"CSVOutput",0,["QuoteFields",_QEC,_RD,_FD,_QC],[0,0,0,0,0]];DefaultRetention$=[3,n0,_DRe,0,["Mode",_D,"Years"],[0,1,1]];Delete$=[3,n0,_De,0,["Objects","Quiet"],[[()=>ObjectIdentifierList,{[_xF]:1,[_xN]:"Object"}],2],1];DeleteBucketAnalyticsConfigurationRequest$=[3,n0,"DeleteBucketAnalyticsConfigurationRequest",0,[_B,_I,_EBO],[[0,1],[0,{[_hQ]:_i}],[0,{[_hH]:_xaebo}]],2];DeleteBucketCorsRequest$=[3,n0,"DeleteBucketCorsRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];DeleteBucketEncryptionRequest$=[3,n0,"DeleteBucketEncryptionRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];DeleteBucketIntelligentTieringConfigurationRequest$=[3,n0,"DeleteBucketIntelligentTieringConfigurationRequest",0,[_B,_I,_EBO],[[0,1],[0,{[_hQ]:_i}],[0,{[_hH]:_xaebo}]],2];DeleteBucketInventoryConfigurationRequest$=[3,n0,"DeleteBucketInventoryConfigurationRequest",0,[_B,_I,_EBO],[[0,1],[0,{[_hQ]:_i}],[0,{[_hH]:_xaebo}]],2];DeleteBucketLifecycleRequest$=[3,n0,"DeleteBucketLifecycleRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];DeleteBucketMetadataConfigurationRequest$=[3,n0,"DeleteBucketMetadataConfigurationRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];DeleteBucketMetadataTableConfigurationRequest$=[3,n0,"DeleteBucketMetadataTableConfigurationRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];DeleteBucketMetricsConfigurationRequest$=[3,n0,"DeleteBucketMetricsConfigurationRequest",0,[_B,_I,_EBO],[[0,1],[0,{[_hQ]:_i}],[0,{[_hH]:_xaebo}]],2];DeleteBucketOwnershipControlsRequest$=[3,n0,"DeleteBucketOwnershipControlsRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];DeleteBucketPolicyRequest$=[3,n0,"DeleteBucketPolicyRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];DeleteBucketReplicationRequest$=[3,n0,"DeleteBucketReplicationRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];DeleteBucketRequest$=[3,n0,"DeleteBucketRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];DeleteBucketTaggingRequest$=[3,n0,"DeleteBucketTaggingRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];DeleteBucketWebsiteRequest$=[3,n0,"DeleteBucketWebsiteRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];DeletedObject$=[3,n0,"DeletedObject",0,[_K,_VI,_DM,"DeleteMarkerVersionId"],[0,0,2,0]];DeleteMarkerEntry$=[3,n0,"DeleteMarkerEntry",0,[_O,_K,_VI,"IsLatest",_LM],[()=>Owner$,0,0,2,4]];DeleteMarkerReplication$=[3,n0,_DMR,0,[_S],[0]];DeleteObjectOutput$=[3,n0,"DeleteObjectOutput",0,[_DM,_VI,_RC],[[2,{[_hH]:_xadm}],[0,{[_hH]:_xavi}],[0,{[_hH]:_xarc}]]];DeleteObjectRequest$=[3,n0,"DeleteObjectRequest",0,[_B,_K,"MFA",_VI,_RP,_BGR,_EBO,_IM,"IfMatchLastModifiedTime","IfMatchSize"],[[0,1],[0,1],[0,{[_hH]:"x-amz-mfa"}],[0,{[_hQ]:_vI}],[0,{[_hH]:_xarp}],[2,{[_hH]:_xabgr}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_IM_}],[6,{[_hH]:"x-amz-if-match-last-modified-time"}],[1,{[_hH]:"x-amz-if-match-size"}]],2];DeleteObjectsOutput$=[3,n0,"DeleteObjectsOutput",{[_xN]:"DeleteResult"},["Deleted",_RC,"Errors"],[[()=>DeletedObjects,{[_xF]:1}],[0,{[_hH]:_xarc}],[()=>Errors,{[_xF]:1,[_xN]:_Err}]]];DeleteObjectsRequest$=[3,n0,"DeleteObjectsRequest",0,[_B,_De,"MFA",_RP,_BGR,_EBO,_CA],[[0,1],[()=>Delete$,{[_hP]:1,[_xN]:_De}],[0,{[_hH]:"x-amz-mfa"}],[0,{[_hH]:_xarp}],[2,{[_hH]:_xabgr}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xasca}]],2];DeleteObjectTaggingOutput$=[3,n0,"DeleteObjectTaggingOutput",0,[_VI],[[0,{[_hH]:_xavi}]]];DeleteObjectTaggingRequest$=[3,n0,"DeleteObjectTaggingRequest",0,[_B,_K,_VI,_EBO],[[0,1],[0,1],[0,{[_hQ]:_vI}],[0,{[_hH]:_xaebo}]],2];DeletePublicAccessBlockRequest$=[3,n0,"DeletePublicAccessBlockRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];Destination$=[3,n0,_Des,0,[_B,"Account",_SC,_ACT,_EC,_RT,"Metrics"],[0,0,0,()=>AccessControlTranslation$,()=>EncryptionConfiguration$,()=>ReplicationTime$,()=>Metrics$],1];DestinationResult$=[3,n0,_DRes,0,["TableBucketType",_TBA,_TN],[0,0,0]];Encryption$=[3,n0,_En,0,[_ET,"KMSKeyId","KMSContext"],[0,[()=>SSEKMSKeyId,0],0],1];EncryptionConfiguration$=[3,n0,_EC,0,["ReplicaKmsKeyID"],[0]];EndEvent$=[3,n0,"EndEvent",0,[],[]];_Error$=[3,n0,_Err,0,[_K,_VI,"Code","Message"],[0,0,0,0]];ErrorDetails$=[3,n0,"ErrorDetails",0,["ErrorCode",_EM],[0,0]];ErrorDocument$=[3,n0,_EDr,0,[_K],[0],1];EventBridgeConfiguration$=[3,n0,_EBC,0,[],[]];ExistingObjectReplication$=[3,n0,_EOR,0,[_S],[0],1];FilterRule$=[3,n0,_FR,0,[_N,_V],[0,0]];GetBucketAbacOutput$=[3,n0,"GetBucketAbacOutput",0,[_AS],[[()=>AbacStatus$,16]]];GetBucketAbacRequest$=[3,n0,"GetBucketAbacRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketAccelerateConfigurationOutput$=[3,n0,"GetBucketAccelerateConfigurationOutput",{[_xN]:_AC},[_S,_RC],[0,[0,{[_hH]:_xarc}]]];GetBucketAccelerateConfigurationRequest$=[3,n0,"GetBucketAccelerateConfigurationRequest",0,[_B,_EBO,_RP],[[0,1],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xarp}]],1];GetBucketAclOutput$=[3,n0,"GetBucketAclOutput",{[_xN]:_ACP},[_O,_G],[()=>Owner$,[()=>Grants,{[_xN]:_ACL}]]];GetBucketAclRequest$=[3,n0,"GetBucketAclRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketAnalyticsConfigurationOutput$=[3,n0,"GetBucketAnalyticsConfigurationOutput",0,[_ACn],[[()=>AnalyticsConfiguration$,16]]];GetBucketAnalyticsConfigurationRequest$=[3,n0,"GetBucketAnalyticsConfigurationRequest",0,[_B,_I,_EBO],[[0,1],[0,{[_hQ]:_i}],[0,{[_hH]:_xaebo}]],2];GetBucketCorsOutput$=[3,n0,"GetBucketCorsOutput",{[_xN]:_CORSC},["CORSRules"],[[()=>CORSRules,{[_xF]:1,[_xN]:"CORSRule"}]]];GetBucketCorsRequest$=[3,n0,"GetBucketCorsRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketEncryptionOutput$=[3,n0,"GetBucketEncryptionOutput",0,[_SSEC],[[()=>ServerSideEncryptionConfiguration$,16]]];GetBucketEncryptionRequest$=[3,n0,"GetBucketEncryptionRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketIntelligentTieringConfigurationOutput$=[3,n0,"GetBucketIntelligentTieringConfigurationOutput",0,[_ITC],[[()=>IntelligentTieringConfiguration$,16]]];GetBucketIntelligentTieringConfigurationRequest$=[3,n0,"GetBucketIntelligentTieringConfigurationRequest",0,[_B,_I,_EBO],[[0,1],[0,{[_hQ]:_i}],[0,{[_hH]:_xaebo}]],2];GetBucketInventoryConfigurationOutput$=[3,n0,"GetBucketInventoryConfigurationOutput",0,[_IC],[[()=>InventoryConfiguration$,16]]];GetBucketInventoryConfigurationRequest$=[3,n0,"GetBucketInventoryConfigurationRequest",0,[_B,_I,_EBO],[[0,1],[0,{[_hQ]:_i}],[0,{[_hH]:_xaebo}]],2];GetBucketLifecycleConfigurationOutput$=[3,n0,"GetBucketLifecycleConfigurationOutput",{[_xN]:_LCi},[_R,_TDMOS],[[()=>LifecycleRules,{[_xF]:1,[_xN]:_Ru}],[0,{[_hH]:_xatdmos}]]];GetBucketLifecycleConfigurationRequest$=[3,n0,"GetBucketLifecycleConfigurationRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketLocationOutput$=[3,n0,"GetBucketLocationOutput",{[_xN]:_LC},[_LC],[0]];GetBucketLocationRequest$=[3,n0,"GetBucketLocationRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketLoggingOutput$=[3,n0,"GetBucketLoggingOutput",{[_xN]:_BLS},[_LE],[[()=>LoggingEnabled$,0]]];GetBucketLoggingRequest$=[3,n0,"GetBucketLoggingRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketMetadataConfigurationOutput$=[3,n0,"GetBucketMetadataConfigurationOutput",0,[_GBMCR],[[()=>GetBucketMetadataConfigurationResult$,16]]];GetBucketMetadataConfigurationRequest$=[3,n0,"GetBucketMetadataConfigurationRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketMetadataConfigurationResult$=[3,n0,_GBMCR,0,[_MCR],[()=>MetadataConfigurationResult$],1];GetBucketMetadataTableConfigurationOutput$=[3,n0,"GetBucketMetadataTableConfigurationOutput",0,[_GBMTCR],[[()=>GetBucketMetadataTableConfigurationResult$,16]]];GetBucketMetadataTableConfigurationRequest$=[3,n0,"GetBucketMetadataTableConfigurationRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketMetadataTableConfigurationResult$=[3,n0,_GBMTCR,0,[_MTCR,_S,_Err],[()=>MetadataTableConfigurationResult$,0,()=>ErrorDetails$],2];GetBucketMetricsConfigurationOutput$=[3,n0,"GetBucketMetricsConfigurationOutput",0,[_MCe],[[()=>MetricsConfiguration$,16]]];GetBucketMetricsConfigurationRequest$=[3,n0,"GetBucketMetricsConfigurationRequest",0,[_B,_I,_EBO],[[0,1],[0,{[_hQ]:_i}],[0,{[_hH]:_xaebo}]],2];GetBucketNotificationConfigurationRequest$=[3,n0,"GetBucketNotificationConfigurationRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketOwnershipControlsOutput$=[3,n0,"GetBucketOwnershipControlsOutput",0,[_OC],[[()=>OwnershipControls$,16]]];GetBucketOwnershipControlsRequest$=[3,n0,"GetBucketOwnershipControlsRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketPolicyOutput$=[3,n0,"GetBucketPolicyOutput",0,["Policy"],[[0,16]]];GetBucketPolicyRequest$=[3,n0,"GetBucketPolicyRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketPolicyStatusOutput$=[3,n0,"GetBucketPolicyStatusOutput",0,[_PS],[[()=>PolicyStatus$,16]]];GetBucketPolicyStatusRequest$=[3,n0,"GetBucketPolicyStatusRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketReplicationOutput$=[3,n0,"GetBucketReplicationOutput",0,[_RCe],[[()=>ReplicationConfiguration$,16]]];GetBucketReplicationRequest$=[3,n0,"GetBucketReplicationRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketRequestPaymentOutput$=[3,n0,"GetBucketRequestPaymentOutput",{[_xN]:_RPC},["Payer"],[0]];GetBucketRequestPaymentRequest$=[3,n0,"GetBucketRequestPaymentRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketTaggingOutput$=[3,n0,"GetBucketTaggingOutput",{[_xN]:_Tag},[_TS],[[()=>TagSet,0]],1];GetBucketTaggingRequest$=[3,n0,"GetBucketTaggingRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketVersioningOutput$=[3,n0,"GetBucketVersioningOutput",{[_xN]:_VC},[_S,"MFADelete"],[0,[0,{[_xN]:"MfaDelete"}]]];GetBucketVersioningRequest$=[3,n0,"GetBucketVersioningRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetBucketWebsiteOutput$=[3,n0,"GetBucketWebsiteOutput",{[_xN]:_WC},[_RART,_IDn,_EDr,_RR],[()=>RedirectAllRequestsTo$,()=>IndexDocument$,()=>ErrorDocument$,[()=>RoutingRules,0]]];GetBucketWebsiteRequest$=[3,n0,"GetBucketWebsiteRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetObjectAclOutput$=[3,n0,"GetObjectAclOutput",{[_xN]:_ACP},[_O,_G,_RC],[()=>Owner$,[()=>Grants,{[_xN]:_ACL}],[0,{[_hH]:_xarc}]]];GetObjectAclRequest$=[3,n0,"GetObjectAclRequest",0,[_B,_K,_VI,_RP,_EBO],[[0,1],[0,1],[0,{[_hQ]:_vI}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}]],2];GetObjectAttributesOutput$=[3,n0,"GetObjectAttributesOutput",{[_xN]:"GetObjectAttributesResponse"},[_DM,_LM,_VI,_RC,_ETa,_C,"ObjectParts",_SC,"ObjectSize"],[[2,{[_hH]:_xadm}],[4,{[_hH]:_LM_}],[0,{[_hH]:_xavi}],[0,{[_hH]:_xarc}],0,()=>Checksum$,[()=>GetObjectAttributesParts$,0],0,1]];GetObjectAttributesParts$=[3,n0,"GetObjectAttributesParts",0,["TotalPartsCount",_PNM,_NPNM,_MP,_IT,_Pa],[[1,{[_xN]:_PC}],0,0,1,2,[()=>PartsList,{[_xF]:1,[_xN]:"Part"}]]];GetObjectAttributesRequest$=[3,n0,"GetObjectAttributesRequest",0,[_B,_K,"ObjectAttributes",_VI,_MP,_PNM,_SSECA,_SSECK,_SSECKMD,_RP,_EBO],[[0,1],[0,1],[64,{[_hH]:"x-amz-object-attributes"}],[0,{[_hQ]:_vI}],[1,{[_hH]:"x-amz-max-parts"}],[0,{[_hH]:"x-amz-part-number-marker"}],[0,{[_hH]:_xasseca}],[()=>SSECustomerKey,{[_hH]:_xasseck}],[0,{[_hH]:_xasseckM}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}]],3];GetObjectLegalHoldOutput$=[3,n0,"GetObjectLegalHoldOutput",0,[_LH],[[()=>ObjectLockLegalHold$,{[_hP]:1,[_xN]:_LH}]]];GetObjectLegalHoldRequest$=[3,n0,"GetObjectLegalHoldRequest",0,[_B,_K,_VI,_RP,_EBO],[[0,1],[0,1],[0,{[_hQ]:_vI}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}]],2];GetObjectLockConfigurationOutput$=[3,n0,"GetObjectLockConfigurationOutput",0,[_OLC],[[()=>ObjectLockConfiguration$,16]]];GetObjectLockConfigurationRequest$=[3,n0,"GetObjectLockConfigurationRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GetObjectOutput$=[3,n0,"GetObjectOutput",0,[_Bo,_DM,_AR,_E,_Re,_LM,_CLo,_ETa,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh,_CT,_MM,_VI,_CC,_CDo,_CEo,_CL,_CR,_CTo,_Ex,_ES,_WRL,_SSE,_M,_SSECA,_SSECKMD,_SSEKMSKI,_BKE,_SC,_RC,_RS,_PC,_TC,_OLM,_OLRUD,_OLLHS],[[()=>StreamingBlob,16],[2,{[_hH]:_xadm}],[0,{[_hH]:_ar}],[0,{[_hH]:_xae}],[0,{[_hH]:_xar}],[4,{[_hH]:_LM_}],[1,{[_hH]:_CL__}],[0,{[_hH]:_ETa}],[0,{[_hH]:_xacc}],[0,{[_hH]:_xacc_}],[0,{[_hH]:_xacc__}],[0,{[_hH]:_xacs}],[0,{[_hH]:_xacs_}],[0,{[_hH]:_xact}],[1,{[_hH]:_xamm}],[0,{[_hH]:_xavi}],[0,{[_hH]:_CC_}],[0,{[_hH]:_CD_}],[0,{[_hH]:_CE_}],[0,{[_hH]:_CL_}],[0,{[_hH]:_CR_}],[0,{[_hH]:_CT_}],[4,{[_hH]:_Ex}],[0,{[_hH]:_ES}],[0,{[_hH]:_xawrl}],[0,{[_hH]:_xasse}],[128,{[_hPH]:_xam}],[0,{[_hH]:_xasseca}],[0,{[_hH]:_xasseckM}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[2,{[_hH]:_xassebke}],[0,{[_hH]:_xasc}],[0,{[_hH]:_xarc}],[0,{[_hH]:_xars}],[1,{[_hH]:_xampc}],[1,{[_hH]:_xatc}],[0,{[_hH]:_xaolm}],[5,{[_hH]:_xaolrud}],[0,{[_hH]:_xaollh}]]];GetObjectRequest$=[3,n0,"GetObjectRequest",0,[_B,_K,_IM,"IfModifiedSince",_INM,_IUS,_Ra,_RCC,_RCD,_RCE,_RCL,_RCT,_RE,_VI,_SSECA,_SSECK,_SSECKMD,_RP,_PN,_EBO,"ChecksumMode"],[[0,1],[0,1],[0,{[_hH]:_IM_}],[4,{[_hH]:_IMS_}],[0,{[_hH]:_INM_}],[4,{[_hH]:_IUS_}],[0,{[_hH]:_Ra}],[0,{[_hQ]:_rcc}],[0,{[_hQ]:_rcd}],[0,{[_hQ]:_rce}],[0,{[_hQ]:_rcl}],[0,{[_hQ]:_rct}],[6,{[_hQ]:_re}],[0,{[_hQ]:_vI}],[0,{[_hH]:_xasseca}],[()=>SSECustomerKey,{[_hH]:_xasseck}],[0,{[_hH]:_xasseckM}],[0,{[_hH]:_xarp}],[1,{[_hQ]:_pN}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xacm}]],2];GetObjectRetentionOutput$=[3,n0,"GetObjectRetentionOutput",0,[_Ret],[[()=>ObjectLockRetention$,{[_hP]:1,[_xN]:_Ret}]]];GetObjectRetentionRequest$=[3,n0,"GetObjectRetentionRequest",0,[_B,_K,_VI,_RP,_EBO],[[0,1],[0,1],[0,{[_hQ]:_vI}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}]],2];GetObjectTaggingOutput$=[3,n0,"GetObjectTaggingOutput",{[_xN]:_Tag},[_TS,_VI],[[()=>TagSet,0],[0,{[_hH]:_xavi}]],1];GetObjectTaggingRequest$=[3,n0,"GetObjectTaggingRequest",0,[_B,_K,_VI,_EBO,_RP],[[0,1],[0,1],[0,{[_hQ]:_vI}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xarp}]],2];GetObjectTorrentOutput$=[3,n0,"GetObjectTorrentOutput",0,[_Bo,_RC],[[()=>StreamingBlob,16],[0,{[_hH]:_xarc}]]];GetObjectTorrentRequest$=[3,n0,"GetObjectTorrentRequest",0,[_B,_K,_RP,_EBO],[[0,1],[0,1],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}]],2];GetPublicAccessBlockOutput$=[3,n0,"GetPublicAccessBlockOutput",0,[_PABC],[[()=>PublicAccessBlockConfiguration$,16]]];GetPublicAccessBlockRequest$=[3,n0,"GetPublicAccessBlockRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];GlacierJobParameters$=[3,n0,_GJP,0,["Tier"],[0],1];Grant$=[3,n0,"Grant",0,["Grantee",_Pe],[[()=>Grantee$,{[_xNm]:["xsi",_hi]}],0]];Grantee$=[3,n0,"Grantee",0,[_Ty,_DN,"EmailAddress","ID","URI"],[[0,{[_xA]:1,[_xN]:"xsi:type"}],0,0,0,0],1];HeadBucketOutput$=[3,n0,"HeadBucketOutput",0,[_BA,"BucketLocationType","BucketLocationName",_BR,"AccessPointAlias"],[[0,{[_hH]:_xaba}],[0,{[_hH]:"x-amz-bucket-location-type"}],[0,{[_hH]:"x-amz-bucket-location-name"}],[0,{[_hH]:"x-amz-bucket-region"}],[2,{[_hH]:"x-amz-access-point-alias"}]]];HeadBucketRequest$=[3,n0,"HeadBucketRequest",0,[_B,_EBO],[[0,1],[0,{[_hH]:_xaebo}]],1];HeadObjectOutput$=[3,n0,"HeadObjectOutput",0,[_DM,_AR,_E,_Re,"ArchiveStatus",_LM,_CLo,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh,_CT,_ETa,_MM,_VI,_CC,_CDo,_CEo,_CL,_CTo,_CR,_Ex,_ES,_WRL,_SSE,_M,_SSECA,_SSECKMD,_SSEKMSKI,_BKE,_SC,_RC,_RS,_PC,_TC,_OLM,_OLRUD,_OLLHS],[[2,{[_hH]:_xadm}],[0,{[_hH]:_ar}],[0,{[_hH]:_xae}],[0,{[_hH]:_xar}],[0,{[_hH]:"x-amz-archive-status"}],[4,{[_hH]:_LM_}],[1,{[_hH]:_CL__}],[0,{[_hH]:_xacc}],[0,{[_hH]:_xacc_}],[0,{[_hH]:_xacc__}],[0,{[_hH]:_xacs}],[0,{[_hH]:_xacs_}],[0,{[_hH]:_xact}],[0,{[_hH]:_ETa}],[1,{[_hH]:_xamm}],[0,{[_hH]:_xavi}],[0,{[_hH]:_CC_}],[0,{[_hH]:_CD_}],[0,{[_hH]:_CE_}],[0,{[_hH]:_CL_}],[0,{[_hH]:_CT_}],[0,{[_hH]:_CR_}],[4,{[_hH]:_Ex}],[0,{[_hH]:_ES}],[0,{[_hH]:_xawrl}],[0,{[_hH]:_xasse}],[128,{[_hPH]:_xam}],[0,{[_hH]:_xasseca}],[0,{[_hH]:_xasseckM}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[2,{[_hH]:_xassebke}],[0,{[_hH]:_xasc}],[0,{[_hH]:_xarc}],[0,{[_hH]:_xars}],[1,{[_hH]:_xampc}],[1,{[_hH]:_xatc}],[0,{[_hH]:_xaolm}],[5,{[_hH]:_xaolrud}],[0,{[_hH]:_xaollh}]]];HeadObjectRequest$=[3,n0,"HeadObjectRequest",0,[_B,_K,_IM,"IfModifiedSince",_INM,_IUS,_Ra,_RCC,_RCD,_RCE,_RCL,_RCT,_RE,_VI,_SSECA,_SSECK,_SSECKMD,_RP,_PN,_EBO,"ChecksumMode"],[[0,1],[0,1],[0,{[_hH]:_IM_}],[4,{[_hH]:_IMS_}],[0,{[_hH]:_INM_}],[4,{[_hH]:_IUS_}],[0,{[_hH]:_Ra}],[0,{[_hQ]:_rcc}],[0,{[_hQ]:_rcd}],[0,{[_hQ]:_rce}],[0,{[_hQ]:_rcl}],[0,{[_hQ]:_rct}],[6,{[_hQ]:_re}],[0,{[_hQ]:_vI}],[0,{[_hH]:_xasseca}],[()=>SSECustomerKey,{[_hH]:_xasseck}],[0,{[_hH]:_xasseckM}],[0,{[_hH]:_xarp}],[1,{[_hQ]:_pN}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xacm}]],2];IndexDocument$=[3,n0,_IDn,0,["Suffix"],[0],1];Initiator$=[3,n0,_In,0,["ID",_DN],[0,0]];InputSerialization$=[3,n0,_IS,0,["CSV","CompressionType","JSON","Parquet"],[()=>CSVInput$,0,()=>JSONInput$,()=>ParquetInput$]];IntelligentTieringAndOperator$=[3,n0,"IntelligentTieringAndOperator",0,[_P,_T],[0,[()=>TagSet,{[_xF]:1,[_xN]:_Ta}]]];IntelligentTieringConfiguration$=[3,n0,_ITC,0,[_I,_S,"Tierings",_F],[0,0,[()=>TieringList,{[_xF]:1,[_xN]:"Tiering"}],[()=>IntelligentTieringFilter$,0]],3];IntelligentTieringFilter$=[3,n0,"IntelligentTieringFilter",0,[_P,_Ta,"And"],[0,()=>Tag$,[()=>IntelligentTieringAndOperator$,0]]];InventoryConfiguration$=[3,n0,_IC,0,[_Des,"IsEnabled",_I,"IncludedObjectVersions","Schedule",_F,"OptionalFields"],[[()=>InventoryDestination$,0],2,0,0,()=>InventorySchedule$,()=>InventoryFilter$,[()=>InventoryOptionalFields,0]],5];InventoryDestination$=[3,n0,"InventoryDestination",0,[_SBD],[[()=>InventoryS3BucketDestination$,0]],1];InventoryEncryption$=[3,n0,"InventoryEncryption",0,["SSES3","SSEKMS"],[[()=>SSES3$,{[_xN]:"SSE-S3"}],[()=>SSEKMS$,{[_xN]:_SK}]]];InventoryFilter$=[3,n0,"InventoryFilter",0,[_P],[0],1];InventoryS3BucketDestination$=[3,n0,"InventoryS3BucketDestination",0,[_B,"Format","AccountId",_P,_En],[0,0,0,0,[()=>InventoryEncryption$,0]],2];InventorySchedule$=[3,n0,"InventorySchedule",0,["Frequency"],[0],1];InventoryTableConfiguration$=[3,n0,_ITCn,0,[_CSo,_EC],[0,()=>MetadataTableEncryptionConfiguration$],1];InventoryTableConfigurationResult$=[3,n0,_ITCR,0,[_CSo,"TableStatus",_Err,_TNa,_TA],[0,0,()=>ErrorDetails$,0,0],1];InventoryTableConfigurationUpdates$=[3,n0,"InventoryTableConfigurationUpdates",0,[_CSo,_EC],[0,()=>MetadataTableEncryptionConfiguration$],1];JournalTableConfiguration$=[3,n0,_JTC,0,[_REe,_EC],[()=>RecordExpiration$,()=>MetadataTableEncryptionConfiguration$],1];JournalTableConfigurationResult$=[3,n0,_JTCR,0,["TableStatus",_TNa,_REe,_Err,_TA],[0,0,()=>RecordExpiration$,()=>ErrorDetails$,0],3];JournalTableConfigurationUpdates$=[3,n0,"JournalTableConfigurationUpdates",0,[_REe],[()=>RecordExpiration$],1];JSONInput$=[3,n0,"JSONInput",0,[_Ty],[0]];JSONOutput$=[3,n0,"JSONOutput",0,[_RD],[0]];LambdaFunctionConfiguration$=[3,n0,"LambdaFunctionConfiguration",0,["LambdaFunctionArn",_Ev,_I,_F],[[0,{[_xN]:"CloudFunction"}],[64,{[_xF]:1,[_xN]:"Event"}],0,[()=>NotificationConfigurationFilter$,0]],2];LifecycleExpiration$=[3,n0,"LifecycleExpiration",0,["Date",_D,"ExpiredObjectDeleteMarker"],[5,1,2]];LifecycleRule$=[3,n0,"LifecycleRule",0,[_S,_E,"ID",_P,_F,"Transitions","NoncurrentVersionTransitions",_NVE,_AIMU],[0,()=>LifecycleExpiration$,0,0,[()=>LifecycleRuleFilter$,0],[()=>TransitionList,{[_xF]:1,[_xN]:"Transition"}],[()=>NoncurrentVersionTransitionList,{[_xF]:1,[_xN]:_NVTo}],()=>NoncurrentVersionExpiration$,()=>AbortIncompleteMultipartUpload$],1];LifecycleRuleAndOperator$=[3,n0,"LifecycleRuleAndOperator",0,[_P,_T,_OSGT,_OSLT],[0,[()=>TagSet,{[_xF]:1,[_xN]:_Ta}],1,1]];LifecycleRuleFilter$=[3,n0,"LifecycleRuleFilter",0,[_P,_Ta,_OSGT,_OSLT,"And"],[0,()=>Tag$,1,1,[()=>LifecycleRuleAndOperator$,0]]];ListBucketAnalyticsConfigurationsOutput$=[3,n0,"ListBucketAnalyticsConfigurationsOutput",{[_xN]:"ListBucketAnalyticsConfigurationResult"},[_IT,_CTon,_NCT,_ACLn],[2,0,0,[()=>AnalyticsConfigurationList,{[_xF]:1,[_xN]:_ACn}]]];ListBucketAnalyticsConfigurationsRequest$=[3,n0,"ListBucketAnalyticsConfigurationsRequest",0,[_B,_CTon,_EBO],[[0,1],[0,{[_hQ]:_ct}],[0,{[_hH]:_xaebo}]],1];ListBucketIntelligentTieringConfigurationsOutput$=[3,n0,"ListBucketIntelligentTieringConfigurationsOutput",0,[_IT,_CTon,_NCT,_ITCL],[2,0,0,[()=>IntelligentTieringConfigurationList,{[_xF]:1,[_xN]:_ITC}]]];ListBucketIntelligentTieringConfigurationsRequest$=[3,n0,"ListBucketIntelligentTieringConfigurationsRequest",0,[_B,_CTon,_EBO],[[0,1],[0,{[_hQ]:_ct}],[0,{[_hH]:_xaebo}]],1];ListBucketInventoryConfigurationsOutput$=[3,n0,"ListBucketInventoryConfigurationsOutput",{[_xN]:"ListInventoryConfigurationsResult"},[_CTon,_ICL,_IT,_NCT],[0,[()=>InventoryConfigurationList,{[_xF]:1,[_xN]:_IC}],2,0]];ListBucketInventoryConfigurationsRequest$=[3,n0,"ListBucketInventoryConfigurationsRequest",0,[_B,_CTon,_EBO],[[0,1],[0,{[_hQ]:_ct}],[0,{[_hH]:_xaebo}]],1];ListBucketMetricsConfigurationsOutput$=[3,n0,"ListBucketMetricsConfigurationsOutput",{[_xN]:"ListMetricsConfigurationsResult"},[_IT,_CTon,_NCT,_MCL],[2,0,0,[()=>MetricsConfigurationList,{[_xF]:1,[_xN]:_MCe}]]];ListBucketMetricsConfigurationsRequest$=[3,n0,"ListBucketMetricsConfigurationsRequest",0,[_B,_CTon,_EBO],[[0,1],[0,{[_hQ]:_ct}],[0,{[_hH]:_xaebo}]],1];ListBucketsOutput$=[3,n0,"ListBucketsOutput",{[_xN]:"ListAllMyBucketsResult"},[_Bu,_O,_CTon,_P],[[()=>Buckets,0],()=>Owner$,0,0]];ListBucketsRequest$=[3,n0,"ListBucketsRequest",0,["MaxBuckets",_CTon,_P,_BR],[[1,{[_hQ]:"max-buckets"}],[0,{[_hQ]:_ct}],[0,{[_hQ]:_p}],[0,{[_hQ]:"bucket-region"}]]];ListDirectoryBucketsOutput$=[3,n0,"ListDirectoryBucketsOutput",{[_xN]:"ListAllMyDirectoryBucketsResult"},[_Bu,_CTon],[[()=>Buckets,0],0]];ListDirectoryBucketsRequest$=[3,n0,"ListDirectoryBucketsRequest",0,[_CTon,"MaxDirectoryBuckets"],[[0,{[_hQ]:_ct}],[1,{[_hQ]:"max-directory-buckets"}]]];ListMultipartUploadsOutput$=[3,n0,"ListMultipartUploadsOutput",{[_xN]:"ListMultipartUploadsResult"},[_B,_KM,_UIM,_NKM,_P,_Deli,"NextUploadIdMarker","MaxUploads",_IT,"Uploads",_CPom,_ETn,_RC],[0,0,0,0,0,0,0,1,2,[()=>MultipartUploadList,{[_xF]:1,[_xN]:"Upload"}],[()=>CommonPrefixList,{[_xF]:1}],0,[0,{[_hH]:_xarc}]]];ListMultipartUploadsRequest$=[3,n0,"ListMultipartUploadsRequest",0,[_B,_Deli,_ETn,_KM,"MaxUploads",_P,_UIM,_EBO,_RP],[[0,1],[0,{[_hQ]:_d}],[0,{[_hQ]:_et}],[0,{[_hQ]:_km}],[1,{[_hQ]:"max-uploads"}],[0,{[_hQ]:_p}],[0,{[_hQ]:"upload-id-marker"}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xarp}]],1];ListObjectsOutput$=[3,n0,"ListObjectsOutput",{[_xN]:_LBRi},[_IT,"Marker","NextMarker","Contents",_N,_P,_Deli,_MK,_CPom,_ETn,_RC],[2,0,0,[()=>ObjectList,{[_xF]:1}],0,0,0,1,[()=>CommonPrefixList,{[_xF]:1}],0,[0,{[_hH]:_xarc}]]];ListObjectsRequest$=[3,n0,"ListObjectsRequest",0,[_B,_Deli,_ETn,"Marker",_MK,_P,_RP,_EBO,_OOA],[[0,1],[0,{[_hQ]:_d}],[0,{[_hQ]:_et}],[0,{[_hQ]:"marker"}],[1,{[_hQ]:_mk}],[0,{[_hQ]:_p}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}],[64,{[_hH]:_xaooa}]],1];ListObjectsV2Output$=[3,n0,"ListObjectsV2Output",{[_xN]:_LBRi},[_IT,"Contents",_N,_P,_Deli,_MK,_CPom,_ETn,"KeyCount",_CTon,_NCT,_SA,_RC],[2,[()=>ObjectList,{[_xF]:1}],0,0,0,1,[()=>CommonPrefixList,{[_xF]:1}],0,1,0,0,0,[0,{[_hH]:_xarc}]]];ListObjectsV2Request$=[3,n0,"ListObjectsV2Request",0,[_B,_Deli,_ETn,_MK,_P,_CTon,"FetchOwner",_SA,_RP,_EBO,_OOA],[[0,1],[0,{[_hQ]:_d}],[0,{[_hQ]:_et}],[1,{[_hQ]:_mk}],[0,{[_hQ]:_p}],[0,{[_hQ]:_ct}],[2,{[_hQ]:"fetch-owner"}],[0,{[_hQ]:"start-after"}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}],[64,{[_hH]:_xaooa}]],1];ListObjectVersionsOutput$=[3,n0,"ListObjectVersionsOutput",{[_xN]:"ListVersionsResult"},[_IT,_KM,_VIM,_NKM,"NextVersionIdMarker","Versions",_DMe,_N,_P,_Deli,_MK,_CPom,_ETn,_RC],[2,0,0,0,0,[()=>ObjectVersionList,{[_xF]:1,[_xN]:"Version"}],[()=>DeleteMarkers,{[_xF]:1,[_xN]:_DM}],0,0,0,1,[()=>CommonPrefixList,{[_xF]:1}],0,[0,{[_hH]:_xarc}]]];ListObjectVersionsRequest$=[3,n0,"ListObjectVersionsRequest",0,[_B,_Deli,_ETn,_KM,_MK,_P,_VIM,_EBO,_RP,_OOA],[[0,1],[0,{[_hQ]:_d}],[0,{[_hQ]:_et}],[0,{[_hQ]:_km}],[1,{[_hQ]:_mk}],[0,{[_hQ]:_p}],[0,{[_hQ]:"version-id-marker"}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xarp}],[64,{[_hH]:_xaooa}]],1];ListPartsOutput$=[3,n0,"ListPartsOutput",{[_xN]:"ListPartsResult"},["AbortDate","AbortRuleId",_B,_K,_UI,_PNM,_NPNM,_MP,_IT,_Pa,_In,_O,_SC,_RC,_CA,_CT],[[4,{[_hH]:_xaad}],[0,{[_hH]:_xaari}],0,0,0,0,0,1,2,[()=>Parts,{[_xF]:1,[_xN]:"Part"}],()=>Initiator$,()=>Owner$,0,[0,{[_hH]:_xarc}],0,0]];ListPartsRequest$=[3,n0,"ListPartsRequest",0,[_B,_K,_UI,_MP,_PNM,_RP,_EBO,_SSECA,_SSECK,_SSECKMD],[[0,1],[0,1],[0,{[_hQ]:_uI}],[1,{[_hQ]:"max-parts"}],[0,{[_hQ]:"part-number-marker"}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xasseca}],[()=>SSECustomerKey,{[_hH]:_xasseck}],[0,{[_hH]:_xasseckM}]],3];LocationInfo$=[3,n0,"LocationInfo",0,[_Ty,_N],[0,0]];LoggingEnabled$=[3,n0,_LE,0,["TargetBucket","TargetPrefix",_TG,_TOKF],[0,0,[()=>TargetGrants,0],[()=>TargetObjectKeyFormat$,0]],2];MetadataConfiguration$=[3,n0,_MC,0,[_JTC,_ITCn],[()=>JournalTableConfiguration$,()=>InventoryTableConfiguration$],1];MetadataConfigurationResult$=[3,n0,_MCR,0,[_DRes,_JTCR,_ITCR],[()=>DestinationResult$,()=>JournalTableConfigurationResult$,()=>InventoryTableConfigurationResult$],1];MetadataEntry$=[3,n0,_ME,0,[_N,_V],[0,0]];MetadataTableConfiguration$=[3,n0,_MTC,0,[_STD],[()=>S3TablesDestination$],1];MetadataTableConfigurationResult$=[3,n0,_MTCR,0,[_STDR],[()=>S3TablesDestinationResult$],1];MetadataTableEncryptionConfiguration$=[3,n0,"MetadataTableEncryptionConfiguration",0,["SseAlgorithm","KmsKeyArn"],[0,0],1];Metrics$=[3,n0,"Metrics",0,[_S,"EventThreshold"],[0,()=>ReplicationTimeValue$],1];MetricsAndOperator$=[3,n0,"MetricsAndOperator",0,[_P,_T,"AccessPointArn"],[0,[()=>TagSet,{[_xF]:1,[_xN]:_Ta}],0]];MetricsConfiguration$=[3,n0,_MCe,0,[_I,_F],[0,[()=>MetricsFilter$,0]],1];MultipartUpload$=[3,n0,_MU,0,[_UI,_K,"Initiated",_SC,_O,_In,_CA,_CT],[0,0,4,0,()=>Owner$,()=>Initiator$,0,0]];NoncurrentVersionExpiration$=[3,n0,_NVE,0,[_ND,_NNV],[1,1]];NoncurrentVersionTransition$=[3,n0,_NVTo,0,[_ND,_SC,_NNV],[1,0,1]];NotificationConfiguration$=[3,n0,_NC,0,["TopicConfigurations","QueueConfigurations","LambdaFunctionConfigurations",_EBC],[[()=>TopicConfigurationList,{[_xF]:1,[_xN]:_TCop}],[()=>QueueConfigurationList,{[_xF]:1,[_xN]:_QCue}],[()=>LambdaFunctionConfigurationList,{[_xF]:1,[_xN]:"CloudFunctionConfiguration"}],()=>EventBridgeConfiguration$]];NotificationConfigurationFilter$=[3,n0,"NotificationConfigurationFilter",0,[_K],[[()=>S3KeyFilter$,{[_xN]:"S3Key"}]]];_Object$=[3,n0,"Object",0,[_K,_LM,_ETa,_CA,_CT,_Si,_SC,_O,_RSe],[0,4,0,[64,{[_xF]:1}],0,1,0,()=>Owner$,()=>RestoreStatus$]];ObjectIdentifier$=[3,n0,"ObjectIdentifier",0,[_K,_VI,_ETa,"LastModifiedTime",_Si],[0,0,0,6,1],1];ObjectLockConfiguration$=[3,n0,_OLC,0,["ObjectLockEnabled",_Ru],[0,()=>ObjectLockRule$]];ObjectLockLegalHold$=[3,n0,"ObjectLockLegalHold",0,[_S],[0]];ObjectLockRetention$=[3,n0,"ObjectLockRetention",0,["Mode","RetainUntilDate"],[0,5]];ObjectLockRule$=[3,n0,"ObjectLockRule",0,[_DRe],[()=>DefaultRetention$]];ObjectPart$=[3,n0,"ObjectPart",0,[_PN,_Si,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh],[1,1,0,0,0,0,0]];ObjectVersion$=[3,n0,"ObjectVersion",0,[_ETa,_CA,_CT,_Si,_SC,_K,_VI,"IsLatest",_LM,_O,_RSe],[0,[64,{[_xF]:1}],0,1,0,0,0,2,4,()=>Owner$,()=>RestoreStatus$]];OutputLocation$=[3,n0,_OL,0,["S3"],[[()=>S3Location$,0]]];OutputSerialization$=[3,n0,_OSu,0,["CSV","JSON"],[()=>CSVOutput$,()=>JSONOutput$]];Owner$=[3,n0,_O,0,[_DN,"ID"],[0,0]];OwnershipControls$=[3,n0,_OC,0,[_R],[[()=>OwnershipControlsRules,{[_xF]:1,[_xN]:_Ru}]],1];OwnershipControlsRule$=[3,n0,"OwnershipControlsRule",0,[_OO],[0],1];ParquetInput$=[3,n0,"ParquetInput",0,[],[]];Part$=[3,n0,"Part",0,[_PN,_LM,_ETa,_Si,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh],[1,4,0,1,0,0,0,0,0]];PartitionedPrefix$=[3,n0,_PP,{[_xN]:_PP},["PartitionDateSource"],[0]];PolicyStatus$=[3,n0,_PS,0,["IsPublic"],[[2,{[_xN]:"IsPublic"}]]];Progress$=[3,n0,"Progress",0,[_BS,_BP,_BRy],[1,1,1]];ProgressEvent$=[3,n0,"ProgressEvent",0,["Details"],[[()=>Progress$,{[_eP]:1}]]];PublicAccessBlockConfiguration$=[3,n0,_PABC,0,[_BPA,_IPA,_BPP,_RPB],[[2,{[_xN]:_BPA}],[2,{[_xN]:_IPA}],[2,{[_xN]:_BPP}],[2,{[_xN]:_RPB}]]];PutBucketAbacRequest$=[3,n0,"PutBucketAbacRequest",0,[_B,_AS,_CMD,_CA,_EBO],[[0,1],[()=>AbacStatus$,{[_hP]:1,[_xN]:_AS}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];PutBucketAccelerateConfigurationRequest$=[3,n0,"PutBucketAccelerateConfigurationRequest",0,[_B,_AC,_EBO,_CA],[[0,1],[()=>AccelerateConfiguration$,{[_hP]:1,[_xN]:_AC}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xasca}]],2];PutBucketAclRequest$=[3,n0,"PutBucketAclRequest",0,[_B,"ACL",_ACP,_CMD,_CA,_GFC,_GR,_GRACP,_GW,_GWACP,_EBO],[[0,1],[0,{[_hH]:_xaa}],[()=>AccessControlPolicy$,{[_hP]:1,[_xN]:_ACP}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xagfc}],[0,{[_hH]:_xagr}],[0,{[_hH]:_xagra}],[0,{[_hH]:_xagw}],[0,{[_hH]:_xagwa}],[0,{[_hH]:_xaebo}]],1];PutBucketAnalyticsConfigurationRequest$=[3,n0,"PutBucketAnalyticsConfigurationRequest",0,[_B,_I,_ACn,_EBO],[[0,1],[0,{[_hQ]:_i}],[()=>AnalyticsConfiguration$,{[_hP]:1,[_xN]:_ACn}],[0,{[_hH]:_xaebo}]],3];PutBucketCorsRequest$=[3,n0,"PutBucketCorsRequest",0,[_B,_CORSC,_CMD,_CA,_EBO],[[0,1],[()=>CORSConfiguration$,{[_hP]:1,[_xN]:_CORSC}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];PutBucketEncryptionRequest$=[3,n0,"PutBucketEncryptionRequest",0,[_B,_SSEC,_CMD,_CA,_EBO],[[0,1],[()=>ServerSideEncryptionConfiguration$,{[_hP]:1,[_xN]:_SSEC}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];PutBucketIntelligentTieringConfigurationRequest$=[3,n0,"PutBucketIntelligentTieringConfigurationRequest",0,[_B,_I,_ITC,_EBO],[[0,1],[0,{[_hQ]:_i}],[()=>IntelligentTieringConfiguration$,{[_hP]:1,[_xN]:_ITC}],[0,{[_hH]:_xaebo}]],3];PutBucketInventoryConfigurationRequest$=[3,n0,"PutBucketInventoryConfigurationRequest",0,[_B,_I,_IC,_EBO],[[0,1],[0,{[_hQ]:_i}],[()=>InventoryConfiguration$,{[_hP]:1,[_xN]:_IC}],[0,{[_hH]:_xaebo}]],3];PutBucketLifecycleConfigurationOutput$=[3,n0,"PutBucketLifecycleConfigurationOutput",0,[_TDMOS],[[0,{[_hH]:_xatdmos}]]];PutBucketLifecycleConfigurationRequest$=[3,n0,"PutBucketLifecycleConfigurationRequest",0,[_B,_CA,_LCi,_EBO,_TDMOS],[[0,1],[0,{[_hH]:_xasca}],[()=>BucketLifecycleConfiguration$,{[_hP]:1,[_xN]:_LCi}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xatdmos}]],1];PutBucketLoggingRequest$=[3,n0,"PutBucketLoggingRequest",0,[_B,_BLS,_CMD,_CA,_EBO],[[0,1],[()=>BucketLoggingStatus$,{[_hP]:1,[_xN]:_BLS}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];PutBucketMetricsConfigurationRequest$=[3,n0,"PutBucketMetricsConfigurationRequest",0,[_B,_I,_MCe,_EBO],[[0,1],[0,{[_hQ]:_i}],[()=>MetricsConfiguration$,{[_hP]:1,[_xN]:_MCe}],[0,{[_hH]:_xaebo}]],3];PutBucketNotificationConfigurationRequest$=[3,n0,"PutBucketNotificationConfigurationRequest",0,[_B,_NC,_EBO,"SkipDestinationValidation"],[[0,1],[()=>NotificationConfiguration$,{[_hP]:1,[_xN]:_NC}],[0,{[_hH]:_xaebo}],[2,{[_hH]:"x-amz-skip-destination-validation"}]],2];PutBucketOwnershipControlsRequest$=[3,n0,"PutBucketOwnershipControlsRequest",0,[_B,_OC,_CMD,_EBO,_CA],[[0,1],[()=>OwnershipControls$,{[_hP]:1,[_xN]:_OC}],[0,{[_hH]:_CM}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xasca}]],2];PutBucketPolicyRequest$=[3,n0,"PutBucketPolicyRequest",0,[_B,"Policy",_CMD,_CA,"ConfirmRemoveSelfBucketAccess",_EBO],[[0,1],[0,16],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[2,{[_hH]:"x-amz-confirm-remove-self-bucket-access"}],[0,{[_hH]:_xaebo}]],2];PutBucketReplicationRequest$=[3,n0,"PutBucketReplicationRequest",0,[_B,_RCe,_CMD,_CA,"Token",_EBO],[[0,1],[()=>ReplicationConfiguration$,{[_hP]:1,[_xN]:_RCe}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xabolt}],[0,{[_hH]:_xaebo}]],2];PutBucketRequestPaymentRequest$=[3,n0,"PutBucketRequestPaymentRequest",0,[_B,_RPC,_CMD,_CA,_EBO],[[0,1],[()=>RequestPaymentConfiguration$,{[_hP]:1,[_xN]:_RPC}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];PutBucketTaggingRequest$=[3,n0,"PutBucketTaggingRequest",0,[_B,_Tag,_CMD,_CA,_EBO],[[0,1],[()=>Tagging$,{[_hP]:1,[_xN]:_Tag}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];PutBucketVersioningRequest$=[3,n0,"PutBucketVersioningRequest",0,[_B,_VC,_CMD,_CA,"MFA",_EBO],[[0,1],[()=>VersioningConfiguration$,{[_hP]:1,[_xN]:_VC}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:"x-amz-mfa"}],[0,{[_hH]:_xaebo}]],2];PutBucketWebsiteRequest$=[3,n0,"PutBucketWebsiteRequest",0,[_B,_WC,_CMD,_CA,_EBO],[[0,1],[()=>WebsiteConfiguration$,{[_hP]:1,[_xN]:_WC}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];PutObjectAclOutput$=[3,n0,"PutObjectAclOutput",0,[_RC],[[0,{[_hH]:_xarc}]]];PutObjectAclRequest$=[3,n0,"PutObjectAclRequest",0,[_B,_K,"ACL",_ACP,_CMD,_CA,_GFC,_GR,_GRACP,_GW,_GWACP,_RP,_VI,_EBO],[[0,1],[0,1],[0,{[_hH]:_xaa}],[()=>AccessControlPolicy$,{[_hP]:1,[_xN]:_ACP}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xagfc}],[0,{[_hH]:_xagr}],[0,{[_hH]:_xagra}],[0,{[_hH]:_xagw}],[0,{[_hH]:_xagwa}],[0,{[_hH]:_xarp}],[0,{[_hQ]:_vI}],[0,{[_hH]:_xaebo}]],2];PutObjectLegalHoldOutput$=[3,n0,"PutObjectLegalHoldOutput",0,[_RC],[[0,{[_hH]:_xarc}]]];PutObjectLegalHoldRequest$=[3,n0,"PutObjectLegalHoldRequest",0,[_B,_K,_LH,_RP,_VI,_CMD,_CA,_EBO],[[0,1],[0,1],[()=>ObjectLockLegalHold$,{[_hP]:1,[_xN]:_LH}],[0,{[_hH]:_xarp}],[0,{[_hQ]:_vI}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];PutObjectLockConfigurationOutput$=[3,n0,"PutObjectLockConfigurationOutput",0,[_RC],[[0,{[_hH]:_xarc}]]];PutObjectLockConfigurationRequest$=[3,n0,"PutObjectLockConfigurationRequest",0,[_B,_OLC,_RP,"Token",_CMD,_CA,_EBO],[[0,1],[()=>ObjectLockConfiguration$,{[_hP]:1,[_xN]:_OLC}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xabolt}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],1];PutObjectOutput$=[3,n0,"PutObjectOutput",0,[_E,_ETa,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh,_CT,_SSE,_VI,_SSECA,_SSECKMD,_SSEKMSKI,_SSEKMSEC,_BKE,_Si,_RC],[[0,{[_hH]:_xae}],[0,{[_hH]:_ETa}],[0,{[_hH]:_xacc}],[0,{[_hH]:_xacc_}],[0,{[_hH]:_xacc__}],[0,{[_hH]:_xacs}],[0,{[_hH]:_xacs_}],[0,{[_hH]:_xact}],[0,{[_hH]:_xasse}],[0,{[_hH]:_xavi}],[0,{[_hH]:_xasseca}],[0,{[_hH]:_xasseckM}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[()=>SSEKMSEncryptionContext,{[_hH]:_xassec}],[2,{[_hH]:_xassebke}],[1,{[_hH]:"x-amz-object-size"}],[0,{[_hH]:_xarc}]]];PutObjectRequest$=[3,n0,"PutObjectRequest",0,[_B,_K,"ACL",_Bo,_CC,_CDo,_CEo,_CL,_CLo,_CMD,_CTo,_CA,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh,_Ex,_IM,_INM,_GFC,_GR,_GRACP,_GWACP,"WriteOffsetBytes",_M,_SSE,_SC,_WRL,_SSECA,_SSECK,_SSECKMD,_SSEKMSKI,_SSEKMSEC,_BKE,_RP,_Tag,_OLM,_OLRUD,_OLLHS,_EBO],[[0,1],[0,1],[0,{[_hH]:_xaa}],[()=>StreamingBlob,16],[0,{[_hH]:_CC_}],[0,{[_hH]:_CD_}],[0,{[_hH]:_CE_}],[0,{[_hH]:_CL_}],[1,{[_hH]:_CL__}],[0,{[_hH]:_CM}],[0,{[_hH]:_CT_}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xacc}],[0,{[_hH]:_xacc_}],[0,{[_hH]:_xacc__}],[0,{[_hH]:_xacs}],[0,{[_hH]:_xacs_}],[4,{[_hH]:_Ex}],[0,{[_hH]:_IM_}],[0,{[_hH]:_INM_}],[0,{[_hH]:_xagfc}],[0,{[_hH]:_xagr}],[0,{[_hH]:_xagra}],[0,{[_hH]:_xagwa}],[1,{[_hH]:"x-amz-write-offset-bytes"}],[128,{[_hPH]:_xam}],[0,{[_hH]:_xasse}],[0,{[_hH]:_xasc}],[0,{[_hH]:_xawrl}],[0,{[_hH]:_xasseca}],[()=>SSECustomerKey,{[_hH]:_xasseck}],[0,{[_hH]:_xasseckM}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[()=>SSEKMSEncryptionContext,{[_hH]:_xassec}],[2,{[_hH]:_xassebke}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xat}],[0,{[_hH]:_xaolm}],[5,{[_hH]:_xaolrud}],[0,{[_hH]:_xaollh}],[0,{[_hH]:_xaebo}]],2];PutObjectRetentionOutput$=[3,n0,"PutObjectRetentionOutput",0,[_RC],[[0,{[_hH]:_xarc}]]];PutObjectRetentionRequest$=[3,n0,"PutObjectRetentionRequest",0,[_B,_K,_Ret,_RP,_VI,_BGR,_CMD,_CA,_EBO],[[0,1],[0,1],[()=>ObjectLockRetention$,{[_hP]:1,[_xN]:_Ret}],[0,{[_hH]:_xarp}],[0,{[_hQ]:_vI}],[2,{[_hH]:_xabgr}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];PutObjectTaggingOutput$=[3,n0,"PutObjectTaggingOutput",0,[_VI],[[0,{[_hH]:_xavi}]]];PutObjectTaggingRequest$=[3,n0,"PutObjectTaggingRequest",0,[_B,_K,_Tag,_VI,_CMD,_CA,_EBO,_RP],[[0,1],[0,1],[()=>Tagging$,{[_hP]:1,[_xN]:_Tag}],[0,{[_hQ]:_vI}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xarp}]],3];PutPublicAccessBlockRequest$=[3,n0,"PutPublicAccessBlockRequest",0,[_B,_PABC,_CMD,_CA,_EBO],[[0,1],[()=>PublicAccessBlockConfiguration$,{[_hP]:1,[_xN]:_PABC}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];QueueConfiguration$=[3,n0,_QCue,0,["QueueArn",_Ev,_I,_F],[[0,{[_xN]:"Queue"}],[64,{[_xF]:1,[_xN]:"Event"}],0,[()=>NotificationConfigurationFilter$,0]],2];RecordExpiration$=[3,n0,_REe,0,[_E,_D],[0,1],1];RecordsEvent$=[3,n0,"RecordsEvent",0,["Payload"],[[21,{[_eP]:1}]]];Redirect$=[3,n0,"Redirect",0,["HostName","HttpRedirectCode","Protocol","ReplaceKeyPrefixWith","ReplaceKeyWith"],[0,0,0,0,0]];RedirectAllRequestsTo$=[3,n0,_RART,0,["HostName","Protocol"],[0,0],1];RenameObjectOutput$=[3,n0,"RenameObjectOutput",0,[],[]];RenameObjectRequest$=[3,n0,"RenameObjectRequest",0,[_B,_K,"RenameSource","DestinationIfMatch","DestinationIfNoneMatch","DestinationIfModifiedSince","DestinationIfUnmodifiedSince","SourceIfMatch","SourceIfNoneMatch","SourceIfModifiedSince","SourceIfUnmodifiedSince","ClientToken"],[[0,1],[0,1],[0,{[_hH]:"x-amz-rename-source"}],[0,{[_hH]:_IM_}],[0,{[_hH]:_INM_}],[4,{[_hH]:_IMS_}],[4,{[_hH]:_IUS_}],[0,{[_hH]:"x-amz-rename-source-if-match"}],[0,{[_hH]:"x-amz-rename-source-if-none-match"}],[6,{[_hH]:"x-amz-rename-source-if-modified-since"}],[6,{[_hH]:"x-amz-rename-source-if-unmodified-since"}],[0,{[_hH]:"x-amz-client-token",[_iT]:1}]],3];ReplicaModifications$=[3,n0,_RM,0,[_S],[0],1];ReplicationConfiguration$=[3,n0,_RCe,0,["Role",_R],[0,[()=>ReplicationRules,{[_xF]:1,[_xN]:_Ru}]],2];ReplicationRule$=[3,n0,"ReplicationRule",0,[_S,_Des,"ID","Priority",_P,_F,_SSC,_EOR,_DMR],[0,()=>Destination$,0,1,0,[()=>ReplicationRuleFilter$,0],()=>SourceSelectionCriteria$,()=>ExistingObjectReplication$,()=>DeleteMarkerReplication$],2];ReplicationRuleAndOperator$=[3,n0,"ReplicationRuleAndOperator",0,[_P,_T],[0,[()=>TagSet,{[_xF]:1,[_xN]:_Ta}]]];ReplicationRuleFilter$=[3,n0,"ReplicationRuleFilter",0,[_P,_Ta,"And"],[0,()=>Tag$,[()=>ReplicationRuleAndOperator$,0]]];ReplicationTime$=[3,n0,_RT,0,[_S,"Time"],[0,()=>ReplicationTimeValue$],2];ReplicationTimeValue$=[3,n0,"ReplicationTimeValue",0,["Minutes"],[1]];RequestPaymentConfiguration$=[3,n0,_RPC,0,["Payer"],[0],1];RequestProgress$=[3,n0,_RPe,0,["Enabled"],[2]];RestoreObjectOutput$=[3,n0,"RestoreObjectOutput",0,[_RC,"RestoreOutputPath"],[[0,{[_hH]:_xarc}],[0,{[_hH]:"x-amz-restore-output-path"}]]];RestoreObjectRequest$=[3,n0,"RestoreObjectRequest",0,[_B,_K,_VI,_RRes,_RP,_CA,_EBO],[[0,1],[0,1],[0,{[_hQ]:_vI}],[()=>RestoreRequest$,{[_hP]:1,[_xN]:_RRes}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];RestoreRequest$=[3,n0,_RRes,0,[_D,_GJP,_Ty,"Tier","Description",_SP,_OL],[1,()=>GlacierJobParameters$,0,0,0,()=>SelectParameters$,[()=>OutputLocation$,0]]];RestoreStatus$=[3,n0,_RSe,0,["IsRestoreInProgress","RestoreExpiryDate"],[2,4]];RoutingRule$=[3,n0,"RoutingRule",0,["Redirect","Condition"],[()=>Redirect$,()=>Condition$],1];S3KeyFilter$=[3,n0,"S3KeyFilter",0,["FilterRules"],[[()=>FilterRuleList,{[_xF]:1,[_xN]:_FR}]]];S3Location$=[3,n0,"S3Location",0,["BucketName",_P,_En,"CannedACL",_ACL,_Tag,_UM,_SC],[0,0,[()=>Encryption$,0],0,[()=>Grants,0],[()=>Tagging$,0],[()=>UserMetadata,0],0],2];S3TablesDestination$=[3,n0,_STD,0,[_TBA,_TNa],[0,0],2];S3TablesDestinationResult$=[3,n0,_STDR,0,[_TBA,_TNa,_TA,_TN],[0,0,0,0],4];ScanRange$=[3,n0,"ScanRange",0,["Start","End"],[1,1]];SelectObjectContentOutput$=[3,n0,"SelectObjectContentOutput",0,["Payload"],[[()=>SelectObjectContentEventStream$,16]]];SelectObjectContentRequest$=[3,n0,"SelectObjectContentRequest",0,[_B,_K,"Expression",_ETx,_IS,_OSu,_SSECA,_SSECK,_SSECKMD,_RPe,"ScanRange",_EBO],[[0,1],[0,1],0,0,()=>InputSerialization$,()=>OutputSerialization$,[0,{[_hH]:_xasseca}],[()=>SSECustomerKey,{[_hH]:_xasseck}],[0,{[_hH]:_xasseckM}],()=>RequestProgress$,()=>ScanRange$,[0,{[_hH]:_xaebo}]],6];SelectParameters$=[3,n0,_SP,0,[_IS,_ETx,"Expression",_OSu],[()=>InputSerialization$,0,0,()=>OutputSerialization$],4];ServerSideEncryptionByDefault$=[3,n0,"ServerSideEncryptionByDefault",0,["SSEAlgorithm","KMSMasterKeyID"],[0,[()=>SSEKMSKeyId,0]],1];ServerSideEncryptionConfiguration$=[3,n0,_SSEC,0,[_R],[[()=>ServerSideEncryptionRules,{[_xF]:1,[_xN]:_Ru}]],1];ServerSideEncryptionRule$=[3,n0,"ServerSideEncryptionRule",0,["ApplyServerSideEncryptionByDefault",_BKE,_BET],[[()=>ServerSideEncryptionByDefault$,0],2,[()=>BlockedEncryptionTypes$,0]]];SessionCredentials$=[3,n0,"SessionCredentials",0,["AccessKeyId",_SAK,_ST,_E],[[0,{[_xN]:"AccessKeyId"}],[()=>SessionCredentialValue,{[_xN]:_SAK}],[()=>SessionCredentialValue,{[_xN]:_ST}],[4,{[_xN]:_E}]],4];SimplePrefix$=[3,n0,_SPi,{[_xN]:_SPi},[],[]];SourceSelectionCriteria$=[3,n0,_SSC,0,[_SKEO,_RM],[()=>SseKmsEncryptedObjects$,()=>ReplicaModifications$]];SSEKMS$=[3,n0,"SSEKMS",{[_xN]:_SK},["KeyId"],[[()=>SSEKMSKeyId,0]],1];SseKmsEncryptedObjects$=[3,n0,_SKEO,0,[_S],[0],1];SSEKMSEncryption$=[3,n0,"SSEKMSEncryption",{[_xN]:_SK},["KMSKeyArn",_BKE],[[()=>NonEmptyKmsKeyArnString,0],2],1];SSES3$=[3,n0,"SSES3",{[_xN]:"SSE-S3"},[],[]];Stats$=[3,n0,"Stats",0,[_BS,_BP,_BRy],[1,1,1]];StatsEvent$=[3,n0,"StatsEvent",0,["Details"],[[()=>Stats$,{[_eP]:1}]]];StorageClassAnalysis$=[3,n0,_SCA,0,["DataExport"],[()=>StorageClassAnalysisDataExport$]];StorageClassAnalysisDataExport$=[3,n0,"StorageClassAnalysisDataExport",0,["OutputSchemaVersion",_Des],[0,()=>AnalyticsExportDestination$],2];Tag$=[3,n0,_Ta,0,[_K,_V],[0,0],2];Tagging$=[3,n0,_Tag,0,[_TS],[[()=>TagSet,0]],1];TargetGrant$=[3,n0,"TargetGrant",0,["Grantee",_Pe],[[()=>Grantee$,{[_xNm]:["xsi",_hi]}],0]];TargetObjectKeyFormat$=[3,n0,_TOKF,0,[_SPi,_PP],[[()=>SimplePrefix$,{[_xN]:_SPi}],[()=>PartitionedPrefix$,{[_xN]:_PP}]]];Tiering$=[3,n0,"Tiering",0,[_D,_AT],[1,0],2];TopicConfiguration$=[3,n0,_TCop,0,["TopicArn",_Ev,_I,_F],[[0,{[_xN]:"Topic"}],[64,{[_xF]:1,[_xN]:"Event"}],0,[()=>NotificationConfigurationFilter$,0]],2];Transition$=[3,n0,"Transition",0,["Date",_D,_SC],[5,1,0]];UpdateBucketMetadataInventoryTableConfigurationRequest$=[3,n0,"UpdateBucketMetadataInventoryTableConfigurationRequest",0,[_B,_ITCn,_CMD,_CA,_EBO],[[0,1],[()=>InventoryTableConfigurationUpdates$,{[_hP]:1,[_xN]:_ITCn}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];UpdateBucketMetadataJournalTableConfigurationRequest$=[3,n0,"UpdateBucketMetadataJournalTableConfigurationRequest",0,[_B,_JTC,_CMD,_CA,_EBO],[[0,1],[()=>JournalTableConfigurationUpdates$,{[_hP]:1,[_xN]:_JTC}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xaebo}]],2];UpdateObjectEncryptionRequest$=[3,n0,"UpdateObjectEncryptionRequest",0,[_B,_K,_OE,_VI,_RP,_EBO,_CMD,_CA],[[0,1],[0,1],[()=>ObjectEncryption$,16],[0,{[_hQ]:_vI}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}]],3];UpdateObjectEncryptionResponse$=[3,n0,"UpdateObjectEncryptionResponse",0,[_RC],[[0,{[_hH]:_xarc}]]];UploadPartCopyOutput$=[3,n0,"UploadPartCopyOutput",0,[_CSVI,_CPR,_SSE,_SSECA,_SSECKMD,_SSEKMSKI,_BKE,_RC],[[0,{[_hH]:_xacsvi}],[()=>CopyPartResult$,16],[0,{[_hH]:_xasse}],[0,{[_hH]:_xasseca}],[0,{[_hH]:_xasseckM}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[2,{[_hH]:_xassebke}],[0,{[_hH]:_xarc}]]];UploadPartCopyRequest$=[3,n0,"UploadPartCopyRequest",0,[_B,_CS,_K,_PN,_UI,_CSIM,_CSIMS,_CSINM,_CSIUS,"CopySourceRange",_SSECA,_SSECK,_SSECKMD,_CSSSECA,_CSSSECK,"CopySourceSSECustomerKeyMD5",_RP,_EBO,_ESBO],[[0,1],[0,{[_hH]:"x-amz-copy-source"}],[0,1],[1,{[_hQ]:_pN}],[0,{[_hQ]:_uI}],[0,{[_hH]:_xacsim}],[4,{[_hH]:_xacsims}],[0,{[_hH]:_xacsinm}],[4,{[_hH]:_xacsius}],[0,{[_hH]:"x-amz-copy-source-range"}],[0,{[_hH]:_xasseca}],[()=>SSECustomerKey,{[_hH]:_xasseck}],[0,{[_hH]:_xasseckM}],[0,{[_hH]:_xacssseca}],[()=>CopySourceSSECustomerKey,{[_hH]:_xacssseck}],[0,{[_hH]:_xacssseckM}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}],[0,{[_hH]:_xasebo}]],5];UploadPartOutput$=[3,n0,"UploadPartOutput",0,[_SSE,_ETa,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh,_SSECA,_SSECKMD,_SSEKMSKI,_BKE,_RC],[[0,{[_hH]:_xasse}],[0,{[_hH]:_ETa}],[0,{[_hH]:_xacc}],[0,{[_hH]:_xacc_}],[0,{[_hH]:_xacc__}],[0,{[_hH]:_xacs}],[0,{[_hH]:_xacs_}],[0,{[_hH]:_xasseca}],[0,{[_hH]:_xasseckM}],[()=>SSEKMSKeyId,{[_hH]:_xasseakki}],[2,{[_hH]:_xassebke}],[0,{[_hH]:_xarc}]]];UploadPartRequest$=[3,n0,"UploadPartRequest",0,[_B,_K,_PN,_UI,_Bo,_CLo,_CMD,_CA,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh,_SSECA,_SSECK,_SSECKMD,_RP,_EBO],[[0,1],[0,1],[1,{[_hQ]:_pN}],[0,{[_hQ]:_uI}],[()=>StreamingBlob,16],[1,{[_hH]:_CL__}],[0,{[_hH]:_CM}],[0,{[_hH]:_xasca}],[0,{[_hH]:_xacc}],[0,{[_hH]:_xacc_}],[0,{[_hH]:_xacc__}],[0,{[_hH]:_xacs}],[0,{[_hH]:_xacs_}],[0,{[_hH]:_xasseca}],[()=>SSECustomerKey,{[_hH]:_xasseck}],[0,{[_hH]:_xasseckM}],[0,{[_hH]:_xarp}],[0,{[_hH]:_xaebo}]],4];VersioningConfiguration$=[3,n0,_VC,0,["MFADelete",_S],[[0,{[_xN]:"MfaDelete"}],0]];WebsiteConfiguration$=[3,n0,_WC,0,[_EDr,_IDn,_RART,_RR],[()=>ErrorDocument$,()=>IndexDocument$,()=>RedirectAllRequestsTo$,[()=>RoutingRules,0]]];WriteGetObjectResponseRequest$=[3,n0,"WriteGetObjectResponseRequest",0,["RequestRoute","RequestToken",_Bo,"StatusCode","ErrorCode",_EM,_AR,_CC,_CDo,_CEo,_CL,_CLo,_CR,_CTo,_CCRC,_CCRCC,_CCRCNVME,_CSHA,_CSHAh,_DM,_ETa,_Ex,_E,_LM,_MM,_M,_OLM,_OLLHS,_OLRUD,_PC,_RS,_RC,_Re,_SSE,_SSECA,_SSEKMSKI,_SSECKMD,_SC,_TC,_VI,_BKE],[[0,{[_hL]:1,[_hH]:"x-amz-request-route"}],[0,{[_hH]:"x-amz-request-token"}],[()=>StreamingBlob,16],[1,{[_hH]:"x-amz-fwd-status"}],[0,{[_hH]:"x-amz-fwd-error-code"}],[0,{[_hH]:"x-amz-fwd-error-message"}],[0,{[_hH]:"x-amz-fwd-header-accept-ranges"}],[0,{[_hH]:"x-amz-fwd-header-Cache-Control"}],[0,{[_hH]:"x-amz-fwd-header-Content-Disposition"}],[0,{[_hH]:"x-amz-fwd-header-Content-Encoding"}],[0,{[_hH]:"x-amz-fwd-header-Content-Language"}],[1,{[_hH]:_CL__}],[0,{[_hH]:"x-amz-fwd-header-Content-Range"}],[0,{[_hH]:"x-amz-fwd-header-Content-Type"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-checksum-crc32"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-checksum-crc32c"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-checksum-crc64nvme"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-checksum-sha1"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-checksum-sha256"}],[2,{[_hH]:"x-amz-fwd-header-x-amz-delete-marker"}],[0,{[_hH]:"x-amz-fwd-header-ETag"}],[4,{[_hH]:"x-amz-fwd-header-Expires"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-expiration"}],[4,{[_hH]:"x-amz-fwd-header-Last-Modified"}],[1,{[_hH]:"x-amz-fwd-header-x-amz-missing-meta"}],[128,{[_hPH]:_xam}],[0,{[_hH]:"x-amz-fwd-header-x-amz-object-lock-mode"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-object-lock-legal-hold"}],[5,{[_hH]:"x-amz-fwd-header-x-amz-object-lock-retain-until-date"}],[1,{[_hH]:"x-amz-fwd-header-x-amz-mp-parts-count"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-replication-status"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-request-charged"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-restore"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-server-side-encryption"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm"}],[()=>SSEKMSKeyId,{[_hH]:"x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-server-side-encryption-customer-key-MD5"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-storage-class"}],[1,{[_hH]:"x-amz-fwd-header-x-amz-tagging-count"}],[0,{[_hH]:"x-amz-fwd-header-x-amz-version-id"}],[2,{[_hH]:"x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled"}]],2];AnalyticsConfigurationList=[1,n0,_ACLn,0,[()=>AnalyticsConfiguration$,0]];Buckets=[1,n0,_Bu,0,[()=>Bucket$,{[_xN]:_B}]];CommonPrefixList=[1,n0,"CommonPrefixList",0,()=>CommonPrefix$];CompletedPartList=[1,n0,"CompletedPartList",0,()=>CompletedPart$];CORSRules=[1,n0,"CORSRules",0,[()=>CORSRule$,0]];DeletedObjects=[1,n0,"DeletedObjects",0,()=>DeletedObject$];DeleteMarkers=[1,n0,_DMe,0,()=>DeleteMarkerEntry$];EncryptionTypeList=[1,n0,"EncryptionTypeList",0,[0,{[_xN]:_ET}]];Errors=[1,n0,"Errors",0,()=>_Error$];FilterRuleList=[1,n0,"FilterRuleList",0,()=>FilterRule$];Grants=[1,n0,_G,0,[()=>Grant$,{[_xN]:"Grant"}]];IntelligentTieringConfigurationList=[1,n0,_ITCL,0,[()=>IntelligentTieringConfiguration$,0]];InventoryConfigurationList=[1,n0,_ICL,0,[()=>InventoryConfiguration$,0]];InventoryOptionalFields=[1,n0,"InventoryOptionalFields",0,[0,{[_xN]:"Field"}]];LambdaFunctionConfigurationList=[1,n0,"LambdaFunctionConfigurationList",0,[()=>LambdaFunctionConfiguration$,0]];LifecycleRules=[1,n0,"LifecycleRules",0,[()=>LifecycleRule$,0]];MetricsConfigurationList=[1,n0,_MCL,0,[()=>MetricsConfiguration$,0]];MultipartUploadList=[1,n0,"MultipartUploadList",0,()=>MultipartUpload$];NoncurrentVersionTransitionList=[1,n0,"NoncurrentVersionTransitionList",0,()=>NoncurrentVersionTransition$];ObjectIdentifierList=[1,n0,"ObjectIdentifierList",0,()=>ObjectIdentifier$];ObjectList=[1,n0,"ObjectList",0,[()=>_Object$,0]];ObjectVersionList=[1,n0,"ObjectVersionList",0,[()=>ObjectVersion$,0]];OwnershipControlsRules=[1,n0,"OwnershipControlsRules",0,()=>OwnershipControlsRule$];Parts=[1,n0,_Pa,0,()=>Part$];PartsList=[1,n0,"PartsList",0,()=>ObjectPart$];QueueConfigurationList=[1,n0,"QueueConfigurationList",0,[()=>QueueConfiguration$,0]];ReplicationRules=[1,n0,"ReplicationRules",0,[()=>ReplicationRule$,0]];RoutingRules=[1,n0,_RR,0,[()=>RoutingRule$,{[_xN]:"RoutingRule"}]];ServerSideEncryptionRules=[1,n0,"ServerSideEncryptionRules",0,[()=>ServerSideEncryptionRule$,0]];TagSet=[1,n0,_TS,0,[()=>Tag$,{[_xN]:_Ta}]];TargetGrants=[1,n0,_TG,0,[()=>TargetGrant$,{[_xN]:"Grant"}]];TieringList=[1,n0,"TieringList",0,()=>Tiering$];TopicConfigurationList=[1,n0,"TopicConfigurationList",0,[()=>TopicConfiguration$,0]];TransitionList=[1,n0,"TransitionList",0,()=>Transition$];UserMetadata=[1,n0,_UM,0,[()=>MetadataEntry$,{[_xN]:_ME}]];AnalyticsFilter$=[4,n0,"AnalyticsFilter",0,[_P,_Ta,"And"],[0,()=>Tag$,[()=>AnalyticsAndOperator$,0]]];MetricsFilter$=[4,n0,"MetricsFilter",0,[_P,_Ta,"AccessPointArn","And"],[0,()=>Tag$,0,[()=>MetricsAndOperator$,0]]];ObjectEncryption$=[4,n0,_OE,0,["SSEKMS"],[[()=>SSEKMSEncryption$,{[_xN]:_SK}]]];SelectObjectContentEventStream$=[4,n0,"SelectObjectContentEventStream",{[_st]:1},["Records","Stats","Progress","Cont","End"],[[()=>RecordsEvent$,0],[()=>StatsEvent$,0],[()=>ProgressEvent$,0],()=>ContinuationEvent$,()=>EndEvent$]];AbortMultipartUpload$=[9,n0,"AbortMultipartUpload",{[_h]:["DELETE","/{Key+}?x-id=AbortMultipartUpload",204]},()=>AbortMultipartUploadRequest$,()=>AbortMultipartUploadOutput$];CompleteMultipartUpload$=[9,n0,_CMUo,{[_h]:["POST","/{Key+}",200]},()=>CompleteMultipartUploadRequest$,()=>CompleteMultipartUploadOutput$];CopyObject$=[9,n0,"CopyObject",{[_h]:["PUT","/{Key+}?x-id=CopyObject",200]},()=>CopyObjectRequest$,()=>CopyObjectOutput$];CreateBucket$=[9,n0,"CreateBucket",{[_h]:["PUT","/",200]},()=>CreateBucketRequest$,()=>CreateBucketOutput$];CreateBucketMetadataConfiguration$=[9,n0,"CreateBucketMetadataConfiguration",{[_hC]:"-",[_h]:["POST","/?metadataConfiguration",200]},()=>CreateBucketMetadataConfigurationRequest$,()=>"unit"];CreateBucketMetadataTableConfiguration$=[9,n0,"CreateBucketMetadataTableConfiguration",{[_hC]:"-",[_h]:["POST","/?metadataTable",200]},()=>CreateBucketMetadataTableConfigurationRequest$,()=>"unit"];CreateMultipartUpload$=[9,n0,"CreateMultipartUpload",{[_h]:["POST","/{Key+}?uploads",200]},()=>CreateMultipartUploadRequest$,()=>CreateMultipartUploadOutput$];CreateSession$=[9,n0,"CreateSession",{[_h]:["GET","/?session",200]},()=>CreateSessionRequest$,()=>CreateSessionOutput$];DeleteBucket$=[9,n0,"DeleteBucket",{[_h]:["DELETE","/",204]},()=>DeleteBucketRequest$,()=>"unit"];DeleteBucketAnalyticsConfiguration$=[9,n0,"DeleteBucketAnalyticsConfiguration",{[_h]:["DELETE","/?analytics",204]},()=>DeleteBucketAnalyticsConfigurationRequest$,()=>"unit"];DeleteBucketCors$=[9,n0,"DeleteBucketCors",{[_h]:["DELETE","/?cors",204]},()=>DeleteBucketCorsRequest$,()=>"unit"];DeleteBucketEncryption$=[9,n0,"DeleteBucketEncryption",{[_h]:["DELETE","/?encryption",204]},()=>DeleteBucketEncryptionRequest$,()=>"unit"];DeleteBucketIntelligentTieringConfiguration$=[9,n0,"DeleteBucketIntelligentTieringConfiguration",{[_h]:["DELETE","/?intelligent-tiering",204]},()=>DeleteBucketIntelligentTieringConfigurationRequest$,()=>"unit"];DeleteBucketInventoryConfiguration$=[9,n0,"DeleteBucketInventoryConfiguration",{[_h]:["DELETE","/?inventory",204]},()=>DeleteBucketInventoryConfigurationRequest$,()=>"unit"];DeleteBucketLifecycle$=[9,n0,"DeleteBucketLifecycle",{[_h]:["DELETE","/?lifecycle",204]},()=>DeleteBucketLifecycleRequest$,()=>"unit"];DeleteBucketMetadataConfiguration$=[9,n0,"DeleteBucketMetadataConfiguration",{[_h]:["DELETE","/?metadataConfiguration",204]},()=>DeleteBucketMetadataConfigurationRequest$,()=>"unit"];DeleteBucketMetadataTableConfiguration$=[9,n0,"DeleteBucketMetadataTableConfiguration",{[_h]:["DELETE","/?metadataTable",204]},()=>DeleteBucketMetadataTableConfigurationRequest$,()=>"unit"];DeleteBucketMetricsConfiguration$=[9,n0,"DeleteBucketMetricsConfiguration",{[_h]:["DELETE","/?metrics",204]},()=>DeleteBucketMetricsConfigurationRequest$,()=>"unit"];DeleteBucketOwnershipControls$=[9,n0,"DeleteBucketOwnershipControls",{[_h]:["DELETE","/?ownershipControls",204]},()=>DeleteBucketOwnershipControlsRequest$,()=>"unit"];DeleteBucketPolicy$=[9,n0,"DeleteBucketPolicy",{[_h]:["DELETE","/?policy",204]},()=>DeleteBucketPolicyRequest$,()=>"unit"];DeleteBucketReplication$=[9,n0,"DeleteBucketReplication",{[_h]:["DELETE","/?replication",204]},()=>DeleteBucketReplicationRequest$,()=>"unit"];DeleteBucketTagging$=[9,n0,"DeleteBucketTagging",{[_h]:["DELETE","/?tagging",204]},()=>DeleteBucketTaggingRequest$,()=>"unit"];DeleteBucketWebsite$=[9,n0,"DeleteBucketWebsite",{[_h]:["DELETE","/?website",204]},()=>DeleteBucketWebsiteRequest$,()=>"unit"];DeleteObject$=[9,n0,"DeleteObject",{[_h]:["DELETE","/{Key+}?x-id=DeleteObject",204]},()=>DeleteObjectRequest$,()=>DeleteObjectOutput$];DeleteObjects$=[9,n0,"DeleteObjects",{[_hC]:"-",[_h]:["POST","/?delete",200]},()=>DeleteObjectsRequest$,()=>DeleteObjectsOutput$];DeleteObjectTagging$=[9,n0,"DeleteObjectTagging",{[_h]:["DELETE","/{Key+}?tagging",204]},()=>DeleteObjectTaggingRequest$,()=>DeleteObjectTaggingOutput$];DeletePublicAccessBlock$=[9,n0,"DeletePublicAccessBlock",{[_h]:["DELETE","/?publicAccessBlock",204]},()=>DeletePublicAccessBlockRequest$,()=>"unit"];GetBucketAbac$=[9,n0,"GetBucketAbac",{[_h]:["GET","/?abac",200]},()=>GetBucketAbacRequest$,()=>GetBucketAbacOutput$];GetBucketAccelerateConfiguration$=[9,n0,"GetBucketAccelerateConfiguration",{[_h]:["GET","/?accelerate",200]},()=>GetBucketAccelerateConfigurationRequest$,()=>GetBucketAccelerateConfigurationOutput$];GetBucketAcl$=[9,n0,"GetBucketAcl",{[_h]:["GET","/?acl",200]},()=>GetBucketAclRequest$,()=>GetBucketAclOutput$];GetBucketAnalyticsConfiguration$=[9,n0,"GetBucketAnalyticsConfiguration",{[_h]:["GET","/?analytics&x-id=GetBucketAnalyticsConfiguration",200]},()=>GetBucketAnalyticsConfigurationRequest$,()=>GetBucketAnalyticsConfigurationOutput$];GetBucketCors$=[9,n0,"GetBucketCors",{[_h]:["GET","/?cors",200]},()=>GetBucketCorsRequest$,()=>GetBucketCorsOutput$];GetBucketEncryption$=[9,n0,"GetBucketEncryption",{[_h]:["GET","/?encryption",200]},()=>GetBucketEncryptionRequest$,()=>GetBucketEncryptionOutput$];GetBucketIntelligentTieringConfiguration$=[9,n0,"GetBucketIntelligentTieringConfiguration",{[_h]:["GET","/?intelligent-tiering&x-id=GetBucketIntelligentTieringConfiguration",200]},()=>GetBucketIntelligentTieringConfigurationRequest$,()=>GetBucketIntelligentTieringConfigurationOutput$];GetBucketInventoryConfiguration$=[9,n0,"GetBucketInventoryConfiguration",{[_h]:["GET","/?inventory&x-id=GetBucketInventoryConfiguration",200]},()=>GetBucketInventoryConfigurationRequest$,()=>GetBucketInventoryConfigurationOutput$];GetBucketLifecycleConfiguration$=[9,n0,"GetBucketLifecycleConfiguration",{[_h]:["GET","/?lifecycle",200]},()=>GetBucketLifecycleConfigurationRequest$,()=>GetBucketLifecycleConfigurationOutput$];GetBucketLocation$=[9,n0,"GetBucketLocation",{[_h]:["GET","/?location",200]},()=>GetBucketLocationRequest$,()=>GetBucketLocationOutput$];GetBucketLogging$=[9,n0,"GetBucketLogging",{[_h]:["GET","/?logging",200]},()=>GetBucketLoggingRequest$,()=>GetBucketLoggingOutput$];GetBucketMetadataConfiguration$=[9,n0,"GetBucketMetadataConfiguration",{[_h]:["GET","/?metadataConfiguration",200]},()=>GetBucketMetadataConfigurationRequest$,()=>GetBucketMetadataConfigurationOutput$];GetBucketMetadataTableConfiguration$=[9,n0,"GetBucketMetadataTableConfiguration",{[_h]:["GET","/?metadataTable",200]},()=>GetBucketMetadataTableConfigurationRequest$,()=>GetBucketMetadataTableConfigurationOutput$];GetBucketMetricsConfiguration$=[9,n0,"GetBucketMetricsConfiguration",{[_h]:["GET","/?metrics&x-id=GetBucketMetricsConfiguration",200]},()=>GetBucketMetricsConfigurationRequest$,()=>GetBucketMetricsConfigurationOutput$];GetBucketNotificationConfiguration$=[9,n0,"GetBucketNotificationConfiguration",{[_h]:["GET","/?notification",200]},()=>GetBucketNotificationConfigurationRequest$,()=>NotificationConfiguration$];GetBucketOwnershipControls$=[9,n0,"GetBucketOwnershipControls",{[_h]:["GET","/?ownershipControls",200]},()=>GetBucketOwnershipControlsRequest$,()=>GetBucketOwnershipControlsOutput$];GetBucketPolicy$=[9,n0,"GetBucketPolicy",{[_h]:["GET","/?policy",200]},()=>GetBucketPolicyRequest$,()=>GetBucketPolicyOutput$];GetBucketPolicyStatus$=[9,n0,"GetBucketPolicyStatus",{[_h]:["GET","/?policyStatus",200]},()=>GetBucketPolicyStatusRequest$,()=>GetBucketPolicyStatusOutput$];GetBucketReplication$=[9,n0,"GetBucketReplication",{[_h]:["GET","/?replication",200]},()=>GetBucketReplicationRequest$,()=>GetBucketReplicationOutput$];GetBucketRequestPayment$=[9,n0,"GetBucketRequestPayment",{[_h]:["GET","/?requestPayment",200]},()=>GetBucketRequestPaymentRequest$,()=>GetBucketRequestPaymentOutput$];GetBucketTagging$=[9,n0,"GetBucketTagging",{[_h]:["GET","/?tagging",200]},()=>GetBucketTaggingRequest$,()=>GetBucketTaggingOutput$];GetBucketVersioning$=[9,n0,"GetBucketVersioning",{[_h]:["GET","/?versioning",200]},()=>GetBucketVersioningRequest$,()=>GetBucketVersioningOutput$];GetBucketWebsite$=[9,n0,"GetBucketWebsite",{[_h]:["GET","/?website",200]},()=>GetBucketWebsiteRequest$,()=>GetBucketWebsiteOutput$];GetObject$=[9,n0,"GetObject",{[_hC]:"-",[_h]:["GET","/{Key+}?x-id=GetObject",200]},()=>GetObjectRequest$,()=>GetObjectOutput$];GetObjectAcl$=[9,n0,"GetObjectAcl",{[_h]:["GET","/{Key+}?acl",200]},()=>GetObjectAclRequest$,()=>GetObjectAclOutput$];GetObjectAttributes$=[9,n0,"GetObjectAttributes",{[_h]:["GET","/{Key+}?attributes",200]},()=>GetObjectAttributesRequest$,()=>GetObjectAttributesOutput$];GetObjectLegalHold$=[9,n0,"GetObjectLegalHold",{[_h]:["GET","/{Key+}?legal-hold",200]},()=>GetObjectLegalHoldRequest$,()=>GetObjectLegalHoldOutput$];GetObjectLockConfiguration$=[9,n0,"GetObjectLockConfiguration",{[_h]:["GET","/?object-lock",200]},()=>GetObjectLockConfigurationRequest$,()=>GetObjectLockConfigurationOutput$];GetObjectRetention$=[9,n0,"GetObjectRetention",{[_h]:["GET","/{Key+}?retention",200]},()=>GetObjectRetentionRequest$,()=>GetObjectRetentionOutput$];GetObjectTagging$=[9,n0,"GetObjectTagging",{[_h]:["GET","/{Key+}?tagging",200]},()=>GetObjectTaggingRequest$,()=>GetObjectTaggingOutput$];GetObjectTorrent$=[9,n0,"GetObjectTorrent",{[_h]:["GET","/{Key+}?torrent",200]},()=>GetObjectTorrentRequest$,()=>GetObjectTorrentOutput$];GetPublicAccessBlock$=[9,n0,"GetPublicAccessBlock",{[_h]:["GET","/?publicAccessBlock",200]},()=>GetPublicAccessBlockRequest$,()=>GetPublicAccessBlockOutput$];HeadBucket$=[9,n0,"HeadBucket",{[_h]:["HEAD","/",200]},()=>HeadBucketRequest$,()=>HeadBucketOutput$];HeadObject$=[9,n0,"HeadObject",{[_h]:["HEAD","/{Key+}",200]},()=>HeadObjectRequest$,()=>HeadObjectOutput$];ListBucketAnalyticsConfigurations$=[9,n0,"ListBucketAnalyticsConfigurations",{[_h]:["GET","/?analytics&x-id=ListBucketAnalyticsConfigurations",200]},()=>ListBucketAnalyticsConfigurationsRequest$,()=>ListBucketAnalyticsConfigurationsOutput$];ListBucketIntelligentTieringConfigurations$=[9,n0,"ListBucketIntelligentTieringConfigurations",{[_h]:["GET","/?intelligent-tiering&x-id=ListBucketIntelligentTieringConfigurations",200]},()=>ListBucketIntelligentTieringConfigurationsRequest$,()=>ListBucketIntelligentTieringConfigurationsOutput$];ListBucketInventoryConfigurations$=[9,n0,"ListBucketInventoryConfigurations",{[_h]:["GET","/?inventory&x-id=ListBucketInventoryConfigurations",200]},()=>ListBucketInventoryConfigurationsRequest$,()=>ListBucketInventoryConfigurationsOutput$];ListBucketMetricsConfigurations$=[9,n0,"ListBucketMetricsConfigurations",{[_h]:["GET","/?metrics&x-id=ListBucketMetricsConfigurations",200]},()=>ListBucketMetricsConfigurationsRequest$,()=>ListBucketMetricsConfigurationsOutput$];ListBuckets$=[9,n0,"ListBuckets",{[_h]:["GET","/?x-id=ListBuckets",200]},()=>ListBucketsRequest$,()=>ListBucketsOutput$];ListDirectoryBuckets$=[9,n0,"ListDirectoryBuckets",{[_h]:["GET","/?x-id=ListDirectoryBuckets",200]},()=>ListDirectoryBucketsRequest$,()=>ListDirectoryBucketsOutput$];ListMultipartUploads$=[9,n0,"ListMultipartUploads",{[_h]:["GET","/?uploads",200]},()=>ListMultipartUploadsRequest$,()=>ListMultipartUploadsOutput$];ListObjects$=[9,n0,"ListObjects",{[_h]:["GET","/",200]},()=>ListObjectsRequest$,()=>ListObjectsOutput$];ListObjectsV2$=[9,n0,"ListObjectsV2",{[_h]:["GET","/?list-type=2",200]},()=>ListObjectsV2Request$,()=>ListObjectsV2Output$];ListObjectVersions$=[9,n0,"ListObjectVersions",{[_h]:["GET","/?versions",200]},()=>ListObjectVersionsRequest$,()=>ListObjectVersionsOutput$];ListParts$=[9,n0,"ListParts",{[_h]:["GET","/{Key+}?x-id=ListParts",200]},()=>ListPartsRequest$,()=>ListPartsOutput$];PutBucketAbac$=[9,n0,"PutBucketAbac",{[_hC]:"-",[_h]:["PUT","/?abac",200]},()=>PutBucketAbacRequest$,()=>"unit"];PutBucketAccelerateConfiguration$=[9,n0,"PutBucketAccelerateConfiguration",{[_hC]:"-",[_h]:["PUT","/?accelerate",200]},()=>PutBucketAccelerateConfigurationRequest$,()=>"unit"];PutBucketAcl$=[9,n0,"PutBucketAcl",{[_hC]:"-",[_h]:["PUT","/?acl",200]},()=>PutBucketAclRequest$,()=>"unit"];PutBucketAnalyticsConfiguration$=[9,n0,"PutBucketAnalyticsConfiguration",{[_h]:["PUT","/?analytics",200]},()=>PutBucketAnalyticsConfigurationRequest$,()=>"unit"];PutBucketCors$=[9,n0,"PutBucketCors",{[_hC]:"-",[_h]:["PUT","/?cors",200]},()=>PutBucketCorsRequest$,()=>"unit"];PutBucketEncryption$=[9,n0,"PutBucketEncryption",{[_hC]:"-",[_h]:["PUT","/?encryption",200]},()=>PutBucketEncryptionRequest$,()=>"unit"];PutBucketIntelligentTieringConfiguration$=[9,n0,"PutBucketIntelligentTieringConfiguration",{[_h]:["PUT","/?intelligent-tiering",200]},()=>PutBucketIntelligentTieringConfigurationRequest$,()=>"unit"];PutBucketInventoryConfiguration$=[9,n0,"PutBucketInventoryConfiguration",{[_h]:["PUT","/?inventory",200]},()=>PutBucketInventoryConfigurationRequest$,()=>"unit"];PutBucketLifecycleConfiguration$=[9,n0,"PutBucketLifecycleConfiguration",{[_hC]:"-",[_h]:["PUT","/?lifecycle",200]},()=>PutBucketLifecycleConfigurationRequest$,()=>PutBucketLifecycleConfigurationOutput$];PutBucketLogging$=[9,n0,"PutBucketLogging",{[_hC]:"-",[_h]:["PUT","/?logging",200]},()=>PutBucketLoggingRequest$,()=>"unit"];PutBucketMetricsConfiguration$=[9,n0,"PutBucketMetricsConfiguration",{[_h]:["PUT","/?metrics",200]},()=>PutBucketMetricsConfigurationRequest$,()=>"unit"];PutBucketNotificationConfiguration$=[9,n0,"PutBucketNotificationConfiguration",{[_h]:["PUT","/?notification",200]},()=>PutBucketNotificationConfigurationRequest$,()=>"unit"];PutBucketOwnershipControls$=[9,n0,"PutBucketOwnershipControls",{[_hC]:"-",[_h]:["PUT","/?ownershipControls",200]},()=>PutBucketOwnershipControlsRequest$,()=>"unit"];PutBucketPolicy$=[9,n0,"PutBucketPolicy",{[_hC]:"-",[_h]:["PUT","/?policy",200]},()=>PutBucketPolicyRequest$,()=>"unit"];PutBucketReplication$=[9,n0,"PutBucketReplication",{[_hC]:"-",[_h]:["PUT","/?replication",200]},()=>PutBucketReplicationRequest$,()=>"unit"];PutBucketRequestPayment$=[9,n0,"PutBucketRequestPayment",{[_hC]:"-",[_h]:["PUT","/?requestPayment",200]},()=>PutBucketRequestPaymentRequest$,()=>"unit"];PutBucketTagging$=[9,n0,"PutBucketTagging",{[_hC]:"-",[_h]:["PUT","/?tagging",200]},()=>PutBucketTaggingRequest$,()=>"unit"];PutBucketVersioning$=[9,n0,"PutBucketVersioning",{[_hC]:"-",[_h]:["PUT","/?versioning",200]},()=>PutBucketVersioningRequest$,()=>"unit"];PutBucketWebsite$=[9,n0,"PutBucketWebsite",{[_hC]:"-",[_h]:["PUT","/?website",200]},()=>PutBucketWebsiteRequest$,()=>"unit"];PutObject$=[9,n0,"PutObject",{[_hC]:"-",[_h]:["PUT","/{Key+}?x-id=PutObject",200]},()=>PutObjectRequest$,()=>PutObjectOutput$];PutObjectAcl$=[9,n0,"PutObjectAcl",{[_hC]:"-",[_h]:["PUT","/{Key+}?acl",200]},()=>PutObjectAclRequest$,()=>PutObjectAclOutput$];PutObjectLegalHold$=[9,n0,"PutObjectLegalHold",{[_hC]:"-",[_h]:["PUT","/{Key+}?legal-hold",200]},()=>PutObjectLegalHoldRequest$,()=>PutObjectLegalHoldOutput$];PutObjectLockConfiguration$=[9,n0,"PutObjectLockConfiguration",{[_hC]:"-",[_h]:["PUT","/?object-lock",200]},()=>PutObjectLockConfigurationRequest$,()=>PutObjectLockConfigurationOutput$];PutObjectRetention$=[9,n0,"PutObjectRetention",{[_hC]:"-",[_h]:["PUT","/{Key+}?retention",200]},()=>PutObjectRetentionRequest$,()=>PutObjectRetentionOutput$];PutObjectTagging$=[9,n0,"PutObjectTagging",{[_hC]:"-",[_h]:["PUT","/{Key+}?tagging",200]},()=>PutObjectTaggingRequest$,()=>PutObjectTaggingOutput$];PutPublicAccessBlock$=[9,n0,"PutPublicAccessBlock",{[_hC]:"-",[_h]:["PUT","/?publicAccessBlock",200]},()=>PutPublicAccessBlockRequest$,()=>"unit"];RenameObject$=[9,n0,"RenameObject",{[_h]:["PUT","/{Key+}?renameObject",200]},()=>RenameObjectRequest$,()=>RenameObjectOutput$];RestoreObject$=[9,n0,"RestoreObject",{[_hC]:"-",[_h]:["POST","/{Key+}?restore",200]},()=>RestoreObjectRequest$,()=>RestoreObjectOutput$];SelectObjectContent$=[9,n0,"SelectObjectContent",{[_h]:["POST","/{Key+}?select&select-type=2",200]},()=>SelectObjectContentRequest$,()=>SelectObjectContentOutput$];UpdateBucketMetadataInventoryTableConfiguration$=[9,n0,"UpdateBucketMetadataInventoryTableConfiguration",{[_hC]:"-",[_h]:["PUT","/?metadataInventoryTable",200]},()=>UpdateBucketMetadataInventoryTableConfigurationRequest$,()=>"unit"];UpdateBucketMetadataJournalTableConfiguration$=[9,n0,"UpdateBucketMetadataJournalTableConfiguration",{[_hC]:"-",[_h]:["PUT","/?metadataJournalTable",200]},()=>UpdateBucketMetadataJournalTableConfigurationRequest$,()=>"unit"];UpdateObjectEncryption$=[9,n0,"UpdateObjectEncryption",{[_hC]:"-",[_h]:["PUT","/{Key+}?encryption",200]},()=>UpdateObjectEncryptionRequest$,()=>UpdateObjectEncryptionResponse$];UploadPart$=[9,n0,"UploadPart",{[_hC]:"-",[_h]:["PUT","/{Key+}?x-id=UploadPart",200]},()=>UploadPartRequest$,()=>UploadPartOutput$];UploadPartCopy$=[9,n0,"UploadPartCopy",{[_h]:["PUT","/{Key+}?x-id=UploadPartCopy",200]},()=>UploadPartCopyRequest$,()=>UploadPartCopyOutput$];WriteGetObjectResponse$=[9,n0,"WriteGetObjectResponse",{[_en]:["{RequestRoute}."],[_h]:["POST","/WriteGetObjectResponse",200]},()=>WriteGetObjectResponseRequest$,()=>"unit"];CreateSessionCommand=class extends(Command.classBuilder().ep({...commonParams,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").sc(CreateSession$).build()){};fromUtf84=input=>(new TextEncoder).encode(input);SHA_1_HMAC_ALGO={name:"HMAC",hash:SHA_1_HASH={name:"SHA-1"}};EMPTY_DATA_SHA_1=new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]);fallbackWindow={};Sha1=function(){function Sha13(secret){this.toHash=new Uint8Array(0);if(void 0!==secret){this.key=new Promise(function(resolve,reject){locateWindow().crypto.subtle.importKey("raw",convertToBuffer2(secret),SHA_1_HMAC_ALGO,!1,["sign"]).then(resolve,reject)});this.key.catch(function(){})}}Sha13.prototype.update=function(data){var update2,typedArray;if(!isEmptyData2(data)){update2=convertToBuffer2(data);(typedArray=new Uint8Array(this.toHash.byteLength+update2.byteLength)).set(this.toHash,0);typedArray.set(update2,this.toHash.byteLength);this.toHash=typedArray}};Sha13.prototype.digest=function(){var _this=this;return this.key?this.key.then(function(key3){return locateWindow().crypto.subtle.sign(SHA_1_HMAC_ALGO,key3,_this.toHash).then(function(data){return new Uint8Array(data)})}):isEmptyData2(this.toHash)?Promise.resolve(EMPTY_DATA_SHA_1):Promise.resolve().then(function(){return locateWindow().crypto.subtle.digest(SHA_1_HASH,_this.toHash)}).then(function(data){return Promise.resolve(new Uint8Array(data))})};Sha13.prototype.reset=function(){this.toHash=new Uint8Array(0)};return Sha13}();subtleCryptoMethods=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];Sha12=function(){function Sha13(secret){if(!supportsWebCrypto(locateWindow()))throw new Error("SHA1 not supported");this.hash=new Sha1(secret)}Sha13.prototype.update=function(data,encoding){this.hash.update(convertToBuffer(data))};Sha13.prototype.digest=function(){return this.hash.digest()};Sha13.prototype.reset=function(){this.hash.reset()};return Sha13}();SHA_256_HMAC_ALGO={name:"HMAC",hash:SHA_256_HASH={name:"SHA-256"}};EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);Sha256=function(){function Sha2564(secret){this.toHash=new Uint8Array(0);this.secret=secret;this.reset()}Sha2564.prototype.update=function(data){var update2,typedArray;if(!isEmptyData(data)){update2=convertToBuffer(data);(typedArray=new Uint8Array(this.toHash.byteLength+update2.byteLength)).set(this.toHash,0);typedArray.set(update2,this.toHash.byteLength);this.toHash=typedArray}};Sha2564.prototype.digest=function(){var _this=this;return this.key?this.key.then(function(key3){return locateWindow().crypto.subtle.sign(SHA_256_HMAC_ALGO,key3,_this.toHash).then(function(data){return new Uint8Array(data)})}):isEmptyData(this.toHash)?Promise.resolve(EMPTY_DATA_SHA_256):Promise.resolve().then(function(){return locateWindow().crypto.subtle.digest(SHA_256_HASH,_this.toHash)}).then(function(data){return Promise.resolve(new Uint8Array(data))})};Sha2564.prototype.reset=function(){var _this=this;this.toHash=new Uint8Array(0);if(this.secret&&void 0!==this.secret){this.key=new Promise(function(resolve,reject){locateWindow().crypto.subtle.importKey("raw",convertToBuffer(_this.secret),SHA_256_HMAC_ALGO,!1,["sign"]).then(resolve,reject)});this.key.catch(function(){})}};return Sha2564}();BLOCK_SIZE=64;KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];MAX_HASHABLE_LENGTH=Math.pow(2,53)-1;RawSha256=function(){function RawSha2562(){this.state=Int32Array.from(INIT);this.temp=new Int32Array(64);this.buffer=new Uint8Array(64);this.bufferLength=0;this.bytesHashed=0;this.finished=!1}RawSha2562.prototype.update=function(data){var position,byteLength;if(this.finished)throw new Error("Attempted to update an already finished hash.");position=0;byteLength=data.byteLength;this.bytesHashed+=byteLength;if(8*this.bytesHashed>MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;byteLength>0;){this.buffer[this.bufferLength++]=data[position++];byteLength--;if(this.bufferLength===BLOCK_SIZE){this.hashBuffer();this.bufferLength=0}}};RawSha2562.prototype.digest=function(){var bitsHashed,bufferView,undecoratedLength,i2,out;if(!this.finished){bitsHashed=8*this.bytesHashed;bufferView=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength);undecoratedLength=this.bufferLength;bufferView.setUint8(this.bufferLength++,128);if(undecoratedLength%BLOCK_SIZE>=BLOCK_SIZE-8){for(i2=this.bufferLength;i2>>24&255;out[4*i2+1]=this.state[i2]>>>16&255;out[4*i2+2]=this.state[i2]>>>8&255;out[4*i2+3]=this.state[i2]>>>0&255}return out};RawSha2562.prototype.hashBuffer=function(){var i2,u2,t1_1,t2_1,t12,t22,buffer=this.buffer,state2=this.state,state0=state2[0],state1=state2[1],state22=state2[2],state3=state2[3],state4=state2[4],state5=state2[5],state6=state2[6],state7=state2[7];for(i2=0;i2>>17|u2<<15)^(u2>>>19|u2<<13)^u2>>>10;t2_1=((u2=this.temp[i2-15])>>>7|u2<<25)^(u2>>>18|u2<<14)^u2>>>3;this.temp[i2]=(t1_1+this.temp[i2-7]|0)+(t2_1+this.temp[i2-16]|0)}t12=(((state4>>>6|state4<<26)^(state4>>>11|state4<<21)^(state4>>>25|state4<<7))+(state4&state5^~state4&state6)|0)+(state7+(KEY[i2]+this.temp[i2]|0)|0)|0;t22=((state0>>>2|state0<<30)^(state0>>>13|state0<<19)^(state0>>>22|state0<<10))+(state0&state1^state0&state22^state1&state22)|0;state7=state6;state6=state5;state5=state4;state4=state3+t12|0;state3=state22;state22=state1;state1=state0;state0=t12+t22|0}state2[0]+=state0;state2[1]+=state1;state2[2]+=state22;state2[3]+=state3;state2[4]+=state4;state2[5]+=state5;state2[6]+=state6;state2[7]+=state7};return RawSha2562}();Sha2562=function(){function Sha2564(secret){this.secret=secret;this.hash=new RawSha256;this.reset()}Sha2564.prototype.update=function(toHash){if(!isEmptyData(toHash)&&!this.error)try{this.hash.update(convertToBuffer(toHash))}catch(e3){this.error=e3}};Sha2564.prototype.digestSync=function(){if(this.error)throw this.error;if(this.outer){this.outer.finished||this.outer.update(this.hash.digest());return this.outer.digest()}return this.hash.digest()};Sha2564.prototype.digest=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a8){return[2,this.digestSync()]})})};Sha2564.prototype.reset=function(){var inner,outer,i2;this.hash=new RawSha256;if(this.secret){this.outer=new RawSha256;inner=bufferFromSecret(this.secret);(outer=new Uint8Array(BLOCK_SIZE)).set(inner);for(i2=0;i2async config=>{var _a8,_b5,_c3,_d2,_e2,_f,_g,_h2,_i2,_j;const navigator2="undefined"!=typeof window?window.navigator:void 0,uaString=null!=(_a8=null==navigator2?void 0:navigator2.userAgent)?_a8:"",osName=null!=(_d2=null!=(_c3=null==(_b5=null==navigator2?void 0:navigator2.userAgentData)?void 0:_b5.platform)?_c3:fallback2.os(uaString))?_d2:"other",brands=null!=(_f=null==(_e2=null==navigator2?void 0:navigator2.userAgentData)?void 0:_e2.brands)?_f:[],brand=brands[brands.length-1],browserName=null!=(_h2=null!=(_g=null==brand?void 0:brand.brand)?_g:fallback2.browser(uaString))?_h2:"unknown",browserVersion=null!=(_i2=null==brand?void 0:brand.version)?_i2:"unknown",sections=[["aws-sdk-js",clientVersion],["ua","2.1"],[`os/${osName}`,void 0],["lang/js"],["md/browser",`${browserName}_${browserVersion}`]];serviceId&§ions.push([`api/${serviceId}`,clientVersion]);const appId=await(null==(_j=null==config?void 0:config.userAgentAppId)?void 0:_j.call(config));appId&§ions.push([`app/${appId}`]);return sections};fallback2={os:ua=>/iPhone|iPad|iPod/.test(ua)?"iOS":/Macintosh|Mac OS X/.test(ua)?"macOS":/Windows NT/.test(ua)?"Windows":/Android/.test(ua)?"Android":/Linux/.test(ua)?"Linux":void 0,browser:ua=>/EdgiOS|EdgA|Edg\//.test(ua)?"Microsoft Edge":/Firefox\//.test(ua)?"Firefox":/Chrome\//.test(ua)?"Chrome":/Safari\//.test(ua)?"Safari":void 0};Int642=class _Int64{constructor(bytes){__publicField(this,"bytes");this.bytes=bytes;if(8!==bytes.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(number){if(number>0x8000000000000000||number<-0x8000000000000000)throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);const bytes=new Uint8Array(8);for(let i2=7,remaining=Math.abs(Math.round(number));i2>-1&&remaining>0;i2--,remaining/=256)bytes[i2]=remaining;number<0&&negate2(bytes);return new _Int64(bytes)}valueOf(){const bytes=this.bytes.slice(0),negative=128&bytes[0];negative&&negate2(bytes);return parseInt(toHex2(bytes),16)*(negative?-1:1)}toString(){return String(this.valueOf())}};HeaderMarshaller=class{constructor(toUtf82,fromUtf85){__publicField(this,"toUtf8");__publicField(this,"fromUtf8");this.toUtf8=toUtf82;this.fromUtf8=fromUtf85}format(headers){const chunks=[];for(const headerName of Object.keys(headers)){const bytes=this.fromUtf8(headerName);chunks.push(Uint8Array.from([bytes.byteLength]),bytes,this.formatHeaderValue(headers[headerName]))}const out=new Uint8Array(chunks.reduce((carry,bytes)=>carry+bytes.byteLength,0));let position=0;for(const chunk of chunks){out.set(chunk,position);position+=chunk.byteLength}return out}formatHeaderValue(header){switch(header.type){case"boolean":return Uint8Array.from([header.value?0:1]);case"byte":return Uint8Array.from([2,header.value]);case"short":const shortView=new DataView(new ArrayBuffer(3));shortView.setUint8(0,3);shortView.setInt16(1,header.value,!1);return new Uint8Array(shortView.buffer);case"integer":const intView=new DataView(new ArrayBuffer(5));intView.setUint8(0,4);intView.setInt32(1,header.value,!1);return new Uint8Array(intView.buffer);case"long":const longBytes=new Uint8Array(9);longBytes[0]=5;longBytes.set(header.value.bytes,1);return longBytes;case"binary":const binView=new DataView(new ArrayBuffer(3+header.value.byteLength));binView.setUint8(0,6);binView.setUint16(1,header.value.byteLength,!1);const binBytes=new Uint8Array(binView.buffer);binBytes.set(header.value,3);return binBytes;case"string":const utf8Bytes=this.fromUtf8(header.value),strView=new DataView(new ArrayBuffer(3+utf8Bytes.byteLength));strView.setUint8(0,7);strView.setUint16(1,utf8Bytes.byteLength,!1);const strBytes=new Uint8Array(strView.buffer);strBytes.set(utf8Bytes,3);return strBytes;case"timestamp":const tsBytes=new Uint8Array(9);tsBytes[0]=8;tsBytes.set(Int642.fromNumber(header.value.valueOf()).bytes,1);return tsBytes;case"uuid":if(!UUID_PATTERN2.test(header.value))throw new Error(`Invalid UUID received: ${header.value}`);const uuidBytes=new Uint8Array(17);uuidBytes[0]=9;uuidBytes.set(fromHex(header.value.replace(/\-/g,"")),1);return uuidBytes}}parse(headers){const out={};let position=0;for(;positionmessage,isEndOfStream:()=>isEndOfStream}}getAvailableMessages(){const messages=this.messageBuffer;this.messageBuffer=[];const isEndOfStream=this.isEndOfStream;return{getMessages:()=>messages,isEndOfStream:()=>isEndOfStream}}encode({headers:rawHeaders,body}){const headers=this.headerMarshaller.format(rawHeaders),length=headers.byteLength+body.byteLength+16,out=new Uint8Array(length),view=new DataView(out.buffer,out.byteOffset,out.byteLength),checksum=new Crc32;view.setUint32(0,length,!1);view.setUint32(4,headers.byteLength,!1);view.setUint32(8,checksum.update(out.subarray(0,8)).digest(),!1);out.set(headers,12);out.set(body,headers.byteLength+12);view.setUint32(length-4,checksum.update(out.subarray(8,length-4)).digest(),!1);return out}decode(message){const{headers,body}=splitMessage(message);return{headers:this.headerMarshaller.parse(headers),body}}formatHeaders(rawHeaders){return this.headerMarshaller.format(rawHeaders)}};MessageDecoderStream=class{constructor(options){__publicField(this,"options");this.options=options}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const bytes of this.options.inputStream){const decoded=this.options.decoder.decode(bytes);yield decoded}}};MessageEncoderStream=class{constructor(options){__publicField(this,"options");this.options=options}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const msg of this.options.messageStream){const encoded=this.options.encoder.encode(msg);yield encoded}this.options.includeEndFrame&&(yield new Uint8Array(0))}};SmithyMessageDecoderStream=class{constructor(options){__publicField(this,"options");this.options=options}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const message of this.options.messageStream){const deserialized=await this.options.deserializer(message);void 0!==deserialized&&(yield deserialized)}}};SmithyMessageEncoderStream=class{constructor(options){__publicField(this,"options");this.options=options}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const chunk of this.options.inputStream){const payloadBuf=this.options.serializer(chunk);yield payloadBuf}}};EventStreamMarshaller=class{constructor({utf8Encoder,utf8Decoder}){__publicField(this,"eventStreamCodec");__publicField(this,"utfEncoder");this.eventStreamCodec=new EventStreamCodec(utf8Encoder,utf8Decoder);this.utfEncoder=utf8Encoder}deserialize(body,deserializer){const inputStream=getChunkedStream(body);return new SmithyMessageDecoderStream({messageStream:new MessageDecoderStream({inputStream,decoder:this.eventStreamCodec}),deserializer:getMessageUnmarshaller(deserializer,this.utfEncoder)})}serialize(inputStream,serializer){return new MessageEncoderStream({messageStream:new SmithyMessageEncoderStream({inputStream,serializer}),encoder:this.eventStreamCodec,includeEndFrame:!0})}};readableStreamtoIterable=readableStream=>({[Symbol.asyncIterator]:async function*(){const reader=readableStream.getReader();try{for(;;){const{done,value}=await reader.read();if(done)return;yield value}}finally{reader.releaseLock()}}});iterableToReadableStream=asyncIterable=>{const iterator=asyncIterable[Symbol.asyncIterator]();return new ReadableStream({async pull(controller){const{done,value}=await iterator.next();if(done)return controller.close();controller.enqueue(value)}})};EventStreamMarshaller2=class{constructor({utf8Encoder,utf8Decoder}){__publicField(this,"universalMarshaller");this.universalMarshaller=new EventStreamMarshaller({utf8Decoder,utf8Encoder})}deserialize(body,deserializer){const bodyIterable=isReadableStream2(body)?readableStreamtoIterable(body):body;return this.universalMarshaller.deserialize(bodyIterable,deserializer)}serialize(input,serializer){const serialziedIterable=this.universalMarshaller.serialize(input,serializer);return"function"==typeof ReadableStream?iterableToReadableStream(serialziedIterable):serialziedIterable}};isReadableStream2=body=>"function"==typeof ReadableStream&&body instanceof ReadableStream;eventStreamSerdeProvider=options=>new EventStreamMarshaller2(options);blobHasher=async function blobHasher2(hashCtor,blob){const hash3=new hashCtor;await blobReader(blob,chunk=>{hash3.update(chunk)});return hash3.digest()};invalidProvider=message=>()=>Promise.reject(message);INIT2=[1732584193,4023233417,2562383102,271733878];init_dist_es();Md5=class{constructor(){__publicField(this,"state");__publicField(this,"buffer");__publicField(this,"bufferLength");__publicField(this,"bytesHashed");__publicField(this,"finished");this.reset()}update(sourceData){if(isEmptyData3(sourceData))return;if(this.finished)throw new Error("Attempted to update an already finished hash.");const data=convertToBuffer3(sourceData);let position=0,{byteLength}=data;this.bytesHashed+=byteLength;for(;byteLength>0;){this.buffer.setUint8(this.bufferLength++,data[position++]);byteLength--;if(64===this.bufferLength){this.hashBuffer();this.bufferLength=0}}}async digest(){if(!this.finished){const{buffer,bufferLength:undecoratedLength,bytesHashed}=this,bitsHashed=8*bytesHashed;buffer.setUint8(this.bufferLength++,128);if(undecoratedLength%64>=56){for(let i2=this.bufferLength;i2<64;i2++)buffer.setUint8(i2,0);this.hashBuffer();this.bufferLength=0}for(let i2=this.bufferLength;i2<56;i2++)buffer.setUint8(i2,0);buffer.setUint32(56,bitsHashed>>>0,!0);buffer.setUint32(60,Math.floor(bitsHashed/4294967296),!0);this.hashBuffer();this.finished=!0}const out=new DataView(new ArrayBuffer(16));for(let i2=0;i2<4;i2++)out.setUint32(4*i2,this.state[i2],!0);return new Uint8Array(out.buffer,out.byteOffset,out.byteLength)}hashBuffer(){const{buffer,state:state2}=this;let a2=state2[0],b3=state2[1],c3=state2[2],d4=state2[3];a2=ff(a2,b3,c3,d4,buffer.getUint32(0,!0),7,3614090360);d4=ff(d4,a2,b3,c3,buffer.getUint32(4,!0),12,3905402710);c3=ff(c3,d4,a2,b3,buffer.getUint32(8,!0),17,606105819);b3=ff(b3,c3,d4,a2,buffer.getUint32(12,!0),22,3250441966);a2=ff(a2,b3,c3,d4,buffer.getUint32(16,!0),7,4118548399);d4=ff(d4,a2,b3,c3,buffer.getUint32(20,!0),12,1200080426);c3=ff(c3,d4,a2,b3,buffer.getUint32(24,!0),17,2821735955);b3=ff(b3,c3,d4,a2,buffer.getUint32(28,!0),22,4249261313);a2=ff(a2,b3,c3,d4,buffer.getUint32(32,!0),7,1770035416);d4=ff(d4,a2,b3,c3,buffer.getUint32(36,!0),12,2336552879);c3=ff(c3,d4,a2,b3,buffer.getUint32(40,!0),17,4294925233);b3=ff(b3,c3,d4,a2,buffer.getUint32(44,!0),22,2304563134);a2=ff(a2,b3,c3,d4,buffer.getUint32(48,!0),7,1804603682);d4=ff(d4,a2,b3,c3,buffer.getUint32(52,!0),12,4254626195);c3=ff(c3,d4,a2,b3,buffer.getUint32(56,!0),17,2792965006);b3=ff(b3,c3,d4,a2,buffer.getUint32(60,!0),22,1236535329);a2=gg(a2,b3,c3,d4,buffer.getUint32(4,!0),5,4129170786);d4=gg(d4,a2,b3,c3,buffer.getUint32(24,!0),9,3225465664);c3=gg(c3,d4,a2,b3,buffer.getUint32(44,!0),14,643717713);b3=gg(b3,c3,d4,a2,buffer.getUint32(0,!0),20,3921069994);a2=gg(a2,b3,c3,d4,buffer.getUint32(20,!0),5,3593408605);d4=gg(d4,a2,b3,c3,buffer.getUint32(40,!0),9,38016083);c3=gg(c3,d4,a2,b3,buffer.getUint32(60,!0),14,3634488961);b3=gg(b3,c3,d4,a2,buffer.getUint32(16,!0),20,3889429448);a2=gg(a2,b3,c3,d4,buffer.getUint32(36,!0),5,568446438);d4=gg(d4,a2,b3,c3,buffer.getUint32(56,!0),9,3275163606);c3=gg(c3,d4,a2,b3,buffer.getUint32(12,!0),14,4107603335);b3=gg(b3,c3,d4,a2,buffer.getUint32(32,!0),20,1163531501);a2=gg(a2,b3,c3,d4,buffer.getUint32(52,!0),5,2850285829);d4=gg(d4,a2,b3,c3,buffer.getUint32(8,!0),9,4243563512);c3=gg(c3,d4,a2,b3,buffer.getUint32(28,!0),14,1735328473);b3=gg(b3,c3,d4,a2,buffer.getUint32(48,!0),20,2368359562);a2=hh(a2,b3,c3,d4,buffer.getUint32(20,!0),4,4294588738);d4=hh(d4,a2,b3,c3,buffer.getUint32(32,!0),11,2272392833);c3=hh(c3,d4,a2,b3,buffer.getUint32(44,!0),16,1839030562);b3=hh(b3,c3,d4,a2,buffer.getUint32(56,!0),23,4259657740);a2=hh(a2,b3,c3,d4,buffer.getUint32(4,!0),4,2763975236);d4=hh(d4,a2,b3,c3,buffer.getUint32(16,!0),11,1272893353);c3=hh(c3,d4,a2,b3,buffer.getUint32(28,!0),16,4139469664);b3=hh(b3,c3,d4,a2,buffer.getUint32(40,!0),23,3200236656);a2=hh(a2,b3,c3,d4,buffer.getUint32(52,!0),4,681279174);d4=hh(d4,a2,b3,c3,buffer.getUint32(0,!0),11,3936430074);c3=hh(c3,d4,a2,b3,buffer.getUint32(12,!0),16,3572445317);b3=hh(b3,c3,d4,a2,buffer.getUint32(24,!0),23,76029189);a2=hh(a2,b3,c3,d4,buffer.getUint32(36,!0),4,3654602809);d4=hh(d4,a2,b3,c3,buffer.getUint32(48,!0),11,3873151461);c3=hh(c3,d4,a2,b3,buffer.getUint32(60,!0),16,530742520);b3=hh(b3,c3,d4,a2,buffer.getUint32(8,!0),23,3299628645);a2=ii(a2,b3,c3,d4,buffer.getUint32(0,!0),6,4096336452);d4=ii(d4,a2,b3,c3,buffer.getUint32(28,!0),10,1126891415);c3=ii(c3,d4,a2,b3,buffer.getUint32(56,!0),15,2878612391);b3=ii(b3,c3,d4,a2,buffer.getUint32(20,!0),21,4237533241);a2=ii(a2,b3,c3,d4,buffer.getUint32(48,!0),6,1700485571);d4=ii(d4,a2,b3,c3,buffer.getUint32(12,!0),10,2399980690);c3=ii(c3,d4,a2,b3,buffer.getUint32(40,!0),15,4293915773);b3=ii(b3,c3,d4,a2,buffer.getUint32(4,!0),21,2240044497);a2=ii(a2,b3,c3,d4,buffer.getUint32(32,!0),6,1873313359);d4=ii(d4,a2,b3,c3,buffer.getUint32(60,!0),10,4264355552);c3=ii(c3,d4,a2,b3,buffer.getUint32(24,!0),15,2734768916);b3=ii(b3,c3,d4,a2,buffer.getUint32(52,!0),21,1309151649);a2=ii(a2,b3,c3,d4,buffer.getUint32(16,!0),6,4149444226);d4=ii(d4,a2,b3,c3,buffer.getUint32(44,!0),10,3174756917);c3=ii(c3,d4,a2,b3,buffer.getUint32(8,!0),15,718787259);b3=ii(b3,c3,d4,a2,buffer.getUint32(36,!0),21,3951481745);state2[0]=a2+state2[0]&4294967295;state2[1]=b3+state2[1]&4294967295;state2[2]=c3+state2[2]&4294967295;state2[3]=d4+state2[3]&4294967295}reset(){this.state=Uint32Array.from(INIT2);this.buffer=new DataView(new ArrayBuffer(64));this.bufferLength=0;this.bytesHashed=0;this.finished=!1}};DEFAULTS_MODE_OPTIONS=["in-region","cross-region","mobile","standard","legacy"];resolveDefaultsModeConfig=({defaultsMode}={})=>memoize(async()=>{const mode="function"==typeof defaultsMode?await defaultsMode():defaultsMode;switch(null==mode?void 0:mode.toLowerCase()){case"auto":return Promise.resolve(useMobileConfiguration()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(null==mode?void 0:mode.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`)}});useMobileConfiguration=()=>{var _a8;const navigator2=null==window?void 0:window.navigator;if(null==navigator2?void 0:navigator2.connection){const{effectiveType,rtt,downlink}=null==navigator2?void 0:navigator2.connection;if("string"==typeof effectiveType&&"4g"!==effectiveType||Number(rtt)>100||Number(downlink)<10)return!0}return(null==(_a8=null==navigator2?void 0:navigator2.userAgentData)?void 0:_a8.mobile)||"number"==typeof(null==navigator2?void 0:navigator2.maxTouchPoints)&&(null==navigator2?void 0:navigator2.maxTouchPoints)>1};init_dist_es();getRuntimeConfig=config=>{var _a8,_b5,_c3,_d2,_e2,_f,_g,_h2,_i2,_j,_k,_l,_m2,_n,_o,_p2,_q,_r,_s2;return{apiVersion:"2006-03-01",base64Decoder:null!=(_a8=null==config?void 0:config.base64Decoder)?_a8:fromBase64,base64Encoder:null!=(_b5=null==config?void 0:config.base64Encoder)?_b5:toBase64,disableHostPrefix:null!=(_c3=null==config?void 0:config.disableHostPrefix)&&_c3,endpointProvider:null!=(_d2=null==config?void 0:config.endpointProvider)?_d2:defaultEndpointResolver,extensions:null!=(_e2=null==config?void 0:config.extensions)?_e2:[],getAwsChunkedEncodingStream:null!=(_f=null==config?void 0:config.getAwsChunkedEncodingStream)?_f:getAwsChunkedEncodingStream,httpAuthSchemeProvider:null!=(_g=null==config?void 0:config.httpAuthSchemeProvider)?_g:defaultS3HttpAuthSchemeProvider,httpAuthSchemes:null!=(_h2=null==config?void 0:config.httpAuthSchemes)?_h2:[{schemeId:"aws.auth#sigv4",identityProvider:ipc=>ipc.getIdentityProvider("aws.auth#sigv4"),signer:new AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:ipc=>ipc.getIdentityProvider("aws.auth#sigv4a"),signer:new AwsSdkSigV4ASigner}],logger:null!=(_i2=null==config?void 0:config.logger)?_i2:new NoOpLogger,protocol:null!=(_j=null==config?void 0:config.protocol)?_j:S3RestXmlProtocol,protocolSettings:null!=(_k=null==config?void 0:config.protocolSettings)?_k:{defaultNamespace:"com.amazonaws.s3",errorTypeRegistries,xmlNamespace:"http://s3.amazonaws.com/doc/2006-03-01/",version:"2006-03-01",serviceTarget:"AmazonS3"},sdkStreamMixin:null!=(_l=null==config?void 0:config.sdkStreamMixin)?_l:sdkStreamMixin,serviceId:null!=(_m2=null==config?void 0:config.serviceId)?_m2:"S3",signerConstructor:null!=(_n=null==config?void 0:config.signerConstructor)?_n:SignatureV4MultiRegion,signingEscapePath:null!=(_o=null==config?void 0:config.signingEscapePath)&&_o,urlParser:null!=(_p2=null==config?void 0:config.urlParser)?_p2:parseUrl,useArnRegion:null!=(_q=null==config?void 0:config.useArnRegion)?_q:void 0,utf8Decoder:null!=(_r=null==config?void 0:config.utf8Decoder)?_r:fromUtf8,utf8Encoder:null!=(_s2=null==config?void 0:config.utf8Encoder)?_s2:toUtf8}};getRuntimeConfig2=config=>{var _a8,_b5,_c3,_d2,_e2,_f,_g,_h2,_i2,_j,_k,_l,_m2,_n,_o;const defaultsMode=resolveDefaultsModeConfig(config),defaultConfigProvider=()=>defaultsMode().then(loadConfigsForDefaultMode),clientSharedValues=getRuntimeConfig(config);return{...clientSharedValues,...config,runtime:"browser",defaultsMode,bodyLengthChecker:null!=(_a8=null==config?void 0:config.bodyLengthChecker)?_a8:calculateBodyLength,credentialDefaultProvider:null!=(_b5=null==config?void 0:config.credentialDefaultProvider)?_b5:_=>()=>Promise.reject(new Error("Credential is missing")),defaultUserAgentProvider:null!=(_c3=null==config?void 0:config.defaultUserAgentProvider)?_c3:createDefaultUserAgentProvider({serviceId:clientSharedValues.serviceId,clientVersion:"3.1017.0"}),eventStreamSerdeProvider:null!=(_d2=null==config?void 0:config.eventStreamSerdeProvider)?_d2:eventStreamSerdeProvider,maxAttempts:null!=(_e2=null==config?void 0:config.maxAttempts)?_e2:3,md5:null!=(_f=null==config?void 0:config.md5)?_f:Md5,region:null!=(_g=null==config?void 0:config.region)?_g:invalidProvider("Region is missing"),requestHandler:FetchHttpHandler.create(null!=(_h2=null==config?void 0:config.requestHandler)?_h2:defaultConfigProvider),retryMode:null!=(_i2=null==config?void 0:config.retryMode)?_i2:async()=>(await defaultConfigProvider()).retryMode||DEFAULT_RETRY_MODE,sha1:null!=(_j=null==config?void 0:config.sha1)?_j:Sha12,sha256:null!=(_k=null==config?void 0:config.sha256)?_k:Sha2563,streamCollector:null!=(_l=null==config?void 0:config.streamCollector)?_l:streamCollector,streamHasher:null!=(_m2=null==config?void 0:config.streamHasher)?_m2:blobHasher,useDualstackEndpoint:null!=(_n=null==config?void 0:config.useDualstackEndpoint)?_n:()=>Promise.resolve(!1),useFipsEndpoint:null!=(_o=null==config?void 0:config.useFipsEndpoint)?_o:()=>Promise.resolve(!1)}};getAwsRegionExtensionConfiguration=runtimeConfig=>({setRegion(region){runtimeConfig.region=region},region:()=>runtimeConfig.region});resolveAwsRegionExtensionConfiguration=awsRegionExtensionConfiguration=>({region:awsRegionExtensionConfiguration.region()});getHttpAuthExtensionConfiguration=runtimeConfig=>{const _httpAuthSchemes=runtimeConfig.httpAuthSchemes;let _httpAuthSchemeProvider=runtimeConfig.httpAuthSchemeProvider,_credentials=runtimeConfig.credentials;return{setHttpAuthScheme(httpAuthScheme){const index6=_httpAuthSchemes.findIndex(scheme=>scheme.schemeId===httpAuthScheme.schemeId);-1===index6?_httpAuthSchemes.push(httpAuthScheme):_httpAuthSchemes.splice(index6,1,httpAuthScheme)},httpAuthSchemes:()=>_httpAuthSchemes,setHttpAuthSchemeProvider(httpAuthSchemeProvider){_httpAuthSchemeProvider=httpAuthSchemeProvider},httpAuthSchemeProvider:()=>_httpAuthSchemeProvider,setCredentials(credentials){_credentials=credentials},credentials:()=>_credentials}};resolveHttpAuthRuntimeConfig=config=>({httpAuthSchemes:config.httpAuthSchemes(),httpAuthSchemeProvider:config.httpAuthSchemeProvider(),credentials:config.credentials()});resolveRuntimeExtensions=(runtimeConfig,extensions)=>{const extensionConfiguration=Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig),getDefaultExtensionConfiguration(runtimeConfig),getHttpHandlerExtensionConfiguration(runtimeConfig),getHttpAuthExtensionConfiguration(runtimeConfig));extensions.forEach(extension=>extension.configure(extensionConfiguration));return Object.assign(runtimeConfig,resolveAwsRegionExtensionConfiguration(extensionConfiguration),resolveDefaultRuntimeConfig(extensionConfiguration),resolveHttpHandlerRuntimeConfig(extensionConfiguration),resolveHttpAuthRuntimeConfig(extensionConfiguration))};S3Client=class extends Client{constructor(...[configuration]){const _config_0=getRuntimeConfig2(configuration||{});super(_config_0);__publicField(this,"config");this.initConfig=_config_0;const _config_2=resolveUserAgentConfig(resolveClientEndpointParameters(_config_0)),_config_3=resolveFlexibleChecksumsConfig(_config_2),_config_4=resolveRetryConfig(_config_3),_config_6=resolveHostHeaderConfig(resolveRegionConfig(_config_4)),_config_7=resolveEndpointConfig(_config_6),_config_8=resolveEventStreamSerdeConfig(_config_7),_config_9=resolveHttpAuthSchemeConfig(_config_8),_config_10=resolveS3Config(_config_9,{session:[()=>this,CreateSessionCommand]}),_config_11=resolveRuntimeExtensions(_config_10,(null==configuration?void 0:configuration.extensions)||[]);this.config=_config_11;this.middlewareStack.use(getSchemaSerdePlugin(this.config));this.middlewareStack.use(getUserAgentPlugin(this.config));this.middlewareStack.use(getRetryPlugin(this.config));this.middlewareStack.use(getContentLengthPlugin(this.config));this.middlewareStack.use(getHostHeaderPlugin(this.config));this.middlewareStack.use(getLoggerPlugin(this.config));this.middlewareStack.use(getRecursionDetectionPlugin(this.config));this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:defaultS3HttpAuthSchemeParametersProvider,identityProviderConfigProvider:async config=>new DefaultIdentityProviderConfig({"aws.auth#sigv4":config.credentials,"aws.auth#sigv4a":config.credentials})}));this.middlewareStack.use(getHttpSigningPlugin(this.config));this.middlewareStack.use(getValidateBucketNamePlugin(this.config));this.middlewareStack.use(getAddExpectContinuePlugin(this.config));this.middlewareStack.use(getRegionRedirectMiddlewarePlugin(this.config));this.middlewareStack.use(getS3ExpressPlugin(this.config));this.middlewareStack.use(getS3ExpressHttpSigningPlugin(this.config))}destroy(){super.destroy()}};AbortMultipartUploadCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","AbortMultipartUpload",{}).n("S3Client","AbortMultipartUploadCommand").sc(AbortMultipartUpload$).build()){};ssecMiddlewareOptions={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0};getSsecPlugin=config=>({applyToStack:clientStack=>{clientStack.add(ssecMiddleware(config),ssecMiddlewareOptions)}});CompleteMultipartUploadCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config),getSsecPlugin(config)]}).s("AmazonS3","CompleteMultipartUpload",{}).n("S3Client","CompleteMultipartUploadCommand").sc(CompleteMultipartUpload$).build()){};CopyObjectCommand=class extends(Command.classBuilder().ep({...commonParams,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"},CopySource:{type:"contextParams",name:"CopySource"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config),getSsecPlugin(config)]}).s("AmazonS3","CopyObject",{}).n("S3Client","CopyObjectCommand").sc(CopyObject$).build()){};locationConstraintMiddlewareOptions={step:"initialize",tags:["LOCATION_CONSTRAINT","CREATE_BUCKET_CONFIGURATION"],name:"locationConstraintMiddleware",override:!0};getLocationConstraintPlugin=config=>({applyToStack:clientStack=>{clientStack.add(locationConstraintMiddleware(config),locationConstraintMiddlewareOptions)}});CreateBucketCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},DisableAccessPoints:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config),getLocationConstraintPlugin(config)]}).s("AmazonS3","CreateBucket",{}).n("S3Client","CreateBucketCommand").sc(CreateBucket$).build()){};CreateBucketMetadataConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","CreateBucketMetadataConfiguration",{}).n("S3Client","CreateBucketMetadataConfigurationCommand").sc(CreateBucketMetadataConfiguration$).build()){};CreateBucketMetadataTableConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","CreateBucketMetadataTableConfiguration",{}).n("S3Client","CreateBucketMetadataTableConfigurationCommand").sc(CreateBucketMetadataTableConfiguration$).build()){};CreateMultipartUploadCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config),getSsecPlugin(config)]}).s("AmazonS3","CreateMultipartUpload",{}).n("S3Client","CreateMultipartUploadCommand").sc(CreateMultipartUpload$).build()){};DeleteBucketAnalyticsConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketAnalyticsConfiguration",{}).n("S3Client","DeleteBucketAnalyticsConfigurationCommand").sc(DeleteBucketAnalyticsConfiguration$).build()){};DeleteBucketCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucket",{}).n("S3Client","DeleteBucketCommand").sc(DeleteBucket$).build()){};DeleteBucketCorsCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketCors",{}).n("S3Client","DeleteBucketCorsCommand").sc(DeleteBucketCors$).build()){};DeleteBucketEncryptionCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketEncryption",{}).n("S3Client","DeleteBucketEncryptionCommand").sc(DeleteBucketEncryption$).build()){};DeleteBucketIntelligentTieringConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketIntelligentTieringConfiguration",{}).n("S3Client","DeleteBucketIntelligentTieringConfigurationCommand").sc(DeleteBucketIntelligentTieringConfiguration$).build()){};DeleteBucketInventoryConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketInventoryConfiguration",{}).n("S3Client","DeleteBucketInventoryConfigurationCommand").sc(DeleteBucketInventoryConfiguration$).build()){};DeleteBucketLifecycleCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketLifecycle",{}).n("S3Client","DeleteBucketLifecycleCommand").sc(DeleteBucketLifecycle$).build()){};DeleteBucketMetadataConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketMetadataConfiguration",{}).n("S3Client","DeleteBucketMetadataConfigurationCommand").sc(DeleteBucketMetadataConfiguration$).build()){};DeleteBucketMetadataTableConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketMetadataTableConfiguration",{}).n("S3Client","DeleteBucketMetadataTableConfigurationCommand").sc(DeleteBucketMetadataTableConfiguration$).build()){};DeleteBucketMetricsConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketMetricsConfiguration",{}).n("S3Client","DeleteBucketMetricsConfigurationCommand").sc(DeleteBucketMetricsConfiguration$).build()){};DeleteBucketOwnershipControlsCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketOwnershipControls",{}).n("S3Client","DeleteBucketOwnershipControlsCommand").sc(DeleteBucketOwnershipControls$).build()){};DeleteBucketPolicyCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketPolicy",{}).n("S3Client","DeleteBucketPolicyCommand").sc(DeleteBucketPolicy$).build()){};DeleteBucketReplicationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketReplication",{}).n("S3Client","DeleteBucketReplicationCommand").sc(DeleteBucketReplication$).build()){};DeleteBucketTaggingCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketTagging",{}).n("S3Client","DeleteBucketTaggingCommand").sc(DeleteBucketTagging$).build()){};DeleteBucketWebsiteCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeleteBucketWebsite",{}).n("S3Client","DeleteBucketWebsiteCommand").sc(DeleteBucketWebsite$).build()){};DeleteObjectCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","DeleteObject",{}).n("S3Client","DeleteObjectCommand").sc(DeleteObject$).build()){};DeleteObjectsCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","DeleteObjects",{}).n("S3Client","DeleteObjectsCommand").sc(DeleteObjects$).build()){};DeleteObjectTaggingCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","DeleteObjectTagging",{}).n("S3Client","DeleteObjectTaggingCommand").sc(DeleteObjectTagging$).build()){};DeletePublicAccessBlockCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","DeletePublicAccessBlock",{}).n("S3Client","DeletePublicAccessBlockCommand").sc(DeletePublicAccessBlock$).build()){};GetBucketAbacCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketAbac",{}).n("S3Client","GetBucketAbacCommand").sc(GetBucketAbac$).build()){};GetBucketAccelerateConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketAccelerateConfiguration",{}).n("S3Client","GetBucketAccelerateConfigurationCommand").sc(GetBucketAccelerateConfiguration$).build()){};GetBucketAclCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketAcl",{}).n("S3Client","GetBucketAclCommand").sc(GetBucketAcl$).build()){};GetBucketAnalyticsConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketAnalyticsConfiguration",{}).n("S3Client","GetBucketAnalyticsConfigurationCommand").sc(GetBucketAnalyticsConfiguration$).build()){};GetBucketCorsCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketCors",{}).n("S3Client","GetBucketCorsCommand").sc(GetBucketCors$).build()){};GetBucketEncryptionCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketEncryption",{}).n("S3Client","GetBucketEncryptionCommand").sc(GetBucketEncryption$).build()){};GetBucketIntelligentTieringConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketIntelligentTieringConfiguration",{}).n("S3Client","GetBucketIntelligentTieringConfigurationCommand").sc(GetBucketIntelligentTieringConfiguration$).build()){};GetBucketInventoryConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketInventoryConfiguration",{}).n("S3Client","GetBucketInventoryConfigurationCommand").sc(GetBucketInventoryConfiguration$).build()){};GetBucketLifecycleConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketLifecycleConfiguration",{}).n("S3Client","GetBucketLifecycleConfigurationCommand").sc(GetBucketLifecycleConfiguration$).build()){};GetBucketLocationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketLocation",{}).n("S3Client","GetBucketLocationCommand").sc(GetBucketLocation$).build()){};GetBucketLoggingCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketLogging",{}).n("S3Client","GetBucketLoggingCommand").sc(GetBucketLogging$).build()){};GetBucketMetadataConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketMetadataConfiguration",{}).n("S3Client","GetBucketMetadataConfigurationCommand").sc(GetBucketMetadataConfiguration$).build()){};GetBucketMetadataTableConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketMetadataTableConfiguration",{}).n("S3Client","GetBucketMetadataTableConfigurationCommand").sc(GetBucketMetadataTableConfiguration$).build()){};GetBucketMetricsConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketMetricsConfiguration",{}).n("S3Client","GetBucketMetricsConfigurationCommand").sc(GetBucketMetricsConfiguration$).build()){};GetBucketNotificationConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketNotificationConfiguration",{}).n("S3Client","GetBucketNotificationConfigurationCommand").sc(GetBucketNotificationConfiguration$).build()){};GetBucketOwnershipControlsCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketOwnershipControls",{}).n("S3Client","GetBucketOwnershipControlsCommand").sc(GetBucketOwnershipControls$).build()){};GetBucketPolicyCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketPolicy",{}).n("S3Client","GetBucketPolicyCommand").sc(GetBucketPolicy$).build()){};GetBucketPolicyStatusCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketPolicyStatus",{}).n("S3Client","GetBucketPolicyStatusCommand").sc(GetBucketPolicyStatus$).build()){};GetBucketReplicationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketReplication",{}).n("S3Client","GetBucketReplicationCommand").sc(GetBucketReplication$).build()){};GetBucketRequestPaymentCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketRequestPayment",{}).n("S3Client","GetBucketRequestPaymentCommand").sc(GetBucketRequestPayment$).build()){};GetBucketTaggingCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketTagging",{}).n("S3Client","GetBucketTaggingCommand").sc(GetBucketTagging$).build()){};GetBucketVersioningCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketVersioning",{}).n("S3Client","GetBucketVersioningCommand").sc(GetBucketVersioning$).build()){};GetBucketWebsiteCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetBucketWebsite",{}).n("S3Client","GetBucketWebsiteCommand").sc(GetBucketWebsite$).build()){};GetObjectAclCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetObjectAcl",{}).n("S3Client","GetObjectAclCommand").sc(GetObjectAcl$).build()){};GetObjectAttributesCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config),getSsecPlugin(config)]}).s("AmazonS3","GetObjectAttributes",{}).n("S3Client","GetObjectAttributesCommand").sc(GetObjectAttributes$).build()){};GetObjectCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC64NVME","CRC32","CRC32C","SHA256","SHA1"]}),getSsecPlugin(config),getS3ExpiresMiddlewarePlugin()]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").sc(GetObject$).build()){};GetObjectLegalHoldCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetObjectLegalHold",{}).n("S3Client","GetObjectLegalHoldCommand").sc(GetObjectLegalHold$).build()){};GetObjectLockConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetObjectLockConfiguration",{}).n("S3Client","GetObjectLockConfigurationCommand").sc(GetObjectLockConfiguration$).build()){};GetObjectRetentionCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetObjectRetention",{}).n("S3Client","GetObjectRetentionCommand").sc(GetObjectRetention$).build()){};GetObjectTaggingCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetObjectTagging",{}).n("S3Client","GetObjectTaggingCommand").sc(GetObjectTagging$).build()){};GetObjectTorrentCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","GetObjectTorrent",{}).n("S3Client","GetObjectTorrentCommand").sc(GetObjectTorrent$).build()){};GetPublicAccessBlockCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","GetPublicAccessBlock",{}).n("S3Client","GetPublicAccessBlockCommand").sc(GetPublicAccessBlock$).build()){};HeadBucketCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","HeadBucket",{}).n("S3Client","HeadBucketCommand").sc(HeadBucket$).build()){};HeadObjectCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config),getSsecPlugin(config),getS3ExpiresMiddlewarePlugin()]}).s("AmazonS3","HeadObject",{}).n("S3Client","HeadObjectCommand").sc(HeadObject$).build()){};ListBucketAnalyticsConfigurationsCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","ListBucketAnalyticsConfigurations",{}).n("S3Client","ListBucketAnalyticsConfigurationsCommand").sc(ListBucketAnalyticsConfigurations$).build()){};ListBucketIntelligentTieringConfigurationsCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","ListBucketIntelligentTieringConfigurations",{}).n("S3Client","ListBucketIntelligentTieringConfigurationsCommand").sc(ListBucketIntelligentTieringConfigurations$).build()){};ListBucketInventoryConfigurationsCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","ListBucketInventoryConfigurations",{}).n("S3Client","ListBucketInventoryConfigurationsCommand").sc(ListBucketInventoryConfigurations$).build()){};ListBucketMetricsConfigurationsCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","ListBucketMetricsConfigurations",{}).n("S3Client","ListBucketMetricsConfigurationsCommand").sc(ListBucketMetricsConfigurations$).build()){};ListBucketsCommand=class extends(Command.classBuilder().ep(commonParams).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","ListBuckets",{}).n("S3Client","ListBucketsCommand").sc(ListBuckets$).build()){};ListDirectoryBucketsCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","ListDirectoryBuckets",{}).n("S3Client","ListDirectoryBucketsCommand").sc(ListDirectoryBuckets$).build()){};ListMultipartUploadsCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","ListMultipartUploads",{}).n("S3Client","ListMultipartUploadsCommand").sc(ListMultipartUploads$).build()){};ListObjectsCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","ListObjects",{}).n("S3Client","ListObjectsCommand").sc(ListObjects$).build()){};ListObjectsV2Command=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","ListObjectsV2",{}).n("S3Client","ListObjectsV2Command").sc(ListObjectsV2$).build()){};ListObjectVersionsCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","ListObjectVersions",{}).n("S3Client","ListObjectVersionsCommand").sc(ListObjectVersions$).build()){};ListPartsCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config),getSsecPlugin(config)]}).s("AmazonS3","ListParts",{}).n("S3Client","ListPartsCommand").sc(ListParts$).build()){};PutBucketAbacCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1})]}).s("AmazonS3","PutBucketAbac",{}).n("S3Client","PutBucketAbacCommand").sc(PutBucketAbac$).build()){};PutBucketAccelerateConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1})]}).s("AmazonS3","PutBucketAccelerateConfiguration",{}).n("S3Client","PutBucketAccelerateConfigurationCommand").sc(PutBucketAccelerateConfiguration$).build()){};PutBucketAclCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketAcl",{}).n("S3Client","PutBucketAclCommand").sc(PutBucketAcl$).build()){};PutBucketAnalyticsConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketAnalyticsConfiguration",{}).n("S3Client","PutBucketAnalyticsConfigurationCommand").sc(PutBucketAnalyticsConfiguration$).build()){};PutBucketCorsCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketCors",{}).n("S3Client","PutBucketCorsCommand").sc(PutBucketCors$).build()){};PutBucketEncryptionCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketEncryption",{}).n("S3Client","PutBucketEncryptionCommand").sc(PutBucketEncryption$).build()){};PutBucketIntelligentTieringConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketIntelligentTieringConfiguration",{}).n("S3Client","PutBucketIntelligentTieringConfigurationCommand").sc(PutBucketIntelligentTieringConfiguration$).build()){};PutBucketInventoryConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketInventoryConfiguration",{}).n("S3Client","PutBucketInventoryConfigurationCommand").sc(PutBucketInventoryConfiguration$).build()){};PutBucketLifecycleConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","PutBucketLifecycleConfiguration",{}).n("S3Client","PutBucketLifecycleConfigurationCommand").sc(PutBucketLifecycleConfiguration$).build()){};PutBucketLoggingCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketLogging",{}).n("S3Client","PutBucketLoggingCommand").sc(PutBucketLogging$).build()){};PutBucketMetricsConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketMetricsConfiguration",{}).n("S3Client","PutBucketMetricsConfigurationCommand").sc(PutBucketMetricsConfiguration$).build()){};PutBucketNotificationConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","PutBucketNotificationConfiguration",{}).n("S3Client","PutBucketNotificationConfigurationCommand").sc(PutBucketNotificationConfiguration$).build()){};PutBucketOwnershipControlsCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketOwnershipControls",{}).n("S3Client","PutBucketOwnershipControlsCommand").sc(PutBucketOwnershipControls$).build()){};PutBucketPolicyCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketPolicy",{}).n("S3Client","PutBucketPolicyCommand").sc(PutBucketPolicy$).build()){};PutBucketReplicationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketReplication",{}).n("S3Client","PutBucketReplicationCommand").sc(PutBucketReplication$).build()){};PutBucketRequestPaymentCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketRequestPayment",{}).n("S3Client","PutBucketRequestPaymentCommand").sc(PutBucketRequestPayment$).build()){};PutBucketTaggingCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketTagging",{}).n("S3Client","PutBucketTaggingCommand").sc(PutBucketTagging$).build()){};PutBucketVersioningCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketVersioning",{}).n("S3Client","PutBucketVersioningCommand").sc(PutBucketVersioning$).build()){};PutBucketWebsiteCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutBucketWebsite",{}).n("S3Client","PutBucketWebsiteCommand").sc(PutBucketWebsite$).build()){};PutObjectAclCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","PutObjectAcl",{}).n("S3Client","PutObjectAclCommand").sc(PutObjectAcl$).build()){};PutObjectCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),getCheckContentLengthHeaderPlugin(),getThrow200ExceptionsPlugin(config),getSsecPlugin(config)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").sc(PutObject$).build()){};PutObjectLegalHoldCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","PutObjectLegalHold",{}).n("S3Client","PutObjectLegalHoldCommand").sc(PutObjectLegalHold$).build()){};PutObjectLockConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","PutObjectLockConfiguration",{}).n("S3Client","PutObjectLockConfigurationCommand").sc(PutObjectLockConfiguration$).build()){};PutObjectRetentionCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","PutObjectRetention",{}).n("S3Client","PutObjectRetentionCommand").sc(PutObjectRetention$).build()){};PutObjectTaggingCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","PutObjectTagging",{}).n("S3Client","PutObjectTaggingCommand").sc(PutObjectTagging$).build()){};PutPublicAccessBlockCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","PutPublicAccessBlock",{}).n("S3Client","PutPublicAccessBlockCommand").sc(PutPublicAccessBlock$).build()){};RenameObjectCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","RenameObject",{}).n("S3Client","RenameObjectCommand").sc(RenameObject$).build()){};RestoreObjectCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","RestoreObject",{}).n("S3Client","RestoreObjectCommand").sc(RestoreObject$).build()){};SelectObjectContentCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config),getSsecPlugin(config)]}).s("AmazonS3","SelectObjectContent",{eventStream:{output:!0}}).n("S3Client","SelectObjectContentCommand").sc(SelectObjectContent$).build()){};UpdateBucketMetadataInventoryTableConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","UpdateBucketMetadataInventoryTableConfiguration",{}).n("S3Client","UpdateBucketMetadataInventoryTableConfigurationCommand").sc(UpdateBucketMetadataInventoryTableConfiguration$).build()){};UpdateBucketMetadataJournalTableConfigurationCommand=class extends(Command.classBuilder().ep({...commonParams,UseS3ExpressControlEndpoint:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0})]}).s("AmazonS3","UpdateBucketMetadataJournalTableConfiguration",{}).n("S3Client","UpdateBucketMetadataJournalTableConfigurationCommand").sc(UpdateBucketMetadataJournalTableConfiguration$).build()){};UpdateObjectEncryptionCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!0}),getThrow200ExceptionsPlugin(config)]}).s("AmazonS3","UpdateObjectEncryption",{}).n("S3Client","UpdateObjectEncryptionCommand").sc(UpdateObjectEncryption$).build()){};UploadPartCommand=class extends(Command.classBuilder().ep({...commonParams,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getFlexibleChecksumsPlugin(config,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),getThrow200ExceptionsPlugin(config),getSsecPlugin(config)]}).s("AmazonS3","UploadPart",{}).n("S3Client","UploadPartCommand").sc(UploadPart$).build()){};UploadPartCopyCommand=class extends(Command.classBuilder().ep({...commonParams,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions()),getThrow200ExceptionsPlugin(config),getSsecPlugin(config)]}).s("AmazonS3","UploadPartCopy",{}).n("S3Client","UploadPartCopyCommand").sc(UploadPartCopy$).build()){};WriteGetObjectResponseCommand=class extends(Command.classBuilder().ep({...commonParams,UseObjectLambdaEndpoint:{type:"staticContextParams",value:!0}}).m(function(Command2,cs2,config,o2){return[getEndpointPlugin(config,Command2.getEndpointParameterInstructions())]}).s("AmazonS3","WriteGetObjectResponse",{}).n("S3Client","WriteGetObjectResponseCommand").sc(WriteGetObjectResponse$).build()){};paginateListBuckets=createPaginator(S3Client,ListBucketsCommand,"ContinuationToken","ContinuationToken","MaxBuckets");paginateListDirectoryBuckets=createPaginator(S3Client,ListDirectoryBucketsCommand,"ContinuationToken","ContinuationToken","MaxDirectoryBuckets");paginateListObjectsV2=createPaginator(S3Client,ListObjectsV2Command,"ContinuationToken","NextContinuationToken","MaxKeys");paginateListParts=createPaginator(S3Client,ListPartsCommand,"PartNumberMarker","NextPartNumberMarker","MaxParts");getCircularReplacer=()=>{const seen=new WeakSet;return(key3,value)=>{if("object"==typeof value&&null!==value){if(seen.has(value))return"[Circular]";seen.add(value)}return value}};sleep=seconds=>new Promise(resolve=>setTimeout(resolve,1e3*seconds));waiterServiceDefaults={minDelay:2,maxDelay:120};(function(WaiterState2){WaiterState2.ABORTED="ABORTED";WaiterState2.FAILURE="FAILURE";WaiterState2.SUCCESS="SUCCESS";WaiterState2.RETRY="RETRY";WaiterState2.TIMEOUT="TIMEOUT"})(WaiterState||(WaiterState={}));checkExceptions=result=>{if(result.state===WaiterState.ABORTED){const abortError=new Error(`${JSON.stringify({...result,reason:"Request was aborted"},getCircularReplacer())}`);abortError.name="AbortError";throw abortError}if(result.state===WaiterState.TIMEOUT){const timeoutError=new Error(`${JSON.stringify({...result,reason:"Waiter has timed out"},getCircularReplacer())}`);timeoutError.name="TimeoutError";throw timeoutError}if(result.state!==WaiterState.SUCCESS)throw new Error(`${JSON.stringify(result,getCircularReplacer())}`);return result};exponentialBackoffWithJitter=(minDelay,maxDelay,attemptCeiling,attempt)=>attempt>attemptCeiling?maxDelay:randomInRange(minDelay,minDelay*2**(attempt-1));randomInRange=(min,max3)=>min+Math.random()*(max3-min);runPolling=async({minDelay,maxDelay,maxWaitTime,abortController,client,abortSignal},input,acceptorChecks)=>{var _a8;const observedResponses={},{state:state2,reason}=await acceptorChecks(client,input);if(reason){const message=createMessageFromResponse(reason);observedResponses[message]|=0;observedResponses[message]+=1}if(state2!==WaiterState.RETRY)return{state:state2,reason,observedResponses};let currentAttempt=1;const waitUntil=Date.now()+1e3*maxWaitTime,attemptCeiling=Math.log(maxDelay/minDelay)/Math.log(2)+1;for(;;){if((null==(_a8=null==abortController?void 0:abortController.signal)?void 0:_a8.aborted)||(null==abortSignal?void 0:abortSignal.aborted)){const message="AbortController signal aborted.";observedResponses[message]|=0;observedResponses[message]+=1;return{state:WaiterState.ABORTED,observedResponses}}const delay2=exponentialBackoffWithJitter(minDelay,maxDelay,attemptCeiling,currentAttempt);if(Date.now()+1e3*delay2>waitUntil)return{state:WaiterState.TIMEOUT,observedResponses};await sleep(delay2);const{state:state3,reason:reason2}=await acceptorChecks(client,input);if(reason2){const message=createMessageFromResponse(reason2);observedResponses[message]|=0;observedResponses[message]+=1}if(state3!==WaiterState.RETRY)return{state:state3,reason:reason2,observedResponses};currentAttempt+=1}};createMessageFromResponse=reason=>{var _a8,_b5,_c3,_d2,_e2,_f;return(null==reason?void 0:reason.$responseBodyText)?`Deserialization error for body: ${reason.$responseBodyText}`:(null==(_a8=null==reason?void 0:reason.$metadata)?void 0:_a8.httpStatusCode)?reason.$response||reason.message?`${null!=(_d2=null!=(_c3=null==(_b5=reason.$response)?void 0:_b5.statusCode)?_c3:reason.$metadata.httpStatusCode)?_d2:"Unknown"}: ${reason.message}`:`${reason.$metadata.httpStatusCode}: OK`:String(null!=(_f=null!=(_e2=null==reason?void 0:reason.message)?_e2:JSON.stringify(reason,getCircularReplacer()))?_f:"Unknown")};validateWaiterOptions=options=>{if(options.maxWaitTime<=0)throw new Error("WaiterConfiguration.maxWaitTime must be greater than 0");if(options.minDelay<=0)throw new Error("WaiterConfiguration.minDelay must be greater than 0");if(options.maxDelay<=0)throw new Error("WaiterConfiguration.maxDelay must be greater than 0");if(options.maxWaitTime<=options.minDelay)throw new Error(`WaiterConfiguration.maxWaitTime [${options.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`);if(options.maxDelay{let onAbort;const promise=new Promise(resolve=>{onAbort=()=>resolve({state:WaiterState.ABORTED});"function"==typeof abortSignal.addEventListener?abortSignal.addEventListener("abort",onAbort):abortSignal.onabort=onAbort});return{clearListener(){"function"==typeof abortSignal.removeEventListener&&abortSignal.removeEventListener("abort",onAbort)},aborted:promise}};createWaiter=async(options,input,acceptorChecks)=>{var _a8;const params={...waiterServiceDefaults,...options};validateWaiterOptions(params);const exitConditions=[runPolling(params,input,acceptorChecks)],finalize=[];if(options.abortSignal){const{aborted:aborted2,clearListener}=abortTimeout(options.abortSignal);finalize.push(clearListener);exitConditions.push(aborted2)}if(null==(_a8=options.abortController)?void 0:_a8.signal){const{aborted:aborted2,clearListener}=abortTimeout(options.abortController.signal);finalize.push(clearListener);exitConditions.push(aborted2)}return Promise.race(exitConditions).then(result=>{for(const fn of finalize)fn();return result})};checkState=async(client,input)=>{let reason;try{reason=await client.send(new HeadBucketCommand(input));return{state:WaiterState.SUCCESS,reason}}catch(exception){reason=exception;if(exception.name&&"NotFound"==exception.name)return{state:WaiterState.RETRY,reason}}return{state:WaiterState.RETRY,reason}};checkState2=async(client,input)=>{let reason;try{reason=await client.send(new HeadBucketCommand(input))}catch(exception){reason=exception;if(exception.name&&"NotFound"==exception.name)return{state:WaiterState.SUCCESS,reason}}return{state:WaiterState.RETRY,reason}};checkState3=async(client,input)=>{let reason;try{reason=await client.send(new HeadObjectCommand(input));return{state:WaiterState.SUCCESS,reason}}catch(exception){reason=exception;if(exception.name&&"NotFound"==exception.name)return{state:WaiterState.RETRY,reason}}return{state:WaiterState.RETRY,reason}};checkState4=async(client,input)=>{let reason;try{reason=await client.send(new HeadObjectCommand(input))}catch(exception){reason=exception;if(exception.name&&"NotFound"==exception.name)return{state:WaiterState.SUCCESS,reason}}return{state:WaiterState.RETRY,reason}};paginators={paginateListBuckets,paginateListDirectoryBuckets,paginateListObjectsV2,paginateListParts};waiters={waitUntilBucketExists:async(params,input)=>{const result=await createWaiter({minDelay:5,maxDelay:120,...params},input,checkState);return checkExceptions(result)},waitUntilBucketNotExists:async(params,input)=>{const result=await createWaiter({minDelay:5,maxDelay:120,...params},input,checkState2);return checkExceptions(result)},waitUntilObjectExists:async(params,input)=>{const result=await createWaiter({minDelay:5,maxDelay:120,...params},input,checkState3);return checkExceptions(result)},waitUntilObjectNotExists:async(params,input)=>{const result=await createWaiter({minDelay:5,maxDelay:120,...params},input,checkState4);return checkExceptions(result)}};createAggregatedClient({AbortMultipartUploadCommand,CompleteMultipartUploadCommand,CopyObjectCommand,CreateBucketCommand,CreateBucketMetadataConfigurationCommand,CreateBucketMetadataTableConfigurationCommand,CreateMultipartUploadCommand,CreateSessionCommand,DeleteBucketCommand,DeleteBucketAnalyticsConfigurationCommand,DeleteBucketCorsCommand,DeleteBucketEncryptionCommand,DeleteBucketIntelligentTieringConfigurationCommand,DeleteBucketInventoryConfigurationCommand,DeleteBucketLifecycleCommand,DeleteBucketMetadataConfigurationCommand,DeleteBucketMetadataTableConfigurationCommand,DeleteBucketMetricsConfigurationCommand,DeleteBucketOwnershipControlsCommand,DeleteBucketPolicyCommand,DeleteBucketReplicationCommand,DeleteBucketTaggingCommand,DeleteBucketWebsiteCommand,DeleteObjectCommand,DeleteObjectsCommand,DeleteObjectTaggingCommand,DeletePublicAccessBlockCommand,GetBucketAbacCommand,GetBucketAccelerateConfigurationCommand,GetBucketAclCommand,GetBucketAnalyticsConfigurationCommand,GetBucketCorsCommand,GetBucketEncryptionCommand,GetBucketIntelligentTieringConfigurationCommand,GetBucketInventoryConfigurationCommand,GetBucketLifecycleConfigurationCommand,GetBucketLocationCommand,GetBucketLoggingCommand,GetBucketMetadataConfigurationCommand,GetBucketMetadataTableConfigurationCommand,GetBucketMetricsConfigurationCommand,GetBucketNotificationConfigurationCommand,GetBucketOwnershipControlsCommand,GetBucketPolicyCommand,GetBucketPolicyStatusCommand,GetBucketReplicationCommand,GetBucketRequestPaymentCommand,GetBucketTaggingCommand,GetBucketVersioningCommand,GetBucketWebsiteCommand,GetObjectCommand,GetObjectAclCommand,GetObjectAttributesCommand,GetObjectLegalHoldCommand,GetObjectLockConfigurationCommand,GetObjectRetentionCommand,GetObjectTaggingCommand,GetObjectTorrentCommand,GetPublicAccessBlockCommand,HeadBucketCommand,HeadObjectCommand,ListBucketAnalyticsConfigurationsCommand,ListBucketIntelligentTieringConfigurationsCommand,ListBucketInventoryConfigurationsCommand,ListBucketMetricsConfigurationsCommand,ListBucketsCommand,ListDirectoryBucketsCommand,ListMultipartUploadsCommand,ListObjectsCommand,ListObjectsV2Command,ListObjectVersionsCommand,ListPartsCommand,PutBucketAbacCommand,PutBucketAccelerateConfigurationCommand,PutBucketAclCommand,PutBucketAnalyticsConfigurationCommand,PutBucketCorsCommand,PutBucketEncryptionCommand,PutBucketIntelligentTieringConfigurationCommand,PutBucketInventoryConfigurationCommand,PutBucketLifecycleConfigurationCommand,PutBucketLoggingCommand,PutBucketMetricsConfigurationCommand,PutBucketNotificationConfigurationCommand,PutBucketOwnershipControlsCommand,PutBucketPolicyCommand,PutBucketReplicationCommand,PutBucketRequestPaymentCommand,PutBucketTaggingCommand,PutBucketVersioningCommand,PutBucketWebsiteCommand,PutObjectCommand,PutObjectAclCommand,PutObjectLegalHoldCommand,PutObjectLockConfigurationCommand,PutObjectRetentionCommand,PutObjectTaggingCommand,PutPublicAccessBlockCommand,RenameObjectCommand,RestoreObjectCommand,SelectObjectContentCommand,UpdateBucketMetadataInventoryTableConfigurationCommand,UpdateBucketMetadataJournalTableConfigurationCommand,UpdateObjectEncryptionCommand,UploadPartCommand,UploadPartCopyCommand,WriteGetObjectResponseCommand},S3=class extends S3Client{},{paginators,waiters});applyMd5BodyChecksumMiddleware=options=>next2=>async args=>{const{request:request2}=args;if(HttpRequest.isInstance(request2)){const{body,headers}=request2;if(!hasHeader3("content-md5",headers)){let digest;if(void 0===body||"string"==typeof body||ArrayBuffer.isView(body)||isArrayBuffer(body)){const hash3=new options.md5;hash3.update(body||"");digest=hash3.digest()}else digest=options.streamHasher(options.md5,body);const cloned=HttpRequest.clone(request2);cloned.headers={...headers,"content-md5":options.base64Encoder(await digest)};return next2({...args,request:cloned})}}return next2(args)};hasHeader3=(soughtHeader,headers)=>{soughtHeader=soughtHeader.toLowerCase();for(const headerName of Object.keys(headers))if(soughtHeader===headerName.toLowerCase())return!0;return!1};ch2={};wk=function(c3,id,msg,transfer,cb2){var w2=new Worker(ch2[id]||(ch2[id]=URL.createObjectURL(new Blob([c3+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));w2.onmessage=function(e3){var err3,d4=e3.data,ed=d4.$e$;if(ed){(err3=new Error(ed[0])).code=ed[1];err3.stack=ed[2];cb2(err3,null)}else cb2(null,d4)};w2.postMessage(msg,transfer);return w2};u8=Uint8Array,u16=Uint16Array,i32=Int32Array;fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]);fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]);clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);freb=function(eb,start){var i2,r4,j2,b3=new u16(31);for(i2=0;i2<31;++i2)b3[i2]=start+=1<>1|(21845&i2)<<1))>>2|(13107&x2)<<2))>>4|(3855&x2)<<4;rev[i2]=((65280&x2)>>8|(255&x2)<<8)>>1}hMap=function(cd2,mb,r4){for(var le,co2,rvb,sv,r_1,v2,m3,s2=cd2.length,i2=0,l2=new u16(mb);i2>rvb]=sv}}else{co2=new u16(s2);for(i2=0;i2>15-cd2[i2])}return co2};flt=new u8(288);for(i2=0;i2<144;++i2)flt[i2]=8;for(i2=144;i2<256;++i2)flt[i2]=9;for(i2=256;i2<280;++i2)flt[i2]=7;for(i2=280;i2<288;++i2)flt[i2]=8;fdt=new u8(32);for(i2=0;i2<32;++i2)fdt[i2]=5;flm=hMap(flt,9,0),flrm=hMap(flt,9,1);fdm=hMap(fdt,5,0),fdrm=hMap(fdt,5,1);max=function(a2){var i2,m3=a2[0];for(i2=1;i2m3&&(m3=a2[i2]);return m3};bits=function(d4,p2,m3){var o2=p2/8|0;return(d4[o2]|d4[o2+1]<<8)>>(7&p2)&m3};bits16=function(d4,p2){var o2=p2/8|0;return(d4[o2]|d4[o2+1]<<8|d4[o2+2]<<16)>>(7&p2)};shft=function(p2){return(p2+7)/8|0};slc=function(v2,s2,e3){(null==s2||s2<0)&&(s2=0);(null==e3||e3>v2.length)&&(e3=v2.length);return new u8(v2.subarray(s2,e3))};ec=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"];err2=function(ind,msg,nt){var e3=new Error(msg||ec[ind]);e3.code=ind;Error.captureStackTrace&&Error.captureStackTrace(e3,err2);if(!nt)throw e3;return e3};inflt=function(dat,st,buf,dict){var noBuf,resize,noSt,cbuf,final,pos,bt2,lm,dm,lbt,dbt,tbts,type,s2,l2,t9,hLit,hcLen,tl,ldt,clt,i2,clb,clbmsk,clm,r4,c3,n3,lt,dt,lms,dms,lpos,sym,add,b3,d4,dsym,end,shift,dend,sl=dat.length,dl=dict?dict.length:0;if(!sl||st.f&&!st.l)return buf||new u8(0);resize=(noBuf=!buf)||2!=st.i;noSt=st.i;noBuf&&(buf=new u8(3*sl));cbuf=function(l3){var nbuf,bl2=buf.length;if(l3>bl2){(nbuf=new u8(Math.max(2*bl2,l3))).set(buf);buf=nbuf}};final=st.f||0,pos=st.p||0,bt2=st.b||0,lm=st.l,dm=st.d,lbt=st.m,dbt=st.n;tbts=8*sl;do{if(!lm){final=bits(dat,pos,1);type=bits(dat,pos+1,3);pos+=3;if(!type){if((t9=(s2=shft(pos)+4)+(l2=dat[s2-4]|dat[s2-3]<<8))>sl){noSt&&err2(0);break}resize&&cbuf(bt2+l2);buf.set(dat.subarray(s2,t9),bt2);st.b=bt2+=l2,st.p=pos=8*t9,st.f=final;continue}if(1==type)lm=flrm,dm=fdrm,lbt=9,dbt=5;else if(2==type){hLit=bits(dat,pos,31)+257,hcLen=bits(dat,pos+10,15)+4;tl=hLit+bits(dat,pos+5,31)+1;pos+=14;ldt=new u8(tl);clt=new u8(19);for(i2=0;i2>4)<16)ldt[i2++]=s2;else{c3=0,n3=0;16==s2?(n3=3+bits(dat,pos,3),pos+=2,c3=ldt[i2-1]):17==s2?(n3=3+bits(dat,pos,7),pos+=3):18==s2&&(n3=11+bits(dat,pos,127),pos+=7);for(;n3--;)ldt[i2++]=c3}}lt=ldt.subarray(0,hLit),dt=ldt.subarray(hLit);lbt=max(lt);dbt=max(dt);lm=hMap(lt,lbt,1);dm=hMap(dt,dbt,1)}else err2(1);if(pos>tbts){noSt&&err2(0);break}}resize&&cbuf(bt2+131072);lms=(1<>4;if((pos+=15&c3)>tbts){noSt&&err2(0);break}c3||err2(2);if(sym<256)buf[bt2++]=sym;else{if(256==sym){lpos=pos,lm=null;break}add=sym-254;if(sym>264){b3=fleb[i2=sym-257];add=bits(dat,pos,(1<>4;d4||err2(3);pos+=15&d4;dt=fd[dsym];if(dsym>3){b3=fdeb[dsym];dt+=bits16(dat,pos)&(1<tbts){noSt&&err2(0);break}resize&&cbuf(bt2+131072);end=bt2+add;if(bt2>8};wbits16=function(d4,p2,v2){v2<<=7&p2;var o2=p2/8|0;d4[o2]|=v2;d4[o2+1]|=v2>>8;d4[o2+2]|=v2>>16};hTree=function(d4,mb){var i2,s2,t22,v2,l2,r4,i0,i1,i22,maxSym,tr,mbt,dt,lft,cst,i2_1,i2_2,i2_3,t9=[];for(i2=0;i2maxSym&&(maxSym=t22[i2].s);tr=new u16(maxSym+1);if((mbt=ln(t9[i1-1],tr,0))>mb){i2=0,dt=0;cst=1<<(lft=mbt-mb);t22.sort(function(a2,b3){return tr[b3.s]-tr[a2.s]||a2.f-b3.f});for(;i2mb))break;dt+=cst-(1<>=lft;for(;dt>0;){i2_2=t22[i2].s;tr[i2_2]=0&&dt;--i2){i2_3=t22[i2].s;if(tr[i2_3]==mb){--tr[i2_3];++dt}}mbt=mb}return{t:new u8(tr),l:mbt}};ln=function(n3,l2,d4){return-1==n3.s?Math.max(ln(n3.l,l2,d4+1),ln(n3.r,l2,d4+1)):l2[n3.s]=d4};lc=function(c3){for(var cl2,cli,cln,cls,w2,i2,s2=c3.length;s2&&!c3[--s2];);cl2=new u16(++s2);cli=0,cln=c3[0],cls=1;w2=function(v2){cl2[cli++]=v2};for(i2=1;i2<=s2;++i2)if(c3[i2]==cln&&i2!=s2)++cls;else{if(!cln&&cls>2){for(;cls>138;cls-=138)w2(32754);if(cls>2){w2(cls>10?cls-11<<5|28690:cls-3<<5|12305);cls=0}}else if(cls>3){w2(cln),--cls;for(;cls>6;cls-=6)w2(8304);cls>2&&(w2(cls-3<<5|8208),cls=0)}for(;cls--;)w2(cln);cls=1;cln=c3[i2]}return{c:cl2.subarray(0,cli),n:s2}};clen=function(cf2,cl2){var i2,l2=0;for(i2=0;i2>8;out[o2+2]=255^out[o2];out[o2+3]=255^out[o2+1];for(i2=0;i24&&!lct[clim[nlcc-1]];--nlcc);flen=bl2+5<<3;ftlen=clen(lf,flt)+clen(df,fdt)+eb;dtlen=clen(lf,dlt)+clen(df,ddt)+eb+14+3*nlcc+clen(lcfreq,lct)+2*lcfreq[16]+3*lcfreq[17]+7*lcfreq[18];if(bs2>=0&&flen<=ftlen&&flen<=dtlen)return wfblk(out,p2,dat.subarray(bs2,bs2+bl2));wbits(out,p2,1+(dtlen15&&(wbits(out,p2,clct[i2]>>5&127),p2+=clct[i2]>>12)}}}else lm=flm,ll=flt,dm=fdm,dl=fdt;for(i2=0;i2255){wbits16(out,p2,lm[257+(len=sym>>18&31)]),p2+=ll[len+257];len>7&&(wbits(out,p2,sym>>23&31),p2+=fleb[len]);wbits16(out,p2,dm[dst=31&sym]),p2+=dl[dst];dst>3&&(wbits16(out,p2,sym>>5&8191),p2+=fdeb[dst])}else wbits16(out,p2,lm[sym]),p2+=ll[sym];wbits16(out,p2,lm[256]);return p2+ll[256]};deo=new i32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]);et=new u8(0);dflt=function(dat,lvl,plvl,pre,post,st){var opt,n3,c3,msk_1,prev,head2,bs1_1,bs2_1,hsh,syms,lf,df,lc_1,eb,i2,li,wi,bs2,hv,imod,pimod,rem,j2,l2,d4,ch_1,dif,maxn,maxd,ml,nl,mmd,md,ti,cd2,lin,din,e3,s2=st.z||dat.length,o2=new u8(pre+s2+5*(1+Math.ceil(s2/7e3))+post),w2=o2.subarray(pre,o2.length-post),lst=st.l,pos=7&(st.r||0);if(lvl){pos&&(w2[0]=st.r>>3);n3=(opt=deo[lvl-1])>>13,c3=8191&opt;msk_1=(1<7e3||li>24576)&&(rem>423||!lst)){pos=wblk(dat,w2,0,syms,lf,df,eb,li,bs2,i2-bs2,pos);li=lc_1=eb=0,bs2=i2;for(j2=0;j2<286;++j2)lf[j2]=0;for(j2=0;j2<30;++j2)df[j2]=0}l2=2,d4=0,ch_1=c3,dif=imod-pimod&32767;if(rem>2&&hv==hsh(i2-dif)){maxn=Math.min(n3,rem)-1;maxd=Math.min(32767,i2);ml=Math.min(258,rem);for(;dif<=maxd&&--ch_1&&imod!=pimod;){if(dat[i2+l2]==dat[i2+l2-dif]){nl=0;for(;nll2){l2=nl,d4=dif;if(nl>maxn)break;mmd=Math.min(dif,nl-2);md=0;for(j2=0;j2md&&(md=cd2,pimod=ti)}}dif+=(imod=pimod)-(pimod=prev[imod])&32767}}if(d4){syms[li++]=268435456|revfl[l2]<<18|revfd[d4];lin=31&revfl[l2],din=31&revfd[d4];eb+=fleb[lin]+fdeb[din];++lf[257+lin];++df[din];wi=i2+l2;++lc_1}else{syms[li++]=dat[i2];++lf[dat[i2]]}}}for(i2=Math.max(i2,wi);i2=s2){w2[pos/8|0]=lst;e3=s2}pos=wfblk(w2,pos+1,dat.subarray(i2,e3))}st.i=s2}return slc(o2,0,pre+shft(pos)+post)};0;0;dopt=function(dat,opt,pre,post,st){var dict,newDat;if(!st){st={l:1};if(opt.dictionary){dict=opt.dictionary.subarray(-32768);(newDat=new u8(dict.length+dat.length)).set(dict);newDat.set(dat,dict.length);dat=newDat;st.w=dict.length}}return dflt(dat,null==opt.level?6:opt.level,null==opt.mem?st.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(dat.length)))):20:12+opt.mem,pre,post,st)};mrg=function(a2,b3){var k2,o2={};for(k2 in a2)o2[k2]=a2[k2];for(k2 in b3)o2[k2]=b3[k2];return o2};wcln=function(fn,fnStr,td3){var i2,v2,k2,st_1,spInd,t9,dt=fn(),st=fn.toString(),ks=st.slice(st.indexOf("[")+1,st.lastIndexOf("]")).replace(/\s+/g,"").split(",");for(i2=0;i2{db.transform({incoming:async doc=>compress?await compressDoc(doc):doc,outgoing:async doc=>await decompressDoc(doc)})};MARK_SHIFT_COMPRESSED="LZ";CheckPointInfoDefault={lastLocalSeq:0,journalEpoch:"",knownIDs:new Set,sentIDs:new Set,receivedFiles:new Set,sentFiles:new Set};DatabaseReadLayer=class{constructor(database){this.database=database}isChunkDoc(doc){return doc&&"string"==typeof doc._id&&"leaf"===doc.type}getError(error){return error instanceof Error?error:"error"in error&&error.error instanceof Error?error.error:void 0}isMissingError(error){return"status"in error&&404===error.status||"error"in error&&"not_found"===error.error||"error"in error&&this.isMissingError(error.error)}async read(ids,options,next2){if(0===ids.length)return[];const resultMap=new Map,remainingIds=[];try{const results=await this.database.allDocs({keys:ids,include_docs:!0});for(const row of results.rows)if("doc"in row&&row.doc&&this.isChunkDoc(row.doc)){const chunk=row.doc;resultMap.set(chunk._id,chunk)}else{if(!this.isMissingError(row))throw new LiveSyncError(`Failed to read chunk ${row.key}`,{status:404,cause:this.getError(row)});{const idFromRow="string"==typeof row.key?row.key:void 0;idFromRow&&remainingIds.push(idFromRow)}}}catch(error){if(error instanceof LiveSyncError)throw error;Logger(`Database read error: ${error}`,LOG_LEVEL_VERBOSE);return ids.map(()=>!1)}if(0===remainingIds.length)return ids.map(id=>{var _a8;return null!=(_a8=resultMap.get(id))&&_a8});const nextResults=await next2(remainingIds),nextResultMap=new Map(remainingIds.map((id,index6)=>[id,nextResults[index6]]));return[...ids.map(id=>{var _a8,_b5;return null!=(_b5=null!=(_a8=resultMap.get(id))?_a8:nextResultMap.get(id))&&_b5})]}};CacheLayer=class{constructor(maxCacheSize){this.caches=new Map;this.allocCount=0;this.derefCount=0;this.maxCacheSize=maxCacheSize}getCachedChunk(id){if(!this.caches.has(id))return!1;const weakRef=this.caches.get(id);if(weakRef){const cachedChunk=weakRef.deref();if(cachedChunk)return cachedChunk;this.derefCount++;this.deleteCachedChunk(id);return!1}return!1}getChunkIDFromCache(data){for(const[id,weakRef]of this.caches){const chunk=weakRef.deref();if(chunk){if(chunk.data===data)return id}else{this.derefCount++;this.deleteCachedChunk(id)}}return!1}cacheChunk(chunk){if(this.getCachedChunk(chunk._id))this.reorderChunk(chunk._id);else{this.caches.set(chunk._id,new FallbackWeakRef(chunk));this.allocCount++;if(this.caches.size>this.maxCacheSize)do{const firstKey=this.caches.keys().next().value;firstKey&&this.caches.delete(firstKey)}while(this.caches.size>this.maxCacheSize)}}reorderChunk(id){const chunk=this.getCachedChunk(id);if(chunk){this.caches.delete(id);this.caches.set(id,new FallbackWeakRef(chunk))}}deleteCachedChunk(id){this.caches.has(id)&&this.caches.delete(id)}clearCaches(){this.caches.clear();this.allocCount=0;this.derefCount=0}tearDown(){this.clearCaches()}getStatistics(){return{size:this.caches.size,allocCount:this.allocCount,derefCount:this.derefCount}}async read(ids,options,next2){if(options.skipCache)return next2(ids);const resultMap=new Map,remainingIds=[];for(const id of ids){const cached=this.getCachedChunk(id);if(cached){this.reorderChunk(id);resultMap.set(id,cached)}else remainingIds.push(id)}if(0===remainingIds.length)return ids.map(id=>resultMap.get(id)||!1);const nextResults=await next2(remainingIds),nextResultMap=new Map(remainingIds.map((id,index6)=>[id,nextResults[index6]]));return ids.map(id=>{var _a8,_b5;return null!=(_b5=null!=(_a8=resultMap.get(id))?_a8:nextResultMap.get(id))&&_b5})}async write(chunks,options,origin2,next2){const filtered=[],cachedCount=chunks.length;for(const chunk of chunks)this.getCachedChunk(chunk._id)?this.reorderChunk(chunk._id):filtered.push(chunk);const result=await next2(filtered);if(result.result&&!options.skipCache)for(const chunk of chunks)this.cacheChunk(chunk);result.processed&&(result.processed.cached=cachedCount-filtered.length);return result}};ArrivalWaitLayer=class{constructor(eventEmitter2){this.waitingMap=new Map;this.DEFAULT_TIMEOUT=15e3;this.eventEmitter=eventEmitter2}enqueueWaiting(id,timeout){const previous=this.waitingMap.get(id);if(previous)return previous.resolver.promise;const resolver2=promiseWithResolvers();this.waitingMap.set(id,{resolver:resolver2});return this.withTimeout(resolver2.promise,timeout,()=>{const current=this.waitingMap.get(id);current&¤t.resolver===resolver2&&this.waitingMap.delete(id);return!1})}withTimeout(proc,timeout,onTimedOut){return new Promise((resolve,reject)=>{const timer=setTimeout(()=>{resolve(onTimedOut())},timeout);proc.then(resolve).catch(reject).finally(()=>{clearTimeout(timer)})})}onChunkArrived(doc,deleted=!1){const id=doc._id;if(this.waitingMap.has(id)){const queue2=this.waitingMap.get(id);this.waitingMap.delete(id);doc._deleted||deleted?queue2.resolver.resolve(!1):queue2.resolver.resolve(doc)}}onMissingChunk(id){if(this.waitingMap.has(id)){const queue2=this.waitingMap.get(id);this.waitingMap.delete(id);queue2.resolver.resolve(!1)}}async read(ids,options,next2){var _a8;const timeout=null!=(_a8=options.timeout)?_a8:this.DEFAULT_TIMEOUT;if(timeout<=0||0===ids.length)return ids.map(()=>!1);const tasks3=ids.map(id=>this.enqueueWaiting(id,timeout));options.preventRemoteRequest||this.eventEmitter("missingChunks",ids);return await Promise.all(tasks3)}clearWaiting(){for(const[,queue2]of this.waitingMap.entries())queue2.resolver.resolve(!1);this.waitingMap.clear()}tearDown(){this.clearWaiting()}getWaitingCount(){return this.waitingMap.size}};DatabaseWriteLayer=class{constructor(database){this.database=database}async write(chunks,options=void 0,origin2,next2){if(0===chunks.length)return next2([]);try{const result=await this.database.bulkDocs(chunks,{new_edits:!(null==options?void 0:options.force)}),failed2=result.filter(res2=>"error"in res2);if(failed2.some(res2=>409!==res2.status))throw new LiveSyncError(`Failed to write chunks: ${failed2.map(res2=>res2.error).join(", ")}`,{status:500});const conflictedChunkIDs=failed2.filter(res2=>"string"==typeof res2.id).map(res2=>res2.id),nextResult=await next2(chunks),writeResult={result:!0,processed:{cached:nextResult.processed.cached,hotPack:nextResult.processed.hotPack,written:result.length-failed2.length,duplicated:conflictedChunkIDs.length}};conflictedChunkIDs.length;return writeResult}catch(error){if(error instanceof LiveSyncError)throw error;throw new LiveSyncError(`Database write layer error: ${error}`,{status:500,cause:error})}}};LayeredChunkManager=class{constructor(options){this.eventTarget=new EventTarget;this.abort=new AbortController;this.initialised=Promise.resolve();this.onChunkArrivedHandler=this.onChunkArrived.bind(this);this.onChangeHandler=this.onChange.bind(this);this.onMissingChunkRemoteHandler=this.onMissingChunkRemote.bind(this);this.concurrentTransactions=0;this.stabilised=Promise.resolve();this.options=options;const maxCacheSize=10*options.settingService.currentSettings().hashCacheMaxCount;this.cacheLayer=new CacheLayer(maxCacheSize);this.arrivalWaitLayer=new ArrivalWaitLayer((eventName,data)=>{"missingChunks"===eventName&&this.emitEvent(EVENT_MISSING_CHUNKS,data)});this.readLayers=[this.cacheLayer,new DatabaseReadLayer(this.database),this.arrivalWaitLayer];this.writeLayers=[new DatabaseWriteLayer(this.database),this.cacheLayer];this.offChangeHandler=this.changeManager.addCallback(this.onChangeHandler);this.addListener(EVENT_CHUNK_FETCHED,this.onChunkArrivedHandler,{signal:this.abort.signal});this.addListener(EVENT_MISSING_CHUNK_REMOTE,this.onMissingChunkRemoteHandler,{signal:this.abort.signal});this.initialised=this._initialise()}get changeManager(){return this.options.changeManager}get database(){return this.options.database}get cacheStatistics(){return this.cacheLayer.getStatistics()}addListener(type,listener,options){const callback=ev=>{listener.call(this,ev.detail)};this.eventTarget.addEventListener(type,callback,options);return()=>{this.eventTarget.removeEventListener(type,callback,options)}}emitEvent(type,detail){const event2=new CustomEvent(type,{detail});this.eventTarget.dispatchEvent(event2)}async _initialise(){Logger("ChunkManager initialised",LOG_LEVEL_VERBOSE);return await Promise.resolve()}destroy(){const layers=unique([...this.readLayers,...this.writeLayers]);this.abort.abort();this.offChangeHandler();for(const layer of layers)layer.tearDown&&layer.tearDown()}getCachedChunk(id){return this.cacheLayer.getCachedChunk(id)}getChunkIDFromCache(data){return this.cacheLayer.getChunkIDFromCache(data)}cacheChunk(chunk){this.cacheLayer.cacheChunk(chunk)}clearCaches(){this.cacheLayer.clearCaches()}async read(ids,options,preloadedChunks){const order=[...ids],resultMap=new Map(ids.map(id=>[id,!1])),readIds=new Set([...resultMap.keys()]);if(preloadedChunks)for(const[id,chunk]of Object.entries(preloadedChunks))if(this.isChunkDoc(chunk)){this.cacheLayer.cacheChunk(chunk);resultMap.set(id,chunk);readIds.delete(id)}const results=await this.executeReadPipeline([...readIds],options);for(let i2=0;i2resultMap.get(id)||!1)}executeReadPipeline(ids,options){let layerIndex=0;const layers=this.readLayers,executeNextLayer=remaining=>{if(layerIndex>=layers.length)return Promise.resolve(remaining.map(()=>!1));const layer=layers[layerIndex];layerIndex++;return layer.read(remaining,options,executeNextLayer)};return executeNextLayer(ids)}async write(chunks,options,origin2){return await this.executeWritePipeline(chunks,options,origin2)}executeWritePipeline(chunks,options,origin2){let layerIndex=0;const layers=this.writeLayers,executeNextLayer=remaining=>{if(layerIndex>=layers.length)return Promise.resolve({result:!0,processed:{cached:0,hotPack:0,written:0,duplicated:0}});const layer=layers[layerIndex];layerIndex++;return layer.write(remaining,options,origin2,executeNextLayer)};return executeNextLayer(chunks)}isChunkDoc(doc){return doc&&"string"==typeof doc._id&&"leaf"===doc.type}onChunkArrived(doc,deleted=!1){this.arrivalWaitLayer.onChunkArrived(doc,deleted)}onChange(change){const doc=change.doc;doc&&doc._id&&"leaf"===doc.type&&this.onChunkArrived(doc,change.deleted)}onMissingChunkRemote(id){this.arrivalWaitLayer.onMissingChunk(id)}async transaction(callback){await this.initialised;await this.stabilised;this.concurrentTransactions++;try{return await callback()}finally{this.concurrentTransactions--;if(0===this.concurrentTransactions){Logger("All transactions completed. Performing stabilisation.",LOG_LEVEL_VERBOSE);await this._stabilise()}else Logger(`Transaction completed. Remaining: ${this.concurrentTransactions}`,LOG_LEVEL_VERBOSE)}}async _stabilise(){const pr=promiseWithResolvers();this.stabilised=pr.promise;try{await this.__stabilise()}finally{pr.resolve()}}__stabilise(){return Promise.resolve()}};EVENT_MISSING_CHUNKS="missingChunks";EVENT_MISSING_CHUNK_REMOTE="missingChunkRemote";EVENT_CHUNK_FETCHED="chunkFetched";ChunkFetcher=class{constructor(options){this.queue=[];this.abort=new AbortController;this.onEventHandler=this.onEvent.bind(this);this.currentProcessing=0;this.previousRequestTime=0;this.options=options;this.chunkManager.addListener(EVENT_MISSING_CHUNKS,this.onEventHandler,{signal:this.abort.signal})}get chunkManager(){return this.options.chunkManager}get interval(){return this.options.settingService.currentSettings().minimumIntervalOfReadChunksOnline||DEFAULT_SETTINGS.minimumIntervalOfReadChunksOnline}get concurrency(){return this.options.settingService.currentSettings().concurrencyOfReadChunksOnline||DEFAULT_SETTINGS.concurrencyOfReadChunksOnline}destroy(){this.abort.abort();this.queue=[]}onEvent(ids){this.queue=unique([...this.queue,...ids]);this.canRequestMore()&&setTimeout(()=>{this.requestMissingChunks()},1)}canRequestMore(){return this.currentProcessing0}async requestMissingChunks(){if(this.canRequestMore())try{let isValidChunk2=function(chunk){return chunk&&"string"==typeof(null==chunk?void 0:chunk._id)&&"string"==typeof(null==chunk?void 0:chunk.data)};this.currentProcessing++;const requestIDs=this.queue.splice(0,100),now3=Date.now(),timeSinceLastRequest=now3-this.previousRequestTime;this.previousRequestTime=now3;const timeToWait=Math.max(this.interval-timeSinceLastRequest,0);timeToWait>0&&await delay(timeToWait);const replicator=this.options.replicatorService.getActiveReplicator();if(!replicator){Logger("No active replicator was found to request missing chunks.");return}const fetched=await replicator.fetchRemoteChunks(requestIDs,!1);if(!fetched){Logger(`No chunks were found for the following IDs: ${requestIDs.join(", ")}`);for(const chunkID of requestIDs)this.chunkManager.emitEvent(EVENT_MISSING_CHUNK_REMOTE,chunkID);return}const chunks=fetched.filter(chunk=>isValidChunk2(chunk));if(chunks.length!==fetched.length){Logger(`Some fetched chunks are invalid and will be ignored: (${fetched.length-chunks.length} / ${fetched.length}).`,LOG_LEVEL_VERBOSE);for(const chunk of fetched)isValidChunk2(chunk)||Logger(`Invalid chunk: ${JSON.stringify(chunk)}`,LOG_LEVEL_VERBOSE)}0===chunks.length&&Logger(`No valid chunks were found for the following IDs: ${requestIDs.join(", ")}`);const missingIDs=requestIDs.filter(id=>!chunks.some(chunk=>chunk._id===id));try{if(0===chunks.length)return;Logger(`Writing fetched chunks (${chunks.length}) to the database...`);!0===(await this.chunkManager.write(chunks,{skipCache:!0,force:!0},"ChunkFetcher")).result?Logger(`Fetched chunks were stored successfully: ${chunks.length}`,LOG_LEVEL_VERBOSE):Logger(`Fetched chunks could not be stored: ${chunks.map(chunk=>chunk._id).join(", ")}`,LOG_LEVEL_VERBOSE)}catch(error){Logger(`An error occurred while storing fetched chunks: ${error}`,LOG_LEVEL_VERBOSE)}finally{for(const chunk of chunks)this.chunkManager.emitEvent(EVENT_CHUNK_FETCHED,chunk);for(const chunkID of missingIDs)this.chunkManager.emitEvent(EVENT_MISSING_CHUNK_REMOTE,chunkID)}}finally{this.currentProcessing--;this.previousRequestTime=Date.now();this.queue.length>0&&setTimeout(()=>{this.requestMissingChunks()},0)}}};ContentSplitterCore=class{constructor(params){this.options=params;this.initialised=this.initialise(params)}};ContentSplitterBase=class extends ContentSplitterCore{initialise(_options3){this.options=_options3;return Promise.resolve(!0)}static isAvailableFor(setting){return!1}getParamsFor(entry){const settings=this.options.settingService.currentSettings(),pieceSize=Math.floor(102400*(1*(settings.customChunkSize||0)+1)),minimumChunkSize=settings.minimumChunkSize,path2=entry.path,plainSplit=shouldSplitAsPlainText(path2),blob=entry.data instanceof Blob?entry.data:createTextBlob(entry.data);let useWorker=!0;settings.disableWorkerForGeneratingChunks&&(useWorker=!1);useWorker&&settings.processSmallFilesInUIThread&&blob.size<=1024&&(useWorker=!1);return{blob,path:path2,pieceSize,plainSplit,minimumChunkSize,useWorker,useSegmenter:"v2-segmenter"===settings.chunkSplitterVersion}}async splitContent(entry){await this.initialised;const options=this.getParamsFor(entry);return await this.processSplit(options)}};charNewLine="\n".charCodeAt(0);segmenter="Segmenter"in Intl?function wrapByDefault(func,onError){try{return func()}catch(ex){return onError(ex)}}(()=>new Intl.Segmenter(navigator.language,{granularity:"sentence"}),err3=>{Logger(`Failed to create Intl.Segmenter: ${err3.message}`,LOG_LEVEL_VERBOSE)}):void 0;MAX_ITEMS=100;ContentSplitterRabinKarp=class extends ContentSplitterBase{static isAvailableFor(setting){return"v3-rabin-karp"===setting.settingService.currentSettings().chunkSplitterVersion}async processSplit(options){return options.useWorker?splitPieces2WorkerRabinKarp(options.blob,options.pieceSize,options.plainSplit,options.minimumChunkSize,options.path)():(await splitPiecesRabinKarp(options.blob,options.pieceSize,options.plainSplit,options.minimumChunkSize,options.path))()}};ContentSplitters=[class extends ContentSplitterBase{static isAvailableFor(setting){const settings=setting.settingService.currentSettings();return"v1"===settings.chunkSplitterVersion||""===settings.chunkSplitterVersion||void 0===settings.chunkSplitterVersion}async processSplit(options){return options.useWorker?splitPieces2Worker(options.blob,options.pieceSize,options.plainSplit,options.minimumChunkSize,options.path,options.useSegmenter)():(await splitPieces2(options.blob,options.pieceSize,options.plainSplit,options.minimumChunkSize,options.path,options.useSegmenter))()}},class extends ContentSplitterBase{static isAvailableFor(setting){const settings=setting.settingService.currentSettings();return"v2"===settings.chunkSplitterVersion||"v2-segmenter"===settings.chunkSplitterVersion}async processSplit(options){return options.useWorker?splitPieces2WorkerV2(options.blob,options.pieceSize,options.plainSplit,options.minimumChunkSize,options.path,options.useSegmenter)():(await splitPieces2V2(options.blob,options.pieceSize,options.plainSplit,options.minimumChunkSize,options.path,options.useSegmenter))()}},ContentSplitterRabinKarp];ContentSplitter=class extends ContentSplitterCore{constructor(options){super(options)}initialise(options){for(const Splitter of ContentSplitters)if(Splitter.isAvailableFor(options)){this._activeSplitter=new Splitter(options);break}if(!this._activeSplitter)throw new Error("ContentSplitter: No available splitter for settings!!");return this._activeSplitter.initialise(options)}async splitContent(entry){await this.initialised;return this._activeSplitter.splitContent(entry)}};ChangeManager=class{constructor(options){this._callbacks=[];this._database=options.database;this.setupListener()}addCallback(callback){const callbackHandler=new FallbackWeakRef(callback);this._callbacks.push(callbackHandler);return()=>{this._callbacks=this._callbacks.filter(cb2=>cb2!==callbackHandler)}}removeCallback(callback){this._callbacks=this._callbacks.filter(cb2=>cb2.deref()!==callback)}async _onChange(changeResponse){var _a8;if(this._callbacks.length){this._callbacks=this._callbacks.filter(callback=>void 0!==callback.deref());for(const callback of this._callbacks)try{const cb2=callback.deref();if(!cb2)continue;await Promise.resolve(cb2(changeResponse))}catch(err3){null==(_a8=this._changes)||_a8.emit("error",err3)}}}setupListener(){if(this._changes){const changes4=this._changes;this._changes=void 0;changes4.removeAllListeners();changes4.cancel()}const changes3=this._database.changes({since:"now",live:!0,include_docs:!0});changes3.on("change",change=>{this._onChange(change)});changes3.on("error",err3=>{Logger("ChangeManager Error watching changes");Logger(err3,LOG_LEVEL_VERBOSE)});this._changes=changes3}teardown(){var _a8,_b5;null==(_a8=this._changes)||_a8.removeAllListeners();null==(_b5=this._changes)||_b5.cancel();this._changes=void 0}restartWatch(){this.teardown();this.setupListener()}};import_diff_match_patch3=__toESM(require_diff_match_patch(),1);ConflictManager=class{constructor(options){this.options=options}get database(){return this.options.database}async getConflictedDoc(path2,rev3){try{const doc=await this.options.entryManager.getDBEntry(path2,{rev:rev3},!1,!0,!0);if(!1===doc)return!1;let data=getDocData(doc.data);"newnote"==doc.datatype?data=readString(new Uint8Array(decodeBinary(doc.data))):doc.datatype;return{deleted:doc.deleted||doc._deleted,ctime:doc.ctime,mtime:doc.mtime,rev:rev3,data}}catch(ex){if(isErrorOfMissingDoc(ex))return!1}return!1}async mergeSensibly(path2,baseRev,currentRev,conflictedRev){function splitDiffPiece(src){const ret=[];do{const d4=src.shift();if(void 0===d4)return ret;const pieces=d4[1].split(/([^\n]*\n)/).filter(f4=>""!=f4);if(void 0===d4)break;d4[0]!=import_diff_match_patch3.DIFF_DELETE&&ret.push(...pieces.map(e3=>[d4[0],e3]));if(d4[0]==import_diff_match_patch3.DIFF_DELETE){const nd=src.shift();if(void 0!==nd){const piecesPair=nd[1].split(/([^\n]*\n)/).filter(f4=>""!=f4);if(nd[0]==import_diff_match_patch3.DIFF_INSERT){for(const pt of pieces){ret.push([d4[0],pt]);const pairP=piecesPair.shift();void 0!==pairP&&ret.push([import_diff_match_patch3.DIFF_INSERT,pairP])}ret.push(...piecesPair.map(e3=>[nd[0],e3]))}else{ret.push(...pieces.map(e3=>[d4[0],e3]));ret.push(...piecesPair.map(e3=>[nd[0],e3]))}}else ret.push(...pieces.map(e3=>[0,e3]))}}while(src.length>0);return ret}var _a8,_b5,_c3,_d2;const baseLeaf=await this.getConflictedDoc(path2,baseRev),leftLeaf=await this.getConflictedDoc(path2,currentRev),rightLeaf=await this.getConflictedDoc(path2,conflictedRev);let autoMerge=!1;if(0==baseLeaf||0==leftLeaf||0==rightLeaf)return!1;if(leftLeaf.deleted&&rightLeaf.deleted)return!1;const dmp=new import_diff_match_patch3.diff_match_patch,mapLeft=dmp.diff_linesToChars_(baseLeaf.data,leftLeaf.data),diffLeftSrc=dmp.diff_main(mapLeft.chars1,mapLeft.chars2,!1);dmp.diff_charsToLines_(diffLeftSrc,mapLeft.lineArray);const mapRight=dmp.diff_linesToChars_(baseLeaf.data,rightLeaf.data),diffRightSrc=dmp.diff_main(mapRight.chars1,mapRight.chars2,!1);dmp.diff_charsToLines_(diffRightSrc,mapRight.lineArray);const diffLeft=splitDiffPiece(diffLeftSrc),diffRight=splitDiffPiece(diffRightSrc);let rightIdx=0,leftIdx=0;const merged=[];autoMerge=!0;LOOP_MERGE:do{if(leftIdx>=diffLeft.length&&rightIdx>=diffRight.length)break LOOP_MERGE;const leftItem=null!=(_a8=diffLeft[leftIdx])?_a8:[0,""],rightItem=null!=(_b5=diffRight[rightIdx])?_b5:[0,""];leftIdx++;rightIdx++;if(leftItem[0]!=import_diff_match_patch3.DIFF_EQUAL||rightItem[0]!=import_diff_match_patch3.DIFF_EQUAL||leftItem[1]!=rightItem[1]){if(leftItem[0]==import_diff_match_patch3.DIFF_DELETE&&rightItem[0]==import_diff_match_patch3.DIFF_DELETE&&leftItem[1]==rightItem[1]){const nextLeftIdx=leftIdx,nextRightIdx=rightIdx,[nextLeftItem,nextRightItem]=[null!=(_c3=diffLeft[nextLeftIdx])?_c3:[0,""],null!=(_d2=diffRight[nextRightIdx])?_d2:[0,""]];if(nextLeftItem[0]==import_diff_match_patch3.DIFF_INSERT&&nextRightItem[0]==import_diff_match_patch3.DIFF_INSERT&&nextLeftItem[1]!=nextRightItem[1]){autoMerge=!1;break}merged.push(leftItem);continue}if(leftItem[0]!=import_diff_match_patch3.DIFF_INSERT||rightItem[0]!=import_diff_match_patch3.DIFF_INSERT)if(leftItem[0]!=import_diff_match_patch3.DIFF_INSERT){if(rightItem[0]!=import_diff_match_patch3.DIFF_INSERT){if(rightItem[1]!=leftItem[1]){Logger(`MERGING PANIC:${leftItem[0]},${leftItem[1]} == ${rightItem[0]},${rightItem[1]}`,LOG_LEVEL_VERBOSE);autoMerge=!1;break LOOP_MERGE}if(leftItem[0]==import_diff_match_patch3.DIFF_DELETE){if(rightItem[0]==import_diff_match_patch3.DIFF_EQUAL){merged.push(leftItem);continue}autoMerge=!1;break LOOP_MERGE}if(rightItem[0]==import_diff_match_patch3.DIFF_DELETE){if(leftItem[0]==import_diff_match_patch3.DIFF_EQUAL){merged.push(rightItem);continue}autoMerge=!1;break LOOP_MERGE}Logger(`Weird condition:${leftItem[0]},${leftItem[1]} == ${rightItem[0]},${rightItem[1]}`,LOG_LEVEL_VERBOSE);break LOOP_MERGE}leftIdx--;merged.push(rightItem)}else{rightIdx--;merged.push(leftItem)}else{if(leftItem[1]==rightItem[1]){merged.push(leftItem);continue}if(leftLeaf.mtime<=rightLeaf.mtime){merged.push(leftItem);merged.push(rightItem);continue}merged.push(rightItem);merged.push(leftItem)}}else merged.push(leftItem)}while(leftIdxa2.mtime-b3.mtime);let newObj={...baseObj};for(const patch of patches)newObj=applyPatch(newObj,patch.patch);Logger("Object merge is applicable!",LOG_LEVEL_VERBOSE);return JSON.stringify(newObj.data)}catch(ex){Logger("Could not merge object");Logger(ex,LOG_LEVEL_VERBOSE);return!1}}async tryAutoMergeSensibly(path2,test,conflicts){var _a8,_b5,_c3;const conflictedRev=conflicts[0],conflictedRevNo=Number(conflictedRev.split("-")[0]),commonBase=null!=(_c3=null==(_b5=null==(_a8=((await this.database.get(await this.options.pathService.path2id(path2),{revs_info:!0}))._revs_info||[]).filter(e3=>"available"==e3.status&&Number(e3.rev.split("-")[0])e3[0]!=import_diff_match_patch3.DIFF_DELETE).map(e3=>e3[1]).join("");Logger(`Sensible merge:${path2}`,LOG_LEVEL_INFO)}else Logger("Sensible merge is not applicable.",LOG_LEVEL_VERBOSE)}else if(isObjectMargeApplicable(path2)){const result=await this.mergeObject(path2,commonBase,test._rev,conflictedRev);if(result){Logger(`Object merge:${path2}`,LOG_LEVEL_INFO);p2=result}else Logger("Object merge is not applicable..",LOG_LEVEL_VERBOSE)}if(void 0!==p2)return{result:p2,conflictedRev}}return!1}async tryAutoMerge(path2,enableMarkdownAutoMerge){const test=await this.options.entryManager.getDBEntry(path2,{conflicts:!0,revs_info:!0},!1,!1,!0);if(!1===test)return{ok:MISSING_OR_ERROR};if(null==test)return{ok:MISSING_OR_ERROR};if(!test._conflicts)return{ok:NOT_CONFLICTED};if(0==test._conflicts.length)return{ok:NOT_CONFLICTED};const conflicts=test._conflicts.sort((a2,b3)=>Number(a2.split("-")[0])-Number(b3.split("-")[0]));if((isSensibleMargeApplicable(path2)||isObjectMargeApplicable(path2))&&enableMarkdownAutoMerge){const autoMergeResult=await this.tryAutoMergeSensibly(path2,test,conflicts);if(!1!==autoMergeResult)return autoMergeResult}const leftLeaf=await this.getConflictedDoc(path2,test._rev),rightLeaf=await this.getConflictedDoc(path2,conflicts[0]);return{leftRev:test._rev,rightRev:conflicts[0],leftLeaf,rightLeaf}}};EntryManager=class{constructor(options){this.options=options}get localDatabase(){return this.options.database}get hashManager(){return this.options.hashManager}get chunkManager(){return this.options.chunkManager}get splitter(){return this.options.splitter}get serviceHost(){return{services:{setting:this.options.settingService,path:this.options.pathService},serviceModules:{}}}get isOnDemandChunkEnabled(){const settings=this.options.settingService.currentSettings();return settings.remoteType===REMOTE_COUCHDB&&!settings.useOnlyLocalChunk}isTargetFile(filenameSrc){return isTargetFile(this.serviceHost,filenameSrc)}async prepareChunk(piece){return await prepareChunk(this,piece)}async getDBEntryMeta(path2,opt,includeDeleted=!1){return await getDBEntryMetaByPath(this.serviceHost,this,path2,opt,includeDeleted)}async getDBEntry(path2,opt,dump=!1,waitForReady=!0,includeDeleted=!1){return await getDBEntryByPath(this.serviceHost,this,path2,opt,dump,waitForReady,includeDeleted)}async getDBEntryFromMeta(meta,dump=!1,waitForReady=!0){return await getDBEntryFromMeta(this.serviceHost,this,meta,dump,waitForReady)}async deleteDBEntry(path2,opt){return await deleteDBEntryByPath(this.serviceHost,this,path2,opt)}async putDBEntry(note,onlyChunks){return await putDBEntry(this.serviceHost,this,note,onlyChunks)}};HashManagerCore=class{constructor(options){this.useEncryption=!1;this.hashedPassphrase="";this.hashedPassphrase32=0;this.options=options;this.settingService=options.settingService;this.applyOptions(options)}applyOptions(options){var _a8;options&&(this.options=options);const settings=this.options.settingService.currentSettings();this.useEncryption=null!=(_a8=settings.encrypt)&&_a8;const passphrase=settings.passphrase||"",usingLetters=~~(passphrase.length/4*3),passphraseForHash="a83hrf7fy7sa8g31"+passphrase.substring(0,usingLetters);this.hashedPassphrase=fallbackMixedHashEach(passphraseForHash);this.hashedPassphrase32=mixedHash(passphraseForHash,305419896)[0]}initialise(){if(this.initialiseTask)return this.initialiseTask;this.initialiseTask=this.processInitialise();return this.initialiseTask}async computeHash(piece){return this.useEncryption?"+"+await this.computeHashWithEncryption(piece):await this.computeHashWithoutEncryption(piece)}static isAvailableFor(hashAlg){return!1}};XXHashHashManager=class extends HashManagerCore{constructor(options){super(options)}async processInitialise(){this.xxhash=await e();return!0}};XXHash32RawHashManager=class extends XXHashHashManager{static isAvailableFor(hashAlg){return""===hashAlg}computeHashWithEncryption(piece){return Promise.resolve((this.xxhash.h32Raw((new TextEncoder).encode(piece))^this.hashedPassphrase32^piece.length).toString(36))}computeHashWithoutEncryption(piece){return Promise.resolve((this.xxhash.h32Raw((new TextEncoder).encode(piece))^piece.length).toString(36))}};XXHash64HashManager=class extends XXHashHashManager{static isAvailableFor(hashAlg){return"xxhash64"===hashAlg}computeHashWithEncryption(piece){return Promise.resolve(this.xxhash.h64(`${piece}-${this.hashedPassphrase}-${piece.length}`).toString(36))}computeHashWithoutEncryption(piece){return Promise.resolve(this.xxhash.h64(`${piece}-${piece.length}`).toString(36))}};FallbackWasmHashManager=class extends XXHashHashManager{static isAvailableFor(hashAlg){return!0}computeHashWithEncryption(piece){return Promise.resolve(this.xxhash.h32(`${piece}-${this.hashedPassphrase}-${piece.length}`).toString(36))}computeHashWithoutEncryption(piece){return Promise.resolve(this.xxhash.h32(`${piece}-${piece.length}`).toString(36))}};PureJSHashManager=class extends HashManagerCore{static isAvailableFor(hashAlg){return"mixed-purejs"===hashAlg}processInitialise(){return Promise.resolve(!0)}computeHashWithEncryption(input){return Promise.resolve(fallbackMixedHashEach(`${input}${this.hashedPassphrase}${input.length}`))}computeHashWithoutEncryption(input){return Promise.resolve(fallbackMixedHashEach(`${input}-${input.length}`))}};HashManagers=[XXHash64HashManager,XXHash32RawHashManager,class extends HashManagerCore{static isAvailableFor(hashAlg){return"sha1"===hashAlg}processInitialise(){return Promise.resolve(!0)}computeHashWithEncryption(input){return sha12(`${input}-${this.hashedPassphrase}-${input.length}`)}computeHashWithoutEncryption(input){return sha12(`${input}-${input.length}`)}},PureJSHashManager,FallbackWasmHashManager,class extends PureJSHashManager{static isAvailableFor(_hashAlg){return!0}}];HashManager=class extends HashManagerCore{constructor(options){super(options);this.manager=void 0}static isAvailableFor(hashAlg){return HashManagers.some(manager=>manager.isAvailableFor(hashAlg))}async setManager(){const settings=this.options.settingService.currentSettings();for(const Manager of HashManagers)if(Manager.isAvailableFor(settings.hashAlg)){this.manager=new Manager(this.options);return await this.manager.initialise()}throw new Error(`HashManager for ${settings.hashAlg} is not available`)}async processInitialise(){const settings=this.options.settingService.currentSettings();if(await this.setManager()){Logger(`HashManager for ${settings.hashAlg} has been initialised`,LOG_LEVEL_VERBOSE);return!0}Logger(`HashManager for ${settings.hashAlg} failed to initialise`);throw new Error(`HashManager for ${settings.hashAlg} failed to initialise`)}async computeHash(piece){return await this.manager.computeHash(piece)}computeHashWithoutEncryption(piece){return this.manager.computeHashWithoutEncryption(piece)}computeHashWithEncryption(piece){return this.manager.computeHashWithEncryption(piece)}};LiveSyncManagers=class{constructor(options){this.options=options;this._APIService=options.APIService;this._pathService=options.pathService;this._replicatorService=options.replicatorService;this._settingService=options.settingService;this.log=createInstanceLogFunction("LiveSyncManagers",this._APIService);const{changeManager,hashManager,splitter,chunkManager,chunkFetcher,entryManager,conflictManager}=this.getManagerMembers();this.changeManager=changeManager;this.hashManager=hashManager;this.splitter=splitter;this.chunkManager=chunkManager;this.chunkFetcher=chunkFetcher;this.entryManager=entryManager;this.conflictManager=conflictManager}async teardownManagers(){this.log("Teardown LiveSync Managers...",LOG_LEVEL_VERBOSE);if(this.changeManager){this.changeManager.teardown();this.changeManager=void 0}if(this.chunkFetcher){this.chunkFetcher.destroy();this.chunkFetcher=void 0}if(this.chunkManager){this.chunkManager.destroy();this.chunkManager=void 0}this.log("Teardown LiveSync Managers... Done");return await Promise.resolve()}getManagerMembers(){this.log("Creating LiveSync Managers...");const database=this.options.databaseService.localDatabase.localDatabase,changeManager=new ChangeManager({database}),hashManager=new HashManager({settingService:this.options.settingService}),splitter=new ContentSplitter({settingService:this.options.settingService}),chunkManager=new LayeredChunkManager({changeManager,database,settingService:this.options.settingService}),chunkFetcher=new ChunkFetcher({chunkManager,replicatorService:this.options.replicatorService,settingService:this.options.settingService}),entryManager=new EntryManager({database,hashManager,chunkManager,splitter,pathService:this._pathService,settingService:this.options.settingService}),conflictManager=new ConflictManager({entryManager,database,pathService:this._pathService});this.log("LiveSync Managers have been created");return{changeManager,hashManager,splitter,chunkManager,chunkFetcher,entryManager,conflictManager}}async initialise(){this.log("Initialising LiveSync Managers...",LOG_LEVEL_VERBOSE);await this.splitter.initialise({settingService:this.options.settingService});await this.hashManager.initialise();this.log("LiveSync Manager has been initialised")}async reinitialise(){await this.teardownManagers();const{changeManager,hashManager,splitter,chunkManager,chunkFetcher,entryManager,conflictManager}=this.getManagerMembers();this.changeManager=changeManager;this.hashManager=hashManager;this.splitter=splitter;this.chunkManager=chunkManager;this.chunkFetcher=chunkFetcher;this.entryManager=entryManager;this.conflictManager=conflictManager;await this.initialise()}clearCaches(){var _a8;null==(_a8=this.chunkManager)||_a8.clearCaches()}async prepareHashFunction(){this.hashManager=new HashManager({settingService:this.options.settingService});await this.hashManager.initialise()}};LiveSyncLocalDB=class{constructor(dbname,env){this.isReady=!1;this.needScanning=!1;this.auth={username:"",password:""};this.dbname=dbname;this.env=env;this._log=createInstanceLogFunction("LiveSyncLocalDB",this.env.services.API);this.refreshSettings()}get managers(){if(!this._managers)throw new Error("Managers are not ready yet.");return this._managers}clearCaches(){var _a8;null==(_a8=this._managers)||_a8.clearCaches()}async _prepareHashFunctions(){var _a8;await(null==(_a8=this._managers)?void 0:_a8.prepareHashFunction())}onunload(){this.env.services.databaseEvents.onUnloadDatabase(this);this.localDatabase.removeAllListeners()}refreshSettings(){const settings=this.env.services.setting.currentSettings();this.settings=settings;this._prepareHashFunctions()}async close(){var _a8;this._log("Database closed (by close)");this.isReady=!1;null==(_a8=this.offRemoteChunkFetchedHandler)||_a8.call(this);null!=this.localDatabase&&await this.localDatabase.close();await this.env.services.databaseEvents.onUnloadDatabase(this)}onNewLeaf(chunk){var _a8;null==(_a8=this.managers.chunkManager)||_a8.emitEvent(EVENT_CHUNK_FETCHED,chunk)}async initializeDatabase(){await this._prepareHashFunctions();if(null!=this.localDatabase){this.localDatabase.removeAllListeners();await this.localDatabase.close()}this.localDatabase=null;this.localDatabase=this.env.services.database.createPouchDBInstance(this.dbname+SuffixDatabaseName,{auto_compaction:!1,revs_limit:100,deterministic_revs:!0});const manager=new LiveSyncManagers({database:this.localDatabase,APIService:this.env.services.API,pathService:this.env.services.path,replicatorService:this.env.services.replicator,settingService:this.env.services.setting,databaseService:this.env.services.database});this._managers=manager;await this.env.services.databaseEvents.onDatabaseInitialisation(this)||this._log("Initializing Database has been failed on some module",LOG_LEVEL_NOTICE);this._log("Opening Database...");this._log("Database info",LOG_LEVEL_VERBOSE);this._log(JSON.stringify(await this.localDatabase.info(),null,2),LOG_LEVEL_VERBOSE);await this.managers.initialise();this.localDatabase.on("close",()=>{var _a8;this._log("Database closed.");this.isReady=!1;this.localDatabase.removeAllListeners();null==(_a8=this.env.services.replicator.getActiveReplicator())||_a8.closeReplication();this.managers.teardownManagers()});const _instance2=new FallbackWeakRef(this),unload=eventHub.onEvent("remote-chunk-fetched",chunk=>{var _a8;null==_instance2.deref()&&unload();null==(_a8=_instance2.deref())||_a8.onNewLeaf(chunk)});this.offRemoteChunkFetchedHandler=unload;this.isReady=!0;if(!await this.env.services.databaseEvents.onDatabaseHasReady()){this._log("Some module has prevented the database from being ready. The database is initialised but not ready for use.",LOG_LEVEL_NOTICE);return!1}this._log("Database is now ready.");return!0}async allChunks(includeDeleted=!1){const used=new Set,existing=new Map;let since=0;for(;;){const changes3=await this.localDatabase.changes({since,limit:100,include_docs:!0,conflicts:!0,style:includeDeleted?"all_docs":"main_only"});if(0==changes3.results.length)break;for(const change of changes3.results){const doc=change.doc;if("leaf"==doc.type){if(doc._deleted&&!includeDeleted)continue;existing.set(doc._id,doc)}if("children"in doc){if(change.deleted&&(!doc._conflicts||0==doc._conflicts.length))continue;doc.children.forEach(e3=>used.add(e3));if(doc._conflicts){const mineRevInfo=(await this.localDatabase.get(doc._id,{revs:!0,revs_info:!0}))._revs_info||[],keepRevs=new Set;for(const conflict of doc._conflicts){const conflictedRevInfo=(await this.localDatabase.get(doc._id,{rev:conflict,revs:!0,revs_info:!0}))._revs_info||[],diffRevs=mineRevInfo.filter(e3=>!conflictedRevInfo.some(f4=>f4.rev==e3.rev&&f4.status==e3.status)),diffRevs2=conflictedRevInfo.filter(e3=>!mineRevInfo.some(f4=>f4.rev==e3.rev&&f4.status==e3.status)),diffRevs3=diffRevs.concat(diffRevs2),sameRevs=mineRevInfo.filter(e3=>conflictedRevInfo.some(f4=>f4.rev==e3.rev&&f4.status==e3.status)).filter(e3=>"available"==e3.status).sort((a2,b3)=>getNoFromRev(b3.rev)-getNoFromRev(a2.rev)),sameRevsTop=sameRevs.length>0?[sameRevs[0].rev]:[];[...diffRevs3.filter(e3=>"available"==e3.status).map(e3=>e3.rev),...sameRevsTop].forEach(e3=>keepRevs.add(e3))}const detail=await this.localDatabase.bulkGet({docs:[...keepRevs.values()].map(e3=>({id:doc._id,rev:e3}))});for(const e3 of detail.results)if("docs"in e3){const docs=e3.docs;for(const doc2 of docs)"ok"in doc2&&"children"in doc2.ok&&doc2.ok.children.forEach(e4=>used.add(e4))}}}}since=changes3.results[changes3.results.length-1].seq}return{used,existing}}async resetDatabase(){var _a8;await this.managers.teardownManagers();null==(_a8=this.env.services.replicator.getActiveReplicator())||_a8.closeReplication();if(!await this.env.services.databaseEvents.onResetDatabase(this)){Logger("Database reset has been prevented or failed on some modules.",LOG_LEVEL_NOTICE);return!1}Logger("Database closed for reset Database.");this.isReady=!1;await this.localDatabase.destroy();this.localDatabase=null;await this.initializeDatabase();this._log("Local Database Reset",LOG_LEVEL_NOTICE);return!0}async*findEntries(startKey,endKey,opt){let nextKey=startKey;""==endKey&&(endKey="􏿿");let req=this.allDocsRaw({limit:100,startkey:nextKey,endkey:endKey,include_docs:!0,...opt});do{const docs=await req;if(0===docs.rows.length)break;nextKey=`${docs.rows[docs.rows.length-1].id}`;req=this.allDocsRaw({limit:100,skip:1,startkey:nextKey,endkey:endKey,include_docs:!0,...opt});for(const row of docs.rows){const doc=row.doc;"type"in doc&&("newnote"!=doc.type&&"plain"!=doc.type||(yield doc))}}while(""!=nextKey)}async*findAllDocs(opt){const targets=[()=>this.findEntries("","_",null!=opt?opt:{}),()=>this.findEntries("_􏿿","h:",null!=opt?opt:{}),()=>this.findEntries("h:􏿿","",null!=opt?opt:{})];for(const targetFun of targets)yield*targetFun()}async*findEntryNames(startKey,endKey,opt){let nextKey=startKey;""==endKey&&(endKey="􏿿");let req=this.allDocsRaw({limit:100,startkey:nextKey,endkey:endKey,...opt});do{const docs=await req;if(0==docs.rows.length){nextKey="";break}nextKey=`${docs.rows[docs.rows.length-1].key}`;req=this.allDocsRaw({limit:100,skip:1,startkey:nextKey,endkey:endKey,...opt});for(const row of docs.rows)yield row.id}while(""!=nextKey)}async*findAllDocNames(opt){const targets=[()=>this.findEntryNames("","_",null!=opt?opt:{}),()=>this.findEntryNames("_􏿿","h:",null!=opt?opt:{}),()=>this.findEntryNames("h:􏿿","i:",null!=opt?opt:{}),()=>this.findEntryNames("i:􏿿","ix:",null!=opt?opt:{}),()=>this.findEntryNames("ix:􏿿","ps:",null!=opt?opt:{}),()=>this.findEntryNames("ps:􏿿","",null!=opt?opt:{})];for(const targetFun of targets){const target=targetFun();for await(const f4 of target)f4.startsWith("_")||"obsydian_livesync_version"!=f4&&(yield f4)}}async*findAllNormalDocs(opt){const targets=[()=>this.findEntries("","_",null!=opt?opt:{}),()=>this.findEntries("_􏿿","h:",null!=opt?opt:{}),()=>this.findEntries("h:􏿿","i:",null!=opt?opt:{}),()=>this.findEntries("i:􏿿","ix:",null!=opt?opt:{}),()=>this.findEntries("ix:􏿿","ps:",null!=opt?opt:{}),()=>this.findEntries("ps:􏿿","",null!=opt?opt:{})];for(const targetFun of targets){const target=targetFun();for await(const f4 of target)f4._id.startsWith("_")||"newnote"!=f4.type&&"plain"!=f4.type||(yield f4)}}async removeRevision(docId,revision){try{const doc=await this.localDatabase.get(docId,{rev:revision});doc._deleted=!0;await this.localDatabase.put(doc);return!0}catch(ex){isErrorOfMissingDoc(ex)&&Logger(`Remove revision: Missing target revision, ${docId}-${revision}`,LOG_LEVEL_VERBOSE)}return!1}getRaw(docId,options){return this.localDatabase.get(docId,options||{})}removeRaw(docId,revision,options){return this.localDatabase.remove(docId,revision,options||{})}putRaw(doc,options){return this.localDatabase.put(doc,options||{})}allDocsRaw(options){return this.localDatabase.allDocs(options)}bulkDocsRaw(docs,options){return this.localDatabase.bulkDocs(docs,options||{})}isTargetFile(filenameSrc){return this.managers.entryManager.isTargetFile(filenameSrc)}async getDBEntryMeta(path2,opt,includeDeleted=!1){return await this.managers.entryManager.getDBEntryMeta(path2,opt,includeDeleted)}async getDBEntry(path2,opt,dump=!1,waitForReady=!0,includeDeleted=!1){return await this.managers.entryManager.getDBEntry(path2,opt,dump,waitForReady,includeDeleted)}async getDBEntryFromMeta(meta,dump=!1,waitForReady=!0){return await this.managers.entryManager.getDBEntryFromMeta(meta,dump,waitForReady)}async deleteDBEntry(path2,opt){return await this.managers.entryManager.deleteDBEntry(path2,opt)}async putDBEntry(note,onlyChunks){return await this.managers.entryManager.putDBEntry(note,onlyChunks)}async getConflictedDoc(path2,rev3){return await this.managers.conflictManager.getConflictedDoc(path2,rev3)}async tryAutoMerge(path2,enableMarkdownAutoMerge){return await this.managers.conflictManager.tryAutoMerge(path2,enableMarkdownAutoMerge)}};RECORD_SPLIT="\n";UNIT_SPLIT="";te4=new TextEncoder;JournalSyncAbstract=class{constructor(settings,store,env){this.hash="";this.batchSize=100;this.requestedStop=!1;this.notifier=new Notifier;this._currentCheckPointInfo={...CheckPointInfoDefault};this.isPacking=!1;this.isDownloading=!1;this._settings=settings;this.env=env;this.processReplication=async docs=>await env.services.replication.parseSynchroniseResult(docs);this.store=store;this.hash=this.getHash(settings);this.trench=new Trench(store);clearHandlers()}get id(){return this._settings.accessKey}get key(){return this._settings.secretKey}get bucket(){return this._settings.bucket}get endpoint(){return this._settings.endpoint}get prefix(){return this._settings.bucketPrefix}get region(){return this._settings.region}get forcePathStyle(){return this._settings.forcePathStyle}get db(){return this.env.services.database.localDatabase.localDatabase}get currentSettings(){return this.env.services.setting.currentSettings()}get useCustomRequestHandler(){return this._settings.useCustomRequestHandler}get customHeaders(){return 0==this._settings.bucketCustomHeaders.length?[]:Object.entries(parseHeaderValues(this._settings.bucketCustomHeaders))}getInitialSyncParameters(){return Promise.resolve({...DEFAULT_SYNC_PARAMETERS,protocolVersion:2,pbkdf2salt:""})}async getSyncParameters(){try{const downloadedSyncParams=await this.downloadJson("_obsidian_livesync_journal_sync_parameters.json");if(!downloadedSyncParams)throw new SyncParamsNotFoundError("Missing sync parameters");return downloadedSyncParams}catch(ex){Logger("Could not retrieve remote sync parameters",LOG_LEVEL_INFO);throw SyncParamsFetchError.fromError(ex)}}async putSyncParameters(params){try{if(await this.uploadJson("_obsidian_livesync_journal_sync_parameters.json",params))return!0;throw new SyncParamsUpdateError("Could not store remote sync parameters")}catch(ex){Logger("Could not upload sync parameters",LOG_LEVEL_INFO);Logger(ex,LOG_LEVEL_VERBOSE);throw SyncParamsUpdateError.fromError(ex)}}getHash(settings){return btoa(encodeURI([settings.endpoint,`${settings.bucket}${settings.bucketPrefix}`,settings.region].join()))}applyNewConfig(settings,store,env){this._settings=settings;this.env=env;this.processReplication=async docs=>await env.services.replication.parseSynchroniseResult(docs);this.store=store;this.hash=this.getHash(settings);clearHandlers()}updateInfo(info3){var _a8,_b5,_c3,_d2,_e2,_f,_g;const old=this.env.services.replicator.replicationStatics.value;this.env.services.replicator.replicationStatics.value={sent:null!=(_a8=info3.sent)?_a8:old.sent,arrived:null!=(_b5=info3.arrived)?_b5:old.arrived,maxPullSeq:null!=(_c3=info3.maxPullSeq)?_c3:old.maxPullSeq,maxPushSeq:null!=(_d2=info3.maxPushSeq)?_d2:old.maxPushSeq,lastSyncPullSeq:null!=(_e2=info3.lastSyncPullSeq)?_e2:old.lastSyncPullSeq,lastSyncPushSeq:null!=(_f=info3.lastSyncPushSeq)?_f:old.lastSyncPushSeq,syncStatus:null!=(_g=info3.syncStatus)?_g:old.syncStatus}}async updateCheckPointInfo(func){const checkPointKey=`bucketsync-checkpoint-${this.hash}`,newInfo=func(await this.getCheckpointInfo());this._currentCheckPointInfo=newInfo;await this.store.set(checkPointKey,newInfo);return newInfo}async getCheckpointInfo(){const checkPointKey=`bucketsync-checkpoint-${this.hash}`,old=await this.store.get(checkPointKey)||{},items=["knownIDs","sentIDs","receivedFiles","sentFiles"];for(const key3 of items){if(!(key3 in old))continue;const value=old[key3];value instanceof Set||(Array.isArray(value)?old[key3]=new Set(value):old[key3]=value&&"object"==typeof value?new Set(Object.keys(value)):new Set)}this._currentCheckPointInfo={...CheckPointInfoDefault,...old};return this._currentCheckPointInfo}async resetAllCaches(){await this.trench.eraseAllPermanences();clearHandlers()}async resetCheckpointInfo(){await this.updateCheckPointInfo(info3=>({...CheckPointInfoDefault}));clearHandlers()}getJournalEpochFromSyncParams(params){return`${params.protocolVersion}:${params.pbkdf2salt}`}async ensureCheckpointCachesAreFresh(){let journalEpoch="";try{const params=await this.getSyncParameters();journalEpoch=this.getJournalEpochFromSyncParams(params)}catch(e3){return}const current=await this.getCheckpointInfo();if(current.journalEpoch===journalEpoch)return;const lastSentFile=[...current.sentFiles].sort().pop();if(!lastSentFile){await this.updateCheckPointInfo(info3=>({...info3,journalEpoch}));return}let remoteWipeConfirmed;try{remoteWipeConfirmed=(await this.listFiles(lastSentFile.slice(0,-1),1))[0]!==lastSentFile}catch(e3){remoteWipeConfirmed=!0}if(remoteWipeConfirmed){Logger("Journal epoch changed and remote wipe confirmed. Clearing dedupe caches.",LOG_LEVEL_NOTICE);await this.updateCheckPointInfo(info3=>({...info3,journalEpoch,knownIDs:new Set,sentIDs:new Set,receivedFiles:new Set,sentFiles:new Set}));clearHandlers()}else{await this.updateCheckPointInfo(info3=>({...info3,journalEpoch}));Logger("Journal epoch changed (remote files still present). Epoch updated; caches kept.",LOG_LEVEL_NOTICE)}}getRemoteKey(){return this.getHash(this._settings)}async getReplicationPBKDF2Salt(refresh){const manager=createSyncParamsHanderForServer(this.getRemoteKey(),{put:params=>this.putSyncParameters(params),get:()=>this.getSyncParameters(),create:()=>this.getInitialSyncParameters()});return await manager.getPBKDF2Salt(refresh)}isEncryptionPrevented(fileName){return!!fileName.endsWith("_obsidian_livesync_journal_sync_parameters.json")}async decryptDataV2(encrypted,set2){const salt=await this.getReplicationPBKDF2Salt();return await decryptBinary(encrypted,set2.passphrase,salt)}async decryptDataV1(encrypted,set2){return await decryptBinary2(encrypted,set2.passphrase,set2.useDynamicIterationCount)}async decryptDownloaded(key3,encrypted,set2){const u2=new Uint8Array(encrypted);try{return!set2.encrypt||""==set2.passphrase||this.isEncryptionPrevented(key3)?u2:set2.E2EEAlgorithm===E2EEAlgorithms.ForceV1?await this.decryptDataV1(u2,set2):await this.decryptDataV2(u2,set2)}catch(ex){Logger(`Failed to decrypt in v2. Falling back to v1: ${key3}`,LOG_LEVEL_INFO);try{const r4=await this.decryptDataV1(u2,set2);Logger(`Decrypted in v1: ${key3}`,LOG_LEVEL_VERBOSE);return r4}catch(ex2){Logger(`Could not decrypt in v1: ${key3}`,LOG_LEVEL_VERBOSE);Logger(ex,LOG_LEVEL_VERBOSE);Logger(ex2,LOG_LEVEL_VERBOSE);throw ex2}}}async encryptForUpload(key3,data,set2){if(!set2.encrypt||""==set2.passphrase||this.isEncryptionPrevented(key3))return data;if(set2.E2EEAlgorithm===E2EEAlgorithms.V2){const salt=await this.getReplicationPBKDF2Salt();return await encryptBinary(data,set2.passphrase,salt)}return await encryptBinary2(data,set2.passphrase,set2.useDynamicIterationCount)}async _createJournalPack(override){const checkPointInfo=await this.getCheckpointInfo(),from=override||checkPointInfo.lastLocalSeq;Logger(`Journal reading from seq:${from}`,LOG_LEVEL_VERBOSE);let knownKeyCount=0;const allChangesTask=this.db.changes({live:!1,since:override||from,conflicts:!0,limit:this.batchSize,return_docs:!0,attachments:!1,style:"all_docs"}),allChanges=await allChangesTask;if(0==allChanges.results.length)return{changes:[],hasNext:!1,packLastSeq:allChanges.last_seq};const bd2=await this.db.bulkGet({docs:allChanges.results.map(e3=>e3.changes.map(change=>({id:e3.id,rev:change.rev}))).flat(),revs:!0}),packLastSeq=allChanges.last_seq,hasNext=packLastSeq<(await this.db.info()).update_seq,docChanges=bd2.results.map(e3=>e3.docs).flat().filter(e3=>"ok"in e3).map(e3=>e3.ok).filter(doc=>{const key3=this.getDocKey(doc);if(this._currentCheckPointInfo.knownIDs.has(key3)){knownKeyCount++;return!1}if(this._currentCheckPointInfo.sentIDs.has(key3)){knownKeyCount++;return!1}return!0});Logger(`Checked ${allChanges.results.length} changed entries, selected ${docChanges.length} docs (${knownKeyCount} keys already known)`,LOG_LEVEL_DEBUG);return{changes:docChanges,hasNext,packLastSeq}}getDocKey(doc){return doc&&doc._id.startsWith("h:")?doc._id:doc._id+"-"+doc._rev}async uploadQueued(showMessage=!1,wrapUp=!1){return await shareRunningResult("upload_queue",async()=>{const TASK_TITLE="Uploading journal:",logLevel=showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO;let uploaded=0;do{const queued=await this.trench.dequeuePermanentWithCommit("upload_queue");if(!queued){if(this.isPacking){Logger(`${TASK_TITLE} Queue run out, but process is running. wait for the next.`,LOG_LEVEL_VERBOSE);await Promise.race([this.notifier.nextNotify,delay(3e3)]);continue}uploaded?Logger(`${TASK_TITLE}: ${uploaded} files have been uploaded!`,logLevel,"send_journal"):wrapUp||Logger("No files needs to be uploaded!",logLevel,"send_journal");return!0}const{key:key3,value,commit,cancel:cancel2,cancelCount,pendingItems}=queued;this.updateInfo({sent:uploaded,maxPushSeq:pendingItems+uploaded,lastSyncPushSeq:1});Logger(`${TASK_TITLE} ${uploaded} / ${pendingItems+uploaded}${0!=cancelCount?`\nRETRY:${cancelCount}`:""}`,logLevel,"send_journal");Logger(`${TASK_TITLE} ${key3} ${0!=cancelCount?`TRY:${cancelCount}`:""} ${pendingItems} left`,LOG_LEVEL_VERBOSE);if(cancelCount>3){Logger(`${TASK_TITLE} Something went wrong on processing queue ${key3}.`,LOG_LEVEL_NOTICE);return!1}const filename=`${Date.now()}-docs.jsonl.gz`,mime="application/octet-stream",blob=new Blob([value],{type:mime});try{if(!await this.uploadFile(filename,blob,mime))throw new Error("Could not send journalPack to the bucket");await commit();uploaded++;await this.updateCheckPointInfo(info3=>({...info3,sentFiles:info3.sentFiles.add(filename)}));Logger(`${TASK_TITLE}: Uploaded ${key3} as ${filename}`,LOG_LEVEL_INFO)}catch(ex){Logger(`${TASK_TITLE} Could not send journalPack to the bucket (${key3} as ${filename})`,LOG_LEVEL_NOTICE);Logger(ex,LOG_LEVEL_VERBOSE);Logger(`${TASK_TITLE} Uploading ${key3} cancelled for retry`,LOG_LEVEL_VERBOSE);cancel2();await delay(1e3);continue}}while(0==this.requestedStop)})}async packAndCompress(showMessage=!1){return await shareRunningResult("create_send_data",async()=>{try{this.isPacking=!0;const MSG_KEY="pack_journal",logLevel=showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO;this.requestedStop=!1;const checkPointInfo=await this.getCheckpointInfo(),max3=(await this.db.info()).update_seq,sentIDs=checkPointInfo.sentIDs,maxOutBufLength=250,maxBinarySize=10485760;let currentLastSeq=checkPointInfo.lastLocalSeq,binarySize=0;const outBuf=[];let isFinished=!1;const startSeq=checkPointInfo.lastLocalSeq,seqToProcess=max3-startSeq;Logger("Packing Journal: Start sending",logLevel,MSG_KEY);do{if(this.requestedStop){Logger("Packing Journal : Stop requested",logLevel,MSG_KEY);isFinished=!0;break}const{changes:changes3,hasNext,packLastSeq}=await this._createJournalPack(currentLastSeq),currentSeq=packLastSeq-startSeq;if(0==changes3.length)Logger(`Packing Journal: No sendable docs in this batch (${currentSeq} / ${seqToProcess}); continuing while there are newer changes.`,LOG_LEVEL_VERBOSE);else{Logger(`Packing Journal: ${currentSeq} / ${seqToProcess}`,logLevel,MSG_KEY);for(const row of changes3){const serialized2=serializeDoc(row);sentIDs.add(this.getDocKey(row));binarySize+=serialized2.length;outBuf.push(serialized2);if(outBuf.length>maxOutBufLength||binarySize>maxBinarySize){const sendBuf=concatUInt8Array2(outBuf),orgLen=sendBuf.byteLength,bin=await wrappedDeflate(sendBuf,{consume:!0,level:8});Logger(`Packing Journal: Compressed ${orgLen} bytes to ${bin.byteLength} bytes (${0!=orgLen?Math.ceil(bin.byteLength/orgLen*100):"--"}%)`,LOG_LEVEL_VERBOSE);await this.trench.queuePermanent("upload_queue",bin);this.notifier.notify();outBuf.length=0;binarySize=0}}}if(outBuf.length>0){const sendBuf=concatUInt8Array2(outBuf),orgLen=sendBuf.byteLength,bin=await wrappedDeflate(sendBuf,{consume:!0,level:8});Logger(`Packing Journal: Compressed ${orgLen} bytes to ${bin.byteLength} bytes (${0!=orgLen?Math.ceil(bin.byteLength/orgLen*100):"--"}%)`,LOG_LEVEL_VERBOSE);await this.trench.queuePermanent("upload_queue",bin);this.notifier.notify()}await this.updateCheckPointInfo(info3=>({...info3,lastLocalSeq:packLastSeq,sentIDs}));currentLastSeq=packLastSeq;if(!hasNext){isFinished=!0;break}}while(0==this.requestedStop&&!isFinished);Logger(0!=seqToProcess?`Packing Journal: Packaging ${seqToProcess}`:"Packing Journal: No journals to be packed!",logLevel,MSG_KEY);this.notifier.notify();return!0}finally{this.isPacking=!1;this.notifier.notify()}})}async sendLocalJournal(showMessage=!1){this.updateInfo({syncStatus:"JOURNAL_SEND"});if((await Promise.all([this.packAndCompress(showMessage),this.uploadQueued(showMessage)])).every(e3=>e3)&&await this.uploadQueued(showMessage,!0)){this.updateInfo({syncStatus:"COMPLETED"});return!0}this.updateInfo({syncStatus:"ERRORED"});return!1}async _getRemoteJournals(){const StartAfter=[...(await this.getCheckpointInfo()).receivedFiles.keys()].sort((a2,b3)=>b3.localeCompare(a2,void 0,{numeric:!0}))[0],files=(await this.listFiles(StartAfter)).filter(e3=>!e3.startsWith("_"));return files?files.sort((a2,b3)=>a2.localeCompare(b3,void 0,{numeric:!0})):[]}async processDocuments(allDocs2){let applyTotal=0,wholeItems=0;try{const chunks=[],docs=[];allDocs2.forEach(e3=>{e3._id.startsWith("h:")?chunks.push(e3):docs.push(e3)});try{const e22=(await this.db.allDocs({include_docs:!0,keys:[...chunks.map(e3=>e3._id)]})).rows.map(e3=>{var _a8;return null!=(_a8=e3.id)?_a8:void 0}),existChunks=new Set(e22.filter(e3=>void 0!==e3)),saveChunks=chunks.filter(e3=>!existChunks.has(e3._id)).map(e3=>({...e3,_rev:void 0})),ret=await this.db.bulkDocs(saveChunks,{new_edits:!0}),saveError=ret.filter(e3=>"error"in e3).map(e3=>e3.id);saveChunks.filter(e3=>-1===saveError.indexOf(e3._id)).forEach(doc=>eventHub.emitEvent("remote-chunk-fetched",doc));await this.updateCheckPointInfo(info3=>({...info3,knownIDs:setAllItems(info3.knownIDs,chunks.map(e3=>this.getDocKey(e3)))}));Logger(`Saved ${ret.length} chunks in transferred ${chunks.length} chunks (Error:${saveError.length})`,LOG_LEVEL_VERBOSE)}catch(ex){Logger("Applying chunks failed",LOG_LEVEL_INFO);Logger(ex,LOG_LEVEL_VERBOSE)}const docsRevs=docs.map(e3=>[e3._id,[e3._rev]]).reduce((acc,[id,revs])=>{var _a8;return{...acc,[id]:[...null!=(_a8=acc[id])?_a8:[],...revs]}},{}),diffRevs=await this.db.revsDiff(docsRevs),saveDocs=docs.filter(e3=>{var _a8,_b5;return e3._id in diffRevs&&"missing"in diffRevs[e3._id]&&-1!==(null!=(_b5=null==(_a8=diffRevs[e3._id].missing)?void 0:_a8.indexOf(e3._rev))?_b5:0)});Logger(`Applying ${saveDocs.length} docs (Total transferred:${docs.length}, docs:${allDocs2.length})`,LOG_LEVEL_VERBOSE);await this.db.bulkDocs(saveDocs,{new_edits:!1});await this.processReplication(saveDocs);await this.updateCheckPointInfo(info3=>({...info3,knownIDs:setAllItems(info3.knownIDs,docs.map(e3=>this.getDocKey(e3)))}));applyTotal+=saveDocs.length;wholeItems+=docs.length;Logger(`Applied ${applyTotal} of ${wholeItems} docs (${wholeItems-applyTotal} skipped)`,LOG_LEVEL_VERBOSE);return!0}catch(ex){Logger("Applying journal failed",LOG_LEVEL_INFO);Logger(ex,LOG_LEVEL_VERBOSE);return!1}}async processDownloadedJournals(showMessage=!1,wrapUp=!1){return await shareRunningResult("process_downloaded_journals",async()=>{const logLevel=showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,TASK_TITLE="Processing journal:";let downloaded=0;do{const queued=await this.trench.dequeuePermanentWithCommit("parse_file");if(!queued){if(this.isDownloading){Logger(`${TASK_TITLE} Queue run out, but process is running. wait for the next.`,LOG_LEVEL_VERBOSE);await Promise.race([this.notifier.nextNotify,delay(3e3)]);continue}downloaded?Logger(`${TASK_TITLE} ${downloaded} files have been uploaded!`,logLevel,"send_journal"):wrapUp||Logger(`${TASK_TITLE} No files needs to be processed!`,logLevel,"send_journal");return!0}const{key:key3,value,commit,cancel:cancel2,cancelCount,pendingItems}=queued;this.updateInfo({arrived:downloaded,maxPullSeq:pendingItems+downloaded,lastSyncPullSeq:1});Logger(`${TASK_TITLE} ${downloaded} / ${pendingItems+downloaded}${0!=cancelCount?`\nRETRY:${cancelCount}`:""}`,logLevel,"processjournal");if(cancelCount>3){Logger(`${TASK_TITLE} Something went wrong on processing queue ${key3}.`,LOG_LEVEL_NOTICE);return!1}const compressed=new Uint8Array(value),decompressed=await wrappedInflate(compressed,{consume:!0});if(0==decompressed.length){await commit();downloaded++;Logger(`${TASK_TITLE}: ${key3} has been processed`,LOG_LEVEL_INFO);continue}let idxFrom=0,idxTo=0;const d4=new TextDecoder,result=[];do{idxTo=decompressed.indexOf(10,idxFrom);if(-1==idxTo)break;const piece=decompressed.slice(idxFrom,idxTo),strPiece=d4.decode(piece);if(strPiece.startsWith("~")){const[key4,data]=strPiece.substring(1).split(UNIT_SPLIT);result.push({_id:key4,data:unescapeNewLineFromString(data),type:"leaf",_rev:""})}else result.push(JSON.parse(strPiece));idxFrom=idxTo+1}while(idxTo>0);try{if(!await this.processDocuments(result))throw new Error("Could not process downloaded journals");await commit();downloaded++;Logger(`${TASK_TITLE}: ${key3} has been processed`,LOG_LEVEL_INFO)}catch(ex){Logger(`${TASK_TITLE}: Could not process downloaded journals`,LOG_LEVEL_NOTICE);Logger(ex,LOG_LEVEL_VERBOSE);Logger(`${TASK_TITLE}: ${key3} cancelled for retry`,LOG_LEVEL_VERBOSE);cancel2();await delay(1e3);continue}}while(0==this.requestedStop);return!0})}async downloadRemoteJournals(showMessage=!1){return await shareRunningResult("downloadRemoteJournals",async()=>{try{this.isDownloading=!0;const logLevel=showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO;Logger("Receiving Journal: Getting list of remote journal",logLevel,"receivejournal");const files=await this._getRemoteJournals();if(0==files.length){Logger("Receiving Journal: No journals needs to be downloaded",logLevel,"receivejournal");return!0}let count=0;for(const key3 of files){count++;Logger(`Receiving Journal: ${count} / ${files.length}`,logLevel,"receivejournal");if(this.requestedStop){Logger(`Receiving canceled: ${key3}`,logLevel);return!1}if(this._currentCheckPointInfo.sentFiles.has(key3)){Logger(`Receiving Journal: ${key3} is own sent file`,LOG_LEVEL_VERBOSE);await this.updateCheckPointInfo(info3=>({...info3,receivedFiles:info3.receivedFiles.add(key3)}))}else try{const data=await this.downloadFile(key3);if(!1===data)throw new Error("Download Error");await this.trench.queuePermanent("parse_file",data);await this.updateCheckPointInfo(info3=>({...info3,receivedFiles:info3.receivedFiles.add(key3)}));this.notifier.notify()}catch(ex){Logger(`Could not download ${key3}`,logLevel);Logger(ex,LOG_LEVEL_DEBUG);return!1}}}finally{this.isDownloading=!1;this.notifier.notify()}this.notifier.notify();return!0})}async receiveRemoteJournal(showMessage=!1){this.updateInfo({syncStatus:"JOURNAL_RECEIVE"});this.requestedStop=!1;if((await Promise.all([this.downloadRemoteJournals(showMessage),this.processDownloadedJournals(showMessage)])).every(e3=>e3)&&await this.processDownloadedJournals(showMessage,!0)){this.updateInfo({syncStatus:"COMPLETED"});return!0}this.updateInfo({syncStatus:"ERRORED"});return!1}async sync(showResult=!1){var _a8;return null!=(_a8=await shareRunningResult("replicate",async()=>{this.requestedStop=!1;const receiveResult=await this.receiveRemoteJournal(showResult);if(!this.requestedStop){if(!receiveResult){Logger("Could not receive remote journal, so we prevent sending local journals to prevent unwanted mass transfers",showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);return}return await this.sendLocalJournal(showResult)}}))&&_a8}requestStop(){this.requestedStop=!0}};JournalSyncMinio=class extends JournalSyncAbstract{_getClient(){if(this._instance)return this._instance;const ep=this.endpoint?{endpoint:this.endpoint,forcePathStyle:this.forcePathStyle}:{};this._instance=new S3({region:this.region,...ep,credentials:{accessKeyId:this.id,secretAccessKey:this.key},maxAttempts:4,retryStrategy:new ConfiguredRetryStrategy(4,attempt=>100+1e3*attempt),requestHandler:this.useCustomRequestHandler?this.env.services.API.getCustomFetchHandler():void 0,requestChecksumCalculation:"WHEN_REQUIRED",responseChecksumValidation:"WHEN_REQUIRED"});const bucketCustomHeaders=this.customHeaders;this._instance.middlewareStack.add((next2,context2)=>args=>{bucketCustomHeaders.forEach(([key3,value])=>{key3&&value&&(args.request.headers[key3]=value)});return next2(args)},{name:"addBucketCustomHeadersMiddleware",step:"build"});const arrayBufferToBase64Sync=buffer=>btoa(String.fromCharCode(...new Uint8Array(buffer)));this._instance.middlewareStack.add(applyMd5BodyChecksumMiddleware({md5:Md5,base64Encoder:data=>arrayBufferToBase64Sync(data.buffer),streamHasher:(hashConstructor,stream)=>{const result=promiseWithResolver(),hash3=new hashConstructor;stream.on("data",chunk=>{hash3.update(chunk)});stream.on("end",()=>{result.resolve(hash3.digest())});return result.promise}}),{step:"build",name:"applyMd5BodyChecksumMiddlewareForDeleteObjects"});clearHandlers();return this._instance}async resetBucket(){var _a8;const client=this._getClient();let files=[],deleteCount=0,errorCount=0;try{do{files=await this.listFiles("",100);if(0==files.length)break;const cmd2=new DeleteObjectsCommand({Bucket:this.bucket,Delete:{Objects:files.map(e3=>({Key:`${this.prefix}${e3}`}))}}),r5=await client.send(cmd2),{Deleted,Errors:Errors2}=r5;deleteCount+=(null==Deleted?void 0:Deleted.length)||0;errorCount+=(null==Errors2?void 0:Errors2.length)||0;Logger(`${deleteCount} items has been deleted!${0!=errorCount?` (${errorCount} items failed to delete)`:""}`,LOG_LEVEL_NOTICE,"reset-bucket")}while(0!=files.length);clearHandlers()}catch(ex){Logger("WARNING! Could not delete files. you should try it once or remake the bucket manually",LOG_LEVEL_NOTICE,"reset-bucket");Logger(ex,LOG_LEVEL_VERBOSE)}const journals=await this._getRemoteJournals();if(0==journals.length){Logger("Nothing to delete!",LOG_LEVEL_NOTICE);return!0}const cmd=new DeleteObjectsCommand({Bucket:this.bucket,Delete:{Objects:journals.map(e3=>({Key:e3}))}}),r4=await client.send(cmd);Logger(`${(null==(_a8=null==r4?void 0:r4.Deleted)?void 0:_a8.length)||0} items has been deleted!`,LOG_LEVEL_NOTICE);await this.resetCheckpointInfo();return!0}async uploadJson(key3,body){try{return await this.uploadFile(key3,new Blob([JSON.stringify(body)]),"application/json")}catch(ex){Logger(`Could not upload json ${key3}`);Logger(ex,LOG_LEVEL_VERBOSE);return!1}}async downloadJson(key3){try{const ret=await this.downloadFile(key3,!0);return!!ret&&JSON.parse((new TextDecoder).decode(ret))}catch(ex){Logger(`Could not download json ${key3}`);Logger(ex,LOG_LEVEL_VERBOSE);return!1}}async uploadFile(key3,blob,mime){try{const buf=new Uint8Array(await blob.arrayBuffer()),set2=this.currentSettings,u2=await this.encryptForUpload(key3,buf,set2),client=this._getClient(),cmd=new PutObjectCommand({Bucket:this.bucket,Key:`${this.prefix}${key3}`,Body:u2,ContentType:mime});if(await client.send(cmd))return!0}catch(ex){Logger(`Could not upload ${key3}`);Logger(ex,LOG_LEVEL_VERBOSE)}return!1}async downloadFile(key3,ignoreCache=!1){const client=this._getClient(),cmd=new GetObjectCommand({Bucket:this.bucket,Key:`${this.prefix}${key3}`,...ignoreCache?{ResponseCacheControl:"no-cache"}:{}}),r4=await client.send(cmd),set2=this.currentSettings;try{if(r4.Body){const u2=new Uint8Array(await r4.Body.transformToByteArray());try{return await this.decryptDownloaded(key3,u2,set2)}catch(ex){Logger(`Could not decrypt downloaded file ${key3}`,LOG_LEVEL_NOTICE);Logger(ex,LOG_LEVEL_VERBOSE);return!1}}}catch(ex){Logger(`Could not download ${key3}`);Logger(ex,LOG_LEVEL_VERBOSE)}return!1}async listFiles(from,limit){const client=this._getClient(),objects=await client.listObjectsV2({Bucket:this.bucket,Prefix:this.prefix,StartAfter:`${this.prefix||""}${from||""}`,...limit?{MaxKeys:limit}:{}});return objects.Contents?objects.Contents.filter(e3=>{var _a8;return null==(_a8=e3.Key)?void 0:_a8.startsWith(this.prefix)}).map(e3=>{var _a8;return null==(_a8=e3.Key)?void 0:_a8.substring(this.prefix.length)}):[]}async isAvailable(){const client=this._getClient(),cmd=new HeadBucketCommand({Bucket:this.bucket});try{await client.send(cmd);return!0}catch(ex){Logger("Could not connected to the remote bucket",LOG_LEVEL_NOTICE);Logger(ex,LOG_LEVEL_VERBOSE);return!1}}async getUsage(){const client=this._getClient();try{const objects=await client.listObjectsV2({Bucket:this.bucket});return objects.Contents?{estimatedSize:objects.Contents.reduce((acc,e3)=>acc+(e3.Size||0),0)}:{}}catch(ex){Logger("Could not get status of the remote bucket",LOG_LEVEL_NOTICE);Logger(ex,LOG_LEVEL_VERBOSE);return!1}}};updateInformation="# 0.25\nSince 19th July, 2025 (beta1 in 0.25.0-beta1, 13th July, 2025)\n\nThe head note of 0.25 is now in [updates_old.md](https://github.com/vrtmrz/obsidian-livesync/blob/main/updates_old.md). Because 0.25 got a lot of updates, thankfully, compatibility is kept and we do not need breaking changes! In other words, when get enough stabled. The next version will be v1.0.0. Even though it my hope.\n\n## 0.25.57\n\n9th April, 2026\n\n- Packing a batch during the journal sync now continues even if the batch contains no items to upload.\n- No unexpected error (about a replicator) during the early stage of initialisation.\n- Now error messages are kept hidden if the show status inside the editor is disabled (related: #829).\n- Fixed an issue where devices could no longer upload after another device performed 'Fresh Start Wipe' and 'Overwrite remote' in Object Storage mode (#848).\n - Each device's local deduplication caches (`knownIDs`, `sentIDs`, `receivedFiles`, `sentFiles`) now track the remote journal epoch (derived from the encryption parameters stored on the remote).\n - When the epoch changes, the plugin verifies whether the device's last uploaded file still exists on the remote. If the file is gone, it confirms a remote wipe and automatically clears the stale caches. If the file is still present (e.g. a protocol upgrade without a wipe), the caches are preserved, and only the epoch is updated. This means normal upgrades never cause unnecessary re-processing.\n\n### Translations\n\n- Russian translation has been added! Thank you so much for the contribution, @vipka1n! (#845)\n\n### New features\n\n- Now we can configure multiple Remote Databases of the same type, e.g, multiple CouchDBs or S3 remotes.\n - A user interface for managing multiple remote databases has been added to the settings dialogue. I think no explanation is needed for the UI, but please let me know if you have any questions.\n- We can switch between multiple Remote Databases in the settings dialogue.\n\n### CLI\n\n#### Fixed\n\n- Replication progress is now correctly saved and restored in the CLI (related: #846).\n\n## ~~0.25.55~~ 0.25.56\n\n30th March, 2026\n\n### Fixed\n\n- No longer `Peer-to-Peer Sync is not enabled. We cannot open a new connection.` error occurs when we have not enabled P2P sync and are not expected to use it (#830).\n\n### CLI\n\n- Fixed incomplete localStorage support in the CLI (#831). Thank you so much @rewse !\n- Fixed the issue where the CLI could not be connected to the remote which had been locked once (#833), also thanks to @rewse !\n\n## 0.25.54\n\n18th March, 2026\n\n### Fixed\n\n- Remote storage size check now works correctly again (#818).\n- Some buttons on the settings dialogue now respond correctly again (#827).\n\n### Refactored\n\n- P2P replicator has been refactored to be a little more robust and easier to understand.\n- Delete items which are no longer used that might cause potential problems\n\n### CLI\n\n- Fixed the corrupted display of the help message.\n- Remove some unnecessary code.\n\n### WebApp\n\n- Fixed the issue where the detail level was not being applied in the log pane.\n- Pop-ups are now shown.\n- Add coverage for the test.\n- Pop-ups are now shown in the web app as well.\n\n## 0.25.53\n\n17th March, 2026\n\nI did wonder whether I should have released a minor version update, but when I actually tested it, compatibility seemed to be intact, so I didn’t. Hmm.\n\n### Fixed\n\n#### P2P Synchronisation\n\n- Fixed flaky timing issues in P2P synchronisation.\n- No longer unexpected `Unhandled Rejections` during P2P operations (waiting for acceptance).\n\n#### Journal Sync\n\n- Fixed an issue where some conflicts cannot be resolved in Journal Sync.\n- Many minor fixes have been made for better stability and reliability.\n\n### Tests\n\n- Rewrite P2P end-to-end tests to use the CLI as a host.\n\n### CLI\n\nWe have previously developed FileSystem LiveSync and various other components in a separate repository, but updates have been significantly delayed, and we have been plagued by compatibility issues. Now, a CLI tool using the same core logic is emerging. This does not directly manipulate the file system, but it offers a more convenient way of working and can also communicate with Object Storage. We can also resolve conflicts. Please refer to the code in `src/apps/cli` for the [self-hosted-livesync-cli](./src/apps/cli/README.md) for more details.\n- Add `self-hosted-livesync-cli` to `src/apps/cli` as a headless and dedicated version.\n- P2P sync and Object Storage are also supported in the CLI.\n - Yes, we have finally managed to 'get one file'.\n - Also, no more need for a [LiveSync PeerServer](https://github.com/vrtmrz/livesync-serverpeer) for virtual environments! The CLI can do it.\n\n- Now binary files are also supported in the CLI.\n\n### Refactored or internal changes\n\n- ServiceFileAccessBase now correctly handles the reading of binary files.\n- HeadlessAPIService now correctly provides the online status (always online) to the plug-in.\n- Non-worker version of bgWorker now correctly handles some functions.\n- Separated `ObsidianLiveSyncPlugin` into `ObsidianLiveSyncPlugin` and `LiveSyncBaseCore`.\n- Now `LiveSyncCore` indicates the type specified version of `LiveSyncBaseCore`.\n- Referencing `plugin.xxx` has been rewritten to referencing the corresponding service or `core.xxx`.\n- Offline change scanner and the local database preparation have been separated.\n- Set default priority for processFileEvent and processSynchroniseResult for the place to add hooks.\n- ControlService now provides the readiness for processing operations.\n- DatabaseService is now able to modify database opening options on derived classes.\n- Now `useOfflineScanner`, `useCheckRemoteSize`, and `useRedFlagFeatures` are set from `main.ts`, instead of `LiveSyncBaseCore`.\n- Storage Access APIs are now yielding Promises. This is to allow more limited storage platforms to be supported.\n- Journal Replicator now yields true after the replication is done.\n\n### R&D\n\n- Browser-version of Self-hosted LiveSync is now in development. This is not intended for public use now, but I will eventually make it available for testing.\n- We can see the code in `src/apps/webapp` for the browser version.\n\n## 0.25.52\n\n9th March, 2026\n\nExcuses: Too much `I`.\nWhilst I had a fever, I could not figure it out at all, but once I felt better, I spotted the problem in about thirty seconds. I apologise for causing you concern. I am grateful for your patience.\nI would like to devise a mechanism for running simple test scenarios. Now that we have got the Obsidian CLI up and running, it seems the perfect opportunity.\n\nTo improve the bus factor, we really need to organise the source code more thoroughly. Your cooperation and contributions would be greatly appreciated.\n\n### Fixed\n\n- No longer unexpected deletion-propagation occurs when the parent directory is not empty (#813).\n\n### Revert reversions\n\n- Reverted the reversion of ModuleCheckRemoteSize. Now it is back to the service feature.\n\n## 0.25.51\n\n7th March, 2026\n\n### Reverted\n\n- Reverted to ModuleRedFlag and ModuleInitializerFile to the previous version because of some unexpected issues. (#813)\n - I will re-implement them in the future with better design and tests.\n\n## 0.25.50\n\n3rd March, 2026\n\nNote: 0.25.49 has been skipped because of too verbose logging (credentials are logged in verbose level, but I realised that could lead to unexpected exposure on issue reporting). Please bump to 0.25.50 to get the fix if you are on 0.25.49. (No expected behaviour changes except the logging).\n\n### Fixed\n\n- No longer deleted files are not clickable in the Global History pane.\n- Diff view now uses more specific classes (#803).\n- A message of configuration mismatching slightly added for better understanding.\n - Now it says `When replication is initiated manually via the command palette or ribbon, a dialogue box will open to address this.` to make it clear that the user can fix the issue by themselves.\n\n### Refactored\n\n- `ModuleRedFlag` has been refactored to `serviceFeatures/redFlag` and also tested.\n- `ModuleInitializerFile` has been refactored to `lib/serviceFeatures/offlineScanner` and also tested.\n\n## 0.25.48\n\n2nd March, 2026\n\nNo behavioural changes except unidentified faults. Please report if you find any unexpected behaviour after this update.\n\n### Refactored\n\n- Many storage-related functions have been refactored for better maintainability and testability.\n - Now all platform-specific logics are supplied as adapters, and the core logic has become platform-agnostic.\n - Quite a number of tests have been added for the core logic, and the platform-specific logics are also tested with mocked adapters.\n\n## 0.25.47\n\n27th February, 2026\n\nPhew, the financial year is still not over yet, but I have got some time to work on the plug-in again!\n\n### Fixed and refactored\n\n- Fixed the inexplicable behaviour when retrieving chunks from the network.\n - The chunk manager has been layered to be responsible for its own areas and duties. e.g., `DatabaseWriteLayer`, `DatabaseReadLayer`, `NetworkLayer`, `CacheLayer`, and `ArrivalWaitLayer`.\n - All layers have been tested now!\n - `LayeredChunkManager` has been implemented to manage these layers. Also tested.\n - `EntryManager` has been mostly rewritten and also tested.\n\n- Now we can configure `Never warn` for remote storage size notification again.\n\n### Tests\n\n- The following test has been added:\n - `ConflictManager`.\n\n## 0.25.46\n\n26th February, 2026\n\n### Fixed\n\n- Unexpected errors no longer occurred when the plug-in was unloaded.\n- Hidden File Sync now respects selectors.\n- Registering protocol-handlers now works safely without causing unexpected errors.\n\n### Refactored\n\n- `ModuleCheckRemoteSize` has been ported to a serviceFeature, and tests have also been added.\n- Some unnecessary things have been removed.\n- LiveSyncManagers has now explicit dependencies.\n- LiveSyncLocalDB is now responsible for LiveSyncManagers, not accepting the managers as dependencies.\n - This is to avoid circular dependencies and clarify the ownership of the managers.\n- ChangeManager has been refactored. This had a potential issue, so something had been fixed, possibly.\n- Some tests have been ported from Deno's test runner to Vitest to accumulate coverage.\n\n## 0.25.45\n\n25th February, 2026\n\nAs a result of recent refactoring, we are able to write tests more easily now!\n\n### Refactored\n\n- `ModuleTargetFilter`, which was responsible for checking if a file is a target file, has been ported to a serviceFeature.\n - And also tests have been added. The middleware-style-power.\n- `ModuleObsidianAPI` has been removed and implemented in `APIService` and `RemoteService`.\n- Now `APIService` is responsible for the network-online-status, not `databaseService.managers.networkManager`.\n\n\nFull notes are in\n[updates_old.md](https://github.com/vrtmrz/obsidian-livesync/blob/main/updates_old.md).\n";lastVersion=~~(versionNumberString2Number("0.25.57")/1e3);CONTEXT_DIALOG_CONTROLS="svelte-dialog-controls";SvelteDialogManagerBase=class{get context(){return this._context}get dependents(){return this._dependents}constructor(c3,dependents){this._context=c3;this._dependents=dependents}async open(component2,initialData){return await this.openSvelteDialog(component2,initialData)}async openWithExplicitCancel(component2,initialData){for(let i2=0;i2<10;i2++){const ret=await this.openSvelteDialog(component2,initialData);if(void 0!==ret)return ret;if(this.dependents.control.hasUnloaded())throw new Error("Operation cancelled due to app shutdown.");Logger("Please select 'Cancel' explicitly to cancel this operation.",LOG_LEVEL_NOTICE)}throw new Error("Operation Forcibly cancelled by user.")}};root_110=from_html("

");root5=from_html('

');$$css6={hash:"svelte-1gf4irx",code:".dialog-header.svelte-1gf4irx {display:none;}"};root_111=from_html("

");root6=from_html("
");root7=from_html("");delegate(["click"]);root_113=from_html("

");root8=from_html('
');$$css7={hash:"svelte-o7k4lc",code:".question-container.svelte-o7k4lc {border-bottom:2px solid var(--interactive-accent);margin-bottom:0.5lh;padding-bottom:0.5lh;}"};root9=from_html('
');$$css8={hash:"svelte-1h8m5at",code:'.option-container.svelte-1h8m5at {border:1px solid transparent;border-radius:0.25lh;padding:0.5rem;}.option-container.selected.svelte-1h8m5at {border-color:var(--interactive-accent);}.choice-row.svelte-1h8m5at {display:flex;align-items:center;gap:0.5rem;\n /* margin-top: 1rem; */cursor:pointer;}.choice-row.svelte-1h8m5at span.choice-title:where(.svelte-1h8m5at) {width:auto;}.choice-row.svelte-1h8m5at input[type="radio"]:where(.svelte-1h8m5at) {\n /* width: 1.2rem;\n height: 1.2rem; */cursor:pointer;}.choice-notes.svelte-1h8m5at {margin-left:2rem;margin-top:0.25rem;color:var(--text-muted);font-size:0.9rem;}.option-container.selected.svelte-1h8m5at .choice-notes:where(.svelte-1h8m5at) {color:var(--text-normal);}'};root10=from_html('
');root11=from_html('
');root12=from_html('
');root_44=from_html(" ",1);root_24=from_html(" ",1);root_72=from_html(" ",1);root13=from_html(" ",1);root_25=from_html("

");root_114=from_html("
");root14=from_html('
');root15=from_html('
',1);$$css9={hash:"svelte-2n6uv8",code:'.choice-row.svelte-2n6uv8 {display:flex;align-items:center;gap:0.5rem;margin-top:1rem;cursor:pointer;}.choice-row.svelte-2n6uv8 span.choice-title:where(.svelte-2n6uv8) {width:auto;}.choice-row.svelte-2n6uv8 input[type="checkbox"]:where(.svelte-2n6uv8) {\n /* width: 1.2rem;\n height: 1.2rem; */cursor:pointer;}.choice-notes.svelte-2n6uv8 {margin-left:2rem;margin-top:0.25rem;color:var(--text-muted);font-size:0.9rem;}'};root_45=from_html(" ",1);root_26=from_html(" ",1);root_73=from_html(" ",1);root16=from_html(" ",1);root_46=from_html(" ",1);root_27=from_html(" ",1);root_83=from_html(" ",1);root17=from_html(" ",1);root_28=from_html("
  1. On this device, please keep this Vault open.
  2. On the source device, open Obsidian.
  3. On the source device, from the command palette, run the 'Show settings as a QR code' command.
  4. On this device, switch to the camera app or use a QR code scanner to scan the displayed QR code.
");root18=from_html(" ",1);root19=from_html('');root20=from_html(' ',1);root_115=from_html('Please enter the Setup URI that was generated during server installation or on another device, along with the vault\n passphrase.
Note that you can generate a new Setup URI by running the "Copy settings as a new Setup URI" command in the command palette.',1);root_29=from_html('');root_74=from_html(" ",1);root21=from_html(" ",1);root_116=from_html("

The connection to the server has been configured successfully. As the next step, the synchronisation data on the server will be built based on the current data on this device.

IMPORTANT
After restarting, the data on this device will be uploaded to the server as the 'master copy'. Please be aware that\n any unintended data currently on the server will be completely overwritten.

",1);root_47=from_html(" ",1);root22=from_html(" ",1);root_117=from_html("

The connection to the server has been configured successfully. As the next step, the latest synchronisation data will be downloaded from the server to this device.

PLEASE NOTE
After restarting, the database on this device will be rebuilt using data from the server. If there are any unsynchronised\n files in this vault, conflicts may occur with the server data.

",1);root_48=from_html(" ",1);root23=from_html(" ",1);root_118=from_html("The connection to the server has been configured successfully. As the next step, the local database, that is to say the synchronisation information, must be reconstituted.",1);root_210=from_html(" ",1);root_102=from_html(" ",1);root24=from_html(" ",1);root_33=from_html(" ",1);root_119=from_html(" ",1);root_75=from_html(" ",1);root25=from_html(" ",1);checkConfig=async editingSettings=>{var _a8,_b5,_c3,_d2,_e2,_f,_g,_h2,_i2,_j,_k,_l,_m2,_n;const result=[],addMessage=(msg,classes=[])=>{result.push({message:msg,classes})},addSuccess=(msg,value)=>{result.push({message:msg,result:"ok",value})},_addError=(message,fixMessage,fix,value)=>{result.push({message,result:"error",fixMessage,fix,value})},addErrorMessage=(msg,classes=[])=>{result.push({message:msg,result:"error",classes})},addError=(message,fixMessage,key3,expected)=>{_addError(message,fixMessage,async()=>{await updateRemoteSetting(editingSettings,key3,expected)})};addMessage($msg("obsidianLiveSyncSettingTab.logCheckingDbConfig"));try{if(isCloudantURI(editingSettings.couchDB_URI)){addMessage($msg("obsidianLiveSyncSettingTab.logCannotUseCloudant"));return result}const customHeaders=parseHeaderValues(editingSettings.couchDB_CustomHeaders),credential=generateCredentialObject(editingSettings),r4=await requestToCouchDBWithCredentials(editingSettings.couchDB_URI,credential,window.origin,void 0,void 0,void 0,customHeaders),responseConfig=r4.json;addMessage($msg("obsidianLiveSyncSettingTab.msgNotice"),["ob-btn-config-head"]);addMessage($msg("obsidianLiveSyncSettingTab.msgIfConfigNotPersistent"),["ob-btn-config-info"]);addMessage($msg("obsidianLiveSyncSettingTab.msgConfigCheck"),["ob-btn-config-head"]);const serverBanner=null!=(_b5=null!=(_a8=r4.headers.server)?_a8:r4.headers.Server)?_b5:"unknown";addMessage($msg("obsidianLiveSyncSettingTab.serverVersion",{info:serverBanner}));const versionMatch=serverBanner.match(/CouchDB(\/([0-9.]+))?/),versionStr=versionMatch?versionMatch[2]:"0.0.0";editingSettings.couchDB_USER in responseConfig.admins?addSuccess($msg("obsidianLiveSyncSettingTab.okAdminPrivileges")):addSuccess($msg("obsidianLiveSyncSettingTab.warnNoAdmin"));isGreaterThanOrEqual(versionStr,"3.2.0")?"true"!=(null==(_c3=null==responseConfig?void 0:responseConfig.chttpd)?void 0:_c3.require_valid_user)?addError($msg("obsidianLiveSyncSettingTab.errRequireValidUser"),$msg("obsidianLiveSyncSettingTab.msgSetRequireValidUser"),"chttpd/require_valid_user","true"):addSuccess($msg("obsidianLiveSyncSettingTab.okRequireValidUser")):"true"!=(null==(_d2=null==responseConfig?void 0:responseConfig.chttpd_auth)?void 0:_d2.require_valid_user)?addError($msg("obsidianLiveSyncSettingTab.errRequireValidUserAuth"),$msg("obsidianLiveSyncSettingTab.msgSetRequireValidUserAuth"),"chttpd_auth/require_valid_user","true"):addSuccess($msg("obsidianLiveSyncSettingTab.okRequireValidUserAuth"));(null==responseConfig?void 0:responseConfig.httpd["WWW-Authenticate"])?addSuccess($msg("obsidianLiveSyncSettingTab.okWwwAuth")):addError($msg("obsidianLiveSyncSettingTab.errMissingWwwAuth"),$msg("obsidianLiveSyncSettingTab.msgSetWwwAuth"),"httpd/WWW-Authenticate",'Basic realm="couchdb"');isGreaterThanOrEqual(versionStr,"3.2.0")?"true"!=(null==(_e2=null==responseConfig?void 0:responseConfig.chttpd)?void 0:_e2.enable_cors)?addError($msg("obsidianLiveSyncSettingTab.errEnableCorsChttpd"),$msg("obsidianLiveSyncSettingTab.msgEnableCorsChttpd"),"chttpd/enable_cors","true"):addSuccess($msg("obsidianLiveSyncSettingTab.okEnableCorsChttpd")):"true"!=(null==(_f=null==responseConfig?void 0:responseConfig.httpd)?void 0:_f.enable_cors)?addError($msg("obsidianLiveSyncSettingTab.errEnableCors"),$msg("obsidianLiveSyncSettingTab.msgEnableCors"),"httpd/enable_cors","true"):addSuccess($msg("obsidianLiveSyncSettingTab.okEnableCors"));if(!isCloudantURI(editingSettings.couchDB_URI)){Number(null!=(_h2=null==(_g=null==responseConfig?void 0:responseConfig.chttpd)?void 0:_g.max_http_request_size)?_h2:0)<4294967296?addError($msg("obsidianLiveSyncSettingTab.errMaxRequestSize"),$msg("obsidianLiveSyncSettingTab.msgSetMaxRequestSize"),"chttpd/max_http_request_size","4294967296"):addSuccess($msg("obsidianLiveSyncSettingTab.okMaxRequestSize"));Number(null!=(_j=null==(_i2=null==responseConfig?void 0:responseConfig.couchdb)?void 0:_i2.max_document_size)?_j:0)<5e7?addError($msg("obsidianLiveSyncSettingTab.errMaxDocumentSize"),$msg("obsidianLiveSyncSettingTab.msgSetMaxDocSize"),"couchdb/max_document_size","50000000"):addSuccess($msg("obsidianLiveSyncSettingTab.okMaxDocumentSize"))}"true"!=(null==(_k=null==responseConfig?void 0:responseConfig.cors)?void 0:_k.credentials)?addError($msg("obsidianLiveSyncSettingTab.errCorsCredentials"),$msg("obsidianLiveSyncSettingTab.msgSetCorsCredentials"),"cors/credentials","true"):addSuccess($msg("obsidianLiveSyncSettingTab.okCorsCredentials"));const ConfiguredOrigins=((null!=(_m2=null==(_l=null==responseConfig?void 0:responseConfig.cors)?void 0:_l.origins)?_m2:"")+"").split(",");if("*"==(null==(_n=null==responseConfig?void 0:responseConfig.cors)?void 0:_n.origins)||-1!==ConfiguredOrigins.indexOf("app://obsidian.md")&&-1!==ConfiguredOrigins.indexOf("capacitor://localhost")&&-1!==ConfiguredOrigins.indexOf("http://localhost"))addSuccess($msg("obsidianLiveSyncSettingTab.okCorsOrigins"));else{const fixedValue=[...new Set([...ConfiguredOrigins.map(e3=>e3.trim()),"app://obsidian.md","capacitor://localhost","http://localhost"])].join(",");addError($msg("obsidianLiveSyncSettingTab.errCorsOrigins"),$msg("obsidianLiveSyncSettingTab.msgSetCorsOrigins"),"cors/origins",fixedValue)}addMessage($msg("obsidianLiveSyncSettingTab.msgConnectionCheck"),["ob-btn-config-head"]);addMessage($msg("obsidianLiveSyncSettingTab.msgCurrentOrigin",{origin:window.location.origin}));const origins=["app://obsidian.md","capacitor://localhost","http://localhost"];for(const org of origins){const rr=await requestToCouchDBWithCredentials(editingSettings.couchDB_URI,credential,org,void 0,void 0,void 0,customHeaders),responseHeaders=Object.fromEntries(Object.entries(rr.headers).map(e3=>{e3[0]=`${e3[0]}`.toLowerCase();return e3}));addMessage($msg("obsidianLiveSyncSettingTab.msgOriginCheck",{org}));"true"!=responseHeaders["access-control-allow-credentials"]?addErrorMessage($msg("obsidianLiveSyncSettingTab.errCorsNotAllowingCredentials")):addSuccess($msg("obsidianLiveSyncSettingTab.okCorsCredentialsForOrigin"));responseHeaders["access-control-allow-origin"]!=org?addErrorMessage($msg("obsidianLiveSyncSettingTab.warnCorsOriginUnmatched",{from:origin,to:responseHeaders["access-control-allow-origin"]})):addSuccess($msg("obsidianLiveSyncSettingTab.okCorsOriginMatched"))}addMessage($msg("obsidianLiveSyncSettingTab.msgDone"),["ob-btn-config-head"]);addMessage($msg("obsidianLiveSyncSettingTab.msgConnectionProxyNote"),["ob-btn-config-info"]);addMessage($msg("obsidianLiveSyncSettingTab.logCheckingConfigDone"))}catch(ex){if(401==(null==ex?void 0:ex.status)){addErrorMessage($msg("obsidianLiveSyncSettingTab.errAccessForbidden"));addErrorMessage($msg("obsidianLiveSyncSettingTab.errCannotContinueTest"));addMessage($msg("obsidianLiveSyncSettingTab.logCheckingConfigDone"))}else{addErrorMessage($msg("obsidianLiveSyncSettingTab.logCheckingConfigFailed"));Logger(ex)}}return result};on_click2=(_,fixIssue,issue)=>fixIssue(issue());root_211=from_html('
');root_120=from_html('
');root_84=from_html("

Issue detection log:

",1);root26=from_html('
',1);$$css10={hash:"svelte-a38xug",code:"\n /* Make .check-result a CSS Grid: let .message expand and keep .operations at minimum width, aligned to the right */.check-results.svelte-a38xug {\n /* Adjust spacing as required */margin-top:0.75rem;}.check-result.svelte-a38xug {display:grid;grid-template-columns:1fr auto; /* message takes remaining space, operations use minimum width */align-items:center; /* vertically centre align */gap:0.5rem 1rem;padding:0rem 0.5rem;border-radius:0;box-shadow:none;border-left:0.5em solid var(--interactive-accent);margin-bottom:0.25lh;}.check-result.error.svelte-a38xug {border-left:0.5em solid var(--text-error);}.check-result.success.svelte-a38xug {border-left:0.5em solid var(--text-success);}.check-result.svelte-a38xug .message:where(.svelte-a38xug) {\n /* Wrap long messages */white-space:normal;word-break:break-word;font-size:0.95rem;color:var(--text-normal);}.check-result.svelte-a38xug .operations:where(.svelte-a38xug) {\n /* Centre the button(s) vertically and align to the right */display:flex;align-items:center;justify-content:flex-end;gap:0.5rem;}\n\n /* For small screens: move .operations below and stack vertically */\n @media (max-width: 520px) {.check-result.svelte-a38xug {grid-template-columns:1fr;grid-auto-rows:auto;}.check-result.svelte-a38xug .operations:where(.svelte-a38xug) {justify-content:flex-start;margin-top:0.5rem;}\n }"};delegate(["click"]);root_212=from_html('');root_49=from_html('');root_64=from_html('');root_85=from_html('');root_1110=from_html('');root_134=from_html('');root_142=from_html("");root_152=from_html('');root_162=from_html('');root_182=from_html('');root_192=from_html('');root_123=from_html(" ",1);root_242=from_html(" ",1);root27=from_html("
",1);root_213=from_html('');root_410=from_html('');root_65=from_html('');root_76=from_html('');root_86=from_html('');root_93=from_html('');root_1111=from_html('');root_143=from_html('');root_183=from_html(" ",1);root28=from_html(" ",1);new(PouchError=class extends Error{constructor(status,error,reason){super();this.status=status;this.name=error;this.message=reason;this.error=!0}toString(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})}})(401,"unauthorized","Name or password is incorrect.");MISSING_BULK_DOCS=new PouchError(400,"bad_request","Missing JSON list of 'docs'");MISSING_DOC=new PouchError(404,"not_found","missing");REV_CONFLICT=new PouchError(409,"conflict","Document update conflict");INVALID_ID=new PouchError(400,"bad_request","_id field must contain a string");MISSING_ID=new PouchError(412,"missing_id","_id is required for puts");RESERVED_ID=new PouchError(400,"bad_request","Only reserved document ids may start with underscore.");new PouchError(412,"precondition_failed","Database not open");UNKNOWN_ERROR=new PouchError(500,"unknown_error","Database encountered an unknown error");BAD_ARG=new PouchError(500,"badarg","Some query argument is invalid");new PouchError(400,"invalid_request","Request was invalid");QUERY_PARSE_ERROR=new PouchError(400,"query_parse_error","Some query parameter is invalid");DOC_VALIDATION=new PouchError(500,"doc_validation","Bad special document member");BAD_REQUEST=new PouchError(400,"bad_request","Something wrong with the request");NOT_AN_OBJECT=new PouchError(400,"bad_request","Document must be a JSON object");new PouchError(404,"not_found","Database not found");IDB_ERROR=new PouchError(500,"indexed_db_went_bad","unknown");new PouchError(500,"web_sql_went_bad","unknown");new PouchError(500,"levelDB_went_went_bad","unknown");new PouchError(403,"forbidden","Forbidden by design doc validate_doc_update function");INVALID_REV=new PouchError(400,"bad_request","Invalid rev format");new PouchError(412,"file_exists","The database could not be created, the file already exists.");MISSING_STUB=new PouchError(412,"missing_stub","A pre-existing attachment stub wasn't found");new PouchError(413,"invalid_url","Provided URL is invalid");rnds8=new Uint8Array(16);regex_default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;validate_default=function validate2(uuid2){return"string"==typeof uuid2&®ex_default.test(uuid2)};byteToHex=[];for(i2=0;i2<256;++i2)byteToHex.push((i2+256).toString(16).substr(1));stringify_default=function stringify(arr){var offset=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,uuid2=(byteToHex[arr[offset+0]]+byteToHex[arr[offset+1]]+byteToHex[arr[offset+2]]+byteToHex[arr[offset+3]]+"-"+byteToHex[arr[offset+4]]+byteToHex[arr[offset+5]]+"-"+byteToHex[arr[offset+6]]+byteToHex[arr[offset+7]]+"-"+byteToHex[arr[offset+8]]+byteToHex[arr[offset+9]]+"-"+byteToHex[arr[offset+10]]+byteToHex[arr[offset+11]]+byteToHex[arr[offset+12]]+byteToHex[arr[offset+13]]+byteToHex[arr[offset+14]]+byteToHex[arr[offset+15]]).toLowerCase();if(!validate_default(uuid2))throw TypeError("Stringified UUID is invalid");return uuid2};v4_default=function v42(options,buf,offset){var rnds,i2;(rnds=(options=options||{}).random||(options.rng||rng)())[6]=15&rnds[6]|64;rnds[8]=63&rnds[8]|128;if(buf){offset=offset||0;for(i2=0;i2<16;++i2)buf[offset+i2]=rnds[i2];return buf}return stringify_default(rnds)};thisAtob=function(str){return atob(str)};thisBtoa=function(str){return btoa(str)};import_spark_md5=__toESM(require_spark_md5());setImmediateShim=self.setImmediate||self.setTimeout;MD5_CHUNK_SIZE=32768;import_events16=__toESM(require_events());funcToString=Function.prototype.toString;objectCtorString=funcToString.call(Object);MAX_NUM_CONCURRENT_REQUESTS=6;try{localStorage.setItem("_pouch_check_localstorage",1);hasLocal=!!localStorage.getItem("_pouch_check_localstorage")}catch(e3){hasLocal=!1}nextTick="function"==typeof queueMicrotask?queueMicrotask:function nextTick2(fn){Promise.resolve().then(fn)};Changes=class extends import_events16.default{constructor(){super();this._listeners={};hasLocalStorage()&&addEventListener("storage",e3=>{this.emit(e3.key)})}addListener(dbName,id,db,opts){function eventFunction(){if(self3._listeners[id])if(inprogress)inprogress="waiting";else{inprogress=!0;var changesOpts=pick(opts,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary","return_docs"]);db.changes(changesOpts).on("change",function(c3){if(c3.seq>opts.since&&!opts.cancelled){opts.since=c3.seq;opts.onChange(c3)}}).on("complete",function(){"waiting"===inprogress&&nextTick(eventFunction);inprogress=!1}).on("error",function onError(){inprogress=!1})}}var inprogress,self3;if(!this._listeners[id]){inprogress=!1;self3=this;this._listeners[id]=eventFunction;this.on(dbName,eventFunction)}}removeListener(dbName,id){if(id in this._listeners){super.removeListener(dbName,this._listeners[id]);delete this._listeners[id]}}notifyLocalWindows(dbName){hasLocalStorage()&&(localStorage[dbName]="a"===localStorage[dbName]?"b":"a")}notify(dbName){this.emit(dbName);this.notifyLocalWindows(dbName)}};(function f2(){}).name;keys2=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];qName="queryKey";qParser=/(?:^|&)([^&=]*)=?([^&]*)/g;parser2=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;uuid=v4_default;f3=fetch;h2=Headers;MIN_MAGNITUDE=-324;MAGNITUDE_DIGITS=3;SEP="";combinationFields=["$or","$nor","$not"];matchers={$elemMatch:function(doc,userValue,parsedField,docFieldValue){return!!Array.isArray(docFieldValue)&&0!==docFieldValue.length&&("object"==typeof docFieldValue[0]&&null!==docFieldValue[0]?docFieldValue.some(function(val){return rowFilter(val,userValue,Object.keys(userValue))}):docFieldValue.some(function(val){return matchSelector(userValue,doc,parsedField,val)}))},$allMatch:function(doc,userValue,parsedField,docFieldValue){return!!Array.isArray(docFieldValue)&&0!==docFieldValue.length&&("object"==typeof docFieldValue[0]&&null!==docFieldValue[0]?docFieldValue.every(function(val){return rowFilter(val,userValue,Object.keys(userValue))}):docFieldValue.every(function(val){return matchSelector(userValue,doc,parsedField,val)}))},$eq:function(doc,userValue,parsedField,docFieldValue){return fieldIsNotUndefined(docFieldValue)&&0===collate(docFieldValue,userValue)},$gte:function(doc,userValue,parsedField,docFieldValue){return fieldIsNotUndefined(docFieldValue)&&collate(docFieldValue,userValue)>=0},$gt:function(doc,userValue,parsedField,docFieldValue){return fieldIsNotUndefined(docFieldValue)&&collate(docFieldValue,userValue)>0},$lte:function(doc,userValue,parsedField,docFieldValue){return fieldIsNotUndefined(docFieldValue)&&collate(docFieldValue,userValue)<=0},$lt:function(doc,userValue,parsedField,docFieldValue){return fieldIsNotUndefined(docFieldValue)&&collate(docFieldValue,userValue)<0},$exists:function(doc,userValue,parsedField,docFieldValue){return userValue?fieldIsNotUndefined(docFieldValue):!fieldIsNotUndefined(docFieldValue)},$mod:function(doc,userValue,parsedField,docFieldValue){return fieldExists(docFieldValue)&&modField(docFieldValue,userValue)},$ne:function(doc,userValue,parsedField,docFieldValue){return userValue.every(function(neValue){return 0!==collate(docFieldValue,neValue)})},$in:function(doc,userValue,parsedField,docFieldValue){return fieldExists(docFieldValue)&&arrayContainsValue(docFieldValue,userValue)},$nin:function(doc,userValue,parsedField,docFieldValue){return fieldExists(docFieldValue)&&!arrayContainsValue(docFieldValue,userValue)},$size:function(doc,userValue,parsedField,docFieldValue){return fieldExists(docFieldValue)&&Array.isArray(docFieldValue)&&arraySize(docFieldValue,userValue)},$all:function(doc,userValue,parsedField,docFieldValue){return Array.isArray(docFieldValue)&&arrayContainsAllValues(docFieldValue,userValue)},$regex:function(doc,userValue,parsedField,docFieldValue){return fieldExists(docFieldValue)&&"string"==typeof docFieldValue&&userValue.every(function(regexValue){return regexMatch(docFieldValue,regexValue)})},$type:function(doc,userValue,parsedField,docFieldValue){return typeMatch(docFieldValue,userValue)}};index_browser_es_default=function applyChangesFilterPlugin(PouchDB2){PouchDB2._changesFilterPlugin={validate:validate3,normalize,shouldFilter,filter:filter2}};import_events17=__toESM(require_events());Changes2=class extends import_events17.default{constructor(db,opts,callback){var complete,promise;super();this.db=db;opts=opts?clone2(opts):{};complete=opts.complete=once2((err3,resp)=>{err3?listenerCount(this,"error")>0&&this.emit("error",err3):this.emit("complete",resp);this.removeAllListeners();db.removeListener("destroyed",onDestroy2)});if(callback){this.on("complete",function(resp){callback(null,resp)});this.on("error",callback)}const onDestroy2=()=>{this.cancel()};db.once("destroyed",onDestroy2);opts.onChange=(change,pending3,lastSeq)=>{this.isCancelled||tryCatchInChangeListener(this,change,pending3,lastSeq)};promise=new Promise(function(fulfill,reject){opts.complete=function(err3,res2){err3?reject(err3):fulfill(res2)}});this.once("cancel",function(){db.removeListener("destroyed",onDestroy2);opts.complete(null,{status:"cancelled"})});this.then=promise.then.bind(promise);this.catch=promise.catch.bind(promise);this.then(function(result){complete(null,result)},complete);db.taskqueue.isReady?this.validateChanges(opts):db.taskqueue.addTask(failed2=>{failed2?opts.complete(failed2):this.isCancelled?this.emit("cancel"):this.validateChanges(opts)})}cancel(){this.isCancelled=!0;this.db.taskqueue.isReady&&this.emit("cancel")}validateChanges(opts){var callback=opts.complete;PouchDB._changesFilterPlugin?PouchDB._changesFilterPlugin.validate(opts,err3=>{if(err3)return callback(err3);this.doChanges(opts)}):this.doChanges(opts)}doChanges(opts){var newPromise,callback=opts.complete;"live"in(opts=clone2(opts))&&!("continuous"in opts)&&(opts.continuous=opts.live);opts.processChange=processChange;"latest"===opts.since&&(opts.since="now");opts.since||(opts.since=0);if("now"!==opts.since){if(PouchDB._changesFilterPlugin){PouchDB._changesFilterPlugin.normalize(opts);if(PouchDB._changesFilterPlugin.shouldFilter(this,opts))return PouchDB._changesFilterPlugin.filter(this,opts)}else["doc_ids","filter","selector","view"].forEach(function(key3){key3 in opts&&guardedConsole("warn",'The "'+key3+'" option was passed in to changes/replicate, but pouchdb-changes-filter plugin is not installed, so it was ignored. Please install the plugin to enable filtering.')});"descending"in opts||(opts.descending=!1);opts.limit=0===opts.limit?1:opts.limit;opts.complete=callback;if((newPromise=this.db._changes(opts))&&"function"==typeof newPromise.cancel){const cancel2=this.cancel;this.cancel=(...args)=>{newPromise.cancel();cancel2.apply(this,args)}}}else this.db.info().then(info3=>{if(this.isCancelled)callback(null,{status:"cancelled"});else{opts.since=info3.update_seq;this.doChanges(opts)}},callback)}};validRevRegex=/^\d+-[^-]*$/;AbstractPouchDB=class extends import_events17.default{_setup(){this.post=adapterFun("post",function(doc,opts,callback){if("function"==typeof opts){callback=opts;opts={}}if(isNotSingleDoc(doc))return callback(createError(NOT_AN_OBJECT));this.bulkDocs({docs:[doc]},opts,yankError(callback,doc._id))}).bind(this);this.put=adapterFun("put",function(doc,opts,cb2){if("function"==typeof opts){cb2=opts;opts={}}if(isNotSingleDoc(doc))return cb2(createError(NOT_AN_OBJECT));invalidIdError(doc._id);if("_rev"in doc&&!isValidRev(doc._rev))return cb2(createError(INVALID_REV));if(isLocalId(doc._id)&&"function"==typeof this._putLocal)return doc._deleted?this._removeLocal(doc,cb2):this._putLocal(doc,cb2);const putDoc=next2=>{"function"==typeof this._put&&!1!==opts.new_edits?this._put(doc,opts,next2):this.bulkDocs({docs:[doc]},opts,yankError(next2,doc._id))};if(opts.force&&doc._rev){(function transformForceOptionToNewEditsOption(){var parts=doc._rev.split("-"),oldRevId=parts[1],newRevNum=parseInt(parts[0],10)+1,newRevId=rev2();doc._revisions={start:newRevNum,ids:[newRevId,oldRevId]};doc._rev=newRevNum+"-"+newRevId;opts.new_edits=!1})();putDoc(function(err3){var result=err3?null:{ok:!0,id:doc._id,rev:doc._rev};cb2(err3,result)})}else putDoc(cb2)}).bind(this);this.putAttachment=adapterFun("putAttachment",function(docId,attachmentId,rev$$1,blob,type){function createAttachment(doc){var prevrevpos="_rev"in doc?parseInt(doc._rev,10):0;doc._attachments=doc._attachments||{};doc._attachments[attachmentId]={content_type:type,data:blob,revpos:++prevrevpos};return api.put(doc)}var api=this;if("function"==typeof type){type=blob;blob=rev$$1;rev$$1=null}if(void 0===type){type=blob;blob=rev$$1;rev$$1=null}type||guardedConsole("warn","Attachment",attachmentId,"on document",docId,"is missing content_type");return api.get(docId).then(function(doc){if(doc._rev!==rev$$1)throw createError(REV_CONFLICT);return createAttachment(doc)},function(err3){if(err3.reason===MISSING_DOC.message)return createAttachment({_id:docId});throw err3})}).bind(this);this.removeAttachment=adapterFun("removeAttachment",function(docId,attachmentId,rev$$1,callback){this.get(docId,(err3,obj)=>{if(err3)callback(err3);else if(obj._rev===rev$$1){if(!obj._attachments)return callback();delete obj._attachments[attachmentId];0===Object.keys(obj._attachments).length&&delete obj._attachments;this.put(obj,callback)}else callback(createError(REV_CONFLICT))})}).bind(this);this.remove=adapterFun("remove",function(docOrId,optsOrRev,opts,callback){var doc,newDoc;if("string"==typeof optsOrRev){doc={_id:docOrId,_rev:optsOrRev};if("function"==typeof opts){callback=opts;opts={}}}else{doc=docOrId;if("function"==typeof optsOrRev){callback=optsOrRev;opts={}}else{callback=opts;opts=optsOrRev}}(opts=opts||{}).was_delete=!0;(newDoc={_id:doc._id,_rev:doc._rev||opts.rev})._deleted=!0;if(isLocalId(newDoc._id)&&"function"==typeof this._removeLocal)return this._removeLocal(doc,callback);this.bulkDocs({docs:[newDoc]},opts,yankError(callback,newDoc._id))}).bind(this);this.revsDiff=adapterFun("revsDiff",function(req,opts,callback){function addToMissing(id,revId){missing.has(id)||missing.set(id,{missing:[]});missing.get(id).missing.push(revId)}function processDoc(id,rev_tree){var missingForId=req[id].slice(0);traverseRevTree(rev_tree,function(isLeaf,pos,revHash,ctx,opts2){var rev$$1=pos+"-"+revHash,idx2=missingForId.indexOf(rev$$1);if(-1!==idx2){missingForId.splice(idx2,1);"available"!==opts2.status&&addToMissing(id,rev$$1)}});missingForId.forEach(function(rev$$1){addToMissing(id,rev$$1)})}var ids,count,missing;if("function"==typeof opts){callback=opts;opts={}}if(!(ids=Object.keys(req)).length)return callback(null,{});count=0;missing=new Map;ids.forEach(function(id){this._getRevisionTree(id,function(err3,rev_tree){if(err3&&404===err3.status&&"missing"===err3.message)missing.set(id,{missing:req[id]});else{if(err3)return callback(err3);processDoc(id,rev_tree)}if(++count===ids.length){var missingObj={};missing.forEach(function(value,key3){missingObj[key3]=value});return callback(null,missingObj)}})},this)}).bind(this);this.bulkGet=adapterFun("bulkGet",function(opts,callback){bulkGet(this,opts,callback)}).bind(this);this.compactDocument=adapterFun("compactDocument",function(docId,maxHeight,callback){this._getRevisionTree(docId,(err3,revTree)=>{var height,candidates,revs;if(err3)return callback(err3);height=computeHeight(revTree);candidates=[];revs=[];Object.keys(height).forEach(function(rev$$1){height[rev$$1]>maxHeight&&candidates.push(rev$$1)});traverseRevTree(revTree,function(isLeaf,pos,revHash,ctx,opts){var rev$$1=pos+"-"+revHash;"available"===opts.status&&-1!==candidates.indexOf(rev$$1)&&revs.push(rev$$1)});this._doCompaction(docId,revs,callback)})}).bind(this);this.compact=adapterFun("compact",function(opts,callback){if("function"==typeof opts){callback=opts;opts={}}opts=opts||{};this._compactionQueue=this._compactionQueue||[];this._compactionQueue.push({opts,callback});1===this._compactionQueue.length&&doNextCompaction(this)}).bind(this);this.get=adapterFun("get",function(id,opts,cb2){var leaves,i2;if("function"==typeof opts){cb2=opts;opts={}}opts=opts||{};if("string"!=typeof id)return cb2(createError(INVALID_ID));if(isLocalId(id)&&"function"==typeof this._getLocal)return this._getLocal(id,cb2);leaves=[];const finishOpenRevs=()=>{var result=[],count=leaves.length;if(!count)return cb2(null,result);leaves.forEach(leaf=>{this.get(id,{rev:leaf,revs:opts.revs,latest:opts.latest,attachments:opts.attachments,binary:opts.binary},function(err3,doc){var existing,i3,l3;if(err3)result.push({missing:leaf});else{for(i3=0,l3=result.length;i3{var doc,metadata,ctx,conflicts,splittedRev,revNo,revHash,paths,path2,i3,currentPath,howMany,pos,attachments,count,key3;if(err3){err3.docId=id;return cb2(err3)}doc=result.doc;metadata=result.metadata;ctx=result.ctx;opts.conflicts&&(conflicts=collectConflicts(metadata)).length&&(doc._conflicts=conflicts);isDeleted(metadata,doc._rev)&&(doc._deleted=!0);if(opts.revs||opts.revs_info){splittedRev=doc._rev.split("-");revNo=parseInt(splittedRev[0],10);revHash=splittedRev[1];paths=rootToLeaf(metadata.rev_tree);path2=null;for(i3=0;i3x2.id===revHash);(hashIndex===revNo-1||!path2&&-1!==hashIndex)&&(path2=currentPath)}if(!path2){(err3=new Error("invalid rev tree")).docId=id;return cb2(err3)}const pathId=doc._rev.split("-")[1],indexOfRev=path2.ids.findIndex(x2=>x2.id===pathId)+1;howMany=path2.ids.length-indexOfRev;path2.ids.splice(indexOfRev,howMany);path2.ids.reverse();opts.revs&&(doc._revisions={start:path2.pos+path2.ids.length-1,ids:path2.ids.map(function(rev$$1){return rev$$1.id})});if(opts.revs_info){pos=path2.pos+path2.ids.length;doc._revs_info=path2.ids.map(function(rev$$1){return{rev:--pos+"-"+rev$$1.id,status:rev$$1.opts.status}})}}if(opts.attachments&&doc._attachments){attachments=doc._attachments;if(0===(count=Object.keys(attachments).length))return cb2(null,doc);Object.keys(attachments).forEach(key4=>{this._getAttachment(doc._id,key4,attachments[key4],{binary:opts.binary,metadata,ctx},function(err4,data){var att=doc._attachments[key4];att.data=data;delete att.stub;delete att.length;--count||cb2(null,doc)})})}else{if(doc._attachments)for(key3 in doc._attachments)Object.prototype.hasOwnProperty.call(doc._attachments,key3)&&(doc._attachments[key3].stub=!0);cb2(null,doc)}});if("all"===opts.open_revs)this._getRevisionTree(id,function(err3,rev_tree){if(err3)return cb2(err3);leaves=collectLeaves(rev_tree).map(function(leaf){return leaf.rev});finishOpenRevs()});else{if(!Array.isArray(opts.open_revs))return cb2(createError(UNKNOWN_ERROR,"function_clause"));leaves=opts.open_revs;for(i2=0;i2{if(err3)return callback(err3);if(!res2.doc._attachments||!res2.doc._attachments[attachmentId])return callback(createError(MISSING_DOC));opts.ctx=res2.ctx;opts.binary=!0;opts.metadata=res2.metadata;this._getAttachment(docId,attachmentId,res2.doc._attachments[attachmentId],opts,callback)})}).bind(this);this.allDocs=adapterFun("allDocs",function(opts,callback){if("function"==typeof opts){callback=opts;opts={}}opts.skip=void 0!==opts.skip?opts.skip:0;opts.start_key&&(opts.startkey=opts.start_key);opts.end_key&&(opts.endkey=opts.end_key);if("keys"in opts){if(!Array.isArray(opts.keys))return callback(new TypeError("options.keys must be an array"));var incompatibleOpt=["startkey","endkey","key"].filter(function(incompatibleOpt2){return incompatibleOpt2 in opts})[0];if(incompatibleOpt){callback(createError(QUERY_PARSE_ERROR,"Query parameter `"+incompatibleOpt+"` is not compatible with multi-get"));return}if(!isRemote(this)){allDocsKeysParse(opts);if(0===opts.keys.length)return this._allDocs({limit:0},callback)}}return this._allDocs(opts,callback)}).bind(this);this.close=adapterFun("close",function(callback){this._closed=!0;this.emit("closed");return this._close(callback)}).bind(this);this.info=adapterFun("info",function(callback){this._info((err3,info3)=>{if(err3)return callback(err3);info3.db_name=info3.db_name||this.name;info3.auto_compaction=!(!this.auto_compaction||isRemote(this));info3.adapter=this.adapter;callback(null,info3)})}).bind(this);this.id=adapterFun("id",function(callback){return this._id(callback)}).bind(this);this.bulkDocs=adapterFun("bulkDocs",function(req,opts,callback){var i2,attachmentError,adapter,ids;if("function"==typeof opts){callback=opts;opts={}}opts=opts||{};Array.isArray(req)&&(req={docs:req});if(!req||!req.docs||!Array.isArray(req.docs))return callback(createError(MISSING_BULK_DOCS));for(i2=0;i2{this._destroy(opts,(err3,resp)=>{if(err3)return callback(err3);this._destroyed=!0;this.emit("destroyed");callback(null,resp||{ok:!0})})};if(isRemote(this))return destroyDb();this.get("_local/_pouch_dependentDbs",(err3,localDoc)=>{var dependentDbs,PouchDB2,deletedMap;if(err3)return 404!==err3.status?callback(err3):destroyDb();dependentDbs=localDoc.dependentDbs;PouchDB2=this.constructor;deletedMap=Object.keys(dependentDbs).map(name=>{var trueName=usePrefix?name.replace(new RegExp("^"+PouchDB2.prefix),""):name;return new PouchDB2(trueName,this.__opts).destroy()});Promise.all(deletedMap).then(destroyDb,callback)})}).bind(this)}_compact(opts,callback){var taskId,changesOpts={return_docs:!1,last_seq:opts.last_seq||0,since:opts.last_seq||0},promises=[],compactedDocs=0;const onChange=row=>{this.activeTasks.update(taskId,{completed_items:++compactedDocs});promises.push(this.compactDocument(row.id,0))},onError=err3=>{this.activeTasks.remove(taskId,err3);callback(err3)},onComplete=resp=>{var lastSeq=resp.last_seq;Promise.all(promises).then(()=>upsert(this,"_local/compaction",doc=>{if(!doc.last_seq||doc.last_seq{this.activeTasks.remove(taskId);callback(null,{ok:!0})}).catch(onError)};this.info().then(info3=>{taskId=this.activeTasks.add({name:"database_compaction",total_items:info3.update_seq-changesOpts.last_seq});this.changes(changesOpts).on("change",onChange).on("complete",onComplete).on("error",onError)})}changes(opts,callback){if("function"==typeof opts){callback=opts;opts={}}(opts=opts||{}).return_docs="return_docs"in opts?opts.return_docs:!opts.live;return new Changes2(this,opts,callback)}type(){return"function"==typeof this._type?this._type():this.adapter}};AbstractPouchDB.prototype.purge=adapterFun("_purge",function(docId,rev$$1,callback){if(void 0===this._purge)return callback(createError(UNKNOWN_ERROR,"Purge is not implemented in the "+this.adapter+" adapter."));var self3=this;self3._getRevisionTree(docId,(error,revs)=>{if(error)return callback(error);if(!revs)return callback(createError(MISSING_DOC));let path2;try{path2=findPathToLeaf(revs,rev$$1)}catch(error2){return callback(error2.message||error2)}self3._purge(docId,path2,(error2,result)=>{if(error2)return callback(error2);appendPurgeSeq(self3,docId,rev$$1).then(function(){return callback(null,result)})})})});TaskQueue=class{constructor(){this.isReady=!1;this.failed=!1;this.queue=[]}execute(){var fun;if(this.failed)for(;fun=this.queue.shift();)fun(this.failed);else for(;fun=this.queue.shift();)fun()}fail(err3){this.failed=err3;this.execute()}ready(db){this.isReady=!0;this.db=db;this.execute()}addTask(fun){this.queue.push(fun);this.failed&&this.execute()}};PouchInternal=class extends AbstractPouchDB{constructor(name,opts){super();this._setup(name,opts)}_setup(name,opts){var backend;super._setup();opts=opts||{};if(name&&"object"==typeof name){name=(opts=name).name;delete opts.name}void 0===opts.deterministic_revs&&(opts.deterministic_revs=!0);this.__opts=opts=clone2(opts);this.auto_compaction=opts.auto_compaction;this.purged_infos_limit=opts.purged_infos_limit||1e3;this.prefix=PouchDB.prefix;if("string"!=typeof name)throw new Error("Missing/invalid DB name");backend=parseAdapter((opts.prefix||"")+name,opts);opts.name=backend.name;opts.adapter=opts.adapter||backend.adapter;this.name=name;this._adapter=opts.adapter;PouchDB.emit("debug",["adapter","Picked adapter: ",opts.adapter]);if(!PouchDB.adapters[opts.adapter]||!PouchDB.adapters[opts.adapter].valid())throw new Error("Invalid Adapter: "+opts.adapter);if(opts.view_adapter&&(!PouchDB.adapters[opts.view_adapter]||!PouchDB.adapters[opts.view_adapter].valid()))throw new Error("Invalid View Adapter: "+opts.view_adapter);this.taskqueue=new TaskQueue;this.adapter=opts.adapter;PouchDB.adapters[opts.adapter].call(this,opts,err3=>{if(err3)return this.taskqueue.fail(err3);prepareForDestruction(this);this.emit("created",this);PouchDB.emit("created",this.name);this.taskqueue.ready(this)})}};PouchDB=createClass(PouchInternal,function(name,opts){PouchInternal.prototype._setup.call(this,name,opts)});ActiveTasks=class{constructor(){this.tasks={}}list(){return Object.values(this.tasks)}add(task){const id=v4_default();this.tasks[id]={id,name:task.name,total_items:task.total_items,created_at:(new Date).toJSON()};return id}get(id){return this.tasks[id]}remove(id,reason){delete this.tasks[id];return this.tasks}update(id,updatedTask){const task=this.tasks[id];if(void 0!==task){const mergedTask={id:task.id,name:task.name,created_at:task.created_at,total_items:updatedTask.total_items||task.total_items,completed_items:updatedTask.completed_items||task.completed_items,updated_at:(new Date).toJSON()};this.tasks[id]=mergedTask}return this.tasks}};PouchDB.adapters={};PouchDB.preferredAdapters=[];PouchDB.prefix="_pouch_";eventEmitter=new import_events17.default;(function setUpEventEmitter(Pouch){Object.keys(import_events17.default.prototype).forEach(function(key3){"function"==typeof import_events17.default.prototype[key3]&&(Pouch[key3]=eventEmitter[key3].bind(eventEmitter))});var destructListeners=Pouch._destructionListeners=new Map;Pouch.on("ref",function onConstructorRef(db){destructListeners.has(db.name)||destructListeners.set(db.name,[]);destructListeners.get(db.name).push(db)});Pouch.on("unref",function onConstructorUnref(db){var dbList,pos;if(destructListeners.has(db.name)&&!((pos=(dbList=destructListeners.get(db.name)).indexOf(db))<0)){dbList.splice(pos,1);dbList.length>1?destructListeners.set(db.name,dbList):destructListeners.delete(db.name)}});Pouch.on("destroyed",function onConstructorDestroyed(name){if(destructListeners.has(name)){var dbList=destructListeners.get(name);destructListeners.delete(name);dbList.forEach(function(db){db.emit("destroyed",!0)})}})})(PouchDB);PouchDB.adapter=function(id,obj,addToPreferredAdapters){if(obj.valid()){PouchDB.adapters[id]=obj;addToPreferredAdapters&&PouchDB.preferredAdapters.push(id)}};PouchDB.plugin=function(obj){if("function"==typeof obj)obj(PouchDB);else{if("object"!=typeof obj||0===Object.keys(obj).length)throw new Error('Invalid plugin: got "'+obj+'", expected an object or a function');Object.keys(obj).forEach(function(id){PouchDB.prototype[id]=obj[id]})}this.__defaults&&(PouchDB.__defaults=Object.assign({},this.__defaults));return PouchDB};PouchDB.defaults=function(defaultOpts){let PouchWithDefaults=createClass(PouchDB,function(name,opts){opts=opts||{};if(name&&"object"==typeof name){name=(opts=name).name;delete opts.name}opts=Object.assign({},PouchWithDefaults.__defaults,opts);PouchDB.call(this,name,opts)});PouchWithDefaults.preferredAdapters=PouchDB.preferredAdapters.slice();Object.keys(PouchDB).forEach(function(key3){key3 in PouchWithDefaults||(PouchWithDefaults[key3]=PouchDB[key3])});PouchWithDefaults.__defaults=Object.assign({},this.__defaults,defaultOpts);return PouchWithDefaults};PouchDB.fetch=function(url,opts){return f3(url,opts)};PouchDB.prototype.activeTasks=PouchDB.activeTasks=new ActiveTasks;PouchDB.plugin(index_browser_es_default);PouchDB.version="9.0.0";index_es_default=PouchDB;import_vuvuzela=__toESM(require_vuvuzela());reservedWords=toObject(["_id","_rev","_access","_attachments","_deleted","_revisions","_revs_info","_conflicts","_deleted_conflicts","_local_seq","_rev_tree","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats","_removed"]);dataWords=toObject(["_access","_attachments","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats"]);ADAPTER_VERSION=5;DOC_STORE="document-store";BY_SEQ_STORE="by-sequence";ATTACH_STORE="attach-store";ATTACH_AND_SEQ_STORE="attach-seq-store";META_STORE="meta-store";LOCAL_STORE="local-store";DETECT_BLOB_SUPPORT_STORE="detect-blob-support";changesHandler$1=new Changes;running=!1;queue=[];cachedDBs=new Map;openReqList=new Map;IdbPouch.valid=function(){try{return"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e3){return!1}};index_es_default2=function index2(PouchDB2){PouchDB2.adapter("idb",IdbPouch,!0)};IDB_NULL=Number.MIN_SAFE_INTEGER;IDB_FALSE=Number.MIN_SAFE_INTEGER+1;IDB_TRUE=Number.MIN_SAFE_INTEGER+2;TEST_KEY_INVALID=/^[^a-zA-Z$]|[^a-zA-Z0-9$]+/;TEST_PATH_INVALID=/\\.|(^|\.)[^a-zA-Z$]|[^a-zA-Z0-9$.]+/;KEY_INVALID=new RegExp(TEST_KEY_INVALID.source,"g");PATH_INVALID=new RegExp(TEST_PATH_INVALID.source,"g");SLASH="\\".charCodeAt(0);IS_DOT=".".charCodeAt(0);DOC_STORE2="docs";META_LOCAL_STORE="meta";POUCHDB_IDB_VERSION=2;versionMultiplier=Math.pow(10,13);BINARY_ATTACHMENTS=!1;COUCH_COLLATE_LO=null;COUCH_COLLATE_HI="￿";IDB_COLLATE_LO=Number.NEGATIVE_INFINITY;IDB_COLLATE_HI=[[[[[[[[[[[[]]]]]]]]]]]];ADAPTER_NAME="indexeddb";idbChanges=new Changes;openDatabases={};IndexeddbPouch.valid=function(){return!0};index_es_default3=function index3(PouchDB2){PouchDB2.adapter(ADAPTER_NAME,IndexeddbPouch,!0)};CHANGES_BATCH_SIZE=25;MAX_SIMULTANEOUS_REVS=50;CHANGES_TIMEOUT_BUFFER=5e3;DEFAULT_HEARTBEAT=1e4;supportsBulkGetMap={};HttpPouch.valid=function(){return!0};index_es_default4=function index4(PouchDB2){PouchDB2.adapter("http",HttpPouch,!1);PouchDB2.adapter("https",HttpPouch,!1)};QueryParseError=class _QueryParseError extends Error{constructor(message){super();this.status=400;this.name="query_parse_error";this.message=message;this.error=!0;try{Error.captureStackTrace(this,_QueryParseError)}catch(e3){}}};NotFoundError=class _NotFoundError extends Error{constructor(message){super();this.status=404;this.name="not_found";this.message=message;this.error=!0;try{Error.captureStackTrace(this,_NotFoundError)}catch(e3){}}};BuiltInError=class _BuiltInError extends Error{constructor(message){super();this.status=500;this.name="invalid_value";this.message=message;this.error=!0;try{Error.captureStackTrace(this,_BuiltInError)}catch(e3){}}};persistentQueues={};tempViewQueue=new(TaskQueue2=class{constructor(){this.promise=Promise.resolve()}add(promiseFactory){this.promise=this.promise.catch(()=>{}).then(()=>promiseFactory());return this.promise}finish(){return this.promise}});index_es_default5=function createAbstractMapReduce(localDocName2,mapper3,reducer3,ddocValidator3){function tryMap(db,fun,doc){try{fun(doc)}catch(e3){emitError(db,e3,{fun,doc})}}function tryReduce(db,fun,keys3,values2,rereduce){try{return{output:fun(keys3,values2,rereduce)}}catch(e3){emitError(db,e3,{fun,keys:keys3,values:values2,rereduce});return{error:e3}}}function sortByKeyThenValue(x2,y2){const keyCompare=collate(x2.key,y2.key);return 0!==keyCompare?keyCompare:collate(x2.value,y2.value)}function sliceResults(results,limit,skip){skip=skip||0;return"number"==typeof limit?results.slice(skip,limit+skip):skip>0?results.slice(skip):results}function rowToDocId(row){const val=row.value;return val&&"object"==typeof val&&val._id||row.id}function readAttachmentsAsBlobOrBuffer2(res2){for(const row of res2.rows){const atts=row.doc&&row.doc._attachments;if(atts)for(const filename of Object.keys(atts)){const att=atts[filename];atts[filename].data=b64ToBluffer(att.data,att.content_type)}}}function postprocessAttachments(opts){return function(res2){opts.include_docs&&opts.attachments&&opts.binary&&readAttachmentsAsBlobOrBuffer2(res2);return res2}}function addHttpParam(paramName,opts,params,asJson){let val=opts[paramName];if(void 0!==val){asJson&&(val=encodeURIComponent(JSON.stringify(val)));params.push(paramName+"="+val)}}function coerceInteger(integerCandidate){if(void 0!==integerCandidate){const asNumber=Number(integerCandidate);return isNaN(asNumber)||asNumber!==parseInt(integerCandidate,10)?integerCandidate:asNumber}}function coerceOptions(opts){opts.group_level=coerceInteger(opts.group_level);opts.limit=coerceInteger(opts.limit);opts.skip=coerceInteger(opts.skip);return opts}function checkPositiveInteger(number){if(number){if("number"!=typeof number)return new QueryParseError(`Invalid value for integer: "${number}"`);if(number<0)return new QueryParseError(`Invalid value for positive integer: "${number}"`)}}function checkQueryParseError(options,fun){const startkeyName=options.descending?"endkey":"startkey",endkeyName=options.descending?"startkey":"endkey";if(void 0!==options[startkeyName]&&void 0!==options[endkeyName]&&collate(options[startkeyName],options[endkeyName])>0)throw new QueryParseError("No rows can match your key range, reverse your start_key and end_key or set {descending : true}");if(fun.reduce&&!1!==options.reduce){if(options.include_docs)throw new QueryParseError("{include_docs:true} is invalid for reduce");if(options.keys&&options.keys.length>1&&!options.group&&!options.group_level)throw new QueryParseError("Multi-key fetches for reduce views must use {group: true}")}for(const optionName of["group_level","limit","skip"]){const error=checkPositiveInteger(options[optionName]);if(error)throw error}}async function httpQuery(db,fun,opts){let body,ok,params=[],method="GET";addHttpParam("reduce",opts,params);addHttpParam("include_docs",opts,params);addHttpParam("attachments",opts,params);addHttpParam("limit",opts,params);addHttpParam("descending",opts,params);addHttpParam("group",opts,params);addHttpParam("group_level",opts,params);addHttpParam("skip",opts,params);addHttpParam("stale",opts,params);addHttpParam("conflicts",opts,params);addHttpParam("startkey",opts,params,!0);addHttpParam("start_key",opts,params,!0);addHttpParam("endkey",opts,params,!0);addHttpParam("end_key",opts,params,!0);addHttpParam("inclusive_end",opts,params);addHttpParam("key",opts,params,!0);addHttpParam("update_seq",opts,params);params=params.join("&");params=""===params?"":"?"+params;if(void 0!==opts.keys){const MAX_URL_LENGTH=2e3,keysAsString=`keys=${encodeURIComponent(JSON.stringify(opts.keys))}`;if(keysAsString.length+params.length+1<=MAX_URL_LENGTH)params+=("?"===params[0]?"&":"?")+keysAsString;else{method="POST";"string"==typeof fun?body={keys:opts.keys}:fun.keys=opts.keys}}if("string"==typeof fun){const parts=parseViewName(fun),response2=await db.fetch("_design/"+parts[0]+"/_view/"+parts[1]+params,{headers:new h2({"Content-Type":"application/json"}),method,body:JSON.stringify(body)});ok=response2.ok;const result2=await response2.json();if(!ok){result2.status=response2.status;throw generateErrorFromResponse(result2)}for(const row of result2.rows)if(row.value&&row.value.error&&"builtin_reduce_error"===row.value.error)throw new Error(row.reason);return new Promise(function(resolve){resolve(result2)}).then(postprocessAttachments(opts))}body=body||{};for(const key3 of Object.keys(fun))Array.isArray(fun[key3])?body[key3]=fun[key3]:body[key3]=fun[key3].toString();const response=await db.fetch("_temp_view"+params,{headers:new h2({"Content-Type":"application/json"}),method:"POST",body:JSON.stringify(body)});ok=response.ok;const result=await response.json();if(!ok){result.status=response.status;throw generateErrorFromResponse(result)}return new Promise(function(resolve){resolve(result)}).then(postprocessAttachments(opts))}function customQuery(db,fun,opts){return new Promise(function(resolve,reject){db._query(fun,opts,function(err3,res2){if(err3)return reject(err3);resolve(res2)})})}function customViewCleanup(db){return new Promise(function(resolve,reject){db._viewCleanup(function(err3,res2){if(err3)return reject(err3);resolve(res2)})})}function defaultsTo(value){return function(reason){if(404===reason.status)return value;throw reason}}async function getDocsToPersist(docId,view,docIdsToChangesAndEmits){const metaDocId="_local/doc_"+docId,defaultMetaDoc={_id:metaDocId,keys:[]},docData=docIdsToChangesAndEmits.get(docId),indexableKeysToKeyValues=docData[0],changes3=docData[1],metaDoc=await function getMetaDoc(){return isGenOne(changes3)?Promise.resolve(defaultMetaDoc):view.db.get(metaDocId).catch(defaultsTo(defaultMetaDoc))}();return function processKeyValueDocs(metaDoc2,kvDocsRes){const kvDocs=[],oldKeys=new Set;for(const row of kvDocsRes.rows){const doc=row.doc;if(doc){kvDocs.push(doc);oldKeys.add(doc._id);doc._deleted=!indexableKeysToKeyValues.has(doc._id);if(!doc._deleted){const keyValue=indexableKeysToKeyValues.get(doc._id);"value"in keyValue&&(doc.value=keyValue.value)}}}const newKeys=mapToKeysArray(indexableKeysToKeyValues);for(const key3 of newKeys)if(!oldKeys.has(key3)){const kvDoc={_id:key3},keyValue=indexableKeysToKeyValues.get(key3);"value"in keyValue&&(kvDoc.value=keyValue.value);kvDocs.push(kvDoc)}metaDoc2.keys=uniq(newKeys.concat(metaDoc2.keys));kvDocs.push(metaDoc2);return kvDocs}(metaDoc,await function getKeyValueDocs(metaDoc2){return metaDoc2.keys.length?view.db.allDocs({keys:metaDoc2.keys,include_docs:!0}):Promise.resolve({rows:[]})}(metaDoc))}function updatePurgeSeq(view){return view.sourceDB.get("_local/purges").then(function(res2){const purgeSeq=res2.purgeSeq;return view.db.get("_local/purgeSeq").then(function(res3){return res3._rev}).catch(defaultsTo(void 0)).then(function(rev3){return view.db.put({_id:"_local/purgeSeq",_rev:rev3,purgeSeq})})}).catch(function(err3){if(404!==err3.status)throw err3})}function saveKeyValues(view,docIdsToChangesAndEmits,seq){return view.db.get("_local/lastSeq").catch(defaultsTo({_id:"_local/lastSeq",seq:0})).then(function(lastSeqDoc){var docIds=mapToKeysArray(docIdsToChangesAndEmits);return Promise.all(docIds.map(function(docId){return getDocsToPersist(docId,view,docIdsToChangesAndEmits)})).then(function(listOfDocsToPersist){var docsToPersist=listOfDocsToPersist.flat();lastSeqDoc.seq=seq;docsToPersist.push(lastSeqDoc);return view.db.bulkDocs({docs:docsToPersist})}).then(()=>updatePurgeSeq(view))})}function getQueue(view){const viewName="string"==typeof view?view:view.name;let queue2=persistentQueues[viewName];queue2||(queue2=persistentQueues[viewName]=new TaskQueue2);return queue2}async function updateView(view,opts){return sequentialize(getQueue(view),function(){return updateViewInQueue(view,opts)})()}async function updateViewInQueue(view,opts){function processChange2(docIdsToChangesAndEmits,seq){return function(){return saveKeyValues(view,docIdsToChangesAndEmits,seq)}}async function processNextBatch(){return processBatch(await view.sourceDB.changes({return_docs:!0,conflicts:!0,include_docs:!0,style:"all_docs",since:currentSeq,limit:opts.changes_batch_size}),await getRecentPurges())}function getRecentPurges(){return view.db.get("_local/purgeSeq").then(function(res2){return res2.purgeSeq}).catch(defaultsTo(-1)).then(function(purgeSeq){return view.sourceDB.get("_local/purges").then(function(res2){const recentPurges=res2.purges.filter(function(purge2,index6){return index6>purgeSeq}).map(purge2=>purge2.docId),uniquePurges=recentPurges.filter(function(docId,index6){return recentPurges.indexOf(docId)===index6});return Promise.all(uniquePurges.map(function(docId){return view.sourceDB.get(docId).then(function(doc2){return{docId,doc:doc2}}).catch(defaultsTo({docId}))}))}).catch(defaultsTo([]))})}function processBatch(response,purges){const results=response.results;if(!results.length&&!purges.length)return;for(const purge2 of purges)if(results.findIndex(function(change){return change.id===purge2.docId})<0){const entry={_id:purge2.docId,doc:{_id:purge2.docId,_deleted:1},changes:[]};if(purge2.doc){entry.doc=purge2.doc;entry.changes.push({rev:purge2.doc._rev})}results.push(entry)}const docIdsToChangesAndEmits=createDocIdsToChangesAndEmits(results);queue2.add(processChange2(docIdsToChangesAndEmits,currentSeq));indexed_docs+=results.length;const progress2={view:view.name,last_seq:response.last_seq,results_count:results.length,indexed_docs};view.sourceDB.emit("indexing",progress2);view.sourceDB.activeTasks.update(taskId,{completed_items:indexed_docs});return results.length0&&0===collate(emittedKeyValue.key,lastKey)&&complexKey.push(i2);indexableKeysToKeyValues.set(toIndexableString(complexKey),emittedKeyValue);lastKey=emittedKeyValue.key}return indexableKeysToKeyValues}let mapResults,doc,taskId;const mapFun=mapper3(view.mapFun,function emit2(key3,value){const output={id:doc._id,key:normalizeKey(key3)};null!=value&&(output.value=normalizeKey(value));mapResults.push(output)});let currentSeq=view.seq||0,indexed_docs=0;const progress={view:view.name,indexed_docs};view.sourceDB.emit("indexing",progress);const queue2=new TaskQueue2;try{await function createTask(){return view.sourceDB.info().then(function(info3){taskId=view.sourceDB.activeTasks.add({name:"view_indexing",total_items:info3.update_seq-currentSeq})})}();await processNextBatch();await queue2.finish();view.seq=currentSeq;view.sourceDB.activeTasks.remove(taskId)}catch(error){view.sourceDB.activeTasks.remove(taskId,error)}}function reduceView(view,results,options){0===options.group_level&&delete options.group_level;const shouldGroup=options.group||options.group_level,reduceFun=reducer3(view.reduceFun),groups=[],lvl=isNaN(options.group_level)?Number.POSITIVE_INFINITY:options.group_level;for(const result of results){const last=groups[groups.length-1];let groupKey=shouldGroup?result.key:null;shouldGroup&&Array.isArray(groupKey)&&(groupKey=groupKey.slice(0,lvl));if(last&&0===collate(last.groupKey,groupKey)){last.keys.push([result.key,result.id]);last.values.push(result.value)}else groups.push({keys:[[result.key,result.id]],values:[result.value],groupKey})}results=[];for(const group4 of groups){const reduceTry=tryReduce(view.sourceDB,reduceFun,group4.keys,group4.values,!1);if(reduceTry.error&&reduceTry.error instanceof BuiltInError)throw reduceTry.error;results.push({value:reduceTry.error?null:reduceTry.output,key:group4.groupKey})}return{rows:sliceResults(results,options.limit,options.skip)}}function queryView(view,opts){return sequentialize(getQueue(view),function(){return queryViewInQueue(view,opts)})()}async function queryViewInQueue(view,opts){async function fetchFromView(viewOpts){viewOpts.include_docs=!0;const res2=await view.db.allDocs(viewOpts);totalRows=res2.total_rows;return res2.rows.map(function(result){if("value"in result.doc&&"object"==typeof result.doc.value&&null!==result.doc.value){const keys3=Object.keys(result.doc.value).sort(),expectedKeys=["id","key","value"];if(!(keys3expectedKeys))return result.doc.value}const parsedKeyAndDocId=parseIndexableString(result.doc._id);return{key:parsedKeyAndDocId[0],id:parsedKeyAndDocId[1],value:"value"in result.doc?result.doc.value:null}})}async function onMapResultsReady(rows){let finalResults;finalResults=shouldReduce?reduceView(view,rows,opts):void 0===opts.keys?{total_rows:totalRows,offset:skip,rows}:{total_rows:totalRows,offset:skip,rows:sliceResults(rows,opts.limit,opts.skip)};opts.update_seq&&(finalResults.update_seq=view.seq);if(opts.include_docs){const docIds=uniq(rows.map(rowToDocId)),allDocsRes=await view.sourceDB.allDocs({keys:docIds,include_docs:!0,conflicts:opts.conflicts,attachments:opts.attachments,binary:opts.binary}),docIdsToDocs=new Map;for(const row of allDocsRes.rows)docIdsToDocs.set(row.id,row.doc);for(const row of rows){const docId=rowToDocId(row),doc=docIdsToDocs.get(docId);doc&&(row.doc=doc)}}return finalResults}let totalRows;const shouldReduce=view.reduceFun&&!1!==opts.reduce,skip=opts.skip||0;if(void 0!==opts.keys&&!opts.keys.length){opts.limit=0;delete opts.keys}if(void 0!==opts.keys){const fetchPromises=opts.keys.map(function(key3){const viewOpts={startkey:toIndexableString([key3]),endkey:toIndexableString([key3,{}])};opts.update_seq&&(viewOpts.update_seq=!0);return fetchFromView(viewOpts)});return onMapResultsReady((await Promise.all(fetchPromises)).flat())}{const viewOpts={descending:opts.descending};opts.update_seq&&(viewOpts.update_seq=!0);let startkey,endkey;"start_key"in opts&&(startkey=opts.start_key);"startkey"in opts&&(startkey=opts.startkey);"end_key"in opts&&(endkey=opts.end_key);"endkey"in opts&&(endkey=opts.endkey);void 0!==startkey&&(viewOpts.startkey=opts.descending?toIndexableString([startkey,{}]):toIndexableString([startkey]));if(void 0!==endkey){let inclusiveEnd=!1!==opts.inclusive_end;opts.descending&&(inclusiveEnd=!inclusiveEnd);viewOpts.endkey=toIndexableString(inclusiveEnd?[endkey,{}]:[endkey])}if(void 0!==opts.key){const keyStart=toIndexableString([opts.key]),keyEnd=toIndexableString([opts.key,{}]);if(viewOpts.descending){viewOpts.endkey=keyStart;viewOpts.startkey=keyEnd}else{viewOpts.startkey=keyStart;viewOpts.endkey=keyEnd}}if(!shouldReduce){"number"==typeof opts.limit&&(viewOpts.limit=opts.limit);viewOpts.skip=skip}return onMapResultsReady(await fetchFromView(viewOpts))}}async function httpViewCleanup(db){return(await db.fetch("_view_cleanup",{headers:new h2({"Content-Type":"application/json"}),method:"POST"})).json()}async function localViewCleanup(db){try{const metaDoc=await db.get("_local/"+localDocName2),docsToViews=new Map;for(const fullViewName of Object.keys(metaDoc.views)){const parts=parseViewName(fullViewName),designDocName="_design/"+parts[0],viewName=parts[1];let views=docsToViews.get(designDocName);if(!views){views=new Set;docsToViews.set(designDocName,views)}views.add(viewName)}const opts={keys:mapToKeysArray(docsToViews),include_docs:!0},res2=await db.allDocs(opts),viewsToStatus={};for(const row of res2.rows){const ddocName=row.key.substring(8);for(const viewName of docsToViews.get(row.key)){let fullViewName=ddocName+"/"+viewName;metaDoc.views[fullViewName]||(fullViewName=viewName);const viewDBNames=Object.keys(metaDoc.views[fullViewName]),statusIsGood=row.doc&&row.doc.views&&row.doc.views[viewName];for(const viewDBName of viewDBNames)viewsToStatus[viewDBName]=viewsToStatus[viewDBName]||statusIsGood}}const destroyPromises=Object.keys(viewsToStatus).filter(function(viewDBName){return!viewsToStatus[viewDBName]}).map(function(viewDBName){return sequentialize(getQueue(viewDBName),function(){return new db.constructor(viewDBName,db.__opts).destroy()})()});return Promise.all(destroyPromises).then(function(){return{ok:!0}})}catch(err3){if(404===err3.status)return{ok:!0};throw err3}}async function queryPromised(db,fun,opts){if("function"==typeof db._query)return customQuery(db,fun,opts);if(isRemote(db))return httpQuery(db,fun,opts);const updateViewOpts={changes_batch_size:db.__opts.view_update_changes_batch_size||50};if("string"!=typeof fun){checkQueryParseError(opts,fun);tempViewQueue.add(async function(){const view=await createView(db,"temp_view/temp_view",fun.map,fun.reduce,!0,localDocName2);return fin(updateView(view,updateViewOpts).then(function(){return queryView(view,opts)}),function(){return view.db.destroy()})});return tempViewQueue.finish()}{const fullViewName=fun,parts=parseViewName(fullViewName),designDocName=parts[0],viewName=parts[1],doc=await db.get("_design/"+designDocName);if(!(fun=doc.views&&doc.views[viewName]))throw new NotFoundError(`ddoc ${doc._id} has no view named ${viewName}`);ddocValidator3(doc,viewName);checkQueryParseError(opts,fun);const view=await createView(db,fullViewName,fun.map,fun.reduce,!1,localDocName2);if("ok"===opts.stale||"update_after"===opts.stale){"update_after"===opts.stale&&nextTick(function(){updateView(view,updateViewOpts)});return queryView(view,opts)}await updateView(view,updateViewOpts);return queryView(view,opts)}}return{query:function abstractQuery(fun,opts,callback){const db=this;if("function"==typeof opts){callback=opts;opts={}}opts=opts?coerceOptions(opts):{};"function"==typeof fun&&(fun={map:fun});const promise=Promise.resolve().then(function(){return queryPromised(db,fun,opts)});promisedCallback(promise,callback);return promise},viewCleanup:callbackify(function(){const db=this;return"function"==typeof db._viewCleanup?customViewCleanup(db):isRemote(db)?httpViewCleanup(db):localViewCleanup(db)})}};log2=guardedConsole.bind(null,"log");isArray=Array.isArray;toJSON=JSON.parse;builtInReduce__sum=function(keys3,values2){return sum(values2)},builtInReduce__count=function(keys3,values2){return values2.length},builtInReduce__stats=function(keys3,values2){return{sum:sum(values2),min:Math.min.apply(null,values2),max:Math.max.apply(null,values2),count:values2.length,sumsqr:function sumsqr(values3){var i2,len,num,_sumsqr=0;for(i2=0,len=values3.length;i2{this.once("complete",fulfill);this.once("error",reject)});this.then=function(resolve,reject){return promise.then(resolve,reject)};this.catch=function(reject){return promise.catch(reject)};this.catch(function(){})}cancel(){this.cancelled=!0;this.state="cancelled";this.emit("cancel")}ready(src,target){function cleanup(){src.removeListener("destroyed",onDestroy2);target.removeListener("destroyed",onDestroy2)}if(this._readyCalled)return;this._readyCalled=!0;const onDestroy2=()=>{this.cancel()};src.once("destroyed",onDestroy2);target.once("destroyed",onDestroy2);this.once("complete",cleanup);this.once("error",cleanup)}};Sync=class extends import_events18.default{constructor(src,target,opts,callback){function addOneListener(ee,event2,listener){-1==ee.listeners(event2).indexOf(listener)&&ee.on(event2,listener)}super();this.canceled=!1;const optsPush=opts.push?Object.assign({},opts,opts.push):opts,optsPull=opts.pull?Object.assign({},opts,opts.pull):opts;this.push=replicateWrapper(src,target,optsPush);this.pull=replicateWrapper(target,src,optsPull);this.pushPaused=!0;this.pullPaused=!0;const pullChange=change=>{this.emit("change",{direction:"pull",change})},pushChange=change=>{this.emit("change",{direction:"push",change})},pushDenied=doc=>{this.emit("denied",{direction:"push",doc})},pullDenied=doc=>{this.emit("denied",{direction:"pull",doc})},pushPaused=()=>{this.pushPaused=!0;this.pullPaused&&this.emit("paused")},pullPaused=()=>{this.pullPaused=!0;this.pushPaused&&this.emit("paused")},pushActive=()=>{this.pushPaused=!1;this.pullPaused&&this.emit("active",{direction:"push"})},pullActive=()=>{this.pullPaused=!1;this.pushPaused&&this.emit("active",{direction:"pull"})};let removed={};const removeAll=type=>(event2,func)=>{if("change"===event2&&(func===pullChange||func===pushChange)||"denied"===event2&&(func===pullDenied||func===pushDenied)||"paused"===event2&&(func===pullPaused||func===pushPaused)||"active"===event2&&(func===pullActive||func===pushActive)){event2 in removed||(removed[event2]={});removed[event2][type]=!0;2===Object.keys(removed[event2]).length&&this.removeAllListeners(event2)}};if(opts.live){this.push.on("complete",this.pull.cancel.bind(this.pull));this.pull.on("complete",this.push.cancel.bind(this.push))}this.on("newListener",function(event2){if("change"===event2){addOneListener(this.pull,"change",pullChange);addOneListener(this.push,"change",pushChange)}else if("denied"===event2){addOneListener(this.pull,"denied",pullDenied);addOneListener(this.push,"denied",pushDenied)}else if("active"===event2){addOneListener(this.pull,"active",pullActive);addOneListener(this.push,"active",pushActive)}else if("paused"===event2){addOneListener(this.pull,"paused",pullPaused);addOneListener(this.push,"paused",pushPaused)}});this.on("removeListener",function(event2){if("change"===event2){this.pull.removeListener("change",pullChange);this.push.removeListener("change",pushChange)}else if("denied"===event2){this.pull.removeListener("denied",pullDenied);this.push.removeListener("denied",pushDenied)}else if("active"===event2){this.pull.removeListener("active",pullActive);this.push.removeListener("active",pushActive)}else if("paused"===event2){this.pull.removeListener("paused",pullPaused);this.push.removeListener("paused",pushPaused)}});this.pull.on("removeListener",removeAll("pull"));this.push.on("removeListener",removeAll("push"));const promise=Promise.all([this.push,this.pull]).then(resp=>{const out={push:resp[0],pull:resp[1]};this.emit("complete",out);callback&&callback(null,out);this.removeAllListeners();return out},err3=>{this.cancel();callback?callback(err3):this.emit("error",err3);this.removeAllListeners();if(callback)throw err3});this.then=function(success,err3){return promise.then(success,err3)};this.catch=function(err3){return promise.catch(err3)}}cancel(){if(!this.canceled){this.canceled=!0;this.push.cancel();this.pull.cancel()}}};index_es_default8=function replication(PouchDB2){PouchDB2.replicate=replicateWrapper;PouchDB2.sync=sync;Object.defineProperty(PouchDB2.prototype,"replicate",{get:function(){var self3=this;void 0===this.replicateMethods&&(this.replicateMethods={from:function(other,opts,callback){return self3.constructor.replicate(other,self3,opts,callback)},to:function(other,opts,callback){return self3.constructor.replicate(self3,other,opts,callback)}});return this.replicateMethods}});PouchDB2.prototype.sync=function(dbName,opts,callback){return this.constructor.sync(this,dbName,opts,callback)}};nativeFlat=(...args)=>args.flat(1/0);polyFlat=(...args)=>{let res2=[];for(const subArr of args)Array.isArray(subArr)?res2=res2.concat(polyFlat(...subArr)):res2.push(subArr);return res2};flatten2="function"==typeof Array.prototype.flat?nativeFlat:polyFlat;requireValidation=["$all","$allMatch","$and","$elemMatch","$exists","$in","$mod","$nin","$nor","$not","$or","$regex","$size","$type"];arrayTypeComparisonOperators=["$in","$nin","$mod","$all"];equalityOperators=["$eq","$gt","$gte","$lt","$lte"];abstractMapper=index_es_default5("indexes",function mapper2(mapFunDef,emit2){return createMapper(Object.keys(mapFunDef.fields),emit2,mapFunDef.partial_filter_selector)},function reducer2(){throw new Error("reduce not supported")},function ddocValidator2(ddoc,viewName){const view=ddoc.views[viewName];if(!view.map||!view.map.fields)throw new Error("ddoc "+ddoc._id+" with view "+viewName+" doesn't have map.fields defined. maybe it wasn't created by this plugin?")});ddocIdPrefix=/^_design\//;SHORT_CIRCUIT_QUERY={queryOpts:{limit:0,startkey:COLLATE_HI={"￿":{}},endkey:COLLATE_LO=null},inMemoryFields:[]};logicalMatchers=["$eq","$gt","$gte","$lt","$lte"];(plugin2={}).createIndex=resolveToCallback(async function(requestDef){if("object"!=typeof requestDef)throw new Error("you must provide an index to create");return(isRemote(this)?createIndex:createIndex$1)(this,requestDef)});plugin2.find=resolveToCallback(async function(requestDef){if("object"!=typeof requestDef)throw new Error("you must provide search parameters to find()");return(isRemote(this)?find:find$1)(this,requestDef)});plugin2.explain=resolveToCallback(async function(requestDef){if("object"!=typeof requestDef)throw new Error("you must provide search parameters to explain()");return(isRemote(this)?explain:explain$1)(this,requestDef)});plugin2.getIndexes=resolveToCallback(async function(){return(isRemote(this)?getIndexes:getIndexes$1)(this)});plugin2.deleteIndex=resolveToCallback(async function(indexDef){if("object"!=typeof indexDef)throw new Error("you must provide an index to delete");return(isRemote(this)?deleteIndex:deleteIndex$1)(this,indexDef)});index_browser_es_default3=plugin2;import_transform_pouch=__toESM(require_transform_pouch(),1);index_es_default.plugin(index_es_default2).plugin(index_es_default3).plugin(index_es_default4).plugin(index_browser_es_default2).plugin(index_es_default8).plugin(index_browser_es_default3).plugin(import_transform_pouch.default);index_es_default.prototype.purgeMulti=adapterFun("_purgeMulti",function(docs,callback){if(void 0===this._purge)return callback(createError(UNKNOWN_ERROR,"Purge is not implemented in the "+this.adapter+" adapter."));const self3=this,tasks3=docs.map(param=>()=>new Promise((res2,rej)=>{const[docId,rev$$1]=param;self3._getRevisionTree(docId,(error,revs)=>{if(error)return res2([param,error]);if(!revs)return res2([param,createError(MISSING_DOC)]);let path2;try{path2=findPathToLeaf(revs,rev$$1)}catch(error2){return res2([param,error2.message||error2])}self3._purge(docId,path2,(error2,result)=>res2(error2?[param,error2]:[param,result]))})}));(async()=>{const retAll=(await mapAllTasksWithConcurrencyLimit(1,tasks3)).map(e3=>unwrapTaskResult(e3));await appendPurgeSeqs(self3,retAll.filter(e3=>"ok"in e3[1]).map(e3=>e3[0]));return Object.fromEntries(retAll.map(e3=>[e3[0][0],e3[1]]))})().then(result=>callback(void 0,result)).catch(error=>callback(error))});TrysteroReplicator=class{constructor(env,server){this._onSetup=!1;this.lastSeq="";this._isBroadcasting=!1;this.availableReplicationPairs=new Set;this._replicateToPeers=new Set;this._replicateFromPeers=new Set;this._watchingPeers=new Set;this._env=env;if(server)this.server=server;else try{if(!this.settings.P2P_Enabled){Logger("P2P is not enabled",LOG_LEVEL_VERBOSE);return}if(!this.settings.P2P_AppID)throw new Error("P2P App ID is not provided. We need it to establish the P2P connection");if(!this.settings.P2P_roomID||!this.settings.P2P_passphrase)throw new Error("Room ID and/or P2P Passphrase have not provided. We need them to establish the P2P connection");if(!this.settings.P2P_relays||0===this.settings.P2P_relays.length)throw new Error("No relay URIs provided. We need them to establish the P2P connection");this.server=new TrysteroReplicatorP2PServer(env)}catch(e3){Logger(e3 instanceof Error?e3.message:"Error while creating TrysteroReplicator",LOG_LEVEL_NOTICE);Logger(e3,LOG_LEVEL_VERBOSE);throw e3}}replicationStatus(){return{}}get settings(){return this._env.settings}get db(){return this._env.db}get deviceName(){return this._env.deviceName}get platform(){return this._env.platform}get confirm(){return this._env.confirm}async close(){var _a8;this.requestStatus();await(null==(_a8=this.server)?void 0:_a8.shutdown());this._replicateFromPeers.clear();this._replicateToPeers.clear();this._watchingPeers.clear();this.requestStatus();this.disconnectFromServer()}async open(){var _a8;this.allowReconnection();await(null==(_a8=this.server)?void 0:_a8.start([this.getCommands()]));this.dispatchStatus();this.settings.P2P_AutoBroadcast&&this.enableBroadcastChanges()}async makeSureOpened(){var _a8;(null==(_a8=this.server)?void 0:_a8.isServing)||await this.open()}get autoSyncPeers(){return this.settings.P2P_AutoSyncPeers.split(",").map(e3=>e3.trim()).filter(e3=>e3.length>0).map(e3=>e3.startsWith("~")?new RegExp(e3.substring(1),"i"):new RegExp(`^${e3}$`,"i"))}get autoWatchPeers(){return this.settings.P2P_AutoWatchPeers.split(",").map(e3=>e3.trim()).filter(e3=>e3.length>0).map(e3=>e3.startsWith("~")?new RegExp(e3.substring(1),"i"):new RegExp(`^${e3}$`,"i"))}async onNewPeer(peer){const peerName=peer.name;this.autoSyncPeers.some(e3=>e3.test(peerName))&&await this.sync(peer.peerId);this.autoWatchPeers.some(e3=>e3.test(peerName))&&this.watchPeer(peer.peerId)}onPeerLeaved(peerId){this.unwatchPeer(peerId)}setOnSetup(){this._onSetup=!0}clearOnSetup(){this._onSetup=!1}async getTweakSettings(fromPeerId){var _a8;const allSettings=JSON.parse(JSON.stringify(this.settings));for(const key3 in allSettings)"encrypt"!=key3&&("passphrase"!=key3?key3 in TweakValuesShouldMatchedTemplate||delete allSettings[key3]:allSettings[key3]=await getHashedStringWithCurrentTime(null!=(_a8=allSettings[key3])?_a8:""));return allSettings}getCommands(){return{reqSync:async fromPeerId=>this._onSetup?{error:new Error("The setup is in progress")}:await this.replicateFrom(fromPeerId),"!reqAuth":async fromPeerId=>{var _a8;return await(null==(_a8=this.server)?void 0:_a8.isAcceptablePeer(fromPeerId))},getTweakSettings:async fromPeerId=>await this.getTweakSettings(fromPeerId),onProgress:async fromPeerId=>{if(this._onSetup)return{error:new Error("The setup is in progress")};await this.onUpdateDatabase(fromPeerId)},getAllConfig:async fromPeerId=>{if(this._onSetup)return{error:new Error("The setup is in progress")};const passphrase=await skipIfDuplicated(`getAllConfig-${fromPeerId}`,async()=>await this.confirm.askString("Passphrase required",$msg("P2P.AskPassphraseForShare"),"something you only know",!0)),setting={...this.settings,configPassphraseStore:"",encryptedCouchDBConnection:"",encryptedPassphrase:"",pluginSyncExtendedSetting:{}};if(!passphrase||""==passphrase.trim()){Logger("Passphrase is required to transfer the configuration. The peer cannot be decrypt the config\nIf you repeatedly receive unintended configuration-sharing requests, change the RPC channel immediately. It allows you to leave the connection and disappear, while they are trying brute force attack for the decoy on their local.",LOG_LEVEL_NOTICE);return encrypt5(JSON.stringify(Object.fromEntries(Object.entries(setting).map(([key3,value])=>[key3,"******".repeat(Math.ceil(10*Math.random())+2)]))),Math.random().toString(36).substring(7))}return encrypt5(JSON.stringify(setting),passphrase.trim())},onProgressAcknowledged:async(fromPeerId,info3)=>{try{await this.onProgressAcknowledged(fromPeerId,info3)}catch(e3){Logger("Error while acknowledging the progress",LOG_LEVEL_VERBOSE);Logger(e3,LOG_LEVEL_VERBOSE)}},getIsBroadcasting:()=>Promise.resolve(this._isBroadcasting),requestBroadcasting:async peerId=>{if(this._onSetup)return{error:new Error("The setup is in progress")};if(this._isBroadcasting)return!0;"yes"===await skipIfDuplicated(`requested-${peerId}`,async()=>await this.confirm.askYesNoDialog("The remote peer requested to broadcast the changes. Do you want to allow it?",{defaultOption:"No"}))&&this.enableBroadcastChanges()}}}async requestAuthenticate(peerId){if(!this.server)return!1;try{const connection=this.server.getConnection(peerId),selfPeerId=this.server.serverPeerId;return await connection.invokeRemoteObjectFunction("!reqAuth",[selfPeerId],2e4)}catch(e3){Logger("Error while requesting authentication",LOG_LEVEL_VERBOSE);Logger(e3,LOG_LEVEL_VERBOSE);return!1}}async selectPeer(){if(!this.server)return!1;const knownPeers=this.server.knownAdvertisements;if(0===knownPeers.length){Logger("No known peers",LOG_LEVEL_VERBOSE);return!1}const peers=[...Object.entries(knownPeers)].map(([peerId,info3])=>`${info3.peerId} : (${info3.name})`),selectedPeer=await this.confirm.askSelectString("Select a peer to replicate",peers);return!!selectedPeer&&selectedPeer.split(" ")[0]}async requestSynchroniseToPeer(peerId){await delay(25);if(!this.server)throw new Error("Server is not available");const conn=this.server.getConnection(peerId);return await conn.invokeRemoteFunction("reqSync",[this.server.serverPeerId],0)}async requestSynchroniseToAllAvailablePeers(){await scheduleOnceIfDuplicated("requestSynchroniseToAllAvailablePeers",async()=>{await delay(25);const replications=[...this.availableReplicationPairs].map(peerId=>this.requestSynchroniseToPeer(peerId));await Promise.all(replications)})}dispatchStatus(){eventHub.emitEvent(EVENT_P2P_REPLICATOR_STATUS,{isBroadcasting:this._isBroadcasting,replicatingTo:[...this._replicateToPeers],replicatingFrom:[...this._replicateFromPeers],watchingPeers:[...this._watchingPeers]})}requestStatus(){var _a8;this.dispatchStatus();null==(_a8=this.server)||_a8.dispatchConnectionStatus()}disableBroadcastChanges(){var _a8;null==(_a8=this.changes)||_a8.cancel();this._isBroadcasting=!1;this.dispatchStatus()}enableBroadcastChanges(){if(this._isBroadcasting)return;this._isBroadcasting=!0;this.dispatchStatus();if(this.changes){this.changes.cancel();this.changes.removeAllListeners()}this.changes=this.db.changes({since:"now",live:!0,include_docs:!1,selector:{_id:{$gt:"_local/"}}});this.changes.on("change",async change=>{this.lastSeq=change.seq;await this.notifyProgress()});const closeChanges=reason=>{var _a8,_b5;if(reason)if(reason instanceof Error){Logger("Error while broadcasting the changes",LOG_LEVEL_INFO);Logger(reason,LOG_LEVEL_VERBOSE)}else{Logger("Broadcasting the changes has been finished",LOG_LEVEL_INFO);Logger(reason,LOG_LEVEL_VERBOSE)}null==(_a8=this.changes)||_a8.cancel();null==(_b5=this.changes)||_b5.removeAllListeners();this.changes=void 0;this._isBroadcasting=!1;this.dispatchStatus()};this.changes.on("error",closeChanges);this.changes.on("complete",closeChanges);fireAndForget(async()=>await this.notifyProgress())}get knownAdvertisements(){var _a8,_b5;return null!=(_b5=null==(_a8=this.server)?void 0:_a8.knownAdvertisements)?_b5:[]}async sync(remotePeer,showNotice=!1){const from=await this.replicateFrom(remotePeer,showNotice);if(!from||from.error){Logger("Error while replicating from the remote",LOG_LEVEL_VERBOSE);Logger(from.error,LOG_LEVEL_VERBOSE);return from}const logLevel=showNotice?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO;Logger(`P2P Replication has been requested to ${remotePeer}`,logLevel,"p2p-replicator");const res2=await this.requestSynchroniseToPeer(remotePeer);res2.ok&&Logger("P2P Replication has been done",logLevel,"p2p-replicator");if(res2.error){Logger("Error while syncing from the remote",logLevel,"p2p-replicator");Logger(res2.error,LOG_LEVEL_VERBOSE)}}async replicateTo(){await this.makeSureOpened();const remotePeer=await this.selectPeer();if(remotePeer){Logger(`P2P Replicating to ${remotePeer}`,LOG_LEVEL_INFO);try{if(this._replicateToPeers.has(remotePeer)){Logger(`Replication to ${remotePeer} is already in progress`,LOG_LEVEL_VERBOSE);return}this._replicateToPeers.add(remotePeer);this.dispatchStatus();return await this.requestSynchroniseToPeer(remotePeer)}finally{this._replicateToPeers.delete(remotePeer);this.dispatchStatus()}}else Logger("No peer selected",LOG_LEVEL_VERBOSE)}dispatchReplicationProgress(peerId,info3){this.onReplicationProgress(peerId,info3)}onReplicationProgress(peerId,info3){var _a8,_b5;const stat={peerId,peerName:(null==(_b5=null==(_a8=this.server)?void 0:_a8._knownAdvertisements.get(peerId))?void 0:_b5.name)||peerId,fetching:{max:0,current:0,isActive:!1}};info3&&(stat.fetching={max:info3.maxSeqInBatch,current:info3.lastSeq,isActive:!0});eventHub.emitEvent("p2p-replicator-progress",stat);return!0}onProgressAcknowledged(peerId,info3){var _a8,_b5;const ack={peerId,peerName:(null==(_b5=null==(_a8=this.server)?void 0:_a8._knownAdvertisements.get(peerId))?void 0:_b5.name)||peerId,sending:{max:0,current:0,isActive:!1}};info3&&(ack.sending={max:info3.maxSeqInBatch,current:info3.lastSeq,isActive:!0});eventHub.emitEvent("p2p-replicator-progress",ack);return!0}acknowledgeProgress(remotePeerId,info3){this.server&&this.server.getConnection(remotePeerId).invokeRemoteFunction("onProgressAcknowledged",[this.server.serverPeerId,info3],500).catch(ex=>{Logger("Error while acknowledging the progress",LOG_LEVEL_VERBOSE);Logger(ex,LOG_LEVEL_VERBOSE)})}async replicateFrom(remotePeer,showNotice=!1,fromStart=!1){const logLevel=showNotice?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO;Logger(`P2P Requesting Authentication to ${remotePeer}`,logLevel,"p2p-replicator");if(!0!==await this.requestAuthenticate(remotePeer)){Logger("Peer rejected the connection",LOG_LEVEL_NOTICE,"p2p-replicator");return{error:new Error("Peer rejected the connection")}}if(!0!==await this.checkTweakValues(remotePeer)){Logger("Tweak values are not matched",LOG_LEVEL_NOTICE,"p2p-replicator");return{error:new Error("Tweak values are not matched")}}Logger(`P2P Replicating from ${remotePeer}`,logLevel,"p2p-replicator");if(this._replicateFromPeers.has(remotePeer)){Logger(`Replication from ${remotePeer} is already in progress`,LOG_LEVEL_NOTICE,"p2p-replicator");return{error:new Error("Replication from this peer is already in progress")}}this._replicateFromPeers.add(remotePeer);this.dispatchStatus();try{if(!this.server)throw new Error("Server is not available");const remoteDB=this.server.getConnection(remotePeer).remoteDB;Logger(`P2P replicateFrom preparing remote DB info for ${remotePeer}`,LOG_LEVEL_VERBOSE,"p2p-replicator");const remoteDBInfo=await remoteDB.info();Logger(`P2P replicateFrom remote DB info for ${remotePeer}: ${remoteDBInfo.db_name} seq=${remoteDBInfo.update_seq}`,LOG_LEVEL_VERBOSE,"p2p-replicator");const localDBInfo=await this.db.info();Logger(`P2P replicateFrom local DB info for ${remotePeer}: ${localDBInfo.db_name} seq=${localDBInfo.update_seq}`,LOG_LEVEL_VERBOSE,"p2p-replicator");Logger(`P2P replicateFrom entering replicateShim for ${remotePeer}`,LOG_LEVEL_VERBOSE,"p2p-replicator");await replicateShim(this.db,remoteDB,async(docs,info3)=>{await this._env.processReplicatedDocs(docs);this.dispatchReplicationProgress(remotePeer,info3);this.acknowledgeProgress(remotePeer,info3);this.notifyProgress(remotePeer);Logger(`P2P Replication from ${remotePeer}\n${info3.lastSeq} / ${info3.maxSeqInBatch})`,logLevel,"p2p-replicator")},{live:!1,rewind:fromStart});Logger(`P2P replicateFrom replicateShim returned for ${remotePeer}`,LOG_LEVEL_VERBOSE,"p2p-replicator");this.acknowledgeProgress(remotePeer,void 0);Logger(`P2P Replication from ${remotePeer} has been completed`,logLevel,"p2p-replicator")}catch(e3){Logger("Error while P2P replicating",logLevel,"p2p-replicator");Logger(e3,LOG_LEVEL_VERBOSE);return{error:e3}}finally{this._replicateFromPeers.delete(remotePeer);this.dispatchStatus()}return{ok:!0}}notifyProgress(excludePeerId){if(this._isBroadcasting&&this.server){for(const peer of this.server.knownAdvertisements){const peerId=peer.peerId;peerId!==excludePeerId&&serialized(`notifyProgress-${peerId}`,async()=>{var _a8,_b5,_c3;if(await(null==(_a8=this.server)?void 0:_a8.isAcceptablePeer(peerId)))try{return await(null==(_c3=this.server)?void 0:_c3.getConnection(peerId).invokeRemoteFunction("onProgress",[null==(_b5=this.server)?void 0:_b5.serverPeerId],0))}catch(e3){Logger(`Error while notifying progress to ${peerId}`,LOG_LEVEL_VERBOSE);Logger(e3,LOG_LEVEL_VERBOSE)}else Logger(`Peer ${peerId} is not acceptable to notify progress`,LOG_LEVEL_VERBOSE)})}return Promise.resolve()}}async requestBroadcastChanges(peerId){var _a8;return await(null==(_a8=this.server)?void 0:_a8.getConnection(peerId).invokeRemoteFunction("requestBroadcasting",[this.server.serverPeerId],0))}async getRemoteIsBroadcasting(peerId){var _a8;try{return await(null==(_a8=this.server)?void 0:_a8.getConnection(peerId).invokeRemoteFunction("getIsBroadcasting",[],0))}catch(e3){Logger("Error while getting remote is broadcasting",LOG_LEVEL_VERBOSE);Logger(e3,LOG_LEVEL_VERBOSE)}}watchPeer(peerId){this._watchingPeers.add(peerId);this.dispatchStatus()}unwatchPeer(peerId){this._watchingPeers.delete(peerId);this.dispatchStatus()}async onUpdateDatabase(fromPeerId){if(this._watchingPeers.has(fromPeerId)){Logger(`Progress notification from ${fromPeerId}`,LOG_LEVEL_VERBOSE);return await serialized(`onProgress-${fromPeerId}`,async()=>await this.replicateFrom(fromPeerId))}return!1}async getRemoteConfig(peerId){if(!this.server){Logger("Server is not available",LOG_LEVEL_NOTICE);return!1}const connection=this.server.getConnection(peerId),encryptedConfig=await connection.invokeRemoteFunction("getAllConfig",[this.server.serverPeerId],0),passphrase=await this.confirm.askString("Passphrase required",$msg("P2P.AskPassphraseForDecrypt"),"something you only know",!0);if(!passphrase||""==passphrase.trim()){Logger("Passphrase is required to decrypt the configuration. The config cannot be decrypted",LOG_LEVEL_NOTICE);return!1}try{return JSON.parse(await decrypt5(encryptedConfig,passphrase))}catch(e3){Logger("Error while decrypting the configuration",LOG_LEVEL_NOTICE);Logger(e3,LOG_LEVEL_VERBOSE);return!1}}async checkTweakValues(peerId){var _a8;if(!this.server){Logger("Server is not available",LOG_LEVEL_NOTICE);return!1}const peerPlatform=null==(_a8=this.server.knownAdvertisements.find(e3=>e3.peerId==peerId))?void 0:_a8.platform;if(null==peerPlatform){Logger("Peer is not found",LOG_LEVEL_NOTICE);return!1}if("pseudo-replicator"===this.platform)return!0;if("pseudo-replicator"===peerPlatform)return!0;const connection=this.server.getConnection(peerId),tweakValues=await connection.invokeRemoteObjectFunction("getTweakSettings",[this.server.serverPeerId],5e3),thisTweakValues=await this.getTweakSettings("");if(!isObjectDifferent(thisTweakValues,tweakValues))return!0;if(thisTweakValues.passphrase!==tweakValues.passphrase){Logger("Replication cancelled: Passphrase is not matched\nCannot replicate to a remote database until the problem is resolved.",LOG_LEVEL_NOTICE);return!1}Logger("Some mismatched configuration have been detected... Please check settings for efficient replication.",LOG_LEVEL_NOTICE);return!0}async replicateFromCommand(showResult=!1){null===await skipIfDuplicated("replicateFromCommand",async()=>{var _a8;const logLevel=showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO;if(!this._env.settings.P2P_Enabled){Logger($msg("P2P.NotEnabled"),logLevel);return Promise.resolve(!1)}const peers=this._env.settings.P2P_SyncOnReplication.split(",").map(e3=>e3.trim()).filter(e3=>e3);if(0==peers.length){Logger($msg("P2P.NoAutoSyncPeers"),logLevel);return Promise.resolve(!1)}for(const peer of peers){const peerId=null==(_a8=this.knownAdvertisements.find(e3=>e3.name==peer))?void 0:_a8.peerId;if(peerId){Logger($msg("P2P.SyncStartedWith",{name:peer}),logLevel);await this.sync(peerId,showResult)}else Logger($msg("P2P.SeemsOffline",{name:peer}),logLevel)}Logger($msg("P2P.SyncCompleted"),logLevel);return Promise.resolve(!0)})&&Logger($msg("P2P.SyncAlreadyRunning"),LOG_LEVEL_NOTICE)}disconnectFromServer(){const connections=getRelaySockets(),sockets=Object.entries(connections);pauseRelayReconnection();sockets.forEach(([,s2])=>{s2.close();s2.onclose=()=>{var _a8;null==(_a8=this.server)||_a8.dispatchConnectionStatus()}});this.pauseServe()}async pauseServe(){var _a8,_b5;await(null==(_a8=this.server)?void 0:_a8.close());await(null==(_b5=this.server)?void 0:_b5.dispatchConnectionStatus())}allowReconnection(){resumeRelayReconnection()}};root_214=from_html('');on_click3=(_,setDefaultRelay)=>setDefaultRelay();root_34=from_html(' ',1);on_click_1=(__1,generateDefaultGroupId)=>generateDefaultGroupId();root_411=from_html(' ',1);root_66=from_html("The Group ID and passphrase are used to identify your group of devices. Make sure to use the same Group ID and\n passphrase on all devices you want to synchronise.
Note that the Group ID is not limited to the generated format; you can use any string as the Group ID.",1);root_77=from_html('');root_87=from_html('');root_103=from_html('');root_153=from_html('');root_163=from_html('');root_124=from_html(" ",1);root_215=from_html(" ",1);root29=from_html(" ",1);delegate(["click"]);root_216=from_html(' ',1);root_35=from_html("Enabling end-to-end encryption ensures that your data is encrypted on your device before being sent to the remote\n server. This means that even if someone gains access to the server, they won't be able to read your data without the\n passphrase. Make sure to remember your passphrase, as it will be required to decrypt your data on other devices.
Also, please note that if you are using Peer-to-Peer synchronization, this configuration will be used when you switch\n to other methods and connect to a remote server in the future.",1);root_53=from_html('');root_94=from_html("");root_88=from_html("");root_78=from_html(" ",1);root_125=from_html("

Please be aware that the End-to-End Encryption passphrase is not validated until the synchronisation process\n actually commences. This is a security measure designed to protect your data.

Therefore, we ask that you exercise extreme caution when configuring server information manually. If an\n incorrect passphrase is entered, the data on the server will become corrupted.

Please understand that this is intended behaviour.

",1);root_135=from_html(" ",1);root30=from_html(" ",1);import_qrcode_generator=__toESM(require_qrcode(),1);OutputFormat=(OutputFormat2=>{OutputFormat2[OutputFormat2.SVG=0]="SVG";OutputFormat2[OutputFormat2.ASCII=1]="ASCII";return OutputFormat2})(OutputFormat||{});necessaryErasureProperties=["configPassphraseStore","encryptedCouchDBConnection","encryptedPassphrase"];UserMode=(UserMode2=>{UserMode2.NewUser="new-user";UserMode2.ExistingUser="existing-user";UserMode2.Unknown="unknown";UserMode2.Update="unknown";return UserMode2})(UserMode||{});SetupManager=class extends AbstractModule{get dialogManager(){return this.services.UI.dialogManager}async startOnBoarding(){const isUserNewOrExisting=await this.dialogManager.openWithExplicitCancel(Intro);if("new-user"===isUserNewOrExisting)await this.onOnboard("new-user");else if("existing-user"===isUserNewOrExisting)await this.onOnboard("existing-user");else if("cancelled"===isUserNewOrExisting){this._log("Onboarding cancelled by user.",LOG_LEVEL_NOTICE);return!1}return!1}async onOnboard(userMode){const originalSetting="new-user"===userMode?DEFAULT_SETTINGS:this.core.settings;if("new-user"===userMode){const method=await this.dialogManager.openWithExplicitCancel(SelectMethodNewUser);if("use-setup-uri"===method)await this.onUseSetupURI(userMode);else if("configure-manually"===method)await this.onConfigureManually(originalSetting,userMode);else if("cancelled"===method){this._log("Onboarding cancelled by user.",LOG_LEVEL_NOTICE);return!1}}else if("existing-user"===userMode){const method=await this.dialogManager.openWithExplicitCancel(SelectMethodExisting);if("use-setup-uri"===method)await this.onUseSetupURI(userMode);else if("configure-manually"===method)await this.onConfigureManually(originalSetting,userMode);else if("scan-qr-code"===method)await this.onPromptQRCodeInstruction();else if("cancelled"===method){this._log("Onboarding cancelled by user.",LOG_LEVEL_NOTICE);return!1}}return!1}async onUseSetupURI(userMode,setupURI=""){const newSetting=await this.dialogManager.openWithExplicitCancel(UseSetupURI,setupURI);if("cancelled"===newSetting){this._log("Setup URI dialog cancelled.",LOG_LEVEL_NOTICE);return!1}this._log("Setup URI dialog closed.",LOG_LEVEL_VERBOSE);return await this.onConfirmApplySettingsFromWizard(newSetting,userMode)}async onCouchDBManualSetup(userMode,currentSetting,activate=!0){const originalSetting=JSON.parse(JSON.stringify(currentSetting)),baseSetting=JSON.parse(JSON.stringify(originalSetting)),couchConf=await this.dialogManager.openWithExplicitCancel(SetupRemoteCouchDB,originalSetting);if("cancelled"===couchConf){this._log("Manual configuration cancelled.",LOG_LEVEL_NOTICE);return await this.onOnboard(userMode)}const newSetting={...baseSetting,...couchConf};activate&&(newSetting.remoteType=REMOTE_COUCHDB);return await this.onConfirmApplySettingsFromWizard(newSetting,userMode,activate)}async onBucketManualSetup(userMode,currentSetting,activate=!0){const bucketConf=await this.dialogManager.openWithExplicitCancel(SetupRemoteBucket,currentSetting);if("cancelled"===bucketConf){this._log("Manual configuration cancelled.",LOG_LEVEL_NOTICE);return await this.onOnboard(userMode)}const newSetting={...currentSetting,...bucketConf};activate&&(newSetting.remoteType=REMOTE_MINIO);return await this.onConfirmApplySettingsFromWizard(newSetting,userMode,activate)}async onP2PManualSetup(userMode,currentSetting,activate=!0){const p2pConf=await this.dialogManager.openWithExplicitCancel(SetupRemoteP2P,currentSetting);if("cancelled"===p2pConf){this._log("Manual configuration cancelled.",LOG_LEVEL_NOTICE);return await this.onOnboard(userMode)}const newSetting={...currentSetting,...p2pConf};activate&&(newSetting.remoteType=REMOTE_P2P);return await this.onConfirmApplySettingsFromWizard(newSetting,userMode,activate)}async onlyE2EEConfiguration(userMode,currentSetting){const e2eeConf=await this.dialogManager.openWithExplicitCancel(SetupRemoteE2EE,currentSetting);if("cancelled"===e2eeConf){this._log("E2EE configuration cancelled.",LOG_LEVEL_NOTICE);return await!1}const newSetting={...currentSetting,...e2eeConf};return await this.onConfirmApplySettingsFromWizard(newSetting,userMode)}async onConfigureManually(originalSetting,userMode){const e2eeConf=await this.dialogManager.openWithExplicitCancel(SetupRemoteE2EE,originalSetting);if("cancelled"===e2eeConf){this._log("Manual configuration cancelled.",LOG_LEVEL_NOTICE);return await this.onOnboard(userMode)}const currentSetting={...originalSetting,...e2eeConf};return await this.onSelectServer(currentSetting,userMode)}async onSelectServer(currentSetting,userMode){const method=await this.dialogManager.openWithExplicitCancel(SetupRemote);if("couchdb"===method)return await this.onCouchDBManualSetup(userMode,currentSetting,!0);if("bucket"===method)return await this.onBucketManualSetup(userMode,currentSetting,!0);if("p2p"===method)return await this.onP2PManualSetup(userMode,currentSetting,!0);if("cancelled"===method){this._log("Manual configuration cancelled.",LOG_LEVEL_NOTICE);if("unknown"!==userMode)return await this.onOnboard(userMode)}return!1}async onConfirmApplySettingsFromWizard(newConf,_userMode,activate=!0,extra=()=>{}){newConf=await this.services.setting.adjustSettings({...this.settings,...newConf});let userMode=_userMode;if("unknown"===userMode){if(!1===isObjectDifferent(this.settings,newConf,!0)){this._log("No changes in settings detected. Skipping applying settings from wizard.",LOG_LEVEL_NOTICE);return!0}const patch=generatePatchObj(this.settings,newConf);console.log("Changes:");console.dir(patch);if(!activate){extra();await this.applySetting(newConf,"existing-user");this._log("Setting Applied",LOG_LEVEL_NOTICE);return!0}if(!1===isObjectDifferent({...this.settings,P2P_DevicePeerName:""},{...newConf,P2P_DevicePeerName:""},!0)){extra();await this.applySetting(newConf,"existing-user");this._log("Settings from wizard applied.",LOG_LEVEL_NOTICE);return!0}{const userModeResult=await this.dialogManager.openWithExplicitCancel(OutroAskUserMode);if("new-user"===userModeResult)userMode="new-user";else if("existing-user"===userModeResult)userMode="existing-user";else{if("compatible-existing-user"===userModeResult){extra();await this.applySetting(newConf,"existing-user");this._log("Settings from wizard applied.",LOG_LEVEL_NOTICE);return!0}if("cancelled"===userModeResult){this._log("User cancelled applying settings from wizard.",LOG_LEVEL_NOTICE);return!1}}}}const component2="new-user"===userMode?OutroNewUser:OutroExistingUser,confirm=await this.dialogManager.openWithExplicitCancel(component2);if("cancelled"===confirm){this._log("User cancelled applying settings from wizard..",LOG_LEVEL_NOTICE);return!1}if(confirm){extra();await this.applySetting(newConf,userMode);"new-user"===userMode?await this.core.rebuilder.scheduleRebuild():await this.core.rebuilder.scheduleFetch()}return!1}async onPromptQRCodeInstruction(){const qrResult=await this.dialogManager.open(ScanQRCode);this._log("QR Code dialog closed.",LOG_LEVEL_VERBOSE);this._log(`QR Code result: ${qrResult}`,LOG_LEVEL_VERBOSE);return!1}async decodeQR(qr){const newSettings=decodeSettingsFromQRCodeData(qr);return await this.onConfirmApplySettingsFromWizard(newSettings,"unknown")}async applySetting(newConf,userMode){this.services.setting.clearUsedPassphrase();await this.services.setting.applyExternalSettings(newConf,!0);return!0}};SveltePanel=class{constructor(component2,mountTo,valueStore){this._componentValue=writable(void 0);this._componentValue=null!=valueStore?valueStore:writable(void 0);this._mountedComponent=mount(component2,{target:mountTo,props:{port:this._componentValue}});return this}destroy(){this._mountedComponent&&unmount(this._mountedComponent)}get componentValue(){return get2(this._componentValue)}set componentValue(value){this._componentValue.set(value)}};root_121=from_html('
',1);root31=from_html('
');$$css11={hash:"svelte-xi83q0",code:'.info-panel.svelte-xi83q0 {padding:0.6rem;flex-grow:1;}\n\n /* Main Grid (Info Items) 120px to 1fr, repeat */.info-grid.svelte-xi83q0 {display:grid;grid-template-columns:minmax(120px, 1fr) 1fr;column-count:2;gap:0.6rem;margin-top:0.5rem;grid-area:"info-key" "info-value";}.info-entry.svelte-xi83q0 {display:grid;gap:0.5rem;border-radius:6px;box-sizing:border-box;min-height:1.2em;}.info-key.svelte-xi83q0 {font-weight:600;align-items:center;border-top:1px solid var(--background-modifier-hover);border-bottom:1px solid var(--background-modifier-hover);grid-area:"info-key";}.info-item.svelte-xi83q0 {align-items:start;padding:0.5rem;background:var(--background-modifier-hover, rgba(0, 0, 0, 0.03));grid-area:"info-value";}.value.svelte-xi83q0 {white-space:pre-wrap;word-break:break-word;color:var(--text-normal, #e6e6e6);min-height:1em;}\n\n @container (max-width: 340px) {.info-grid.svelte-xi83q0 {grid-template-columns:1fr;}.info-item.svelte-xi83q0 {grid-template-columns:1fr;}\n }'};ConnectionStringParser=class{static parse(uriString){const url=new URL(uriString),protocol=url.protocol.replace(":","");switch(protocol){case"sls+http":case"sls+https":return{type:"couchdb",settings:this.parseCouchDB(url)};case"sls+s3":return{type:"s3",settings:this.parseS3(url)};case"sls+p2p":return{type:"p2p",settings:this.parseP2P(url)};default:throw new Error(`Unsupported protocol: ${protocol}`)}}static serialize(config){switch(config.type){case"couchdb":return this.serializeCouchDB(config.settings);case"s3":return this.serializeS3(config.settings);case"p2p":return this.serializeP2P(config.settings);default:throw new Error(`Unsupported type: ${config.type}`)}}static parseCouchDB(url){return{couchDB_URI:`${(url.protocol.split("+")[1]||"https").replace(":","")}://${url.host}${"/"===url.pathname?"":url.pathname}`,couchDB_USER:decodeURIComponent(url.username),couchDB_PASSWORD:decodeURIComponent(url.password),couchDB_DBNAME:url.searchParams.get("db")||"",couchDB_CustomHeaders:url.searchParams.get("headers")||"",useJWT:"true"===url.searchParams.get("useJWT"),jwtAlgorithm:url.searchParams.get("jwtAlg")||"",jwtKey:url.searchParams.get("jwtKey")||"",jwtKid:url.searchParams.get("jwtKid")||"",jwtSub:url.searchParams.get("jwtSub")||"",jwtExpDuration:parseInt(url.searchParams.get("jwtExp")||"5"),useRequestAPI:"true"===url.searchParams.get("useRequestAPI")}}static serializeCouchDB(settings){const url=new URL(settings.couchDB_URI),newUrl=new URL(`sls+${url.protocol.replace(":","")}://${url.host}${url.pathname}`);newUrl.username=encodeURIComponent(settings.couchDB_USER);newUrl.password=encodeURIComponent(settings.couchDB_PASSWORD);newUrl.searchParams.set("db",settings.couchDB_DBNAME);settings.couchDB_CustomHeaders&&newUrl.searchParams.set("headers",settings.couchDB_CustomHeaders);if(settings.useJWT){newUrl.searchParams.set("useJWT","true");newUrl.searchParams.set("jwtAlg",settings.jwtAlgorithm);settings.jwtKey&&newUrl.searchParams.set("jwtKey",settings.jwtKey);settings.jwtKid&&newUrl.searchParams.set("jwtKid",settings.jwtKid);settings.jwtSub&&newUrl.searchParams.set("jwtSub",settings.jwtSub);newUrl.searchParams.set("jwtExp",`${settings.jwtExpDuration||5}`)}settings.useRequestAPI&&newUrl.searchParams.set("useRequestAPI","true");return newUrl.toString()}static parseS3(url){const endpoint=url.searchParams.get("endpoint")||`https://${url.host}`;return{accessKey:decodeURIComponent(url.username),secretKey:decodeURIComponent(url.password),endpoint,bucket:url.searchParams.get("bucket")||"",region:url.searchParams.get("region")||"auto",bucketPrefix:url.searchParams.get("prefix")||"",useCustomRequestHandler:"true"===url.searchParams.get("useProxy"),bucketCustomHeaders:url.searchParams.get("headers")||"",forcePathStyle:"false"!==url.searchParams.get("pathStyle")}}static serializeS3(settings){const url=new URL(settings.endpoint),newUrl=new URL(`sls+s3://${url.host}`);newUrl.username=encodeURIComponent(settings.accessKey);newUrl.password=encodeURIComponent(settings.secretKey);newUrl.searchParams.set("endpoint",settings.endpoint);newUrl.searchParams.set("bucket",settings.bucket);newUrl.searchParams.set("region",settings.region);settings.bucketPrefix&&newUrl.searchParams.set("prefix",settings.bucketPrefix);settings.bucketCustomHeaders&&newUrl.searchParams.set("headers",settings.bucketCustomHeaders);settings.useCustomRequestHandler&&newUrl.searchParams.set("useProxy","true");settings.forcePathStyle||newUrl.searchParams.set("pathStyle","false");return newUrl.toString()}static parseP2P(url){return{P2P_Enabled:"false"!==url.searchParams.get("enabled"),P2P_roomID:decodeURIComponent(url.host),P2P_passphrase:decodeURIComponent(url.password),P2P_relays:url.searchParams.get("relays")||"",P2P_AppID:url.searchParams.get("appId")||"self-hosted-livesync",P2P_AutoStart:"true"===url.searchParams.get("autoStart"),P2P_AutoBroadcast:"true"===url.searchParams.get("autoBroadcast"),P2P_turnServers:url.searchParams.get("turnServers")||"",P2P_turnUsername:url.searchParams.get("turnUser")||"",P2P_turnCredential:url.searchParams.get("turnPass")||""}}static serializeP2P(settings){const newUrl=new URL(`sls+p2p://${encodeURIComponent(settings.P2P_roomID)}`);newUrl.password=encodeURIComponent(settings.P2P_passphrase);settings.P2P_Enabled||newUrl.searchParams.set("enabled","false");newUrl.searchParams.set("relays",settings.P2P_relays);newUrl.searchParams.set("appId",settings.P2P_AppID);settings.P2P_AutoStart&&newUrl.searchParams.set("autoStart","true");settings.P2P_AutoBroadcast&&newUrl.searchParams.set("autoBroadcast","true");settings.P2P_turnServers&&newUrl.searchParams.set("turnServers",settings.P2P_turnServers);settings.P2P_turnUsername&&newUrl.searchParams.set("turnUser",settings.P2P_turnUsername);settings.P2P_turnCredential&&newUrl.searchParams.set("turnPass",settings.P2P_turnCredential);return newUrl.toString()}};root_126=from_html('
  • ');root32=from_html('
    ');$$css12={hash:"svelte-9kxeje",code:"label.svelte-9kxeje {min-width:4em;width:4em;display:inline-flex;flex-direction:row;justify-content:flex-end;}ul.svelte-9kxeje {flex-grow:1;display:inline-flex;flex-direction:column;list-style-type:none;margin-block-start:0;margin-block-end:0;margin-inline-start:0;margin-inline-end:0;padding-inline-start:0;}li.svelte-9kxeje {padding:var(--size-2-1) var(--size-4-1);display:inline-flex;flex-grow:1;align-items:center;justify-content:flex-end;gap:var(--size-4-2);}li.svelte-9kxeje input:where(.svelte-9kxeje) {min-width:10em;}button.iconbutton.svelte-9kxeje {max-width:4em;}.chip.svelte-9kxeje {background-color:var(--tag-background);color:var(--tag-color);padding:var(--size-2-1) var(--size-4-1);border-radius:0.5em;font-size:0.8em;}.chip.svelte-9kxeje:empty {display:none;}"};EVENT_REQUEST_SHOW_HISTORY="show-history";toc=new Set;stubs={};ObsidianLiveSyncSettingTab=class extends import_obsidian.PluginSettingTab{constructor(app,plugin3){super(app,plugin3);this.selectedScreen="";this.settingComponents=[];this.controlledElementFunc=[];this.onSavedHandlers=[];this.inWizard=!1;this.isShown=!1;this.manifestVersion="0.25.57";this.lastVersion=~~(versionNumberString2Number(this.manifestVersion)/1e3);this.screenElements={};this.enableOnlySyncDisabled=enableOnly(()=>!this.isAnySyncEnabled());this.onlyOnP2POrCouchDB=()=>({visibility:this.isConfiguredAs("remoteType",REMOTE_P2P)||this.isConfiguredAs("remoteType",REMOTE_COUCHDB)});this.onlyOnCouchDB=()=>({visibility:this.isConfiguredAs("remoteType",REMOTE_COUCHDB)});this.onlyOnMinIO=()=>({visibility:this.isConfiguredAs("remoteType",REMOTE_MINIO)});this.onlyOnOnlyP2P=()=>({visibility:this.isConfiguredAs("remoteType",REMOTE_P2P)});this.onlyOnCouchDBOrMinIO=()=>({visibility:this.isConfiguredAs("remoteType",REMOTE_COUCHDB)||this.isConfiguredAs("remoteType",REMOTE_MINIO)});this.checkWorkingPassphrase=async()=>{if(this.editingSettings.remoteType==REMOTE_MINIO)return!0;const settingForCheck={...this.editingSettings},replicator=this.services.replicator.getNewReplicator(settingForCheck);if(!(replicator instanceof LiveSyncCouchDBReplicator))return!0;const db=await replicator.connectRemoteCouchDBWithSetting(settingForCheck,this.services.API.isMobile(),!0);if("string"==typeof db){Logger($msg("obsidianLiveSyncSettingTab.logCheckPassphraseFailed",{db}),LOG_LEVEL_NOTICE);return!1}if(await checkSyncInfo(db.db))return!0;Logger($msg("obsidianLiveSyncSettingTab.logPassphraseNotCompatible"),LOG_LEVEL_NOTICE);return!1};this.isPassphraseValid=async()=>{if(this.editingSettings.encrypt&&""==this.editingSettings.passphrase){Logger($msg("obsidianLiveSyncSettingTab.logEncryptionNoPassphrase"),LOG_LEVEL_NOTICE);return!1}if(this.editingSettings.encrypt&&!await testCrypt()){Logger($msg("obsidianLiveSyncSettingTab.logEncryptionNoSupport"),LOG_LEVEL_NOTICE);return!1}return!0};this.rebuildDB=async method=>{if(this.editingSettings.encrypt&&""==this.editingSettings.passphrase)Logger($msg("obsidianLiveSyncSettingTab.logEncryptionNoPassphrase"),LOG_LEVEL_NOTICE);else if(!this.editingSettings.encrypt||await testCrypt()){this.editingSettings.encrypt||(this.editingSettings.passphrase="");this.applyAllSettings();await this.services.setting.suspendAllSync();await this.services.setting.suspendExtraSync();this.reloadAllSettings();this.editingSettings.isConfigured=!0;Logger($msg("obsidianLiveSyncSettingTab.logRebuildNote"),LOG_LEVEL_NOTICE);await this.saveAllDirtySettings();this.closeSetting();await delay(2e3);await this.core.rebuilder.$performRebuildDB(method)}else Logger($msg("obsidianLiveSyncSettingTab.logEncryptionNoSupport"),LOG_LEVEL_NOTICE)};this.plugin=plugin3;LiveSyncSetting.env=this;eventHub.onEvent("reload-setting-tab",()=>{this.requestReload()})}get core(){return this.plugin.core}get services(){return this.core.services}get editingSettings(){this._editingSettings||this.reloadAllSettings();return this._editingSettings}set editingSettings(v2){this._editingSettings||this.reloadAllSettings();this._editingSettings=v2}applySetting(keys3){for(const k2 of keys3)if(this.isDirty(k2)&&!(k2 in OnDialogSettingsDefault)){this.core.settings[k2]=this.editingSettings[k2];this.initialSettings[k2]=this.core.settings[k2]}keys3.forEach(e3=>this.refreshSetting(e3))}applyAllSettings(){var _a8;const changedKeys=Object.keys(null!=(_a8=this.editingSettings)?_a8:{}).filter(e3=>this.isDirty(e3));this.applySetting(changedKeys);this.reloadAllSettings()}async saveLocalSetting(key3){var _a8,_b5,_c3,_d2;if("configPassphrase"==key3){localStorage.setItem("ls-setting-passphrase",null!=(_b5=null==(_a8=this.editingSettings)?void 0:_a8[key3])?_b5:"");return await Promise.resolve()}if("deviceAndVaultName"==key3){this.services.setting.setDeviceAndVaultName(null!=(_d2=null==(_c3=this.editingSettings)?void 0:_c3[key3])?_d2:"");this.services.setting.saveDeviceAndVaultName();return await Promise.resolve()}}async saveSettings(keys3){let hasChanged=!1;const appliedKeys=[];for(const k2 of keys3)if(this.isDirty(k2)){appliedKeys.push(k2);if(k2 in OnDialogSettingsDefault){await this.saveLocalSetting(k2);this.initialSettings[k2]=this.editingSettings[k2]}else{this.core.settings[k2]=this.editingSettings[k2];this.initialSettings[k2]=this.core.settings[k2];hasChanged=!0}}hasChanged&&await this.services.setting.saveSettingData();const handlers3=this.onSavedHandlers.filter(e3=>-1!==appliedKeys.indexOf(e3.key)).map(e3=>e3.handler(this.editingSettings[e3.key]));await Promise.all(handlers3);keys3.forEach(e3=>this.refreshSetting(e3))}async saveAllDirtySettings(){var _a8;const changedKeys=Object.keys(null!=(_a8=this.editingSettings)?_a8:{}).filter(e3=>this.isDirty(e3));await this.saveSettings(changedKeys);this.reloadAllSettings()}requestUpdate(){scheduleTask("update-setting",10,()=>{for(const setting of this.settingComponents)setting._onUpdate();for(const func of this.controlledElementFunc)func()})}reloadAllLocalSettings(){const ret={...OnDialogSettingsDefault};ret.configPassphrase=localStorage.getItem("ls-setting-passphrase")||"";ret.preset="";ret.deviceAndVaultName=this.services.setting.getDeviceAndVaultName();return ret}computeAllLocalSettings(){var _a8,_b5;return{syncMode:(null==(_a8=this.editingSettings)?void 0:_a8.liveSync)?"LIVESYNC":(null==(_b5=this.editingSettings)?void 0:_b5.periodicReplication)?"PERIODIC":"ONEVENTS"}}reloadAllSettings(skipUpdate=!1){const localSetting=this.reloadAllLocalSettings();this._editingSettings={...this.core.settings,...localSetting};this._editingSettings={...this.editingSettings,...this.computeAllLocalSettings()};this.initialSettings={...this.editingSettings};skipUpdate||this.requestUpdate()}refreshSetting(key3){const localSetting=this.reloadAllLocalSettings();if(key3 in this.core.settings)if(key3 in localSetting){this.initialSettings[key3]=localSetting[key3];this.editingSettings[key3]=localSetting[key3]}else{this.initialSettings[key3]=this.core.settings[key3];this.editingSettings[key3]=this.initialSettings[key3]}this.editingSettings={...this.editingSettings,...this.computeAllLocalSettings()};this.requestUpdate()}isDirty(key3){var _a8;return isObjectDifferent(this.editingSettings[key3],null==(_a8=this.initialSettings)?void 0:_a8[key3])}isSomeDirty(keys3){return keys3.some(e3=>this.isDirty(e3))}isConfiguredAs(key3,value){return!!this.editingSettings&&this.editingSettings[key3]==value}async testConnection(settingOverride={}){const trialSetting={...this.editingSettings,...settingOverride},replicator=await this.services.replicator.getNewReplicator(trialSetting);if(!replicator){Logger("No replicator available for the current settings.",LOG_LEVEL_NOTICE);return}await replicator.tryConnectRemote(trialSetting);const status=await replicator.getRemoteStatus(trialSetting);status&&status.estimatedSize&&Logger($msg("obsidianLiveSyncSettingTab.logEstimatedSize",{size:sizeToHumanReadable(status.estimatedSize)}),LOG_LEVEL_NOTICE)}closeSetting(){this.plugin.app.setting.close()}handleElement(element2,func){const updateFunc=((element3,func2)=>{const prev={};return()=>{const newValue=func2(),keys3=Object.keys(newValue);for(const k2 of keys3)if(prev[k2]!==newValue[k2]){"visibility"==k2&&element3.toggleClass("sls-setting-hidden",!newValue[k2]);prev[k2]=newValue[k2]}}})(element2,func);this.controlledElementFunc.push(updateFunc);updateFunc()}createEl(el,tag3,o2,callback,func){const element2=el.createEl(tag3,o2,callback);func&&this.handleElement(element2,func);return element2}addEl(el,tag3,o2,callback,func){const elm=this.createEl(el,tag3,o2,callback,func);return Promise.resolve(elm)}addOnSaved(key3,func){this.onSavedHandlers.push({key:key3,handler:func})}resetEditingSettings(){this._editingSettings=void 0;this.initialSettings=void 0}hide(){this.isShown=!1}requestReload(){var _a8;if(this.isShown){const newConf=this.core.settings,keys3=Object.keys(newConf);let hasLoaded=!1;for(const k2 of keys3)if(isObjectDifferent(newConf[k2],null==(_a8=this.initialSettings)?void 0:_a8[k2]))if(this.isDirty(k2))this.core.confirm.askInPopup(`config-reloaded-${k2}`,$msg("obsidianLiveSyncSettingTab.msgSettingModified",{setting:getConfName(k2)}),anchor=>{anchor.text=$msg("obsidianLiveSyncSettingTab.optionHere");anchor.addEventListener("click",()=>{this.refreshSetting(k2);this.display()})});else{this.refreshSetting(k2);if(k2 in OnDialogSettingsDefault)continue;hasLoaded=!0}hasLoaded?this.display():this.requestUpdate()}else this.reloadAllSettings(!0)}changeDisplay(screen){for(const k2 in this.screenElements)k2==screen?this.screenElements[k2].forEach(element2=>element2.removeClass("setting-collapsed")):this.screenElements[k2].forEach(element2=>element2.addClass("setting-collapsed"));this.menuEl&&this.menuEl.querySelectorAll(".sls-setting-label").forEach(element2=>{if(element2.hasClass(`c-${screen}`)){element2.addClass("selected");element2.querySelector("input[type=radio]").checked=!0}else{element2.removeClass("selected");element2.querySelector("input[type=radio]").checked=!1}});this.selectedScreen=screen}async enableMinimalSetup(){this.editingSettings.liveSync=!1;this.editingSettings.periodicReplication=!1;this.editingSettings.syncOnSave=!1;this.editingSettings.syncOnEditorSave=!1;this.editingSettings.syncOnStart=!1;this.editingSettings.syncOnFileOpen=!1;this.editingSettings.syncAfterMerge=!1;this.core.replicator.closeReplication();await this.saveAllDirtySettings();this.containerEl.addClass("isWizard");this.inWizard=!0;this.changeDisplay("20")}addScreenElement(key3,element2){key3 in this.screenElements||(this.screenElements[key3]=[]);this.screenElements[key3].push(element2)}selectPane(event2){const target=event2.target;if("INPUT"==target.tagName){const value=target.getAttribute("value");value&&this.selectedScreen!=value&&this.changeDisplay(value)}}isNeedRebuildLocal(){return this.isSomeDirty(["useIndexedDBAdapter","doNotUseFixedRevisionForChunks","handleFilenameCaseSensitive","passphrase","useDynamicIterationCount","usePathObfuscation","encrypt"])}isNeedRebuildRemote(){return this.isSomeDirty(["doNotUseFixedRevisionForChunks","handleFilenameCaseSensitive","passphrase","useDynamicIterationCount","usePathObfuscation","encrypt"])}isAnySyncEnabled(){var _a8,_b5,_c3,_d2;return!(this.isConfiguredAs("isConfigured",!1)||!this.isConfiguredAs("liveSync",!0)&&!this.isConfiguredAs("periodicReplication",!0)&&!this.isConfiguredAs("syncOnFileOpen",!0)&&!this.isConfiguredAs("syncOnSave",!0)&&!this.isConfiguredAs("syncOnEditorSave",!0)&&!this.isConfiguredAs("syncOnStart",!0)&&!this.isConfiguredAs("syncAfterMerge",!0)&&!this.isConfiguredAs("syncOnFileOpen",!0)&&"CONNECTED"!=(null==(_b5=null==(_a8=this.core)?void 0:_a8.replicator)?void 0:_b5.syncStatus)&&"PAUSED"!=(null==(_d2=null==(_c3=this.core)?void 0:_c3.replicator)?void 0:_d2.syncStatus))}async confirmRebuild(){if(!await this.isPassphraseValid()){Logger("Passphrase is not valid, please fix it.",LOG_LEVEL_NOTICE);return}const OPTION_FETCH=$msg("obsidianLiveSyncSettingTab.optionFetchFromRemote"),OPTION_REBUILD_BOTH=$msg("obsidianLiveSyncSettingTab.optionRebuildBoth"),OPTION_ONLY_SETTING=$msg("obsidianLiveSyncSettingTab.optionSaveOnlySettings"),OPTION_CANCEL=$msg("obsidianLiveSyncSettingTab.optionCancel"),title=$msg("obsidianLiveSyncSettingTab.titleRebuildRequired"),note=$msg("obsidianLiveSyncSettingTab.msgRebuildRequired",{OPTION_REBUILD_BOTH,OPTION_FETCH,OPTION_ONLY_SETTING}),buttons=[OPTION_FETCH,OPTION_REBUILD_BOTH,OPTION_ONLY_SETTING,OPTION_CANCEL],result=await confirmWithMessage(this.plugin,title,note,buttons,OPTION_CANCEL,0);if(result!=OPTION_CANCEL&&(result!=OPTION_FETCH||await this.checkWorkingPassphrase()||"yes"==await this.core.confirm.askYesNoDialog($msg("obsidianLiveSyncSettingTab.msgAreYouSureProceed"),{defaultOption:"No"}))){this.editingSettings.encrypt||(this.editingSettings.passphrase="");await this.saveAllDirtySettings();await this.applyAllSettings();if(result==OPTION_FETCH){await this.core.storageAccess.writeFileAuto(FLAGMD_REDFLAG3_HR,"");this.services.appLifecycle.scheduleRestart();this.closeSetting()}else if(result==OPTION_REBUILD_BOTH){await this.core.storageAccess.writeFileAuto(FLAGMD_REDFLAG2_HR,"");this.services.appLifecycle.scheduleRestart();this.closeSetting()}else result==OPTION_ONLY_SETTING&&await this.services.setting.saveSettingData()}}display(){const changeDisplay=this.changeDisplay.bind(this),{containerEl}=this;this.settingComponents.length=0;this.controlledElementFunc.length=0;this.onSavedHandlers.length=0;this.screenElements={};null!=this._editingSettings&&null!=this.initialSettings||this.reloadAllSettings();if(void 0===this.editingSettings||null==this.initialSettings)return;this.isShown=!0;containerEl.empty();containerEl.addClass("sls-setting");containerEl.removeClass("isWizard");setStyle(containerEl,"menu-setting-poweruser",()=>this.isConfiguredAs("usePowerUserMode",!0));setStyle(containerEl,"menu-setting-advanced",()=>this.isConfiguredAs("useAdvancedMode",!0));setStyle(containerEl,"menu-setting-edgecase",()=>this.isConfiguredAs("useEdgeCaseMode",!0));const menuWrapper=this.createEl(containerEl,"div",{cls:"sls-setting-menu-wrapper"});this.menuEl&&this.menuEl.remove();this.menuEl=menuWrapper.createDiv("");this.menuEl.addClass("sls-setting-menu");const menuTabs=this.menuEl.querySelectorAll(".sls-setting-label");this.createEl(menuWrapper,"div",{cls:"sls-setting-menu-buttons"},el=>{el.addClass("wizardHidden");el.createEl("label",{text:$msg("obsidianLiveSyncSettingTab.msgChangesNeedToBeApplied")});this.addEl(el,"button",{text:$msg("obsidianLiveSyncSettingTab.optionApply"),cls:"mod-warning"},buttonEl=>{buttonEl.addEventListener("click",()=>fireAndForget(async()=>await this.confirmRebuild()))})},visibleOnly(()=>this.isNeedRebuildLocal()||this.isNeedRebuildRemote()));let paneNo=0;const addPane=(parentEl,title,icon,order,wizardHidden,level)=>{const el=this.createEl(parentEl,"div",{text:""});{const mdTitle=`${paneNo++}. ${title}${getLevelStr(null!=level?level:"")}`;el.setAttribute("data-pane",mdTitle);toc.add(`| ${icon} | [${mdTitle}](#${mdTitle.toLowerCase().replace(/ /g,"-").replace(/[^\w\s-]/g,"")}) | `)}setLevelClass(el,level);el.createEl("h3",{text:title,cls:"sls-setting-pane-title"});this.menuEl&&this.menuEl.createEl("label",{cls:`sls-setting-label c-${order} ${wizardHidden?"wizardHidden":""}`},el2=>{setLevelClass(el2,level);const inputEl=el2.createEl("input",{type:"radio",name:"disp",value:`${order}`,cls:"sls-setting-tab"});el2.createEl("div",{cls:"sls-setting-menu-btn",text:icon,title});inputEl.addEventListener("change",evt=>this.selectPane(evt));inputEl.addEventListener("click",evt=>this.selectPane(evt))});this.addScreenElement(`${order}`,el);return Promise.resolve(el)},panelNoMap={},addPanel=(parentEl,title,callback,func,level)=>{const el=this.createEl(parentEl,"div",{text:""},callback,func);{const paneNo2=findAttrFromParent(parentEl,"data-pane");paneNo2 in panelNoMap||(panelNoMap[paneNo2]=0);panelNoMap[paneNo2]+=1;const panelNo=panelNoMap[paneNo2];el.setAttribute("data-panel",`${panelNo}. ${title}${getLevelStr(null!=level?level:"")}`)}setLevelClass(el,level);this.createEl(el,"h4",{text:title,cls:"sls-setting-panel-title"});return Promise.resolve(el)};menuTabs.forEach(element2=>{const e3=element2.querySelector(".sls-setting-tab");e3&&e3.addEventListener("change",event2=>{menuTabs.forEach(element3=>element3.removeClass("selected"));this.changeDisplay(event2.currentTarget.value);element2.addClass("selected")})});const bindPane=paneFunc=>paneEl=>{paneFunc.call(this,paneEl,{addPane,addPanel})};addPane(containerEl,$msg("obsidianLiveSyncSettingTab.panelChangeLog"),"💬",100,!1).then(bindPane(paneChangeLog));addPane(containerEl,$msg("obsidianLiveSyncSettingTab.panelSetup"),"🧙‍♂️",110,!1).then(bindPane(paneSetup));addPane(containerEl,$msg("obsidianLiveSyncSettingTab.panelGeneralSettings"),"⚙️",20,!1).then(bindPane(paneGeneral));addPane(containerEl,$msg("obsidianLiveSyncSettingTab.panelRemoteConfiguration"),"🛰️",0,!1).then(bindPane(paneRemoteConfig));addPane(containerEl,$msg("obsidianLiveSyncSettingTab.titleSyncSettings"),"🔄",30,!1).then(bindPane(paneSyncSettings));addPane(containerEl,"Selector","🚦",33,!1,LEVEL_ADVANCED).then(bindPane(paneSelector));addPane(containerEl,"Customization sync","🔌",60,!1,LEVEL_ADVANCED).then(bindPane(paneCustomisationSync));addPane(containerEl,"Hatch","🧰",50,!0).then(bindPane(paneHatch));addPane(containerEl,"Advanced","🔧",46,!1,LEVEL_ADVANCED).then(bindPane(paneAdvanced));addPane(containerEl,"Power users","💪",47,!0,LEVEL_POWER_USER).then(bindPane(panePowerUsers));addPane(containerEl,"Patches","🩹",51,!1,LEVEL_EDGE_CASE).then(bindPane(panePatches));addPane(containerEl,"Maintenance","🎛️",70,!0).then(bindPane(paneMaintenance));yieldNextAnimationFrame().then(()=>{""==this.selectedScreen?this.lastVersion!=this.editingSettings.lastReadUpdates?this.editingSettings.isConfigured?changeDisplay("100"):changeDisplay("110"):this.isAnySyncEnabled()?changeDisplay("20"):changeDisplay("110"):changeDisplay(this.selectedScreen);this.requestUpdate()})}getMinioJournalSyncClient(){return new JournalSyncMinio(this.core.settings,this.core.simpleStore,this.core)}async resetRemoteBucket(){const minioJournal=this.getMinioJournalSyncClient();await minioJournal.resetBucket()}};ModuleObsidianSettingDialogue=class extends AbstractObsidianModule{_everyOnloadStart(){this.settingTab=new ObsidianLiveSyncSettingTab(this.app,this.plugin);this.plugin.addSettingTab(this.settingTab);eventHub.onEvent("request-open-settings",()=>this.openSetting());eventHub.onEvent("request-open-setting-wizard",()=>{this.openSetting();this.settingTab.enableMinimalSetup()});return Promise.resolve(!0)}openSetting(){this.app.setting.open();this.app.setting.openTabById("obsidian-livesync")}get appId(){return`${"appId"in this.app?this.app.appId:""}`}onBindFunction(core,services){services.appLifecycle.onInitialise.addHandler(this._everyOnloadStart.bind(this))}};DocumentHistoryModal=class extends import_obsidian.Modal{constructor(app,core,plugin3,file,id,revision){super(app);this.showDiff=!1;this.revs_info=[];this.currentText="";this.currentDeleted=!1;this.BlobURLs=new Map;this.plugin=plugin3;this.core=core;this.file=file instanceof import_obsidian.TFile?getPathFromTFile(file):file;this.id=id;this.initialRev=revision;!file&&id&&(this.file=this.services.path.id2path(id));"1"==localStorage.getItem("ols-history-highlightdiff")&&(this.showDiff=!0)}get services(){return this.core.services}async loadFile(initialRev){var _a8,_b5;this.id||(this.id=await this.services.path.path2id(this.file));const db=this.core.localDatabase;try{const w2=await db.getRaw(this.id,{revs_info:!0});this.revs_info=null!=(_b5=null==(_a8=w2._revs_info)?void 0:_a8.filter(e3=>"available"==(null==e3?void 0:e3.status)))?_b5:[];this.range.max=`${Math.max(this.revs_info.length-1,0)}`;this.range.value=this.range.max;this.fileInfo.setText(`${this.file} / ${this.revs_info.length} revisions`);await this.loadRevs(initialRev)}catch(ex){if(isErrorOfMissingDoc(ex)){this.range.max="0";this.range.value="";this.range.disabled=!0;this.contentView.setText("We don't have any history for this note.")}else{this.contentView.setText("Error while loading file.");Logger(ex,LOG_LEVEL_VERBOSE)}}}async loadRevs(initialRev){if(0==this.revs_info.length)return;if(initialRev){const rIndex=this.revs_info.findIndex(e3=>e3.rev==initialRev);rIndex>=0&&(this.range.value=""+(this.revs_info.length-1-rIndex))}const index6=this.revs_info.length-1-this.range.value/1,rev3=this.revs_info[index6];await this.showExactRev(rev3.rev)}revokeURL(key3){const v2=this.BlobURLs.get(key3);v2&&URL.revokeObjectURL(v2);this.BlobURLs.delete(key3)}generateBlobURL(key3,data){this.revokeURL(key3);const v2=URL.createObjectURL(new Blob([data],{endings:"transparent",type:"application/octet-stream"}));this.BlobURLs.set(key3,v2);return v2}async showExactRev(rev3){const db=this.core.localDatabase,w2=await db.getDBEntry(this.file,{rev:rev3},!1,!1,!0);this.currentText="";this.currentDeleted=!1;if(!1===w2){this.currentDeleted=!0;this.info.innerHTML="";this.contentView.innerHTML=`Could not read this revision
    (${rev3})`}else{this.currentDoc=w2;this.info.innerHTML=`Modified:${new Date(w2.mtime).toLocaleString()}`;let result;const w1data=readDocument(w2);this.currentDeleted=!!w2.deleted;if(this.showDiff){const prevRevIdx=this.revs_info.length-1-(this.range.value/1-1);if(prevRevIdx>=0&&prevRevIdx"+escapeStringToHTML(x2)+"":x1==import_diff_match_patch.DIFF_EQUAL?result+=""+escapeStringToHTML(x2)+"":x1==import_diff_match_patch.DIFF_INSERT&&(result+=""+escapeStringToHTML(x2)+"")}result=result.replace(/\n/g,"
    ")}else if(isImage(this.file)){result=`
    \n
    \n \n \n
    \n
    `;this.contentView.removeClass("op-pre")}}}if(null==result)if("string"!=typeof w1data){if(isImage(this.file)){result=`
    \n
    \n\n
    \n
    `;this.contentView.removeClass("op-pre")}}else result=escapeStringToHTML(w1data);null==result&&(result="string"==typeof w1data?escapeStringToHTML(w1data):"Binary file");this.contentView.innerHTML=(this.currentDeleted?"(At this revision, the file has been deleted)\n":"")+result}}onOpen(){const{contentEl}=this;this.titleEl.setText("Document History");contentEl.empty();this.fileInfo=contentEl.createDiv("");this.fileInfo.addClass("op-info");const divView=contentEl.createDiv("");divView.addClass("op-flex");divView.createEl("input",{type:"range"},e3=>{this.range=e3;e3.addEventListener("change",e4=>{scheduleOnceIfDuplicated("loadRevs",()=>this.loadRevs())});e3.addEventListener("input",e4=>{scheduleOnceIfDuplicated("loadRevs",()=>this.loadRevs())})});contentEl.createDiv("",e3=>{e3.createEl("label",{},label2=>{label2.appendChild(createEl("input",{type:"checkbox"},checkbox=>{this.showDiff&&(checkbox.checked=!0);checkbox.addEventListener("input",evt=>{this.showDiff=checkbox.checked;localStorage.setItem("ols-history-highlightdiff",1==this.showDiff?"1":"");scheduleOnceIfDuplicated("loadRevs",()=>this.loadRevs())})}));label2.appendText("Highlight diff")})}).addClass("op-info");this.info=contentEl.createDiv("");this.info.addClass("op-info");fireAndForget(async()=>await this.loadFile(this.initialRev));const div=contentEl.createDiv({text:"Loading old revisions..."});this.contentView=div;div.addClass("op-scrollable");div.addClass("op-pre");const buttons=contentEl.createDiv("");buttons.createEl("button",{text:"Copy to clipboard"},e3=>{e3.addClass("mod-cta");e3.addEventListener("click",()=>{fireAndForget(async()=>{await navigator.clipboard.writeText(this.currentText);Logger("Old content copied to clipboard",LOG_LEVEL_NOTICE)})})});const focusFile=async path2=>{const targetFile=this.plugin.app.vault.getFileByPath(path2);if(targetFile){const leaf=this.plugin.app.workspace.getLeaf(!1);await leaf.openFile(targetFile)}else Logger("Unable to display the file in the editor",LOG_LEVEL_NOTICE)};buttons.createEl("button",{text:"Back to this revision"},e3=>{e3.addClass("mod-cta");e3.addEventListener("click",()=>{fireAndForget(async()=>{const pathToWrite=stripPrefix(this.file);if(!isValidPath(pathToWrite)){Logger("Path is not valid to write content.",LOG_LEVEL_INFO);return}if(!this.currentDoc){Logger("No active file loaded.",LOG_LEVEL_INFO);return}const d4=readContent(this.currentDoc);await this.core.storageAccess.writeHiddenFileAuto(pathToWrite,d4);await focusFile(pathToWrite);this.close()})})})}onClose(){const{contentEl}=this;contentEl.empty();this.BlobURLs.forEach(value=>{console.log(value);value&&URL.revokeObjectURL(value)})}};ModuleObsidianDocumentHistory=class extends AbstractObsidianModule{_everyOnloadStart(){this.addCommand({id:"livesync-history",name:"Show history",callback:()=>{const file=this.services.vault.getActiveFilePath();file&&this.showHistory(file,void 0)}});this.addCommand({id:"livesync-filehistory",name:"Pick a file to show history",callback:()=>{fireAndForget(async()=>await this.fileHistory())}});eventHub.onEvent(EVENT_REQUEST_SHOW_HISTORY,({file,fileOnDB})=>{this.showHistory(file,fileOnDB._id)});return Promise.resolve(!0)}showHistory(file,id){new DocumentHistoryModal(this.app,this.core,this.plugin,file,id).open()}async fileHistory(){const notes=[];for await(const doc of this.localDatabase.findAllDocs())notes.push({id:doc._id,path:this.getPath(doc),dispPath:this.getPath(doc),mtime:doc.mtime});notes.sort((a2,b3)=>b3.mtime-a2.mtime);const notesList=notes.map(e3=>e3.dispPath),target=await this.core.confirm.askSelectString("File to view History",notesList);if(target){const targetId=notes.find(e3=>e3.dispPath==target);this.showHistory(targetId.path,targetId.id)}}onBindFunction(core,services){services.appLifecycle.onInitialise.addHandler(this._everyOnloadStart.bind(this))}};root_127=from_html('
    Gathering information...
    ');root_217=from_html('Chunks');root_36=from_html('
    ');root_412=from_html('
    ');root_67=from_html(' ');root_79=from_html(' ');root_89=from_html(' ');root_104=from_html(' ');root_54=from_html('
    ');root_1112=from_html('
    ');root_128=from_html('
    ');root33=from_html('

    Vault history

    DatePathRevStat
    ');$$css13={hash:"svelte-1ddarry",code:".svelte-1ddarry {box-sizing:border-box;}.globalhistory.svelte-1ddarry {margin-bottom:2em;}table.svelte-1ddarry {width:100%;}.more.svelte-1ddarry > div:where(.svelte-1ddarry) {display:flex;}.more.svelte-1ddarry > div:where(.svelte-1ddarry) > button:where(.svelte-1ddarry) {flex-grow:1;}th.svelte-1ddarry {position:sticky;top:0;backdrop-filter:blur(10px);}td.mtime.svelte-1ddarry {white-space:break-spaces;}td.path.svelte-1ddarry {word-break:break-word;}.row.svelte-1ddarry {display:flex;flex-direction:row;flex-wrap:wrap;}.row.svelte-1ddarry > label:where(.svelte-1ddarry) {display:flex;align-items:center;min-width:5em;}.row.svelte-1ddarry > input:where(.svelte-1ddarry) {flex-grow:1;}.filenames.svelte-1ddarry {display:flex;flex-direction:column;}.filenames.svelte-1ddarry > .path:where(.svelte-1ddarry) {font-size:70%;}.rev.svelte-1ddarry {text-overflow:ellipsis;max-width:3em;display:inline-block;overflow:hidden;white-space:nowrap;}"};GlobalHistoryView=class extends SvelteItemView{constructor(leaf,plugin3){super(leaf);this.icon="clock";this.title="";this.navigation=!0;this.plugin=plugin3}instantiateComponent(target){return mount(GlobalHistory,{target,props:{plugin:this.plugin,core:this.plugin.core}})}getIcon(){return"clock"}getViewType(){return"global-history"}getDisplayText(){return"Vault history"}};ModuleObsidianGlobalHistory=class extends AbstractObsidianModule{_everyOnloadStart(){this.addCommand({id:"livesync-global-history",name:"Show vault history",callback:()=>{this.showGlobalHistory()}});this.registerView("global-history",leaf=>new GlobalHistoryView(leaf,this.plugin));return Promise.resolve(!0)}showGlobalHistory(){this.services.API.showWindow("global-history")}onBindFunction(core,services){services.appLifecycle.onInitialise.addHandler(this._everyOnloadStart.bind(this))}};ModuleIntegratedTest=class extends AbstractObsidianModule{async waitFor(proc,timeout=1e4){await delay(100);const start=Date.now();for(;!await proc();){if(timeout>0&&Date.now()-start>timeout){this._log("Timeout");return!1}await delay(500)}return!0}waitWithReplicating(proc,timeout=1e4){return this.waitFor(async()=>{await this.tryReplicate();return await proc()},timeout)}async storageContentIsEqual(file,content){try{return await this.readStorageContent(file)===content}catch(e3){this._log(`Error: ${e3}`);return!1}}async assert(proc){if(!await proc()){this._log("Assertion failed");return!1}return!0}async __orDie(key3,proc){if(!await this._test(key3,proc))throw new Error(`${key3}`);return!0}tryReplicate(){if(!this.settings.liveSync)return shareRunningResult("replicate-test",async()=>{await this.services.replication.replicate()})}async readStorageContent(file){if(await this.core.storageAccess.isExistsIncludeHidden(file))return await this.core.storageAccess.readHiddenFileText(file)}async __proceed(no,title){const stepContent=`Step ${no}`;await this.services.conflict.resolveByNewest("_STEP.md");await this.core.storageAccess.writeFileAuto("_STEP.md",stepContent);await this.__orDie(`Wait for acknowledge ${no}`,async()=>!!await this.waitWithReplicating(async()=>await this.storageContentIsEqual("_STEP_ACK.md",stepContent),2e4));return!0}async __join(no,title){const stepContent=`Step ${no}`;await this.__orDie(`Wait for step ${no} (${title})`,async()=>!!await this.waitWithReplicating(async()=>await this.storageContentIsEqual("_STEP.md",stepContent),2e4));await this.services.conflict.resolveByNewest("_STEP_ACK.md");await this.core.storageAccess.writeFileAuto("_STEP_ACK.md",stepContent);await this.tryReplicate();return!0}async performStep({step,title,isGameChanger,proc,check}){if(isGameChanger){await this.__proceed(step,title);try{await proc()}catch(e3){this._log(`Error: ${e3}`);return!1}return await this.__orDie(`Step ${step} - ${title}`,async()=>await this.waitWithReplicating(check))}return await this.__join(step,title)}async nonLiveTestRunner(isLeader,testMain){const storage=this.core.storageAccess;let testFileName;this.addTestResult("-------Starting ... ",!0,`Test as ${isLeader?"Leader":"Receiver"} command file IT.md`);isLeader&&await this.__proceed(0,"start");await this.tryReplicate();await this.performStep({step:0,title:"Make sure that command File Not Exists",isGameChanger:isLeader,proc:async()=>await storage.removeHidden("IT.md"),check:async()=>!await storage.isExistsIncludeHidden("IT.md")});await this.performStep({step:1,title:"Make sure that command File Not Exists On Receiver",isGameChanger:!isLeader,proc:async()=>await storage.removeHidden("ITx.md"),check:async()=>!await storage.isExistsIncludeHidden("ITx.md")});await this.performStep({step:2,title:"Decide the test file name",isGameChanger:isLeader,proc:async()=>{testFileName=Date.now()+"-"+Math.ceil(1e3*Math.random())+".md";await storage.writeFileAuto("IT.md",testFileName)},check:()=>Promise.resolve(!0)});await this.performStep({step:3,title:"Wait for the command file to be arrived",isGameChanger:!isLeader,proc:async()=>{},check:async()=>await storage.isExistsIncludeHidden("IT.md")});await this.performStep({step:4,title:"Send the response file",isGameChanger:!isLeader,proc:async()=>{await storage.writeHiddenFileAuto("ITx.md","!")},check:()=>Promise.resolve(!0)});await this.performStep({step:5,title:"Wait for the response file to be arrived",isGameChanger:isLeader,proc:async()=>{},check:async()=>await storage.isExistsIncludeHidden("ITx.md")});await this.performStep({step:6,title:"Proceed to begin the test",isGameChanger:isLeader,proc:async()=>{},check:()=>Promise.resolve(!0)});await this.performStep({step:6,title:"Begin the test",isGameChanger:!0,proc:async()=>{},check:()=>Promise.resolve(!0)});try{this.addTestResult("** Main------",!0,"");if(isLeader)return await testMain(testFileName,!0);{const testFileName2=await this.readStorageContent("IT.md");this.addTestResult("testFileName",!0,`Request client to use :${testFileName2}`);return await testMain(testFileName2,!1)}}finally{this.addTestResult("Teardown",!0,`Deleting ${testFileName}`);await storage.removeHidden(testFileName)}return!0}async testBasic(filename,isLeader){const storage=this.core.storageAccess,database=this.core.databaseFileAccess;await this.addTestResult("---**Starting Basic Test**---",!0,`Test as ${isLeader?"Leader":"Receiver"} command file ${filename}`);await this.performStep({step:0,title:"Make sure that file is not exist",isGameChanger:!isLeader,proc:async()=>{},check:async()=>!await storage.isExists(filename)});await this.performStep({step:1,title:"Write a file",isGameChanger:isLeader,proc:async()=>await storage.writeFileAuto(filename,"Hello World"),check:async()=>await storage.isExists(filename)});await this.performStep({step:2,title:"Make sure the file is arrived",isGameChanger:!isLeader,proc:async()=>{},check:async()=>await storage.isExists(filename)});await this.performStep({step:3,title:"Update to Hello World 2",isGameChanger:isLeader,proc:async()=>await storage.writeFileAuto(filename,"Hello World 2"),check:async()=>await this.storageContentIsEqual(filename,"Hello World 2")});await this.performStep({step:4,title:"Make sure the modified file is arrived",isGameChanger:!isLeader,proc:async()=>{},check:async()=>await this.storageContentIsEqual(filename,"Hello World 2")});await this.performStep({step:5,title:"Update to Hello World 3",isGameChanger:!isLeader,proc:async()=>await storage.writeFileAuto(filename,"Hello World 3"),check:async()=>await this.storageContentIsEqual(filename,"Hello World 3")});await this.performStep({step:6,title:"Make sure the modified file is arrived",isGameChanger:isLeader,proc:async()=>{},check:async()=>await this.storageContentIsEqual(filename,"Hello World 3")});await this.performStep({step:7,title:"Update to Multiline",isGameChanger:isLeader,proc:async()=>await storage.writeFileAuto(filename,"Line1:A\nLine2:B\nLine3:C\nLine4:D"),check:async()=>await this.storageContentIsEqual(filename,"Line1:A\nLine2:B\nLine3:C\nLine4:D")});await this.performStep({step:8,title:"Make sure the modified file is arrived",isGameChanger:!isLeader,proc:async()=>{},check:async()=>await this.storageContentIsEqual(filename,"Line1:A\nLine2:B\nLine3:C\nLine4:D")});if(!this.settings.liveSync){const multiLineContentL="Line1:A\nLine2:B\nLine3:C!\nLine4:D",multiLineContentC="Line1:A\nLine2:bbbbb\nLine3:C\nLine4:D";await this.performStep({step:9,title:"Progress to be conflicted",isGameChanger:isLeader,proc:async()=>{},check:()=>Promise.resolve(!0)});await storage.writeFileAuto(filename,isLeader?multiLineContentL:multiLineContentC);await this.performStep({step:10,title:"Update As Conflicted",isGameChanger:!isLeader,proc:async()=>{},check:()=>Promise.resolve(!0)});await this.performStep({step:10,title:"Make sure Automatically resolved",isGameChanger:isLeader,proc:async()=>{},check:async()=>0===(await database.getConflictedRevs(filename)).length});await this.performStep({step:11,title:"Make sure Automatically resolved",isGameChanger:!isLeader,proc:async()=>{},check:async()=>0===(await database.getConflictedRevs(filename)).length});const sensiblyMergedContent="Line1:A\nLine2:bbbbb\nLine3:C!\nLine4:D";await this.performStep({step:12,title:"Make sure Sensibly Merged on Leader",isGameChanger:isLeader,proc:async()=>{},check:async()=>await this.storageContentIsEqual(filename,sensiblyMergedContent)});await this.performStep({step:13,title:"Make sure Sensibly Merged on Receiver",isGameChanger:!isLeader,proc:async()=>{},check:async()=>await this.storageContentIsEqual(filename,sensiblyMergedContent)})}await this.performStep({step:14,title:"Delete File",isGameChanger:isLeader,proc:async()=>{await storage.removeHidden(filename)},check:async()=>!await storage.isExists(filename)});await this.performStep({step:15,title:"Make sure File is deleted",isGameChanger:!isLeader,proc:async()=>{},check:async()=>!await storage.isExists(filename)});this._log("The Basic Test has been completed",LOG_LEVEL_NOTICE);return!0}async testBasicEvent(isLeader){this.settings.liveSync=!1;await this.saveSettings();await this._test("basic",async()=>await this.nonLiveTestRunner(isLeader,(t9,l2)=>this.testBasic(t9,l2)))}async testBasicLive(isLeader){this.settings.liveSync=!0;await this.saveSettings();await this._test("basic",async()=>await this.nonLiveTestRunner(isLeader,(t9,l2)=>this.testBasic(t9,l2)))}async _everyModuleTestMultiDevice(){if(!this.settings.enableDebugTools)return Promise.resolve(!0);const isLeader=-1===this.core.services.vault.vaultName().indexOf("recv");this.addTestResult("-------",!0,"Test as "+(isLeader?"Leader":"Receiver"));try{this._log("Starting Test");await this.testBasicEvent(isLeader);this.settings.remoteType==REMOTE_MINIO&&await this.testBasicLive(isLeader)}catch(e3){this._log(e3);this._log(`Error: ${e3}`);return Promise.resolve(!1)}return Promise.resolve(!0)}onBindFunction(core,services){services.test.testMultiDevice.addHandler(this._everyModuleTestMultiDevice.bind(this))}};ModuleReplicateTest=class extends AbstractObsidianModule{constructor(){super(...arguments);this.testRootPath="_test/";this.testInfoPath="_testinfo/";this.watchIsSynchronised=!1}get isLeader(){return this.services.vault.getVaultName().indexOf("dev")>=0&&this.services.vault.vaultName().indexOf("recv")<0}get nameByKind(){return this.isLeader?this.isLeader?"LEADER":void 0:"RECV"}get pairName(){return this.isLeader?"RECV":this.isLeader?void 0:"LEADER"}async readFileContent(file){try{return await this.core.storageAccess.readHiddenFileText(file)}catch(e3){return""}}async dumpList(){if(this.settings.syncInternalFiles){this._log("Write file list (Include Hidden)");await this.__dumpFileListIncludeHidden("files.md")}else{this._log("Write file list");await this.__dumpFileList("files.md")}}async _everyBeforeReplicate(showMessage){if(!this.settings.enableDebugTools)return Promise.resolve(!0);await this.dumpList();return!0}_everyOnloadAfterLoadSettings(){if(!this.settings.enableDebugTools)return Promise.resolve(!0);this.addCommand({id:"dump-file-structure-normal",name:"Dump Structure (Normal)",callback:()=>{this.__dumpFileList("files.md").finally(()=>{this.refreshSyncStatus()})}});this.addCommand({id:"dump-file-structure-ih",name:"Dump Structure (Include Hidden)",callback:()=>{this.__dumpFileListIncludeHidden("files.md")}});this.addCommand({id:"dump-file-structure-auto",name:"Dump Structure",callback:()=>{this.dumpList()}});this.addCommand({id:"dump-file-test",name:"Perform Test (Dev) "+(this.isLeader?"(Leader)":"(Recv)"),callback:()=>{this.performTestManually()}});this.addCommand({id:"watch-sync-result",name:"Watch sync result is matched between devices",callback:()=>{this.watchIsSynchronised=!this.watchIsSynchronised;this.refreshSyncStatus()}});this.app.vault.on("modify",async file=>{file.path.startsWith(this.testInfoPath)?await this.refreshSyncStatus():scheduleTask("dumpStatus",125,async()=>{await this.dumpList();return!0})});this.statusBarSyncStatus=this.plugin.addStatusBarItem();return Promise.resolve(!0)}async getSyncStatusAsText(){const fileMine=this.testInfoPath+this.nameByKind+"/files.md",filePair=this.testInfoPath+this.pairName+"/files.md",mine=(0,import_obsidian.parseYaml)(await this.readFileContent(fileMine)),pair=(0,import_obsidian.parseYaml)(await this.readFileContent(filePair)),result=[];mine.length!=pair.length&&result.push(`File count is different: ${mine.length} vs ${pair.length}`);const filesAll=new Set([...mine.map(e3=>e3.path),...pair.map(e3=>e3.path)]);for(const file of filesAll){const mineFile=mine.find(e3=>e3.path==file),pairFile=pair.find(e3=>e3.path==file);if(mineFile&&pairFile){mineFile.size!=pairFile.size&&result.push(`Size is different: ${file} ${mineFile.size} vs ${pairFile.size}`);mineFile.hash!=pairFile.hash&&result.push(`Hash is different: ${file} ${mineFile.hash} vs ${pairFile.hash}`)}else result.push(`File not found: ${file}`)}eventHub.emitEvent("debug-sync-status",result);return result.join("\n")}async refreshSyncStatus(){if(this.watchIsSynchronised){const syncStatus=await this.getSyncStatusAsText();if(syncStatus){this.statusBarSyncStatus.setText("Sync Status: Having Error");this._log(`Sync Status: Having Error\n${syncStatus}`,LOG_LEVEL_INFO)}else this.statusBarSyncStatus.setText("Sync Status: Synchronised")}else this.statusBarSyncStatus.setText("")}async __dumpFileList(outFile){if(!this.core||!this.core.storageAccess){this._log("No storage access",LOG_LEVEL_INFO);return}const files=await this.core.storageAccess.getFiles(),out=[],webcrypto6=await getWebCrypto();for(const file of files){if(!await this.services.vault.isTargetFile(file.path))continue;if(file.path.startsWith(this.testInfoPath))continue;const stat=await this.core.storageAccess.stat(file.path);if(stat){const hashSrc=await this.core.storageAccess.readHiddenFileBinary(file.path),hash3=await webcrypto6.subtle.digest("SHA-1",hashSrc),hashStr=uint8ArrayToHexString(new Uint8Array(hash3)),item={path:file.path,name:file.name,size:stat.size,mtime:stat.mtime,hash:hashStr};out.push(item)}}out.sort((a2,b3)=>a2.path.localeCompare(b3.path));if(outFile){outFile=this.testInfoPath+this.nameByKind+"/"+outFile;await this.core.storageAccess.ensureDir(outFile);await this.core.storageAccess.writeHiddenFileAuto(outFile,(0,import_obsidian.stringifyYaml)(out))}this._log(`Dumped ${out.length} files`,LOG_LEVEL_INFO)}async __dumpFileListIncludeHidden(outFile){const ignorePatterns=getFileRegExp(this.core.settings,"syncInternalFilesIgnorePatterns"),targetPatterns=getFileRegExp(this.core.settings,"syncInternalFilesTargetPatterns"),out=[],files=await this.core.storageAccess.getFilesIncludeHidden("",targetPatterns,ignorePatterns),webcrypto6=await getWebCrypto();for(const file of files){if(file.startsWith(this.testInfoPath))continue;const stat=await this.core.storageAccess.statHidden(file);if(stat){const hashSrc=await this.core.storageAccess.readHiddenFileBinary(file),hash3=await webcrypto6.subtle.digest("SHA-1",hashSrc),hashStr=uint8ArrayToHexString(new Uint8Array(hash3)),item={path:file,name:file.split("/").pop(),size:stat.size,mtime:stat.mtime,hash:hashStr};out.push(item)}}out.sort((a2,b3)=>a2.path.localeCompare(b3.path));if(outFile){outFile=this.testInfoPath+this.nameByKind+"/"+outFile;await this.core.storageAccess.ensureDir(outFile);await this.core.storageAccess.writeHiddenFileAuto(outFile,(0,import_obsidian.stringifyYaml)(out))}this._log(`Dumped ${out.length} files`,LOG_LEVEL_NOTICE)}async collectTestFiles(){const files=["README.md","docs/adding_translations.md","docs/design_docs_of_journalsync.md","docs/design_docs_of_keep_newborn_chunks.md","docs/design_docs_of_prefixed_hidden_file_sync.md","docs/design_docs_of_sharing_tweak_value.md","docs/quick_setup_cn.md","docs/quick_setup_ja.md","docs/quick_setup.md","docs/settings_ja.md","docs/settings.md","docs/setup_cloudant_ja.md","docs/setup_cloudant.md","docs/setup_flyio.md","docs/setup_own_server_cn.md","docs/setup_own_server_ja.md","docs/setup_own_server.md","docs/tech_info_ja.md","docs/tech_info.md","docs/terms.md","docs/troubleshooting.md","images/1.png","images/2.png","images/corrupted_data.png","images/hatch.png","images/lock_pattern1.png","images/lock_pattern2.png","images/quick_setup_1.png","images/quick_setup_2.png","images/quick_setup_3.png","images/quick_setup_3b.png","images/quick_setup_4.png","images/quick_setup_5.png","images/quick_setup_6.png","images/quick_setup_7.png","images/quick_setup_8.png","images/quick_setup_9_1.png","images/quick_setup_9_2.png","images/quick_setup_10.png","images/remote_db_setting.png","images/write_logs_into_the_file.png"];for(const file of files){const remote="https://raw.githubusercontent.com/vrtmrz/obsidian-livesync/refs/heads/main/"+file,local=this.testRootPath+file;try{const f4=(await(0,import_obsidian.requestUrl)(remote)).arrayBuffer;await this.core.storageAccess.ensureDir(local);await this.core.storageAccess.writeHiddenFileAuto(local,f4)}catch(ex){this._log(`Could not fetch ${remote}`,LOG_LEVEL_VERBOSE);this._log(ex,LOG_LEVEL_VERBOSE)}}await this.dumpList()}async waitFor(proc,timeout=1e4){await delay(100);const start=Date.now();for(;!await proc();){if(timeout>0&&Date.now()-start>timeout){this._log("Timeout");return!1}await delay(500)}return!0}async testConflictedManually1(){await this.services.replication.replicate();this.isLeader&&await this.core.storageAccess.writeHiddenFileAuto(this.testRootPath+"wonka.md","Resolve! \n*****, the amazing chocolatier!!");await this.services.replication.replicate();await this.services.replication.replicate();if("no"==await this.core.confirm.askYesNoDialog("Ready to begin the test conflict Manually 1?",{timeout:30,defaultOption:"Yes"}))return;const fileA="Resolve to KEEP THIS\nWilly Wonka, Willy Wonka, the amazing chocolatier!!";this.isLeader?await this.core.storageAccess.writeHiddenFileAuto(this.testRootPath+"wonka.md",fileA):await this.core.storageAccess.writeHiddenFileAuto(this.testRootPath+"wonka.md","Resolve to DISCARD THIS\nCharlie Bucket, Charlie Bucket, the amazing chocolatier!!");if("no"!=await this.core.confirm.askYesNoDialog("Ready to check the result of Manually 1?",{timeout:30,defaultOption:"Yes"})){await this.services.replication.replicate();await this.services.replication.replicate();return!!await this.waitFor(async()=>{await this.services.replication.replicate();return 1==await this.__assertStorageContent(this.testRootPath+"wonka.md",fileA,!1,!0)},3e4)||await this.__assertStorageContent(this.testRootPath+"wonka.md",fileA,!1,!0)}}async testConflictedManually2(){await this.services.replication.replicate();this.isLeader&&await this.core.storageAccess.writeHiddenFileAuto(this.testRootPath+"concat.md","Resolve To concatenate\nABCDEFG");await this.services.replication.replicate();await this.services.replication.replicate();if("no"==await this.core.confirm.askYesNoDialog("Ready to begin the test conflict Manually 2?",{timeout:30,defaultOption:"Yes"}))return;const concatenated="Resolve to Concatenate\nABCDEFGHIJKLMNOPQRSTUVWXYZ";this.isLeader?await this.core.storageAccess.writeHiddenFileAuto(this.testRootPath+"concat.md","Resolve to Concatenate\nABCDEFGHIJKLMNOPQRSTYZ"):await this.core.storageAccess.writeHiddenFileAuto(this.testRootPath+"concat.md","Resolve to Concatenate\nAJKLMNOPQRSTUVWXYZ");if("no"!=await this.core.confirm.askYesNoDialog("Ready to test conflict Manually 2?",{timeout:30,defaultOption:"Yes"})){await this.services.replication.replicate();await this.services.replication.replicate();return!!await this.waitFor(async()=>{await this.services.replication.replicate();return 1==await this.__assertStorageContent(this.testRootPath+"concat.md",concatenated,!1,!0)},3e4)||await this.__assertStorageContent(this.testRootPath+"concat.md",concatenated,!1,!0)}}async testConflictAutomatic(){if(this.isLeader){const baseDoc="Tasks!\n- [ ] Task 1\n- [ ] Task 2\n- [ ] Task 3\n- [ ] Task 4\n";await this.core.storageAccess.writeHiddenFileAuto(this.testRootPath+"task.md",baseDoc)}await delay(100);await this.services.replication.replicate();await this.services.replication.replicate();if("no"!=await this.core.confirm.askYesNoDialog("Ready to test conflict?",{timeout:30,defaultOption:"Yes"})){this.isLeader?await this.core.storageAccess.writeHiddenFileAuto(this.testRootPath+"task.md","Tasks!\n- [ ] Task 1\n- [v] Task 2\n- [ ] Task 3\n- [ ] Task 4\n"):await this.core.storageAccess.writeHiddenFileAuto(this.testRootPath+"task.md","Tasks!\n- [ ] Task 1\n- [ ] Task 2\n- [v] Task 3\n- [ ] Task 4\n");await this.services.replication.replicate();await this.services.replication.replicate();await delay(1e3);if("no"!=await this.core.confirm.askYesNoDialog("Ready to check result?",{timeout:30,defaultOption:"Yes"})){await this.services.replication.replicate();await this.services.replication.replicate();return this.__assertStorageContent(this.testRootPath+"task.md","Tasks!\n- [ ] Task 1\n- [v] Task 2\n- [v] Task 3\n- [ ] Task 4\n",!1,!0)}}}async checkConflictResolution(){this._log("Before testing conflicted files, resolve all once",LOG_LEVEL_NOTICE);await this.services.conflict.resolveAllConflictedFilesByNewerOnes();await this.services.conflict.resolveAllConflictedFilesByNewerOnes();await this.services.replication.replicate();await delay(1e3);if(!await this.testConflictAutomatic()){this._log("Conflict resolution (Auto) failed",LOG_LEVEL_NOTICE);return!1}if(!await this.testConflictedManually1()){this._log("Conflict resolution (Manual1) failed",LOG_LEVEL_NOTICE);return!1}if(!await this.testConflictedManually2()){this._log("Conflict resolution (Manual2) failed",LOG_LEVEL_NOTICE);return!1}return!0}async __assertStorageContent(fileName,content,inverted=!1,showResult=!1){try{const fileContent=await this.core.storageAccess.readHiddenFileText(fileName);let result=fileContent===content;inverted&&(result=!result);if(result)return!0;showResult&&this._log(`Content is not same \n Expected:${content}\n Actual:${fileContent}`,LOG_LEVEL_VERBOSE);return`Content is not same \n Expected:${content}\n Actual:${fileContent}`}catch(e3){this._log(`Cannot assert storage content: ${e3}`);return!1}}async performTestManually(){if(!this.settings.enableDebugTools)return Promise.resolve(!0);await this.checkConflictResolution()}async _everyModuleTestMultiDevice(){if(!this.settings.enableDebugTools)return Promise.resolve(!0);await this._test("Conflict resolution",async()=>await this.checkConflictResolution());return this.testDone()}onBindFunction(core,services){services.appLifecycle.onSettingLoaded.addHandler(this._everyOnloadAfterLoadSettings.bind(this));services.replication.onBeforeReplicate.addHandler(this._everyBeforeReplicate.bind(this));services.test.testMultiDevice.addHandler(this._everyModuleTestMultiDevice.bind(this))}};LocalDatabaseMaintenance=class extends LiveSyncCommands{onunload(){}onload(){this.plugin.addCommand({id:"analyse-database",name:"Analyse Database Usage (advanced)",icon:"database-search",callback:async()=>{await this.analyseDatabase()}});this.plugin.addCommand({id:"gc-v3",name:"Garbage Collection V3 (advanced, beta)",icon:"trash-2",callback:async()=>{await this.gcv3()}});eventHub.onEvent(EVENT_ANALYSE_DB_USAGE,()=>this.analyseDatabase());eventHub.onEvent(EVENT_REQUEST_PERFORM_GC_V3,()=>this.gcv3())}async allChunks(includeDeleted=!1){const p2=this._progress("",LOG_LEVEL_NOTICE);p2.log("Retrieving chunks informations..");try{return await this.localDatabase.allChunks(includeDeleted)}finally{p2.done()}}get database(){return this.localDatabase.localDatabase}clearHash(){this.localDatabase.clearCaches()}async confirm(title,message,affirmative="Yes",negative="No"){return await this.core.confirm.askSelectStringDialogue(message,[affirmative,negative],{title,defaultAction:affirmative})===affirmative}isAvailable(){if(!this.settings.doNotUseFixedRevisionForChunks){this._notice("Please enable 'Compute revisions for chunks' in settings to use Garbage Collection.");return!1}if(this.settings.readChunksOnline){this._notice("Please disable 'Read chunks online' in settings to use Garbage Collection.");return!1}return!0}async resurrectChunks(){if(!this.isAvailable())return;const{used,existing}=await this.allChunks(!0),excessiveDeletions=[...existing].filter(([key3,e3])=>e3._deleted).filter(([key3,e3])=>used.has(e3._id)).map(([key3,e3])=>e3),completelyLostChunks=[],dataLostChunks=[...existing].filter(([key3,e3])=>e3._deleted&&""===e3.data).map(([key3,e3])=>e3).filter(e3=>used.has(e3._id));for(const e3 of dataLostChunks){let resurrected=null;const availableRevs=((await this.database.get(e3._id,{rev:e3._rev,revs:!0,revs_info:!0,conflicts:!0}))._revs_info||[]).filter(e4=>"available"==e4.status).map(e4=>e4.rev).sort((a2,b3)=>getNoFromRev(a2)-getNoFromRev(b3));for(const rev3 of availableRevs){const revDoc=await this.database.get(e3._id,{rev:rev3});if("leaf"==revDoc.type&&""!==revDoc.data){resurrected=revDoc.data;break}}null!==resurrected?excessiveDeletions.push({...e3,data:resurrected,_deleted:!1}):completelyLostChunks.push(e3._id)}const resurrectChunks=excessiveDeletions.filter(e3=>""!==e3.data).map(e3=>({...e3,_deleted:!1}));if(0==resurrectChunks.length){this._notice("No chunks are found to be resurrected.");return}const message=`We have following chunks that are deleted but still used in the database.\n\n- Completely lost chunks: ${completelyLostChunks.length}\n- Resurrectable chunks: ${resurrectChunks.length}\n\nDo you want to resurrect these chunks?`;if(await this.confirm("Resurrect Chunks",message,"Resurrect","Cancel")){const result=await this.database.bulkDocs(resurrectChunks);this.clearHash();const resurrectedChunks=result.filter(e3=>"ok"in e3).map(e3=>e3.id);this._notice(`Resurrected chunks: ${resurrectedChunks.length} / ${resurrectChunks.length}`)}else this._notice("Resurrect operation is cancelled.")}async commitFileDeletion(){if(!this.isAvailable())return;const p2=this._progress("",LOG_LEVEL_NOTICE);p2.log("Searching for deleted files..");const deletedDocs=(await this.database.allDocs({include_docs:!0})).rows.filter(e3=>{var _a8,_b5,_c3;return("newnote"==(null==(_a8=e3.doc)?void 0:_a8.type)||"plain"==(null==(_b5=e3.doc)?void 0:_b5.type))&&(null==(_c3=e3.doc)?void 0:_c3.deleted)});if(0==deletedDocs.length){p2.done("No deleted files found.");return}p2.log(`Found ${deletedDocs.length} deleted files.`);const message=`We have following files that are marked as deleted.\n\n- Deleted files: ${deletedDocs.length}\n\nAre you sure to delete these files permanently?\n\nNote: **Make sure to synchronise all devices before deletion.**\n\n> [!Note]\n> This operation affects the database permanently. Deleted files will not be recovered after this operation.\n> And, the chunks that are used in the deleted files will be ready for compaction.`,deletingDocs=deletedDocs.map(e3=>({...e3.doc,_deleted:!0}));if(await this.confirm("Delete Files",message,"Delete","Cancel")){const result=await this.database.bulkDocs(deletingDocs);this.clearHash();p2.done(`Deleted ${result.filter(e3=>"ok"in e3).length} / ${deletedDocs.length} files.`)}else p2.done("Deletion operation is cancelled.")}async commitChunkDeletion(){if(!this.isAvailable())return;const{existing}=await this.allChunks(!0),deletedChunks=[...existing].filter(([key3,e3])=>e3._deleted&&""!==e3.data).map(([key3,e3])=>e3),deletedNotVacantChunks=deletedChunks.map(e3=>({...e3,data:"",_deleted:!0})),humanSize=sizeToHumanReadable(deletedChunks.reduce((acc,e3)=>acc+e3.data.length,0)),message=`We have following chunks that are marked as deleted.\n\n- Deleted chunks: ${deletedNotVacantChunks.length} (${humanSize})\n\nAre you sure to delete these chunks permanently?\n\nNote: **Make sure to synchronise all devices before deletion.**\n\n> [!Note]\n> This operation finally reduces the capacity of the remote.`;if(0!=deletedNotVacantChunks.length)if(await this.confirm("Delete Chunks",message,"Delete","Cancel")){const result=await this.database.bulkDocs(deletedNotVacantChunks);this.clearHash();this._notice(`Deleted chunks: ${result.filter(e3=>"ok"in e3).length} / ${deletedNotVacantChunks.length}`)}else this._notice("Deletion operation is cancelled.");else this._notice("No deleted chunks found.")}async markUnusedChunks(){if(!this.isAvailable())return;const{used,existing}=await this.allChunks(),deleteChunks=[...existing].filter(([key3,e3])=>!used.has(e3._id)).map(([key3,e3])=>e3).map(e3=>({...e3,_deleted:!0})),humanSize=sizeToHumanReadable(deleteChunks.reduce((acc,e3)=>acc+e3.data.length,0));if(0==deleteChunks.length){this._notice("No unused chunks found.");return}const message=`We have following chunks that are not used from any files.\n\n- Chunks: ${deleteChunks.length} (${humanSize})\n\nAre you sure to mark these chunks to be deleted?\n\nNote: **Make sure to synchronise all devices before deletion.**\n\n> [!Note]\n> This operation will not reduces the capacity of the remote until permanent deletion.`;if(await this.confirm("Mark unused chunks",message,"Mark","Cancel")){const result=await this.database.bulkDocs(deleteChunks);this.clearHash();this._notice(`Marked chunks: ${result.filter(e3=>"ok"in e3).length} / ${deleteChunks.length}`)}}async removeUnusedChunks(){const{used,existing}=await this.allChunks(),unusedChunks=[...existing].filter(([key3,e3])=>!used.has(e3._id)).map(([key3,e3])=>e3),deleteChunks=unusedChunks.map(e3=>({...e3,data:"",_deleted:!0})),humanSize=sizeToHumanReadable(unusedChunks.reduce((acc,e3)=>acc+e3.data.length,0));if(0==deleteChunks.length){this._notice("No unused chunks found.");return}const message=`We have following chunks that are not used from any files.\n\n- Chunks: ${deleteChunks.length} (${humanSize})\n\nAre you sure to delete these chunks?\n\nNote: **Make sure to synchronise all devices before deletion.**\n\n> [!Note]\n> Chunks referenced from deleted files are not deleted. Please run "Commit File Deletion" before this operation.`;if(await this.confirm("Mark unused chunks",message,"Mark","Cancel")){const result=await this.database.bulkDocs(deleteChunks);this._notice(`Deleted chunks: ${result.filter(e3=>"ok"in e3).length} / ${deleteChunks.length}`);this.clearHash()}}async scanUnusedChunks(){const kvDB=this.core.kvDB,chunkSet=await kvDB.get("chunk-set")||new Set,chunkUsageMap=await kvDB.get("doc-usage-map")||new Map,unusedSet=new Set([...chunkSet]);for(const[,revIdMap]of chunkUsageMap){const sortedRevId=[...revIdMap.entries()].sort((a2,b3)=>getNoFromRev(b3[0])-getNoFromRev(a2[0]));sortedRevId.length;sortedRevId.slice(0,10).forEach(e3=>e3[1].forEach(ee=>unusedSet.delete(ee)))}return{chunkSet,chunkUsageMap,unusedSet}}async trackChanges(fromStart=!1,showNotice=!1){if(!this.isAvailable())return;const logLevel=showNotice?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,kvDB=this.core.kvDB,previousSeq=fromStart?"":await kvDB.get("gc-seq"),chunkSet=await kvDB.get("chunk-set")||new Set,chunkUsageMap=await kvDB.get("doc-usage-map")||new Map,db=this.localDatabase.localDatabase,verbose2=msg=>this._verbose(msg),processDoc=async(doc,isDeleted2)=>{if(!("children"in doc))return;const id=doc._id,rev3=doc._rev,deleted=doc._deleted||isDeleted2,softDeleted=doc.deleted,children=doc.children||[];chunkUsageMap.has(id)||chunkUsageMap.set(id,new Map);for(const chunkId of children)deleted?chunkUsageMap.get(id).delete(rev3):chunkUsageMap.get(id).set(rev3,(chunkUsageMap.get(id).get(rev3)||new Set).add(chunkId));verbose2(`Tracking chunk: ${id}/${rev3} (${null==doc?void 0:doc.path}), deleted: ${deleted?"yes":"no"} Soft-Deleted:${softDeleted?"yes":"no"}`);return await Promise.resolve()},saveState=async seq=>{await kvDB.set("gc-seq",seq);await kvDB.set("chunk-set",chunkSet);await kvDB.set("doc-usage-map",chunkUsageMap)},processDocRevisions=async doc=>{var _a8;try{const oldRevisions=await db.get(doc._id,{revs:!0,revs_info:!0,conflicts:!0}),allRevs=(null==(_a8=oldRevisions._revs_info)?void 0:_a8.length)||0,info3=(oldRevisions._revs_info||[]).filter(e3=>"available"==e3.status&&e3.rev!=doc._rev).filter(info4=>{var _a9;return!(null==(_a9=chunkUsageMap.get(doc._id))?void 0:_a9.has(info4.rev))}),infoLength=info3.length;this._log(`Found ${allRevs} old revisions for ${doc._id} . ${infoLength} items to check `);if(info3.length>0){const oldDocs=await Promise.all(info3.filter(revInfo=>"available"==revInfo.status).map(revInfo=>db.get(doc._id,{rev:revInfo.rev}))).then(docs=>docs.filter(doc2=>doc2));for(const oldDoc of oldDocs)await processDoc(oldDoc,!1)}}catch(ex){if(404==(null==ex?void 0:ex.status))this._log(`No revisions found for ${doc._id}`,LOG_LEVEL_VERBOSE);else{this._log(`Error finding revisions for ${doc._id}`);this._verbose(ex)}}},processChange2=async(doc,isDeleted2,seq)=>{if("leaf"===doc.type){if(isDeleted2)return;chunkSet.add(doc._id)}else if("children"in doc){await processDoc(doc,isDeleted2);await serialized("x-process-doc",async()=>await processDocRevisions(doc))}};let i2=0;await db.changes({since:previousSeq||"",live:!1,conflicts:!0,include_docs:!0,style:"all_docs",return_docs:!1}).on("change",async change=>{var _a8;await processChange2(change.doc,null!=(_a8=change.deleted)&&_a8,change.seq);i2++%100==0&&await saveState(change.seq)}).on("complete",async info3=>{await saveState(info3.last_seq)});const result=await this.scanUnusedChunks(),message=`Total chunks: ${result.chunkSet.size}\nUnused chunks: ${result.unusedSet.size}`;this._log(message,logLevel)}async performGC(showingNotice=!1){var _a8;if(!this.isAvailable())return;await this.trackChanges(!1,showingNotice);const logLevel=showingNotice?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO;if("Yes, delete chunks"!==await this.core.confirm.askSelectStringDialogue("This function deletes unused chunks from the device. If there are differences between devices, some chunks may be missing when resolving conflicts.\nBe sure to synchronise before executing.\n\nHowever, if you have deleted them, you may be able to recover them by performing Hatch -> Recreate missing chunks for all files.\n\nAre you ready to delete unused chunks?",["Yes, delete chunks","Cancel"],{title:"Are all devices synchronised?",defaultAction:"Cancel"})){this._log("User cancelled chunk deletion",logLevel);return}const{unusedSet,chunkSet}=await this.scanUnusedChunks(),deleteChunks=await this.database.allDocs({keys:[...unusedSet],include_docs:!0});for(const chunk of deleteChunks.rows)(null==(_a8=null==chunk?void 0:chunk.value)?void 0:_a8.deleted)&&chunkSet.delete(chunk.key);const deleteDocs=deleteChunks.rows.filter(e3=>"doc"in e3).map(e3=>({...e3.doc,_deleted:!0}));this._log(`Deleting chunks: ${deleteDocs.length}`,logLevel);const deleteChunkBatch=arrayToChunkedArray(deleteDocs,100);let successCount=0,errored=0;for(const batch of deleteChunkBatch){const results=await this.database.bulkDocs(batch);for(const result2 of results)if("ok"in result2){chunkSet.delete(result2.id);successCount++}else{this._log(`Failed to delete doc: ${result2.id}`,LOG_LEVEL_VERBOSE);errored++}this._log(`Deleting chunks: ${successCount} `,logLevel,"gc-preforming")}const message=`Garbage Collection completed.\nSuccess: ${successCount}, Errored: ${errored}`;this._log(message,logLevel);const kvDB=this.core.kvDB;await kvDB.set("chunk-set",chunkSet)}async analyseDatabase(){if(!this.isAvailable())return;const db=this.localDatabase.localDatabase,chunkMap=new Map,docMap=new Map,info3=await db.info(),maxSeq=new Number(info3.update_seq);let processed=0,read=0,errored=0;const ft=[],fetchRevision=async(id,rev3,seq)=>{try{processed++;const doc=await db.get(id,{rev:rev3});if(doc){if("children"in doc){const id2=doc._id,rev4=doc._rev,children=doc.children||[],set2=docMap.get(id2)||new Set;set2.add({id:id2,rev:rev4,chunks:new Set(children),uniqueChunks:new Set,sharedChunks:new Set,path:doc.path});docMap.set(id2,set2)}else if("leaf"===doc.type){const id2=doc._id;if(chunkMap.has(id2))return;if(doc._deleted)return;const length=doc.data.length,set2=chunkMap.get(id2)||new Set;set2.add({id:id2,length,refCount:0});chunkMap.set(id2,set2)}read++}else{this._log(`Analysing Database: not found: ${id} / ${rev3}`);errored++}}catch(error){this._log(`Error fetching document ${id} / ${rev3}: $`,LOG_LEVEL_NOTICE);this._log(error,LOG_LEVEL_VERBOSE);errored++}processed%100==0&&this._log(`Analysing database: ${read} (${errored}) / ${maxSeq} `,LOG_LEVEL_NOTICE,"db-analyse")},IDs=this.localDatabase.findEntryNames("","",{});for await(const id of IDs){const revInfos=(await this.localDatabase.getRaw(id,{revs:!0,revs_info:!0,conflicts:!0}))._revs_info||[];for(const revInfo of revInfos)"available"==revInfo.status&&ft.push(fetchRevision(id,revInfo.rev))}await Promise.all(ft);for(const[,docRevs]of docMap)for(const docRev of docRevs)for(const chunkId of docRev.chunks){const chunkInfos=chunkMap.get(chunkId);if(chunkInfos)for(const chunkInfo of chunkInfos){0===chunkInfo.refCount?docRev.uniqueChunks.add(chunkId):docRev.sharedChunks.add(chunkId);chunkInfo.refCount++}}const result=[],getTotalSize=ids=>[...ids].reduce((acc,chunkId)=>{const chunkInfos=chunkMap.get(chunkId);if(chunkInfos)for(const chunkInfo of chunkInfos)acc+=chunkInfo.length;return acc},0);for(const doc of docMap.values())for(const rev3 of doc){const title=`${rev3.path} (${rev3.rev})`,id=rev3.id,revStr=`${getNoFromRev(rev3.rev)}`,revHash=rev3.rev.split("-")[1].substring(0,6),path2=rev3.path,uniqueChunkCount=rev3.uniqueChunks.size,sharedChunkCount=rev3.sharedChunks.size,uniqueChunkSize=getTotalSize(rev3.uniqueChunks),sharedChunkSize=getTotalSize(rev3.sharedChunks);result.push({title,path:path2,rev:revStr,revHash,id,uniqueChunkCount,sharedChunkCount,uniqueChunkSize,sharedChunkSize})}const orphanChunks=[...chunkMap.entries()].filter(([chunkId,infos])=>0===[...infos].reduce((acc,info4)=>acc+info4.refCount,0)),orphanChunkSize=orphanChunks.reduce((acc,[chunkId,infos])=>{for(const info4 of infos)acc+=info4.length;return acc},0);result.push({title:"__orphan",id:"__orphan",path:"__orphan",rev:"1",revHash:"xxxxx",uniqueChunkCount:orphanChunks.length,sharedChunkCount:0,uniqueChunkSize:orphanChunkSize,sharedChunkSize:0});const csvSrc=result.map(e3=>[`${e3.title.replace(/"/g,'""')}"`,`${e3.id}`,`${e3.path}`,`${e3.rev}`,`${e3.revHash}`,`${e3.uniqueChunkCount}`,`${e3.sharedChunkCount}`,`${e3.uniqueChunkSize}`,`${e3.sharedChunkSize}`].join("\t"));csvSrc.unshift(Object.values({title:"Title",id:"Document ID",path:"Path",rev:"Revision No",revHash:"Revision Hash",uniqueChunkCount:"Unique Chunk Count",sharedChunkCount:"Shared Chunk Count",uniqueChunkSize:"Unique Chunk Size",sharedChunkSize:"Shared Chunk Size"}).join("\t"));const csv=csvSrc.join("\n");await this.services.UI.promptCopyToClipboard("Database Analysis data (TSV):",csv)}async compactDatabase(){const replicator=this.core.replicator,remote=await replicator.connectRemoteCouchDBWithSetting(this.settings,!1,!1,!0);if(!remote){this._notice("Failed to connect to remote for compaction.","gc-compact");return}if("string"==typeof remote){this._notice(`Failed to connect to remote for compaction. ${remote}`,"gc-compact");return}const compactResult=await remote.db.compact({interval:1e3});let timeout=12e4;for(;;){const status=await remote.db.info();if(!("compact_running"in status)||!(null==status?void 0:status.compact_running))break;this._notice("Compaction in progress on remote database...","gc-compact");await delay(2e3);timeout-=2e3;if(timeout<=0){this._notice("Compaction on remote database timed out.","gc-compact");break}}compactResult&&"ok"in compactResult?this._notice("Compaction on remote database completed successfully.","gc-compact"):this._notice("Compaction on remote database failed.","gc-compact")}async compactDatabaseWithRevLimit(){return!1}async gcv3(){if(!this.isAvailable())return;const replicator=this.core.replicator;if(!await replicator.openOneShotReplication(this.settings,!1,!1,"sync")){this._notice("Failed to start one-shot replication before Garbage Collection. Garbage Collection Cancelled.");return}const OPTION_CANCEL="Cancel Garbage Collection",info3=await this.core.replicator.getConnectedDeviceList();if(!info3){this._notice("No connected device information found. Cancelling Garbage Collection.");return}const{accepted_nodes,node_info}=info3,infoMissingNodes=[];for(const node of accepted_nodes)node in node_info||infoMissingNodes.push(node);if(infoMissingNodes.length>0){const message2=`The following accepted nodes are missing its node information:\n- ${infoMissingNodes.join("\n- ")}\n\nThis indicates that they have not been connected for some time or have been left on an older version.\nIt is preferable to update all devices if possible. If you have any devices that are no longer in use, you can clear all accepted nodes by locking the remote once.`,OPTION_IGNORE="Ignore and Proceed",buttons2=[OPTION_CANCEL,OPTION_IGNORE],result2=await this.core.confirm.askSelectStringDialogue(message2,buttons2,{title:"Node Information Missing",defaultAction:OPTION_CANCEL});if(result2===OPTION_CANCEL){this._notice("Garbage Collection cancelled by user.");return}result2===OPTION_IGNORE&&this._notice("Proceeding with Garbage Collection, ignoring missing nodes.")}const progressValues=Object.values(node_info).map(e3=>e3.progress.split("-")[0]).map(e3=>parseInt(e3)),maxProgress=Math.max(...progressValues),minProgress=Math.min(...progressValues),progressDifference=maxProgress-minProgress,detail=`> [!INFO]- The connected devices have been detected as follows:\n${Object.entries(node_info).map(([nodeId,nodeData])=>`> - Device: ${nodeData.device_name} (Node ID: ${nodeId})\n> - Obsidian version: ${nodeData.app_version}\n> - Plug-in version: ${nodeData.plugin_version}\n> - Progress: ${nodeData.progress.split("-")[0]}`).join("\n")}\n`,message=0!=progressDifference?`Some devices have differing progress values (max: ${maxProgress}, min: ${minProgress}).\nThis may indicate that some devices have not completed synchronisation, which could lead to conflicts. Strongly recommend confirming that all devices are synchronised before proceeding.`:`All devices have the same progress value (${maxProgress}). Your devices seem to be synchronised. And be able to proceed with Garbage Collection.`,buttons=["Proceed Garbage Collection",OPTION_CANCEL],defaultAction=0!=progressDifference?OPTION_CANCEL:"Proceed Garbage Collection";if("Proceed Garbage Collection"!==await this.core.confirm.askSelectStringDialogue(message+"\n\n"+detail,buttons,{title:"Garbage Collection Confirmation",defaultAction})){this._notice("Garbage Collection cancelled by user.");return}this._notice("Proceeding with Garbage Collection.");const gcStartTime=Date.now(),localDatabase=this.localDatabase.localDatabase,usedChunks=new Set,allChunks=new Map,IDs=this.localDatabase.findEntryNames("","",{});let i2=0;const doc_count=(await localDatabase.info()).doc_count;for await(const id of IDs){const doc=await this.localDatabase.getRaw(id);i2++;i2%100==0&&this._notice(`Garbage Collection: Scanned ${i2} / ~${doc_count} `,"gc-scanning");if(doc)if("children"in doc){const children=doc.children||[];for(const chunkId of children)usedChunks.add(chunkId)}else"leaf"===doc.type&&allChunks.set(doc._id,doc._rev)}this._notice(`Garbage Collection: Scanning completed. Total chunks: ${allChunks.size}, Used chunks: ${usedChunks.size}`,"gc-scanning");const unusedChunks=[...allChunks.keys()].filter(e3=>!usedChunks.has(e3));this._notice(`Garbage Collection: Found ${unusedChunks.length} unused chunks to delete.`,"gc-scanning");const deleteChunkDocs=unusedChunks.map(chunkId=>({_id:chunkId,_deleted:!0,_rev:allChunks.get(chunkId)})),deletedCount=(await localDatabase.bulkDocs(deleteChunkDocs)).filter(e3=>"ok"in e3).length,gcEndTime=Date.now();this._notice(`Garbage Collection completed. Deleted chunks: ${deletedCount} / ${unusedChunks.length}. Time taken: ${(gcEndTime-gcStartTime)/1e3} seconds.`);if(await replicator.openOneShotReplication(this.settings,!1,!1,"pushOnly")){await this.compactDatabase();this.clearHash()}else this._notice("Failed to start replication after Garbage Collection.")}};ServiceContext=class{};ServiceBase=class{constructor(context2){this.context=context2}};ControlService=class extends ServiceBase{constructor(context2,dependencies){super(context2);this._unloaded=!1;this.services=dependencies;this._log=createInstanceLogFunction("ControlService",this.services.APIService);this._activated=promiseWithResolvers();this.services.appLifecycleService.onLoaded.addHandler(()=>{this.onActivated();return Promise.resolve(!0)})}hasUnloaded(){return this._unloaded}get activated(){return this._activated.promise}onActivated(){this._activated.resolve(!0)}async applySettings(){await this.services.appLifecycleService.onSuspending();await this.services.settingService.onBeforeRealiseSetting();this.services.databaseService.localDatabase.refreshSettings();await this.services.fileProcessingService.commitPendingFileEvents();await this.services.settingService.onRealiseSetting();if(!this.services.appLifecycleService.isSuspended()){await this.services.appLifecycleService.onResuming();await this.services.appLifecycleService.onResumed();await this.services.settingService.onSettingRealised()}}async _onLiveSyncUnload(){eventHub.emitEvent("plugin-unloaded");await this.services.appLifecycleService.onBeforeUnload();await this.services.appLifecycleService.onAppUnload();cancelAllPeriodicTask();cancelAllTasks();stopAllRunningProcessors();await this.services.appLifecycleService.onUnload();this._unloaded=!0;const localDatabase=this.services.databaseService.localDatabaseDirect;if(null!=localDatabase){const activeReplicator=this.services.replicatorService.getActiveReplicator();activeReplicator&&activeReplicator.closeReplication();localDatabase.onunload();await localDatabase.close()}eventHub.emitEvent(EVENT_PLATFORM_UNLOADED);eventHub.offAll();this._log($msg("moduleLiveSyncMain.logUnloadingPlugin"))}async onLoad(){if(!await this.services.appLifecycleService.onLoad()){this._log("Self-hosted LiveSync cannot be initialised, exiting loading.",128);return!1}return!0}async onReady(){return await this.services.appLifecycleService.onReady()}async onUnload(){return await this._onLiveSyncUnload()}};PathService=class extends ServiceBase{get settings(){return this.settingService.currentSettings()}constructor(context2,dependencies){super(context2);this.settingService=dependencies.settingService}_id2path(id,entry){const temp=id2path_base(id,entry).split(":"),path2=temp.pop(),normalizedPath=this.normalizePath(path2);temp.push(normalizedPath);return temp.join(":")}async _path2id(filename,obfuscatePassphrase,caseInsensitive){const temp=filename.split(":"),path2=temp.pop(),normalizedPath=this.normalizePath(path2);temp.push(normalizedPath);const fixedPath=temp.join(":");return await path2id_base(fixedPath,obfuscatePassphrase,caseInsensitive)}id2path(id,entry,stripPrefix2){const tempId=this._id2path(id,entry);return stripPrefix2&&isInternalMetadata(tempId)?stripInternalMetadataPrefix(tempId):tempId}async path2id(filename,prefix){const destPath=addPrefix(filename,null!=prefix?prefix:""),setting=this.settings;return await this._path2id(destPath,setting.usePathObfuscation?setting.passphrase:"",!setting.handleFilenameCaseSensitive)}getPath(entry){return this.id2path(entry._id,entry)}};ServiceHub=class{constructor(context2,services={}){this._injected={};this.context=context2;this._injected=services}get API(){return this._injected.API||this._api}get path(){return this._injected.path||this._path}get database(){return this._injected.database||this._database}get databaseEvents(){return this._injected.databaseEvents||this._databaseEvents}get replicator(){return this._injected.replicator||this._replicator}get fileProcessing(){return this._injected.fileProcessing||this._fileProcessing}get replication(){return this._injected.replication||this._replication}get remote(){return this._injected.remote||this._remote}get conflict(){return this._injected.conflict||this._conflict}get appLifecycle(){return this._injected.appLifecycle||this._appLifecycle}get setting(){return this._injected.setting||this._setting}get tweakValue(){return this._injected.tweakValue||this._tweakValue}get vault(){return this._injected.vault||this._vault}get test(){return this._injected.test||this._test}get UI(){return this._injected.ui||this._ui}get config(){return this._injected.config||this._config}get keyValueDB(){return this._injected.keyValueDB||this._keyValueDB}get control(){return this._injected.control||this._control}};APIService=class extends ServiceBase{constructor(){super(...arguments);this.requestCount=reactiveSource(0);this.responseCount=reactiveSource(0)}get isOnline(){return!("navigator"in globalThis)||navigator.onLine}webCompatFetch(req,opts){return fetch(req,opts)}nativeFetch(req,opts){throw new Error("nativeFetch is not implemented for this platform")}setInterval(handler,timeout){return globalThis.setInterval(handler,timeout)}clearInterval(timerId){globalThis.clearInterval(timerId)}getSystemConfigDir(){return".livesync"}};Binder=class{constructor(name,initialCallback){this._callback=null;this._name=name;initialCallback&&(this._callback=initialCallback)}assign(callback,override=!1){if(this._callback&&!override)throw new Error(`Handler ${this._name} is already assigned.`);this._callback=callback;return()=>{this._callback=null}}invoke(...args){if(this._callback)return this._callback(...args);throw new Error(`Handler ${this._name} is not assigned.`)}};LazyBinder=class{constructor(name,initialCallback){this._callbackPromise=promiseWithResolvers();this._callback=null;this._name=name;if(initialCallback){this._callback=initialCallback;this._callbackPromise.resolve()}}assign(callback,override=!1){if(this._callback&&!override)throw new Error(`Handler ${this._name} is already assigned.`);this._callback=callback;this._callbackPromise.resolve();return()=>{this._callback=null;this._callbackPromise=promiseWithResolvers()}}async invoke(...args){await this._callbackPromise.promise;if(this._callback)return await this._callback(...args);throw new Error(`Handler ${this._name} is not assigned.`)}};MultiBinder=class{constructor(name){this._callbackMap=new Map;this._isCallbackDirty=!1;this._maxUsedPriority=0;this._sortedCallbacks=[];this._name=name}addHandler(callback,priority=0,allowSwap=!1){this._callbackMap.set(callback,[priority,this._maxUsedPriority++]);this._isCallbackDirty=!0;return()=>{this.removeHandler(callback);this._isCallbackDirty=!0}}removeHandler(callback){this._callbackMap.delete(callback);this._isCallbackDirty=!0}use(callback,priority=0){return this.addHandler(callback,priority)}get _callbacks(){if(this._isCallbackDirty){this._sortedCallbacks=Array.from(this._callbackMap.entries()).sort((a2,b3)=>{const[priorityA,registerOrderA]=a2[1],[priorityB,registerOrderB]=b3[1];return priorityA!==priorityB?priorityA-priorityB:registerOrderA-registerOrderB}).map(entry=>entry[0]);this._isCallbackDirty=!1}return this._sortedCallbacks}};DispatchParallel=class extends MultiBinder{dispatch(...args){const promises=[...this._callbacks].map(async callback=>{try{return await Promise.resolve(callback(...args))}catch(error){return error instanceof Error?error:new Error(String(error))}});return Promise.all(promises)}};BooleanHandlerBase=class extends MultiBinder{};AllHandler=class extends BooleanHandlerBase{async invoke(...args){const _callbacks2=[...this._callbacks];for(const callback of _callbacks2)try{if(!1===await Promise.resolve(callback(...args)))return!1}catch(error){Logger(`AllHandler ${this._name} treated error as failure: ${error}`,LOG_LEVEL_VERBOSE);Logger(error,LOG_LEVEL_VERBOSE);return!1}return!0}};ParallelAllHandler=class extends BooleanHandlerBase{async invoke(...args){const promises=[...this._callbacks].map(async callback=>{try{return await Promise.resolve(callback(...args))}catch(error){Logger(`ParallelAllHandler ${this._name} treated error as failure: ${error}`,LOG_LEVEL_VERBOSE);return!1}});return(await Promise.all(promises)).every(res2=>!0===res2)}};AnySuccessHandler=class extends BooleanHandlerBase{async invoke(...args){const _callbacks2=[...this._callbacks];for(const callback of _callbacks2)try{if(!0===await Promise.resolve(callback(...args)))return!0}catch(error){Logger(`FirstSuccessHandler ${this._name} ignored error: ${error}`,LOG_LEVEL_VERBOSE)}return!1}};FirstResultHandler=class extends MultiBinder{async invoke(...args){const _callbacks2=[...this._callbacks];for(const callback of _callbacks2)try{const result=await Promise.resolve(callback(...args));if(void 0!==result&&!1!==result)return result}catch(error){Logger(`FirstResultHandler ${this._name} ignored error: ${error}`,LOG_LEVEL_VERBOSE)}return!1}};InjectableAPIService=class extends APIService{constructor(){super(...arguments);this.addLog=handlers2().binder("addLog")}getPlatform(){return"unknown"}getCrypto(){if("undefined"!=typeof crypto)return crypto;throw new Error("Crypto API is not available in this environment.")}};AppLifecycleService=class extends ServiceBase{constructor(context2,dependencies){super(context2);this.onLayoutReady=handlers2().bailFirstFailure("onLayoutReady");this.onFirstInitialise=handlers2().bailFirstFailure("onFirstInitialise");this.onReady=handlers2().bailFirstFailure("onReady");this.onWireUpEvents=handlers2().bailFirstFailure("onWireUpEvents");this.onInitialise=handlers2().bailFirstFailure("onInitialise");this.onLoad=handlers2().bailFirstFailure("onLoad");this.onSettingLoaded=handlers2().bailFirstFailure("onSettingLoaded");this.onLoaded=handlers2().bailFirstFailure("onLoaded");this.onScanningStartupIssues=handlers2().all("onScanningStartupIssues");this.onAppUnload=handlers2().dispatchParallel("onAppUnload");this.onBeforeUnload=handlers2().all("onBeforeUnload");this.onUnload=handlers2().all("onUnload");this.onSuspending=handlers2().bailFirstFailure("onSuspending");this.onResuming=handlers2().bailFirstFailure("onResuming");this.onResumed=handlers2().bailFirstFailure("onResumed");this._isSuspended=!1;this._isReady=!1;this.getUnresolvedMessages=handlers2().dispatchParallel("getUnresolvedMessages");this.settingService=dependencies.settingService}isSuspended(){const settings=this.settingService.currentSettings();return this._isSuspended||!(null==settings?void 0:settings.isConfigured)}setSuspended(suspend){this._isSuspended=suspend}isReady(){return this._isReady}markIsReady(){this._isReady=!0}resetIsReady(){this._isReady=!1}};AppLifecycleServiceBase=class extends AppLifecycleService{constructor(){super(...arguments);this.askRestart=handlers2().binder("askRestart");this.scheduleRestart=handlers2().binder("scheduleRestart");this.isReloadingScheduled=handlers2().binder("isReloadingScheduled")}};ConflictService=class extends ServiceBase{constructor(){super(...arguments);this.getOptionalConflictCheckMethod=handlers2().firstResult("getOptionalConflictCheckMethod");this.resolveByUserInteraction=handlers2().firstResult("resolveByUserInteraction");this.conflictProcessQueueCount=reactiveSource(0)}};InjectableConflictService=class extends ConflictService{constructor(){super(...arguments);this.queueCheckForIfOpen=handlers2().binder("queueCheckForIfOpen");this.queueCheckFor=handlers2().binder("queueCheckFor");this.ensureAllProcessed=handlers2().binder("ensureAllProcessed");this.resolveByDeletingRevision=handlers2().binder("resolveByDeletingRevision");this.resolve=handlers2().binder("resolve");this.resolveByNewest=handlers2().binder("resolveByNewest");this.resolveAllConflictedFilesByNewerOnes=handlers2().binder("resolveAllConflictedFilesByNewerOnes")}};DatabaseEventService=class extends ServiceBase{constructor(){super(...arguments);this.onUnloadDatabase=handlers2().all("onUnloadDatabase");this.onCloseDatabase=handlers2().all("onCloseDatabase");this.onDatabaseInitialisation=handlers2().bailFirstFailure("onDatabaseInitialisation");this.onDatabaseInitialised=handlers2().bailFirstFailure("onDatabaseInitialised");this.onResetDatabase=handlers2().bailFirstFailure("onResetDatabase");this.onDatabaseHasReady=handlers2().bailFirstFailure("onDatabaseHasReady");this.initialiseDatabase=handlers2().bailFirstFailure("initialiseDatabase")}};InjectableDatabaseEventService=class extends DatabaseEventService{};FileProcessingService=class extends ServiceBase{constructor(){super(...arguments);this.processFileEvent=handlers2().anySuccess("processFileEvent");this.processOptionalFileEvent=handlers2().anySuccess("processOptionalFileEvent");this.commitPendingFileEvents=handlers2().bailFirstFailure("commitPendingFileEvents");this.batched=reactiveSource(0);this.totalQueued=reactiveSource(0);this.processing=reactiveSource(0);this.totalStorageFileEventCount=0}onStorageFileEvent(){this.totalStorageFileEventCount++}};InjectableFileProcessingService=class extends FileProcessingService{};UnresolvedErrorManager=class{constructor(appLifecycleService){this._log=createInstanceLogFunction("UnresolvedErrorManager");this._occurredErrors=new Set;this.appLifecycleService=appLifecycleService;this.appLifecycleService.getUnresolvedMessages.addHandler(this._reportUnresolvedMessages.bind(this))}showError(msg,max_log_level=LEVEL_NOTICE){const level=this._occurredErrors.has(msg)?LEVEL_INFO:max_log_level;this._log(msg,level);if(!this._occurredErrors.has(msg)){this._occurredErrors.add(msg);eventHub.emitEvent(EVENT_ON_UNRESOLVED_ERROR)}}clearError(msg){if(this._occurredErrors.has(msg)){this._occurredErrors.delete(msg);eventHub.emitEvent(EVENT_ON_UNRESOLVED_ERROR)}}clearErrors(){this._occurredErrors.clear();eventHub.emitEvent(EVENT_ON_UNRESOLVED_ERROR)}countErrors(needle){return Array.from(this._occurredErrors).filter(error=>"string"==typeof error&&-1!==error.indexOf(needle)).length}_reportUnresolvedMessages(){return Promise.resolve(Array.from(this._occurredErrors))}};RemoteService=class extends ServiceBase{constructor(context2,dependencies){super(context2);this._authHeader=new AuthorizationHeaderGenerator;this.last_successful_post=!1;this._APIService=dependencies.APIService;this._appLifecycleService=dependencies.appLifecycle;this._settingService=dependencies.setting;this._log=createInstanceLogFunction("RemoteService",dependencies.APIService);this._unresolvedErrors=new UnresolvedErrorManager(this._appLifecycleService)}get hadLastPostFailedBySize(){return!this.last_successful_post}showError(msg,max_log_level=LOG_LEVEL_NOTICE){this._unresolvedErrors.showError(msg,max_log_level)}clearErrors(){this._unresolvedErrors.clearErrors()}async performFetch(req,opts,fetchMethod=0){var _a8;const fetchFunction=1===fetchMethod?this._APIService.nativeFetch.bind(this._APIService):this._APIService.webCompatFetch.bind(this._APIService);this._APIService.requestCount.value=this._APIService.requestCount.value+1;const response=await fetchFunction(req,opts),method=null!=(_a8=null==opts?void 0:opts.method)?_a8:"GET";this.last_successful_post="POST"!=method&&"PUT"!=method||response.ok;const url=new URL("string"==typeof req?req:req.url),localURL=`${url.protocol}//${url.host}${url.pathname}`;this._log(`[REQ] (${method}) ${localURL} -> ${response.status}`,LOG_LEVEL_DEBUG);if(2!==Math.floor(response.status/100))if(404==response.status)"GET"===method&&-1===url.pathname.indexOf("/_local/")&&this._log("Just checkpoint or some server information has been missing. The 404 error shown above is not an error.",LOG_LEVEL_VERBOSE);else{const r4=response.clone();this._log(`The request may have failed. The reason sent by the server: ${r4.status}: ${r4.statusText}`,LOG_LEVEL_NOTICE);try{const result=await r4.text();this._log(result,LOG_LEVEL_VERBOSE)}catch(_){this._log("Could not fetch response body",LOG_LEVEL_VERBOSE);this._log(_,LOG_LEVEL_VERBOSE)}}else this.clearErrors();return response}async connect(uri,auth,disableRequestURI,passphrase,useDynamicIterationCount,performSetup,skipInfo,compression,customHeaders,useRequestAPI,getPBKDF2Salt){if(!isValidRemoteCouchDBURI(uri))return"Remote URI is not valid";if(uri.toLowerCase()!=uri)return"Remote URI and database name could not contain capital letters.";if(-1!==uri.indexOf(" "))return"Remote URI and database name could not contain spaces.";if(!this._APIService.isOnline)return"Network is offline";const conf={adapter:"http",auth:"username"in auth?auth:void 0,skip_setup:!performSetup,fetch:async(url,opts)=>{var _a8;const authHeader=await this._authHeader.getAuthorizationHeader(auth);let size="";const localURL=url.toString().substring(uri.length),method=null!=(_a8=null==opts?void 0:opts.method)?_a8:"GET";if(null==opts?void 0:opts.body){const opts_length=opts.body.toString().length;if(opts_length>1e7&&isCloudantURI(uri)){this.last_successful_post=!1;this._log("This request should fail on IBM Cloudant.",LOG_LEVEL_VERBOSE);throw new Error("This request should fail on IBM Cloudant.")}size=` (${opts_length})`}try{const headers=new Headers(null==opts?void 0:opts.headers);if(customHeaders)for(const[key3,value]of Object.entries(customHeaders))key3&&value&&headers.append(key3,value);"username"in auth||headers.append("authorization",authHeader);try{this._APIService.requestCount.value=this._APIService.requestCount.value+1;return await this.performFetch(url,{...opts,headers},useRequestAPI?1:0)}catch(ex){if(ex instanceof TypeError){if(useRequestAPI){this._log("Failed to request by API.");throw ex}this._log("Failed to fetch by native fetch API. Trying to fetch by API to get more information.");const resp2=await this.performFetch(url,{...opts,headers},1);if(resp2.status/100==2){this.showError("The request was successful by API. But the native fetch API failed! Please check CORS settings on the remote database!. While this condition, you cannot enable LiveSync",LOG_LEVEL_NOTICE);return resp2}const r22=resp2.clone(),msg=await r22.text();this.showError(`Failed to fetch by API. ${resp2.status}: ${msg}`,LOG_LEVEL_NOTICE);return resp2}throw ex}}catch(ex){this._log(`HTTP:${method}${size} to:${localURL} -> failed`,LOG_LEVEL_VERBOSE);const msg=ex instanceof Error?`${null==ex?void 0:ex.name}:${null==ex?void 0:ex.message}`:null==ex?void 0:ex.toString();this.showError(`${MARK_LOG_NETWORK_ERROR}Network Error: Failed to fetch: ${msg}`);this._log(ex,LOG_LEVEL_VERBOSE);-1!==url.toString().indexOf("_bulk_docs")&&(this.last_successful_post=!1);this._log(ex);throw ex}finally{this._APIService.responseCount.value=this._APIService.responseCount.value+1}}},setting=this._settingService.currentSettings(),db=new index_es_default(uri,conf);replicationFilter(db,compression);disableEncryption();"false"!==passphrase&&"string"==typeof passphrase&&enableEncryption(db,passphrase,useDynamicIterationCount,!1,getPBKDF2Salt,setting.E2EEAlgorithm);if(skipInfo)return{db,info:{db_name:"",doc_count:0,update_seq:""}};try{const info3=await db.info();return{db,info:info3}}catch(ex){const msg=`${null==ex?void 0:ex.name}:${null==ex?void 0:ex.message}`;this._log(ex,LOG_LEVEL_VERBOSE);return msg}}};InjectableRemoteService=class extends RemoteService{};ReplicationService=class extends ServiceBase{constructor(context2,dependencies){super(context2);this.processSynchroniseResult=handlers2().anySuccess("processSynchroniseResult");this.processOptionalSynchroniseResult=handlers2().anySuccess("processOptionalSynchroniseResult");this.parseSynchroniseResult=handlers2().all("parseSynchroniseResult");this.processVirtualDocument=handlers2().anySuccess("processVirtualDocument");this.onBeforeReplicate=handlers2().bailFirstFailure("onBeforeReplicate");this.onCheckReplicationReady=handlers2().bailFirstFailure("onCheckReplicationReady");this.onReplicationFailed=handlers2().bailFirstFailure("onReplicationFailed");this.previousReplicated=0;this.checkConnectionFailure=handlers2().firstResult("checkConnectionFailure");this.databaseQueueCount=reactiveSource(0);this.storageApplyingCount=reactiveSource(0);this.replicationResultCount=reactiveSource(0);this.appLifecycleService=dependencies.appLifecycleService;this.settingService=dependencies.settingService;this.replicatorService=dependencies.replicatorService;this.APIService=dependencies.APIService;this.fileProcessing=dependencies.fileProcessingService;this.databaseService=dependencies.databaseService;this._log=createInstanceLogFunction("ReplicationService",dependencies.APIService);this._unresolvedErrorManager=new UnresolvedErrorManager(dependencies.appLifecycleService)}showError(msg,max_log_level=LOG_LEVEL_NOTICE){this._unresolvedErrorManager.showError(msg,max_log_level)}clearErrors(){this._unresolvedErrorManager.clearErrors()}async isReplicationReady(showMessage=!1){if(!this.appLifecycleService.isReady()){this._log("Not ready");return!1}const currentSettings=this.settingService.currentSettings();if(isLockAcquired("cleanup")){this._log($msg("Replicator.Message.Cleaned"),LOG_LEVEL_NOTICE);return!1}if(""!=currentSettings.versionUpFlash){this._log($msg("Replicator.Message.VersionUpFlash"),LOG_LEVEL_NOTICE);return!1}if(!await this.fileProcessing.commitPendingFileEvents()){this.showError($msg("Replicator.Message.Pending"),LOG_LEVEL_NOTICE);return!1}if(!this.APIService.isOnline){this.showError("Network is offline",showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);return!1}if(!await this.onBeforeReplicate(showMessage)){(await this.appLifecycleService.getUnresolvedMessages()).flat().some(e3=>"string"==typeof e3&&-1!==e3.indexOf(MARK_LOG_NETWORK_ERROR))?this._log($msg("Replicator.Message.SomeModuleFailed"),LOG_LEVEL_INFO):this.showError($msg("Replicator.Message.SomeModuleFailed"),LOG_LEVEL_NOTICE);return!1}this.clearErrors();return!0}async performReplication(showMessage){const activeReplicator=this.replicatorService.getActiveReplicator();if(!activeReplicator){this._log("No active replicator found",showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);return!1}const settings=this.settingService.currentSettings();return await activeReplicator.openReplication(settings,!1,!!showMessage,!1)||await this.onReplicationFailed(showMessage)}async replicate(showMessage){try{return!!await this.isReplicationReady(showMessage)&&await this.performReplication(showMessage)}finally{this.previousReplicated=Date.now()}}replicateByEvent(showMessage){return shareRunningResult("replication",async()=>{const least=this.settingService.currentSettings().syncMinimumInterval;if(least>0){const now3=Date.now(),elapsed=now3-this.previousReplicated;if(elapsedawait activeReplicator.markRemoteLocked(currentSettings,!0,lockByClean))}async markUnlocked(){return await this._getReplicatorAndPerform("marking remote unlocked",async(currentSettings,activeReplicator)=>await activeReplicator.markRemoteLocked(currentSettings,!1,!1))}async markResolved(){return await this._getReplicatorAndPerform("marking remote resolved",async(currentSettings,activeReplicator)=>await activeReplicator.markRemoteResolved(currentSettings))}};InjectableReplicationService=class extends ReplicationService{};ReplicatorService=class extends ServiceBase{constructor(context2,dependencies){super(context2);this.dependencies=dependencies;this._log=createInstanceLogFunction("ReplicatorService");this.onCloseActiveReplication=handlers2().anySuccess("onCloseActiveReplication");this.getNewReplicator=handlers2().firstResult("getNewReplicator");this.onReplicatorInitialised=handlers2().bailFirstFailure("onReplicatorInitialised");this.replicationStatics=reactiveSource({...DEFAULT_REPLICATION_STATICS});this.appLifecycleService=dependencies.appLifecycleService;this._unresolvedErrorManager=new UnresolvedErrorManager(dependencies.appLifecycleService);this.settingService=dependencies.settingService;this.settingService.onRealiseSetting.addHandler(this._initialiseReplicator.bind(this));this.databaseEventService=dependencies.databaseEventService;this.databaseEventService.onResetDatabase.addHandler(this.disposeReplicator.bind(this));this.databaseEventService.onDatabaseInitialisation.addHandler(this.disposeReplicator.bind(this));this.databaseEventService.onDatabaseInitialised.addHandler(this.reinitialiseReplicator.bind(this));this.databaseEventService.onDatabaseHasReady.addHandler(this.reinitialiseReplicator.bind(this));this.appLifecycleService.onSuspending.addHandler(this.suspendReplication.bind(this))}suspendReplication(){const activeReplicator=this._activeReplicator;activeReplicator&&activeReplicator.closeReplication();return Promise.resolve(!0)}async reinitialiseReplicator(){await this.disposeReplicator();await yieldMicrotask();return this._initialiseReplicator()}async disposeReplicator(){this._log("Detect database reset, closing active replicator if exists.");this._activeReplicator&&await this._activeReplicator.closeReplication();this._activeReplicator=void 0;this._replicatorType=void 0;return!0}async _initialiseReplicator(){const message=$msg("Replicator.Message.InitialiseFatalError"),setting=this.settingService.currentSettings();if(!setting){this._activeReplicator=void 0;this._replicatorType=void 0;this._unresolvedErrorManager.showError(message,LOG_LEVEL_NOTICE);return!1}const replicatorType=setting.remoteType;if(replicatorType===this._replicatorType&&this._activeReplicator){this._unresolvedErrorManager.clearError(message);this._log("Active replicator has been kept",LOG_LEVEL_VERBOSE);return!0}{this._log("Acquiring new replicator");const newReplicator=await this.getNewReplicator();if(!newReplicator){this._unresolvedErrorManager.showError(message,LOG_LEVEL_NOTICE);return!1}if(this._activeReplicator){await this._activeReplicator.closeReplication();this._log("Active replicator closed",LOG_LEVEL_VERBOSE)}this._activeReplicator=newReplicator;this._replicatorType=replicatorType;this.replicationStatics.value={...DEFAULT_REPLICATION_STATICS};await yieldMicrotask();if(!await this.onReplicatorInitialised()){this._log("Failed to initialise the replicator, onReplicatorInitialised reported some problems.");this._activeReplicator=void 0;this._replicatorType=void 0;this._unresolvedErrorManager.showError(message,LOG_LEVEL_NOTICE);return!1}const remoteTypeDisplay=replicatorType===RemoteTypes_REMOTE_COUCHDB?"CouchDB":replicatorType;this._log(`Replicator (${remoteTypeDisplay}) initialised and activated`,LOG_LEVEL_VERBOSE);this._unresolvedErrorManager.clearError(message);return!0}}getActiveReplicator(){const message="No replicator has been activated or has not been initialised yet.";if(this._activeReplicator){this._unresolvedErrorManager.clearError(message);return this._activeReplicator}this._unresolvedErrorManager.showError(message,LOG_LEVEL_NOTICE)}};InjectableReplicatorService=class extends ReplicatorService{};TestService=class extends ServiceBase{constructor(){super(...arguments);this.test=handlers2().bailFirstFailure("test");this.testMultiDevice=handlers2().bailFirstFailure("testMultiDevice")}};InjectableTestService=class extends TestService{constructor(){super(...arguments);this.addTestResult=handlers2().binder("addTestResult")}};TweakValueService=class extends ServiceBase{};InjectableTweakValueService=class extends TweakValueService{constructor(){super(...arguments);this.fetchRemotePreferred=handlers2().binder("fetchRemotePreferred");this.checkAndAskResolvingMismatched=handlers2().binder("checkAndAskResolvingMismatched");this.askResolvingMismatched=handlers2().binder("askResolvingMismatched");this.checkAndAskUseRemoteConfiguration=handlers2().binder("checkAndAskUseRemoteConfiguration");this.askUseRemoteConfiguration=handlers2().binder("askUseRemoteConfiguration")}};VaultService=class extends ServiceBase{constructor(context2,dependencies){super(context2);this.scanVault=handlers2().bailFirstFailure("scanVault");this.isIgnoredByIgnoreFile=handlers2().anySuccess("isIgnoredByIgnoreFile");this.isTargetFile=handlers2().bailFirstFailure("isTargetFile");this.isTargetFileInExtra=handlers2().anySuccess("isTargetFileInExtra");this.settingService=dependencies.settingService;this.APIService=dependencies.APIService}get settings(){return this.settingService.currentSettings()}vaultName(){return this.APIService.getSystemVaultName()}getVaultName(){return this.vaultName()+(this.settings.additionalSuffixOfDatabaseName?"-"+this.settings.additionalSuffixOfDatabaseName:"")}isFileSizeTooLarge(size){const maxSize=this.settings.syncMaxSizeInMB;return maxSize>0&&size>0&&1024*maxSize*1024constructors.some(c3=>object instanceof c3);transactionDoneMap=new WeakMap;transformCache=new WeakMap;reverseTransformCache=new WeakMap;idbProxyTraps={get(target,prop2,receiver){if(target instanceof IDBTransaction){if("done"===prop2)return transactionDoneMap.get(target);if("store"===prop2)return receiver.objectStoreNames[1]?void 0:receiver.objectStore(receiver.objectStoreNames[0])}return wrap(target[prop2])},set(target,prop2,value){target[prop2]=value;return!0},has:(target,prop2)=>target instanceof IDBTransaction&&("done"===prop2||"store"===prop2)||prop2 in target};unwrap=value=>reverseTransformCache.get(value);readMethods=["get","getKey","getAll","getAllKeys","count"];writeMethods=["put","add","delete","clear"];cachedMethods=new Map;replaceTraps(oldTraps=>({...oldTraps,get:(target,prop2,receiver)=>getMethod(target,prop2)||oldTraps.get(target,prop2,receiver),has:(target,prop2)=>!!getMethod(target,prop2)||oldTraps.has(target,prop2)}));advanceMethodProps=["continue","continuePrimaryKey","advance"];methodMap={};advanceResults=new WeakMap;ittrProxiedCursorToOriginalProxy=new WeakMap;cursorIteratorTraps={get(target,prop2){if(!advanceMethodProps.includes(prop2))return target[prop2];let cachedFunc=methodMap[prop2];cachedFunc||(cachedFunc=methodMap[prop2]=function(...args){advanceResults.set(this,ittrProxiedCursorToOriginalProxy.get(this)[prop2](...args))});return cachedFunc}};replaceTraps(oldTraps=>({...oldTraps,get:(target,prop2,receiver)=>isIteratorProp(target,prop2)?iterate:oldTraps.get(target,prop2,receiver),has:(target,prop2)=>isIteratorProp(target,prop2)||oldTraps.has(target,prop2)}));databaseCache=new Map;IDBKeyValueDatabase=class{constructor(dbKey){this._dbPromise=null;this._isDestroyed=!1;this.destroyedPromise=null;this.dbKey=dbKey;this.storeKey=dbKey}get isDestroyed(){return this._isDestroyed}get ensuredDestroyed(){return this.destroyedPromise?this.destroyedPromise:Promise.resolve()}async getIsReady(){await this.ensureDB();return!1===this.isDestroyed}ensureDB(){if(this._isDestroyed)throw new Error("Database is destroyed");if(this._dbPromise)return this._dbPromise;this._dbPromise=openDB(this.dbKey,void 0,{upgrade:(db,_oldVersion,_newVersion,_transaction,_event)=>{if(!db.objectStoreNames.contains(this.storeKey))return db.createObjectStore(this.storeKey)},blocking:(currentVersion,blockedVersion,event2)=>{Logger(`Blocking database open for ${this.dbKey}: currentVersion=${currentVersion}, blockedVersion=${blockedVersion}`,LOG_LEVEL_VERBOSE);this.closeDB(!0)},blocked:(currentVersion,blockedVersion,event2)=>{Logger(`Database open blocked for ${this.dbKey}: currentVersion=${currentVersion}, blockedVersion=${blockedVersion}`,LOG_LEVEL_VERBOSE)},terminated:()=>{Logger(`Database connection terminated for ${this.dbKey}`,LOG_LEVEL_VERBOSE);this._dbPromise=null}}).catch(e3=>{this._dbPromise=null;throw e3});return this._dbPromise}async closeDB(setDestroyed=!1){if(this._dbPromise){const tempPromise=this._dbPromise;this._dbPromise=null;try{(await tempPromise).close()}catch(e3){Logger("Error closing database");Logger(e3,LOG_LEVEL_VERBOSE)}}this._dbPromise=null;if(setDestroyed){this._isDestroyed=!0;this.destroyedPromise=Promise.resolve()}}get DB(){return this._isDestroyed?Promise.reject(new Error("Database is destroyed")):this.ensureDB()}async get(key3){const db=await this.DB;return await db.get(this.storeKey,key3)}async set(key3,value){const db=await this.DB;await db.put(this.storeKey,value,key3);return key3}async del(key3){const db=await this.DB;return await db.delete(this.storeKey,key3)}async clear(){const db=await this.DB;return await db.clear(this.storeKey)}async keys(query3,count){const db=await this.DB;return await db.getAllKeys(this.storeKey,query3,count)}async close(){await this.closeDB()}async destroy(){this._isDestroyed=!0;this.destroyedPromise=(async()=>{await this.closeDB();await deleteDB(this.dbKey,{blocked:()=>{Logger(`Database delete blocked for ${this.dbKey}`)}})})();await this.destroyedPromise}};KeyValueDBService=class extends ServiceBase{constructor(context2,dependencies){super(context2);this._log=createInstanceLogFunction("KeyValueDBService");this.databaseEvents=dependencies.databaseEvents;this.vault=dependencies.vault;this.appLifecycle=dependencies.appLifecycle;this.databaseEvents.onResetDatabase.addHandler(this._everyOnResetDatabase.bind(this));this.appLifecycle.onSettingLoaded.addHandler(this._everyOnloadAfterLoadSettings.bind(this));this.databaseEvents.onDatabaseInitialisation.addHandler(this._everyOnInitializeDatabase.bind(this));this.databaseEvents.onUnloadDatabase.addHandler(this._onOtherDatabaseUnload.bind(this));this.databaseEvents.onCloseDatabase.addHandler(this._onOtherDatabaseClose.bind(this))}get simpleStore(){if(!this._simpleStore)throw new Error("SimpleStore is not initialized yet");return this._simpleStore}get kvDB(){if(!this._kvDB)throw new Error("KeyValueDB is not initialized yet");return this._kvDB}async _everyOnResetDatabase(any){var _a8,_b5;try{const kvDBKey="queued-files";await(null==(_a8=this._kvDB)?void 0:_a8.del(kvDBKey));await(null==(_b5=this._kvDB)?void 0:_b5.destroy());await yieldMicrotask();this._kvDB=await OpenKeyValueDatabase(this.vault.getVaultName()+"-livesync-kv");await delay(100)}catch(e3){this._kvDB=void 0;this._log("Failed to reset KeyValueDB",LOG_LEVEL_NOTICE);this._log(e3,LOG_LEVEL_VERBOSE);return!1}return!0}async tryCloseKvDB(){var _a8;try{await(null==(_a8=this._kvDB)?void 0:_a8.close());return!0}catch(e3){this._log("Failed to close KeyValueDB",LOG_LEVEL_VERBOSE);this._log(e3);return!1}}async openKeyValueDB(){await delay(10);try{await this.tryCloseKvDB();await delay(10);await yieldMicrotask();this._kvDB=await OpenKeyValueDatabase(this.vault.getVaultName()+"-livesync-kv");await yieldMicrotask();await delay(100)}catch(e3){this._kvDB=void 0;this._log("Failed to open KeyValueDB",LOG_LEVEL_NOTICE);this._log(e3,LOG_LEVEL_VERBOSE);return!1}return!0}async _onOtherDatabaseUnload(){this._kvDB&&await this.tryCloseKvDB();return Promise.resolve(!0)}async _onOtherDatabaseClose(){this._kvDB&&await this.tryCloseKvDB();return Promise.resolve(!0)}_everyOnInitializeDatabase(any){return this.openKeyValueDB()}async _everyOnloadAfterLoadSettings(){if(!await this.openKeyValueDB())return!1;this._simpleStore=this.openSimpleStore("os");return Promise.resolve(!0)}openSimpleStore(kind){const getDB=()=>{if(!this._kvDB)throw new Error("KeyValueDB is not initialized yet");return this._kvDB},prefix=`${kind}-`;return{get:async key3=>await getDB().get(`${prefix}${key3}`),set:async(key3,value)=>{await getDB().set(`${prefix}${key3}`,value)},delete:async key3=>{await getDB().del(`${prefix}${key3}`)},keys:async(from,to,count)=>(await getDB().keys(IDBKeyRange.bound(`${prefix}${from||""}`,`${prefix}${to||""}`),count)).map(e3=>e3.toString()).filter(e3=>e3.startsWith(prefix)).map(e3=>e3.substring(prefix.length)),db:Promise.resolve(getDB())}}};ObsidianDatabaseEventService=class extends InjectableDatabaseEventService{};ObsidianReplicatorService=class extends InjectableReplicatorService{};ObsidianFileProcessingService=class extends InjectableFileProcessingService{};ObsidianReplicationService=class extends InjectableReplicationService{};ObsidianRemoteService=class extends InjectableRemoteService{};ObsidianConflictService=class extends InjectableConflictService{};ObsidianTweakValueService=class extends InjectableTweakValueService{};ObsidianTestService=class extends InjectableTestService{};ObsidianConfigService=class extends ConfigServiceBrowserCompat{};ObsidianKeyValueDBService=class extends KeyValueDBService{};ObsidianControlService=class extends ControlService{};SettingService=class extends ServiceBase{constructor(context2,dependencies){super(context2);this.deviceAndVaultName="";this.onBeforeRealiseSetting=handlers2().bailFirstFailure("onBeforeRealiseSetting");this.onSettingRealised=handlers2().bailFirstFailure("onSettingRealised");this.onRealiseSetting=handlers2().bailFirstFailure("onRealiseSetting");this.suspendAllSync=handlers2().all("suspendAllSync");this.suspendExtraSync=handlers2().all("suspendExtraSync");this.suggestOptionalFeatures=handlers2().all("suggestOptionalFeatures");this.enableOptionalFeature=handlers2().all("enableOptionalFeature");this.onSettingLoaded=handlers2().dispatchParallel("onSettingLoaded");this.onSettingChanged=handlers2().dispatchParallel("onSettingChanged");this.onSettingSaved=handlers2().dispatchParallel("onSettingSaved");this.usedPassphrase="";this.APIService=dependencies.APIService;this._log=createInstanceLogFunction("SettingService",this.APIService)}get settings(){return this._settings}set settings(value){this._settings=value}adjustSettings(settings){migrateLegacyRemoteConfigurationsInPlace(settings,message=>{this._log(message,LOG_LEVEL_NOTICE)})&&this._log("Legacy remote configuration has been migrated to the remote configuration list.",LOG_LEVEL_NOTICE);settings.disableRequestURI=!0;settings.gcDelay=0;settings.useHistory=!0;"workingEncrypt"in settings&&delete settings.workingEncrypt;"workingPassphrase"in settings&&delete settings.workingPassphrase;""==settings.chunkSplitterVersion?settings.enableChunkSplitterV2?settings.useSegmenter?settings.chunkSplitterVersion="v2-segmenter":settings.chunkSplitterVersion="v2":settings.chunkSplitterVersion="":settings.chunkSplitterVersion in ChunkAlgorithmNames||(settings.chunkSplitterVersion="");return Promise.resolve(settings)}getDeviceAndVaultName(){return this.deviceAndVaultName}setDeviceAndVaultName(name){this.deviceAndVaultName=name}saveDeviceAndVaultName(){const lsKey="obsidian-live-sync-vaultanddevicename-"+this.APIService.getSystemVaultName()+this.additionalSuffixOfDatabaseName();this.setItem(lsKey,this.deviceAndVaultName)}additionalSuffixOfDatabaseName(){var _a8;const suffix=null==(_a8=this.settings)?void 0:_a8.additionalSuffixOfDatabaseName;if(void 0===suffix){this._log("too early to get additionalSuffixOfDatabaseName, returning empty string");return""}return`-${suffix}`}getKey(key3){return`${this.APIService.getSystemVaultName()}${this.additionalSuffixOfDatabaseName()}-${key3}`}setSmallConfig(key3,value){const dbKey=this.getKey(key3);this.setItem(dbKey,value)}getSmallConfig(key3){const dbKey=this.getKey(key3);return this.getItem(dbKey)}deleteSmallConfig(key3){const dbKey=this.getKey(key3);this.deleteItem(dbKey)}async saveSettingData(){this.saveDeviceAndVaultName();const settings={...this.settings,remoteConfigurations:Object.fromEntries(Object.entries(this.settings.remoteConfigurations||{}).map(([id,config])=>[id,{...config}]))};settings.deviceAndVaultName="";if(settings.P2P_DevicePeerName&&""!==settings.P2P_DevicePeerName.trim()){this._log("Saving device peer name to small config");this.setSmallConfig(SETTING_KEY_P2P_DEVICE_NAME,settings.P2P_DevicePeerName.trim());settings.P2P_DevicePeerName=""}if(""!=this.usedPassphrase||await this.getPassphrase(settings)){if(""!=settings.couchDB_PASSWORD||""!=settings.couchDB_URI||""!=settings.couchDB_USER||settings.couchDB_DBNAME){const connectionSetting={couchDB_DBNAME:settings.couchDB_DBNAME,couchDB_PASSWORD:settings.couchDB_PASSWORD,couchDB_URI:settings.couchDB_URI,couchDB_USER:settings.couchDB_USER,accessKey:settings.accessKey,bucket:settings.bucket,endpoint:settings.endpoint,region:settings.region,secretKey:settings.secretKey,useCustomRequestHandler:settings.useCustomRequestHandler,bucketCustomHeaders:settings.bucketCustomHeaders,couchDB_CustomHeaders:settings.couchDB_CustomHeaders,useJWT:settings.useJWT,jwtKey:settings.jwtKey,jwtAlgorithm:settings.jwtAlgorithm,jwtKid:settings.jwtKid,jwtExpDuration:settings.jwtExpDuration,jwtSub:settings.jwtSub,useRequestAPI:settings.useRequestAPI,bucketPrefix:settings.bucketPrefix,forcePathStyle:settings.forcePathStyle};settings.encryptedCouchDBConnection=await this.encryptConfigurationItem(JSON.stringify(connectionSetting),settings);settings.couchDB_PASSWORD="";settings.couchDB_DBNAME="";settings.couchDB_URI="";settings.couchDB_USER="";settings.accessKey="";settings.bucket="";settings.region="";settings.secretKey="";settings.endpoint=""}if(settings.encrypt&&""!=settings.passphrase){settings.encryptedPassphrase=await this.encryptConfigurationItem(settings.passphrase,settings);settings.passphrase=""}await this.encryptRemoteConfigurationUris(settings)}else this._log("Failed to retrieve passphrase. data.json contains unencrypted items!",LOG_LEVEL_NOTICE);await this.saveData(settings);this.onSettingSaved(settings)}async encryptRemoteConfigurationUris(settings){const configs=settings.remoteConfigurations||{};for(const[id,config]of Object.entries(configs)){if(config.isEncrypted||""===config.uri.trim())continue;const encryptedURI=await this.encryptConfigurationItem(config.uri,settings);""!==encryptedURI?configs[id]={...config,uri:encryptedURI,isEncrypted:!0}:this._log(`Failed to encrypt remote configuration '${id}'. This entry will be saved in plain text.`,128)}}async decryptRemoteConfigurationUris(settings,passphrase){const configs=settings.remoteConfigurations||{};for(const[id,config]of Object.entries(configs)){if(!config.isEncrypted)continue;const decryptedURI=await this.decryptConfigurationItem(config.uri,passphrase);if(!1!==decryptedURI)configs[id]={...config,uri:decryptedURI,isEncrypted:!1};else{try{ConnectionStringParser.parse(config.uri);configs[id]={...config,isEncrypted:!1};this._log(`Remote configuration '${id}' had a plain-text URI marked as encrypted. The flag has been repaired.`,LOG_LEVEL_NOTICE);continue}catch(e3){}this._log(`Failed to decrypt remote configuration '${id}'. Verify passphrase and configuration.`,128)}}}currentSettings(){return this.settings}updateSettings(updateFn,saveImmediately){try{const updated=updateFn(this.settings);this.settings=updated}catch(ex){this._log("Error in update function: "+ex,128);return Promise.reject(ex)}return saveImmediately?this.saveSettingData():Promise.resolve()}async applyExternalSettings(partial,saveImmediately){try{this.settings=await this.adjustSettings({...this.settings,...partial})}catch(ex){this._log("Error in applying external settings: "+ex,128);return Promise.reject(ex)}return saveImmediately?this.saveSettingData():Promise.resolve()}applyPartial(partial,saveImmediately){try{this.settings={...this.settings,...partial}}catch(ex){this._log("Error in applying partial settings: "+ex,128);return Promise.reject(ex)}return saveImmediately?this.saveSettingData():Promise.resolve()}getPassphrase(settings){const methods={"":()=>Promise.resolve("*"),LOCALSTORAGE:()=>{var _a8;return Promise.resolve(null!=(_a8=this.getItem("ls-setting-passphrase"))&&_a8)},ASK_AT_LAUNCH:()=>this.APIService.confirm.askString("Passphrase","passphrase","")},method=settings.configPassphraseStore;return(method in methods?methods[method]:methods[""])()}clearUsedPassphrase(){this.usedPassphrase=""}async decryptConfigurationItem(encrypted,passphrase){try{const dec=await decryptString(encrypted,passphrase+"rHGMPtr6oWw7VSa3W3wpa8fT8U");if(dec){this.usedPassphrase=passphrase;return dec}}catch(ex){this._log(`Failed to decrypt configuration item: ${ex}`,LOG_LEVEL_NOTICE)}return!1}async encryptConfigurationItem(src,settings){if(""!=this.usedPassphrase)return await encryptString(src,this.usedPassphrase+"rHGMPtr6oWw7VSa3W3wpa8fT8U");const passphrase=await this.getPassphrase(settings);if(!1===passphrase){this._log("Failed to obtain passphrase when saving data.json! Please verify the configuration.",128);return""}const dec=await encryptString(src,passphrase+"rHGMPtr6oWw7VSa3W3wpa8fT8U");if(dec){this.usedPassphrase=passphrase;return dec}return""}async decryptSettings(settings){const passphrase=await this.getPassphrase(settings);if(!1===passphrase){this._log("No passphrase found for data.json! Verify configuration before syncing.",128);Object.values(settings.remoteConfigurations||{}).some(config=>config.isEncrypted)&&this._log("Encrypted remote configurations found, but passphrase is unavailable. Verify configuration before syncing.",128)}else{if(settings.encryptedCouchDBConnection){const keys3=["couchDB_URI","couchDB_USER","couchDB_PASSWORD","couchDB_DBNAME","accessKey","bucket","endpoint","region","secretKey"],decrypted=this.tryDecodeJson(await this.decryptConfigurationItem(settings.encryptedCouchDBConnection,passphrase));if(decrypted)for(const key3 of keys3)key3 in decrypted&&(settings[key3]=decrypted[key3]);else{this._log("Failed to decrypt passphrase from data.json! Ensure configuration is correct before syncing with remote.",128);for(const key3 of keys3)settings[key3]=""}}if(settings.encrypt&&settings.encryptedPassphrase){const encrypted=settings.encryptedPassphrase,decrypted=await this.decryptConfigurationItem(encrypted,passphrase);if(decrypted)settings.passphrase=decrypted;else{this._log("Failed to decrypt passphrase from data.json! Ensure configuration is correct before syncing with remote.",128);settings.passphrase=""}}await this.decryptRemoteConfigurationUris(settings,passphrase)}return settings}async loadSettings(){var _a8,_b5;const settings=Object.assign({},DEFAULT_SETTINGS,await this.loadData()),hadRemoteConfigurations=Object.keys(null!=(_a8=settings.remoteConfigurations)?_a8:{}).length>0;if(void 0===settings.isConfigured)if(JSON.stringify(settings)!==JSON.stringify(DEFAULT_SETTINGS))settings.isConfigured=!0;else{const appId=this.APIService.getAppID();settings.additionalSuffixOfDatabaseName=appId;settings.isConfigured=!1}this.settings=await this.decryptSettings(settings);setLang(this.settings.displayLanguage);await this.adjustSettings(this.settings);const shouldPersistMigratedRemoteConfigurations=!hadRemoteConfigurations&&Object.keys(null!=(_b5=this.settings.remoteConfigurations)?_b5:{}).length>0,lsKey="obsidian-live-sync-vaultanddevicename-"+this.APIService.getSystemVaultName()+this.additionalSuffixOfDatabaseName();if(""!=this.settings.deviceAndVaultName&&!this.getItem(lsKey)){this.setDeviceAndVaultName(this.settings.deviceAndVaultName);this.saveDeviceAndVaultName();this.settings.deviceAndVaultName=""}if(isCloudantURI(this.settings.couchDB_URI)&&0!=this.settings.customChunkSize){this._log("Configuration issues detected and automatically resolved. However, unsynchronized data may exist. Consider rebuilding if necessary.",LOG_LEVEL_NOTICE);this.settings.customChunkSize=0}this.setDeviceAndVaultName(this.getItem(lsKey)||"");if(""==this.getDeviceAndVaultName()&&this.settings.usePluginSync){this._log("Device name missing. Disabling plug-in sync.",LOG_LEVEL_NOTICE);this.settings.usePluginSync=!1}shouldPersistMigratedRemoteConfigurations&&await this.saveSettingData();const dispatch=this.settings;this.onSettingLoaded(dispatch);this.onSettingChanged(dispatch)}tryDecodeJson(encoded){try{return!!encoded&&JSON.parse(encoded)}catch(e3){return!1}}};ObsidianSettingService=class extends SettingService{constructor(context2,dependencies){super(context2,dependencies);this.onSettingSaved.addHandler(settings=>{eventHub.emitEvent(EVENT_SETTING_SAVED,settings);return Promise.resolve(!0)});this.onSettingLoaded.addHandler(settings=>{eventHub.emitEvent("reload-setting-tab");return Promise.resolve(!0)})}setItem(key3,value){return localStorage.setItem(key3,value)}getItem(key3){var _a8;return null!=(_a8=localStorage.getItem(key3))?_a8:""}deleteItem(key3){localStorage.removeItem(key3)}async saveData(data){return await this.context.liveSyncPlugin.saveData(data)}async loadData(){return await this.context.liveSyncPlugin.loadData()}};DatabaseService=class extends ServiceBase{constructor(context2,dependencies){super(context2);this._log=createInstanceLogFunction("InjectableDatabaseService");this._localDatabase=null;this.onOpenDatabase=handlers2().bailFirstFailure("onOpenDatabase");this.onDatabaseReset=handlers2().bailFirstFailure("onDatabaseReset");this.services=dependencies}get localDatabase(){if(!this._localDatabase)throw new Error("Local database is not ready yet.");return this._localDatabase}get localDatabaseDirect(){return this._localDatabase}modifyDatabaseOptions(settings,name,options){const optionPass={...options};if(settings.useIndexedDBAdapter){optionPass.adapter="indexeddb";optionPass.purged_infos_limit=1;return{name:name+ExtraSuffixIndexedDB,options:optionPass}}return{name,options:optionPass}}createPouchDBInstance(name,options){const settings=this.services.setting.currentSettings(),optionPass=this.modifyDatabaseOptions(settings,null!=name?name:"",null!=options?options:{});return new index_es_default(optionPass.name,optionPass.options)}async openDatabase(params){null!=this._localDatabase&&await this._localDatabase.close();const vaultName=this.services.vault.getVaultName();this._log($msg("moduleLocalDatabase.logWaitingForReady"));const env={services:{...this.services,...params,database:this}};this._localDatabase=new LiveSyncLocalDB(vaultName,env);await this.onOpenDatabase(vaultName);return await this.localDatabase.initializeDatabase()}isDatabaseReady(){return null!=this._localDatabase&&this._localDatabase.isReady}async resetDatabase(){return this._localDatabase?await this._localDatabase.resetDatabase():Promise.resolve(!0)}};ObsidianDatabaseService=class extends DatabaseService{__onOpenDatabase(vaultName){initializeStores(vaultName);return Promise.resolve(!0)}constructor(context2,dependencies){super(context2,dependencies);this.onOpenDatabase.addHandler(this.__onOpenDatabase.bind(this))}};ObsHttpHandler=class extends FetchHttpHandler{constructor(options,reverseProxyNoSignUrl){super(options);this.requestTimeoutInMs=void 0===options?void 0:options.requestTimeout;this.reverseProxyNoSignUrl=reverseProxyNoSignUrl}async handle(request2,{abortSignal}={}){if(null==abortSignal?void 0:abortSignal.aborted){const abortError=new Error("Request aborted");abortError.name="AbortError";return Promise.reject(abortError)}let path2=request2.path;if(request2.query){const queryString=buildQueryString(request2.query);queryString&&(path2+=`?${queryString}`)}const{port,method}=request2;let url=`${request2.protocol}//${request2.hostname}${port?`:${port}`:""}${path2}`;if(void 0!==this.reverseProxyNoSignUrl&&""!==this.reverseProxyNoSignUrl){const urlObj=new URL(url);urlObj.host=this.reverseProxyNoSignUrl;url=urlObj.href}const body="GET"===method||"HEAD"===method?void 0:request2.body,transformedHeaders={};for(const key3 of Object.keys(request2.headers)){const keyLower=key3.toLowerCase();"host"!==keyLower&&"content-length"!==keyLower&&(transformedHeaders[keyLower]=request2.headers[key3])}let contentType;void 0!==transformedHeaders["content-type"]&&(contentType=transformedHeaders["content-type"]);let transformedBody=body;ArrayBuffer.isView(body)&&(transformedBody=new Uint8Array(body.buffer).buffer);const param={body:transformedBody,headers:transformedHeaders,method,url,contentType},raceOfPromises=[(0,import_obsidian.requestUrl)(param).then(rsp=>{const headers=rsp.headers,headersLower={};for(const key3 of Object.keys(headers))headersLower[key3.toLowerCase()]=headers[key3];const stream=new ReadableStream({start(controller){controller.enqueue(new Uint8Array(rsp.arrayBuffer));controller.close()}});return{response:new HttpResponse({headers:headersLower,statusCode:rsp.status,body:stream})}}),requestTimeout(this.requestTimeoutInMs)];abortSignal&&raceOfPromises.push(new Promise((resolve,reject)=>{abortSignal.onabort=()=>{const abortError=new Error("Request aborted");abortError.name="AbortError";reject(abortError)}}));return Promise.race(raceOfPromises)}};ObsidianConfirm=class{get _app(){return this._context.app}get _plugin(){return this._context.plugin}constructor(context2){this._context=context2}askYesNo(message){return askYesNo(this._app,message)}askString(title,key3,placeholder,isPassword=!1){return askString(this._app,title,key3,placeholder,isPassword)}async askYesNoDialog(message,opt={title:"Confirmation"}){const defaultTitle=$msg("moduleInputUIObsidian.defaultTitleConfirmation"),yesLabel=$msg("moduleInputUIObsidian.optionYes"),noLabel=$msg("moduleInputUIObsidian.optionNo"),defaultOption="Yes"===opt.defaultOption?yesLabel:noLabel;return await confirmWithMessageWithWideButton(this._plugin,opt.title||defaultTitle,message,[yesLabel,noLabel],defaultOption,opt.timeout)===yesLabel?"yes":"no"}askSelectString(message,items){return askSelectString(this._app,message,items)}askSelectStringDialogue(message,buttons,opt){const defaultTitle=$msg("moduleInputUIObsidian.defaultTitleSelect");return confirmWithMessageWithWideButton(this._plugin,opt.title||defaultTitle,message,buttons,opt.defaultAction,opt.timeout)}askInPopup(key3,dialogText,anchorCallback){const fragment=createFragment(doc=>{const[beforeText,afterText]=dialogText.split("{HERE}",2);doc.createEl("span",void 0,a2=>{a2.appendText(beforeText);a2.appendChild(a2.createEl("a",void 0,anchor=>{anchorCallback(anchor)}));a2.appendText(afterText)})}),popupKey="popup-"+key3;scheduleTask(popupKey,1e3,async()=>{var _a8;const popup=await memoIfNotExist(popupKey,()=>new import_obsidian.Notice(fragment,0));(null==(_a8=null==popup?void 0:popup.noticeEl)?void 0:_a8.isShown())||memoObject(popupKey,new import_obsidian.Notice(fragment,0));scheduleTask(popupKey+"-close",2e4,()=>{var _a9;const popup2=retrieveMemoObject(popupKey);if(popup2){(null==(_a9=null==popup2?void 0:popup2.noticeEl)?void 0:_a9.isShown())&&popup2.hide();disposeMemoObject(popupKey)}})})}confirmWithMessage(title,contentMd,buttons,defaultAction,timeout){return confirmWithMessage(this._plugin,title,contentMd,buttons,defaultAction,timeout)}};import_obsidian3=require("obsidian");ObsidianAPIService=class extends InjectableAPIService{constructor(context2){super(context2);this._confirmInstance=new ObsidianConfirm(context2)}getCustomFetchHandler(){this._customHandler||(this._customHandler=new ObsHttpHandler(void 0,void 0));return this._customHandler}async showWindow(viewType){const leaves=this.app.workspace.getLeavesOfType(viewType);0==leaves.length?await this.app.workspace.getLeaf(!0).setViewState({type:viewType,active:!0}):await leaves[0].setViewState({type:viewType,active:!0});leaves.length>0&&await this.app.workspace.revealLeaf(leaves[0])}get app(){return this.context.app}getPlatform(){return import_obsidian3.Platform.isAndroidApp?"android-app":import_obsidian3.Platform.isIosApp?"ios":import_obsidian3.Platform.isMacOS?"macos":import_obsidian3.Platform.isMobileApp?"mobile-app":import_obsidian3.Platform.isMobile?"mobile":import_obsidian3.Platform.isSafari?"safari":import_obsidian3.Platform.isDesktop?"desktop":import_obsidian3.Platform.isDesktopApp?"desktop-app":"unknown-obsidian"}isMobile(){return this.app.isMobile}getAppID(){return`${"appId"in this.app?this.app.appId:""}`}getSystemVaultName(){return this.app.vault.getName()}getAppVersion(){var _a8,_b5;const match3=(null!=(_b5=null==(_a8=globalThis.navigator)?void 0:_a8.userAgent)?_b5:"").match(/obsidian\/([0-9]+\.[0-9]+\.[0-9]+)/);return match3&&match3.length>=2?match3[1]:"0.0.0"}getPluginVersion(){return this.context.plugin.manifest.version}get confirm(){return this._confirmInstance}addCommand(command){return this.context.plugin.addCommand(command)}registerWindow(type,factory){return this.context.plugin.registerView(type,factory)}addRibbonIcon(icon,title,callback){return this.context.plugin.addRibbonIcon(icon,title,callback)}registerProtocolHandler(action2,handler){return this.context.plugin.registerObsidianProtocolHandler(action2,handler)}async nativeFetch(req,opts){var _a8,_b5;const url="string"==typeof req?req:req.url;let body;const method="string"==typeof(null==opts?void 0:opts.method)?opts.method:req instanceof Request&&"string"==typeof req.method?req.method:"GET";"string"!=typeof req?(null==opts?void 0:opts.body)?body="string"==typeof opts.body?opts.body:await new Response(opts.body).arrayBuffer():req.body&&(body=await new Response(req.body).arrayBuffer()):body=null==opts?void 0:opts.body;const reqHeaders=new Headers(req instanceof Request?req.headers:{}),optHeaders={};reqHeaders.forEach((value,key3)=>{optHeaders[key3]=value});if(opts&&"headers"in opts)if(opts.headers instanceof Headers)opts.headers.forEach((value,key3)=>{optHeaders[key3]=value});else for(const[key3,value]of Object.entries(opts.headers))optHeaders[key3]=value;const transformedHeaders={...optHeaders};delete transformedHeaders.host;delete transformedHeaders.Host;delete transformedHeaders["content-length"];delete transformedHeaders["Content-Length"];const requestParam={url,method,body,headers:transformedHeaders,contentType:null!=(_b5=null!=(_a8=transformedHeaders["content-type"])?_a8:transformedHeaders["Content-Type"])?_b5:"application/json"},r4=await(0,import_obsidian.requestUrl)({...requestParam,throw:!1});return new Response(r4.arrayBuffer,{headers:r4.headers,status:r4.status,statusText:`${r4.status}`})}addStatusBarItem(){return this.context.plugin.addStatusBarItem()}setInterval(handler,timeout){const timerId=globalThis.setInterval(handler,timeout);this.context.plugin.registerInterval(timerId);return timerId}getSystemConfigDir(){return this.app.vault.configDir}};ObsidianAppLifecycleService=class extends AppLifecycleServiceBase{performRestart(){this.context.plugin.app.commands.executeCommandById("app:reload")}};ObsidianPathService=class extends PathService{markChangesAreSame(old,newMtime,oldMtime){return markChangesAreSame(old,newMtime,oldMtime)}unmarkChanges(file){return unmarkChanges(file)}compareFileFreshness(baseFile,checkTarget){return compareFileFreshness(baseFile,checkTarget)}isMarkedAsSameChanges(file,mtimes){return isMarkedAsSameChanges(file,mtimes)}normalizePath(path2){return normalizePath(path2)}};ObsidianVaultService=class extends InjectableVaultService{vaultName(){return this.context.app.vault.getName()}getActiveFilePath(){const file=this.context.app.workspace.getActiveFile();if(file)return getPathFromTFile(file)}isStorageInsensitive(){var _a8;return null==(_a8=this.context.app.vault.adapter.insensitive)||_a8}shouldCheckCaseInsensitively(){return!this.isStorageInsensitive()&&super.shouldCheckCaseInsensitively()}isValidPath(path2){return isValidPath(path2)}};UIService=class extends ServiceBase{constructor(context2,dependents){super(context2);this._dialogManager=dependents.dialogManager;this._APIService=dependents.APIService}get dialogManager(){return this._dialogManager}async promptCopyToClipboard(title,value){const param={title,dataToCopy:value};return"ok"===await this._dialogManager.open(this.dialogToCopy,param)}showMarkdownDialog(title,contentMD,buttons,defaultAction){return this._APIService.confirm.askSelectStringDialogue(contentMD,buttons,{title,defaultAction:null!=defaultAction?defaultAction:buttons[0],timeout:0})}get confirm(){return this._APIService.confirm}};root34=from_html('
    ');$$css14={hash:"svelte-3n2ufb",code:'.dialog-host.svelte-3n2ufb {padding:20px;gap:0.5em;display:flex;flex-direction:column;padding-bottom:var(--keyboard-height, 0px);}.dialog-host.svelte-3n2ufb button {margin-left:10px;}.dialog-host.svelte-3n2ufb .button-group {display:flex;flex-direction:column;gap:10px;margin-top:20px;}.dialog-host.svelte-3n2ufb .row {display:flex;flex-direction:row;justify-items:center;align-items:center;flex-wrap:wrap;}.dialog-host.svelte-3n2ufb .row > input[type="text"],\n .dialog-host.svelte-3n2ufb .row > input[type="password"],\n .dialog-host.svelte-3n2ufb .row > textarea,\n .dialog-host.svelte-3n2ufb .row > select {flex:1;margin-left:10px;min-width:10em;}.dialog-host.svelte-3n2ufb .row > input[type="password"] {-webkit-text-security:disc;}.dialog-host.svelte-3n2ufb .row > input[type="checkbox"] {margin-left:10px;margin-right:10px;}.dialog-host.svelte-3n2ufb label > span {display:block;width:8em;}.dialog-host.svelte-3n2ufb .note,\n .dialog-host.svelte-3n2ufb .note-important,\n .dialog-host.svelte-3n2ufb .note-error {padding:10px;margin-top:4px;margin-bottom:0.5lh;border-left:4px solid;}.dialog-host.svelte-3n2ufb .note {background-color:var(--interactive-hover);border-left-color:var(--interactive-accent);}.dialog-host.svelte-3n2ufb .note-important {background-color:var(--interactive-hover);border-left-color:var(--text-warning);}.dialog-host.svelte-3n2ufb .note-error {background-color:var(--interactive-hover);border-left-color:var(--text-error);}.dialog-host.svelte-3n2ufb hr {margin:0.7lh 0;}.dialog-host.svelte-3n2ufb details {gap:0.5em;padding-left:0.5em;border-left:2px solid var(--interactive-accent);}.dialog-host.svelte-3n2ufb summary::marker {display:none;content:"";}.dialog-host.svelte-3n2ufb summary {border-left:4px solid var(--interactive-accent);padding-left:0.5em;cursor:pointer;outline:none;}.dialog-host.svelte-3n2ufb details > summary::after {content:"⏷";float:right;margin-right:0.5em;}.dialog-host.svelte-3n2ufb details[open] > summary::after {content:"⏶";float:right;margin-right:0.5em;}.dialog-host.svelte-3n2ufb input:invalid,\n .dialog-host.svelte-3n2ufb textarea:invalid {border-color:var(--background-modifier-error);}.dialog-host.svelte-3n2ufb .sub-section {margin-left:1em;display:flex;flex-direction:column;gap:0.5em;}.dialog-host.svelte-3n2ufb .row > input[type="text"]:disabled,\n .dialog-host.svelte-3n2ufb .row > input[type="password"]:disabled,\n .dialog-host.svelte-3n2ufb .row > textarea:disabled,\n .dialog-host.svelte-3n2ufb .row > select:disabled {background-color:var(--background-secondary);}'};SvelteDialogBase=function SvelteDialogMixIn(TBase,d4){return class SvelteDialog extends TBase{constructor(...args){super(...args);this.title="Self-hosted LiveSync - Setup Wizard"}get context(){return this._context}initDialog(context2,dependents,component2,initialData){this._context=context2;this.dependents=dependents;this.component=component2;this.initialData=initialData}resolveResult(){var _a8;null==(_a8=this.resultPromiseWithResolvers)||_a8.resolve(this.result);this.resultPromiseWithResolvers=void 0}onOpen(){const{contentEl}=this;contentEl.empty();const dialog=this;this.resultPromiseWithResolvers&&this.resultPromiseWithResolvers.reject("Dialog opened again");const pr=promiseWithResolvers();eventHub.once("plugin-unloaded",()=>{if(this.resultPromiseWithResolvers===pr){pr.reject("Plugin unloaded");this.close()}});this.resultPromiseWithResolvers=pr;this.mountedComponent=mount(d4,{target:contentEl,props:{onSetupContext:props=>{setupDialogContext({...props,context:this.context,services:this.dependents})},setTitle:title=>{dialog.setTitle(title)},closeDialog:()=>{dialog.close()},setResult:result=>{this.result=result},getInitialData:()=>this.initialData,mountComponent:this.component}})}waitForClose(){if(!this.resultPromiseWithResolvers)throw new Error("Dialog not opened yet");return this.resultPromiseWithResolvers.promise}onClose(){this.resolveResult();fireAndForget(async()=>{this.mountedComponent&&await unmount(this.mountedComponent)})}}}(import_obsidian.Modal,function DialogHost($$anchor,$$props){var div;push($$props,!0);append_styles($$anchor,$$css14);const contextProps={setTitle:$$props.setTitle,closeDialog:$$props.closeDialog,setResult:$$props.setResult,getInitialData:$$props.getInitialData};null===$$props.onSetupContext||void 0===$$props.onSetupContext||$$props.onSetupContext(contextProps);let thisElement;(0,$$props.mountComponent)(child(div=root34()),{setResult:result=>{$$props.setResult(result);$$props.closeDialog()},get getInitialData(){return $$props.getInitialData}});reset(div);bind_this(div,$$value=>thisElement=$$value,()=>thisElement);append($$anchor,div);pop()});SvelteDialogObsidian=class extends SvelteDialogBase{constructor(context2,dependents,component2,initialData){super(context2.app);this.initDialog(context2,dependents,component2,initialData)}};ObsidianSvelteDialogManager=class extends SvelteDialogManagerBase{async openSvelteDialog(component2,initialData){const dialog=new SvelteDialogObsidian(this.context,this.dependents,component2,initialData);dialog.open();return await dialog.waitForClose()}};on_click4=(_,copyToClipboard)=>copyToClipboard();root_218=from_html(' ',1);root35=from_html(" ",1);$$css15={hash:"svelte-u2ix67",code:"textarea.svelte-u2ix67 {resize:none;}"};delegate(["click"]);ObsidianUIService=class extends UIService{get dialogToCopy(){return DialogueToCopy}constructor(context2,dependents){const obsidianConfirm=dependents.APIService.confirm,obsidianSvelteDialogManager=new ObsidianSvelteDialogManager(context2,{appLifecycle:dependents.appLifecycle,config:dependents.config,replicator:dependents.replicator,confirm:obsidianConfirm,control:dependents.control});super(context2,{appLifecycle:dependents.appLifecycle,dialogManager:obsidianSvelteDialogManager,APIService:dependents.APIService})}};ObsidianServiceHub=class extends InjectableServiceHub{constructor(plugin3){const context2=new ObsidianServiceContext(plugin3.app,plugin3,plugin3),API=new ObsidianAPIService(context2),conflict=new ObsidianConflictService(context2),fileProcessing=new ObsidianFileProcessingService(context2),tweakValue=new ObsidianTweakValueService(context2),setting=new ObsidianSettingService(context2,{APIService:API}),appLifecycle=new ObsidianAppLifecycleService(context2,{settingService:setting}),remote=new ObsidianRemoteService(context2,{APIService:API,appLifecycle,setting}),vault=new ObsidianVaultService(context2,{settingService:setting,APIService:API}),test=new ObsidianTestService(context2),databaseEvents=new ObsidianDatabaseEventService(context2),path2=new ObsidianPathService(context2,{settingService:setting}),database=new ObsidianDatabaseService(context2,{path:path2,vault,setting,API}),keyValueDB=new ObsidianKeyValueDBService(context2,{appLifecycle,databaseEvents,vault}),config=new ObsidianConfigService(context2,{settingService:setting,APIService:API}),replicator=new ObsidianReplicatorService(context2,{settingService:setting,appLifecycleService:appLifecycle,databaseEventService:databaseEvents}),replication2=new ObsidianReplicationService(context2,{APIService:API,appLifecycleService:appLifecycle,replicatorService:replicator,settingService:setting,fileProcessingService:fileProcessing,databaseService:database}),control=new ObsidianControlService(context2,{appLifecycleService:appLifecycle,databaseService:database,fileProcessingService:fileProcessing,settingService:setting,APIService:API,replicatorService:replicator});super(context2,{appLifecycle,conflict,database,databaseEvents,fileProcessing,replication:replication2,replicator,remote,setting,tweakValue,vault,test,ui:new ObsidianUIService(context2,{appLifecycle,config,replicator,APIService:API,control}),path:path2,API,config,keyValueDB,control})}};ServiceModuleBase=class{get name(){return this.constructor.name}constructor(services){this._log=createInstanceLogFunction(this.name,services.API)}};ServiceRebuilder=class extends ServiceModuleBase{constructor(services){super(services);this.appLifecycle=services.appLifecycle;this.API=services.API;this.UI=services.UI;this.setting=services.setting;this.remote=services.remote;this.databaseEvents=services.databaseEvents;this.storageAccess=services.storageAccess;this.replicator=services.replicator;this.vault=services.vault;this.replication=services.replication;this.database=services.database;this.fileHandler=services.fileHandler;this.control=services.control;services.database.onDatabaseReset.addHandler(this._onResetLocalDatabase.bind(this));services.setting.suspendAllSync.addHandler(this._allSuspendAllSync.bind(this))}async $performRebuildDB(method){"localOnly"==method&&await this.$fetchLocal();"localOnlyWithChunks"==method&&await this.$fetchLocal(!0);"remoteOnly"==method&&await this.$rebuildRemote();"rebuildBothByThisDevice"==method&&await this.$rebuildEverything()}async informOptionalFeatures(){await this.UI.showMarkdownDialog("All optional features are disabled","Customisation Sync and Hidden File Sync will all be disabled.\nPlease enable them from the settings screen after setup is complete.",["OK"])}async askUsingOptionalFeature(opt){"yes"==await this.UI.confirm.askYesNoDialog("Do you want to enable extra features? If you are new to Self-hosted LiveSync, try the core feature first!",{title:"Enable extra features",defaultOption:"No",timeout:15})&&await this.setting.suggestOptionalFeatures(opt)}async rebuildRemote(){await this.setting.suspendExtraSync();await this.setting.applyPartial({isConfigured:!0,notifyThresholdOfRemoteStorageSize:DEFAULT_SETTINGS.notifyThresholdOfRemoteStorageSize});await this.control.applySettings();await this.replication.markLocked();await this._tryResetRemoteDatabase();await this.replication.markLocked();await delay(500);await delay(1e3);await this.replication.replicateAllToRemote(!0);await delay(1e3);await this.replication.replicateAllToRemote(!0,!0);await this.informOptionalFeatures()}$rebuildRemote(){return this.rebuildRemote()}async rebuildEverything(){await this.setting.suspendExtraSync();await this.setting.applyPartial({isConfigured:!0,notifyThresholdOfRemoteStorageSize:DEFAULT_SETTINGS.notifyThresholdOfRemoteStorageSize});await this.control.applySettings();await this.resetLocalDatabase();await delay(1e3);await this.databaseEvents.initialiseDatabase(!0,!0,!0);await this.replication.markLocked();await this._tryResetRemoteDatabase();await this.replication.markLocked();await delay(500);await delay(1e3);await this.replication.replicateAllToRemote(!0);await delay(1e3);await this.replication.replicateAllToRemote(!0,!0);await this.informOptionalFeatures()}$rebuildEverything(){return this.rebuildEverything()}$fetchLocal(makeLocalChunkBeforeSync,preventMakeLocalFilesBeforeSync){return this.fetchLocal(makeLocalChunkBeforeSync,preventMakeLocalFilesBeforeSync)}async scheduleRebuild(){try{await this.storageAccess.writeFileAuto(FlagFilesHumanReadable_REBUILD_ALL,"")}catch(ex){this._log(`Could not create ${FlagFilesHumanReadable_REBUILD_ALL}`,LOG_LEVEL_NOTICE);this._log(ex,LOG_LEVEL_VERBOSE)}this.appLifecycle.performRestart()}async scheduleFetch(){try{await this.storageAccess.writeFileAuto(FlagFilesHumanReadable_FETCH_ALL,"")}catch(ex){this._log(`Could not create ${FlagFilesHumanReadable_FETCH_ALL}`,LOG_LEVEL_NOTICE);this._log(ex,LOG_LEVEL_VERBOSE)}this.appLifecycle.performRestart()}async _tryResetRemoteDatabase(){const currentReplicator=this.replicator.getActiveReplicator(),settings=this.setting.currentSettings();currentReplicator?await currentReplicator.tryResetRemoteDatabase(settings):this._log("No active replicator found when trying to reset remote database.",LOG_LEVEL_NOTICE)}_onResetLocalDatabase(){this.storageAccess.clearTouched();return Promise.resolve(!0)}async suspendAllSync(){await this.setting.applyPartial({liveSync:!1,periodicReplication:!1,syncOnSave:!1,syncOnEditorSave:!1,syncOnStart:!1,syncOnFileOpen:!1,syncAfterMerge:!1});await this.setting.suspendExtraSync()}async suspendReflectingDatabase(){const settings=this.setting.currentSettings();if(!settings.doNotSuspendOnFetching&&settings.remoteType!=REMOTE_MINIO){this._log("Suspending reflection: Database and storage changes will not be reflected in each other until completely finished the fetching.",LOG_LEVEL_NOTICE);await this.setting.applyPartial({suspendParseReplicationResult:!0,suspendFileWatching:!0});await this.setting.saveSettingData()}}async resumeReflectingDatabase(){const settings=this.setting.currentSettings();if(!settings.doNotSuspendOnFetching&&settings.remoteType!=REMOTE_MINIO){this._log("Database and storage reflection has been resumed!",LOG_LEVEL_NOTICE);await this.setting.applyPartial({suspendParseReplicationResult:!1,suspendFileWatching:!1});await this.vault.scanVault(!0);await this.replication.onBeforeReplicate(!1);await this.setting.saveSettingData()}}async fetchLocal(makeLocalChunkBeforeSync,preventMakeLocalFilesBeforeSync){await this.setting.suspendExtraSync();await this.setting.applyPartial({isConfigured:!0,notifyThresholdOfRemoteStorageSize:DEFAULT_SETTINGS.notifyThresholdOfRemoteStorageSize});const settings=this.setting.currentSettings();if(settings.maxMTimeForReflectEvents>0){const ask=`Your settings restrict file reflection times to no later than ${new Date(settings.maxMTimeForReflectEvents)}.\n\n**This is a recovery configuration.**\n\nThis operation should only be performed on an empty vault.\nAre you sure you wish to proceed?`,CANCEL="Cancel operation",CLEARANDPROCEED="Clear restriction and proceed",choices=["I understand, proceed",CLEARANDPROCEED,CANCEL],ret=await this.UI.confirm.askSelectStringDialogue(ask,choices,{title:"Confirm restricted fetch",defaultAction:CANCEL,timeout:0});if(ret==CLEARANDPROCEED){await this.setting.applyPartial({maxMTimeForReflectEvents:0});await this.setting.saveSettingData()}if(ret==CANCEL)return}await this.suspendReflectingDatabase();await this.control.applySettings();await this.resetLocalDatabase();await delay(1e3);await this.database.openDatabase({databaseEvents:this.databaseEvents,replicator:this.replicator});this.appLifecycle.markIsReady();makeLocalChunkBeforeSync?await this.fileHandler.createAllChunks(!0):preventMakeLocalFilesBeforeSync||await this.databaseEvents.initialiseDatabase(!0,!0,!0);await this.replication.markResolved();await delay(500);await this.replication.replicateAllFromRemote(!0);await delay(1e3);await this.replication.replicateAllFromRemote(!0);await this.resumeReflectingDatabase();await this.informOptionalFeatures()}async fetchLocalWithRebuild(){return await this.fetchLocal(!0)}async _allSuspendAllSync(){await this.suspendAllSync();return!0}async resetLocalDatabase(){const settings=this.setting.currentSettings();settings.isConfigured&&""==settings.additionalSuffixOfDatabaseName&&await this.database.resetDatabase();const suffix=this.API.getAppID()||"";await this.setting.applyPartial({additionalSuffixOfDatabaseName:suffix});await this.database.resetDatabase();eventHub.emitEvent(EVENT_DATABASE_REBUILT)}};ServiceDatabaseFileAccessBase=class extends ServiceModuleBase{constructor(services){super(services);this.vault=services.vault;this.storageAccess=services.storageAccess;this.database=services.database;this.path=services.path}async checkIsTargetFile(file){const path2=getStoragePathFromUXFileInfo(file);if(!await this.vault.isTargetFile(path2)){this._log(`File is not target: ${path2}`,LOG_LEVEL_VERBOSE);return!1}if(shouldBeIgnored(path2)){this._log(`File should be ignored: ${path2}`,LOG_LEVEL_VERBOSE);return!1}return!0}async delete(file,rev3){if(!await this.checkIsTargetFile(file))return!0;const fullPath=getDatabasePathFromUXFileInfo(file);try{this._log(`deleteDB By path:${fullPath}`);return await this.deleteFromDBbyPath(fullPath,rev3)}catch(ex){this._log(`Failed to delete ${fullPath}`);this._log(ex,LOG_LEVEL_VERBOSE);return!1}}async createChunks(file,force=!1,skipCheck){return await this.__store(file,force,skipCheck,!0)}async store(file,force=!1,skipCheck){return await this.__store(file,force,skipCheck,!1)}async storeContent(path2,content){const blob=createTextBlob(content),bytes=(await blob.arrayBuffer()).byteLength,isInternal=!!path2.startsWith(".")||void 0,dummyUXFileInfo={name:path2.split("/").pop(),path:path2,stat:{size:bytes,ctime:Date.now(),mtime:Date.now(),type:"file"},body:blob,isInternal};return await this.__store(dummyUXFileInfo,!0,!1,!1)}async __store(file,force=!1,skipCheck,onlyChunks){if(!skipCheck&&!await this.checkIsTargetFile(file))return!0;if(!file){this._log("File seems bad",LOG_LEVEL_VERBOSE);return!1}const possiblyLarge=!isPlainText(file.name),content=file.body,datatype=determineTypeFromBlob(content),idPrefix=file.isInternal?ICHeader:"",fullPath=getStoragePathFromUXFileInfo(file),fullPathOnDB=getDatabasePathFromUXFileInfo(file);possiblyLarge&&this._log(`Processing: ${fullPath}`,LOG_LEVEL_VERBOSE);if(file.isInternal)if(file.deleted)file.stat={size:0,ctime:Date.now(),mtime:Date.now(),type:"file"};else if(null==file.stat){const stat=await this.storageAccess.statHidden(file.path);if(!stat){this._log(`Internal file not found: ${fullPath}`,LOG_LEVEL_VERBOSE);return!1}file.stat=stat}const d4={_id:idPrefix+await this.path.path2id(fullPath),path:fullPathOnDB,data:content,ctime:file.stat.ctime,mtime:file.stat.mtime,size:file.stat.size,children:[],datatype,type:datatype,eden:{}},msg=`STORAGE -> DB (${datatype}) `;if(await serialized("file-"+fullPath,async()=>{if(force){this._log(msg+"Force writing "+fullPath,LOG_LEVEL_VERBOSE);return!1}try{const old=await this.database.localDatabase.getDBEntry(d4.path,void 0,!1,!0,!1);if(!1!==old){const oldData={data:old.data,deleted:old._deleted||old.deleted},newData={data:d4.data,deleted:d4._deleted||d4.deleted};if(oldData.deleted!=newData.deleted)return!1;if(!await isDocContentSame(old.data,newData.data))return!1;this._log(msg+"Skipped (not changed) "+fullPath+(d4._deleted||d4.deleted?" (deleted)":""),LOG_LEVEL_VERBOSE);this.path.markChangesAreSame(old,d4.mtime,old.mtime);return!0}}catch(ex){this._log(msg+"Error, Could not check the diff for the old one."+(force?"force writing.":"")+fullPath+(d4._deleted||d4.deleted?" (deleted)":""),LOG_LEVEL_VERBOSE);this._log(ex,LOG_LEVEL_VERBOSE);return!force}return!1})){this._log(msg+" Skip "+fullPath,LOG_LEVEL_VERBOSE);return!0}const ret=await this.database.localDatabase.putDBEntry(d4,onlyChunks);if(!1!==ret){this._log(msg+fullPath);eventHub.emitEvent("file-saved")}return 0!=ret}async getConflictedRevs(file){if(!await this.checkIsTargetFile(file))return[];const filename=getDatabasePathFromUXFileInfo(file),doc=await this.database.localDatabase.getDBEntryMeta(filename,{conflicts:!0},!0);return!1===doc?[]:doc._conflicts||[]}async fetch(file,rev3,waitForReady,skipCheck=!1){if(skipCheck&&!await this.checkIsTargetFile(file))return!1;const entry=await this.fetchEntry(file,rev3,waitForReady,!0);if(!1===entry)return!1;const data=createBlob(readContent(entry)),path2=stripAllPrefixes(entry.path),fileInfo={name:path2.split("/").pop(),path:path2,stat:{size:entry.size,ctime:entry.ctime,mtime:entry.mtime,type:"file"},body:data,deleted:entry.deleted||entry._deleted};isInternalMetadata(entry.path)&&(fileInfo.isInternal=!0);return fileInfo}async fetchEntryMeta(file,rev3,skipCheck=!1){const dbFileName=getDatabasePathFromUXFileInfo(file);if(skipCheck&&!await this.checkIsTargetFile(file))return!1;const doc=await this.database.localDatabase.getDBEntryMeta(dbFileName,rev3?{rev:rev3}:void 0,!0);return!1!==doc&&doc}async fetchEntryFromMeta(meta,waitForReady=!0,skipCheck=!1){if(skipCheck&&!await this.checkIsTargetFile(meta.path))return!1;const doc=await this.database.localDatabase.getDBEntryFromMeta(meta,!1,waitForReady);return!1!==doc&&doc}async fetchEntry(file,rev3,waitForReady=!0,skipCheck=!1){if(skipCheck&&!await this.checkIsTargetFile(file))return!1;const entry=await this.fetchEntryMeta(file,rev3,!0);return!1!==entry&&await this.fetchEntryFromMeta(entry,waitForReady,!0)}async deleteFromDBbyPath(fullPath,rev3){if(!await this.checkIsTargetFile(fullPath)){this._log(`deleteFromDBbyPath: File is not target: ${fullPath}`);return!0}const opt=rev3?{rev:rev3}:void 0,ret=await this.database.localDatabase.deleteDBEntry(fullPath,opt);eventHub.emitEvent("file-saved");return ret}};ServiceDatabaseFileAccess=class extends ServiceDatabaseFileAccessBase{};StorageEventManager=class{};ServiceFileAccessBase=class extends ServiceModuleBase{constructor(services){super(services);this.vault=services.vault;this.setting=services.setting;this.vaultManager=services.storageEventManager;this.vaultAccess=services.vaultAccess;services.appLifecycle.onFirstInitialise.addHandler(this._everyOnFirstInitialize.bind(this));services.fileProcessing.commitPendingFileEvents.addHandler(this._everyCommitPendingFileEvent.bind(this))}restoreState(){return this.vaultManager.restoreState()}async _everyOnFirstInitialize(){await this.vaultManager.beginWatch();return Promise.resolve(!0)}async _everyCommitPendingFileEvent(){await this.vaultManager.waitForIdle();return Promise.resolve(!0)}normalisePath(path2){return this.vaultAccess.normalisePath(path2)}async writeFileAuto(path2,data,opt){const file=await this.vaultAccess.getAbstractFileByPath(path2);if(this.vaultAccess.isFile(file))return this.vaultAccess.vaultModify(file,data,opt);if(null!==file){this._log(`Could not write file (Possibly already exists as a folder): ${path2}`,LOG_LEVEL_VERBOSE);return!1}if(!path2.endsWith(".md")){await this.vaultAccess.adapterWrite(path2,data,opt);return await this.vaultAccess.adapterExists(path2)}try{return null!==await this.vaultAccess.vaultCreate(path2,data,opt)}catch(ex){if(ex instanceof Error&&"File already exists."===ex.message){await this.vaultAccess.adapterWrite(path2,data,opt);return await this.vaultAccess.adapterExists(path2)}throw ex}}async readFileAuto(path2){const file=await this.vaultAccess.getAbstractFileByPath(path2);if(this.vaultAccess.isFile(file))return this.vaultAccess.vaultReadAuto(file);throw new Error(`Could not read file (Possibly does not exist): ${path2}`)}async readFileText(path2){const file=await this.vaultAccess.getAbstractFileByPath(path2);if(this.vaultAccess.isFile(file))return this.vaultAccess.vaultRead(file);throw new Error(`Could not read file (Possibly does not exist): ${path2}`)}async isExists(path2){return this.vaultAccess.isFile(await this.vaultAccess.getAbstractFileByPath(path2))}async writeHiddenFileAuto(path2,data,opt){try{await this.vaultAccess.adapterWrite(path2,data,opt);return!0}catch(e3){this._log(`Could not write hidden file: ${path2}`,LOG_LEVEL_VERBOSE);this._log(e3,LOG_LEVEL_VERBOSE);return!1}}async appendHiddenFile(path2,data,opt){try{await this.vaultAccess.adapterAppend(path2,data,opt);return!0}catch(e3){this._log(`Could not append hidden file: ${path2}`,LOG_LEVEL_VERBOSE);this._log(e3,LOG_LEVEL_VERBOSE);return!1}}async stat(path2){const file=await this.vaultAccess.getAbstractFileByPath(path2);if(null===file)return Promise.resolve(null);if(this.vaultAccess.isFile(file)){const fileWithStat=file;return Promise.resolve({ctime:fileWithStat.stat.ctime,mtime:fileWithStat.stat.mtime,size:fileWithStat.stat.size,type:"file"})}throw new Error(`Could not stat file (Possibly does not exist): ${path2}`)}statHidden(path2){return this.vaultAccess.tryAdapterStat(path2)}async removeHidden(path2){try{await this.vaultAccess.adapterRemove(path2);return null===this.vaultAccess.tryAdapterStat(path2)}catch(e3){this._log(`Could not remove hidden file: ${path2}`,LOG_LEVEL_VERBOSE);this._log(e3,LOG_LEVEL_VERBOSE);return!1}}async readHiddenFileAuto(path2){return await this.vaultAccess.adapterReadAuto(path2)}async readHiddenFileText(path2){return await this.vaultAccess.adapterRead(path2)}async readHiddenFileBinary(path2){return await this.vaultAccess.adapterReadBinary(path2)}async isExistsIncludeHidden(path2){return null!==await this.vaultAccess.tryAdapterStat(path2)}async ensureDir(path2){try{await this.vaultAccess.ensureDirectory(path2);return!0}catch(e3){this._log(`Could not ensure directory: ${path2}`,LOG_LEVEL_VERBOSE);this._log(e3,LOG_LEVEL_VERBOSE);return!1}}async _triggerFileEvent(event2,path2){const file=await this.vaultAccess.getAbstractFileByPath(path2);null!==file&&this.vaultAccess.trigger(event2,file)}triggerFileEvent(event2,path2){fireAndForget(async()=>await this._triggerFileEvent(event2,path2))}async triggerHiddenFile(path2){await this.vaultAccess.reconcileInternalFile(path2)}async getFileStub(path2){const file=await this.vaultAccess.getAbstractFileByPath(path2);return this.vaultAccess.isFile(file)?this.vaultAccess.nativeFileToUXFileInfoStub(file):null}async readStubContent(stub){const file=await this.vaultAccess.getAbstractFileByPath(stub.path);if(!this.vaultAccess.isFile(file)){this._log(`Could not read file (Possibly does not exist or a folder): ${stub.path}`,LOG_LEVEL_VERBOSE);return!1}const data=await this.vaultAccess.vaultReadAuto(file);return{...stub,...this.vaultAccess.nativeFileToUXFileInfoStub(file),body:createBlob(data)}}async getStub(path2){const file=await this.vaultAccess.getAbstractFileByPath(path2);return this.vaultAccess.isFile(file)?this.vaultAccess.nativeFileToUXFileInfoStub(file):this.vaultAccess.isFolder(file)?this.vaultAccess.nativeFolderToUXFolder(file):null}async getFiles(){return(await this.vaultAccess.getFiles()).map(f4=>this.vaultAccess.nativeFileToUXFileInfoStub(f4))}async getFileNames(){return(await this.vaultAccess.getFiles()).map(f4=>f4.path)}async getFilesIncludeHidden(basePath,includeFilter,excludeFilter,skipFolder=[".git",".trash","node_modules"]){var _a8;let w2;try{w2=await this.vaultAccess.adapterList(basePath)}catch(ex){this._log(`Could not traverse(getFilesIncludeHidden):${basePath}`,LOG_LEVEL_INFO);this._log(ex,LOG_LEVEL_VERBOSE);return[]}skipFolder=skipFolder.map(e3=>e3.toLowerCase());let files=[];for(const file of w2.files)includeFilter&&includeFilter.length>0&&!includeFilter.some(e3=>e3.test(file))||excludeFilter&&excludeFilter.some(ee=>ee.test(file))||await this.vault.isIgnoredByIgnoreFile(file)||files.push(file);for(const v2 of w2.folders){const folderName=(null!=(_a8=v2.split("/").pop())?_a8:"").toLowerCase();skipFolder.some(e3=>folderName===e3)||excludeFilter&&excludeFilter.some(e3=>e3.test(v2))||await this.vault.isIgnoredByIgnoreFile(v2)||(files=files.concat(await this.getFilesIncludeHidden(v2,includeFilter,excludeFilter,skipFolder)))}return files}async touched(file){const path2="string"==typeof file?file:file.path;await this.vaultAccess.touch(path2)}async recentlyTouched(file){const xFile="string"==typeof file?await this.vaultAccess.getAbstractFileByPath(file):file;return null!==xFile&&!this.vaultAccess.isFolder(xFile)&&this.vaultAccess.recentlyTouched(xFile)}clearTouched(){this.vaultAccess.clearTouched()}async delete(file,force){const xPath="string"==typeof file?file:file.path,xFile=await this.vaultAccess.getAbstractFileByPath(xPath);return null===xFile?Promise.resolve():this.vaultAccess.isFile(xFile)||this.vaultAccess.isFolder(xFile)?this.vaultAccess.delete(xFile,force):Promise.resolve()}async trash(file,system){const xPath="string"==typeof file?file:file.path,xFile=await this.vaultAccess.getAbstractFileByPath(xPath);return null===xFile?Promise.resolve():this.vaultAccess.isFile(xFile)||this.vaultAccess.isFolder(xFile)?this.vaultAccess.trash(xFile,system):Promise.resolve()}async __deleteVaultItem(file){var _a8,_b5,_c3,_d2;const filePath=this.vaultAccess.getPath(file);if(this.vaultAccess.isFile(file)&&!await this.vault.isTargetFile(filePath))return;const dir=file.parent,settings=this.setting.currentSettings();settings.trashInsteadDelete?await this.vaultAccess.trash(file,!1):await this.vaultAccess.delete(file,!0);this._log(`xxx <- STORAGE (deleted) ${filePath}`);if(dir){this._log(`files: ${null!=(_b5=null==(_a8=null==dir?void 0:dir.children)?void 0:_a8.length)?_b5:"unknown"}`);if(0===(null!=(_d2=null==(_c3=null==dir?void 0:dir.children)?void 0:_c3.length)?_d2:0)&&!settings.doNotDeleteFolder){this._log(`All files under the parent directory (${dir.path}) have been deleted, so delete this one.`);await this.__deleteVaultItem(dir)}}}async deleteVaultItem(fileSrc){const path2="string"==typeof fileSrc?fileSrc:fileSrc.path,file=await this.vaultAccess.getAbstractFileByPath(path2);if(null!==file)return this.vaultAccess.isFile(file)||this.vaultAccess.isFolder(file)?await this.__deleteVaultItem(file):void 0}};ServiceFileAccessObsidian=class extends ServiceFileAccessBase{};StorageAccessManager=class{constructor(){this.processingFiles=new Set;this.touchedFiles=[]}processWriteFile(file,proc){const path2="string"==typeof file?file:file.path;return serialized(`file-lock:${path2}`,async()=>{try{this.processingFiles.add(path2);return await proc()}finally{this.processingFiles.delete(path2)}})}processReadFile(file,proc){const path2="string"==typeof file?file:file.path;return serialized(`file-lock:${path2}`,async()=>{try{this.processingFiles.add(path2);return await proc()}finally{this.processingFiles.delete(path2)}})}isFileProcessing(file){const path2="string"==typeof file?file:file.path;return this.processingFiles.has(path2)}touch(file){const key3="stat"in file?`${file.path}-${file.stat.mtime}-${file.stat.size}`:`${file.path}-${file.mtime}-${file.size}`;this.touchedFiles.unshift(key3);this.touchedFiles=this.touchedFiles.slice(0,100)}recentlyTouched(file){const key3="stat"in file?`${file.path}-${file.stat.mtime}-${file.stat.size}`:`${file.path}-${file.mtime}-${file.size}`;return-1!=this.touchedFiles.indexOf(key3)}clearTouched(){this.touchedFiles=[]}};ServiceFileHandlerBase=class extends ServiceModuleBase{constructor(services){super(services);this.databaseFileAccess=services.databaseFileAccess;this.storageAccess=services.storageAccess;this.conflict=services.conflict;this.path=services.path;this.setting=services.setting;this.vault=services.vault;services.fileProcessing.processFileEvent.addHandler(this._anyHandlerProcessesFileEvent.bind(this),100);services.replication.processSynchroniseResult.addHandler(this._anyProcessReplicatedDoc.bind(this),100)}get db(){return this.databaseFileAccess}get storage(){return this.storageAccess}getPath(entry){return this.path.getPath(entry)}getPathWithoutPrefix(entry){return stripAllPrefixes(this.path.getPath(entry))}async readFileFromStub(file){if("body"in file&&file.body)return file;const readFile=await this.storage.readStubContent(file);if(!readFile)throw new Error(`File ${file.path} is not exist on the storage`);return readFile}async infoToStub(info3){return null==info3?null:"string"==typeof info3?await this.storage.getFileStub(info3):info3}async storeFileToDB(info3,force=!1,onlyChunks=!1){const file=await this.infoToStub(info3);if(null==file){this._log(`File ${info3} is not exist on the storage`,LOG_LEVEL_VERBOSE);return!1}if(file.isInternal){this._log(`Internal file ${file.path} is not allowed to be processed on processFileEvent`,LOG_LEVEL_VERBOSE);return!1}const entry=await this.db.fetchEntry(file,void 0,!0,!0);if(!entry||entry.deleted||entry._deleted){const readFile=await this.readFileFromStub(file);return onlyChunks?await this.db.createChunks(readFile,!1,!0):await this.db.store(readFile)}let shouldApplied=!1;if(force||onlyChunks){const readFile=await this.readFileFromStub(file);return onlyChunks?await this.db.createChunks(readFile,!0,!0):await this.db.store(readFile,!0,!0)}{this.path.compareFileFreshness(file,entry)!==EVEN&&(shouldApplied=!0);let readFile;if(!shouldApplied){readFile=await this.readFileFromStub(file);if(!readFile){this._log(`File ${file.path} is not exist on the storage`,LOG_LEVEL_NOTICE);return!1}await isDocContentSame(getDocDataAsArray(entry.data),readFile.body)?this.path.markChangesAreSame(readFile,readFile.stat.mtime,entry.mtime):shouldApplied=!0}if(!shouldApplied){this._log(`File ${file.path} is not changed`,LOG_LEVEL_VERBOSE);return!0}readFile||(readFile=await this.readFileFromStub(file));return onlyChunks?await this.db.createChunks(readFile,!1,!0):await this.db.store(readFile,!1,!0)}}async deleteFileFromDB(info3){const file=await this.infoToStub(info3);if(null==file){this._log(`File ${info3} is not exist on the storage`,LOG_LEVEL_VERBOSE);return!1}if(file.isInternal){this._log(`Internal file ${file.path} is not allowed to be processed on processFileEvent`,LOG_LEVEL_VERBOSE);return!1}const entry=await this.db.fetchEntry(file,void 0,!0,!0);if(!entry||entry.deleted||entry._deleted){this._log(`File ${file.path} is not exist or already deleted on the database`,LOG_LEVEL_VERBOSE);return!1}return(await this.db.getConflictedRevs(file)).length>0?await this.db.delete(file,entry._rev):await this.db.delete(file)}async deleteRevisionFromDB(info3,rev3){return await this.db.delete(info3,rev3)}async resolveConflictedByDeletingRevision(info3,rev3){const path2=getStoragePathFromUXFileInfo(info3);if(!await this.deleteRevisionFromDB(info3,rev3)){this._log(`Failed to delete the conflicted revision ${rev3} of ${path2}`,LOG_LEVEL_VERBOSE);return!1}if(!await this.dbToStorageWithSpecificRev(info3,rev3,!0)){this._log(`Failed to apply the resolved revision ${rev3} of ${path2} to the storage`,LOG_LEVEL_VERBOSE);return!1}}async dbToStorageWithSpecificRev(info3,rev3,force){const file=await this.infoToStub(info3);if(null==file){this._log(`File ${info3} is not exist on the storage`,LOG_LEVEL_VERBOSE);return!1}const docEntry=await this.db.fetchEntryMeta(file,rev3,!0);if(!docEntry){this._log(`File ${file.path} is not exist on the database`,LOG_LEVEL_VERBOSE);return!1}return await this.dbToStorage(docEntry,file,force)}async dbToStorage(entryInfo,info3,force){const mode=null==await this.infoToStub(info3)?"create":"modify",pathFromEntryInfo="string"==typeof entryInfo?entryInfo:this.getPath(entryInfo),docEntry=await this.db.fetchEntryMeta(pathFromEntryInfo,void 0,!0);if(!docEntry){this._log(`File ${pathFromEntryInfo} is not exist on the database`,LOG_LEVEL_VERBOSE);return!1}const path2=this.getPath(docEntry),settings=this.setting.currentSettings();if((await this.db.getConflictedRevs(path2)).length>0&&!settings.writeDocumentsIfConflicted){await this.conflict.queueCheckForIfOpen(path2);return!0}const existDoc=await this.storage.getStub(path2);if(existDoc&&existDoc.isFolder){this._log(`Folder ${path2} is already exist on the storage as a folder`,LOG_LEVEL_VERBOSE);return!0}const existOnDB=!(docEntry._deleted||docEntry.deleted),existOnStorage=null!=existDoc;if(!existOnDB&&!existOnStorage){this._log(`File ${path2} seems to be deleted, but already not on storage`,LOG_LEVEL_VERBOSE);return!0}if(!existOnDB&&existOnStorage){await this.storage.deleteVaultItem(path2);return!0}const docRead=await this.db.fetchEntryFromMeta(docEntry);if(!docRead){this._log(`File ${path2} is not exist on the database`,LOG_LEVEL_VERBOSE);return!1}if(!settings.processSizeMismatchedFiles&&0!=docRead.size&&docRead.size!==readAsBlob(docRead).size){this._log(`File ${path2} seems to be corrupted! Writing prevented. (${docRead.size} != ${readAsBlob(docRead).size})`,LOG_LEVEL_NOTICE);return!1}const docData=readContent(docRead);if(existOnStorage&&!force){let shouldApplied=!1;this.path.compareFileFreshness(existDoc,docEntry)!==EVEN&&(shouldApplied=!0);if(!shouldApplied){const readFile=await this.readFileFromStub(existDoc);if(await isDocContentSame(docData,readFile.body)){shouldApplied=!1;this.path.markChangesAreSame(docRead,docRead.mtime,existDoc.stat.mtime)}else shouldApplied=!0}if(!shouldApplied){this._log(`File ${docRead.path} is not changed`,LOG_LEVEL_VERBOSE);return!0}}else this._log(`File ${docRead.path} ${existOnStorage?"(new) ":""} ${force?" (forced)":""}`,LOG_LEVEL_VERBOSE);await this.storage.ensureDir(path2);const ret=await this.storage.writeFileAuto(path2,docData,{ctime:docRead.ctime,mtime:docRead.mtime});await this.storage.touched(path2);this.storage.triggerFileEvent(mode,path2);return ret}async _anyHandlerProcessesFileEvent(item){const eventItem=item.args,type=item.type,path2=eventItem.file.path;if(!await this.vault.isTargetFile(path2)){this._log(`File ${path2} is not the target file`,LOG_LEVEL_VERBOSE);return!1}if(shouldBeIgnored(path2)){this._log(`File ${path2} should be ignored`,LOG_LEVEL_VERBOSE);return!1}const lockKey=`processFileEvent-${path2}`;return await serialized(lockKey,async()=>{switch(type){case"CREATE":case"CHANGED":return await this.storeFileToDB(item.args.file);case"DELETE":return await this.deleteFileFromDB(item.args.file);case"INTERNAL":return!1;default:this._log(`Unsupported event type: ${type}`,LOG_LEVEL_VERBOSE);return!1}})}async _anyProcessReplicatedDoc(entry){return await serialized(entry.path,async()=>{var _a8,_b5;if(!await this.vault.isTargetFile(entry.path)){this._log(`File ${entry.path} is not the target file`,LOG_LEVEL_VERBOSE);return!1}if(this.vault.isFileSizeTooLarge(entry.size)){this._log(`File ${entry.path} is too large (on database) to be processed`,LOG_LEVEL_VERBOSE);return!1}if(shouldBeIgnored(entry.path)){this._log(`File ${entry.path} should be ignored`,LOG_LEVEL_VERBOSE);return!1}const path2=this.getPath(entry),targetFile=await this.storage.getStub(this.getPathWithoutPrefix(entry));if(targetFile&&targetFile.isFolder){this._log(`${path2} is already exist as the folder`);return!0}{if(targetFile&&this.vault.isFileSizeTooLarge(targetFile.stat.size)){this._log(`File ${targetFile.path} is too large (on storage) to be processed`,LOG_LEVEL_VERBOSE);return!1}this._log(`Processing ${path2} (${entry._id.substring(0,8)} :${null==(_a8=entry._rev)?void 0:_a8.substring(0,5)}) : Started...`,LOG_LEVEL_VERBOSE);eventHub.emitEvent("conflict-cancelled",path2);const ret=await this.dbToStorage(entry,targetFile);this._log(`Processing ${path2} (${entry._id.substring(0,8)} :${null==(_b5=entry._rev)?void 0:_b5.substring(0,5)}) : Done`);return ret}})}async createAllChunks(showingNotice){this._log("Collecting local files on the storage",LOG_LEVEL_VERBOSE);const semaphore=Semaphore(10);let processed=0;const filesStorageSrc=await this.storage.getFiles(),incProcessed=()=>{processed++;processed%25==0&&this._log(`Creating missing chunks: ${processed} of ${total} files`,showingNotice?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"chunkCreation")},total=filesStorageSrc.length,procAllChunks=filesStorageSrc.map(async file=>{if(!await this.vault.isTargetFile(file)){incProcessed();return!0}if(this.vault.isFileSizeTooLarge(file.stat.size)){incProcessed();return!0}if(shouldBeIgnored(file.path)){incProcessed();return!0}const release=await semaphore.acquire();incProcessed();try{await this.storeFileToDB(file,!1,!0)}catch(ex){this._log(ex,LOG_LEVEL_VERBOSE)}finally{release()}});await Promise.all(procAllChunks);this._log(`Creating chunks Done: ${processed} of ${total} files`,showingNotice?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO,"chunkCreation")}};ServiceFileHandler=class extends ServiceFileHandlerBase{};FileAccessBase=class{constructor(adapter,dependencies){this.adapter=adapter;this.storageAccessManager=dependencies.storageAccessManager;this.vaultService=dependencies.vaultService;this.settingService=dependencies.settingService;this.APIService=dependencies.APIService;this.path=dependencies.pathService;this._log=createInstanceLogFunction("FileAccess",this.APIService)}isFile(file){return this.adapter.typeGuard.isFile(file)}isFolder(item){return this.adapter.typeGuard.isFolder(item)}getPath(file){return this.adapter.path.getPath(file)}nativeFileToUXFileInfoStub(file){return this.adapter.conversion.nativeFileToUXFileInfoStub(file)}nativeFolderToUXFolder(file){return this.adapter.conversion.nativeFolderToUXFolder(file)}normalisePath(path2){return this.adapter.path.normalisePath(path2)}_writeOp(file,callback){const path2=this.getPath(file);return this.storageAccessManager.processWriteFile(path2,async()=>await callback(path2,file))}_readOp(file,callback){const path2=this.getPath(file);return this.storageAccessManager.processReadFile(path2,async()=>await callback(path2,file))}async tryAdapterStat(file){return await this._readOp(file,async path2=>await this.adapter.storage.trystat(path2))}async adapterStat(file){return await this._readOp(file,async path2=>await this.adapter.storage.stat(path2))}async adapterExists(file){return await this._readOp(file,async path2=>await this.adapter.storage.exists(path2))}async adapterRemove(file){return await this._writeOp(file,async path2=>await this.adapter.storage.remove(path2))}async adapterRead(file){return await this._readOp(file,async path2=>await this.adapter.storage.read(path2))}async adapterReadBinary(file){return await this._readOp(file,async path2=>await this.adapter.storage.readBinary(path2))}async adapterReadAuto(file){return isPlainText(this.getPath(file))?await this._readOp(file,async path3=>await this.adapter.storage.read(path3)):await this._readOp(file,async path3=>await this.adapter.storage.readBinary(path3))}async adapterWrite(file,data,options){return"string"==typeof data?await this._writeOp(file,async path2=>await this.adapter.storage.write(path2,data,options)):await this._writeOp(file,async path2=>await this.adapter.storage.writeBinary(path2,toArrayBuffer(data),options))}adapterList(basePath){return this.adapter.storage.list(basePath)}async vaultCacheRead(file){return await this._readOp(file,async path2=>await this.adapter.vault.cachedRead(file))}vaultRead(file){return this._readOp(file,async path2=>await this.adapter.vault.read(file))}vaultReadBinary(file){return this._readOp(file,async path2=>await this.adapter.vault.readBinary(file))}async vaultReadAuto(file){const path2=this.getPath(file);return isPlainText(path2)?await this._readOp(path2,async path3=>await this.adapter.vault.read(file)):await this._readOp(path2,async path3=>await this.adapter.vault.readBinary(file))}async vaultModify(file,data,options){return"string"==typeof data?await this._writeOp(file,async path2=>{const oldData=await this.adapter.vault.read(file);if(data===oldData){const stat=await this.adapter.statFromNative(file);options&&options.mtime&&this.path.markChangesAreSame(path2,stat.mtime,options.mtime);return!0}await this.adapter.vault.modify(file,data,options);return!0}):await this._writeOp(file,async path2=>{const oldData=await this.adapter.vault.readBinary(file);if(await isDocContentSame(createBinaryBlob(oldData),createBinaryBlob(data))){const stat=await this.adapter.statFromNative(file);options&&options.mtime&&this.path.markChangesAreSame(path2,stat.mtime,options.mtime);return!0}await this.adapter.vault.modifyBinary(file,toArrayBuffer(data),options);return!0})}async vaultCreate(path2,data,options){return"string"==typeof data?await this._writeOp(path2,()=>this.adapter.vault.create(path2,data,options)):await this._writeOp(path2,()=>this.adapter.vault.createBinary(path2,toArrayBuffer(data),options))}trigger(name,...data){return this.adapter.vault.trigger(name,...data)}async reconcileInternalFile(path2){return await this.adapter.reconcileInternalFile(path2)}async adapterAppend(normalizedPath,data,options){return await this.adapter.storage.append(normalizedPath,data,options)}async delete(file,force){return await this._writeOp(file,async(path2,file2)=>await this.adapter.vault.delete(file2,force))}async trash(file,force){return await this._writeOp(file,async(path2,file2)=>await this.adapter.vault.trash(file2,force))}isStorageInsensitive(){return this.vaultService.isStorageInsensitive()}async getAbstractFileByPath(path2){return!this.settingService.currentSettings().handleFilenameCaseSensitive||this.isStorageInsensitive()?await this.adapter.getAbstractFileByPathInsensitive(path2):await this.adapter.getAbstractFileByPath(path2)}async getFiles(){return await this.adapter.getFiles()}async ensureDirectory(fullPath){const pathElements=fullPath.split("/");pathElements.pop();let c3="";for(const v2 of pathElements){c3+=v2;try{await this.adapter.storage.mkdir(c3)}catch(ex){if("Folder already exists."==(null==ex?void 0:ex.message));else{this._log("Folder Create Error");this._log(ex)}}c3+="/"}}async touch(file){const path2=this.getPath(file),statOrg=this.isFile(file)?file.stat:await this.adapter.storage.stat(path2);return this.storageAccessManager.touch({path:path2,stat:statOrg||{ctime:0,mtime:0,size:0}})}recentlyTouched(file){const path2=file.path;return this.storageAccessManager.recentlyTouched({...file,path:path2})}clearTouched(){return this.storageAccessManager.clearTouched()}};ObsidianConversionAdapter=class{nativeFileToUXFileInfoStub(file){return TFileToUXFileInfoStub(file)}nativeFolderToUXFolder(folder){return TFolderToUXFileInfoStub(folder)}};ObsidianPathAdapter=class{getPath(file){return"string"==typeof file?file:file.path}normalisePath(path2){return normalizePath(path2)}};ObsidianStorageAdapter=class{constructor(app){this.app=app}async exists(path2){return await this.app.vault.adapter.exists(path2)}async trystat(path2){return await this.app.vault.adapter.exists(path2)?await this.app.vault.adapter.stat(path2):null}async stat(path2){return await this.app.vault.adapter.stat(path2)}async mkdir(path2){await this.app.vault.adapter.mkdir(path2)}async remove(path2){await this.app.vault.adapter.remove(path2)}async read(path2){return await this.app.vault.adapter.read(path2)}async readBinary(path2){return await this.app.vault.adapter.readBinary(path2)}async write(path2,data,options){return await this.app.vault.adapter.write(path2,data,options)}async writeBinary(path2,data,options){return await this.app.vault.adapter.writeBinary(path2,toArrayBuffer(data),options)}async append(path2,data,options){return await this.app.vault.adapter.append(path2,data,options)}list(basePath){return Promise.resolve(this.app.vault.adapter.list(basePath))}};import_obsidian4=require("obsidian");ObsidianTypeGuardAdapter=class{isFile(file){return file instanceof import_obsidian4.TFile}isFolder(item){return item instanceof import_obsidian4.TFolder}};ObsidianVaultAdapter=class{constructor(app){this.app=app}async read(file){return await this.app.vault.read(file)}async cachedRead(file){return await this.app.vault.cachedRead(file)}async readBinary(file){return await this.app.vault.readBinary(file)}async modify(file,data,options){return await this.app.vault.modify(file,data,options)}async modifyBinary(file,data,options){return await this.app.vault.modifyBinary(file,toArrayBuffer(data),options)}async create(path2,data,options){return await this.app.vault.create(path2,data,options)}async createBinary(path2,data,options){return await this.app.vault.createBinary(path2,toArrayBuffer(data),options)}async delete(file,force=!1){return await this.app.vault.delete(file,force)}async trash(file,force=!1){return await this.app.vault.trash(file,force)}trigger(name,...data){return this.app.vault.trigger(name,...data)}};ObsidianFileSystemAdapter=class{constructor(app){this.app=app;this.path=new ObsidianPathAdapter;this.typeGuard=new ObsidianTypeGuardAdapter;this.conversion=new ObsidianConversionAdapter;this.storage=new ObsidianStorageAdapter(app);this.vault=new ObsidianVaultAdapter(app)}getAbstractFileByPath(path2){return Promise.resolve(this.app.vault.getAbstractFileByPath(path2))}getAbstractFileByPathInsensitive(path2){return Promise.resolve(this.app.vault.getAbstractFileByPathInsensitive(path2))}getFiles(){return Promise.resolve(this.app.vault.getFiles())}statFromNative(file){return Promise.resolve({...file.stat,type:"file"})}async reconcileInternalFile(path2){var _a8,_b5;return await Promise.resolve(null==(_b5=(_a8=this.app.vault.adapter).reconcileInternalFile)?void 0:_b5.call(_a8,path2))}};FileAccessObsidian=class extends FileAccessBase{constructor(app,dependencies){super(new ObsidianFileSystemAdapter(app),dependencies)}};StorageEventManagerBase=class extends StorageEventManager{constructor(adapter,dependencies){super();this.snapShotRestored=null;this.bufferedQueuedItems=[];this.triggerTakeSnapshot=throttle(()=>this._triggerTakeSnapshot(),100);this.concurrentProcessing=Semaphore(5);this._waitingMap=new Map;this._waitForIdle=null;this.processingCount=0;this.adapter=adapter;this.setting=dependencies.setting;this.vaultService=dependencies.vaultService;this.fileProcessing=dependencies.fileProcessing;this.storageAccess=dependencies.storageAccessManager;this._log=createInstanceLogFunction("StorageEventManager",dependencies.APIService)}get shouldBatchSave(){var _a8,_b5;return(null==(_a8=this.settings)?void 0:_a8.batchSave)&&1!=(null==(_b5=this.settings)?void 0:_b5.liveSync)}get batchSaveMinimumDelay(){var _a8,_b5;return null!=(_b5=null==(_a8=this.settings)?void 0:_a8.batchSaveMinimumDelay)?_b5:DEFAULT_SETTINGS.batchSaveMinimumDelay}get batchSaveMaximumDelay(){var _a8,_b5;return null!=(_b5=null==(_a8=this.settings)?void 0:_a8.batchSaveMaximumDelay)?_b5:DEFAULT_SETTINGS.batchSaveMaximumDelay}get settings(){return this.setting.currentSettings()}_saveSnapshot(snapshot2){return this.adapter.persistence.saveSnapshot(snapshot2)}_loadSnapshot(){return this.adapter.persistence.loadSnapshot()}isFolder(file){return this.adapter.typeGuard.isFolder(file)}isFile(file){return this.adapter.typeGuard.isFile(file)}updateStatus(){const totalItems=this.bufferedQueuedItems.filter(e3=>"args"in e3).filter(e3=>!e3.cancelled).length+this.concurrentProcessing.waiting,processing=this.processingCount,batchedCount=this._waitingMap.size;this.adapter.status.updateStatus({batched:batchedCount,processing,totalQueued:totalItems+batchedCount+processing})}restoreState(){this.snapShotRestored=this._restoreFromSnapshot();return this.snapShotRestored}async appendQueue(params,ctx){var _a8;const settings=this.settings;if(settings.isConfigured&&!(settings.suspendFileWatching||settings.maxMTimeForReflectEvents>0)){this.fileProcessing.onStorageFileEvent();for(const param of params){if(shouldBeIgnored(param.file.path))continue;const atomicKey=[0,0,0,0,0,0].map(e3=>`${Math.floor(1e5*Math.random())}`).join("-"),type=param.type,file=param.file,oldPath=param.oldPath;if("INTERNAL"!==type){const size=file.stat.size;if(this.vaultService.isFileSizeTooLarge(size)&&("CREATE"==type||"CHANGED"==type)){this._log(`The storage file has been changed but exceeds the maximum size. Skipping: ${param.file.path}`,LOG_LEVEL_NOTICE);continue}}if(this.isFolder(file)){this._log(`Folder event skipped: ${file.path}`,LOG_LEVEL_VERBOSE);continue}if(!await this.vaultService.isTargetFile(file.path))continue;if(this.isFile(file)&&("CREATE"==type||"CHANGED"==type)){await delay(10);if(this.storageAccess.recentlyTouched({path:file.path,stat:null!=(_a8=file.stat)?_a8:{ctime:0,mtime:0,size:0}}))continue}let cache2;param.cachedData&&(cache2=param.cachedData);this.enqueue({type,args:{file,oldPath,cache:cache2,ctx},skipBatchWait:param.skipBatchWait,key:atomicKey})}}}enqueue(newItem){"DELETE"==newItem.type&&this.bufferedQueuedItems.push({type:"SENTINEL_FLUSH"});this.updateStatus();this.bufferedQueuedItems.push(newItem);fireAndForget(()=>this._takeSnapshot().then(()=>this.runQueuedEvents()))}_triggerTakeSnapshot(){this._takeSnapshot()}waitForIdle(){if(0===this._waitingMap.size)return Promise.resolve();if(this._waitForIdle)return this._waitForIdle;const promises=[...this._waitingMap.entries()].map(([key3,waitInfo])=>new Promise(resolve=>{waitInfo.canProceed.promise.then(()=>{this._log(`Processing ${key3}: Wait for idle completed`,LOG_LEVEL_DEBUG)}).catch(e3=>{this._log(`Processing ${key3}: Wait for idle error`,LOG_LEVEL_INFO);this._log(e3,LOG_LEVEL_VERBOSE)}).finally(()=>{resolve()});this._proceedWaiting(key3)})),waitPromise=Promise.all(promises).then(()=>{this._waitForIdle=null;this._log("All wait for idle completed",LOG_LEVEL_VERBOSE)});this._waitForIdle=waitPromise;return waitPromise}_proceedWaiting(key3){const waitInfo=this._waitingMap.get(key3);if(waitInfo){waitInfo.canProceed.resolve(!0);clearTimeout(waitInfo.timerHandler);this._waitingMap.delete(key3)}this.triggerTakeSnapshot()}_cancelWaiting(key3){const waitInfo=this._waitingMap.get(key3);if(waitInfo){waitInfo.canProceed.resolve(!1);clearTimeout(waitInfo.timerHandler);this._waitingMap.delete(key3)}this.triggerTakeSnapshot()}_addWaiting(key3,event2,waitedSince){if(this._waitingMap.has(key3))throw new Error(`Already waiting for key: ${key3}`);const resolver2=promiseWithResolvers(),now3=Date.now(),since=null!=waitedSince?waitedSince:now3,elapsed=now3-since,maxDelay=1e3*this.batchSaveMaximumDelay,remainingDelay=Math.max(0,maxDelay-elapsed),nextDelay=Math.min(remainingDelay,1e3*this.batchSaveMinimumDelay);elapsed>=maxDelay?this._log(`Processing ${key3}: Batch save maximum delay already exceeded: ${event2.type}`,LOG_LEVEL_DEBUG):this._log(`Processing ${key3}: Adding waiting for batch save: ${event2.type} (${nextDelay}ms)`,LOG_LEVEL_DEBUG);const waitInfo={since,type:event2.type,event:event2,canProceed:resolver2,timerHandler:setTimeout(()=>{this._log(`Processing ${key3}: Batch save timeout reached: ${event2.type}`,LOG_LEVEL_DEBUG);this._proceedWaiting(key3)},nextDelay)};this._waitingMap.set(key3,waitInfo);this.triggerTakeSnapshot();return waitInfo}async processFileEvent(fei){const releaser=await this.concurrentProcessing.acquire();try{this.updateStatus();const filename=fei.args.file.path,waitingKey=`${filename}`,previous=this._waitingMap.get(waitingKey);let isShouldBeCancelled=fei.skipBatchWait||!1,previousPromise=Promise.resolve(!0),waitPromise=Promise.resolve(!0);if(previous){previousPromise=previous.canProceed.promise;isShouldBeCancelled&&this._log(`Processing ${filename}: Requested to perform immediately, cancelling previous waiting: ${fei.type}`,LOG_LEVEL_DEBUG);if(!isShouldBeCancelled&&"DELETE"===fei.type){this._log(`Processing ${filename}: DELETE requested, cancelling previous waiting: ${fei.type}`,LOG_LEVEL_DEBUG);isShouldBeCancelled=!0}if(!isShouldBeCancelled&&previous.type===fei.type){this._log(`Processing ${filename}: Cancelling previous waiting: ${fei.type}`,LOG_LEVEL_DEBUG);isShouldBeCancelled=!0}if(isShouldBeCancelled){this._cancelWaiting(waitingKey);this._log(`Processing ${filename}: Previous cancelled: ${fei.type}`,LOG_LEVEL_DEBUG);isShouldBeCancelled=!0}if(!isShouldBeCancelled){this._log(`Processing ${filename}: Waiting for previous to complete: ${fei.type}`,LOG_LEVEL_DEBUG);this._proceedWaiting(waitingKey);this._log(`Processing ${filename}: Previous completed: ${fei.type}`,LOG_LEVEL_DEBUG)}}await previousPromise;if(this.shouldBatchSave&&!fei.skipBatchWait){"CREATE"==fei.type||"CHANGED"==fei.type?waitPromise=this._addWaiting(waitingKey,fei,null==previous?void 0:previous.since).canProceed.promise:fei.type;this._log(`Processing ${filename}: Waiting for batch save: ${fei.type}`,LOG_LEVEL_DEBUG);if(!await waitPromise){this._log(`Processing ${filename}: Cancelled by new queue: ${fei.type}`,LOG_LEVEL_DEBUG);return}}await this.requestProcessQueue(fei)}finally{await this._takeSnapshot();releaser()}}async _takeSnapshot(){const snapShot=[...[...this._waitingMap.values()].map(e3=>e3.event),...this.bufferedQueuedItems];await this._saveSnapshot(snapShot);this.updateStatus()}async _restoreFromSnapshot(){const snapShot=await this._loadSnapshot();if(snapShot&&Array.isArray(snapShot)&&snapShot.length>0){this._log(`Restoring storage operation snapshot: ${snapShot.length} items`,LOG_LEVEL_VERBOSE);this.bufferedQueuedItems=snapShot.map(e3=>({...e3,skipBatchWait:!0}));this.updateStatus();await this.runQueuedEvents()}else this._log("No snapshot to restore",LOG_LEVEL_VERBOSE)}runQueuedEvents(){return skipIfDuplicated("storage-event-manager-run-queued-events",async()=>{do{if(0===this.bufferedQueuedItems.length)break;const fei=this.bufferedQueuedItems.shift();await this._takeSnapshot();this.updateStatus();(await this.concurrentProcessing.acquire())();this.updateStatus();if("SENTINEL_FLUSH"!==fei.type)fireAndForget(()=>this.processFileEvent(fei));else{this._log("Waiting for idle",LOG_LEVEL_VERBOSE);await this.waitForIdle();this.updateStatus()}}while(this.bufferedQueuedItems.length>0)})}async requestProcessQueue(fei){try{this.processingCount++;this.updateStatus();await this.handleFileEvent(fei);await this._takeSnapshot()}finally{this.processingCount--;this.updateStatus()}}isWaiting(filename){return isWaitingForTimeout(`storage-event-manager-batchsave-${filename}`)}async handleFileEvent(queue2){const file=queue2.args.file,lockKey=`handleFile:${file.path}`,ret=await serialized(lockKey,async()=>{if(queue2.cancelled)this._log(`File event cancelled before processing: ${file.path}`,LOG_LEVEL_INFO);else if("INTERNAL"==queue2.type||file.isInternal)await this.fileProcessing.processOptionalFileEvent(file.path);else{const last=0;if("DELETE"==queue2.type)await this.fileProcessing.processFileEvent(queue2);else{if(file.stat.mtime==last){this._log(`File has been already scanned on ${queue2.type}, skip: ${file.path}`,LOG_LEVEL_VERBOSE);return}if(!await this.fileProcessing.processFileEvent(queue2)){this._log(`STORAGE -> DB: Handler failed, cancel the relative operations: ${file.path}`,LOG_LEVEL_INFO);this.cancelRelativeEvent(queue2);return}}}});this.updateStatus();return ret}cancelRelativeEvent(item){this._cancelWaiting(item.args.file.path)}async beginWatch(){await this.snapShotRestored;await this.adapter.watch.beginWatch({onCreate:(file,ctx)=>this.watchVaultCreate(file,ctx),onChange:(file,ctx)=>this.watchVaultChange(file,ctx),onDelete:(file,ctx)=>this.watchVaultDelete(file,ctx),onRename:(file,oldPath,ctx)=>this.watchVaultRename(file,oldPath,ctx),onRaw:path2=>this.watchVaultRawEvents(path2),onEditorChange:(editor,info3)=>this.watchEditorChange(editor,info3)})}watchEditorChange(editor,info3){if(!("path"in info3))return;if(!this.shouldBatchSave)return;const file=null==info3?void 0:info3.file;if(!file)return;const path2=this.adapter.typeGuard.isFile(file)?file.path:info3.path;if(!path2)return;if(this.storageAccess.isFileProcessing(path2))return;if(!this.isWaiting(path2))return;const data=null==info3?void 0:info3.data,fi={type:"CHANGED",file:this.adapter.converter.toFileInfo(file),cachedData:data};this.appendQueue([fi])}watchVaultCreate(file,ctx){if(this.adapter.typeGuard.isFolder(file))return;const path2=file.path;if(this.storageAccess.isFileProcessing(path2))return;const fileInfo=this.adapter.converter.toFileInfo(file);this.appendQueue([{type:"CREATE",file:fileInfo}],ctx)}watchVaultChange(file,ctx){if(this.adapter.typeGuard.isFolder(file))return;const path2=file.path;if(this.storageAccess.isFileProcessing(path2))return;const fileInfo=this.adapter.converter.toFileInfo(file);this.appendQueue([{type:"CHANGED",file:fileInfo}],ctx)}watchVaultDelete(file,ctx){if(this.adapter.typeGuard.isFolder(file))return;const path2=file.path;if(this.storageAccess.isFileProcessing(path2))return;const fileInfo=this.adapter.converter.toFileInfo(file,!0);this.appendQueue([{type:"DELETE",file:fileInfo}],ctx)}watchVaultRename(file,oldPath,ctx){if(this.adapter.typeGuard.isFile(file)){const fileInfo=this.adapter.converter.toFileInfo(file);this.appendQueue([{type:"DELETE",file:{path:oldPath,name:fileInfo.name,stat:fileInfo.stat,deleted:!0},skipBatchWait:!0},{type:"CREATE",file:fileInfo,skipBatchWait:!0}],ctx)}}watchVaultRawEvents(path2){this.storageAccess.isFileProcessing(path2)||this.settings&&(this.settings.useIgnoreFiles?this.vaultService.isTargetFile(path2).then(()=>this._watchVaultRawEvents(path2)):this._watchVaultRawEvents(path2))}async _watchVaultRawEvents(path2){}};ObsidianTypeGuardAdapter2=class{isFile(file){return file instanceof import_obsidian.TFile||!(!file||"object"!=typeof file||!("isFolder"in file))&&!file.isFolder}isFolder(item){return item instanceof import_obsidian.TFolder||!(!item||"object"!=typeof item||!("isFolder"in item))&&!!item.isFolder}};ObsidianPersistenceAdapter=class{constructor(core){this.core=core}async saveSnapshot(snapshot2){await this.core.kvDB.set("storage-event-manager-snapshot",snapshot2)}async loadSnapshot(){return await this.core.kvDB.get("storage-event-manager-snapshot")}};ObsidianStatusAdapter=class{constructor(fileProcessing){this.fileProcessing=fileProcessing}updateStatus(status){this.fileProcessing.batched.value=status.batched;this.fileProcessing.processing.value=status.processing;this.fileProcessing.totalQueued.value=status.totalQueued}};ObsidianConverterAdapter=class{toFileInfo(file,deleted){return TFileToUXFileInfoStub(file,deleted)}toInternalFileInfo(path2){return InternalFileToUXFileInfoStub(path2)}};ObsidianWatchAdapter=class{constructor(plugin3){this.plugin=plugin3}beginWatch(handlers3){var _a8;const plugin3=this.plugin,boundHandlers={onCreate:handlers3.onCreate.bind(handlers3),onChange:handlers3.onChange.bind(handlers3),onDelete:handlers3.onDelete.bind(handlers3),onRename:handlers3.onRename.bind(handlers3),onRaw:handlers3.onRaw.bind(handlers3),onEditorChange:null==(_a8=handlers3.onEditorChange)?void 0:_a8.bind(handlers3)};plugin3.registerEvent(plugin3.app.vault.on("create",boundHandlers.onCreate));plugin3.registerEvent(plugin3.app.vault.on("modify",boundHandlers.onChange));plugin3.registerEvent(plugin3.app.vault.on("delete",boundHandlers.onDelete));plugin3.registerEvent(plugin3.app.vault.on("rename",boundHandlers.onRename));plugin3.registerEvent(plugin3.app.vault.on("raw",boundHandlers.onRaw));boundHandlers.onEditorChange&&plugin3.registerEvent(plugin3.app.workspace.on("editor-change",boundHandlers.onEditorChange));return Promise.resolve()}};ObsidianStorageEventManagerAdapter=class{constructor(plugin3,core,fileProcessing){this.typeGuard=new ObsidianTypeGuardAdapter2;this.persistence=new ObsidianPersistenceAdapter(core);this.watch=new ObsidianWatchAdapter(plugin3);this.status=new ObsidianStatusAdapter(fileProcessing);this.converter=new ObsidianConverterAdapter}};StorageEventManagerObsidian=class extends StorageEventManagerBase{constructor(plugin3,core,dependencies){super(new ObsidianStorageEventManagerAdapter(plugin3,core,dependencies.fileProcessing),dependencies);this.core=core}async _watchVaultRawEvents(path2){(this.settings.syncInternalFiles||this.settings.usePluginSync)&&this.settings.watchInternalFileChanges&&path2.startsWith(this.core.services.API.getSystemConfigDir())&&(path2.endsWith("/")||await this.vaultService.isTargetFileInExtra(path2)&&this.appendQueue([{type:"INTERNAL",file:this.adapter.converter.toInternalFileInfo(path2),skipBatchWait:!0}],null))}};ModulePeriodicProcess=class extends AbstractModule{constructor(){super(...arguments);this.periodicSyncProcessor=new PeriodicProcessor(this.core,async()=>await this.services.replication.replicate())}disablePeriodic(){var _a8;null==(_a8=this.periodicSyncProcessor)||_a8.disable();return Promise.resolve(!0)}resumePeriodic(){this.periodicSyncProcessor.enable(this.settings.periodicReplication?1e3*this.settings.periodicReplicationInterval:0);return Promise.resolve(!0)}_allOnUnload(){return this.disablePeriodic()}_everyBeforeRealizeSetting(){return this.disablePeriodic()}_everyBeforeSuspendProcess(){return this.disablePeriodic()}_everyAfterResumeProcess(){return this.resumePeriodic()}_everyAfterRealizeSetting(){return this.resumePeriodic()}onBindFunction(core,services){services.appLifecycle.onUnload.addHandler(this._allOnUnload.bind(this));services.setting.onBeforeRealiseSetting.addHandler(this._everyBeforeRealizeSetting.bind(this));services.setting.onSettingRealised.addHandler(this._everyAfterRealizeSetting.bind(this));services.appLifecycle.onSuspending.addHandler(this._everyBeforeSuspendProcess.bind(this));services.appLifecycle.onResumed.addHandler(this._everyAfterResumeProcess.bind(this))}};ReplicateResultProcessor=class{constructor(replicator){this._suspended=!1;this.triggerTakeSnapshot=throttle(()=>this._triggerTakeSnapshot(),50);this._restoreFromSnapshot=void 0;this._queuedChanges=[];this._processingChanges=[];this._semaphore=Semaphore(10);this._isRunningProcessQueue=!1;this.replicator=replicator}log(message,level=LOG_LEVEL_INFO){Logger(`[ReplicateResultProcessor] ${message}`,level)}logError(e3){Logger(e3,LOG_LEVEL_VERBOSE)}get localDatabase(){return this.replicator.core.localDatabase}get services(){return this.replicator.core.services}get core(){return this.replicator.core}getPath(entry){return this.services.path.getPath(entry)}suspend(){this._suspended=!0}resume(){this._suspended=!1;fireAndForget(()=>this.runProcessQueue())}get isSuspended(){return this._suspended||!this.core.services.appLifecycle.isReady||this.replicator.settings.suspendParseReplicationResult||this.core.services.appLifecycle.isSuspended()}async _takeSnapshot(){const snapshot2={queued:this._queuedChanges.slice(),processing:this._processingChanges.slice()};await this.core.kvDB.set("replicationResultProcessorSnapshot",snapshot2);this.log(`Snapshot taken. Queued: ${snapshot2.queued.length}, Processing: ${snapshot2.processing.length}`,LOG_LEVEL_DEBUG);this.reportStatus()}_triggerTakeSnapshot(){fireAndForget(()=>this._takeSnapshot())}async restoreFromSnapshot(){const snapshot2=await this.core.kvDB.get("replicationResultProcessorSnapshot");if(snapshot2){const newQueue=[...snapshot2.processing,...snapshot2.queued,...this._queuedChanges];this._queuedChanges=[];this.enqueueAll(newQueue);this.log(`Restored from snapshot (${snapshot2.processing.length+snapshot2.queued.length} items)`,LOG_LEVEL_INFO)}}restoreFromSnapshotOnce(){this._restoreFromSnapshot||(this._restoreFromSnapshot=this.restoreFromSnapshot());return this._restoreFromSnapshot}async withCounting(proc,countValue){countValue.value++;try{return await proc()}finally{countValue.value--}}reportStatus(){this.services.replication.replicationResultCount.value=this._queuedChanges.length+this._processingChanges.length}enqueueAll(changes3){for(const change of changes3)this.processIfNonDocumentChange(change)||this.enqueueChange(change)}processIfNonDocumentChange(change){if(!change){this.log("Received empty change",LOG_LEVEL_VERBOSE);return!0}if(isChunk(change._id)){this.localDatabase.onNewLeaf(change);this.log(`Processed chunk: ${shortenId(change._id)}`,LOG_LEVEL_DEBUG);return!0}if("versioninfo"==change.type){this.log(`Version info document received: ${change._id}`,LOG_LEVEL_VERBOSE);if(change.version>12){this.core.replicator.closeReplication();this.log("Remote database updated to incompatible version. update your Self-hosted LiveSync plugin.",LOG_LEVEL_NOTICE)}return!0}if(change._id==SYNCINFO_ID||change._id.startsWith("_design")){this.log(`Skipped system document: ${change._id}`,LOG_LEVEL_VERBOSE);return!0}return!1}enqueueChange(doc){var _a8;const old=this._queuedChanges.find(e3=>e3._id==doc._id),docNote=`${"path"in doc?this.getPath(doc):""} (${shortenId(doc._id)}, ${shortenRev(doc._rev)})`;if(old){if(old._rev==doc._rev){this.log(`[Enqueue] skipped (Already queued): ${docNote}`,LOG_LEVEL_VERBOSE);return}const oldRev=null!=(_a8=old._rev)?_a8:"";if((!0===old._deleted||"deleted"in old&&!0===old.deleted)==(!0===doc._deleted||"deleted"in doc&&!0===doc.deleted)){this._queuedChanges=this._queuedChanges.filter(e3=>e3._id!=doc._id);this.log(`[Enqueue] requeued: ${docNote} (from rev: ${shortenRev(oldRev)})`,LOG_LEVEL_VERBOSE)}}this._queuedChanges.push(doc);this.triggerTakeSnapshot();this.triggerProcessQueue()}triggerProcessQueue(){fireAndForget(()=>this.runProcessQueue())}async runProcessQueue(){if(!this._isRunningProcessQueue&&!this.isSuspended&&0!=this._queuedChanges.length)try{this._isRunningProcessQueue=!0;for(;this._queuedChanges.length>0;){if(this.isSuspended){this.log(`Processing has got suspended. Remaining items in queue: ${this._queuedChanges.length}`,LOG_LEVEL_INFO);break}(await this._semaphore.acquire())();const doc=this._queuedChanges.shift();if(doc){this._processingChanges.push(doc);this.parseDocumentChange(doc)}this.triggerTakeSnapshot()}}finally{this._isRunningProcessQueue=!1}}async parseDocumentChange(change){var _a8;try{if(isAnyNote(change)){const docMtime=null!=(_a8=change.mtime)?_a8:0,maxMTime=this.replicator.settings.maxMTimeForReflectEvents;if(maxMTime>0&&docMtime>maxMTime){const docPath=this.getPath(change);this.log(`Processing ${docPath} has been skipped due to modification time (${new Date(1e3*docMtime).toISOString()}) exceeding the limit`,LOG_LEVEL_INFO);return}}if(await this.services.replication.processVirtualDocument(change))return;if(isAnyNote(change)){const docPath=this.getPath(change);if(!await this.services.vault.isTargetFile(docPath)){this.log(`Skipped: ${docPath}`,LOG_LEVEL_VERBOSE);return}const size=change.size;if(this.services.vault.isFileSizeTooLarge(size)){this.log(`Processing ${docPath} has been skipped due to file size exceeding the limit`,LOG_LEVEL_NOTICE);return}return await this.applyToDatabase(change)}this.log(`Skipped unexpected non-note document: ${change._id}`,LOG_LEVEL_INFO);return}finally{this._processingChanges=this._processingChanges.filter(e3=>e3!==change);this.triggerTakeSnapshot()}}applyToDatabase(doc){return this.withCounting(async()=>{let releaser;try{releaser=await this._semaphore.acquire();await this._applyToDatabase(doc)}catch(e3){this.log("Error while processing replication result",LOG_LEVEL_NOTICE);this.logError(e3)}finally{releaser&&releaser()}},this.services.replication.databaseQueueCount)}_applyToDatabase(doc_){const dbDoc=doc_,path2=this.getPath(dbDoc);return serialized(`replication-process:${dbDoc._id}`,async()=>{const docNote=`${path2} (${shortenId(dbDoc._id)}, ${shortenRev(dbDoc._rev)})`;if(!await this.checkIsChangeRequiredForDatabaseProcessing(dbDoc)){this.log(`Skipped (Not latest): ${docNote}`,LOG_LEVEL_VERBOSE);return}const doc=!0===dbDoc._deleted||"deleted"in dbDoc&&!0===dbDoc.deleted?{...dbDoc,data:""}:await this.localDatabase.getDBEntryFromMeta({...dbDoc},!1,!0);if(doc)if(await this.services.replication.processOptionalSynchroniseResult(dbDoc))this.log(`Processed by other processor: ${docNote}`,LOG_LEVEL_DEBUG);else if(this.services.vault.isValidPath(this.getPath(doc))){await this.applyToStorage(doc);this.log(`Processed: ${docNote}`,LOG_LEVEL_DEBUG)}else this.log(`Unprocessed (Invalid path): ${docNote}`,LOG_LEVEL_VERBOSE);else this.log(`Failed to gather content of ${docNote}`,LOG_LEVEL_NOTICE)})}applyToStorage(entry){return this.withCounting(async()=>{await this.services.replication.processSynchroniseResult(entry)},this.services.replication.storageApplyingCount)}async checkIsChangeRequiredForDatabaseProcessing(dbDoc){var _a8,_b5,_c3,_d2;const path2=this.getPath(dbDoc);try{const savedDoc=await this.localDatabase.getRaw(dbDoc._id,{conflicts:!0,revs_info:!0}),newRev=null!=(_a8=dbDoc._rev)?_a8:"",latestRev=null!=(_b5=savedDoc._rev)?_b5:"",revisions=null!=(_d2=null==(_c3=savedDoc._revs_info)?void 0:_c3.map(e3=>e3.rev))?_d2:[];return!(!(savedDoc._conflicts&&savedDoc._conflicts.length>0)&&newRev!=latestRev&&revisions.indexOf(newRev)>=0)}catch(e3){if("status"in e3&&404==e3.status)return!0;this.log(`Failed to get existing document for ${path2} (${shortenId(dbDoc._id)}, ${shortenRev(dbDoc._rev)}) `,LOG_LEVEL_NOTICE);this.logError(e3);return!1}}};ModuleReplicator=class extends AbstractModule{constructor(){super(...arguments);this.processor=new ReplicateResultProcessor(this);this._unresolvedErrorManager=new UnresolvedErrorManager(this.core.services.appLifecycle)}clearErrors(){this._unresolvedErrorManager.clearErrors()}_everyOnloadAfterLoadSettings(){eventHub.onEvent("file-saved",()=>{this.settings.syncOnSave&&!this.core.services.appLifecycle.isSuspended()&&scheduleTask("perform-replicate-after-save",250,()=>this.services.replication.replicateByEvent())});eventHub.onEvent(EVENT_SETTING_SAVED,setting=>{this.core.settings.suspendParseReplicationResult?this.processor.suspend():this.processor.resume()});return Promise.resolve(!0)}_onReplicatorInitialised(){clearHandlers();return Promise.resolve(!0)}_everyOnDatabaseInitialized(showNotice){fireAndForget(()=>this.processor.restoreFromSnapshotOnce());return Promise.resolve(!0)}async _everyBeforeReplicate(showMessage){await this.processor.restoreFromSnapshotOnce();this.clearErrors();return!0}async cleaned(showMessage){Logger("The remote database has been cleaned.",showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO);await skipIfDuplicated("cleanup",async()=>{var _a8;const message=`The remote database has been cleaned up.\nTo synchronize, this device must be also cleaned up. ${await purgeUnreferencedChunks(this.localDatabase.localDatabase,!0)} chunk(s) will be erased from this device.\nHowever, If there are many chunks to be deleted, maybe fetching again is faster.\nWe will lose the history of this device if we fetch the remote database again.\nEven if you choose to clean up, you will see this option again if you exit Obsidian and then synchronise again.`,ret=await this.core.confirm.confirmWithMessage("Cleaned",message,["Fetch again","Cleanup","Dismiss"],"Dismiss",30);"Fetch again"==ret&&await this.core.rebuilder.$performRebuildDB("localOnly");if("Cleanup"==ret){const replicator=this.services.replicator.getActiveReplicator();if(!(replicator instanceof LiveSyncCouchDBReplicator))return;const remoteDB=await replicator.connectRemoteCouchDBWithSetting(this.settings,this.services.API.isMobile(),!0);if("string"==typeof remoteDB){Logger(remoteDB,LOG_LEVEL_NOTICE);return!1}await purgeUnreferencedChunks(this.localDatabase.localDatabase,!1);this.localDatabase.clearCaches();if(await this.core.replicator.openReplication(this.settings,!1,showMessage,!0)){await balanceChunkPurgedDBs(this.localDatabase.localDatabase,remoteDB.db);await purgeUnreferencedChunks(this.localDatabase.localDatabase,!1);this.localDatabase.clearCaches();await(null==(_a8=this.services.replicator.getActiveReplicator())?void 0:_a8.markRemoteResolved(this.settings));Logger("The local database has been cleaned up.",showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO)}else Logger("Replication has been cancelled. Please try it again.",showMessage?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO)}})}async onReplicationFailed(showMessage=!1){const activeReplicator=this.services.replicator.getActiveReplicator();if(!activeReplicator){Logger("No active replicator found",LOG_LEVEL_INFO);return!1}if(activeReplicator.tweakSettingsMismatched&&activeReplicator.preferredTweakValue)await this.services.tweakValue.askResolvingMismatched(activeReplicator.preferredTweakValue);else if(activeReplicator.remoteLockedAndDeviceNotAccepted)if(activeReplicator.remoteCleaned&&this.settings.useIndexedDBAdapter)await this.cleaned(showMessage);else{const message=$msg("Replicator.Dialogue.Locked.Message"),CHOICE_FETCH=$msg("Replicator.Dialogue.Locked.Action.Fetch"),CHOICE_DISMISS=$msg("Replicator.Dialogue.Locked.Action.Dismiss"),CHOICE_UNLOCK=$msg("Replicator.Dialogue.Locked.Action.Unlock"),ret=await this.core.confirm.askSelectStringDialogue(message,[CHOICE_FETCH,CHOICE_UNLOCK,CHOICE_DISMISS],{title:$msg("Replicator.Dialogue.Locked.Title"),defaultAction:CHOICE_DISMISS,timeout:60});if(ret==CHOICE_FETCH){this._log($msg("Replicator.Dialogue.Locked.Message.Fetch"),LOG_LEVEL_NOTICE);await this.core.rebuilder.scheduleFetch();this.services.appLifecycle.scheduleRestart();return!1}if(ret==CHOICE_UNLOCK){await activeReplicator.markRemoteResolved(this.settings);this._log($msg("Replicator.Dialogue.Locked.Message.Unlocked"),LOG_LEVEL_NOTICE);return!1}}return!1}_parseReplicationResult(docs){this.processor.enqueueAll(docs);return Promise.resolve(!0)}onBindFunction(core,services){services.replicator.onReplicatorInitialised.addHandler(this._onReplicatorInitialised.bind(this));services.databaseEvents.onDatabaseInitialised.addHandler(this._everyOnDatabaseInitialized.bind(this));services.appLifecycle.onSettingLoaded.addHandler(this._everyOnloadAfterLoadSettings.bind(this));services.replication.parseSynchroniseResult.addHandler(this._parseReplicationResult.bind(this));const isOnlineAndCanReplicateWithHost=isOnlineAndCanReplicate.bind(null,this._unresolvedErrorManager,{services:{API:services.API},serviceModules:{}}),canReplicateWithPBKDF2WithHost=canReplicateWithPBKDF2.bind(null,this._unresolvedErrorManager,{services:{replicator:services.replicator,setting:services.setting},serviceModules:{}});services.replication.onBeforeReplicate.addHandler(isOnlineAndCanReplicateWithHost,10);services.replication.onBeforeReplicate.addHandler(canReplicateWithPBKDF2WithHost,20);services.replication.onBeforeReplicate.addHandler(this._everyBeforeReplicate.bind(this),100);services.replication.onReplicationFailed.addHandler(this.onReplicationFailed.bind(this))}};ModuleReplicatorCouchDB=class extends AbstractModule{_anyNewReplicator(settingOverride={}){const settings={...this.settings,...settingOverride};return settings.remoteType==REMOTE_MINIO||settings.remoteType==REMOTE_P2P?Promise.resolve(!1):Promise.resolve(new LiveSyncCouchDBReplicator(this.core))}_everyAfterResumeProcess(){if(this.services.appLifecycle.isSuspended())return Promise.resolve(!0);if(!this.services.appLifecycle.isReady())return Promise.resolve(!0);if(this.settings.remoteType!=REMOTE_MINIO&&this.settings.remoteType!=REMOTE_P2P){const LiveSyncEnabled=this.settings.liveSync,continuous=LiveSyncEnabled,eventualOnStart=!LiveSyncEnabled&&this.settings.syncOnStart;(LiveSyncEnabled||eventualOnStart)&&fireAndForget(async()=>{await this.services.replication.isReplicationReady(!1)&&this.core.replicator.openReplication(this.settings,continuous,!1,!1)})}return Promise.resolve(!0)}onBindFunction(core,services){services.replicator.getNewReplicator.addHandler(this._anyNewReplicator.bind(this));services.appLifecycle.onResumed.addHandler(this._everyAfterResumeProcess.bind(this))}};MILSTONE_DOCID="_00000000-milestone.json";currentVersionRange2={min:0,max:2,current:2};LiveSyncJournalReplicator=class extends LiveSyncAbstractReplicator{get isChunkSendingSupported(){return!1}get client(){return this.setupJournalSyncClient()}get simpleStore(){return this.env.services.keyValueDB.simpleStore}async getReplicationPBKDF2Salt(setting,refresh){return await this.client.getReplicationPBKDF2Salt(refresh)}setupJournalSyncClient(){const settings=this.currentSettings;this._client?this._client.applyNewConfig(settings,this.simpleStore,this.env):this._client=new JournalSyncMinio(settings,this.simpleStore,this.env);return this._client}async ensureBucketIsCompatible(deviceNodeID,currentVersionRange3){const downloadedMilestone=await this.client.downloadJson(MILSTONE_DOCID),cPointInfo=await this.client.getCheckpointInfo(),progress=[...(null==cPointInfo?void 0:cPointInfo.receivedFiles)||[]].sort().pop()||"";return await ensureRemoteIsCompatible(downloadedMilestone,this.currentSettings,deviceNodeID,currentVersionRange3,{app_version:this.env.services.API.getAppVersion(),plugin_version:this.env.services.API.getPluginVersion(),vault_name:this.env.services.vault.vaultName(),device_name:this.env.services.vault.getVaultName(),progress},async info3=>{await this.client.uploadJson(MILSTONE_DOCID,info3)})}constructor(env){super(env);this.env=env;fireAndForget(()=>this.initializeDatabaseForReplication());this.rawDatabase.on("close",()=>{this.closeReplication()})}async migrate(from,to){Logger(`Database updated from ${from} to ${to}`,LOG_LEVEL_NOTICE);return Promise.resolve(!0)}terminateSync(){this.client.requestStop()}async openReplication(setting,_,showResult,ignoreCleanLock=!1){if(!await this.checkReplicationConnectivity(!1,ignoreCleanLock,showResult))return!1;await this.client.sync(showResult);return!0}async replicateAllToServer(setting,showingNotice){return!!await this.checkReplicationConnectivity(!1,!1,!!showingNotice)&&await this.client.sendLocalJournal(showingNotice)}async replicateAllFromServer(setting,showingNotice){return!!await this.checkReplicationConnectivity(!1,!1,!!showingNotice)&&await this.client.receiveRemoteJournal(showingNotice)}async checkReplicationConnectivity(skipCheck,ignoreCleanLock=!1,showMessage=!1){if(!await this.client.isAvailable())return!1;if(!skipCheck){await this.client.ensureCheckpointCachesAreFresh();this.remoteCleaned=!1;this.remoteLocked=!1;this.remoteLockedAndDeviceNotAccepted=!1;this.tweakSettingsMismatched=!1;const ensure=await this.ensureBucketIsCompatible(this.nodeid,currentVersionRange2);if("INCOMPATIBLE"==ensure){Logger("The remote database has no compatibility with the running version. Please upgrade the plugin.",LOG_LEVEL_NOTICE);return!1}if("NODE_LOCKED"==ensure){Logger("The remote database has been rebuilt or corrupted since we have synchronized last time. Fetch rebuilt DB, explicit unlocking or chunk clean-up is required.",LOG_LEVEL_NOTICE);this.remoteLockedAndDeviceNotAccepted=!0;this.remoteLocked=!0;return!1}if("LOCKED"==ensure)this.remoteLocked=!0;else if("NODE_CLEANED"==ensure){if(!ignoreCleanLock){Logger("The remote database has been cleaned up. Fetch rebuilt DB, explicit unlocking or chunk clean-up is required.",LOG_LEVEL_NOTICE);this.remoteLockedAndDeviceNotAccepted=!0;this.remoteLocked=!0;this.remoteCleaned=!0;return!1}this.remoteLocked=!0}else if("OK"==ensure);else if("MISMATCHED"==ensure[0]){Logger("Configuration mismatching between the clients has been detected. This can be harmful or extra capacity consumption. We have to make these value unified. When replication is initiated manually via the command palette or ribbon, a dialogue box will open to address this.",LOG_LEVEL_NOTICE);this.tweakSettingsMismatched=!0;this.preferredTweakValue=ensure[1];return!1}}return!0}async fetchRemoteChunks(missingChunks,showResult){return Promise.resolve([])}closeReplication(){this.client.requestStop();this.syncStatus="CLOSED";Logger("Replication closed");this.updateInfo()}async tryResetRemoteDatabase(setting){this.closeReplication();try{await this.client.resetBucket();clearHandlers();Logger("Remote Bucket Cleared",LOG_LEVEL_NOTICE);await this.tryCreateRemoteDatabase(setting)}catch(ex){Logger("Something happened on Remote Bucket Clear",LOG_LEVEL_NOTICE);Logger(ex,LOG_LEVEL_NOTICE)}}async tryCreateRemoteDatabase(setting){this.closeReplication();Logger("Remote Database Created or Connected",LOG_LEVEL_NOTICE);clearHandlers();await this.ensurePBKDF2Salt(setting,!0,!1);return await Promise.resolve()}async markRemoteLocked(setting,locked,lockByClean){const defInitPoint={_id:MILSTONE_DOCID,type:"milestoneinfo",created:new Date/1,locked,cleaned:lockByClean,accepted_nodes:[this.nodeid],node_chunk_info:{[this.nodeid]:currentVersionRange2},node_info:{},tweak_values:{}},remoteMilestone={...defInitPoint,...await this.client.downloadJson(MILSTONE_DOCID)||{}};remoteMilestone.node_chunk_info={...defInitPoint.node_chunk_info,...remoteMilestone.node_chunk_info};remoteMilestone.accepted_nodes=[this.nodeid];remoteMilestone.locked=locked;remoteMilestone.cleaned=remoteMilestone.cleaned||lockByClean;Logger(locked?"Lock remote bucket to prevent data corruption":"Unlock remote bucket to prevent data corruption",LOG_LEVEL_NOTICE);await this.client.uploadJson(MILSTONE_DOCID,remoteMilestone)}async markRemoteResolved(setting){const defInitPoint={_id:MILSTONE_DOCID,type:"milestoneinfo",created:new Date/1,locked:!1,accepted_nodes:[this.nodeid],node_chunk_info:{[this.nodeid]:currentVersionRange2},node_info:{},tweak_values:{}},remoteMilestone={...defInitPoint,...await this.client.downloadJson(MILSTONE_DOCID)||{}};remoteMilestone.node_chunk_info={...defInitPoint.node_chunk_info,...remoteMilestone.node_chunk_info};remoteMilestone.accepted_nodes=Array.from(new Set([...remoteMilestone.accepted_nodes,this.nodeid]));Logger("Mark this device as 'resolved'.",LOG_LEVEL_NOTICE);await this.client.uploadJson(MILSTONE_DOCID,remoteMilestone)}async tryConnectRemote(setting,showResult=!0){const endpoint=setting.endpoint,testClient=new JournalSyncMinio(setting,this.simpleStore,this.env);try{await testClient.listFiles("",1);Logger(`Connected to ${endpoint} successfully!`,LOG_LEVEL_NOTICE);return!0}catch(ex){Logger(`Error! Could not connected to ${endpoint}\n${ex.message}`,LOG_LEVEL_NOTICE);Logger(ex,LOG_LEVEL_NOTICE);return!1}}async resetRemoteTweakSettings(setting){try{const remoteMilestone=await this.client.downloadJson(MILSTONE_DOCID);if(!remoteMilestone)throw new Error("Missing remote milestone");remoteMilestone.tweak_values={};Logger("tweak values on the remote database have been cleared",LOG_LEVEL_VERBOSE);await this.client.uploadJson(MILSTONE_DOCID,remoteMilestone)}catch(ex){Logger("Could not retrieve remote milestone",LOG_LEVEL_NOTICE);throw ex}}async setPreferredRemoteTweakSettings(setting){try{const remoteMilestone=await this.client.downloadJson(MILSTONE_DOCID);if(!remoteMilestone)throw new Error("Missing remote milestone");remoteMilestone.tweak_values[DEVICE_ID_PREFERRED]=extractObject(TweakValuesTemplate,{...setting});Logger("tweak values on the remote database have been cleared",LOG_LEVEL_VERBOSE);await this.client.uploadJson(MILSTONE_DOCID,remoteMilestone)}catch(ex){Logger("Could not retrieve remote milestone",LOG_LEVEL_NOTICE);throw ex}}async getRemotePreferredTweakValues(setting){var _a8;try{const remoteMilestone=await this.client.downloadJson(MILSTONE_DOCID);if(!remoteMilestone)throw new Error("Missing remote milestone");return(null==(_a8=null==remoteMilestone?void 0:remoteMilestone.tweak_values)?void 0:_a8[DEVICE_ID_PREFERRED])||!1}catch(ex){Logger("Could not retrieve remote milestone",LOG_LEVEL_NOTICE);Logger(ex,LOG_LEVEL_VERBOSE);return!1}}async getRemoteStatus(setting){const testClient=new JournalSyncMinio(setting,this.simpleStore,this.env);return await testClient.getUsage()}countCompromisedChunks(){Logger("Bucket Sync Replicator cannot count compromised chunks",LOG_LEVEL_VERBOSE);return Promise.resolve(0)}getConnectedDeviceList(setting){return Promise.resolve(!1)}};ModuleReplicatorMinIO=class extends AbstractModule{_anyNewReplicator(settingOverride={}){return{...this.settings,...settingOverride}.remoteType==REMOTE_MINIO?Promise.resolve(new LiveSyncJournalReplicator(this.core)):Promise.resolve(!1)}onBindFunction(core,services){services.replicator.getNewReplicator.addHandler(this._anyNewReplicator.bind(this))}};ModuleConflictChecker=class extends AbstractModule{constructor(){super(...arguments);this.conflictResolveQueue=new QueueProcessor(async filenames=>{const filename=filenames[0];return await this.services.conflict.resolve(filename)},{suspended:!1,batchSize:1,concurrentLimit:10,delay:0,keepResultUntilDownstreamConnected:!1}).replaceEnqueueProcessor((queue2,newEntity)=>{sendValue("cancel-resolve-conflict:"+newEntity,!0);return[...[...queue2].filter(e3=>e3!=newEntity),newEntity]});this.conflictCheckQueue=new QueueProcessor(files=>{const filename=files[0];return Promise.resolve([filename])},{suspended:!1,batchSize:1,concurrentLimit:10,delay:0,keepResultUntilDownstreamConnected:!0,pipeTo:this.conflictResolveQueue,totalRemainingReactiveSource:this.services.conflict.conflictProcessQueueCount})}async _queueConflictCheckIfOpen(file){const path2=file;if(this.settings.checkConflictOnlyOnOpen){const af2=this.services.vault.getActiveFilePath();if(af2&&af2!=path2){this._log(`${file} is conflicted, merging process has been postponed.`,LOG_LEVEL_NOTICE);return}}await this.services.conflict.queueCheckFor(path2)}async _queueConflictCheck(file){const optionalConflictResult=await this.services.conflict.getOptionalConflictCheckMethod(file);1!=optionalConflictResult&&("newer"===optionalConflictResult?await this.services.conflict.resolveByNewest(file):this.conflictCheckQueue.enqueue(file))}_waitForAllConflictProcessed(){return this.conflictResolveQueue.waitForAllProcessed()}onBindFunction(core,services){services.conflict.queueCheckForIfOpen.setHandler(this._queueConflictCheckIfOpen.bind(this));services.conflict.queueCheckFor.setHandler(this._queueConflictCheck.bind(this));services.conflict.ensureAllProcessed.setHandler(this._waitForAllConflictProcessed.bind(this))}};import_diff_match_patch4=__toESM(require_diff_match_patch(),1);ModuleConflictResolver=class extends AbstractModule{async _resolveConflictByDeletingRev(path2,deleteRevision,subTitle=""){const title=`Resolving ${subTitle?`[${subTitle}]`:""}:`;if(!await this.core.fileHandler.deleteRevisionFromDB(path2,deleteRevision)){this._log(`${title} Could not delete conflicted revision ${displayRev(deleteRevision)} of ${path2}`,LOG_LEVEL_NOTICE);return MISSING_OR_ERROR}eventHub.emitEvent("conflict-cancelled",path2);this._log(`${title} Conflicted revision has been deleted ${displayRev(deleteRevision)} ${path2}`,LOG_LEVEL_INFO);if(0!=(await this.core.databaseFileAccess.getConflictedRevs(path2)).length){this._log(`${title} some conflicts are left in ${path2}`,LOG_LEVEL_INFO);return AUTO_MERGED}if(isPluginMetadata(path2)||isCustomisationSyncMetadata(path2)){this._log(`${title} ${path2} is a plugin metadata file, no need to write to storage`,LOG_LEVEL_INFO);return AUTO_MERGED}if(!await this.core.fileHandler.dbToStorage(path2,stripAllPrefixes(path2),!0)){this._log(`Could not write the resolved content to the storage: ${path2}`,LOG_LEVEL_NOTICE);return MISSING_OR_ERROR}const level=-1!==subTitle.indexOf("same")?LOG_LEVEL_INFO:LOG_LEVEL_NOTICE;this._log(`${path2} has been merged automatically`,level);return AUTO_MERGED}async checkConflictAndPerformAutoMerge(path2){const ret=await this.localDatabase.tryAutoMerge(path2,!this.settings.disableMarkdownAutoMerge);if("ok"in ret)return ret.ok;if("result"in ret){const p2=ret.result;if(!await this.core.databaseFileAccess.storeContent(path2,p2)){this._log(`Merged content cannot be stored:${path2}`,LOG_LEVEL_NOTICE);return MISSING_OR_ERROR}return await this.services.conflict.resolveByDeletingRevision(path2,ret.conflictedRev,"Sensible")}const{rightRev,leftLeaf,rightLeaf}=ret;if(0==leftLeaf){this._log(`could not get current revisions:${path2}`,LOG_LEVEL_NOTICE);return MISSING_OR_ERROR}if(0==rightLeaf)return await this.services.conflict.resolveByDeletingRevision(path2,rightRev,"MISSING OLD REV");const isSame=leftLeaf.data==rightLeaf.data&&leftLeaf.deleted==rightLeaf.deleted,isBinary=!isPlainText(path2),alwaysNewer=this.settings.resolveConflictsByNewerFile;if(isSame||isBinary||alwaysNewer){let loser=leftLeaf;compareMTime(leftLeaf.mtime,rightLeaf.mtime)!=TARGET_IS_NEW&&(loser=rightLeaf);const subTitle=[isSame?"same":"",isBinary?"binary":"",alwaysNewer?"alwaysNewer":""].filter(e3=>e3.trim()).join(",");return await this.services.conflict.resolveByDeletingRevision(path2,loser.rev,subTitle)}const dmp=new import_diff_match_patch4.default,diff=dmp.diff_main(leftLeaf.data,rightLeaf.data);dmp.diff_cleanupSemantic(diff);this._log(`conflict(s) found:${path2}`);return{left:leftLeaf,right:rightLeaf,diff}}async _resolveConflict(filename){return await serialized(`conflict-resolve:${filename}`,async()=>{const conflictCheckResult=await this.checkConflictAndPerformAutoMerge(filename);if(conflictCheckResult!==MISSING_OR_ERROR&&conflictCheckResult!==NOT_CONFLICTED&&conflictCheckResult!==CANCELLED)if(conflictCheckResult!==AUTO_MERGED){if(this.settings.showMergeDialogOnlyOnActive){const af2=this.services.vault.getActiveFilePath();if(af2&&af2!=filename){this._log(`[conflict] ${filename} is conflicted. Merging process has been postponed to the file have got opened.`,LOG_LEVEL_NOTICE);return}}this._log("[conflict] Manual merge required!");eventHub.emitEvent("conflict-cancelled",filename);await this.services.conflict.resolveByUserInteraction(filename,conflictCheckResult)}else{this.settings.syncAfterMerge&&!this.services.appLifecycle.isSuspended()&&await this.services.replication.replicateByEvent();this._log("[conflict] Automatically merged, but we have to check it again");await this.services.conflict.queueCheckFor(filename)}else this._log(`[conflict] Not conflicted or cancelled: ${filename}`,LOG_LEVEL_VERBOSE)})}async _anyResolveConflictByNewest(filename){const currentRev=await this.core.databaseFileAccess.fetchEntryMeta(filename,void 0,!0);if(0==currentRev){this._log(`Could not get current revision of ${filename}`);return Promise.resolve(!1)}const revs=await this.core.databaseFileAccess.getConflictedRevs(filename);if(0==revs.length)return Promise.resolve(!0);const mTimeAndRev=[[currentRev.mtime,currentRev._rev],...await Promise.all(revs.map(async rev3=>{const leaf=await this.core.databaseFileAccess.fetchEntryMeta(filename,rev3);return 0==leaf?[0,rev3]:[leaf.mtime,rev3]}))].sort((a2,b3)=>{const diff=b3[0]-a2[0];return 0==diff?a2[1].localeCompare(b3[1],"en",{numeric:!0}):diff});this._log(`Resolving conflict by newest: ${filename} (Newest: ${new Date(mTimeAndRev[0][0]).toLocaleString()}) (${mTimeAndRev.length} revisions exists)`);for(let i2=1;i2v2).join("\n")}),CHOICE_USE_REMOTE=$msg("TweakMismatchResolve.Action.UseRemote"),CHOICE_USE_REMOTE_WITH_REBUILD=$msg("TweakMismatchResolve.Action.UseRemoteWithRebuild"),CHOICE_USE_REMOTE_PREVENT_REBUILD=$msg("TweakMismatchResolve.Action.UseRemoteAcceptIncompatible"),CHOICE_USE_MINE=$msg("TweakMismatchResolve.Action.UseMine"),CHOICE_USE_MINE_WITH_REBUILD=$msg("TweakMismatchResolve.Action.UseMineWithRebuild"),CHOICE_USE_MINE_PREVENT_REBUILD=$msg("TweakMismatchResolve.Action.UseMineAcceptIncompatible"),CHOICE_DISMISS=$msg("TweakMismatchResolve.Action.Dismiss"),CHOICE_AND_VALUES=[];if(rebuildRequired){CHOICE_AND_VALUES.push([CHOICE_USE_REMOTE_WITH_REBUILD,[preferred,!0]]);CHOICE_AND_VALUES.push([CHOICE_USE_MINE_WITH_REBUILD,[!0,!0]]);CHOICE_AND_VALUES.push([CHOICE_USE_REMOTE_PREVENT_REBUILD,[preferred,!1]]);CHOICE_AND_VALUES.push([CHOICE_USE_MINE_PREVENT_REBUILD,[!0,!1]])}else if(rebuildRecommended){CHOICE_AND_VALUES.push([CHOICE_USE_REMOTE,[preferred,!1]]);CHOICE_AND_VALUES.push([CHOICE_USE_MINE,[!0,!1]]);CHOICE_AND_VALUES.push([CHOICE_USE_REMOTE_WITH_REBUILD,[!0,!0]]);CHOICE_AND_VALUES.push([CHOICE_USE_MINE_WITH_REBUILD,[!0,!0]])}else{CHOICE_AND_VALUES.push([CHOICE_USE_REMOTE,[preferred,!1]]);CHOICE_AND_VALUES.push([CHOICE_USE_MINE,[!0,!1]])}CHOICE_AND_VALUES.push([CHOICE_DISMISS,[!1,!1]]);const CHOICES=Object.fromEntries(CHOICE_AND_VALUES),retKey=await this.core.confirm.askSelectStringDialogue(message,Object.keys(CHOICES),{title:$msg("TweakMismatchResolve.Title.TweakResolving"),timeout:60,defaultAction:CHOICE_DISMISS});return retKey?CHOICES[retKey]:[!1,!1]}async _askResolvingMismatchedTweaks(){if(!this.core.replicator.tweakSettingsMismatched)return"OK";const tweaks=this.core.replicator.preferredTweakValue;if(!tweaks)return"IGNORE";const preferred=extractObject(TweakValuesShouldMatchedTemplate,tweaks),[conf,rebuildRequired]=await this.services.tweakValue.checkAndAskResolvingMismatched(preferred);if(!conf)return"IGNORE";if(!0===conf){await this.core.replicator.setPreferredRemoteTweakSettings(this.settings);rebuildRequired&&await this.core.rebuilder.$rebuildRemote();Logger("Tweak values on the remote server have been updated. Your other device will see this message.",LOG_LEVEL_NOTICE);return"CHECKAGAIN"}if(conf){this.settings={...this.settings,...conf};await this.core.replicator.setPreferredRemoteTweakSettings(this.settings);await this.services.setting.saveSettingData();rebuildRequired&&await this.core.rebuilder.$fetchLocal();Logger("Configuration has been updated as configured by the other device.",LOG_LEVEL_NOTICE);return"CHECKAGAIN"}return"IGNORE"}async _fetchRemotePreferredTweakValues(trialSetting){const replicator=await this.services.replicator.getNewReplicator(trialSetting);if(!replicator){this._log("The remote type is not supported for fetching preferred tweak values.",LOG_LEVEL_NOTICE);return!1}if(await replicator.tryConnectRemote(trialSetting)){const preferred=await replicator.getRemotePreferredTweakValues(trialSetting);if(preferred)return preferred;this._log("Failed to get the preferred tweak values from the remote server.",LOG_LEVEL_NOTICE);return!1}this._log("Failed to connect to the remote server.",LOG_LEVEL_NOTICE);return!1}async _checkAndAskUseRemoteConfiguration(trialSetting){const preferred=await this.services.tweakValue.fetchRemotePreferred(trialSetting);return preferred?await this.services.tweakValue.askUseRemoteConfiguration(trialSetting,preferred):{result:!1,requireFetch:!1}}async _askUseRemoteConfiguration(trialSetting,preferred){const items=Object.entries(TweakValuesShouldMatchedTemplate);let rebuildRequired=!1,rebuildRecommended=!1,differenceCount=0;const tableRows=[];for(const v2 of items){const key3=v2[0],remoteValueForDisplay=escapeMarkdownValue(preferred[key3]),currentValueForDisplay=`${escapeMarkdownValue(null==trialSetting?void 0:trialSetting[key3])}`;if((null==trialSetting?void 0:trialSetting[key3])!==preferred[key3]){-1!==IncompatibleChanges.indexOf(key3)&&(rebuildRequired=!0);for(const pattern of IncompatibleChangesInSpecificPattern){if(pattern.key!==key3)continue;const isFromConditionMet="from"in pattern&&pattern.from===(null==trialSetting?void 0:trialSetting[key3]),isToConditionMet="to"in pattern&&pattern.to===preferred[key3];(isFromConditionMet||isToConditionMet)&&(pattern.isRecommendation?rebuildRecommended=!0:rebuildRequired=!0)}-1!==CompatibleButLossyChanges.indexOf(key3)&&(rebuildRecommended=!0);tableRows.push($msg("TweakMismatchResolve.Table.Row",{name:confName(key3),self:currentValueForDisplay,remote:remoteValueForDisplay}));differenceCount++}}if(0===differenceCount){this._log("The settings in the remote database are the same as the local database.",LOG_LEVEL_NOTICE);return{result:!1,requireFetch:!1}}const additionalMessage=rebuildRequired&&this.core.settings.isConfigured?$msg("TweakMismatchResolve.Message.UseRemote.WarningRebuildRequired"):"",additionalMessage2=rebuildRecommended&&this.core.settings.isConfigured?$msg("TweakMismatchResolve.Message.UseRemote.WarningRebuildRecommended"):"",table2=$msg("TweakMismatchResolve.Table",{rows:tableRows.join("\n")}),message=$msg("TweakMismatchResolve.Message.Main",{table:table2,additionalMessage:[additionalMessage,additionalMessage2].filter(v2=>v2).join("\n")}),CHOICE_USE_REMOTE=$msg("TweakMismatchResolve.Action.UseConfigured"),CHOICE_DISMISS=$msg("TweakMismatchResolve.Action.Dismiss"),CHOICES=[CHOICE_USE_REMOTE,CHOICE_DISMISS],retKey=await this.core.confirm.askSelectStringDialogue(message,CHOICES,{title:$msg("TweakMismatchResolve.Title.UseRemoteConfig"),timeout:0,defaultAction:CHOICE_DISMISS});return retKey?retKey===CHOICE_DISMISS?{result:!1,requireFetch:!1}:retKey===CHOICE_USE_REMOTE?{result:{...trialSetting,...preferred},requireFetch:rebuildRequired}:{result:!1,requireFetch:!1}:{result:!1,requireFetch:!1}}onBindFunction(core,services){services.tweakValue.fetchRemotePreferred.setHandler(this._fetchRemotePreferredTweakValues.bind(this));services.tweakValue.checkAndAskResolvingMismatched.setHandler(this._checkAndAskResolvingMismatchedTweaks.bind(this));services.tweakValue.askResolvingMismatched.setHandler(this._askResolvingMismatchedTweaks.bind(this));services.tweakValue.checkAndAskUseRemoteConfiguration.setHandler(this._checkAndAskUseRemoteConfiguration.bind(this));services.tweakValue.askUseRemoteConfiguration.setHandler(this._askUseRemoteConfiguration.bind(this));services.replication.checkConnectionFailure.addHandler(this._anyAfterConnectCheckFailed.bind(this))}};ModuleLiveSyncMain=class extends AbstractModule{async _onLiveSyncReady(){if(!await this.core.services.appLifecycle.onLayoutReady())return!1;eventHub.emitEvent(EVENT_LAYOUT_READY);if(this.settings.suspendFileWatching||this.settings.suspendParseReplicationResult){const ANSWER_KEEP=$msg("moduleLiveSyncMain.optionKeepLiveSyncDisabled"),ANSWER_RESUME=$msg("moduleLiveSyncMain.optionResumeAndRestart"),message=$msg("moduleLiveSyncMain.msgScramEnabled",{fileWatchingStatus:this.settings.suspendFileWatching?"suspended":"active",parseReplicationStatus:this.settings.suspendParseReplicationResult?"suspended":"active"});if(await this.core.confirm.askSelectStringDialogue(message,[ANSWER_KEEP,ANSWER_RESUME],{defaultAction:ANSWER_KEEP,title:$msg("moduleLiveSyncMain.titleScramEnabled")})==ANSWER_RESUME){this.settings.suspendFileWatching=!1;this.settings.suspendParseReplicationResult=!1;await this.saveSettings();this.services.appLifecycle.scheduleRestart();return!1}}if(!await this.services.databaseEvents.initialiseDatabase(!1,!1))return!1;if(!await this.core.services.appLifecycle.onFirstInitialise())return!1;await this.services.control.applySettings();fireAndForget(async()=>{this._log($msg("moduleLiveSyncMain.logAdditionalSafetyScan"),LOG_LEVEL_VERBOSE);await this.services.appLifecycle.onScanningStartupIssues()?this._log($msg("moduleLiveSyncMain.logSafetyScanCompleted"),LOG_LEVEL_VERBOSE):this._log($msg("moduleLiveSyncMain.logSafetyScanFailed"),LOG_LEVEL_NOTICE)});return!0}_wireUpEvents(){eventHub.onEvent(EVENT_SETTING_SAVED,settings=>{fireAndForget(async()=>{var _a8,_b5,_c3;try{await this.core.services.control.applySettings();void 0!==(null!=(_b5=null==(_a8=this.core.services.setting.currentSettings())?void 0:_a8.displayLanguage)?_b5:void 0)&&setLang(null==(_c3=this.core.services.setting.currentSettings())?void 0:_c3.displayLanguage);eventHub.emitEvent("reload-setting-tab")}catch(e3){this._log("Error in Setting Save Event",LOG_LEVEL_NOTICE);this._log(e3,LOG_LEVEL_VERBOSE)}})});return Promise.resolve(!0)}async _onLiveSyncLoad(){initialiseWorkerModule();await this.services.appLifecycle.onWireUpEvents();eventHub.emitEvent("plugin-loaded");this._log($msg("moduleLiveSyncMain.logLoadingPlugin"));if(!await this.services.appLifecycle.onInitialise()){this._log($msg("moduleLiveSyncMain.logPluginInitCancelled"),LOG_LEVEL_NOTICE);return!1}this._log($msg("moduleLiveSyncMain.logPluginVersion",{manifestVersion:"0.25.57",packageVersion:"0.25.57"}));await this.services.setting.loadSettings();if(!await this.services.appLifecycle.onSettingLoaded()){this._log($msg("moduleLiveSyncMain.logPluginInitCancelled"),LOG_LEVEL_NOTICE);return!1}const lsKey="obsidian-live-sync-ver"+this.services.vault.getVaultName(),last_version=localStorage.getItem(lsKey);~~(versionNumberString2Number("0.25.57")/1e3)>this.settings.lastReadUpdates&&this.settings.isConfigured&&this._log($msg("moduleLiveSyncMain.logReadChangelog"),LOG_LEVEL_NOTICE);if(last_version&&Number(last_version)<12){this.settings.liveSync=!1;this.settings.syncOnSave=!1;this.settings.syncOnEditorSave=!1;this.settings.syncOnStart=!1;this.settings.syncOnFileOpen=!1;this.settings.syncAfterMerge=!1;this.settings.periodicReplication=!1;this.settings.versionUpFlash=$msg("moduleLiveSyncMain.logVersionUpdate");await this.saveSettings()}localStorage.setItem(lsKey,"12");await this.services.database.openDatabase({databaseEvents:this.services.databaseEvents,replicator:this.services.replicator});await this.core.services.appLifecycle.onLoaded();await Promise.all(this.core.addOns.map(e3=>e3.onload()));return!0}onBindFunction(core,services){super.onBindFunction(core,services);services.appLifecycle.onReady.addHandler(this._onLiveSyncReady.bind(this));services.appLifecycle.onWireUpEvents.addHandler(this._wireUpEvents.bind(this));services.appLifecycle.onLoad.addHandler(this._onLiveSyncLoad.bind(this))}};ModuleBasicMenu=class extends AbstractModule{_everyOnloadStart(){this.addCommand({id:"livesync-replicate",name:"Replicate now",callback:async()=>{await this.services.replication.replicate()}});this.addCommand({id:"livesync-dump",name:"Dump information of this doc ",callback:()=>{const file=this.services.vault.getActiveFilePath();file&&fireAndForget(()=>this.localDatabase.getDBEntry(file,{},!0,!1))}});this.addCommand({id:"livesync-toggle",name:"Toggle LiveSync",callback:async()=>{if(this.settings.liveSync){this.settings.liveSync=!1;this._log("LiveSync Disabled.",LOG_LEVEL_NOTICE)}else{this.settings.liveSync=!0;this._log("LiveSync Enabled.",LOG_LEVEL_NOTICE)}await this.services.control.applySettings();await this.services.setting.saveSettingData()}});this.addCommand({id:"livesync-suspendall",name:"Toggle All Sync.",callback:async()=>{if(this.services.appLifecycle.isSuspended()){this.services.appLifecycle.setSuspended(!1);this._log("Self-hosted LiveSync resumed",LOG_LEVEL_NOTICE)}else{this.services.appLifecycle.setSuspended(!0);this._log("Self-hosted LiveSync suspended",LOG_LEVEL_NOTICE)}await this.services.control.applySettings();await this.services.setting.saveSettingData()}});this.addCommand({id:"livesync-scan-files",name:"Scan storage and database again",callback:async()=>{await this.services.vault.scanVault(!0)}});this.addCommand({id:"livesync-runbatch",name:"Run pended batch processes",callback:async()=>{await this.services.fileProcessing.commitPendingFileEvents()}});this.addCommand({id:"livesync-abortsync",name:"Abort synchronization immediately",callback:()=>{this.core.replicator.terminateSync()}});return Promise.resolve(!0)}onBindFunction(core,services){services.appLifecycle.onInitialise.addHandler(this._everyOnloadStart.bind(this))}};LiveSyncBaseCore=class{constructor(serviceHub,serviceModuleInitialiser,extraModuleInitialiser,addOnsInitialiser,featuresInitialiser){this.addOns=[];this._services=void 0;this.modules=[];this._services=serviceHub;this._serviceModules=serviceModuleInitialiser(this,serviceHub);const extraModules=extraModuleInitialiser(this);this.registerModules(extraModules);this.initialiseServiceFeatures();featuresInitialiser(this);const addOns=addOnsInitialiser(this);for(const addOn of addOns)this._registerAddOn(addOn);this.bindModuleFunctions()}_registerAddOn(addOn){this.addOns.push(addOn);this.services.appLifecycle.onUnload.addHandler(()=>Promise.resolve(addOn.onunload()).then(()=>!0))}getAddOn(cls){for(const addon of this.addOns)if(addon.constructor.name==cls)return addon}get services(){if(!this._services)throw new Error("Services not initialised yet");return this._services}get serviceModules(){return this._serviceModules}getModule(constructor){for(const module2 of this.modules)if(module2.constructor===constructor)return module2;throw new Error(`Module ${constructor} not found or not loaded.`)}_registerModule(module2){this.modules.push(module2)}registerModules(extraModules=[]){this._registerModule(new ModuleLiveSyncMain(this));this._registerModule(new ModuleConflictChecker(this));this._registerModule(new ModuleReplicatorMinIO(this));this._registerModule(new ModuleReplicatorCouchDB(this));this._registerModule(new ModuleReplicator(this));this._registerModule(new ModuleConflictResolver(this));this._registerModule(new ModulePeriodicProcess(this));this._registerModule(new ModuleResolvingMismatchedTweaks(this));this._registerModule(new ModuleBasicMenu(this));for(const module2 of extraModules)this._registerModule(module2)}bindModuleFunctions(){var _a8,_b5;for(const module2 of this.modules)if(module2 instanceof AbstractModule){module2.onBindFunction(this,this.services);__$checkInstanceBinding(module2)}else this.services.API.addLog(`Module ${null!=(_b5=null==(_a8=null==module2?void 0:module2.constructor)?void 0:_a8.name)?_b5:"unknown"} does not have onBindFunction, skipping binding.`,LOG_LEVEL_INFO)}get confirm(){return this.services.UI.confirm}get settings(){return this.services.setting.settings}set settings(value){this.services.setting.settings=value}getSettings(){return this.settings}get localDatabase(){return this.services.database.localDatabase}getDatabase(){return this.localDatabase.localDatabase}get simpleStore(){return this.services.keyValueDB.simpleStore}get replicator(){return this.services.replicator.getActiveReplicator()}get kvDB(){return this.services.keyValueDB.kvDB}get storageAccess(){return this.serviceModules.storageAccess}get databaseFileAccess(){return this.serviceModules.databaseFileAccess}get fileHandler(){return this.serviceModules.fileHandler}get rebuilder(){return this.serviceModules.rebuilder}initialiseServiceFeatures(){useTargetFilters(this);usePrepareDatabaseForUse(this);useRemoteConfigurationMigration(this)}};ModuleObsidianMenu=class extends AbstractModule{_everyOnloadStart(){(0,import_obsidian.addIcon)("replicate",'\n \n \n \n \n ');this.addRibbonIcon("replicate",$msg("moduleObsidianMenu.replicate"),async()=>{await this.services.replication.replicate(!0)}).addClass("livesync-ribbon-replicate");this.addCommand({id:"livesync-checkdoc-conflicted",name:"Resolve if conflicted.",editorCallback:(editor,view)=>{const file=view.file;file&&this.services.conflict.queueCheckForIfOpen(file.path)}});return Promise.resolve(!0)}onBindFunction(core,services){services.appLifecycle.onInitialise.addHandler(this._everyOnloadStart.bind(this))}};SETTING_HEADER="````yaml:livesync-setting\n";ModuleObsidianSettingsAsMarkdown=class extends AbstractModule{_everyOnloadStart(){this.addCommand({id:"livesync-export-config",name:"Write setting markdown manually",checkCallback:checking=>{if(checking)return""!=this.settings.settingSyncFile;fireAndForget(async()=>{await this.services.setting.saveSettingData()})}});this.addCommand({id:"livesync-import-config",name:"Parse setting file",editorCheckCallback:(checking,editor,ctx)=>{if(checking){const doc=editor.getValue();return""!=this.extractSettingFromWholeText(doc).body}if(ctx.file){const file=ctx.file;fireAndForget(async()=>await this.checkAndApplySettingFromMarkdown(file.path,!1))}}});eventHub.onEvent("event-file-changed",info3=>{fireAndForget(()=>this.checkAndApplySettingFromMarkdown(info3.file,info3.automated))});eventHub.onEvent(EVENT_SETTING_SAVED,settings=>{""!=settings.settingSyncFile&&fireAndForget(()=>this.saveSettingToMarkdown(settings.settingSyncFile))});return Promise.resolve(!0)}extractSettingFromWholeText(data){if(-1===data.indexOf(SETTING_HEADER))return{preamble:data,body:"",postscript:""};const startMarkerPos=data.indexOf(SETTING_HEADER),dataStartPos=-1==startMarkerPos?data.length:startMarkerPos,endMarkerPos=-1==startMarkerPos?data.length:data.indexOf("\n````",dataStartPos),dataEndPos=-1==endMarkerPos?data.length:endMarkerPos,body=data.substring(dataStartPos+26,dataEndPos);return{preamble:data.substring(0,dataStartPos),body,postscript:data.substring(dataEndPos+5+1)}}async parseSettingFromMarkdown(filename,data){if(!await this.core.storageAccess.isExists(filename))return{preamble:"",body:"",postscript:""};if(data)return this.extractSettingFromWholeText(data);const parseData=null!=data?data:await this.core.storageAccess.readFileText(filename);return this.extractSettingFromWholeText(parseData)}async checkAndApplySettingFromMarkdown(filename,automated){if(automated&&!this.settings.notifyAllSettingSyncFile&&(!this.settings.settingSyncFile||this.settings.settingSyncFile!=filename)){this._log(`Setting file (${filename}) does not match the current configuration. skipped.`,LOG_LEVEL_DEBUG);return}const{body}=await this.parseSettingFromMarkdown(filename);let newSetting={};try{newSetting=(0,import_obsidian.parseYaml)(body)}catch(ex){this._log("Could not parse YAML",LOG_LEVEL_NOTICE);this._log(ex,LOG_LEVEL_VERBOSE);return}if("settingSyncFile"in newSetting&&newSetting.settingSyncFile!=filename){this._log("This setting file seems to backed up one. Please fix the filename or settingSyncFile value.",automated?LOG_LEVEL_INFO:LOG_LEVEL_NOTICE);return}let settingToApply={...DEFAULT_SETTINGS};settingToApply={...settingToApply,...newSetting};if(!(null==settingToApply?void 0:settingToApply.writeCredentialsForSettingSync)){settingToApply.couchDB_USER=this.settings.couchDB_USER;settingToApply.couchDB_PASSWORD=this.settings.couchDB_PASSWORD;settingToApply.passphrase=this.settings.passphrase}if(!isObjectDifferent(this.generateSettingForMarkdown(this.settings,settingToApply.writeCredentialsForSettingSync),this.generateSettingForMarkdown(settingToApply))){this._log("Setting markdown has been detected, but not changed.",automated?LOG_LEVEL_INFO:LOG_LEVEL_NOTICE);return}const addMsg=this.settings.settingSyncFile!=filename?" (This is not-active file)":"";this.core.confirm.askInPopup("apply-setting-from-md",`Setting markdown ${filename}${addMsg} has been detected. Apply this from {HERE}.`,anchor=>{anchor.text="HERE";anchor.addEventListener("click",()=>{fireAndForget(async()=>{const APPLY_AND_RESTART="Apply settings and restart obsidian",APPLY_AND_REBUILD="Apply settings and restart obsidian with red_flag_rebuild.md",APPLY_AND_FETCH="Apply settings and restart obsidian with red_flag_fetch.md",result=await this.core.confirm.askSelectStringDialogue("Ready for apply the setting.",[APPLY_AND_RESTART,"Apply settings",APPLY_AND_FETCH,APPLY_AND_REBUILD,"Cancel"],{defaultAction:APPLY_AND_RESTART});if("Apply settings"==result||result==APPLY_AND_RESTART||result==APPLY_AND_REBUILD||result==APPLY_AND_FETCH){await this.services.setting.applyExternalSettings(settingToApply,!0);this.services.setting.clearUsedPassphrase();if("Apply settings"==result){this._log("Loaded settings have been applied!",LOG_LEVEL_NOTICE);return}result==APPLY_AND_REBUILD&&await this.core.rebuilder.scheduleRebuild();result==APPLY_AND_FETCH&&await this.core.rebuilder.scheduleFetch();this.services.appLifecycle.performRestart()}})})})}generateSettingForMarkdown(settings,keepCredential){const saveData={...settings||this.settings};delete saveData.encryptedCouchDBConnection;delete saveData.encryptedPassphrase;delete saveData.additionalSuffixOfDatabaseName;if(!saveData.writeCredentialsForSettingSync&&!keepCredential){delete saveData.couchDB_USER;delete saveData.couchDB_PASSWORD;delete saveData.passphrase;delete saveData.jwtKey;delete saveData.jwtKid;delete saveData.jwtSub;delete saveData.couchDB_CustomHeaders;delete saveData.bucketCustomHeaders}return saveData}async saveSettingToMarkdown(filename){const saveData=this.generateSettingForMarkdown();if(!await this.core.storageAccess.isExists(filename)){await this.core.storageAccess.ensureDir(filename);const initialContent='This file contains Self-hosted LiveSync settings as YAML.\nExcept for the `livesync-setting` code block, we can add a note for free.\n\nIf the name of this file matches the value of the "settingSyncFile" setting inside the `livesync-setting` block, LiveSync will tell us whenever the settings change. We can decide to accept or decline the remote setting. (In other words, we can back up this file by renaming it to another name).\n\nWe can perform a command in this file.\n- `Parse setting file` : load the setting from the file.\n\n**Note** Please handle it with all of your care if you have configured to write credentials in.\n\n\n';await this.core.storageAccess.writeFileAuto(filename,initialContent+SETTING_HEADER+"\n\n````")}const data=await this.core.storageAccess.readFileText(filename),{preamble,body,postscript}=this.extractSettingFromWholeText(data),newBody=(0,import_obsidian.stringifyYaml)(saveData);if(newBody==body)this._log("Markdown setting: Nothing had been changed",LOG_LEVEL_VERBOSE);else{await this.core.storageAccess.writeFileAuto(filename,preamble+SETTING_HEADER+newBody+"\n````"+postscript);this._log(`Markdown setting: ${filename} has been updated!`,LOG_LEVEL_VERBOSE)}}onBindFunction(core,services){services.appLifecycle.onInitialise.addHandler(this._everyOnloadStart.bind(this))}};ConditionType=(ConditionType2=>{ConditionType2.PLATFORM_CASE_INSENSITIVE="platform-case-insensitive";ConditionType2.PLATFORM_CASE_SENSITIVE="platform-case-sensitive";ConditionType2.REMOTE_CASE_SENSITIVE="remote-case-sensitive";return ConditionType2})(ConditionType||{});RuleLevel=(RuleLevel2=>{RuleLevel2[RuleLevel2.Must=0]="Must";RuleLevel2[RuleLevel2.Necessary=1]="Necessary";RuleLevel2[RuleLevel2.Recommended=2]="Recommended";RuleLevel2[RuleLevel2.Optional=3]="Optional";return RuleLevel2})(RuleLevel||{});DoctorRegulationV0_25_27={version:"0.25.27",rules:{sendChunksBulk:{value:!1,reason:"This is an obsolete setting and we should not enable this no more",level:0},sendChunksBulkMaxSize:{value:1,reason:"This is an obsolete setting and we should not enable this no more",level:0},doNotUseFixedRevisionForChunks:{value:!0,reason:"This value has been reverted at v0.24.16 for garbage collection of chunks.",level:2},handleFilenameCaseSensitive:{value:!1,reason:"If Self-hosted LiveSync is Case-Sensitive, unexpected file operations may occur when synchronising with Windows, Android or other devices. This value should only be enabled if all devices have a Case-Sensitive file system.",requireRebuild:!0,level:2},useIndexedDBAdapter:{value:!0,requireRebuildLocal:!0,level:3,reason:"The old option is active. This is not a performance-appropriate setting."},useEden:{reason:"This option is no longer recommended.",level:3,value:!1},hashAlg:{obsoleteValues:["sha1","xxhash32",""],value:"xxhash64",level:1,reason:"The hash function is set to the old fallback. This should be retried. This may result in a change to the new fallback."},disableCheckingConfigMismatch:{value:!1,level:2,reason:"If you disabled an older version of the dialogue because it was hard to understand, try it once in the latest version."},enableCompression:{value:!1,level:2,requireRebuild:!0,reason:"This option will be sunset soon."},usePluginSyncV2:{value:!0,level:2,reason:"This option is now enabled by default. If you have problems with the new plugin, please report them."},chunkSplitterVersion:{value:"v3-rabin-karp",valueDisplay:ChunkAlgorithmNames["v3-rabin-karp"],level:2,reason:"Chunk splitting has been optimised for more effective de-duplication. This is the new default value."},customChunkSize:{min:55,value:60,valueDisplay:"60 (detected on if less than 55)",level:2,detectionFunc:settings=>"v3-rabin-karp"===(null==settings?void 0:settings.chunkSplitterVersion)&&!isCloudantURI((null==settings?void 0:settings.couchDB_URI)||""),reason:"With the V3 Rabin-Karp chunk splitter and Self-hosted CouchDB, the chunk size is set to 60 (means around 6MB) by default. This is in effect the maximum chunk size, which in practice is divided more finely."},E2EEAlgorithm:{value:E2EEAlgorithms.V2,valueDisplay:E2EEAlgorithmNames[E2EEAlgorithms.V2],level:2,reasonFunc:_=>$msg("Doctor.RULES.E2EE_V02500.REASON")},useIndexedDBAdapter:void 0}};DoctorRegulation=DoctorRegulationV0_25_27;RebuildOptions_AutomaticAcceptable=0,RebuildOptions_ConfirmIfRequired=1,RebuildOptions_SkipEvenIfRequired=2;ModuleMigration=class extends AbstractModule{async migrateUsingDoctor(skipRebuild=!1,activateReason="updated",forceRescan=!1){const{shouldRebuild,shouldRebuildLocal,isModified,settings}=await performDoctorConsultation(this.core,this.settings,{localRebuild:skipRebuild?RebuildOptions_SkipEvenIfRequired:RebuildOptions_AutomaticAcceptable,remoteRebuild:skipRebuild?RebuildOptions_SkipEvenIfRequired:RebuildOptions_AutomaticAcceptable,activateReason,forceRescan});if(isModified){this.settings=settings;await this.saveSettings()}if(!skipRebuild){if(shouldRebuild){await this.core.rebuilder.scheduleRebuild();this.services.appLifecycle.performRestart();return!1}if(shouldRebuildLocal){await this.core.rebuilder.scheduleFetch();this.services.appLifecycle.performRestart();return!1}}return!0}async migrateDisableBulkSend(){if(this.settings.sendChunksBulk){this._log($msg("moduleMigration.logBulkSendCorrupted"),LOG_LEVEL_NOTICE);this.settings.sendChunksBulk=!1;this.settings.sendChunksBulkMaxSize=1;await this.saveSettings()}}async initialMessage(){const manager=this.core.getModule(SetupManager);return await manager.startOnBoarding()}async askAgainForSetupURI(){const message=$msg("moduleMigration.msgRecommendSetupUri",{URI_DOC:$msg("moduleMigration.docUri")}),USE_MINIMAL=$msg("moduleMigration.optionSetupWizard"),USE_P2P=$msg("moduleMigration.optionSetupViaP2P"),USE_SETUP=$msg("moduleMigration.optionManualSetup"),NEXT=$msg("moduleMigration.optionRemindNextLaunch"),ret=await this.core.confirm.askSelectStringDialogue(message,[USE_MINIMAL,USE_SETUP,USE_P2P,NEXT],{title:$msg("moduleMigration.titleRecommendSetupUri"),defaultAction:USE_MINIMAL});if(ret===USE_MINIMAL){eventHub.emitEvent("request-open-setting-wizard");return!1}if(ret===USE_P2P){eventHub.emitEvent(EVENT_REQUEST_OPEN_P2P);return!1}if(ret===USE_SETUP){eventHub.emitEvent("request-open-settings");return!1}return!1}async hasIncompleteDocs(force=!1){if(await this.core.kvDB.get("checkIncompleteDocs")&&!force){this._log("Incomplete docs check already done, skipping.",LOG_LEVEL_VERBOSE);return Promise.resolve(!0)}this._log("Checking for incomplete documents...",LOG_LEVEL_NOTICE,"check-incomplete");const errorFiles=[];for await(const metaDoc of this.localDatabase.findAllNormalDocs({conflicts:!0})){const path2=this.getPath(metaDoc);if(!isValidPath(path2))continue;if(!await this.services.vault.isTargetFile(path2))continue;if(!isMetaEntry(metaDoc))continue;const doc=await this.localDatabase.getDBEntryFromMeta(metaDoc);if(!doc||!isLoadedEntry(doc))continue;if(isDeletedEntry(doc))continue;const isConflicted=(null==metaDoc?void 0:metaDoc._conflicts)&&metaDoc._conflicts.length>0;let storageFileContent;try{storageFileContent=await this.core.storageAccess.readHiddenFileBinary(path2)}catch(e3){Logger(`Failed to read file ${path2}: Possibly unprocessed or missing`);Logger(e3,LOG_LEVEL_VERBOSE);continue}const sizeOnStorage=storageFileContent.byteLength,recordedSize=doc.size,actualSize=readAsBlob(doc).size;if(recordedSize!==actualSize||sizeOnStorage!==actualSize||sizeOnStorage!==recordedSize||isConflicted){const contentMatched=await isDocContentSame(doc.data,storageFileContent);errorFiles.push({path:path2,recordedSize,actualSize,storageSize:sizeOnStorage,contentMatched,isConflicted});Logger(`Size mismatch for ${path2}: ${recordedSize} (DB Recorded) , ${actualSize} (DB Stored) , ${sizeOnStorage} (Storage Stored), ${contentMatched?"Content Matched":"Content Mismatched"} ${isConflicted?"Conflicted":"Not Conflicted"}`)}}if(0==errorFiles.length){Logger("No size mismatches found",LOG_LEVEL_NOTICE);await this.core.kvDB.set("checkIncompleteDocs",!0);return Promise.resolve(!0)}Logger(`Found ${errorFiles.length} size mismatches`,LOG_LEVEL_NOTICE);const recoverable=errorFiles.filter(e3=>e3.recordedSize===e3.storageSize&&!e3.isConflicted),unrecoverable=errorFiles.filter(e3=>e3.recordedSize!==e3.storageSize||e3.isConflicted),fileInfo=e3=>`${e3.path} (M: ${e3.recordedSize}, A: ${e3.actualSize}, S: ${e3.storageSize}) ${e3.isConflicted?"(Conflicted)":""}`,messageUnrecoverable=unrecoverable.length>0?$msg("moduleMigration.fix0256.messageUnrecoverable",{filesNotRecoverable:unrecoverable.map(e3=>`- ${fileInfo(e3)}`).join("\n")}):"",message=$msg("moduleMigration.fix0256.message",{files:recoverable.map(e3=>`- ${fileInfo(e3)}`).join("\n"),messageUnrecoverable}),CHECK_IT_LATER=$msg("moduleMigration.fix0256.buttons.checkItLater"),FIX=$msg("moduleMigration.fix0256.buttons.fix"),DISMISS=$msg("moduleMigration.fix0256.buttons.DismissForever"),ret=await this.core.confirm.askSelectStringDialogue(message,[CHECK_IT_LATER,FIX,DISMISS],{title:$msg("moduleMigration.fix0256.title"),defaultAction:CHECK_IT_LATER});if(ret==FIX)for(const file of recoverable){const stubFile=await this.core.storageAccess.getFileStub(file.path);if(null!=stubFile){stubFile.stat.mtime=Date.now();await this.core.fileHandler.storeFileToDB(stubFile,!0,!1)?Logger(`Successfully restored ${file.path} from storage`):Logger(`Failed to restore ${file.path} from storage`,LOG_LEVEL_NOTICE)}else Logger(`Could not find stub file for ${file.path}`,LOG_LEVEL_NOTICE)}else ret===DISMISS&&await this.core.kvDB.set("checkIncompleteDocs",!0);return Promise.resolve(!0)}async hasCompromisedChunks(){Logger("Checking for compromised chunks...",LOG_LEVEL_VERBOSE);if(!this.settings.encrypt)return!0;const localCompromised=await countCompromisedChunks(this.localDatabase.localDatabase),remote=this.services.replicator.getActiveReplicator(),remoteCompromised=this.services.API.isOnline?await(null==remote?void 0:remote.countCompromisedChunks()):0;if(!1===localCompromised){Logger("Failed to count compromised chunks in local database",LOG_LEVEL_NOTICE);return!1}if(!1===remoteCompromised){Logger("Failed to count compromised chunks in remote database",LOG_LEVEL_NOTICE);return!1}if(0===remoteCompromised&&0===localCompromised)return!0;Logger(`Found compromised chunks : ${localCompromised} in local, ${remoteCompromised} in remote`,LOG_LEVEL_NOTICE);const title=$msg("moduleMigration.insecureChunkExist.title"),msg=$msg("moduleMigration.insecureChunkExist.message"),REBUILD=$msg("moduleMigration.insecureChunkExist.buttons.rebuild"),FETCH=$msg("moduleMigration.insecureChunkExist.buttons.fetch"),DISMISS=$msg("moduleMigration.insecureChunkExist.buttons.later"),buttons=[REBUILD,FETCH,DISMISS];0!=remoteCompromised&&buttons.splice(buttons.indexOf(FETCH),1);const result=await this.core.confirm.askSelectStringDialogue(msg,buttons,{title,defaultAction:DISMISS,timeout:0});if(result===REBUILD){await this.core.rebuilder.scheduleRebuild();this.services.appLifecycle.performRestart();return!1}if(result===FETCH){await this.core.rebuilder.scheduleFetch();this.services.appLifecycle.performRestart();return!1}this._log($msg("moduleMigration.insecureChunkExist.laterMessage"),LOG_LEVEL_NOTICE);return!0}async _everyOnFirstInitialize(){if(!this.localDatabase.isReady){this._log($msg("moduleMigration.logLocalDatabaseNotReady"),LOG_LEVEL_NOTICE);return!1}if(this.settings.isConfigured){if(!await this.hasCompromisedChunks())return!1;if(!await this.hasIncompleteDocs())return!1;if(!await this.migrateUsingDoctor(!1))return!1;await this.migrateDisableBulkSend()}if(!this.settings.isConfigured){if(!await this.initialMessage()){this._log($msg("moduleMigration.logSetupCancelled"),LOG_LEVEL_NOTICE);return!1}if(!await this.migrateUsingDoctor(!0))return!1}return!0}_everyOnLayoutReady(){eventHub.onEvent(EVENT_REQUEST_RUN_DOCTOR,async reason=>{await this.migrateUsingDoctor(!1,reason,!0)});eventHub.onEvent(EVENT_REQUEST_RUN_FIX_INCOMPLETE,async()=>{await this.hasIncompleteDocs(!0)});return Promise.resolve(!0)}onBindFunction(core,services){super.onBindFunction(core,services);services.appLifecycle.onLayoutReady.addHandler(this._everyOnLayoutReady.bind(this));services.appLifecycle.onFirstInitialise.addHandler(this._everyOnFirstInitialize.bind(this))}};enableI18nFeature=function createServiceFeature(featureFunction){return featureFunction}(async({services:{setting,API}})=>{let isChanged=!1;const settings=setting.currentSettings();if(""==settings.displayLanguage){const obsidianLanguage=(0,import_obsidian.getLanguage)();if(-1!==SUPPORTED_I18N_LANGS.indexOf(obsidianLanguage)&&obsidianLanguage!=settings.displayLanguage){await setting.applyPartial({displayLanguage:obsidianLanguage});isChanged=!0;setLang(settings.displayLanguage)}else if(""==settings.displayLanguage){await setting.applyPartial({displayLanguage:"def"});setLang(settings.displayLanguage);await setting.saveSettingData()}}if(isChanged){const revert2=$msg("dialog.yourLanguageAvailable.btnRevertToDefault");if(await API.confirm.askSelectStringDialogue($msg("dialog.yourLanguageAvailable"),["OK",revert2],{defaultAction:"OK",title:$msg("dialog.yourLanguageAvailable.Title")})==revert2){await setting.applyPartial({displayLanguage:"def"});setLang(settings.displayLanguage)}await setting.saveSettingData()}return!0});root_219=from_html("If you have unsynchronised changes in your Vault on this device, they will likely diverge from the server's\n versions after the reset. This may result in a large number of file conflicts.
    Furthermore, if conflicts are already present in the server data, they will be synchronised to this device as they are,\n and you will need to resolve them locally.",1);root_413=from_html("To minimise the creation of new conflicts, please select the option that best describes the\n current state of your Vault. The application will then check your files in the most appropriate way based on\n your selection.",1);root_810=from_html("(e.g., after editing many files whilst offline) ",1);root_55=from_html(" ",1);root_37=from_html(" ",1);root_154=from_html("It is strongly advised to create a backup before proceeding. Continuing without a backup may lead\n to data loss.
    If you understand the risks and still wish to proceed, select so.",1);root_136=from_html(" ",1);root_105=from_html(" ",1);root_184=from_html(" ",1);root36=from_html("

    ",1);root_129=from_html("This procedure will first delete all existing synchronisation data from the server. Following this, the server data\n will be completely rebuilt, using the current state of your Vault on this device (including its local database) as the single, authoritative master copy.",1);root_414=from_html(" ",1);root_38=from_html(" ",1);root_144=from_html("You should create a new synchronisation destination and rebuild your data there.
    After that,\n synchronise to a brand new vault on each other device with the new remote one by one.
    ");root_1210=from_html(" ",1);root_95=from_html(" ",1);root_172=from_html(" ",1);root37=from_html("
    ",1);LiveSyncTrysteroReplicator=class extends LiveSyncAbstractReplicator{get rawReplicator(){return this._replicator}get rawHost(){return this._p2pHost}get isChunkSendingSupported(){return!1}getReplicationPBKDF2Salt(_setting,_refresh){return Promise.resolve(new Uint8Array(32))}terminateSync(){}_buildEnv(){const services=this.env.services;return{get settings(){return services.setting.currentSettings()},get db(){return services.database.localDatabase.localDatabase},get simpleStore(){return services.keyValueDB.openSimpleStore("p2p-sync")},get deviceName(){return services.config.getSmallConfig(SETTING_KEY_P2P_DEVICE_NAME)||services.vault.getVaultName()},get platform(){return services.API.getPlatform()},get confirm(){return services.API.confirm},processReplicatedDocs:async docs=>{await services.replication.parseSynchroniseResult(docs)}}}async open(){var _a8;if((!this._replicator||!(null==(_a8=this._p2pHost)?void 0:_a8.isServing))&&this.env.services.setting.currentSettings().P2P_Enabled)try{const env=this._buildEnv(),host=new TrysteroReplicatorP2PServer(env),replicator=new TrysteroReplicator(env,host);this._p2pHost=host;this._replicator=replicator;await replicator.open()}catch(e3){Logger(e3 instanceof Error?e3.message:"Error while opening P2P connection",LOG_LEVEL_NOTICE);Logger(e3,LOG_LEVEL_VERBOSE);this._p2pHost=void 0;this._replicator=void 0}}async close(){if(this._replicator){this._replicator.disableBroadcastChanges();await this._replicator.close();this._replicator=void 0}this._p2pHost=void 0}closeReplication(){var _a8;null==(_a8=this._replicator)||_a8.disconnectFromServer()}get server(){var _a8;return null==(_a8=this._replicator)?void 0:_a8.server}get knownAdvertisements(){var _a8,_b5;return null!=(_b5=null==(_a8=this._replicator)?void 0:_a8.knownAdvertisements)?_b5:[]}enableBroadcastChanges(){var _a8;null==(_a8=this._replicator)||_a8.enableBroadcastChanges()}disableBroadcastChanges(){var _a8;null==(_a8=this._replicator)||_a8.disableBroadcastChanges()}requestStatus(){var _a8;null==(_a8=this._replicator)||_a8.requestStatus()}onNewPeer(peer){var _a8;return null==(_a8=this._replicator)?void 0:_a8.onNewPeer(peer)}onPeerLeaved(peerId){var _a8;null==(_a8=this._replicator)||_a8.onPeerLeaved(peerId)}async replicateFromCommand(showResult=!1){var _a8;await(null==(_a8=this._replicator)?void 0:_a8.replicateFromCommand(showResult))}async replicateFrom(peerId,showNotice=!1){if(!this._replicator)throw new Error("P2P replicator is not open");return await this._replicator.replicateFrom(peerId,showNotice)}async requestSynchroniseToPeer(peerId){if(!this._replicator)throw new Error("P2P replicator is not open");return await this._replicator.requestSynchroniseToPeer(peerId)}async getRemoteConfig(peerId){if(!this._replicator)throw new Error("P2P replicator is not open");return await this._replicator.getRemoteConfig(peerId)}watchPeer(peerId){var _a8;null==(_a8=this._replicator)||_a8.watchPeer(peerId)}unwatchPeer(peerId){var _a8;null==(_a8=this._replicator)||_a8.unwatchPeer(peerId)}async sync(peerId,showNotice=!1){if(!this._replicator)throw new Error("P2P replicator is not open");return await this._replicator.sync(peerId,showNotice)}async makeDecision(decision){var _a8,_b5;await(null==(_b5=null==(_a8=this._replicator)?void 0:_a8.server)?void 0:_b5.makeDecision(decision))}async revokeDecision(decision){var _a8,_b5;await(null==(_b5=null==(_a8=this._replicator)?void 0:_a8.server)?void 0:_b5.revokeDecision(decision))}async makeSureOpened(){var _a8;this._replicator&&(null==(_a8=this._p2pHost)?void 0:_a8.isServing)||await this.open()}async openReplication(_setting,_keepAlive,showResult,_ignoreCleanLock){const logLevel=showResult?LOG_LEVEL_NOTICE:LOG_LEVEL_INFO;if(!this._replicator){Logger($msg("P2P.ReplicatorInstanceMissing"),logLevel);return!1}await this._replicator.makeSureOpened();await this._replicator.replicateFromCommand(showResult)}tryConnectRemote(_setting,_showResult){return Promise.resolve(!1)}replicateAllToServer(_setting,_showingNotice,_sendChunksInBulkDisabled){return Promise.resolve(!1)}async selectPeer(settingPeerName,r4,logLevel){var _a8,_b5,_c3,_d2,_e2;const knownPeersOrg=null!=(_b5=null==(_a8=r4.server)?void 0:_a8.knownAdvertisements)?_b5:[];let knownPeers;if(0!=knownPeersOrg.length)knownPeers=knownPeersOrg;else{Logger($msg("P2P.NoKnownPeers"),logLevel);await Promise.race([delay(5e3),eventHub.waitFor(EVENT_ADVERTISEMENT_RECEIVED)]);knownPeers=null!=(_d2=null==(_c3=r4.server)?void 0:_c3.knownAdvertisements)?_d2:[]}const message="Rebuild from which peer?"+(settingPeerName?"\n [*] indicates the peer you have selected before.":""),confirm=this.env.services.UI.confirm,options=[...knownPeers.map(e3=>e3.name+" "+(e3.name==settingPeerName?"[*]":"")+" ("+e3.peerId+")"),"Refresh List","Cancel"],selected=await confirm.askSelectStringDialogue(message,options,{title:"Select a peer to fetch from",defaultAction:"Refresh List"});if(!selected||"Cancel"==selected)return!1;if("Refresh List"==selected){await Promise.race([delay(1e3),eventHub.waitFor(EVENT_ADVERTISEMENT_RECEIVED)]);return this.selectPeer(settingPeerName,r4,logLevel)}const selectedPeerName=selected.split(" ")[0],peerId=null==(_e2=knownPeers.find(e3=>e3.name==selectedPeerName))?void 0:_e2.peerId;if(!peerId){Logger("Failed to find peerId for "+selectedPeerName,logLevel);return!1}return peerId}async tryUntilSuccess(func,repeat,logLevel){if(!this.env.services.UI.confirm){Logger("Cannot find confirm instance.",logLevel);return Promise.reject("Cannot find confirm instance.")}let result;for(;!result;)for(let i2=0;i2{var _a9;await this.makeSureOpened();return null!=(_a9=this._replicator)&&_a9},10,logLevel);if(!1===r4){Logger("Failed to open P2P connection.",logLevel);return!1}const peerId=await this.selectPeer(peerFrom,r4,logLevel);if(!1===peerId){Logger("Failed to connect peer.",logLevel);return!1}this.env.services.setting.currentSettings().P2P_RebuildFrom="";Logger("Fetching from peer "+peerId+".",logLevel);const rep=await r4.replicateFrom(peerId,showingNotice);if(rep.ok){Logger("P2P Fetching has been succeed from "+peerId+".",logLevel);return!0}Logger("Failed to fetch from peer "+peerId+".",logLevel);Logger(rep.error,LOG_LEVEL_VERBOSE);return!1}finally{null==(_a8=this._replicator)||_a8.clearOnSetup()}}tryResetRemoteDatabase(_setting){throw new Error("P2P replication does not support database reset.")}tryCreateRemoteDatabase(_setting){throw new Error("P2P replication does not support database reset.")}markRemoteLocked(_setting,_locked,_lockByClean){throw new Error("P2P replication does not support database lock.")}markRemoteResolved(_setting){Logger("Trying resolving remote-database-lock but P2P replication does not support database lock. This operation has been ignored",LOG_LEVEL_INFO);return Promise.resolve()}resetRemoteTweakSettings(_setting){throw new Error("P2P replication does not support resetting tweaks.")}setPreferredRemoteTweakSettings(_setting){Logger("Trying setting tweak values but P2P replication does not support to do this. This operation has been ignored",LOG_LEVEL_INFO);return Promise.resolve()}fetchRemoteChunks(_missingChunks,_showResult){return Promise.resolve(!1)}getRemoteStatus(_setting){Logger("Trying to get remote status but P2P replication does not support to do this. This operation has been ignored",LOG_LEVEL_INFO);return Promise.resolve(!1)}getRemotePreferredTweakValues(_setting){Logger("Trying to get tweak values but P2P replication does not support to do this. This operation has been ignored",LOG_LEVEL_INFO);return Promise.resolve(!1)}countCompromisedChunks(){Logger("P2P Replicator cannot count compromised chunks",LOG_LEVEL_VERBOSE);return Promise.resolve(0)}getConnectedDeviceList(_setting){Logger("Trying to get connected device list but P2P replication does not support to do this. This operation has been ignored",LOG_LEVEL_INFO);return Promise.resolve(!1)}constructor(env){super(env);this.env=env}};EVENT_P2P_PEER_SHOW_EXTRA_MENU="p2p-peer-show-extra-menu";AcceptedStatus=(AcceptedStatus2=>{AcceptedStatus2.UNKNOWN="Unknown";AcceptedStatus2.ACCEPTED="Accepted";AcceptedStatus2.DENIED="Denied";AcceptedStatus2.ACCEPTED_IN_SESSION="Accepted in session";AcceptedStatus2.DENIED_IN_SESSION="Denied in session";return AcceptedStatus2})(AcceptedStatus||{});ConnectionStatus=(ConnectionStatus2=>{ConnectionStatus2.CONNECTED="Connected";ConnectionStatus2.CONNECTED_LIVE="Connected(live)";ConnectionStatus2.DISCONNECTED="Disconnected";return ConnectionStatus2})(ConnectionStatus||{});root_220=from_html(" ");root_130=from_html('
    ');root_39=from_html(' ');on_click5=(__3,makeDecision)=>makeDecision(!0,!0);on_click_12=(__4,makeDecision)=>makeDecision(!0,!1);root_56=from_html(' ',1);on_click_2=(__5,makeDecision)=>makeDecision(!1,!0);on_click_3=(__6,makeDecision)=>makeDecision(!1,!1);root_68=from_html(' ',1);root_415=from_html(" ",1);on_click_4=(__7,revokeDecision)=>revokeDecision();root_710=from_html('');root_96=from_html('');root_106=from_html('');root_811=from_html('
    ');root38=from_html('
    ');$$css16={hash:"svelte-8nqxsr",code:"tr.svelte-8nqxsr:nth-child(odd) {background-color:var(--background-primary-alt);}.info.svelte-8nqxsr {display:flex;flex-direction:column;justify-content:center;align-items:center;padding:var(--size-4-1) var(--size-4-1);}.peer-id.svelte-8nqxsr {font-size:0.8em;}.status-chips.svelte-8nqxsr {display:flex;flex-direction:column;justify-content:center;align-items:center;\n /* min-width: 10em; */}.buttons.svelte-8nqxsr {display:flex;flex-direction:column;justify-content:center;align-items:center;}.buttons.svelte-8nqxsr .row:where(.svelte-8nqxsr) {display:flex;justify-content:center;align-items:center;flex-wrap:wrap;\n /* padding: var(--size-4-1) var(--size-4-1); */}.chip.svelte-8nqxsr {display:inline-block;padding:4px 8px;margin:4px;border-radius:4px;font-size:0.75em;font-weight:bold;background-color:var(--tag-background);border:var(--tag-border-width) solid var(--tag-border-color);}.chip.connected.svelte-8nqxsr {background-color:var(--background-modifier-success);color:var(--text-normal);}.chip.connected-live.svelte-8nqxsr {background-color:var(--background-modifier-success);border-color:var(--background-modifier-success);color:var(--text-normal);}.chip.accepted.svelte-8nqxsr {background-color:var(--background-modifier-success);color:var(--text-normal);}.chip.waiting.svelte-8nqxsr {background-color:var(--background-secondary);}.chip.unknown.svelte-8nqxsr {background-color:var(--background-primary);color:var(--text-warning);}.chip.denied.svelte-8nqxsr {background-color:var(--background-modifier-error);color:var(--text-error);}.chip.attr.svelte-8nqxsr {background-color:var(--background-secondary);}.button.svelte-8nqxsr {margin:var(--size-4-1);}.button.affirmative.svelte-8nqxsr {background-color:var(--interactive-accent);color:var(--text-normal);}.button.affirmative.svelte-8nqxsr:hover {background-color:var(--interactive-accent-hover);}.button.negative.svelte-8nqxsr {background-color:var(--background-modifier-error);color:var(--text-error);}.button.negative.svelte-8nqxsr:hover {background-color:var(--background-modifier-error-hover);}"};delegate(["click"]);root_131=from_html('

    ');on_click6=(__5,useDefaultRelay)=>useDefaultRelay();on_click_13=(__6,chooseRandom)=>chooseRandom();root_310=from_html('
    Enable P2P Replicator
    Relay settings
    Room ID This can isolate your connections between devices. Use the same Room ID for the same\n devices.
    Password This password is used to encrypt the connection. Use something long enough.
    This device name Device name to identify the device. Please use shorter one for the stable peer\n detection, i.e., "iphone-16" or "macbook-2021".
    Auto Connect
    Start change-broadcasting on Connect
    ');root_416=from_html('

    No Connection

    ');root_57=from_html('

    ');root_69=from_html("");root_97=from_html("");root_107=from_html("");root_711=from_html('
    Broadcasting?

    If you want to use `LiveSync`, you should broadcast changes. All `watching` peers which\n detects this will start the replication for fetching.
    However, This should not be enabled if you want to increase your secrecy more.

    ',1);root39=from_html('

    Peer to Peer Replicator

    Connection Settings

    Signaling Server Connection

    Peers

    NameActionCommand
    ');$$css17={hash:"svelte-2cmos",code:"article.svelte-2cmos {max-width:100%;}article.svelte-2cmos p:where(.svelte-2cmos) {user-select:text;-webkit-user-select:text;}h2.svelte-2cmos {margin-top:var(--size-4-1);margin-bottom:var(--size-4-1);padding-bottom:var(--size-4-1);border-bottom:1px solid var(--background-modifier-border);}label.is-dirty.svelte-2cmos {background-color:var(--background-modifier-error);}input.svelte-2cmos {background-color:transparent;}th.svelte-2cmos {\n /* display: flex;\n justify-content: center;\n align-items: center; */min-height:var(--input-height);}td.svelte-2cmos {min-height:var(--input-height);}td.svelte-2cmos > label:where(.svelte-2cmos) {display:flex;flex-direction:row;align-items:center;justify-content:flex-start;min-height:var(--input-height);}td.svelte-2cmos > label:where(.svelte-2cmos) > :where(.svelte-2cmos) {margin:auto var(--size-4-1);}table.peers.svelte-2cmos {width:100%;}.important.svelte-2cmos {color:var(--text-error);font-size:1.2em;font-weight:bold;}.important-sub.svelte-2cmos {color:var(--text-warning);}.settings.svelte-2cmos label:where(.svelte-2cmos) {display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;}"};delegate(["click"]);VIEW_TYPE_P2P="p2p-replicator";P2PReplicatorPaneView=class extends SvelteItemView{constructor(leaf,core,p2pResult){super(leaf);this.icon="waypoints";this.title="";this.navigation=!1;this.core=core;this._p2pResult=p2pResult;eventHub.onEvent(EVENT_P2P_PEER_SHOW_EXTRA_MENU,({peer,event:event2})=>{this.m&&this.m.hide();this.m=(new import_obsidian.Menu).addItem(item=>item.setTitle("📥 Only Fetch").onClick(()=>this.replicateFrom(peer))).addItem(item=>item.setTitle("📤 Only Send").onClick(()=>this.replicateTo(peer))).addSeparator().addItem(item=>{item.setTitle("🔧 Get Configuration").onClick(async()=>{await this.getRemoteConfig(peer)})}).addSeparator().addItem(item=>{const mark=peer.syncOnConnect?"checkmark":null;item.setTitle("Toggle Sync on connect").onClick(async()=>{await this.toggleProp(peer,"syncOnConnect")}).setIcon(mark)}).addItem(item=>{const mark=peer.watchOnConnect?"checkmark":null;item.setTitle("Toggle Watch on connect").onClick(async()=>{await this.toggleProp(peer,"watchOnConnect")}).setIcon(mark)}).addItem(item=>{const mark=peer.syncOnReplicationCommand?"checkmark":null;item.setTitle("Toggle Sync on `Replicate now` command").onClick(async()=>{await this.toggleProp(peer,"syncOnReplicationCommand")}).setIcon(mark)});this.m.showAtPosition({x:event2.x,y:event2.y})})}getIcon(){return"waypoints"}get replicator(){return this._p2pResult.replicator}async replicateFrom(peer){await this.replicator.replicateFrom(peer.peerId)}async replicateTo(peer){await this.replicator.requestSynchroniseToPeer(peer.peerId)}async getRemoteConfig(peer){Logger(`Requesting remote config for ${peer.name}. Please input the passphrase on the remote device`,LOG_LEVEL_NOTICE);const remoteConfig=await this.replicator.getRemoteConfig(peer.peerId);if(remoteConfig){Logger(`Remote config for ${peer.name} is retrieved successfully`);const DROP="Yes, and drop local database",KEEP="Yes, but keep local database",CANCEL="No, cancel",yn=await this.core.confirm.askSelectStringDialogue("Do you really want to apply the remote config? This will overwrite your current config immediately and restart.\nAnd you can also drop the local database to rebuild from the remote device.",[DROP,KEEP,CANCEL],{defaultAction:CANCEL,title:"Apply Remote Config "});if(yn===DROP||yn===KEEP){if(yn===DROP&&remoteConfig.remoteType!==REMOTE_P2P&&"yes"===await this.core.confirm.askYesNoDialog('Do you want to set the remote type to "P2P Sync" to rebuild by "P2P replication"?',{title:"Rebuild from remote device"})){remoteConfig.remoteType=REMOTE_P2P;remoteConfig.P2P_RebuildFrom=peer.name}await this.core.services.setting.applyExternalSettings(remoteConfig);yn===DROP?await this.core.rebuilder.scheduleFetch():this.core.services.appLifecycle.scheduleRestart()}else Logger(`Cancelled\nRemote config for ${peer.name} is not applied`,LOG_LEVEL_NOTICE)}else Logger(`Cannot retrieve remote config for ${peer.peerId}`)}async toggleProp(peer,prop2){const targetSetting={syncOnConnect:"P2P_AutoSyncPeers",watchOnConnect:"P2P_AutoWatchPeers",syncOnReplicationCommand:"P2P_SyncOnReplication"}[prop2],currentSettingAll=this.core.services.setting.currentSettings(),currentSetting={[targetSetting]:currentSettingAll?currentSettingAll[targetSetting]:""};peer[prop2]?currentSetting[targetSetting]=removeFromList(peer.name,currentSetting[targetSetting]):currentSetting[targetSetting]=addToList(peer.name,currentSetting[targetSetting]);await this.core.services.setting.applyPartial(currentSetting,!0)}getViewType(){return VIEW_TYPE_P2P}getDisplayText(){return"Peer-to-Peer Replicator"}async onClose(){await super.onClose();this.m&&this.m.hide()}instantiateComponent(target){return mount(P2PReplicatorPane,{target,props:{cmdSync:this._p2pResult.replicator,core:this.core}})}};ObsidianLiveSyncPlugin=class extends import_obsidian.Plugin{initialiseServiceModules(core,services){const storageAccessManager=new StorageAccessManager,vaultAccess=new FileAccessObsidian(this.app,{storageAccessManager,vaultService:services.vault,settingService:services.setting,APIService:services.API,pathService:services.path}),storageEventManager=new StorageEventManagerObsidian(this,core,{fileProcessing:services.fileProcessing,setting:services.setting,vaultService:services.vault,storageAccessManager,APIService:services.API}),storageAccess=new ServiceFileAccessObsidian({API:services.API,setting:services.setting,fileProcessing:services.fileProcessing,vault:services.vault,appLifecycle:services.appLifecycle,storageEventManager,storageAccessManager,vaultAccess}),databaseFileAccess=new ServiceDatabaseFileAccess({API:services.API,database:services.database,path:services.path,storageAccess,vault:services.vault}),fileHandler=new ServiceFileHandler({API:services.API,databaseFileAccess,conflict:services.conflict,setting:services.setting,fileProcessing:services.fileProcessing,vault:services.vault,path:services.path,replication:services.replication,storageAccess});return{rebuilder:new ServiceRebuilder({API:services.API,database:services.database,appLifecycle:services.appLifecycle,setting:services.setting,remote:services.remote,databaseEvents:services.databaseEvents,replication:services.replication,replicator:services.replicator,UI:services.UI,vault:services.vault,fileHandler,storageAccess,control:services.control}),fileHandler,databaseFileAccess,storageAccess}}async saveSettings(){await this.core.services.setting.saveSettingData()}constructor(app,manifest){super(app,manifest);import_obsidian.Notice;const serviceHub=new ObsidianServiceHub(this);this.core=new LiveSyncBaseCore(serviceHub,(core,serviceHub2)=>this.initialiseServiceModules(core,serviceHub2),core=>[new ModuleObsidianEvents(this,core),new ModuleObsidianSettingDialogue(this,core),new ModuleObsidianMenu(core),new ModuleObsidianSettingsAsMarkdown(core),new ModuleLog(this,core),new ModuleObsidianDocumentHistory(this,core),new ModuleInteractiveConflictResolver(this,core),new ModuleObsidianGlobalHistory(this,core),new ModuleDev(this,core),new ModuleReplicateTest(this,core),new ModuleIntegratedTest(this,core),new SetupManager(core),new ModuleMigration(core)],core=>[new ConfigSync(this,core),new HiddenFileSync(this,core),new LocalDatabaseMaintenance(this,core)],core=>{const featuresInitialiser=enableI18nFeature;core.services.appLifecycle.onLayoutReady.addHandler(()=>featuresInitialiser(core));const setupManager=core.getModule(SetupManager);useRemoteConfiguration(core);useSetupProtocolFeature(core,setupManager);useSetupQRCodeFeature(core);useSetupURIFeature(core);useSetupManagerHandlersFeature(core,setupManager);useOfflineScanner(core);useRedFlagFeatures(core);useCheckRemoteSize(core);const replicator=useP2PReplicatorFeature(core);useP2PReplicatorCommands(core,replicator);useP2PReplicatorUI(core,core,replicator)})}async _startUp(){if(!await this.core.services.control.onLoad())return;const onReady=this.core.services.control.onReady.bind(this.core.services.control);this.app.workspace.onLayoutReady(onReady)}onload(){this._startUp()}onunload(){this.core.services.control.onUnload()}}; +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-livesync/manifest.json b/.obsidian/plugins/obsidian-livesync/manifest.json new file mode 100644 index 0000000..8bcd242 --- /dev/null +++ b/.obsidian/plugins/obsidian-livesync/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "obsidian-livesync", + "name": "Self-hosted LiveSync", + "version": "0.25.57", + "minAppVersion": "0.9.12", + "description": "Community implementation of self-hosted livesync. Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.", + "author": "vorotamoroz", + "authorUrl": "https://github.com/vrtmrz", + "isDesktopOnly": false +} diff --git a/.obsidian/plugins/obsidian-livesync/styles.css b/.obsidian/plugins/obsidian-livesync/styles.css new file mode 100644 index 0000000..a3b1792 --- /dev/null +++ b/.obsidian/plugins/obsidian-livesync/styles.css @@ -0,0 +1,487 @@ +.ls-dialog .added { + color: var(--text-on-accent); + background-color: var(--text-accent); +} + +.ls-dialog .normal { + color: var(--text-normal); +} + +.ls-dialog .deleted { + color: var(--text-on-accent); + background-color: var(--text-muted); +} + +.conflict-dev-name { + display: inline-block; + min-width: 5em; +} + +.op-scrollable { + overflow-y: scroll; + /* min-height: 280px; */ + max-height: 280px; + user-select: text; + -webkit-user-select: text; +} + +.op-pre { + white-space: pre-wrap; +} + +.op-warn { + border: 1px solid salmon; + padding: 2px; + border-radius: 4px; +} + +.op-warn::before { + content: "Warning"; + font-weight: bold; + color: salmon; + position: relative; + display: block; +} + +.op-warn-info { + border: 1px solid rgb(255, 209, 81); + padding: 2px; + border-radius: 4px; +} + +.op-warn-info::before { + content: "Notice"; + font-weight: bold; + color: rgb(255, 209, 81); + position: relative; + display: block; +} + +.syncstatusbar { + -webkit-filter: grayscale(100%); + filter: grayscale(100%); +} + +.tcenter { + text-align: center; +} + +.sls-plugins-wrap { + display: flex; + flex-grow: 1; + max-height: 50vh; + overflow-y: scroll; +} + +.sls-remote-list .setting-item-description { + white-space: normal; + overflow-wrap: anywhere; + word-break: break-word; +} + +.sls-plugins-tbl { + border: 1px solid var(--background-modifier-border); + width: 100%; + max-height: 80%; +} + +.divider th { + border-top: 1px solid var(--background-modifier-border); +} + +.sls-header-button { + margin-left: 2em; +} + +.sls-hidden { + display: none; +} + +:root { + --sls-log-text: ""; +} + +.sls-troubleshoot-preview { + max-width: max-content; +} + +.sls-troubleshoot-preview img { + max-width: 100%; +} + +.sls-setting-tab { + display: none; +} + +div.sls-setting-menu-btn { + color: var(--text-normal); + background-color: var(--background-secondary-alt); + border-radius: 8px; + padding: 6px 10px; + cursor: pointer; + margin-right: 2px; + font-family: "Inter", sans-serif; + outline: none; + user-select: none; + flex-grow: 1; + text-align: center; + flex-shrink: 1; +} + +.sls-setting-label.selected { + /* order: 1; */ + flex-grow: 1; + /* width: 100%; */ +} + +.sls-setting-tab:hover~div.sls-setting-menu-btn, +.sls-setting-label.selected .sls-setting-tab:checked~div.sls-setting-menu-btn { + background-color: var(--interactive-accent); + color: var(--text-on-accent); +} + +.sls-setting-menu-wrapper { + display: flex; + flex-direction: column; + flex-grow: 1; + position: sticky; + top: 0; + backdrop-filter: blur(15px); + padding: 4px; + border-radius: 10px; + z-index: 10; +} + +.sls-setting-menu { + display: flex; + flex-direction: row; + overflow-x: auto; +} + +body { + --sls-col-transparent: transparent; + --sls-col-warn: rgba(var(--background-modifier-error-rgb), 0.1); + --sls-col-warn-stripe1: var(--sls-col-transparent); + --sls-col-warn-stripe2: var(--sls-col-warn); +} + +.sls-setting-menu-buttons { + border: 1px solid var(--sls-col-warn); + padding: 2px; + margin: 1px; + border-radius: 4px; + background-image: linear-gradient(-45deg, + var(--sls-col-warn-stripe1) 25%, var(--sls-col-warn-stripe2) 25%, var(--sls-col-warn-stripe2) 50%, + var(--sls-col-warn-stripe1) 50%, var(--sls-col-warn-stripe1) 75%, var(--sls-col-warn-stripe2) 75%, var(--sls-col-warn-stripe2)); + background-size: 30px 30px; + display: flex; + flex-direction: row; + justify-content: flex-end; + padding: 0.5em 0.25em; + justify-content: center; + align-items: center; + /* transition: background-position 1s; */ + animation: sls-scroll-warn 1s linear 0s infinite; +} + +@keyframes sls-scroll-warn { + 0% { + background-position: 0 0; + } + + 100% { + background-position: 30px 0; + } + +} + +.sls-setting-menu-buttons label { + margin-right: auto; + flex-grow: 1; + color: var(--text-warning); +} + +.sls-setting-label { + flex-grow: 1; + display: inline-flex; + justify-content: center; +} + +.setting-collapsed { + display: none; +} + +.sls-plugins-tbl-buttons { + text-align: right; +} + +.sls-plugins-tbl-buttons button { + flex-grow: 0; + padding: 6px 10px; +} + +.sls-plugins-tbl-device-head { + background-color: var(--background-secondary-alt); + color: var(--text-accent); +} + +.op-flex { + display: flex; +} + +.op-flex input { + display: inline-flex; + flex-grow: 1; + margin-bottom: 8px; +} + +.op-info { + display: inline-flex; + flex-grow: 1; + border-bottom: 1px solid var(--background-modifier-border); + width: 100%; + margin-bottom: 4px; + padding-bottom: 4px; +} + +.history-added { + color: var(--text-on-accent); + background-color: var(--text-accent); +} + +.history-normal { + color: var(--text-normal); +} + +.history-deleted { + color: var(--text-on-accent); + background-color: var(--text-muted); + text-decoration: line-through; +} + +.ob-btn-config-fix label { + margin-right: 40px; +} + +.ob-btn-config-info { + border: 1px solid salmon; + padding: 2px; + margin: 1px; + border-radius: 4px; +} + +.ob-btn-config-head { + padding: 2px; + margin: 1px; + border-radius: 4px; +} + +.isWizard .wizardHidden { + display: none; +} + +.sls-setting:not(.isWizard) .wizardOnly { + display: none; +} + +.sls-item-dirty::before { + content: "✏"; +} + +.sls-item-dirty-help::after { + content: " ❓"; +} + +.sls-item-invalid-value { + background-color: rgba(var(--background-modifier-error-rgb), 0.3) !important; +} + +.sls-setting-disabled input[type=text], +.sls-setting-disabled input[type=number], +.sls-setting-disabled input[type=password] { + filter: brightness(80%); + color: var(--text-muted); + +} + +.sls-setting-hidden { + display: none; +} + + + +.sls-setting-obsolete { + background-image: linear-gradient(-45deg, + var(--sls-col-warn-stripe1) 25%, var(--sls-col-warn-stripe2) 25%, var(--sls-col-warn-stripe2) 50%, + var(--sls-col-warn-stripe1) 50%, var(--sls-col-warn-stripe1) 75%, var(--sls-col-warn-stripe2) 75%, var(--sls-col-warn-stripe2)); + background-image: linear-gradient(-45deg, + transparent 25%, rgba(var(--background-secondary), 0.1) 25%, rgba(var(--background-secondary), 0.1) 50%, transparent 50%, transparent 75%, rgba(var(--background-secondary), 0.1) 75%, rgba(var(--background-secondary), 0.1)); + background-size: 60px 60px; +} + +.password-input>.setting-item-control>input { + -webkit-text-security: disc; +} + +span.ls-mark-cr::after { + user-select: none; + content: "↲"; + color: var(--text-muted); + font-size: 0.8em; +} + +.deleted span.ls-mark-cr::after { + color: var(--text-on-accent); +} + +.ls-imgdiff-wrap { + display: flex; + justify-content: center; + align-items: center; +} + +.ls-imgdiff-wrap .overlay { + position: relative; +} + +.ls-imgdiff-wrap .overlay .img-base { + position: relative; + top: 0; + left: 0; +} + +.ls-imgdiff-wrap .overlay .img-overlay { + -webkit-filter: invert(100%) opacity(50%); + filter: invert(100%) opacity(50%); + position: absolute; + top: 0; + left: 0; + animation: ls-blink-diff 0.5s cubic-bezier(0.4, 0, 1, 1) infinite alternate; +} + +@keyframes ls-blink-diff { + 0% { + opacity: 0; + } + + 50% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + + +.livesync-status { + user-select: none; + pointer-events: none; + height: auto; + min-height: 1em; + position: absolute; + background-color: transparent; + width: 100%; + padding: 10px; + padding-right: 16px; + top: var(--header-height); + z-index: calc(var(--layer-cover) + 1); + + font-variant-numeric: tabular-nums; + tab-size: 4; + text-align: right; + white-space: pre-wrap; + display: inline-block; + color: var(--text-normal); + font-size: 80%; +} + +div.workspace-leaf-content[data-type=bases] .livesync-status { + top: calc(var(--bases-header-height) + var(--header-height)); + padding: 5px; + padding-right: 18px; +} + +.is-mobile div.workspace-leaf-content[data-type=bases] .livesync-status { + top: calc(var(--bases-header-height) + var(--view-header-height)); + padding: 6px; + padding-right: 18px; +} + +.livesync-status div { + opacity: 0.6; + -webkit-filter: grayscale(100%); + filter: grayscale(100%); +} + +.livesync-status .livesync-status-loghistory { + text-align: left; + opacity: 0.4; + +} + +.livesync-status div.livesync-status-messagearea:empty { + display: none; +} + +.livesync-status div.livesync-status-messagearea:not(:empty) { + opacity: 0.6; + color: var(--text-on-accent); + border: 1px solid var(--background-modifier-error); + background-color: rgba(var(--background-modifier-error-rgb), 0.2); + -webkit-filter: unset; + filter: unset; + width: fit-content; + margin-left: auto; +} + + +.menu-setting-poweruser-disabled .sls-setting-poweruser { + display: none; +} + +.menu-setting-advanced-disabled .sls-setting-advanced { + display: none; +} + +.menu-setting-edgecase-disabled .sls-setting-edgecase { + display: none; +} + +.sls-setting-panel-title { + position: sticky; + font-size: medium; + top: 2.5em; + background-color: var(--background-secondary-alt); + border-radius: 10px; + padding: 0.5em 1.0em; +} + +.active-pane .sls-setting-panel-title { + border: 1px solid var(--interactive-accent); +} + +.sls-dialogue-note-wrapper { + display: flex; + justify-content: flex-end; + align-items: center; +} + +.sls-dialogue-note-countdown { + font-size: 0.8em; +} + +.sls-qr { + display: flex; + justify-content: center; + align-items: center; + max-width: max-content; +} + +.sls-keypair pre { + max-width: 100%; + overflow-x: auto; + white-space: pre-wrap; + word-break: break-all; + +} \ No newline at end of file diff --git a/.obsidian/plugins/remotely-secure/.gitignore b/.obsidian/plugins/remotely-secure/.gitignore deleted file mode 100644 index 2d46485..0000000 --- a/.obsidian/plugins/remotely-secure/.gitignore +++ /dev/null @@ -1 +0,0 @@ -data.json diff --git a/.obsidian/plugins/remotely-secure/main.js b/.obsidian/plugins/remotely-secure/main.js deleted file mode 100644 index 6ea09db..0000000 --- a/.obsidian/plugins/remotely-secure/main.js +++ /dev/null @@ -1,235 +0,0 @@ -/* -THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source, please visit the github repository of this plugin -*/ - -var ine=Object.create;var zg=Object.defineProperty;var one=Object.getOwnPropertyDescriptor;var sne=Object.getOwnPropertyNames;var ane=Object.getPrototypeOf,cne=Object.prototype.hasOwnProperty;var une=(t,e)=>()=>(t&&(e=t(t=0)),e);var F=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Mu=(t,e)=>{for(var r in e)zg(t,r,{get:e[r],enumerable:!0})},h6=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of sne(e))!cne.call(t,n)&&n!==r&&zg(t,n,{get:()=>e[n],enumerable:!(i=one(e,n))||i.enumerable});return t};var Et=(t,e,r)=>(r=t!=null?ine(ane(t)):{},h6(e||!t||!t.__esModule?zg(r,"default",{value:t,enumerable:!0}):r,t)),lne=t=>h6(zg({},"__esModule",{value:!0}),t);var Ix=F(Hg=>{"use strict";m();Hg.byteLength=dne;Hg.toByteArray=pne;Hg.fromByteArray=yne;var ys=[],co=[],fne=typeof Uint8Array<"u"?Uint8Array:Array,kx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ru=0,p6=kx.length;Ru0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function dne(t){var e=m6(t),r=e[0],i=e[1];return(r+i)*3/4-i}function hne(t,e,r){return(e+r)*3/4-r}function pne(t){var e,r=m6(t),i=r[0],n=r[1],o=new fne(hne(t,i,n)),c=0,u=n>0?i-4:i,d;for(d=0;d>16&255,o[c++]=e>>8&255,o[c++]=e&255;return n===2&&(e=co[t.charCodeAt(d)]<<2|co[t.charCodeAt(d+1)]>>4,o[c++]=e&255),n===1&&(e=co[t.charCodeAt(d)]<<10|co[t.charCodeAt(d+1)]<<4|co[t.charCodeAt(d+2)]>>2,o[c++]=e>>8&255,o[c++]=e&255),o}function mne(t){return ys[t>>18&63]+ys[t>>12&63]+ys[t>>6&63]+ys[t&63]}function gne(t,e,r){for(var i,n=[],o=e;ou?u:c+o));return i===1?(e=t[r-1],n.push(ys[e>>2]+ys[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(ys[e>>10]+ys[e>>4&63]+ys[e<<2&63]+"=")),n.join("")}});var Px=F(Ox=>{m();Ox.read=function(t,e,r,i,n){var o,c,u=n*8-i-1,d=(1<>1,E=-7,x=r?n-1:0,A=r?-1:1,R=t[e+x];for(x+=A,o=R&(1<<-E)-1,R>>=-E,E+=u;E>0;o=o*256+t[e+x],x+=A,E-=8);for(c=o&(1<<-E)-1,o>>=-E,E+=i;E>0;c=c*256+t[e+x],x+=A,E-=8);if(o===0)o=1-y;else{if(o===d)return c?NaN:(R?-1:1)*(1/0);c=c+Math.pow(2,i),o=o-y}return(R?-1:1)*c*Math.pow(2,o-i)};Ox.write=function(t,e,r,i,n,o){var c,u,d,y=o*8-n-1,E=(1<>1,A=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=i?0:o-1,M=i?1:-1,I=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,c=E):(c=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-c))<1&&(c--,d*=2),c+x>=1?e+=A/d:e+=A*Math.pow(2,1-x),e*d>=2&&(c++,d/=2),c+x>=E?(u=0,c=E):c+x>=1?(u=(e*d-1)*Math.pow(2,n),c=c+x):(u=e*Math.pow(2,x-1)*Math.pow(2,n),c=0));n>=8;t[r+R]=u&255,R+=M,u/=256,n-=8);for(c=c<0;t[r+R]=c&255,R+=M,c/=256,y-=8);t[r+R-M]|=I*128}});var xn=F(Hf=>{"use strict";m();var Nx=Ix(),jf=Px(),g6=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Hf.Buffer=$e;Hf.SlowBuffer=Ene;Hf.INSPECT_MAX_BYTES=50;var $g=2147483647;Hf.kMaxLength=$g;$e.TYPED_ARRAY_SUPPORT=vne();!$e.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function vne(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty($e.prototype,"parent",{enumerable:!0,get:function(){if(!!$e.isBuffer(this))return this.buffer}});Object.defineProperty($e.prototype,"offset",{enumerable:!0,get:function(){if(!!$e.isBuffer(this))return this.byteOffset}});function ta(t){if(t>$g)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,$e.prototype),e}function $e(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return qx(t)}return _6(t,e,r)}$e.poolSize=8192;function _6(t,e,r){if(typeof t=="string")return _ne(t,e);if(ArrayBuffer.isView(t))return wne(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(vs(t,ArrayBuffer)||t&&vs(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(vs(t,SharedArrayBuffer)||t&&vs(t.buffer,SharedArrayBuffer)))return Fx(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return $e.from(i,e,r);let n=xne(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return $e.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}$e.from=function(t,e,r){return _6(t,e,r)};Object.setPrototypeOf($e.prototype,Uint8Array.prototype);Object.setPrototypeOf($e,Uint8Array);function w6(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function bne(t,e,r){return w6(t),t<=0?ta(t):e!==void 0?typeof r=="string"?ta(t).fill(e,r):ta(t).fill(e):ta(t)}$e.alloc=function(t,e,r){return bne(t,e,r)};function qx(t){return w6(t),ta(t<0?0:Ux(t)|0)}$e.allocUnsafe=function(t){return qx(t)};$e.allocUnsafeSlow=function(t){return qx(t)};function _ne(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!$e.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=x6(t,e)|0,i=ta(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function Bx(t){let e=t.length<0?0:Ux(t.length)|0,r=ta(e);for(let i=0;i=$g)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$g.toString(16)+" bytes");return t|0}function Ene(t){return+t!=t&&(t=0),$e.alloc(+t)}$e.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==$e.prototype};$e.compare=function(e,r){if(vs(e,Uint8Array)&&(e=$e.from(e,e.offset,e.byteLength)),vs(r,Uint8Array)&&(r=$e.from(r,r.offset,r.byteLength)),!$e.isBuffer(e)||!$e.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let o=0,c=Math.min(i,n);on.length?($e.isBuffer(c)||(c=$e.from(c)),c.copy(n,o)):Uint8Array.prototype.set.call(n,c,o);else if($e.isBuffer(c))c.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=c.length}return n};function x6(t,e){if($e.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||vs(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Lx(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return k6(t).length;default:if(n)return i?-1:Lx(t).length;e=(""+e).toLowerCase(),n=!0}}$e.byteLength=x6;function Sne(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Pne(this,e,r);case"utf8":case"utf-8":return S6(this,e,r);case"ascii":return Ine(this,e,r);case"latin1":case"binary":return One(this,e,r);case"base64":return Dne(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nne(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}$e.prototype._isBuffer=!0;function Du(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}$e.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;rr&&(e+=" ... "),""};g6&&($e.prototype[g6]=$e.prototype.inspect);$e.prototype.compare=function(e,r,i,n,o){if(vs(e,Uint8Array)&&(e=$e.from(e,e.offset,e.byteLength)),!$e.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let c=o-n,u=i-r,d=Math.min(c,u),y=this.slice(n,o),E=e.slice(r,i);for(let x=0;x2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,zx(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=$e.from(e,i)),$e.isBuffer(e))return e.length===0?-1:y6(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y6(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y6(t,e,r,i,n){let o=1,c=t.length,u=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,c/=2,u/=2,r/=2}function d(E,x){return o===1?E[x]:E.readUInt16BE(x*o)}let y;if(n){let E=-1;for(y=r;yc&&(r=c-u),y=r;y>=0;y--){let E=!0;for(let x=0;xn&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let c;for(c=0;c>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let c=!1;for(;;)switch(n){case"hex":return Cne(this,e,r,i);case"utf8":case"utf-8":return Ane(this,e,r,i);case"ascii":case"latin1":case"binary":return Tne(this,e,r,i);case"base64":return Mne(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rne(this,e,r,i);default:if(c)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),c=!0}};$e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Dne(t,e,r){return e===0&&r===t.length?Nx.fromByteArray(t):Nx.fromByteArray(t.slice(e,r))}function S6(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n239?4:o>223?3:o>191?2:1;if(n+u<=r){let d,y,E,x;switch(u){case 1:o<128&&(c=o);break;case 2:d=t[n+1],(d&192)===128&&(x=(o&31)<<6|d&63,x>127&&(c=x));break;case 3:d=t[n+1],y=t[n+2],(d&192)===128&&(y&192)===128&&(x=(o&15)<<12|(d&63)<<6|y&63,x>2047&&(x<55296||x>57343)&&(c=x));break;case 4:d=t[n+1],y=t[n+2],E=t[n+3],(d&192)===128&&(y&192)===128&&(E&192)===128&&(x=(o&15)<<18|(d&63)<<12|(y&63)<<6|E&63,x>65535&&x<1114112&&(c=x))}}c===null?(c=65533,u=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|c&1023),i.push(c),n+=u}return kne(i)}var v6=4096;function kne(t){let e=t.length;if(e<=v6)return String.fromCharCode.apply(String,t);let r="",i=0;for(;ii)&&(r=i);let n="";for(let o=e;oi&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),rr)throw new RangeError("Trying to access beyond buffer length")}$e.prototype.readUintLE=$e.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Un(e,r,this.length);let n=this[e],o=1,c=0;for(;++c>>0,r=r>>>0,i||Un(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n};$e.prototype.readUint8=$e.prototype.readUInt8=function(e,r){return e=e>>>0,r||Un(e,1,this.length),this[e]};$e.prototype.readUint16LE=$e.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Un(e,2,this.length),this[e]|this[e+1]<<8};$e.prototype.readUint16BE=$e.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Un(e,2,this.length),this[e]<<8|this[e+1]};$e.prototype.readUint32LE=$e.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Un(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};$e.prototype.readUint32BE=$e.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Un(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};$e.prototype.readBigUInt64LE=rc(function(e){e=e>>>0,zf(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Bp(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<>>0,zf(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Bp(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<>>0,r=r>>>0,i||Un(e,r,this.length);let n=this[e],o=1,c=0;for(;++c=o&&(n-=Math.pow(2,8*r)),n};$e.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Un(e,r,this.length);let n=r,o=1,c=this[e+--n];for(;n>0&&(o*=256);)c+=this[e+--n]*o;return o*=128,c>=o&&(c-=Math.pow(2,8*r)),c};$e.prototype.readInt8=function(e,r){return e=e>>>0,r||Un(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};$e.prototype.readInt16LE=function(e,r){e=e>>>0,r||Un(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};$e.prototype.readInt16BE=function(e,r){e=e>>>0,r||Un(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};$e.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Un(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};$e.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Un(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};$e.prototype.readBigInt64LE=rc(function(e){e=e>>>0,zf(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Bp(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<>>0,zf(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Bp(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,r||Un(e,4,this.length),jf.read(this,e,!0,23,4)};$e.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Un(e,4,this.length),jf.read(this,e,!1,23,4)};$e.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Un(e,8,this.length),jf.read(this,e,!0,52,8)};$e.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Un(e,8,this.length),jf.read(this,e,!1,52,8)};function Ni(t,e,r,i,n,o){if(!$e.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}$e.prototype.writeUintLE=$e.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let u=Math.pow(2,8*i)-1;Ni(this,e,r,i,u,0)}let o=1,c=0;for(this[r]=e&255;++c>>0,i=i>>>0,!n){let u=Math.pow(2,8*i)-1;Ni(this,e,r,i,u,0)}let o=i-1,c=1;for(this[r+o]=e&255;--o>=0&&(c*=256);)this[r+o]=e/c&255;return r+i};$e.prototype.writeUint8=$e.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||Ni(this,e,r,1,255,0),this[r]=e&255,r+1};$e.prototype.writeUint16LE=$e.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||Ni(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};$e.prototype.writeUint16BE=$e.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||Ni(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};$e.prototype.writeUint32LE=$e.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||Ni(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};$e.prototype.writeUint32BE=$e.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||Ni(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function C6(t,e,r,i,n){D6(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let c=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=c,c=c>>8,t[r++]=c,c=c>>8,t[r++]=c,c=c>>8,t[r++]=c,r}function A6(t,e,r,i,n){D6(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let c=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=c,c=c>>8,t[r+2]=c,c=c>>8,t[r+1]=c,c=c>>8,t[r]=c,r+8}$e.prototype.writeBigUInt64LE=rc(function(e,r=0){return C6(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});$e.prototype.writeBigUInt64BE=rc(function(e,r=0){return A6(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});$e.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let d=Math.pow(2,8*i-1);Ni(this,e,r,i,d-1,-d)}let o=0,c=1,u=0;for(this[r]=e&255;++o>0)-u&255;return r+i};$e.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let d=Math.pow(2,8*i-1);Ni(this,e,r,i,d-1,-d)}let o=i-1,c=1,u=0;for(this[r+o]=e&255;--o>=0&&(c*=256);)e<0&&u===0&&this[r+o+1]!==0&&(u=1),this[r+o]=(e/c>>0)-u&255;return r+i};$e.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||Ni(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};$e.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||Ni(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};$e.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||Ni(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};$e.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||Ni(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};$e.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||Ni(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};$e.prototype.writeBigInt64LE=rc(function(e,r=0){return C6(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$e.prototype.writeBigInt64BE=rc(function(e,r=0){return A6(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function T6(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M6(t,e,r,i,n){return e=+e,r=r>>>0,n||T6(t,e,r,4,34028234663852886e22,-34028234663852886e22),jf.write(t,e,r,i,23,4),r+4}$e.prototype.writeFloatLE=function(e,r,i){return M6(this,e,r,!0,i)};$e.prototype.writeFloatBE=function(e,r,i){return M6(this,e,r,!1,i)};function R6(t,e,r,i,n){return e=+e,r=r>>>0,n||T6(t,e,r,8,17976931348623157e292,-17976931348623157e292),jf.write(t,e,r,i,52,8),r+8}$e.prototype.writeDoubleLE=function(e,r,i){return R6(this,e,r,!0,i)};$e.prototype.writeDoubleBE=function(e,r,i){return R6(this,e,r,!1,i)};$e.prototype.copy=function(e,r,i,n){if(!$e.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o2**32?n=b6(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=b6(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function b6(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Bne(t,e,r){zf(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Bp(e,t.length-(r+1))}function D6(t,e,r,i,n,o){if(t>r||t3?e===0||e===BigInt(0)?u=`>= 0${c} and < 2${c} ** ${(o+1)*8}${c}`:u=`>= -(2${c} ** ${(o+1)*8-1}${c}) and < 2 ** ${(o+1)*8-1}${c}`:u=`>= ${e}${c} and <= ${r}${c}`,new Uf.ERR_OUT_OF_RANGE("value",u,t)}Bne(i,n,o)}function zf(t,e){if(typeof t!="number")throw new Uf.ERR_INVALID_ARG_TYPE(e,"number",t)}function Bp(t,e,r){throw Math.floor(t)!==t?(zf(t,r),new Uf.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Uf.ERR_BUFFER_OUT_OF_BOUNDS:new Uf.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Fne=/[^+/0-9A-Za-z-_]/g;function Lne(t){if(t=t.split("=")[0],t=t.trim().replace(Fne,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Lx(t,e){e=e||1/0;let r,i=t.length,n=null,o=[];for(let c=0;c55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(c+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function qne(t){let e=[];for(let r=0;r>8,n=r%256,o.push(n),o.push(i);return o}function k6(t){return Nx.toByteArray(Lne(t))}function Gg(t,e,r,i){let n;for(n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function vs(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function zx(t){return t!==t}var jne=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function rc(t){return typeof BigInt>"u"?zne:t}function zne(){throw new Error("BigInt not supported")}});var B6=F((z5e,N6)=>{m();var mn=N6.exports={},bs,_s;function Hx(){throw new Error("setTimeout has not been defined")}function $x(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?bs=setTimeout:bs=Hx}catch{bs=Hx}try{typeof clearTimeout=="function"?_s=clearTimeout:_s=$x}catch{_s=$x}})();function I6(t){if(bs===setTimeout)return setTimeout(t,0);if((bs===Hx||!bs)&&setTimeout)return bs=setTimeout,setTimeout(t,0);try{return bs(t,0)}catch{try{return bs.call(null,t,0)}catch{return bs.call(this,t,0)}}}function Hne(t){if(_s===clearTimeout)return clearTimeout(t);if((_s===$x||!_s)&&clearTimeout)return _s=clearTimeout,clearTimeout(t);try{return _s(t)}catch{try{return _s.call(null,t)}catch{return _s.call(this,t)}}}var ra=[],$f=!1,ku,Kg=-1;function $ne(){!$f||!ku||($f=!1,ku.length?ra=ku.concat(ra):Kg=-1,ra.length&&O6())}function O6(){if(!$f){var t=I6($ne);$f=!0;for(var e=ra.length;e;){for(ku=ra,ra=[];++Kg1)for(var r=1;r{T=xn().Buffer,C=B6()});var L6=F(($5e,F6)=>{m();function Gne(){this.__data__=[],this.size=0}F6.exports=Gne});var Fp=F((G5e,q6)=>{m();function Kne(t,e){return t===e||t!==t&&e!==e}q6.exports=Kne});var Lp=F((K5e,U6)=>{m();var Vne=Fp();function Wne(t,e){for(var r=t.length;r--;)if(Vne(t[r][0],e))return r;return-1}U6.exports=Wne});var z6=F((V5e,j6)=>{m();var Yne=Lp(),Qne=Array.prototype,Jne=Qne.splice;function Xne(t){var e=this.__data__,r=Yne(e,t);if(r<0)return!1;var i=e.length-1;return r==i?e.pop():Jne.call(e,r,1),--this.size,!0}j6.exports=Xne});var $6=F((W5e,H6)=>{m();var Zne=Lp();function eie(t){var e=this.__data__,r=Zne(e,t);return r<0?void 0:e[r][1]}H6.exports=eie});var K6=F((Y5e,G6)=>{m();var tie=Lp();function rie(t){return tie(this.__data__,t)>-1}G6.exports=rie});var W6=F((Q5e,V6)=>{m();var nie=Lp();function iie(t,e){var r=this.__data__,i=nie(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}V6.exports=iie});var qp=F((J5e,Y6)=>{m();var oie=L6(),sie=z6(),aie=$6(),cie=K6(),uie=W6();function Gf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{m();var lie=qp();function fie(){this.__data__=new lie,this.size=0}Q6.exports=fie});var Z6=F((Z5e,X6)=>{m();function die(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}X6.exports=die});var tD=F((eNe,eD)=>{m();function hie(t){return this.__data__.get(t)}eD.exports=hie});var nD=F((tNe,rD)=>{m();function pie(t){return this.__data__.has(t)}rD.exports=pie});var Gx=F((rNe,iD)=>{m();var mie=typeof window=="object"&&window&&window.Object===Object&&window;iD.exports=mie});var $o=F((nNe,oD)=>{m();var gie=Gx(),yie=typeof self=="object"&&self&&self.Object===Object&&self,vie=gie||yie||Function("return this")();oD.exports=vie});var Kf=F((iNe,sD)=>{m();var bie=$o(),_ie=bie.Symbol;sD.exports=_ie});var lD=F((oNe,uD)=>{m();var aD=Kf(),cD=Object.prototype,wie=cD.hasOwnProperty,xie=cD.toString,Up=aD?aD.toStringTag:void 0;function Eie(t){var e=wie.call(t,Up),r=t[Up];try{t[Up]=void 0;var i=!0}catch{}var n=xie.call(t);return i&&(e?t[Up]=r:delete t[Up]),n}uD.exports=Eie});var dD=F((sNe,fD)=>{m();var Sie=Object.prototype,Cie=Sie.toString;function Aie(t){return Cie.call(t)}fD.exports=Aie});var Vf=F((aNe,mD)=>{m();var hD=Kf(),Tie=lD(),Mie=dD(),Rie="[object Null]",Die="[object Undefined]",pD=hD?hD.toStringTag:void 0;function kie(t){return t==null?t===void 0?Die:Rie:pD&&pD in Object(t)?Tie(t):Mie(t)}mD.exports=kie});var nc=F((cNe,gD)=>{m();function Iie(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}gD.exports=Iie});var Kx=F((uNe,yD)=>{m();var Oie=Vf(),Pie=nc(),Nie="[object AsyncFunction]",Bie="[object Function]",Fie="[object GeneratorFunction]",Lie="[object Proxy]";function qie(t){if(!Pie(t))return!1;var e=Oie(t);return e==Bie||e==Fie||e==Nie||e==Lie}yD.exports=qie});var bD=F((lNe,vD)=>{m();var Uie=$o(),jie=Uie["__core-js_shared__"];vD.exports=jie});var xD=F((fNe,wD)=>{m();var Vx=bD(),_D=function(){var t=/[^.]+$/.exec(Vx&&Vx.keys&&Vx.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function zie(t){return!!_D&&_D in t}wD.exports=zie});var Wx=F((dNe,ED)=>{m();var Hie=Function.prototype,$ie=Hie.toString;function Gie(t){if(t!=null){try{return $ie.call(t)}catch{}try{return t+""}catch{}}return""}ED.exports=Gie});var CD=F((hNe,SD)=>{m();var Kie=Kx(),Vie=xD(),Wie=nc(),Yie=Wx(),Qie=/[\\^$.*+?()[\]{}|]/g,Jie=/^\[object .+?Constructor\]$/,Xie=Function.prototype,Zie=Object.prototype,eoe=Xie.toString,toe=Zie.hasOwnProperty,roe=RegExp("^"+eoe.call(toe).replace(Qie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function noe(t){if(!Wie(t)||Vie(t))return!1;var e=Kie(t)?roe:Jie;return e.test(Yie(t))}SD.exports=noe});var TD=F((pNe,AD)=>{m();function ioe(t,e){return t?.[e]}AD.exports=ioe});var ic=F((mNe,MD)=>{m();var ooe=CD(),soe=TD();function aoe(t,e){var r=soe(t,e);return ooe(r)?r:void 0}MD.exports=aoe});var Vg=F((gNe,RD)=>{m();var coe=ic(),uoe=$o(),loe=coe(uoe,"Map");RD.exports=loe});var jp=F((yNe,DD)=>{m();var foe=ic(),doe=foe(Object,"create");DD.exports=doe});var OD=F((vNe,ID)=>{m();var kD=jp();function hoe(){this.__data__=kD?kD(null):{},this.size=0}ID.exports=hoe});var ND=F((bNe,PD)=>{m();function poe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}PD.exports=poe});var FD=F((_Ne,BD)=>{m();var moe=jp(),goe="__lodash_hash_undefined__",yoe=Object.prototype,voe=yoe.hasOwnProperty;function boe(t){var e=this.__data__;if(moe){var r=e[t];return r===goe?void 0:r}return voe.call(e,t)?e[t]:void 0}BD.exports=boe});var qD=F((wNe,LD)=>{m();var _oe=jp(),woe=Object.prototype,xoe=woe.hasOwnProperty;function Eoe(t){var e=this.__data__;return _oe?e[t]!==void 0:xoe.call(e,t)}LD.exports=Eoe});var jD=F((xNe,UD)=>{m();var Soe=jp(),Coe="__lodash_hash_undefined__";function Aoe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Soe&&e===void 0?Coe:e,this}UD.exports=Aoe});var HD=F((ENe,zD)=>{m();var Toe=OD(),Moe=ND(),Roe=FD(),Doe=qD(),koe=jD();function Wf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{m();var $D=HD(),Ioe=qp(),Ooe=Vg();function Poe(){this.size=0,this.__data__={hash:new $D,map:new(Ooe||Ioe),string:new $D}}GD.exports=Poe});var WD=F((CNe,VD)=>{m();function Noe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}VD.exports=Noe});var zp=F((ANe,YD)=>{m();var Boe=WD();function Foe(t,e){var r=t.__data__;return Boe(e)?r[typeof e=="string"?"string":"hash"]:r.map}YD.exports=Foe});var JD=F((TNe,QD)=>{m();var Loe=zp();function qoe(t){var e=Loe(this,t).delete(t);return this.size-=e?1:0,e}QD.exports=qoe});var ZD=F((MNe,XD)=>{m();var Uoe=zp();function joe(t){return Uoe(this,t).get(t)}XD.exports=joe});var tk=F((RNe,ek)=>{m();var zoe=zp();function Hoe(t){return zoe(this,t).has(t)}ek.exports=Hoe});var nk=F((DNe,rk)=>{m();var $oe=zp();function Goe(t,e){var r=$oe(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}rk.exports=Goe});var Yx=F((kNe,ik)=>{m();var Koe=KD(),Voe=JD(),Woe=ZD(),Yoe=tk(),Qoe=nk();function Yf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{m();var Joe=qp(),Xoe=Vg(),Zoe=Yx(),ese=200;function tse(t,e){var r=this.__data__;if(r instanceof Joe){var i=r.__data__;if(!Xoe||i.length{m();var rse=qp(),nse=J6(),ise=Z6(),ose=tD(),sse=nD(),ase=sk();function Qf(t){var e=this.__data__=new rse(t);this.size=e.size}Qf.prototype.clear=nse;Qf.prototype.delete=ise;Qf.prototype.get=ose;Qf.prototype.has=sse;Qf.prototype.set=ase;ak.exports=Qf});var uk=F((PNe,ck)=>{m();function cse(t,e){for(var r=-1,i=t==null?0:t.length;++r{m();var use=ic(),lse=function(){try{var t=use(Object,"defineProperty");return t({},"",{}),t}catch{}}();lk.exports=lse});var Jx=F((BNe,hk)=>{m();var dk=fk();function fse(t,e,r){e=="__proto__"&&dk?dk(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}hk.exports=fse});var Xx=F((FNe,pk)=>{m();var dse=Jx(),hse=Fp(),pse=Object.prototype,mse=pse.hasOwnProperty;function gse(t,e,r){var i=t[e];(!(mse.call(t,e)&&hse(i,r))||r===void 0&&!(e in t))&&dse(t,e,r)}pk.exports=gse});var Hp=F((LNe,mk)=>{m();var yse=Xx(),vse=Jx();function bse(t,e,r,i){var n=!r;r||(r={});for(var o=-1,c=e.length;++o{m();function _se(t,e){for(var r=-1,i=Array(t);++r{m();function wse(t){return t!=null&&typeof t=="object"}vk.exports=wse});var _k=F((jNe,bk)=>{m();var xse=Vf(),Ese=oc(),Sse="[object Arguments]";function Cse(t){return Ese(t)&&xse(t)==Sse}bk.exports=Cse});var Zx=F((zNe,Ek)=>{m();var wk=_k(),Ase=oc(),xk=Object.prototype,Tse=xk.hasOwnProperty,Mse=xk.propertyIsEnumerable,Rse=wk(function(){return arguments}())?wk:function(t){return Ase(t)&&Tse.call(t,"callee")&&!Mse.call(t,"callee")};Ek.exports=Rse});var Jf=F((HNe,Sk)=>{m();var Dse=Array.isArray;Sk.exports=Dse});var Ak=F(($Ne,Ck)=>{m();function kse(){return!1}Ck.exports=kse});var Wg=F(($p,Xf)=>{m();var Ise=$o(),Ose=Ak(),Rk=typeof $p=="object"&&$p&&!$p.nodeType&&$p,Tk=Rk&&typeof Xf=="object"&&Xf&&!Xf.nodeType&&Xf,Pse=Tk&&Tk.exports===Rk,Mk=Pse?Ise.Buffer:void 0,Nse=Mk?Mk.isBuffer:void 0,Bse=Nse||Ose;Xf.exports=Bse});var eE=F((GNe,Dk)=>{m();var Fse=9007199254740991,Lse=/^(?:0|[1-9]\d*)$/;function qse(t,e){var r=typeof t;return e=e??Fse,!!e&&(r=="number"||r!="symbol"&&Lse.test(t))&&t>-1&&t%1==0&&t{m();var Use=9007199254740991;function jse(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Use}kk.exports=jse});var Ok=F((VNe,Ik)=>{m();var zse=Vf(),Hse=tE(),$se=oc(),Gse="[object Arguments]",Kse="[object Array]",Vse="[object Boolean]",Wse="[object Date]",Yse="[object Error]",Qse="[object Function]",Jse="[object Map]",Xse="[object Number]",Zse="[object Object]",eae="[object RegExp]",tae="[object Set]",rae="[object String]",nae="[object WeakMap]",iae="[object ArrayBuffer]",oae="[object DataView]",sae="[object Float32Array]",aae="[object Float64Array]",cae="[object Int8Array]",uae="[object Int16Array]",lae="[object Int32Array]",fae="[object Uint8Array]",dae="[object Uint8ClampedArray]",hae="[object Uint16Array]",pae="[object Uint32Array]",Kr={};Kr[sae]=Kr[aae]=Kr[cae]=Kr[uae]=Kr[lae]=Kr[fae]=Kr[dae]=Kr[hae]=Kr[pae]=!0;Kr[Gse]=Kr[Kse]=Kr[iae]=Kr[Vse]=Kr[oae]=Kr[Wse]=Kr[Yse]=Kr[Qse]=Kr[Jse]=Kr[Xse]=Kr[Zse]=Kr[eae]=Kr[tae]=Kr[rae]=Kr[nae]=!1;function mae(t){return $se(t)&&Hse(t.length)&&!!Kr[zse(t)]}Ik.exports=mae});var Yg=F((WNe,Pk)=>{m();function gae(t){return function(e){return t(e)}}Pk.exports=gae});var Qg=F((Gp,Zf)=>{m();var yae=Gx(),Nk=typeof Gp=="object"&&Gp&&!Gp.nodeType&&Gp,Kp=Nk&&typeof Zf=="object"&&Zf&&!Zf.nodeType&&Zf,vae=Kp&&Kp.exports===Nk,rE=vae&&yae.process,bae=function(){try{var t=Kp&&Kp.require&&Kp.require("util").types;return t||rE&&rE.binding&&rE.binding("util")}catch{}}();Zf.exports=bae});var nE=F((YNe,Lk)=>{m();var _ae=Ok(),wae=Yg(),Bk=Qg(),Fk=Bk&&Bk.isTypedArray,xae=Fk?wae(Fk):_ae;Lk.exports=xae});var iE=F((QNe,qk)=>{m();var Eae=yk(),Sae=Zx(),Cae=Jf(),Aae=Wg(),Tae=eE(),Mae=nE(),Rae=Object.prototype,Dae=Rae.hasOwnProperty;function kae(t,e){var r=Cae(t),i=!r&&Sae(t),n=!r&&!i&&Aae(t),o=!r&&!i&&!n&&Mae(t),c=r||i||n||o,u=c?Eae(t.length,String):[],d=u.length;for(var y in t)(e||Dae.call(t,y))&&!(c&&(y=="length"||n&&(y=="offset"||y=="parent")||o&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||Tae(y,d)))&&u.push(y);return u}qk.exports=kae});var Jg=F((JNe,Uk)=>{m();var Iae=Object.prototype;function Oae(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Iae;return t===r}Uk.exports=Oae});var oE=F((XNe,jk)=>{m();function Pae(t,e){return function(r){return t(e(r))}}jk.exports=Pae});var Hk=F((ZNe,zk)=>{m();var Nae=oE(),Bae=Nae(Object.keys,Object);zk.exports=Bae});var Gk=F((eBe,$k)=>{m();var Fae=Jg(),Lae=Hk(),qae=Object.prototype,Uae=qae.hasOwnProperty;function jae(t){if(!Fae(t))return Lae(t);var e=[];for(var r in Object(t))Uae.call(t,r)&&r!="constructor"&&e.push(r);return e}$k.exports=jae});var Xg=F((tBe,Kk)=>{m();var zae=Kx(),Hae=tE();function $ae(t){return t!=null&&Hae(t.length)&&!zae(t)}Kk.exports=$ae});var Zg=F((rBe,Vk)=>{m();var Gae=iE(),Kae=Gk(),Vae=Xg();function Wae(t){return Vae(t)?Gae(t):Kae(t)}Vk.exports=Wae});var Yk=F((nBe,Wk)=>{m();var Yae=Hp(),Qae=Zg();function Jae(t,e){return t&&Yae(e,Qae(e),t)}Wk.exports=Jae});var Jk=F((iBe,Qk)=>{m();function Xae(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}Qk.exports=Xae});var Zk=F((oBe,Xk)=>{m();var Zae=nc(),ece=Jg(),tce=Jk(),rce=Object.prototype,nce=rce.hasOwnProperty;function ice(t){if(!Zae(t))return tce(t);var e=ece(t),r=[];for(var i in t)i=="constructor"&&(e||!nce.call(t,i))||r.push(i);return r}Xk.exports=ice});var ey=F((sBe,eI)=>{m();var oce=iE(),sce=Zk(),ace=Xg();function cce(t){return ace(t)?oce(t,!0):sce(t)}eI.exports=cce});var rI=F((aBe,tI)=>{m();var uce=Hp(),lce=ey();function fce(t,e){return t&&uce(e,lce(e),t)}tI.exports=fce});var aI=F((Vp,ed)=>{m();var dce=$o(),sI=typeof Vp=="object"&&Vp&&!Vp.nodeType&&Vp,nI=sI&&typeof ed=="object"&&ed&&!ed.nodeType&&ed,hce=nI&&nI.exports===sI,iI=hce?dce.Buffer:void 0,oI=iI?iI.allocUnsafe:void 0;function pce(t,e){if(e)return t.slice();var r=t.length,i=oI?oI(r):new t.constructor(r);return t.copy(i),i}ed.exports=pce});var uI=F((cBe,cI)=>{m();function mce(t,e){var r=-1,i=t.length;for(e||(e=Array(i));++r{m();function gce(t,e){for(var r=-1,i=t==null?0:t.length,n=0,o=[];++r{m();function yce(){return[]}dI.exports=yce});var ty=F((fBe,pI)=>{m();var vce=fI(),bce=sE(),_ce=Object.prototype,wce=_ce.propertyIsEnumerable,hI=Object.getOwnPropertySymbols,xce=hI?function(t){return t==null?[]:(t=Object(t),vce(hI(t),function(e){return wce.call(t,e)}))}:bce;pI.exports=xce});var gI=F((dBe,mI)=>{m();var Ece=Hp(),Sce=ty();function Cce(t,e){return Ece(t,Sce(t),e)}mI.exports=Cce});var ry=F((hBe,yI)=>{m();function Ace(t,e){for(var r=-1,i=e.length,n=t.length;++r{m();var Tce=oE(),Mce=Tce(Object.getPrototypeOf,Object);vI.exports=Mce});var cE=F((mBe,bI)=>{m();var Rce=ry(),Dce=aE(),kce=ty(),Ice=sE(),Oce=Object.getOwnPropertySymbols,Pce=Oce?function(t){for(var e=[];t;)Rce(e,kce(t)),t=Dce(t);return e}:Ice;bI.exports=Pce});var wI=F((gBe,_I)=>{m();var Nce=Hp(),Bce=cE();function Fce(t,e){return Nce(t,Bce(t),e)}_I.exports=Fce});var uE=F((yBe,xI)=>{m();var Lce=ry(),qce=Jf();function Uce(t,e,r){var i=e(t);return qce(t)?i:Lce(i,r(t))}xI.exports=Uce});var lE=F((vBe,EI)=>{m();var jce=uE(),zce=ty(),Hce=Zg();function $ce(t){return jce(t,Hce,zce)}EI.exports=$ce});var CI=F((bBe,SI)=>{m();var Gce=uE(),Kce=cE(),Vce=ey();function Wce(t){return Gce(t,Vce,Kce)}SI.exports=Wce});var TI=F((_Be,AI)=>{m();var Yce=ic(),Qce=$o(),Jce=Yce(Qce,"DataView");AI.exports=Jce});var RI=F((wBe,MI)=>{m();var Xce=ic(),Zce=$o(),eue=Xce(Zce,"Promise");MI.exports=eue});var kI=F((xBe,DI)=>{m();var tue=ic(),rue=$o(),nue=tue(rue,"Set");DI.exports=nue});var OI=F((EBe,II)=>{m();var iue=ic(),oue=$o(),sue=iue(oue,"WeakMap");II.exports=sue});var Wp=F((SBe,UI)=>{m();var fE=TI(),dE=Vg(),hE=RI(),pE=kI(),mE=OI(),qI=Vf(),td=Wx(),PI="[object Map]",aue="[object Object]",NI="[object Promise]",BI="[object Set]",FI="[object WeakMap]",LI="[object DataView]",cue=td(fE),uue=td(dE),lue=td(hE),fue=td(pE),due=td(mE),Iu=qI;(fE&&Iu(new fE(new ArrayBuffer(1)))!=LI||dE&&Iu(new dE)!=PI||hE&&Iu(hE.resolve())!=NI||pE&&Iu(new pE)!=BI||mE&&Iu(new mE)!=FI)&&(Iu=function(t){var e=qI(t),r=e==aue?t.constructor:void 0,i=r?td(r):"";if(i)switch(i){case cue:return LI;case uue:return PI;case lue:return NI;case fue:return BI;case due:return FI}return e});UI.exports=Iu});var zI=F((CBe,jI)=>{m();var hue=Object.prototype,pue=hue.hasOwnProperty;function mue(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&pue.call(t,"index")&&(r.index=t.index,r.input=t.input),r}jI.exports=mue});var gE=F((ABe,HI)=>{m();var gue=$o(),yue=gue.Uint8Array;HI.exports=yue});var ny=F((TBe,GI)=>{m();var $I=gE();function vue(t){var e=new t.constructor(t.byteLength);return new $I(e).set(new $I(t)),e}GI.exports=vue});var VI=F((MBe,KI)=>{m();var bue=ny();function _ue(t,e){var r=e?bue(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}KI.exports=_ue});var YI=F((RBe,WI)=>{m();var wue=/\w*$/;function xue(t){var e=new t.constructor(t.source,wue.exec(t));return e.lastIndex=t.lastIndex,e}WI.exports=xue});var e4=F((DBe,ZI)=>{m();var QI=Kf(),JI=QI?QI.prototype:void 0,XI=JI?JI.valueOf:void 0;function Eue(t){return XI?Object(XI.call(t)):{}}ZI.exports=Eue});var r4=F((kBe,t4)=>{m();var Sue=ny();function Cue(t,e){var r=e?Sue(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}t4.exports=Cue});var i4=F((IBe,n4)=>{m();var Aue=ny(),Tue=VI(),Mue=YI(),Rue=e4(),Due=r4(),kue="[object Boolean]",Iue="[object Date]",Oue="[object Map]",Pue="[object Number]",Nue="[object RegExp]",Bue="[object Set]",Fue="[object String]",Lue="[object Symbol]",que="[object ArrayBuffer]",Uue="[object DataView]",jue="[object Float32Array]",zue="[object Float64Array]",Hue="[object Int8Array]",$ue="[object Int16Array]",Gue="[object Int32Array]",Kue="[object Uint8Array]",Vue="[object Uint8ClampedArray]",Wue="[object Uint16Array]",Yue="[object Uint32Array]";function Que(t,e,r){var i=t.constructor;switch(e){case que:return Aue(t);case kue:case Iue:return new i(+t);case Uue:return Tue(t,r);case jue:case zue:case Hue:case $ue:case Gue:case Kue:case Vue:case Wue:case Yue:return Due(t,r);case Oue:return new i;case Pue:case Fue:return new i(t);case Nue:return Mue(t);case Bue:return new i;case Lue:return Rue(t)}}n4.exports=Que});var a4=F((OBe,s4)=>{m();var Jue=nc(),o4=Object.create,Xue=function(){function t(){}return function(e){if(!Jue(e))return{};if(o4)return o4(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();s4.exports=Xue});var u4=F((PBe,c4)=>{m();var Zue=a4(),ele=aE(),tle=Jg();function rle(t){return typeof t.constructor=="function"&&!tle(t)?Zue(ele(t)):{}}c4.exports=rle});var f4=F((NBe,l4)=>{m();var nle=Wp(),ile=oc(),ole="[object Map]";function sle(t){return ile(t)&&nle(t)==ole}l4.exports=sle});var m4=F((BBe,p4)=>{m();var ale=f4(),cle=Yg(),d4=Qg(),h4=d4&&d4.isMap,ule=h4?cle(h4):ale;p4.exports=ule});var y4=F((FBe,g4)=>{m();var lle=Wp(),fle=oc(),dle="[object Set]";function hle(t){return fle(t)&&lle(t)==dle}g4.exports=hle});var w4=F((LBe,_4)=>{m();var ple=y4(),mle=Yg(),v4=Qg(),b4=v4&&v4.isSet,gle=b4?mle(b4):ple;_4.exports=gle});var A4=F((qBe,C4)=>{m();var yle=Qx(),vle=uk(),ble=Xx(),_le=Yk(),wle=rI(),xle=aI(),Ele=uI(),Sle=gI(),Cle=wI(),Ale=lE(),Tle=CI(),Mle=Wp(),Rle=zI(),Dle=i4(),kle=u4(),Ile=Jf(),Ole=Wg(),Ple=m4(),Nle=nc(),Ble=w4(),Fle=Zg(),Lle=ey(),qle=1,Ule=2,jle=4,x4="[object Arguments]",zle="[object Array]",Hle="[object Boolean]",$le="[object Date]",Gle="[object Error]",E4="[object Function]",Kle="[object GeneratorFunction]",Vle="[object Map]",Wle="[object Number]",S4="[object Object]",Yle="[object RegExp]",Qle="[object Set]",Jle="[object String]",Xle="[object Symbol]",Zle="[object WeakMap]",efe="[object ArrayBuffer]",tfe="[object DataView]",rfe="[object Float32Array]",nfe="[object Float64Array]",ife="[object Int8Array]",ofe="[object Int16Array]",sfe="[object Int32Array]",afe="[object Uint8Array]",cfe="[object Uint8ClampedArray]",ufe="[object Uint16Array]",lfe="[object Uint32Array]",qr={};qr[x4]=qr[zle]=qr[efe]=qr[tfe]=qr[Hle]=qr[$le]=qr[rfe]=qr[nfe]=qr[ife]=qr[ofe]=qr[sfe]=qr[Vle]=qr[Wle]=qr[S4]=qr[Yle]=qr[Qle]=qr[Jle]=qr[Xle]=qr[afe]=qr[cfe]=qr[ufe]=qr[lfe]=!0;qr[Gle]=qr[E4]=qr[Zle]=!1;function iy(t,e,r,i,n,o){var c,u=e&qle,d=e&Ule,y=e&jle;if(r&&(c=n?r(t,i,n,o):r(t)),c!==void 0)return c;if(!Nle(t))return t;var E=Ile(t);if(E){if(c=Rle(t),!u)return Ele(t,c)}else{var x=Mle(t),A=x==E4||x==Kle;if(Ole(t))return xle(t,u);if(x==S4||x==x4||A&&!n){if(c=d||A?{}:kle(t),!u)return d?Cle(t,wle(c,t)):Sle(t,_le(c,t))}else{if(!qr[x])return n?t:{};c=Dle(t,x,u)}}o||(o=new yle);var R=o.get(t);if(R)return R;o.set(t,c),Ble(t)?t.forEach(function(D){c.add(iy(D,e,r,D,t,o))}):Ple(t)&&t.forEach(function(D,O){c.set(O,iy(D,e,r,O,t,o))});var M=y?d?Tle:Ale:d?Lle:Fle,I=E?void 0:M(t);return vle(I||t,function(D,O){I&&(O=D,D=t[O]),ble(c,O,iy(D,e,r,O,t,o))}),c}C4.exports=iy});var oy=F((UBe,T4)=>{m();var ffe=A4(),dfe=1,hfe=4;function pfe(t){return ffe(t,dfe|hfe)}T4.exports=pfe});var I4=F((zBe,k4)=>{m();k4.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var sc=F(Pu=>{m();var yE,yfe=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Pu.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Pu.getSymbolTotalCodewords=function(e){return yfe[e]};Pu.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Pu.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');yE=e};Pu.isKanjiModeEnabled=function(){return typeof yE<"u"};Pu.toSJIS=function(e){return yE(e)}});var ly=F(lo=>{m();lo.L={bit:1};lo.M={bit:0};lo.Q={bit:3};lo.H={bit:2};function vfe(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return lo.L;case"m":case"medium":return lo.M;case"q":case"quartile":return lo.Q;case"h":case"high":return lo.H;default:throw new Error("Unknown EC Level: "+t)}}lo.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};lo.from=function(e,r){if(lo.isValid(e))return e;try{return vfe(e)}catch{return r}}});var N4=F((GBe,P4)=>{m();function O4(){this.buffer=[],this.length=0}O4.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};P4.exports=O4});var F4=F((KBe,B4)=>{m();function Qp(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}Qp.prototype.set=function(t,e,r,i){let n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)};Qp.prototype.get=function(t,e){return this.data[t*this.size+e]};Qp.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Qp.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};B4.exports=Qp});var L4=F(fy=>{m();var bfe=sc().getSymbolSize;fy.getRowColCoords=function(e){if(e===1)return[];let r=Math.floor(e/7)+2,i=bfe(e),n=i===145?26:Math.ceil((i-13)/(2*r-2))*2,o=[i-7];for(let c=1;c{m();var _fe=sc().getSymbolSize,q4=7;U4.getPositions=function(e){let r=_fe(e);return[[0,0],[r-q4,0],[0,r-q4]]}});var z4=F(Ur=>{m();Ur.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var Nu={N1:3,N2:3,N3:40,N4:10};Ur.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};Ur.from=function(e){return Ur.isValid(e)?parseInt(e,10):void 0};Ur.getPenaltyN1=function(e){let r=e.size,i=0,n=0,o=0,c=null,u=null;for(let d=0;d=5&&(i+=Nu.N1+(n-5)),c=E,n=1),E=e.get(y,d),E===u?o++:(o>=5&&(i+=Nu.N1+(o-5)),u=E,o=1)}n>=5&&(i+=Nu.N1+(n-5)),o>=5&&(i+=Nu.N1+(o-5))}return i};Ur.getPenaltyN2=function(e){let r=e.size,i=0;for(let n=0;n=10&&(n===1488||n===93)&&i++,o=o<<1&2047|e.get(u,c),u>=10&&(o===1488||o===93)&&i++}return i*Nu.N3};Ur.getPenaltyN4=function(e){let r=0,i=e.data.length;for(let o=0;o{m();var ac=ly(),dy=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],hy=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];vE.getBlocksCount=function(e,r){switch(r){case ac.L:return dy[(e-1)*4+0];case ac.M:return dy[(e-1)*4+1];case ac.Q:return dy[(e-1)*4+2];case ac.H:return dy[(e-1)*4+3];default:return}};vE.getTotalCodewordsCount=function(e,r){switch(r){case ac.L:return hy[(e-1)*4+0];case ac.M:return hy[(e-1)*4+1];case ac.Q:return hy[(e-1)*4+2];case ac.H:return hy[(e-1)*4+3];default:return}}});var H4=F(my=>{m();var Jp=new Uint8Array(512),py=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)Jp[r]=e,py[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)Jp[r]=Jp[r-255]})();my.log=function(e){if(e<1)throw new Error("log("+e+")");return py[e]};my.exp=function(e){return Jp[e]};my.mul=function(e,r){return e===0||r===0?0:Jp[py[e]+py[r]]}});var $4=F(Xp=>{m();var _E=H4();Xp.mul=function(e,r){let i=new Uint8Array(e.length+r.length-1);for(let n=0;n=0;){let n=i[0];for(let c=0;c{m();var G4=$4();function wE(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}wE.prototype.initialize=function(e){this.degree=e,this.genPoly=G4.generateECPolynomial(this.degree)};wE.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(e.length+this.degree);r.set(e);let i=G4.mod(r,this.genPoly),n=this.degree-i.length;if(n>0){let o=new Uint8Array(this.degree);return o.set(i,n),o}return i};K4.exports=wE});var xE=F(W4=>{m();W4.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var EE=F(oa=>{m();var Y4="[0-9]+",xfe="[A-Z $%*+\\-./:]+",Zp="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Zp=Zp.replace(/u/g,"\\u");var Efe="(?:(?![A-Z0-9 $%*+\\-./:]|"+Zp+`)(?:.|[\r -]))+`;oa.KANJI=new RegExp(Zp,"g");oa.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");oa.BYTE=new RegExp(Efe,"g");oa.NUMERIC=new RegExp(Y4,"g");oa.ALPHANUMERIC=new RegExp(xfe,"g");var Sfe=new RegExp("^"+Zp+"$"),Cfe=new RegExp("^"+Y4+"$"),Afe=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");oa.testKanji=function(e){return Sfe.test(e)};oa.testNumeric=function(e){return Cfe.test(e)};oa.testAlphanumeric=function(e){return Afe.test(e)}});var cc=F(En=>{m();var Tfe=xE(),SE=EE();En.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]};En.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]};En.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]};En.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]};En.MIXED={bit:-1};En.getCharCountIndicator=function(e,r){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!Tfe.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?e.ccBits[0]:r<27?e.ccBits[1]:e.ccBits[2]};En.getBestModeForData=function(e){return SE.testNumeric(e)?En.NUMERIC:SE.testAlphanumeric(e)?En.ALPHANUMERIC:SE.testKanji(e)?En.KANJI:En.BYTE};En.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};En.isValid=function(e){return e&&e.bit&&e.ccBits};function Mfe(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return En.NUMERIC;case"alphanumeric":return En.ALPHANUMERIC;case"kanji":return En.KANJI;case"byte":return En.BYTE;default:throw new Error("Unknown mode: "+t)}}En.from=function(e,r){if(En.isValid(e))return e;try{return Mfe(e)}catch{return r}}});var eO=F(Bu=>{m();var gy=sc(),Rfe=bE(),Q4=ly(),uc=cc(),CE=xE(),X4=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,J4=gy.getBCHDigit(X4);function Dfe(t,e,r){for(let i=1;i<=40;i++)if(e<=Bu.getCapacity(i,r,t))return i}function Z4(t,e){return uc.getCharCountIndicator(t,e)+4}function kfe(t,e){let r=0;return t.forEach(function(i){r+=Z4(i.mode,e)+i.getBitsLength()}),r}function Ife(t,e){for(let r=1;r<=40;r++)if(kfe(t,r)<=Bu.getCapacity(r,e,uc.MIXED))return r}Bu.from=function(e,r){return CE.isValid(e)?parseInt(e,10):r};Bu.getCapacity=function(e,r,i){if(!CE.isValid(e))throw new Error("Invalid QR Code version");typeof i>"u"&&(i=uc.BYTE);let n=gy.getSymbolTotalCodewords(e),o=Rfe.getTotalCodewordsCount(e,r),c=(n-o)*8;if(i===uc.MIXED)return c;let u=c-Z4(i,e);switch(i){case uc.NUMERIC:return Math.floor(u/10*3);case uc.ALPHANUMERIC:return Math.floor(u/11*2);case uc.KANJI:return Math.floor(u/13);case uc.BYTE:default:return Math.floor(u/8)}};Bu.getBestVersionForData=function(e,r){let i,n=Q4.from(r,Q4.M);if(Array.isArray(e)){if(e.length>1)return Ife(e,n);if(e.length===0)return 1;i=e[0]}else i=e;return Dfe(i.mode,i.getLength(),n)};Bu.getEncodedBits=function(e){if(!CE.isValid(e)||e<7)throw new Error("Invalid QR Code version");let r=e<<12;for(;gy.getBCHDigit(r)-J4>=0;)r^=X4<{m();var AE=sc(),rO=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,Ofe=1<<14|1<<12|1<<10|1<<4|1<<1,tO=AE.getBCHDigit(rO);nO.getEncodedBits=function(e,r){let i=e.bit<<3|r,n=i<<10;for(;AE.getBCHDigit(n)-tO>=0;)n^=rO<{m();var Pfe=cc();function nd(t){this.mode=Pfe.NUMERIC,this.data=t.toString()}nd.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};nd.prototype.getLength=function(){return this.data.length};nd.prototype.getBitsLength=function(){return nd.getBitsLength(this.data.length)};nd.prototype.write=function(e){let r,i,n;for(r=0;r+3<=this.data.length;r+=3)i=this.data.substr(r,3),n=parseInt(i,10),e.put(n,10);let o=this.data.length-r;o>0&&(i=this.data.substr(r),n=parseInt(i,10),e.put(n,o*3+1))};oO.exports=nd});var cO=F((s7e,aO)=>{m();var Nfe=cc(),TE=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function id(t){this.mode=Nfe.ALPHANUMERIC,this.data=t}id.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};id.prototype.getLength=function(){return this.data.length};id.prototype.getBitsLength=function(){return id.getBitsLength(this.data.length)};id.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let i=TE.indexOf(this.data[r])*45;i+=TE.indexOf(this.data[r+1]),e.put(i,11)}this.data.length%2&&e.put(TE.indexOf(this.data[r]),6)};aO.exports=id});var lO=F((a7e,uO)=>{"use strict";m();uO.exports=function(e){for(var r=[],i=e.length,n=0;n=55296&&o<=56319&&i>n+1){var c=e.charCodeAt(n+1);c>=56320&&c<=57343&&(o=(o-55296)*1024+c-56320+65536,n+=1)}if(o<128){r.push(o);continue}if(o<2048){r.push(o>>6|192),r.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){r.push(o>>12|224),r.push(o>>6&63|128),r.push(o&63|128);continue}if(o>=65536&&o<=1114111){r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer}});var dO=F((c7e,fO)=>{m();var Bfe=lO(),Ffe=cc();function od(t){this.mode=Ffe.BYTE,typeof t=="string"&&(t=Bfe(t)),this.data=new Uint8Array(t)}od.getBitsLength=function(e){return e*8};od.prototype.getLength=function(){return this.data.length};od.prototype.getBitsLength=function(){return od.getBitsLength(this.data.length)};od.prototype.write=function(t){for(let e=0,r=this.data.length;e{m();var Lfe=cc(),qfe=sc();function sd(t){this.mode=Lfe.KANJI,this.data=t}sd.getBitsLength=function(e){return e*13};sd.prototype.getLength=function(){return this.data.length};sd.prototype.getBitsLength=function(){return sd.getBitsLength(this.data.length)};sd.prototype.write=function(t){let e;for(e=0;e=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` -Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};hO.exports=sd});var mO=F((l7e,ME)=>{"use strict";m();var em={single_source_shortest_paths:function(t,e,r){var i={},n={};n[e]=0;var o=em.PriorityQueue.make();o.push(e,0);for(var c,u,d,y,E,x,A,R,M;!o.empty();){c=o.pop(),u=c.value,y=c.cost,E=t[u]||{};for(d in E)E.hasOwnProperty(d)&&(x=E[d],A=y+x,R=n[d],M=typeof n[d]>"u",(M||R>A)&&(n[d]=A,o.push(d,A),i[d]=u))}if(typeof r<"u"&&typeof n[r]>"u"){var I=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(I)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],i=e,n;i;)r.push(i),n=t[i],i=t[i];return r.reverse(),r},find_path:function(t,e,r){var i=em.single_source_shortest_paths(t,e,r);return em.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var e=em.PriorityQueue,r={},i;t=t||{};for(i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);return r.queue=[],r.sorter=t.sorter||e.default_sorter,r},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof ME<"u"&&(ME.exports=em)});var EO=F(ad=>{m();var Dr=cc(),vO=sO(),bO=cO(),_O=dO(),wO=pO(),tm=EE(),yy=sc(),Ufe=mO();function gO(t){return unescape(encodeURIComponent(t)).length}function rm(t,e,r){let i=[],n;for(;(n=t.exec(r))!==null;)i.push({data:n[0],index:n.index,mode:e,length:n[0].length});return i}function xO(t){let e=rm(tm.NUMERIC,Dr.NUMERIC,t),r=rm(tm.ALPHANUMERIC,Dr.ALPHANUMERIC,t),i,n;return yy.isKanjiModeEnabled()?(i=rm(tm.BYTE,Dr.BYTE,t),n=rm(tm.KANJI,Dr.KANJI,t)):(i=rm(tm.BYTE_KANJI,Dr.BYTE,t),n=[]),e.concat(r,i,n).sort(function(c,u){return c.index-u.index}).map(function(c){return{data:c.data,mode:c.mode,length:c.length}})}function RE(t,e){switch(e){case Dr.NUMERIC:return vO.getBitsLength(t);case Dr.ALPHANUMERIC:return bO.getBitsLength(t);case Dr.KANJI:return wO.getBitsLength(t);case Dr.BYTE:return _O.getBitsLength(t)}}function jfe(t){return t.reduce(function(e,r){let i=e.length-1>=0?e[e.length-1]:null;return i&&i.mode===r.mode?(e[e.length-1].data+=r.data,e):(e.push(r),e)},[])}function zfe(t){let e=[];for(let r=0;r{m();var by=sc(),DE=ly(),$fe=N4(),Gfe=F4(),Kfe=L4(),Vfe=j4(),OE=z4(),PE=bE(),Wfe=V4(),vy=eO(),Yfe=iO(),Qfe=cc(),kE=EO();function Jfe(t,e){let r=t.size,i=Vfe.getPositions(e);for(let n=0;n=0&&u<=6&&(d===0||d===6)||d>=0&&d<=6&&(u===0||u===6)||u>=2&&u<=4&&d>=2&&d<=4?t.set(o+u,c+d,!0,!0):t.set(o+u,c+d,!1,!0))}}function Xfe(t){let e=t.size;for(let r=8;r>u&1)===1,t.set(n,o,c,!0),t.set(o,n,c,!0)}function IE(t,e,r){let i=t.size,n=Yfe.getEncodedBits(e,r),o,c;for(o=0;o<15;o++)c=(n>>o&1)===1,o<6?t.set(o,8,c,!0):o<8?t.set(o+1,8,c,!0):t.set(i-15+o,8,c,!0),o<8?t.set(8,i-o-1,c,!0):o<9?t.set(8,15-o-1+1,c,!0):t.set(8,15-o-1,c,!0);t.set(i-8,8,1,!0)}function tde(t,e){let r=t.size,i=-1,n=r-1,o=7,c=0;for(let u=r-1;u>0;u-=2)for(u===6&&u--;;){for(let d=0;d<2;d++)if(!t.isReserved(n,u-d)){let y=!1;c>>o&1)===1),t.set(n,u-d,y),o--,o===-1&&(c++,o=7)}if(n+=i,n<0||r<=n){n-=i,i=-i;break}}}function rde(t,e,r){let i=new $fe;r.forEach(function(d){i.put(d.mode.bit,4),i.put(d.getLength(),Qfe.getCharCountIndicator(d.mode,t)),d.write(i)});let n=by.getSymbolTotalCodewords(t),o=PE.getTotalCodewordsCount(t,e),c=(n-o)*8;for(i.getLengthInBits()+4<=c&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);let u=(c-i.getLengthInBits())/8;for(let d=0;d=7&&ede(d,e),tde(d,c),isNaN(i)&&(i=OE.getBestMask(d,IE.bind(null,d,r))),OE.applyMask(i,d),IE(d,r,i),{modules:d,version:e,errorCorrectionLevel:r,maskPattern:i,segments:n}}SO.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let i=DE.M,n,o;return typeof r<"u"&&(i=DE.from(r.errorCorrectionLevel,DE.M),n=vy.from(r.version),o=OE.from(r.maskPattern),r.toSJISFunc&&by.setToSJISFunction(r.toSJISFunc)),ide(e,n,i,o)}});var NE=F(Fu=>{m();function AO(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||e.length===5||e.length>8)throw new Error("Invalid hex color: "+t);(e.length===3||e.length===4)&&(e=Array.prototype.concat.apply([],e.map(function(i){return[i,i]}))),e.length===6&&e.push("F","F");let r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+e.slice(0,6).join("")}}Fu.getOptions=function(e){e||(e={}),e.color||(e.color={});let r=typeof e.margin>"u"||e.margin===null||e.margin<0?4:e.margin,i=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return{width:i,scale:i?4:n,margin:r,color:{dark:AO(e.color.dark||"#000000ff"),light:AO(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}};Fu.getScale=function(e,r){return r.width&&r.width>=e+r.margin*2?r.width/(e+r.margin*2):r.scale};Fu.getImageWidth=function(e,r){let i=Fu.getScale(e,r);return Math.floor((e+r.margin*2)*i)};Fu.qrToImageData=function(e,r,i){let n=r.modules.size,o=r.modules.data,c=Fu.getScale(n,i),u=Math.floor((n+i.margin*2)*c),d=i.margin*c,y=[i.color.light,i.color.dark];for(let E=0;E=d&&x>=d&&E{m();var BE=NE();function ode(t,e,r){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=r,e.width=r,e.style.height=r+"px",e.style.width=r+"px"}function sde(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}_y.render=function(e,r,i){let n=i,o=r;typeof n>"u"&&(!r||!r.getContext)&&(n=r,r=void 0),r||(o=sde()),n=BE.getOptions(n);let c=BE.getImageWidth(e.modules.size,n),u=o.getContext("2d"),d=u.createImageData(c,c);return BE.qrToImageData(d.data,e,n),ode(u,o,c),u.putImageData(d,0,0),o};_y.renderToDataURL=function(e,r,i){let n=i;typeof n>"u"&&(!r||!r.getContext)&&(n=r,r=void 0),n||(n={});let o=_y.render(e,r,n),c=n.type||"image/png",u=n.rendererOpts||{};return o.toDataURL(c,u.quality)}});var DO=F(RO=>{m();var ade=NE();function MO(t,e){let r=t.a/255,i=e+'="'+t.hex+'"';return r<1?i+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':i}function FE(t,e,r){let i=t+e;return typeof r<"u"&&(i+=" "+r),i}function cde(t,e,r){let i="",n=0,o=!1,c=0;for(let u=0;u0&&d>0&&t[u-1]||(i+=o?FE("M",d+r,.5+y+r):FE("m",n,0),n=0,o=!1),d+1':"",y="',E='viewBox="0 0 '+u+" "+u+'"',x=n.width?'width="'+n.width+'" height="'+n.width+'" ':"",A=''+d+y+` -`;return typeof i=="function"&&i(null,A),A}});var IO=F(nm=>{m();var ude=I4(),LE=CO(),kO=TO(),lde=DO();function qE(t,e,r,i,n){let o=[].slice.call(arguments,1),c=o.length,u=typeof o[c-1]=="function";if(!u&&!ude())throw new Error("Callback required as last argument");if(u){if(c<2)throw new Error("Too few arguments provided");c===2?(n=r,r=e,e=i=void 0):c===3&&(e.getContext&&typeof n>"u"?(n=i,i=void 0):(n=i,i=r,r=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(r=e,e=i=void 0):c===2&&!e.getContext&&(i=r,r=e,e=void 0),new Promise(function(d,y){try{let E=LE.create(r,i);d(t(E,e,i))}catch(E){y(E)}})}try{let d=LE.create(r,i);n(null,t(d,e,i))}catch(d){n(d)}}nm.create=LE.create;nm.toCanvas=qE.bind(null,kO.render);nm.toDataURL=qE.bind(null,kO.renderToDataURL);nm.toString=qE.bind(null,function(t,e,r){return lde.render(t,r)})});var LO=F((FO,UE)=>{m();(function(t){if(typeof FO=="object"&&typeof UE<"u")UE.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"||typeof window<"u"?e=window:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,r;return function i(n,o,c){function u(E,x){if(!o[E]){if(!n[E]){var A=typeof require=="function"&&require;if(!x&&A)return A(E,!0);if(d)return d(E,!0);var R=new Error("Cannot find module '"+E+"'");throw R.code="MODULE_NOT_FOUND",R}var M=o[E]={exports:{}};n[E][0].call(M.exports,function(I){var D=n[E][1][I];return u(D||I)},M,M.exports,i,n,o,c)}return o[E].exports}for(var d=typeof require=="function"&&require,y=0;y"u"&&i(3);var A=Promise;function R(V,te){te&&V.then(function(Q){te(null,Q)},function(Q){te(Q)})}function M(V,te,Q){typeof te=="function"&&V.then(te),typeof Q=="function"&&V.catch(Q)}function I(V){return typeof V!="string"&&(console.warn(V+" used as a key, but it is not a string."),V=String(V)),V}function D(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var O="local-forage-detect-blob-support",N=void 0,L={},j=Object.prototype.toString,H="readonly",Y="readwrite";function W(V){for(var te=V.length,Q=new ArrayBuffer(te),se=new Uint8Array(Q),ae=0;ae=43)}}).catch(function(){return!1})}function J(V){return typeof N=="boolean"?A.resolve(N):q(V).then(function(te){return N=te,N})}function _(V){var te=L[V.name],Q={};Q.promise=new A(function(se,ae){Q.resolve=se,Q.reject=ae}),te.deferredOperations.push(Q),te.dbReady?te.dbReady=te.dbReady.then(function(){return Q.promise}):te.dbReady=Q.promise}function s(V){var te=L[V.name],Q=te.deferredOperations.pop();if(Q)return Q.resolve(),Q.promise}function l(V,te){var Q=L[V.name],se=Q.deferredOperations.pop();if(se)return se.reject(te),se.promise}function p(V,te){return new A(function(Q,se){if(L[V.name]=L[V.name]||S(),V.db)if(te)_(V),V.db.close();else return Q(V.db);var ae=[V.name];te&&ae.push(V.version);var ne=y.open.apply(y,ae);te&&(ne.onupgradeneeded=function(Ke){var Je=ne.result;try{Je.createObjectStore(V.storeName),Ke.oldVersion<=1&&Je.createObjectStore(O)}catch(Ze){if(Ze.name==="ConstraintError")console.warn('The database "'+V.name+'" has been upgraded from version '+Ke.oldVersion+" to version "+Ke.newVersion+', but the storage "'+V.storeName+'" already exists.');else throw Ze}}),ne.onerror=function(Ke){Ke.preventDefault(),se(ne.error)},ne.onsuccess=function(){var Ke=ne.result;Ke.onversionchange=function(Je){Je.target.close()},Q(Ke),s(V)}})}function f(V){return p(V,!1)}function h(V){return p(V,!0)}function b(V,te){if(!V.db)return!0;var Q=!V.db.objectStoreNames.contains(V.storeName),se=V.versionV.db.version;if(se&&(V.version!==te&&console.warn('The database "'+V.name+`" can't be downgraded from version `+V.db.version+" to version "+V.version+"."),V.version=V.db.version),ae||Q){if(Q){var ne=V.db.version+1;ne>V.version&&(V.version=ne)}return!0}return!1}function w(V){return new A(function(te,Q){var se=new FileReader;se.onerror=Q,se.onloadend=function(ae){var ne=btoa(ae.target.result||"");te({__local_forage_encoded_blob:!0,data:ne,type:V.type})},se.readAsBinaryString(V)})}function g(V){var te=W(atob(V.data));return x([te],{type:V.type})}function a(V){return V&&V.__local_forage_encoded_blob}function v(V){var te=this,Q=te._initReady().then(function(){var se=L[te._dbInfo.name];if(se&&se.dbReady)return se.dbReady});return M(Q,V,V),Q}function P(V){_(V);for(var te=L[V.name],Q=te.forages,se=0;se0&&(!V.db||ne.name==="InvalidStateError"||ne.name==="NotFoundError"))return A.resolve().then(function(){if(!V.db||ne.name==="NotFoundError"&&!V.db.objectStoreNames.contains(V.storeName)&&V.version<=V.db.version)return V.db&&(V.version=V.db.version+1),h(V)}).then(function(){return P(V).then(function(){k(V,te,Q,se-1)})}).catch(Q);Q(ne)}}function S(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function B(V){var te=this,Q={db:null};if(V)for(var se in V)Q[se]=V[se];var ae=L[Q.name];ae||(ae=S(),L[Q.name]=ae),ae.forages.push(te),te._initReady||(te._initReady=te.ready,te.ready=v);var ne=[];function Ke(){return A.resolve()}for(var Je=0;Je>4,rt[ae++]=(Ke&15)<<4|Je>>2,rt[ae++]=(Je&3)<<6|Ze&63;return et}function Ae(V){var te=new Uint8Array(V),Q="",se;for(se=0;se>2],Q+=bt[(te[se]&3)<<4|te[se+1]>>4],Q+=bt[(te[se+1]&15)<<2|te[se+2]>>6],Q+=bt[te[se+2]&63];return te.length%3===2?Q=Q.substring(0,Q.length-1)+"=":te.length%3===1&&(Q=Q.substring(0,Q.length-2)+"=="),Q}function ke(V,te){var Q="";if(V&&(Q=Ce.call(V)),V&&(Q==="[object ArrayBuffer]"||V.buffer&&Ce.call(V.buffer)==="[object ArrayBuffer]")){var se,ae=Ct;V instanceof ArrayBuffer?(se=V,ae+=me):(se=V.buffer,Q==="[object Int8Array]"?ae+=ye:Q==="[object Uint8Array]"?ae+=de:Q==="[object Uint8ClampedArray]"?ae+=Mr:Q==="[object Int16Array]"?ae+=xe:Q==="[object Uint16Array]"?ae+=Ir:Q==="[object Int32Array]"?ae+=Ee:Q==="[object Uint32Array]"?ae+=_e:Q==="[object Float32Array]"?ae+=we:Q==="[object Float64Array]"?ae+=Lr:te(new Error("Failed to get type for BinaryArray"))),te(ae+Ae(se))}else if(Q==="[object Blob]"){var ne=new FileReader;ne.onload=function(){var Ke=pe+V.type+"~"+Ae(this.result);te(Ct+Ht+Ke)},ne.readAsArrayBuffer(V)}else try{te(JSON.stringify(V))}catch(Ke){console.error("Couldn't convert value into a JSON string: ",V),te(null,Ke)}}function Lt(V){if(V.substring(0,le)!==Ct)return JSON.parse(V);var te=V.substring(De),Q=V.substring(le,De),se;if(Q===Ht&&ge.test(te)){var ae=te.match(ge);se=ae[1],te=te.substring(ae[0].length)}var ne=$r(te);switch(Q){case me:return ne;case Ht:return x([ne],{type:se});case ye:return new Int8Array(ne);case de:return new Uint8Array(ne);case Mr:return new Uint8ClampedArray(ne);case xe:return new Int16Array(ne);case Ir:return new Uint16Array(ne);case Ee:return new Int32Array(ne);case _e:return new Uint32Array(ne);case we:return new Float32Array(ne);case Lr:return new Float64Array(ne);default:throw new Error("Unkown type: "+Q)}}var be={serialize:ke,deserialize:Lt,stringToBuffer:$r,bufferToString:Ae};function Te(V,te,Q,se){V.executeSql("CREATE TABLE IF NOT EXISTS "+te.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],Q,se)}function Yr(V){var te=this,Q={db:null};if(V)for(var se in V)Q[se]=typeof V[se]!="string"?V[se].toString():V[se];var ae=new A(function(ne,Ke){try{Q.db=openDatabase(Q.name,String(Q.version),Q.description,Q.size)}catch(Je){return Ke(Je)}Q.db.transaction(function(Je){Te(Je,Q,function(){te._dbInfo=Q,ne()},function(Ze,et){Ke(et)})},Ke)});return Q.serializer=be,ae}function ve(V,te,Q,se,ae,ne){V.executeSql(Q,se,ae,function(Ke,Je){Je.code===Je.SYNTAX_ERR?Ke.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[te.storeName],function(Ze,et){et.rows.length?ne(Ze,Je):Te(Ze,te,function(){Ze.executeSql(Q,se,ae,ne)},ne)},ne):ne(Ke,Je)},ne)}function Se(V,te){var Q=this;V=I(V);var se=new A(function(ae,ne){Q.ready().then(function(){var Ke=Q._dbInfo;Ke.db.transaction(function(Je){ve(Je,Ke,"SELECT * FROM "+Ke.storeName+" WHERE key = ? LIMIT 1",[V],function(Ze,et){var rt=et.rows.length?et.rows.item(0).value:null;rt&&(rt=Ke.serializer.deserialize(rt)),ae(rt)},function(Ze,et){ne(et)})})}).catch(ne)});return R(se,te),se}function Qr(V,te){var Q=this,se=new A(function(ae,ne){Q.ready().then(function(){var Ke=Q._dbInfo;Ke.db.transaction(function(Je){ve(Je,Ke,"SELECT * FROM "+Ke.storeName,[],function(Ze,et){for(var rt=et.rows,ft=rt.length,kt=0;kt0){Ke(Ie.apply(ae,[V,Ze,Q,se-1]));return}Je(kt)}})})}).catch(Je)});return R(ne,Q),ne}function Me(V,te,Q){return Ie.apply(this,[V,te,Q,1])}function Jr(V,te){var Q=this;V=I(V);var se=new A(function(ae,ne){Q.ready().then(function(){var Ke=Q._dbInfo;Ke.db.transaction(function(Je){ve(Je,Ke,"DELETE FROM "+Ke.storeName+" WHERE key = ?",[V],function(){ae()},function(Ze,et){ne(et)})})}).catch(ne)});return R(se,te),se}function Pe(V){var te=this,Q=new A(function(se,ae){te.ready().then(function(){var ne=te._dbInfo;ne.db.transaction(function(Ke){ve(Ke,ne,"DELETE FROM "+ne.storeName,[],function(){se()},function(Je,Ze){ae(Ze)})})}).catch(ae)});return R(Q,V),Q}function Oe(V){var te=this,Q=new A(function(se,ae){te.ready().then(function(){var ne=te._dbInfo;ne.db.transaction(function(Ke){ve(Ke,ne,"SELECT COUNT(key) as c FROM "+ne.storeName,[],function(Je,Ze){var et=Ze.rows.item(0).c;se(et)},function(Je,Ze){ae(Ze)})})}).catch(ae)});return R(Q,V),Q}function Xr(V,te){var Q=this,se=new A(function(ae,ne){Q.ready().then(function(){var Ke=Q._dbInfo;Ke.db.transaction(function(Je){ve(Je,Ke,"SELECT key FROM "+Ke.storeName+" WHERE id = ? LIMIT 1",[V+1],function(Ze,et){var rt=et.rows.length?et.rows.item(0).key:null;ae(rt)},function(Ze,et){ne(et)})})}).catch(ne)});return R(se,te),se}function Re(V){var te=this,Q=new A(function(se,ae){te.ready().then(function(){var ne=te._dbInfo;ne.db.transaction(function(Ke){ve(Ke,ne,"SELECT key FROM "+ne.storeName,[],function(Je,Ze){for(var et=[],rt=0;rt '__WebKitDatabaseInfoTable__'",[],function(ae,ne){for(var Ke=[],Je=0;Je0}function en(V){var te=this,Q={};if(V)for(var se in V)Q[se]=V[se];return Q.keyPrefix=Gr(V,te._defaultConfig),qe()?(te._dbInfo=Q,Q.serializer=be,A.resolve()):A.reject()}function Ue(V){var te=this,Q=te.ready().then(function(){for(var se=te._dbInfo.keyPrefix,ae=localStorage.length-1;ae>=0;ae--){var ne=localStorage.key(ae);ne.indexOf(se)===0&&localStorage.removeItem(ne)}});return R(Q,V),Q}function je(V,te){var Q=this;V=I(V);var se=Q.ready().then(function(){var ae=Q._dbInfo,ne=localStorage.getItem(ae.keyPrefix+V);return ne&&(ne=ae.serializer.deserialize(ne)),ne});return R(se,te),se}function gr(V,te){var Q=this,se=Q.ready().then(function(){for(var ae=Q._dbInfo,ne=ae.keyPrefix,Ke=ne.length,Je=localStorage.length,Ze=1,et=0;et=0;Ke--){var Je=localStorage.key(Ke);Je.indexOf(ne)===0&&localStorage.removeItem(Je)}}):ae=A.reject("Invalid arguments"),R(ae,te),ae}var br={_driver:"localStorageWrapper",_initStorage:en,_support:Fe(),iterate:gr,getItem:je,setItem:lr,removeItem:yr,clear:Ue,length:or,key:wt,keys:xt,dropInstance:vr},_r=function(te,Q){return te===Q||typeof te=="number"&&typeof Q=="number"&&isNaN(te)&&isNaN(Q)},wr=function(te,Q){for(var se=te.length,ae=0;ae"u"?"undefined":c(Q))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var se in Q){if(se==="storeName"&&(Q[se]=Q[se].replace(/\W/g,"_")),se==="version"&&typeof Q[se]!="number")return new Error("Database version must be a number.");this._config[se]=Q[se]}return"driver"in Q&&Q.driver?this.setDriver(this._config.driver):!0}else return typeof Q=="string"?this._config[Q]:this._config},V.prototype.defineDriver=function(Q,se,ae){var ne=new A(function(Ke,Je){try{var Ze=Q._driver,et=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!Q._driver){Je(et);return}for(var rt=nr.concat("_initStorage"),ft=0,kt=rt.length;ft{"use strict";m();Object.defineProperty(lc,"__esModule",{value:!0});function cd(t,e,r){var i;if(r===void 0&&(r={}),!e.codes){e.codes={};for(var n=0;n=8&&(u-=8,c[y++]=255&d>>u)}if(u>=e.bits||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return c}function ud(t,e,r){r===void 0&&(r={});for(var i=r,n=i.pad,o=n===void 0?!0:n,c=(1<e.bits;)d-=e.bits,u+=e.chars[c&y>>d];if(d&&(u+=e.chars[c&y<{m();(function(t,e){"use strict";typeof define=="function"&&define.amd?define(e):typeof wy=="object"&&wy.exports?wy.exports=e():t.log=e()})(WO,function(){"use strict";var t=function(){},e="undefined",r=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function n(M,I){var D=M[I];if(typeof D.bind=="function")return D.bind(M);try{return Function.prototype.bind.call(D,M)}catch{return function(){return Function.prototype.apply.apply(D,[M,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(M){return M==="debug"&&(M="log"),typeof console===e?!1:M==="trace"&&r?o:console[M]!==void 0?n(console,M):console.log!==void 0?n(console,"log"):t}function u(M,I){for(var D=0;D=0&&q<=O.levels.SILENT){if(N=q,J!==!1&&j(q),u.call(O,q,M),typeof console===e&&q{"use strict";m();var Ade=(t,e)=>Math.floor(Math.random()*(e-t+1)+t),_8=()=>{let t=new Error("Delay aborted");return t.name="AbortError",t},w8=({clearTimeout:t,setTimeout:e,willResolve:r})=>(i,{value:n,signal:o}={})=>{if(o&&o.aborted)return Promise.reject(_8());let c,u,d,y=t||clearTimeout,E=()=>{y(c),d(_8())},x=()=>{o&&o.removeEventListener("abort",E)},A=new Promise((R,M)=>{u=()=>{x(),r?R(n):M(n)},d=M,c=(e||setTimeout)(u,i)});return o&&o.addEventListener("abort",E,{once:!0}),A.clear=()=>{y(c),c=null,u()},A},x8=t=>{let e=w8({...t,willResolve:!0});return e.reject=w8({...t,willResolve:!1}),e.range=(r,i,n)=>e(Ade(r,i),n),e},WE=x8();WE.createWithTimers=x8;YE.exports=WE;YE.exports.default=WE});var C8=F((fd,S8)=>{"use strict";m();var Tde=function(){if(typeof self<"u")return self;if(typeof window<"u"||typeof window<"u")return window;throw new Error("unable to locate global object")},zu=Tde();S8.exports=fd=zu.fetch;zu.fetch&&(fd.default=zu.fetch.bind(zu));fd.Headers=zu.Headers;fd.Request=zu.Request;fd.Response=zu.Response});var At=F((QE,T8)=>{m();var Cy=xn(),xs=Cy.Buffer;function A8(t,e){for(var r in t)e[r]=t[r]}xs.from&&xs.alloc&&xs.allocUnsafe&&xs.allocUnsafeSlow?T8.exports=Cy:(A8(Cy,QE),QE.Buffer=Hu);function Hu(t,e,r){return xs(t,e,r)}Hu.prototype=Object.create(xs.prototype);A8(xs,Hu);Hu.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return xs(t,e,r)};Hu.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=xs(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};Hu.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return xs(t)};Hu.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Cy.SlowBuffer(t)}});var $u=F((V7e,XE)=>{"use strict";m();var JE=65536,Mde=4294967295;function Rde(){throw new Error(`Secure random number generation is not supported by this browser. -Use Chrome, Firefox or Internet Explorer 11`)}var Dde=At().Buffer,Ay=window.crypto||window.msCrypto;Ay&&Ay.getRandomValues?XE.exports=kde:XE.exports=Rde;function kde(t,e){if(t>Mde)throw new RangeError("requested too many random bytes");var r=Dde.allocUnsafe(t);if(t>0)if(t>JE)for(var i=0;i{m();typeof Object.create=="function"?ZE.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ZE.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var aa=F((Y7e,eS)=>{"use strict";m();var dd=typeof Reflect=="object"?Reflect:null,M8=dd&&typeof dd.apply=="function"?dd.apply:function(e,r,i){return Function.prototype.apply.call(e,r,i)},Ty;dd&&typeof dd.ownKeys=="function"?Ty=dd.ownKeys:Object.getOwnPropertySymbols?Ty=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ty=function(e){return Object.getOwnPropertyNames(e)};function Ide(t){console&&console.warn&&console.warn(t)}var D8=Number.isNaN||function(e){return e!==e};function Or(){Or.init.call(this)}eS.exports=Or;eS.exports.once=Bde;Or.EventEmitter=Or;Or.prototype._events=void 0;Or.prototype._eventsCount=0;Or.prototype._maxListeners=void 0;var R8=10;function My(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Or,"defaultMaxListeners",{enumerable:!0,get:function(){return R8},set:function(t){if(typeof t!="number"||t<0||D8(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");R8=t}});Or.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Or.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||D8(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function k8(t){return t._maxListeners===void 0?Or.defaultMaxListeners:t._maxListeners}Or.prototype.getMaxListeners=function(){return k8(this)};Or.prototype.emit=function(e){for(var r=[],i=1;i0&&(c=r[0]),c instanceof Error)throw c;var u=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw u.context=c,u}var d=o[e];if(d===void 0)return!1;if(typeof d=="function")M8(d,this,r);else for(var y=d.length,E=B8(d,y),i=0;i0&&c.length>n&&!c.warned){c.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=c.length,Ide(u)}return t}Or.prototype.addListener=function(e,r){return I8(this,e,r,!1)};Or.prototype.on=Or.prototype.addListener;Or.prototype.prependListener=function(e,r){return I8(this,e,r,!0)};function Ode(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function O8(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=Ode.bind(i);return n.listener=r,i.wrapFn=n,n}Or.prototype.once=function(e,r){return My(r),this.on(e,O8(this,e,r)),this};Or.prototype.prependOnceListener=function(e,r){return My(r),this.prependListener(e,O8(this,e,r)),this};Or.prototype.removeListener=function(e,r){var i,n,o,c,u;if(My(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(o=-1,c=i.length-1;c>=0;c--)if(i[c]===r||i[c].listener===r){u=i[c].listener,o=c;break}if(o<0)return this;o===0?i.shift():Pde(i,o),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,u||r)}return this};Or.prototype.off=Or.prototype.removeListener;Or.prototype.removeAllListeners=function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var o=Object.keys(i),c;for(n=0;n=0;n--)this.removeListener(e,r[n]);return this};function P8(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?Nde(n):B8(n,n.length)}Or.prototype.listeners=function(e){return P8(this,e,!0)};Or.prototype.rawListeners=function(e){return P8(this,e,!1)};Or.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):N8.call(t,e)};Or.prototype.listenerCount=N8;function N8(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Or.prototype.eventNames=function(){return this._eventsCount>0?Ty(this._events):[]};function B8(t,e){for(var r=new Array(e),i=0;i{m();L8.exports=aa().EventEmitter});var Gu=F(()=>{m()});var $8=F((Z7e,H8)=>{"use strict";m();function q8(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function U8(t){for(var e=1;e0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return Ry.alloc(0);for(var i=Ry.allocUnsafe(r>>>0),n=this.head,o=0;n;)Gde(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return rc.length?c.length:r;if(u===c.length?o+=c:o+=c.slice(0,r),r-=u,r===0){u===c.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=c.slice(u));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(r){var i=Ry.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var c=n.data,u=r>c.length?c.length:r;if(c.copy(i,i.length-r,0,u),r-=u,r===0){u===c.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=c.slice(u));break}++o}return this.length-=o,i}},{key:$de,value:function(r,i){return rS(this,U8(U8({},i),{},{depth:0,customInspect:!1}))}}]),t}()});var iS=F((eFe,K8)=>{"use strict";m();function Kde(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,C.nextTick(nS,this,t)):C.nextTick(nS,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?C.nextTick(Dy,r):(r._writableState.errorEmitted=!0,C.nextTick(G8,r,o)):C.nextTick(G8,r,o):e?(C.nextTick(Dy,r),e(o)):C.nextTick(Dy,r)}),this)}function G8(t,e){nS(t,e),Dy(t)}function Dy(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Vde(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function nS(t,e){t.emit("error",e)}function Wde(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}K8.exports={destroy:Kde,undestroy:Vde,errorOrDestroy:Wde}});var Ku=F((tFe,Y8)=>{"use strict";m();function Yde(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var W8={};function fo(t,e,r){r||(r=Error);function i(o,c,u){return typeof e=="string"?e:e(o,c,u)}var n=function(o){Yde(c,o);function c(u,d,y){return o.call(this,i(u,d,y))||this}return c}(r);n.prototype.name=r.name,n.prototype.code=t,W8[t]=n}function V8(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(i){return String(i)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function Qde(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Jde(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Xde(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}fo("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);fo("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;typeof e=="string"&&Qde(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";var n;if(Jde(t," argument"))n="The ".concat(t," ").concat(i," ").concat(V8(e,"type"));else{var o=Xde(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(V8(e,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);fo("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");fo("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});fo("ERR_STREAM_PREMATURE_CLOSE","Premature close");fo("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});fo("ERR_MULTIPLE_CALLBACK","Callback called multiple times");fo("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");fo("ERR_STREAM_WRITE_AFTER_END","write after end");fo("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);fo("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);fo("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Y8.exports.codes=W8});var oS=F((rFe,Q8)=>{"use strict";m();var Zde=Ku().codes.ERR_INVALID_OPT_VALUE;function ehe(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function the(t,e,r,i){var n=ehe(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new Zde(o,n)}return Math.floor(n)}return t.objectMode?16:16*1024}Q8.exports={getHighWaterMark:the}});var ky=F((nFe,J8)=>{m();J8.exports=rhe;function rhe(t,e){if(sS("noDeprecation"))return t;var r=!1;function i(){if(!r){if(sS("throwDeprecation"))throw new Error(e);sS("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return i}function sS(t){try{if(!window.localStorage)return!1}catch{return!1}var e=window.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}});var uS=F((iFe,nP)=>{"use strict";m();nP.exports=cn;function Z8(t){var e=this;this.next=null,this.entry=null,this.finish=function(){Rhe(e,t)}}var hd;cn.WritableState=sm;var nhe={deprecate:ky()},eP=tS(),Oy=xn().Buffer,ihe=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ohe(t){return Oy.from(t)}function she(t){return Oy.isBuffer(t)||t instanceof ihe}var cS=iS(),ahe=oS(),che=ahe.getHighWaterMark,pc=Ku().codes,uhe=pc.ERR_INVALID_ARG_TYPE,lhe=pc.ERR_METHOD_NOT_IMPLEMENTED,fhe=pc.ERR_MULTIPLE_CALLBACK,dhe=pc.ERR_STREAM_CANNOT_PIPE,hhe=pc.ERR_STREAM_DESTROYED,phe=pc.ERR_STREAM_NULL_VALUES,mhe=pc.ERR_STREAM_WRITE_AFTER_END,ghe=pc.ERR_UNKNOWN_ENCODING,pd=cS.errorOrDestroy;vt()(cn,eP);function yhe(){}function sm(t,e,r){hd=hd||Vu(),t=t||{},typeof r!="boolean"&&(r=e instanceof hd),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=che(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){She(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Z8(this)}sm.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(sm.prototype,"buffer",{get:nhe.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Iy;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Iy=Function.prototype[Symbol.hasInstance],Object.defineProperty(cn,Symbol.hasInstance,{value:function(e){return Iy.call(this,e)?!0:this!==cn?!1:e&&e._writableState instanceof sm}})):Iy=function(e){return e instanceof this};function cn(t){hd=hd||Vu();var e=this instanceof hd;if(!e&&!Iy.call(cn,this))return new cn(t);this._writableState=new sm(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),eP.call(this)}cn.prototype.pipe=function(){pd(this,new dhe)};function vhe(t,e){var r=new mhe;pd(t,r),C.nextTick(e,r)}function bhe(t,e,r,i){var n;return r===null?n=new phe:typeof r!="string"&&!e.objectMode&&(n=new uhe("chunk",["string","Buffer"],r)),n?(pd(t,n),C.nextTick(i,n),!1):!0}cn.prototype.write=function(t,e,r){var i=this._writableState,n=!1,o=!i.objectMode&&she(t);return o&&!Oy.isBuffer(t)&&(t=ohe(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=yhe),i.ending?vhe(this,r):(o||bhe(this,i,t,r))&&(i.pendingcb++,n=whe(this,i,o,t,e,r)),n};cn.prototype.cork=function(){this._writableState.corked++};cn.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&tP(this,t))};cn.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new ghe(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(cn.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function _he(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Oy.from(e,r)),e}Object.defineProperty(cn.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function whe(t,e,r,i,n,o){if(!r){var c=_he(e,i,n);i!==c&&(r=!0,n="buffer",i=c)}var u=e.objectMode?1:i.length;e.length+=u;var d=e.length{"use strict";m();var Dhe=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};oP.exports=Es;var iP=dS(),fS=uS();vt()(Es,iP);for(lS=Dhe(fS.prototype),Py=0;Py{m();var By=xn(),ca=By.Buffer;function sP(t,e){for(var r in t)e[r]=t[r]}ca.from&&ca.alloc&&ca.allocUnsafe&&ca.allocUnsafeSlow?aP.exports=By:(sP(By,hS),hS.Buffer=md);function md(t,e,r){return ca(t,e,r)}sP(ca,md);md.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ca(t,e,r)};md.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=ca(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};md.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ca(t)};md.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return By.SlowBuffer(t)}});var mc=F(lP=>{"use strict";m();var mS=cP().Buffer,uP=mS.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ohe(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function Phe(t){var e=Ohe(t);if(typeof e!="string"&&(mS.isEncoding===uP||!uP(t)))throw new Error("Unknown encoding: "+t);return e||t}lP.StringDecoder=am;function am(t){this.encoding=Phe(t);var e;switch(this.encoding){case"utf16le":this.text=Uhe,this.end=jhe,e=4;break;case"utf8":this.fillLast=Fhe,e=4;break;case"base64":this.text=zhe,this.end=Hhe,e=3;break;default:this.write=$he,this.end=Ghe;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=mS.allocUnsafe(e)}am.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Nhe(t,e,r){var i=e.length-1;if(i=0?(n>0&&(t.lastNeed=n-1),n):--i=0?(n>0&&(t.lastNeed=n-2),n):--i=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function Bhe(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function Fhe(t){var e=this.lastTotal-this.lastNeed,r=Bhe(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function Lhe(t,e){var r=Nhe(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function qhe(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Uhe(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function jhe(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function zhe(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function Hhe(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function $he(t){return t.toString(this.encoding)}function Ghe(t){return t&&t.length?this.write(t):""}});var Fy=F((aFe,hP)=>{"use strict";m();var fP=Ku().codes.ERR_STREAM_PREMATURE_CLOSE;function Khe(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n{"use strict";m();var Ly;function gc(t,e,r){return e=Yhe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yhe(t){var e=Qhe(t,"string");return typeof e=="symbol"?e:String(e)}function Qhe(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Jhe=Fy(),yc=Symbol("lastResolve"),Wu=Symbol("lastReject"),cm=Symbol("error"),qy=Symbol("ended"),Yu=Symbol("lastPromise"),gS=Symbol("handlePromise"),Qu=Symbol("stream");function vc(t,e){return{value:t,done:e}}function Xhe(t){var e=t[yc];if(e!==null){var r=t[Qu].read();r!==null&&(t[Yu]=null,t[yc]=null,t[Wu]=null,e(vc(r,!1)))}}function Zhe(t){C.nextTick(Xhe,t)}function epe(t,e){return function(r,i){t.then(function(){if(e[qy]){r(vc(void 0,!0));return}e[gS](r,i)},i)}}var tpe=Object.getPrototypeOf(function(){}),rpe=Object.setPrototypeOf((Ly={get stream(){return this[Qu]},next:function(){var e=this,r=this[cm];if(r!==null)return Promise.reject(r);if(this[qy])return Promise.resolve(vc(void 0,!0));if(this[Qu].destroyed)return new Promise(function(c,u){C.nextTick(function(){e[cm]?u(e[cm]):c(vc(void 0,!0))})});var i=this[Yu],n;if(i)n=new Promise(epe(i,this));else{var o=this[Qu].read();if(o!==null)return Promise.resolve(vc(o,!1));n=new Promise(this[gS])}return this[Yu]=n,n}},gc(Ly,Symbol.asyncIterator,function(){return this}),gc(Ly,"return",function(){var e=this;return new Promise(function(r,i){e[Qu].destroy(null,function(n){if(n){i(n);return}r(vc(void 0,!0))})})}),Ly),tpe),npe=function(e){var r,i=Object.create(rpe,(r={},gc(r,Qu,{value:e,writable:!0}),gc(r,yc,{value:null,writable:!0}),gc(r,Wu,{value:null,writable:!0}),gc(r,cm,{value:null,writable:!0}),gc(r,qy,{value:e._readableState.endEmitted,writable:!0}),gc(r,gS,{value:function(o,c){var u=i[Qu].read();u?(i[Yu]=null,i[yc]=null,i[Wu]=null,o(vc(u,!1))):(i[yc]=o,i[Wu]=c)},writable:!0}),r));return i[Yu]=null,Jhe(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[Wu];o!==null&&(i[Yu]=null,i[yc]=null,i[Wu]=null,o(n)),i[cm]=n;return}var c=i[yc];c!==null&&(i[Yu]=null,i[yc]=null,i[Wu]=null,c(vc(void 0,!0))),i[qy]=!0}),e.on("readable",Zhe.bind(null,i)),i};pP.exports=npe});var yP=F((uFe,gP)=>{m();gP.exports=function(){throw new Error("Readable.from is not available in the browser")}});var dS=F((fFe,TP)=>{"use strict";m();TP.exports=sr;var gd;sr.ReadableState=wP;var lFe=aa().EventEmitter,_P=function(e,r){return e.listeners(r).length},lm=tS(),Uy=xn().Buffer,ipe=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ope(t){return Uy.from(t)}function spe(t){return Uy.isBuffer(t)||t instanceof ipe}var yS=Gu(),qt;yS&&yS.debuglog?qt=yS.debuglog("stream"):qt=function(){};var ape=$8(),SS=iS(),cpe=oS(),upe=cpe.getHighWaterMark,jy=Ku().codes,lpe=jy.ERR_INVALID_ARG_TYPE,fpe=jy.ERR_STREAM_PUSH_AFTER_EOF,dpe=jy.ERR_METHOD_NOT_IMPLEMENTED,hpe=jy.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,yd,vS,bS;vt()(sr,lm);var um=SS.errorOrDestroy,_S=["error","close","destroy","pause","resume"];function ppe(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function wP(t,e,r){gd=gd||Vu(),t=t||{},typeof r!="boolean"&&(r=e instanceof gd),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=upe(this,t,"readableHighWaterMark",r),this.buffer=new ape,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(yd||(yd=mc().StringDecoder),this.decoder=new yd(t.encoding),this.encoding=t.encoding)}function sr(t){if(gd=gd||Vu(),!(this instanceof sr))return new sr(t);var e=this instanceof gd;this._readableState=new wP(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),lm.call(this)}Object.defineProperty(sr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});sr.prototype.destroy=SS.destroy;sr.prototype._undestroy=SS.undestroy;sr.prototype._destroy=function(t,e){e(t)};sr.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Uy.from(t,e),e=""),i=!0),xP(this,t,e,!1,i)};sr.prototype.unshift=function(t){return xP(this,t,null,!0,!1)};function xP(t,e,r,i,n){qt("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,ype(t,o);else{var c;if(n||(c=mpe(o,e)),c)um(t,c);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Uy.prototype&&(e=ope(e)),i)o.endEmitted?um(t,new hpe):wS(t,o,e,!0);else if(o.ended)um(t,new fpe);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?wS(t,o,e,!1):ES(t,o)):wS(t,o,e,!1)}else i||(o.reading=!1,ES(t,o))}return!o.ended&&(o.length=vP?t=vP:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function bP(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=gpe(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}sr.prototype.read=function(t){qt("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return qt("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?xS(this):zy(this),null;if(t=bP(t,e),t===0&&e.ended)return e.length===0&&xS(this),null;var i=e.needReadable;qt("need readable",i),(e.length===0||e.length-t0?n=CP(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&xS(this)),n!==null&&this.emit("data",n),n};function ype(t,e){if(qt("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?zy(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,EP(t)))}}function zy(t){var e=t._readableState;qt("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(qt("emitReadable",e.flowing),e.emittedReadable=!0,C.nextTick(EP,t))}function EP(t){var e=t._readableState;qt("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,CS(t)}function ES(t,e){e.readingMore||(e.readingMore=!0,C.nextTick(vpe,t,e))}function vpe(t,e){for(;!e.reading&&!e.ended&&(e.length1&&AP(i.pipes,t)!==-1)&&!y&&(qt("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function A(D){qt("onerror",D),I(),t.removeListener("error",A),_P(t,"error")===0&&um(t,D)}ppe(t,"error",A);function R(){t.removeListener("finish",M),I()}t.once("close",R);function M(){qt("onfinish"),t.removeListener("close",R),I()}t.once("finish",M);function I(){qt("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(qt("pipe resume"),r.resume()),t};function bpe(t){return function(){var r=t._readableState;qt("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&_P(t,"data")&&(r.flowing=!0,CS(t))}}sr.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,qt("on readable",i.length,i.reading),i.length?zy(this):i.reading||C.nextTick(_pe,this)),r};sr.prototype.addListener=sr.prototype.on;sr.prototype.removeListener=function(t,e){var r=lm.prototype.removeListener.call(this,t,e);return t==="readable"&&C.nextTick(SP,this),r};sr.prototype.removeAllListeners=function(t){var e=lm.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&C.nextTick(SP,this),e};function SP(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function _pe(t){qt("readable nexttick read 0"),t.read(0)}sr.prototype.resume=function(){var t=this._readableState;return t.flowing||(qt("resume"),t.flowing=!t.readableListening,wpe(this,t)),t.paused=!1,this};function wpe(t,e){e.resumeScheduled||(e.resumeScheduled=!0,C.nextTick(xpe,t,e))}function xpe(t,e){qt("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),CS(t),e.flowing&&!e.reading&&t.read(0)}sr.prototype.pause=function(){return qt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(qt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function CS(t){var e=t._readableState;for(qt("flow",e.flowing);e.flowing&&t.read()!==null;);}sr.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(qt("wrapped end"),r.decoder&&!r.ended){var c=r.decoder.end();c&&c.length&&e.push(c)}e.push(null)}),t.on("data",function(c){if(qt("wrapped data"),r.decoder&&(c=r.decoder.write(c)),!(r.objectMode&&c==null)&&!(!r.objectMode&&(!c||!c.length))){var u=e.push(c);u||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(u){return function(){return t[u].apply(t,arguments)}}(n));for(var o=0;o<_S.length;o++)t.on(_S[o],this.emit.bind(this,_S[o]));return this._read=function(c){qt("wrapped _read",c),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(sr.prototype[Symbol.asyncIterator]=function(){return vS===void 0&&(vS=mP()),vS(this)});Object.defineProperty(sr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(sr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(sr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});sr._fromList=CP;Object.defineProperty(sr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function CP(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function xS(t){var e=t._readableState;qt("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,C.nextTick(Epe,e,t))}function Epe(t,e){if(qt("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(sr.from=function(t,e){return bS===void 0&&(bS=yP()),bS(sr,t,e)});function AP(t,e){for(var r=0,i=t.length;r{"use strict";m();RP.exports=ua;var Hy=Ku().codes,Spe=Hy.ERR_METHOD_NOT_IMPLEMENTED,Cpe=Hy.ERR_MULTIPLE_CALLBACK,Ape=Hy.ERR_TRANSFORM_ALREADY_TRANSFORMING,Tpe=Hy.ERR_TRANSFORM_WITH_LENGTH_0,$y=Vu();vt()(ua,$y);function Mpe(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new Cpe);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{"use strict";m();kP.exports=fm;var DP=AS();vt()(fm,DP);function fm(t){if(!(this instanceof fm))return new fm(t);DP.call(this,t)}fm.prototype._transform=function(t,e,r){r(null,t)}});var FP=F((pFe,BP)=>{"use strict";m();var TS;function Dpe(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var NP=Ku().codes,kpe=NP.ERR_MISSING_ARGS,Ipe=NP.ERR_STREAM_DESTROYED;function OP(t){if(t)throw t}function Ope(t){return t.setHeader&&typeof t.abort=="function"}function Ppe(t,e,r,i){i=Dpe(i);var n=!1;t.on("close",function(){n=!0}),TS===void 0&&(TS=Fy()),TS(t,{readable:e,writable:r},function(c){if(c)return i(c);n=!0,i()});var o=!1;return function(c){if(!n&&!o){if(o=!0,Ope(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(c||new Ipe("pipe"))}}}function PP(t){t()}function Npe(t,e){return t.pipe(e)}function Bpe(t){return!t.length||typeof t[t.length-1]!="function"?OP:t.pop()}function Fpe(){for(var t=arguments.length,e=new Array(t),r=0;r0;return Ppe(c,d,y,function(E){n||(n=E),E&&o.forEach(PP),!d&&(o.forEach(PP),i(n))})});return e.reduce(Npe)}BP.exports=Fpe});var qP=F((ho,LP)=>{m();ho=LP.exports=dS();ho.Stream=ho;ho.Readable=ho;ho.Writable=uS();ho.Duplex=Vu();ho.Transform=AS();ho.PassThrough=IP();ho.finished=Fy();ho.pipeline=FP()});var MS=F((mFe,jP)=>{"use strict";m();var Gy=At().Buffer,UP=qP().Transform,Lpe=vt();function qpe(t,e){if(!Gy.isBuffer(t)&&typeof t!="string")throw new TypeError(e+" must be a string or a buffer")}function bc(t){UP.call(this),this._block=Gy.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}Lpe(bc,UP);bc.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(n){i=n}r(i)};bc.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)};bc.prototype.update=function(t,e){if(qpe(t,"Data"),this._finalized)throw new Error("Digest already called");Gy.isBuffer(t)||(t=Gy.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var n=this._blockOffset;n0;++o)this._length[o]+=c,c=this._length[o]/4294967296|0,c>0&&(this._length[o]-=4294967296*c);return this};bc.prototype._update=function(){throw new Error("_update is not implemented")};bc.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();t!==void 0&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e};bc.prototype._digest=function(){throw new Error("_digest is not implemented")};jP.exports=bc});var Wy=F((gFe,HP)=>{"use strict";m();var Upe=vt(),zP=MS(),jpe=At().Buffer,zpe=new Array(16);function Ky(){zP.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}Upe(Ky,zP);Ky.prototype._update=function(){for(var t=zpe,e=0;e<16;++e)t[e]=this._block.readInt32LE(e*4);var r=this._a,i=this._b,n=this._c,o=this._d;r=ci(r,i,n,o,t[0],3614090360,7),o=ci(o,r,i,n,t[1],3905402710,12),n=ci(n,o,r,i,t[2],606105819,17),i=ci(i,n,o,r,t[3],3250441966,22),r=ci(r,i,n,o,t[4],4118548399,7),o=ci(o,r,i,n,t[5],1200080426,12),n=ci(n,o,r,i,t[6],2821735955,17),i=ci(i,n,o,r,t[7],4249261313,22),r=ci(r,i,n,o,t[8],1770035416,7),o=ci(o,r,i,n,t[9],2336552879,12),n=ci(n,o,r,i,t[10],4294925233,17),i=ci(i,n,o,r,t[11],2304563134,22),r=ci(r,i,n,o,t[12],1804603682,7),o=ci(o,r,i,n,t[13],4254626195,12),n=ci(n,o,r,i,t[14],2792965006,17),i=ci(i,n,o,r,t[15],1236535329,22),r=ui(r,i,n,o,t[1],4129170786,5),o=ui(o,r,i,n,t[6],3225465664,9),n=ui(n,o,r,i,t[11],643717713,14),i=ui(i,n,o,r,t[0],3921069994,20),r=ui(r,i,n,o,t[5],3593408605,5),o=ui(o,r,i,n,t[10],38016083,9),n=ui(n,o,r,i,t[15],3634488961,14),i=ui(i,n,o,r,t[4],3889429448,20),r=ui(r,i,n,o,t[9],568446438,5),o=ui(o,r,i,n,t[14],3275163606,9),n=ui(n,o,r,i,t[3],4107603335,14),i=ui(i,n,o,r,t[8],1163531501,20),r=ui(r,i,n,o,t[13],2850285829,5),o=ui(o,r,i,n,t[2],4243563512,9),n=ui(n,o,r,i,t[7],1735328473,14),i=ui(i,n,o,r,t[12],2368359562,20),r=li(r,i,n,o,t[5],4294588738,4),o=li(o,r,i,n,t[8],2272392833,11),n=li(n,o,r,i,t[11],1839030562,16),i=li(i,n,o,r,t[14],4259657740,23),r=li(r,i,n,o,t[1],2763975236,4),o=li(o,r,i,n,t[4],1272893353,11),n=li(n,o,r,i,t[7],4139469664,16),i=li(i,n,o,r,t[10],3200236656,23),r=li(r,i,n,o,t[13],681279174,4),o=li(o,r,i,n,t[0],3936430074,11),n=li(n,o,r,i,t[3],3572445317,16),i=li(i,n,o,r,t[6],76029189,23),r=li(r,i,n,o,t[9],3654602809,4),o=li(o,r,i,n,t[12],3873151461,11),n=li(n,o,r,i,t[15],530742520,16),i=li(i,n,o,r,t[2],3299628645,23),r=fi(r,i,n,o,t[0],4096336452,6),o=fi(o,r,i,n,t[7],1126891415,10),n=fi(n,o,r,i,t[14],2878612391,15),i=fi(i,n,o,r,t[5],4237533241,21),r=fi(r,i,n,o,t[12],1700485571,6),o=fi(o,r,i,n,t[3],2399980690,10),n=fi(n,o,r,i,t[10],4293915773,15),i=fi(i,n,o,r,t[1],2240044497,21),r=fi(r,i,n,o,t[8],1873313359,6),o=fi(o,r,i,n,t[15],4264355552,10),n=fi(n,o,r,i,t[6],2734768916,15),i=fi(i,n,o,r,t[13],1309151649,21),r=fi(r,i,n,o,t[4],4149444226,6),o=fi(o,r,i,n,t[11],3174756917,10),n=fi(n,o,r,i,t[2],718787259,15),i=fi(i,n,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0};Ky.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=jpe.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t};function Vy(t,e){return t<>>32-e}function ci(t,e,r,i,n,o,c){return Vy(t+(e&r|~e&i)+n+o|0,c)+e|0}function ui(t,e,r,i,n,o,c){return Vy(t+(e&i|r&~i)+n+o|0,c)+e|0}function li(t,e,r,i,n,o,c){return Vy(t+(e^r^i)+n+o|0,c)+e|0}function fi(t,e,r,i,n,o,c){return Vy(t+(r^(e|~i))+n+o|0,c)+e|0}HP.exports=Ky});var Qy=F((yFe,QP)=>{"use strict";m();var RS=xn().Buffer,Hpe=vt(),YP=MS(),$pe=new Array(16),dm=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],hm=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],pm=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],mm=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],gm=[0,1518500249,1859775393,2400959708,2840853838],ym=[1352829926,1548603684,1836072691,2053994217,0];function Yy(){YP.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}Hpe(Yy,YP);Yy.prototype._update=function(){for(var t=$pe,e=0;e<16;++e)t[e]=this._block.readInt32LE(e*4);for(var r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,c=this._e|0,u=this._a|0,d=this._b|0,y=this._c|0,E=this._d|0,x=this._e|0,A=0;A<80;A+=1){var R,M;A<16?(R=$P(r,i,n,o,c,t[dm[A]],gm[0],pm[A]),M=WP(u,d,y,E,x,t[hm[A]],ym[0],mm[A])):A<32?(R=GP(r,i,n,o,c,t[dm[A]],gm[1],pm[A]),M=VP(u,d,y,E,x,t[hm[A]],ym[1],mm[A])):A<48?(R=KP(r,i,n,o,c,t[dm[A]],gm[2],pm[A]),M=KP(u,d,y,E,x,t[hm[A]],ym[2],mm[A])):A<64?(R=VP(r,i,n,o,c,t[dm[A]],gm[3],pm[A]),M=GP(u,d,y,E,x,t[hm[A]],ym[3],mm[A])):(R=WP(r,i,n,o,c,t[dm[A]],gm[4],pm[A]),M=$P(u,d,y,E,x,t[hm[A]],ym[4],mm[A])),r=c,c=o,o=Ju(n,10),n=i,i=R,u=x,x=E,E=Ju(y,10),y=d,d=M}var I=this._b+n+E|0;this._b=this._c+o+x|0,this._c=this._d+c+u|0,this._d=this._e+r+d|0,this._e=this._a+i+y|0,this._a=I};Yy.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=RS.alloc?RS.alloc(20):new RS(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t};function Ju(t,e){return t<>>32-e}function $P(t,e,r,i,n,o,c,u){return Ju(t+(e^r^i)+o+c|0,u)+n|0}function GP(t,e,r,i,n,o,c,u){return Ju(t+(e&r|~e&i)+o+c|0,u)+n|0}function KP(t,e,r,i,n,o,c,u){return Ju(t+((e|~r)^i)+o+c|0,u)+n|0}function VP(t,e,r,i,n,o,c,u){return Ju(t+(e&i|r&~i)+o+c|0,u)+n|0}function WP(t,e,r,i,n,o,c,u){return Ju(t+(e^(r|~i))+o+c|0,u)+n|0}QP.exports=Yy});var Xu=F((vFe,XP)=>{m();var JP=At().Buffer;function Jy(t,e){this._block=JP.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Jy.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=JP.from(t,e));for(var r=this._block,i=this._blockSize,n=t.length,o=this._len,c=0;c=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o};Jy.prototype._update=function(){throw new Error("_update must be implemented by subclass")};XP.exports=Jy});var t5=F((bFe,e5)=>{m();var Gpe=vt(),ZP=Xu(),Kpe=At().Buffer,Vpe=[1518500249,1859775393,-1894007588,-899497514],Wpe=new Array(80);function vm(){this.init(),this._w=Wpe,ZP.call(this,64,56)}Gpe(vm,ZP);vm.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Ype(t){return t<<5|t>>>27}function Qpe(t){return t<<30|t>>>2}function Jpe(t,e,r,i){return t===0?e&r|~e&i:t===2?e&r|e&i|r&i:e^r^i}vm.prototype._update=function(t){for(var e=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,c=this._e|0,u=0;u<16;++u)e[u]=t.readInt32BE(u*4);for(;u<80;++u)e[u]=e[u-3]^e[u-8]^e[u-14]^e[u-16];for(var d=0;d<80;++d){var y=~~(d/20),E=Ype(r)+Jpe(y,i,n,o)+c+e[d]+Vpe[y]|0;c=o,o=n,n=Qpe(i),i=r,r=E}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0};vm.prototype._hash=function(){var t=Kpe.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};e5.exports=vm});var i5=F((_Fe,n5)=>{m();var Xpe=vt(),r5=Xu(),Zpe=At().Buffer,eme=[1518500249,1859775393,-1894007588,-899497514],tme=new Array(80);function bm(){this.init(),this._w=tme,r5.call(this,64,56)}Xpe(bm,r5);bm.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rme(t){return t<<1|t>>>31}function nme(t){return t<<5|t>>>27}function ime(t){return t<<30|t>>>2}function ome(t,e,r,i){return t===0?e&r|~e&i:t===2?e&r|e&i|r&i:e^r^i}bm.prototype._update=function(t){for(var e=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,c=this._e|0,u=0;u<16;++u)e[u]=t.readInt32BE(u*4);for(;u<80;++u)e[u]=rme(e[u-3]^e[u-8]^e[u-14]^e[u-16]);for(var d=0;d<80;++d){var y=~~(d/20),E=nme(r)+ome(y,i,n,o)+c+e[d]+eme[y]|0;c=o,o=n,n=ime(i),i=r,r=E}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0};bm.prototype._hash=function(){var t=Zpe.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};n5.exports=bm});var DS=F((wFe,s5)=>{m();var sme=vt(),o5=Xu(),ame=At().Buffer,cme=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],ume=new Array(64);function _m(){this.init(),this._w=ume,o5.call(this,64,56)}sme(_m,o5);_m.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function lme(t,e,r){return r^t&(e^r)}function fme(t,e,r){return t&e|r&(t|e)}function dme(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function hme(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function pme(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function mme(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}_m.prototype._update=function(t){for(var e=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,c=this._e|0,u=this._f|0,d=this._g|0,y=this._h|0,E=0;E<16;++E)e[E]=t.readInt32BE(E*4);for(;E<64;++E)e[E]=mme(e[E-2])+e[E-7]+pme(e[E-15])+e[E-16]|0;for(var x=0;x<64;++x){var A=y+hme(c)+lme(c,u,d)+cme[x]+e[x]|0,R=dme(r)+fme(r,i,n)|0;y=d,d=u,u=c,c=o+A|0,o=n,n=i,i=r,r=A+R|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0,this._f=u+this._f|0,this._g=d+this._g|0,this._h=y+this._h|0};_m.prototype._hash=function(){var t=ame.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};s5.exports=_m});var c5=F((xFe,a5)=>{m();var gme=vt(),yme=DS(),vme=Xu(),bme=At().Buffer,_me=new Array(64);function Xy(){this.init(),this._w=_me,vme.call(this,64,56)}gme(Xy,yme);Xy.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Xy.prototype._hash=function(){var t=bme.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};a5.exports=Xy});var kS=F((EFe,m5)=>{m();var wme=vt(),p5=Xu(),xme=At().Buffer,u5=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Eme=new Array(160);function wm(){this.init(),this._w=Eme,p5.call(this,128,112)}wme(wm,p5);wm.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function l5(t,e,r){return r^t&(e^r)}function f5(t,e,r){return t&e|r&(t|e)}function d5(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function h5(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function Sme(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function Cme(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function Ame(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function Tme(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function jn(t,e){return t>>>0>>0?1:0}wm.prototype._update=function(t){for(var e=this._w,r=this._ah|0,i=this._bh|0,n=this._ch|0,o=this._dh|0,c=this._eh|0,u=this._fh|0,d=this._gh|0,y=this._hh|0,E=this._al|0,x=this._bl|0,A=this._cl|0,R=this._dl|0,M=this._el|0,I=this._fl|0,D=this._gl|0,O=this._hl|0,N=0;N<32;N+=2)e[N]=t.readInt32BE(N*4),e[N+1]=t.readInt32BE(N*4+4);for(;N<160;N+=2){var L=e[N-30],j=e[N-15*2+1],H=Sme(L,j),Y=Cme(j,L);L=e[N-2*2],j=e[N-2*2+1];var W=Ame(L,j),q=Tme(j,L),J=e[N-7*2],_=e[N-7*2+1],s=e[N-16*2],l=e[N-16*2+1],p=Y+_|0,f=H+J+jn(p,Y)|0;p=p+q|0,f=f+W+jn(p,q)|0,p=p+l|0,f=f+s+jn(p,l)|0,e[N]=f,e[N+1]=p}for(var h=0;h<160;h+=2){f=e[h],p=e[h+1];var b=f5(r,i,n),w=f5(E,x,A),g=d5(r,E),a=d5(E,r),v=h5(c,M),P=h5(M,c),k=u5[h],S=u5[h+1],B=l5(c,u,d),$=l5(M,I,D),K=O+P|0,he=y+v+jn(K,O)|0;K=K+$|0,he=he+B+jn(K,$)|0,K=K+S|0,he=he+k+jn(K,S)|0,K=K+p|0,he=he+f+jn(K,p)|0;var X=a+w|0,Z=g+b+jn(X,a)|0;y=d,O=D,d=u,D=I,u=c,I=M,M=R+K|0,c=o+he+jn(M,R)|0,o=n,R=A,n=i,A=x,i=r,x=E,E=K+X|0,r=he+Z+jn(E,K)|0}this._al=this._al+E|0,this._bl=this._bl+x|0,this._cl=this._cl+A|0,this._dl=this._dl+R|0,this._el=this._el+M|0,this._fl=this._fl+I|0,this._gl=this._gl+D|0,this._hl=this._hl+O|0,this._ah=this._ah+r+jn(this._al,E)|0,this._bh=this._bh+i+jn(this._bl,x)|0,this._ch=this._ch+n+jn(this._cl,A)|0,this._dh=this._dh+o+jn(this._dl,R)|0,this._eh=this._eh+c+jn(this._el,M)|0,this._fh=this._fh+u+jn(this._fl,I)|0,this._gh=this._gh+d+jn(this._gl,D)|0,this._hh=this._hh+y+jn(this._hl,O)|0};wm.prototype._hash=function(){var t=xme.allocUnsafe(64);function e(r,i,n){t.writeInt32BE(r,n),t.writeInt32BE(i,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};m5.exports=wm});var y5=F((SFe,g5)=>{m();var Mme=vt(),Rme=kS(),Dme=Xu(),kme=At().Buffer,Ime=new Array(160);function Zy(){this.init(),this._w=Ime,Dme.call(this,128,112)}Mme(Zy,Rme);Zy.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Zy.prototype._hash=function(){var t=kme.allocUnsafe(48);function e(r,i,n){t.writeInt32BE(r,n),t.writeInt32BE(i,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};g5.exports=Zy});var ev=F((la,v5)=>{m();var la=v5.exports=function(e){e=e.toLowerCase();var r=la[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};la.sha=t5();la.sha1=i5();la.sha224=c5();la.sha256=DS();la.sha384=y5();la.sha512=kS()});var IS=F((CFe,b5)=>{m();b5.exports=aa().EventEmitter});var C5=F((AFe,S5)=>{"use strict";m();function _5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function w5(t){for(var e=1;e0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return tv.alloc(0);for(var i=tv.allocUnsafe(r>>>0),n=this.head,o=0;n;)Ume(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return rc.length?c.length:r;if(u===c.length?o+=c:o+=c.slice(0,r),r-=u,r===0){u===c.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=c.slice(u));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(r){var i=tv.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var c=n.data,u=r>c.length?c.length:r;if(c.copy(i,i.length-r,0,u),r-=u,r===0){u===c.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=c.slice(u));break}++o}return this.length-=o,i}},{key:qme,value:function(r,i){return OS(this,w5(w5({},i),{},{depth:0,customInspect:!1}))}}]),t}()});var NS=F((TFe,T5)=>{"use strict";m();function jme(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,C.nextTick(PS,this,t)):C.nextTick(PS,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?C.nextTick(rv,r):(r._writableState.errorEmitted=!0,C.nextTick(A5,r,o)):C.nextTick(A5,r,o):e?(C.nextTick(rv,r),e(o)):C.nextTick(rv,r)}),this)}function A5(t,e){PS(t,e),rv(t)}function rv(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function zme(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function PS(t,e){t.emit("error",e)}function Hme(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}T5.exports={destroy:jme,undestroy:zme,errorOrDestroy:Hme}});var Zu=F((MFe,D5)=>{"use strict";m();function $me(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var R5={};function po(t,e,r){r||(r=Error);function i(o,c,u){return typeof e=="string"?e:e(o,c,u)}var n=function(o){$me(c,o);function c(u,d,y){return o.call(this,i(u,d,y))||this}return c}(r);n.prototype.name=r.name,n.prototype.code=t,R5[t]=n}function M5(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(i){return String(i)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function Gme(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Kme(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Vme(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}po("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);po("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;typeof e=="string"&&Gme(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";var n;if(Kme(t," argument"))n="The ".concat(t," ").concat(i," ").concat(M5(e,"type"));else{var o=Vme(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(M5(e,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);po("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");po("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});po("ERR_STREAM_PREMATURE_CLOSE","Premature close");po("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});po("ERR_MULTIPLE_CALLBACK","Callback called multiple times");po("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");po("ERR_STREAM_WRITE_AFTER_END","write after end");po("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);po("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);po("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");D5.exports.codes=R5});var BS=F((RFe,k5)=>{"use strict";m();var Wme=Zu().codes.ERR_INVALID_OPT_VALUE;function Yme(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Qme(t,e,r,i){var n=Yme(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new Wme(o,n)}return Math.floor(n)}return t.objectMode?16:16*1024}k5.exports={getHighWaterMark:Qme}});var qS=F((DFe,F5)=>{"use strict";m();F5.exports=un;function O5(t){var e=this;this.next=null,this.entry=null,this.finish=function(){E0e(e,t)}}var vd;un.WritableState=Em;var Jme={deprecate:ky()},P5=IS(),iv=xn().Buffer,Xme=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Zme(t){return iv.from(t)}function e0e(t){return iv.isBuffer(t)||t instanceof Xme}var LS=NS(),t0e=BS(),r0e=t0e.getHighWaterMark,_c=Zu().codes,n0e=_c.ERR_INVALID_ARG_TYPE,i0e=_c.ERR_METHOD_NOT_IMPLEMENTED,o0e=_c.ERR_MULTIPLE_CALLBACK,s0e=_c.ERR_STREAM_CANNOT_PIPE,a0e=_c.ERR_STREAM_DESTROYED,c0e=_c.ERR_STREAM_NULL_VALUES,u0e=_c.ERR_STREAM_WRITE_AFTER_END,l0e=_c.ERR_UNKNOWN_ENCODING,bd=LS.errorOrDestroy;vt()(un,P5);function f0e(){}function Em(t,e,r){vd=vd||el(),t=t||{},typeof r!="boolean"&&(r=e instanceof vd),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=r0e(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){v0e(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new O5(this)}Em.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Em.prototype,"buffer",{get:Jme.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var nv;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(nv=Function.prototype[Symbol.hasInstance],Object.defineProperty(un,Symbol.hasInstance,{value:function(e){return nv.call(this,e)?!0:this!==un?!1:e&&e._writableState instanceof Em}})):nv=function(e){return e instanceof this};function un(t){vd=vd||el();var e=this instanceof vd;if(!e&&!nv.call(un,this))return new un(t);this._writableState=new Em(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),P5.call(this)}un.prototype.pipe=function(){bd(this,new s0e)};function d0e(t,e){var r=new u0e;bd(t,r),C.nextTick(e,r)}function h0e(t,e,r,i){var n;return r===null?n=new c0e:typeof r!="string"&&!e.objectMode&&(n=new n0e("chunk",["string","Buffer"],r)),n?(bd(t,n),C.nextTick(i,n),!1):!0}un.prototype.write=function(t,e,r){var i=this._writableState,n=!1,o=!i.objectMode&&e0e(t);return o&&!iv.isBuffer(t)&&(t=Zme(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=f0e),i.ending?d0e(this,r):(o||h0e(this,i,t,r))&&(i.pendingcb++,n=m0e(this,i,o,t,e,r)),n};un.prototype.cork=function(){this._writableState.corked++};un.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&N5(this,t))};un.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new l0e(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(un.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function p0e(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=iv.from(e,r)),e}Object.defineProperty(un.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function m0e(t,e,r,i,n,o){if(!r){var c=p0e(e,i,n);i!==c&&(r=!0,n="buffer",i=c)}var u=e.objectMode?1:i.length;e.length+=u;var d=e.length{"use strict";m();var S0e=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};q5.exports=Ss;var L5=zS(),jS=qS();vt()(Ss,L5);for(US=S0e(jS.prototype),ov=0;ov{"use strict";m();var U5=Zu().codes.ERR_STREAM_PREMATURE_CLOSE;function T0e(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n{"use strict";m();var cv;function wc(t,e,r){return e=D0e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D0e(t){var e=k0e(t,"string");return typeof e=="symbol"?e:String(e)}function k0e(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var I0e=av(),xc=Symbol("lastResolve"),tl=Symbol("lastReject"),Sm=Symbol("error"),uv=Symbol("ended"),rl=Symbol("lastPromise"),HS=Symbol("handlePromise"),nl=Symbol("stream");function Ec(t,e){return{value:t,done:e}}function O0e(t){var e=t[xc];if(e!==null){var r=t[nl].read();r!==null&&(t[rl]=null,t[xc]=null,t[tl]=null,e(Ec(r,!1)))}}function P0e(t){C.nextTick(O0e,t)}function N0e(t,e){return function(r,i){t.then(function(){if(e[uv]){r(Ec(void 0,!0));return}e[HS](r,i)},i)}}var B0e=Object.getPrototypeOf(function(){}),F0e=Object.setPrototypeOf((cv={get stream(){return this[nl]},next:function(){var e=this,r=this[Sm];if(r!==null)return Promise.reject(r);if(this[uv])return Promise.resolve(Ec(void 0,!0));if(this[nl].destroyed)return new Promise(function(c,u){C.nextTick(function(){e[Sm]?u(e[Sm]):c(Ec(void 0,!0))})});var i=this[rl],n;if(i)n=new Promise(N0e(i,this));else{var o=this[nl].read();if(o!==null)return Promise.resolve(Ec(o,!1));n=new Promise(this[HS])}return this[rl]=n,n}},wc(cv,Symbol.asyncIterator,function(){return this}),wc(cv,"return",function(){var e=this;return new Promise(function(r,i){e[nl].destroy(null,function(n){if(n){i(n);return}r(Ec(void 0,!0))})})}),cv),B0e),L0e=function(e){var r,i=Object.create(F0e,(r={},wc(r,nl,{value:e,writable:!0}),wc(r,xc,{value:null,writable:!0}),wc(r,tl,{value:null,writable:!0}),wc(r,Sm,{value:null,writable:!0}),wc(r,uv,{value:e._readableState.endEmitted,writable:!0}),wc(r,HS,{value:function(o,c){var u=i[nl].read();u?(i[rl]=null,i[xc]=null,i[tl]=null,o(Ec(u,!1))):(i[xc]=o,i[tl]=c)},writable:!0}),r));return i[rl]=null,I0e(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[tl];o!==null&&(i[rl]=null,i[xc]=null,i[tl]=null,o(n)),i[Sm]=n;return}var c=i[xc];c!==null&&(i[rl]=null,i[xc]=null,i[tl]=null,c(Ec(void 0,!0))),i[uv]=!0}),e.on("readable",P0e.bind(null,i)),i};H5.exports=L0e});var K5=F((PFe,G5)=>{m();G5.exports=function(){throw new Error("Readable.from is not available in the browser")}});var zS=F((BFe,rN)=>{"use strict";m();rN.exports=ar;var _d;ar.ReadableState=Q5;var NFe=aa().EventEmitter,Y5=function(e,r){return e.listeners(r).length},Am=IS(),lv=xn().Buffer,q0e=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function U0e(t){return lv.from(t)}function j0e(t){return lv.isBuffer(t)||t instanceof q0e}var $S=Gu(),Ut;$S&&$S.debuglog?Ut=$S.debuglog("stream"):Ut=function(){};var z0e=C5(),JS=NS(),H0e=BS(),$0e=H0e.getHighWaterMark,fv=Zu().codes,G0e=fv.ERR_INVALID_ARG_TYPE,K0e=fv.ERR_STREAM_PUSH_AFTER_EOF,V0e=fv.ERR_METHOD_NOT_IMPLEMENTED,W0e=fv.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,wd,GS,KS;vt()(ar,Am);var Cm=JS.errorOrDestroy,VS=["error","close","destroy","pause","resume"];function Y0e(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function Q5(t,e,r){_d=_d||el(),t=t||{},typeof r!="boolean"&&(r=e instanceof _d),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=$0e(this,t,"readableHighWaterMark",r),this.buffer=new z0e,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(wd||(wd=mc().StringDecoder),this.decoder=new wd(t.encoding),this.encoding=t.encoding)}function ar(t){if(_d=_d||el(),!(this instanceof ar))return new ar(t);var e=this instanceof _d;this._readableState=new Q5(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Am.call(this)}Object.defineProperty(ar.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});ar.prototype.destroy=JS.destroy;ar.prototype._undestroy=JS.undestroy;ar.prototype._destroy=function(t,e){e(t)};ar.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=lv.from(t,e),e=""),i=!0),J5(this,t,e,!1,i)};ar.prototype.unshift=function(t){return J5(this,t,null,!0,!1)};function J5(t,e,r,i,n){Ut("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,X0e(t,o);else{var c;if(n||(c=Q0e(o,e)),c)Cm(t,c);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==lv.prototype&&(e=U0e(e)),i)o.endEmitted?Cm(t,new W0e):WS(t,o,e,!0);else if(o.ended)Cm(t,new K0e);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?WS(t,o,e,!1):QS(t,o)):WS(t,o,e,!1)}else i||(o.reading=!1,QS(t,o))}return!o.ended&&(o.length=V5?t=V5:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function W5(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=J0e(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ar.prototype.read=function(t){Ut("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return Ut("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?YS(this):dv(this),null;if(t=W5(t,e),t===0&&e.ended)return e.length===0&&YS(this),null;var i=e.needReadable;Ut("need readable",i),(e.length===0||e.length-t0?n=eN(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&YS(this)),n!==null&&this.emit("data",n),n};function X0e(t,e){if(Ut("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?dv(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,X5(t)))}}function dv(t){var e=t._readableState;Ut("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(Ut("emitReadable",e.flowing),e.emittedReadable=!0,C.nextTick(X5,t))}function X5(t){var e=t._readableState;Ut("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,XS(t)}function QS(t,e){e.readingMore||(e.readingMore=!0,C.nextTick(Z0e,t,e))}function Z0e(t,e){for(;!e.reading&&!e.ended&&(e.length1&&tN(i.pipes,t)!==-1)&&!y&&(Ut("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function A(D){Ut("onerror",D),I(),t.removeListener("error",A),Y5(t,"error")===0&&Cm(t,D)}Y0e(t,"error",A);function R(){t.removeListener("finish",M),I()}t.once("close",R);function M(){Ut("onfinish"),t.removeListener("close",R),I()}t.once("finish",M);function I(){Ut("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(Ut("pipe resume"),r.resume()),t};function ege(t){return function(){var r=t._readableState;Ut("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Y5(t,"data")&&(r.flowing=!0,XS(t))}}ar.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,Ut("on readable",i.length,i.reading),i.length?dv(this):i.reading||C.nextTick(tge,this)),r};ar.prototype.addListener=ar.prototype.on;ar.prototype.removeListener=function(t,e){var r=Am.prototype.removeListener.call(this,t,e);return t==="readable"&&C.nextTick(Z5,this),r};ar.prototype.removeAllListeners=function(t){var e=Am.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&C.nextTick(Z5,this),e};function Z5(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function tge(t){Ut("readable nexttick read 0"),t.read(0)}ar.prototype.resume=function(){var t=this._readableState;return t.flowing||(Ut("resume"),t.flowing=!t.readableListening,rge(this,t)),t.paused=!1,this};function rge(t,e){e.resumeScheduled||(e.resumeScheduled=!0,C.nextTick(nge,t,e))}function nge(t,e){Ut("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),XS(t),e.flowing&&!e.reading&&t.read(0)}ar.prototype.pause=function(){return Ut("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Ut("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function XS(t){var e=t._readableState;for(Ut("flow",e.flowing);e.flowing&&t.read()!==null;);}ar.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(Ut("wrapped end"),r.decoder&&!r.ended){var c=r.decoder.end();c&&c.length&&e.push(c)}e.push(null)}),t.on("data",function(c){if(Ut("wrapped data"),r.decoder&&(c=r.decoder.write(c)),!(r.objectMode&&c==null)&&!(!r.objectMode&&(!c||!c.length))){var u=e.push(c);u||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(u){return function(){return t[u].apply(t,arguments)}}(n));for(var o=0;o=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function YS(t){var e=t._readableState;Ut("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,C.nextTick(ige,e,t))}function ige(t,e){if(Ut("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(ar.from=function(t,e){return KS===void 0&&(KS=K5()),KS(ar,t,e)});function tN(t,e){for(var r=0,i=t.length;r{"use strict";m();iN.exports=fa;var hv=Zu().codes,oge=hv.ERR_METHOD_NOT_IMPLEMENTED,sge=hv.ERR_MULTIPLE_CALLBACK,age=hv.ERR_TRANSFORM_ALREADY_TRANSFORMING,cge=hv.ERR_TRANSFORM_WITH_LENGTH_0,pv=el();vt()(fa,pv);function uge(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new sge);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{"use strict";m();sN.exports=Tm;var oN=ZS();vt()(Tm,oN);function Tm(t){if(!(this instanceof Tm))return new Tm(t);oN.call(this,t)}Tm.prototype._transform=function(t,e,r){r(null,t)}});var dN=F((qFe,fN)=>{"use strict";m();var e2;function fge(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var lN=Zu().codes,dge=lN.ERR_MISSING_ARGS,hge=lN.ERR_STREAM_DESTROYED;function cN(t){if(t)throw t}function pge(t){return t.setHeader&&typeof t.abort=="function"}function mge(t,e,r,i){i=fge(i);var n=!1;t.on("close",function(){n=!0}),e2===void 0&&(e2=av()),e2(t,{readable:e,writable:r},function(c){if(c)return i(c);n=!0,i()});var o=!1;return function(c){if(!n&&!o){if(o=!0,pge(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(c||new hge("pipe"))}}}function uN(t){t()}function gge(t,e){return t.pipe(e)}function yge(t){return!t.length||typeof t[t.length-1]!="function"?cN:t.pop()}function vge(){for(var t=arguments.length,e=new Array(t),r=0;r0;return mge(c,d,y,function(E){n||(n=E),E&&o.forEach(uN),!d&&(o.forEach(uN),i(n))})});return e.reduce(gge)}fN.exports=vge});var il=F((UFe,hN)=>{m();hN.exports=mo;var t2=aa().EventEmitter,bge=vt();bge(mo,t2);mo.Readable=zS();mo.Writable=qS();mo.Duplex=el();mo.Transform=ZS();mo.PassThrough=aN();mo.finished=av();mo.pipeline=dN();mo.Stream=mo;function mo(){t2.call(this)}mo.prototype.pipe=function(t,e){var r=this;function i(E){t.writable&&t.write(E)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",c),r.on("close",u));var o=!1;function c(){o||(o=!0,t.end())}function u(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function d(E){if(y(),t2.listenerCount(this,"error")===0)throw E}r.on("error",d),t.on("error",d);function y(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",c),r.removeListener("close",u),r.removeListener("error",d),t.removeListener("error",d),r.removeListener("end",y),r.removeListener("close",y),t.removeListener("close",y)}return r.on("end",y),r.on("close",y),t.on("close",y),t.emit("pipe",r),t}});var da=F((jFe,gN)=>{m();var pN=At().Buffer,mN=il().Transform,_ge=mc().StringDecoder,wge=vt();function Go(t){mN.call(this),this.hashMode=typeof t=="string",this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}wge(Go,mN);Go.prototype.update=function(t,e,r){typeof t=="string"&&(t=pN.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)};Go.prototype.setAutoPadding=function(){};Go.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};Go.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};Go.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};Go.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(n){i=n}finally{r(i)}};Go.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(r){e=r}t(e)};Go.prototype._finalOrDigest=function(t){var e=this.__final()||pN.alloc(0);return t&&(e=this._toString(e,t,!0)),e};Go.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new _ge(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i};gN.exports=Go});var xd=F((zFe,vN)=>{"use strict";m();var xge=vt(),Ege=Wy(),Sge=Qy(),Cge=ev(),yN=da();function mv(t){yN.call(this,"digest"),this._hash=t}xge(mv,yN);mv.prototype._update=function(t){this._hash.update(t)};mv.prototype._final=function(){return this._hash.digest()};vN.exports=function(e){return e=e.toLowerCase(),e==="md5"?new Ege:e==="rmd160"||e==="ripemd160"?new Sge:new mv(Cge(e))}});var wN=F((HFe,_N)=>{"use strict";m();var Age=vt(),ol=At().Buffer,bN=da(),Tge=ol.alloc(128),Ed=64;function gv(t,e){bN.call(this,"digest"),typeof e=="string"&&(e=ol.from(e)),this._alg=t,this._key=e,e.length>Ed?e=t(e):e.length{m();var Mge=Wy();xN.exports=function(t){return new Mge().update(t).digest()}});var o2=F((GFe,SN)=>{"use strict";m();var Rge=vt(),Dge=wN(),EN=da(),Mm=At().Buffer,kge=r2(),n2=Qy(),i2=ev(),Ige=Mm.alloc(128);function Rm(t,e){EN.call(this,"digest"),typeof e=="string"&&(e=Mm.from(e));var r=t==="sha512"||t==="sha384"?128:64;if(this._alg=t,this._key=e,e.length>r){var i=t==="rmd160"?new n2:i2(t);e=i.update(e).digest()}else e.length{Oge.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}});var AN=F((VFe,CN)=>{"use strict";m();CN.exports=s2()});var a2=F((WFe,TN)=>{m();var Pge=Math.pow(2,30)-1;TN.exports=function(t,e){if(typeof t!="number")throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if(typeof e!="number")throw new TypeError("Key length not a number");if(e<0||e>Pge||e!==e)throw new TypeError("Bad key length")}});var c2=F((YFe,RN)=>{m();var yv;window.process&&window.process.browser?yv="utf-8":window.process&&window.process.version?(MN=parseInt(C.version.split(".")[0].slice(1),10),yv=MN>=6?"utf-8":"binary"):yv="utf-8";var MN;RN.exports=yv});var l2=F((QFe,DN)=>{m();var u2=At().Buffer;DN.exports=function(t,e,r){if(u2.isBuffer(t))return t;if(typeof t=="string")return u2.from(t,e);if(ArrayBuffer.isView(t))return u2.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}});var f2=F((JFe,PN)=>{m();var Nge=r2(),Bge=Qy(),Fge=ev(),sl=At().Buffer,Lge=a2(),kN=c2(),IN=l2(),qge=sl.alloc(128),vv={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function ON(t,e,r){var i=Uge(t),n=t==="sha512"||t==="sha384"?128:64;e.length>n?e=i(e):e.length{m();var LN=At().Buffer,zge=a2(),NN=c2(),BN=f2(),FN=l2(),bv,Dm=window.crypto&&window.crypto.subtle,Hge={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d2=[];function $ge(t){if(window.process&&!window.process.browser||!Dm||!Dm.importKey||!Dm.deriveBits)return Promise.resolve(!1);if(d2[t]!==void 0)return d2[t];bv=bv||LN.alloc(8);var e=qN(bv,bv,10,128,t).then(function(){return!0}).catch(function(){return!1});return d2[t]=e,e}var al;function h2(){return al||(window.process&&window.process.nextTick?al=window.process.nextTick:window.queueMicrotask?al=window.queueMicrotask:window.setImmediate?al=window.setImmediate:al=window.setTimeout,al)}function qN(t,e,r,i,n){return Dm.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then(function(o){return Dm.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:n}},o,i<<3)}).then(function(o){return LN.from(o)})}function Gge(t,e){t.then(function(r){h2()(function(){e(null,r)})},function(r){h2()(function(){e(r)})})}UN.exports=function(t,e,r,i,n,o){typeof n=="function"&&(o=n,n=void 0),n=n||"sha1";var c=Hge[n.toLowerCase()];if(!c||typeof window.Promise!="function"){h2()(function(){var u;try{u=BN(t,e,r,i,n)}catch(d){return o(d)}o(null,u)});return}if(zge(r,i),t=FN(t,NN,"Password"),e=FN(e,NN,"Salt"),typeof o!="function")throw new Error("No callback provided to pbkdf2");Gge($ge(c).then(function(u){return u?qN(t,e,r,i,c):BN(t,e,r,i,n)}),o)}});var m2=F(p2=>{m();p2.pbkdf2=jN();p2.pbkdf2Sync=f2()});var g2=F(go=>{"use strict";m();go.readUInt32BE=function(e,r){var i=e[0+r]<<24|e[1+r]<<16|e[2+r]<<8|e[3+r];return i>>>0};go.writeUInt32BE=function(e,r,i){e[0+i]=r>>>24,e[1+i]=r>>>16&255,e[2+i]=r>>>8&255,e[3+i]=r&255};go.ip=function(e,r,i,n){for(var o=0,c=0,u=6;u>=0;u-=2){for(var d=0;d<=24;d+=8)o<<=1,o|=r>>>d+u&1;for(var d=0;d<=24;d+=8)o<<=1,o|=e>>>d+u&1}for(var u=6;u>=0;u-=2){for(var d=1;d<=25;d+=8)c<<=1,c|=r>>>d+u&1;for(var d=1;d<=25;d+=8)c<<=1,c|=e>>>d+u&1}i[n+0]=o>>>0,i[n+1]=c>>>0};go.rip=function(e,r,i,n){for(var o=0,c=0,u=0;u<4;u++)for(var d=24;d>=0;d-=8)o<<=1,o|=r>>>d+u&1,o<<=1,o|=e>>>d+u&1;for(var u=4;u<8;u++)for(var d=24;d>=0;d-=8)c<<=1,c|=r>>>d+u&1,c<<=1,c|=e>>>d+u&1;i[n+0]=o>>>0,i[n+1]=c>>>0};go.pc1=function(e,r,i,n){for(var o=0,c=0,u=7;u>=5;u--){for(var d=0;d<=24;d+=8)o<<=1,o|=r>>d+u&1;for(var d=0;d<=24;d+=8)o<<=1,o|=e>>d+u&1}for(var d=0;d<=24;d+=8)o<<=1,o|=r>>d+u&1;for(var u=1;u<=3;u++){for(var d=0;d<=24;d+=8)c<<=1,c|=r>>d+u&1;for(var d=0;d<=24;d+=8)c<<=1,c|=e>>d+u&1}for(var d=0;d<=24;d+=8)c<<=1,c|=e>>d+u&1;i[n+0]=o>>>0,i[n+1]=c>>>0};go.r28shl=function(e,r){return e<>>28-r};var _v=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];go.pc2=function(e,r,i,n){for(var o=0,c=0,u=_v.length>>>1,d=0;d>>_v[d]&1;for(var d=u;d<_v.length;d++)c<<=1,c|=r>>>_v[d]&1;i[n+0]=o>>>0,i[n+1]=c>>>0};go.expand=function(e,r,i){var n=0,o=0;n=(e&1)<<5|e>>>27;for(var c=23;c>=15;c-=4)n<<=6,n|=e>>>c&63;for(var c=11;c>=3;c-=4)o|=e>>>c&63,o<<=6;o|=(e&31)<<1|e>>>31,r[i+0]=n>>>0,r[i+1]=o>>>0};var zN=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];go.substitute=function(e,r){for(var i=0,n=0;n<4;n++){var o=e>>>18-n*6&63,c=zN[n*64+o];i<<=4,i|=c}for(var n=0;n<4;n++){var o=r>>>18-n*6&63,c=zN[4*64+n*64+o];i<<=4,i|=c}return i>>>0};var HN=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];go.permute=function(e){for(var r=0,i=0;i>>HN[i]&1;return r>>>0};go.padSplit=function(e,r,i){for(var n=e.toString(2);n.length{m();GN.exports=$N;function $N(t,e){if(!t)throw new Error(e||"Assertion failed")}$N.equal=function(e,r,i){if(e!=r)throw new Error(i||"Assertion failed: "+e+" != "+r)}});var wv=F((r9e,KN)=>{"use strict";m();var Kge=Zi();function yo(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=t.padding!==!1}KN.exports=yo;yo.prototype._init=function(){};yo.prototype.update=function(e){return e.length===0?[]:this.type==="decrypt"?this._updateDecrypt(e):this._updateEncrypt(e)};yo.prototype._buffer=function(e,r){for(var i=Math.min(this.buffer.length-this.bufferOff,e.length-r),n=0;n0;n--)r+=this._buffer(e,r),i+=this._flushBuffer(o,i);return r+=this._buffer(e,r),o};yo.prototype.final=function(e){var r;e&&(r=this.update(e));var i;return this.type==="encrypt"?i=this._finalEncrypt():i=this._finalDecrypt(),r?r.concat(i):i};yo.prototype._pad=function(e,r){if(r===0)return!1;for(;r{"use strict";m();var VN=Zi(),Vge=vt(),On=g2(),WN=wv();function Wge(){this.tmp=new Array(2),this.keys=null}function Cs(t){WN.call(this,t);var e=new Wge;this._desState=e,this.deriveKeys(e,t.key)}Vge(Cs,WN);YN.exports=Cs;Cs.create=function(e){return new Cs(e)};var Yge=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];Cs.prototype.deriveKeys=function(e,r){e.keys=new Array(16*2),VN.equal(r.length,this.blockSize,"Invalid key length");var i=On.readUInt32BE(r,0),n=On.readUInt32BE(r,4);On.pc1(i,n,e.tmp,0),i=e.tmp[0],n=e.tmp[1];for(var o=0;o>>1];i=On.r28shl(i,c),n=On.r28shl(n,c),On.pc2(i,n,e.keys,o)}};Cs.prototype._update=function(e,r,i,n){var o=this._desState,c=On.readUInt32BE(e,r),u=On.readUInt32BE(e,r+4);On.ip(c,u,o.tmp,0),c=o.tmp[0],u=o.tmp[1],this.type==="encrypt"?this._encrypt(o,c,u,o.tmp,0):this._decrypt(o,c,u,o.tmp,0),c=o.tmp[0],u=o.tmp[1],On.writeUInt32BE(i,c,n),On.writeUInt32BE(i,u,n+4)};Cs.prototype._pad=function(e,r){if(this.padding===!1)return!1;for(var i=e.length-r,n=r;n>>0,c=R}On.rip(u,c,n,o)};Cs.prototype._decrypt=function(e,r,i,n,o){for(var c=i,u=r,d=e.keys.length-2;d>=0;d-=2){var y=e.keys[d],E=e.keys[d+1];On.expand(c,e.tmp,0),y^=e.tmp[0],E^=e.tmp[1];var x=On.substitute(y,E),A=On.permute(x),R=c;c=(u^A)>>>0,u=R}On.rip(c,u,n,o)}});var JN=F(QN=>{"use strict";m();var Qge=Zi(),Jge=vt(),xv={};function Xge(t){Qge.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e{"use strict";m();var eye=Zi(),tye=vt(),XN=wv(),Sc=y2();function rye(t,e){eye.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),n=e.slice(16,24);t==="encrypt"?this.ciphers=[Sc.create({type:"encrypt",key:r}),Sc.create({type:"decrypt",key:i}),Sc.create({type:"encrypt",key:n})]:this.ciphers=[Sc.create({type:"decrypt",key:n}),Sc.create({type:"encrypt",key:i}),Sc.create({type:"decrypt",key:r})]}function cl(t){XN.call(this,t);var e=new rye(this.type,this.options.key);this._edeState=e}tye(cl,XN);ZN.exports=cl;cl.create=function(e){return new cl(e)};cl.prototype._update=function(e,r,i,n){var o=this._edeState;o.ciphers[0]._update(e,r,i,n),o.ciphers[1]._update(i,n,i,n),o.ciphers[2]._update(i,n,i,n)};cl.prototype._pad=Sc.prototype._pad;cl.prototype._unpad=Sc.prototype._unpad});var tB=F(Sd=>{"use strict";m();Sd.utils=g2();Sd.Cipher=wv();Sd.DES=y2();Sd.CBC=JN();Sd.EDE=eB()});var iB=F((a9e,nB)=>{m();var rB=da(),ha=tB(),nye=vt(),ul=At().Buffer,km={"des-ede3-cbc":ha.CBC.instantiate(ha.EDE),"des-ede3":ha.EDE,"des-ede-cbc":ha.CBC.instantiate(ha.EDE),"des-ede":ha.EDE,"des-cbc":ha.CBC.instantiate(ha.DES),"des-ecb":ha.DES};km.des=km["des-cbc"];km.des3=km["des-ede3-cbc"];nB.exports=Ev;nye(Ev,rB);function Ev(t){rB.call(this);var e=t.mode.toLowerCase(),r=km[e],i;t.decrypt?i="decrypt":i="encrypt";var n=t.key;ul.isBuffer(n)||(n=ul.from(n)),(e==="des-ede"||e==="des-ede-cbc")&&(n=ul.concat([n,n.slice(0,8)]));var o=t.iv;ul.isBuffer(o)||(o=ul.from(o)),this._des=r.create({key:n,iv:o,type:i})}Ev.prototype._update=function(t){return ul.from(this._des.update(t))};Ev.prototype._final=function(){return ul.from(this._des.final())}});var oB=F(v2=>{m();v2.encrypt=function(t,e){return t._cipher.encryptBlock(e)};v2.decrypt=function(t,e){return t._cipher.decryptBlock(e)}});var Cd=F((u9e,sB)=>{m();sB.exports=function(e,r){for(var i=Math.min(e.length,r.length),n=new T(i),o=0;o{m();var aB=Cd();b2.encrypt=function(t,e){var r=aB(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev};b2.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return aB(i,r)}});var fB=F(lB=>{m();var Im=At().Buffer,iye=Cd();function uB(t,e,r){var i=e.length,n=iye(e,t._cache);return t._cache=t._cache.slice(i),t._prev=Im.concat([t._prev,r?e:n]),n}lB.encrypt=function(t,e,r){for(var i=Im.allocUnsafe(0),n;e.length;)if(t._cache.length===0&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=Im.allocUnsafe(0)),t._cache.length<=e.length)n=t._cache.length,i=Im.concat([i,uB(t,e.slice(0,n),r)]),e=e.slice(n);else{i=Im.concat([i,uB(t,e,r)]);break}return i}});var hB=F(dB=>{m();var _2=At().Buffer;function oye(t,e,r){var i=t._cipher.encryptBlock(t._prev),n=i[0]^e;return t._prev=_2.concat([t._prev.slice(1),_2.from([r?e:n])]),n}dB.encrypt=function(t,e,r){for(var i=e.length,n=_2.allocUnsafe(i),o=-1;++o{m();var Sv=At().Buffer;function sye(t,e,r){for(var i,n=-1,o=8,c=0,u,d;++n>n%8,t._prev=aye(t._prev,r?u:d);return c}function aye(t,e){var r=t.length,i=-1,n=Sv.allocUnsafe(t.length);for(t=Sv.concat([t,Sv.from([e])]);++i>7;return n}pB.encrypt=function(t,e,r){for(var i=e.length,n=Sv.allocUnsafe(i),o=-1;++o{m();var cye=Cd();function uye(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}gB.encrypt=function(t,e){for(;t._cache.length{m();function lye(t){for(var e=t.length,r;e--;)if(r=t.readUInt8(e),r===255)t.writeUInt8(0,e);else{r++,t.writeUInt8(r,e);break}}vB.exports=lye});var E2=F(_B=>{m();var fye=Cd(),bB=At().Buffer,dye=w2();function hye(t){var e=t._cipher.encryptBlockRaw(t._prev);return dye(t._prev),e}var x2=16;_B.encrypt=function(t,e){var r=Math.ceil(e.length/x2),i=t._cache.length;t._cache=bB.concat([t._cache,bB.allocUnsafe(r*x2)]);for(var n=0;n{pye.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}});var Av=F((v9e,wB)=>{m();var mye={ECB:oB(),CBC:cB(),CFB:fB(),CFB8:hB(),CFB1:mB(),OFB:yB(),CTR:E2(),GCM:E2()},Cv=S2();for(C2 in Cv)Cv[C2].module=mye[Cv[C2].mode];var C2;wB.exports=Cv});var Om=F((b9e,EB)=>{m();var Tv=At().Buffer;function T2(t){Tv.isBuffer(t)||(t=Tv.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i>>24]^c[E>>>16&255]^u[x>>>8&255]^d[A&255]^e[O++],M=o[E>>>24]^c[x>>>16&255]^u[A>>>8&255]^d[y&255]^e[O++],I=o[x>>>24]^c[A>>>16&255]^u[y>>>8&255]^d[E&255]^e[O++],D=o[A>>>24]^c[y>>>16&255]^u[E>>>8&255]^d[x&255]^e[O++],y=R,E=M,x=I,A=D;return R=(i[y>>>24]<<24|i[E>>>16&255]<<16|i[x>>>8&255]<<8|i[A&255])^e[O++],M=(i[E>>>24]<<24|i[x>>>16&255]<<16|i[A>>>8&255]<<8|i[y&255])^e[O++],I=(i[x>>>24]<<24|i[A>>>16&255]<<16|i[y>>>8&255]<<8|i[E&255])^e[O++],D=(i[A>>>24]<<24|i[y>>>16&255]<<16|i[E>>>8&255]<<8|i[x&255])^e[O++],R=R>>>0,M=M>>>0,I=I>>>0,D=D>>>0,[R,M,I,D]}var gye=[0,1,2,4,8,16,32,64,128,27,54],Sn=function(){for(var t=new Array(256),e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],c=0,u=0,d=0;d<256;++d){var y=u^u<<1^u<<2^u<<3^u<<4;y=y>>>8^y&255^99,r[c]=y,i[y]=c;var E=t[c],x=t[E],A=t[x],R=t[y]*257^y*16843008;n[0][c]=R<<24|R>>>8,n[1][c]=R<<16|R>>>16,n[2][c]=R<<8|R>>>24,n[3][c]=R,R=A*16843009^x*65537^E*257^c*16843008,o[0][y]=R<<24|R>>>8,o[1][y]=R<<16|R>>>16,o[2][y]=R<<8|R>>>24,o[3][y]=R,c===0?c=u=1:(c=E^t[t[t[A^E]]],u^=t[t[u]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function vo(t){this._key=T2(t),this._reset()}vo.blockSize=4*4;vo.keySize=256/8;vo.prototype.blockSize=vo.blockSize;vo.prototype.keySize=vo.keySize;vo.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,i=(r+1)*4,n=[],o=0;o>>24,c=Sn.SBOX[c>>>24]<<24|Sn.SBOX[c>>>16&255]<<16|Sn.SBOX[c>>>8&255]<<8|Sn.SBOX[c&255],c^=gye[o/e|0]<<24):e>6&&o%e===4&&(c=Sn.SBOX[c>>>24]<<24|Sn.SBOX[c>>>16&255]<<16|Sn.SBOX[c>>>8&255]<<8|Sn.SBOX[c&255]),n[o]=n[o-e]^c}for(var u=[],d=0;d>>24]]^Sn.INV_SUB_MIX[1][Sn.SBOX[E>>>16&255]]^Sn.INV_SUB_MIX[2][Sn.SBOX[E>>>8&255]]^Sn.INV_SUB_MIX[3][Sn.SBOX[E&255]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=u};vo.prototype.encryptBlockRaw=function(t){return t=T2(t),xB(t,this._keySchedule,Sn.SUB_MIX,Sn.SBOX,this._nRounds)};vo.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=Tv.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r};vo.prototype.decryptBlock=function(t){t=T2(t);var e=t[1];t[1]=t[3],t[3]=e;var r=xB(t,this._invKeySchedule,Sn.INV_SUB_MIX,Sn.INV_SBOX,this._nRounds),i=Tv.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i};vo.prototype.scrub=function(){A2(this._keySchedule),A2(this._invKeySchedule),A2(this._key)};EB.exports.AES=vo});var AB=F((_9e,CB)=>{m();var Ad=At().Buffer,yye=Ad.alloc(16,0);function vye(t){return[t.readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)]}function SB(t){var e=Ad.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function Pm(t){this.h=t,this.state=Ad.alloc(16,0),this.cache=Ad.allocUnsafe(0)}Pm.prototype.ghash=function(t){for(var e=-1;++e0;r--)t[r]=t[r]>>>1|(t[r-1]&1)<<31;t[0]=t[0]>>>1,n&&(t[0]=t[0]^225<<24)}this.state=SB(e)};Pm.prototype.update=function(t){this.cache=Ad.concat([this.cache,t]);for(var e;this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)};Pm.prototype.final=function(t,e){return this.cache.length&&this.ghash(Ad.concat([this.cache,yye],16)),this.ghash(SB([0,t,0,e])),this.state};CB.exports=Pm});var M2=F((w9e,RB)=>{m();var bye=Om(),Fi=At().Buffer,TB=da(),_ye=vt(),MB=AB(),wye=Cd(),xye=w2();function Eye(t,e){var r=0;t.length!==e.length&&r++;for(var i=Math.min(t.length,e.length),n=0;n{m();var Cye=Om(),R2=At().Buffer,DB=da(),Aye=vt();function Mv(t,e,r,i){DB.call(this),this._cipher=new Cye.AES(e),this._prev=R2.from(r),this._cache=R2.allocUnsafe(0),this._secCache=R2.allocUnsafe(0),this._decrypt=i,this._mode=t}Aye(Mv,DB);Mv.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)};Mv.prototype._final=function(){this._cipher.scrub()};kB.exports=Mv});var Nm=F((E9e,IB)=>{m();var fl=At().Buffer,Tye=Wy();function Mye(t,e,r,i){if(fl.isBuffer(t)||(t=fl.from(t,"binary")),e&&(fl.isBuffer(e)||(e=fl.from(e,"binary")),e.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var n=r/8,o=fl.alloc(n),c=fl.alloc(i||0),u=fl.alloc(0);n>0||i>0;){var d=new Tye;d.update(u),d.update(t),e&&d.update(e),u=d.digest();var y=0;if(n>0){var E=o.length-n;y=Math.min(n,u.length),u.copy(o,E,0,y),n-=y}if(y0){var x=c.length-i,A=Math.min(i,u.length-y);u.copy(c,x,y,y+A),i-=A}}return u.fill(0),{key:o,iv:c}}IB.exports=Mye});var BB=F(k2=>{m();var OB=Av(),Rye=M2(),pa=At().Buffer,Dye=D2(),PB=da(),kye=Om(),Iye=Nm(),Oye=vt();function Bm(t,e,r){PB.call(this),this._cache=new Rv,this._cipher=new kye.AES(e),this._prev=pa.from(r),this._mode=t,this._autopadding=!0}Oye(Bm,PB);Bm.prototype._update=function(t){this._cache.add(t);for(var e,r,i=[];e=this._cache.get();)r=this._mode.encrypt(this,e),i.push(r);return pa.concat(i)};var Pye=pa.alloc(16,16);Bm.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(Pye))throw this._cipher.scrub(),new Error("data not multiple of block length")};Bm.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this};function Rv(){this.cache=pa.allocUnsafe(0)}Rv.prototype.add=function(t){this.cache=pa.concat([this.cache,t])};Rv.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null};Rv.prototype.flush=function(){for(var t=16-this.cache.length,e=pa.allocUnsafe(t),r=-1;++r{m();var Bye=M2(),Td=At().Buffer,FB=Av(),Fye=D2(),LB=da(),Lye=Om(),qye=Nm(),Uye=vt();function Fm(t,e,r){LB.call(this),this._cache=new Dv,this._last=void 0,this._cipher=new Lye.AES(e),this._prev=Td.from(r),this._mode=t,this._autopadding=!0}Uye(Fm,LB);Fm.prototype._update=function(t){this._cache.add(t);for(var e,r,i=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),i.push(r);return Td.concat(i)};Fm.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return jye(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")};Fm.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this};function Dv(){this.cache=Td.allocUnsafe(0)}Dv.prototype.add=function(t){this.cache=Td.concat([this.cache,t])};Dv.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null};Dv.prototype.flush=function(){if(this.cache.length)return this.cache};function jye(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r{m();var jB=BB(),zB=UB(),Hye=S2();function $ye(){return Object.keys(Hye)}Ko.createCipher=Ko.Cipher=jB.createCipher;Ko.createCipheriv=Ko.Cipheriv=jB.createCipheriv;Ko.createDecipher=Ko.Decipher=zB.createDecipher;Ko.createDecipheriv=Ko.Decipheriv=zB.createDecipheriv;Ko.listCiphers=Ko.getCiphers=$ye});var HB=F(ma=>{m();ma["des-ecb"]={key:8,iv:0};ma["des-cbc"]=ma.des={key:8,iv:8};ma["des-ede3-cbc"]=ma.des3={key:24,iv:8};ma["des-ede3"]={key:24,iv:0};ma["des-ede-cbc"]={key:16,iv:8};ma["des-ede"]={key:16,iv:0}});var WB=F(Vo=>{m();var $B=iB(),O2=kv(),Cc=Av(),ga=HB(),GB=Nm();function Gye(t,e){t=t.toLowerCase();var r,i;if(Cc[t])r=Cc[t].key,i=Cc[t].iv;else if(ga[t])r=ga[t].key*8,i=ga[t].iv;else throw new TypeError("invalid suite type");var n=GB(e,!1,r,i);return KB(t,n.key,n.iv)}function Kye(t,e){t=t.toLowerCase();var r,i;if(Cc[t])r=Cc[t].key,i=Cc[t].iv;else if(ga[t])r=ga[t].key*8,i=ga[t].iv;else throw new TypeError("invalid suite type");var n=GB(e,!1,r,i);return VB(t,n.key,n.iv)}function KB(t,e,r){if(t=t.toLowerCase(),Cc[t])return O2.createCipheriv(t,e,r);if(ga[t])return new $B({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function VB(t,e,r){if(t=t.toLowerCase(),Cc[t])return O2.createDecipheriv(t,e,r);if(ga[t])return new $B({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}function Vye(){return Object.keys(ga).concat(O2.getCiphers())}Vo.createCipher=Vo.Cipher=Gye;Vo.createCipheriv=Vo.Cipheriv=KB;Vo.createDecipher=Vo.Decipher=Kye;Vo.createDecipheriv=Vo.Decipheriv=VB;Vo.listCiphers=Vo.getCiphers=Vye});var Ac=F(()=>{m()});var N2=F((YB,P2)=>{m();(function(t,e){"use strict";function r(_,s){if(!_)throw new Error(s||"Assertion failed")}function i(_,s){_.super_=s;var l=function(){};l.prototype=s.prototype,_.prototype=new l,_.prototype.constructor=_}function n(_,s,l){if(n.isBN(_))return _;this.negative=0,this.words=null,this.length=0,this.red=null,_!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(_||0,s||10,l||"be"))}typeof t=="object"?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ac().Buffer}catch{}n.isBN=function(s){return s instanceof n?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===n.wordSize&&Array.isArray(s.words)},n.max=function(s,l){return s.cmp(l)>0?s:l},n.min=function(s,l){return s.cmp(l)<0?s:l},n.prototype._init=function(s,l,p){if(typeof s=="number")return this._initNumber(s,l,p);if(typeof s=="object")return this._initArray(s,l,p);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f=0;f-=3)b=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[h]|=b<>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);else if(p==="le")for(f=0,h=0;f>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);return this.strip()};function c(_,s){var l=_.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function u(_,s,l){var p=c(_,l);return l-1>=s&&(p|=c(_,l-1)<<4),p}n.prototype._parseHex=function(s,l,p){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f=l;f-=2)w=u(s,l,f)<=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8;else{var g=s.length-l;for(f=g%2===0?l+1:l;f=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8}this.strip()};function d(_,s,l,p){for(var f=0,h=Math.min(_.length,l),b=s;b=49?f+=w-49+10:w>=17?f+=w-17+10:f+=w}return f}n.prototype._parseBase=function(s,l,p){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=l)f++;f--,h=h/l|0;for(var b=s.length-p,w=b%f,g=Math.min(b,b-w)+p,a=0,v=p;v1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(s,l){s=s||10,l=l|0||1;var p;if(s===16||s==="hex"){p="";for(var f=0,h=0,b=0;b>>24-f&16777215,h!==0||b!==this.length-1?p=y[6-g.length]+g+p:p=g+p,f+=2,f>=26&&(f-=26,b--)}for(h!==0&&(p=h.toString(16)+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(s===(s|0)&&s>=2&&s<=36){var a=E[s],v=x[s];p="";var P=this.clone();for(P.negative=0;!P.isZero();){var k=P.modn(v).toString(s);P=P.idivn(v),P.isZero()?p=k+p:p=y[a-k.length]+k+p}for(this.isZero()&&(p="0"+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},n.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},n.prototype.toArrayLike=function(s,l,p){var f=this.byteLength(),h=p||Math.max(1,f);r(f<=h,"byte array longer than desired length"),r(h>0,"Requested array length <= 0"),this.strip();var b=l==="le",w=new s(h),g,a,v=this.clone();if(b){for(a=0;!v.isZero();a++)g=v.andln(255),v.iushrn(8),w[a]=g;for(;a=4096&&(p+=13,l>>>=13),l>=64&&(p+=7,l>>>=7),l>=8&&(p+=4,l>>>=4),l>=2&&(p+=2,l>>>=2),p+l},n.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,p=0;return(l&8191)===0&&(p+=13,l>>>=13),(l&127)===0&&(p+=7,l>>>=7),(l&15)===0&&(p+=4,l>>>=4),(l&3)===0&&(p+=2,l>>>=2),(l&1)===0&&p++,p},n.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function A(_){for(var s=new Array(_.bitLength()),l=0;l>>f}return s}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;ls.length?this.clone().ior(s):s.clone().ior(this)},n.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},n.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var p=0;ps.length?this.clone().iand(s):s.clone().iand(this)},n.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},n.prototype.iuxor=function(s){var l,p;this.length>s.length?(l=this,p=s):(l=s,p=this);for(var f=0;fs.length?this.clone().ixor(s):s.clone().ixor(this)},n.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},n.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,p=s%26;this._expand(l),p>0&&l--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-p),this.strip()},n.prototype.notn=function(s){return this.clone().inotn(s)},n.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var p=s/26|0,f=s%26;return this._expand(p+1),l?this.words[p]=this.words[p]|1<s.length?(p=this,f=s):(p=s,f=this);for(var h=0,b=0;b>>26;for(;h!==0&&b>>26;if(this.length=p.length,h!==0)this.words[this.length]=h,this.length++;else if(p!==this)for(;bs.length?this.clone().iadd(s):s.clone().iadd(this)},n.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var p=this.cmp(s);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;p>0?(f=this,h=s):(f=s,h=this);for(var b=0,w=0;w>26,this.words[w]=l&67108863;for(;b!==0&&w>26,this.words[w]=l&67108863;if(b===0&&w>>26,P=g&67108863,k=Math.min(a,s.length-1),S=Math.max(0,a-_.length+1);S<=k;S++){var B=a-S|0;f=_.words[B]|0,h=s.words[S]|0,b=f*h+P,v+=b/67108864|0,P=b&67108863}l.words[a]=P|0,g=v|0}return g!==0?l.words[a]=g|0:l.length--,l.strip()}var M=function(s,l,p){var f=s.words,h=l.words,b=p.words,w=0,g,a,v,P=f[0]|0,k=P&8191,S=P>>>13,B=f[1]|0,$=B&8191,K=B>>>13,he=f[2]|0,X=he&8191,Z=he>>>13,it=f[3]|0,oe=it&8191,ce=it>>>13,Rt=f[4]|0,ue=Rt&8191,ie=Rt>>>13,bt=f[5]|0,pe=bt&8191,ge=bt>>>13,Ct=f[6]|0,le=Ct&8191,me=Ct>>>13,Ht=f[7]|0,ye=Ht&8191,de=Ht>>>13,Mr=f[8]|0,xe=Mr&8191,Ee=Mr>>>13,Ir=f[9]|0,_e=Ir&8191,we=Ir>>>13,Lr=h[0]|0,De=Lr&8191,Ce=Lr>>>13,$r=h[1]|0,Ae=$r&8191,ke=$r>>>13,Lt=h[2]|0,be=Lt&8191,Te=Lt>>>13,Yr=h[3]|0,ve=Yr&8191,Se=Yr>>>13,Qr=h[4]|0,Ie=Qr&8191,Me=Qr>>>13,Jr=h[5]|0,Pe=Jr&8191,Oe=Jr>>>13,Xr=h[6]|0,Re=Xr&8191,Ne=Xr>>>13,Zr=h[7]|0,Be=Zr&8191,Fe=Zr>>>13,Gr=h[8]|0,Le=Gr&8191,qe=Gr>>>13,en=h[9]|0,Ue=en&8191,je=en>>>13;p.negative=s.negative^l.negative,p.length=19,g=Math.imul(k,De),a=Math.imul(k,Ce),a=a+Math.imul(S,De)|0,v=Math.imul(S,Ce);var gr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(gr>>>26)|0,gr&=67108863,g=Math.imul($,De),a=Math.imul($,Ce),a=a+Math.imul(K,De)|0,v=Math.imul(K,Ce),g=g+Math.imul(k,Ae)|0,a=a+Math.imul(k,ke)|0,a=a+Math.imul(S,Ae)|0,v=v+Math.imul(S,ke)|0;var wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,g=Math.imul(X,De),a=Math.imul(X,Ce),a=a+Math.imul(Z,De)|0,v=Math.imul(Z,Ce),g=g+Math.imul($,Ae)|0,a=a+Math.imul($,ke)|0,a=a+Math.imul(K,Ae)|0,v=v+Math.imul(K,ke)|0,g=g+Math.imul(k,be)|0,a=a+Math.imul(k,Te)|0,a=a+Math.imul(S,be)|0,v=v+Math.imul(S,Te)|0;var xt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,g=Math.imul(oe,De),a=Math.imul(oe,Ce),a=a+Math.imul(ce,De)|0,v=Math.imul(ce,Ce),g=g+Math.imul(X,Ae)|0,a=a+Math.imul(X,ke)|0,a=a+Math.imul(Z,Ae)|0,v=v+Math.imul(Z,ke)|0,g=g+Math.imul($,be)|0,a=a+Math.imul($,Te)|0,a=a+Math.imul(K,be)|0,v=v+Math.imul(K,Te)|0,g=g+Math.imul(k,ve)|0,a=a+Math.imul(k,Se)|0,a=a+Math.imul(S,ve)|0,v=v+Math.imul(S,Se)|0;var or=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(or>>>26)|0,or&=67108863,g=Math.imul(ue,De),a=Math.imul(ue,Ce),a=a+Math.imul(ie,De)|0,v=Math.imul(ie,Ce),g=g+Math.imul(oe,Ae)|0,a=a+Math.imul(oe,ke)|0,a=a+Math.imul(ce,Ae)|0,v=v+Math.imul(ce,ke)|0,g=g+Math.imul(X,be)|0,a=a+Math.imul(X,Te)|0,a=a+Math.imul(Z,be)|0,v=v+Math.imul(Z,Te)|0,g=g+Math.imul($,ve)|0,a=a+Math.imul($,Se)|0,a=a+Math.imul(K,ve)|0,v=v+Math.imul(K,Se)|0,g=g+Math.imul(k,Ie)|0,a=a+Math.imul(k,Me)|0,a=a+Math.imul(S,Ie)|0,v=v+Math.imul(S,Me)|0;var yr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(yr>>>26)|0,yr&=67108863,g=Math.imul(pe,De),a=Math.imul(pe,Ce),a=a+Math.imul(ge,De)|0,v=Math.imul(ge,Ce),g=g+Math.imul(ue,Ae)|0,a=a+Math.imul(ue,ke)|0,a=a+Math.imul(ie,Ae)|0,v=v+Math.imul(ie,ke)|0,g=g+Math.imul(oe,be)|0,a=a+Math.imul(oe,Te)|0,a=a+Math.imul(ce,be)|0,v=v+Math.imul(ce,Te)|0,g=g+Math.imul(X,ve)|0,a=a+Math.imul(X,Se)|0,a=a+Math.imul(Z,ve)|0,v=v+Math.imul(Z,Se)|0,g=g+Math.imul($,Ie)|0,a=a+Math.imul($,Me)|0,a=a+Math.imul(K,Ie)|0,v=v+Math.imul(K,Me)|0,g=g+Math.imul(k,Pe)|0,a=a+Math.imul(k,Oe)|0,a=a+Math.imul(S,Pe)|0,v=v+Math.imul(S,Oe)|0;var lr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(lr>>>26)|0,lr&=67108863,g=Math.imul(le,De),a=Math.imul(le,Ce),a=a+Math.imul(me,De)|0,v=Math.imul(me,Ce),g=g+Math.imul(pe,Ae)|0,a=a+Math.imul(pe,ke)|0,a=a+Math.imul(ge,Ae)|0,v=v+Math.imul(ge,ke)|0,g=g+Math.imul(ue,be)|0,a=a+Math.imul(ue,Te)|0,a=a+Math.imul(ie,be)|0,v=v+Math.imul(ie,Te)|0,g=g+Math.imul(oe,ve)|0,a=a+Math.imul(oe,Se)|0,a=a+Math.imul(ce,ve)|0,v=v+Math.imul(ce,Se)|0,g=g+Math.imul(X,Ie)|0,a=a+Math.imul(X,Me)|0,a=a+Math.imul(Z,Ie)|0,v=v+Math.imul(Z,Me)|0,g=g+Math.imul($,Pe)|0,a=a+Math.imul($,Oe)|0,a=a+Math.imul(K,Pe)|0,v=v+Math.imul(K,Oe)|0,g=g+Math.imul(k,Re)|0,a=a+Math.imul(k,Ne)|0,a=a+Math.imul(S,Re)|0,v=v+Math.imul(S,Ne)|0;var vr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(vr>>>26)|0,vr&=67108863,g=Math.imul(ye,De),a=Math.imul(ye,Ce),a=a+Math.imul(de,De)|0,v=Math.imul(de,Ce),g=g+Math.imul(le,Ae)|0,a=a+Math.imul(le,ke)|0,a=a+Math.imul(me,Ae)|0,v=v+Math.imul(me,ke)|0,g=g+Math.imul(pe,be)|0,a=a+Math.imul(pe,Te)|0,a=a+Math.imul(ge,be)|0,v=v+Math.imul(ge,Te)|0,g=g+Math.imul(ue,ve)|0,a=a+Math.imul(ue,Se)|0,a=a+Math.imul(ie,ve)|0,v=v+Math.imul(ie,Se)|0,g=g+Math.imul(oe,Ie)|0,a=a+Math.imul(oe,Me)|0,a=a+Math.imul(ce,Ie)|0,v=v+Math.imul(ce,Me)|0,g=g+Math.imul(X,Pe)|0,a=a+Math.imul(X,Oe)|0,a=a+Math.imul(Z,Pe)|0,v=v+Math.imul(Z,Oe)|0,g=g+Math.imul($,Re)|0,a=a+Math.imul($,Ne)|0,a=a+Math.imul(K,Re)|0,v=v+Math.imul(K,Ne)|0,g=g+Math.imul(k,Be)|0,a=a+Math.imul(k,Fe)|0,a=a+Math.imul(S,Be)|0,v=v+Math.imul(S,Fe)|0;var br=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(br>>>26)|0,br&=67108863,g=Math.imul(xe,De),a=Math.imul(xe,Ce),a=a+Math.imul(Ee,De)|0,v=Math.imul(Ee,Ce),g=g+Math.imul(ye,Ae)|0,a=a+Math.imul(ye,ke)|0,a=a+Math.imul(de,Ae)|0,v=v+Math.imul(de,ke)|0,g=g+Math.imul(le,be)|0,a=a+Math.imul(le,Te)|0,a=a+Math.imul(me,be)|0,v=v+Math.imul(me,Te)|0,g=g+Math.imul(pe,ve)|0,a=a+Math.imul(pe,Se)|0,a=a+Math.imul(ge,ve)|0,v=v+Math.imul(ge,Se)|0,g=g+Math.imul(ue,Ie)|0,a=a+Math.imul(ue,Me)|0,a=a+Math.imul(ie,Ie)|0,v=v+Math.imul(ie,Me)|0,g=g+Math.imul(oe,Pe)|0,a=a+Math.imul(oe,Oe)|0,a=a+Math.imul(ce,Pe)|0,v=v+Math.imul(ce,Oe)|0,g=g+Math.imul(X,Re)|0,a=a+Math.imul(X,Ne)|0,a=a+Math.imul(Z,Re)|0,v=v+Math.imul(Z,Ne)|0,g=g+Math.imul($,Be)|0,a=a+Math.imul($,Fe)|0,a=a+Math.imul(K,Be)|0,v=v+Math.imul(K,Fe)|0,g=g+Math.imul(k,Le)|0,a=a+Math.imul(k,qe)|0,a=a+Math.imul(S,Le)|0,v=v+Math.imul(S,qe)|0;var _r=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(_r>>>26)|0,_r&=67108863,g=Math.imul(_e,De),a=Math.imul(_e,Ce),a=a+Math.imul(we,De)|0,v=Math.imul(we,Ce),g=g+Math.imul(xe,Ae)|0,a=a+Math.imul(xe,ke)|0,a=a+Math.imul(Ee,Ae)|0,v=v+Math.imul(Ee,ke)|0,g=g+Math.imul(ye,be)|0,a=a+Math.imul(ye,Te)|0,a=a+Math.imul(de,be)|0,v=v+Math.imul(de,Te)|0,g=g+Math.imul(le,ve)|0,a=a+Math.imul(le,Se)|0,a=a+Math.imul(me,ve)|0,v=v+Math.imul(me,Se)|0,g=g+Math.imul(pe,Ie)|0,a=a+Math.imul(pe,Me)|0,a=a+Math.imul(ge,Ie)|0,v=v+Math.imul(ge,Me)|0,g=g+Math.imul(ue,Pe)|0,a=a+Math.imul(ue,Oe)|0,a=a+Math.imul(ie,Pe)|0,v=v+Math.imul(ie,Oe)|0,g=g+Math.imul(oe,Re)|0,a=a+Math.imul(oe,Ne)|0,a=a+Math.imul(ce,Re)|0,v=v+Math.imul(ce,Ne)|0,g=g+Math.imul(X,Be)|0,a=a+Math.imul(X,Fe)|0,a=a+Math.imul(Z,Be)|0,v=v+Math.imul(Z,Fe)|0,g=g+Math.imul($,Le)|0,a=a+Math.imul($,qe)|0,a=a+Math.imul(K,Le)|0,v=v+Math.imul(K,qe)|0,g=g+Math.imul(k,Ue)|0,a=a+Math.imul(k,je)|0,a=a+Math.imul(S,Ue)|0,v=v+Math.imul(S,je)|0;var wr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wr>>>26)|0,wr&=67108863,g=Math.imul(_e,Ae),a=Math.imul(_e,ke),a=a+Math.imul(we,Ae)|0,v=Math.imul(we,ke),g=g+Math.imul(xe,be)|0,a=a+Math.imul(xe,Te)|0,a=a+Math.imul(Ee,be)|0,v=v+Math.imul(Ee,Te)|0,g=g+Math.imul(ye,ve)|0,a=a+Math.imul(ye,Se)|0,a=a+Math.imul(de,ve)|0,v=v+Math.imul(de,Se)|0,g=g+Math.imul(le,Ie)|0,a=a+Math.imul(le,Me)|0,a=a+Math.imul(me,Ie)|0,v=v+Math.imul(me,Me)|0,g=g+Math.imul(pe,Pe)|0,a=a+Math.imul(pe,Oe)|0,a=a+Math.imul(ge,Pe)|0,v=v+Math.imul(ge,Oe)|0,g=g+Math.imul(ue,Re)|0,a=a+Math.imul(ue,Ne)|0,a=a+Math.imul(ie,Re)|0,v=v+Math.imul(ie,Ne)|0,g=g+Math.imul(oe,Be)|0,a=a+Math.imul(oe,Fe)|0,a=a+Math.imul(ce,Be)|0,v=v+Math.imul(ce,Fe)|0,g=g+Math.imul(X,Le)|0,a=a+Math.imul(X,qe)|0,a=a+Math.imul(Z,Le)|0,v=v+Math.imul(Z,qe)|0,g=g+Math.imul($,Ue)|0,a=a+Math.imul($,je)|0,a=a+Math.imul(K,Ue)|0,v=v+Math.imul(K,je)|0;var tr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(tr>>>26)|0,tr&=67108863,g=Math.imul(_e,be),a=Math.imul(_e,Te),a=a+Math.imul(we,be)|0,v=Math.imul(we,Te),g=g+Math.imul(xe,ve)|0,a=a+Math.imul(xe,Se)|0,a=a+Math.imul(Ee,ve)|0,v=v+Math.imul(Ee,Se)|0,g=g+Math.imul(ye,Ie)|0,a=a+Math.imul(ye,Me)|0,a=a+Math.imul(de,Ie)|0,v=v+Math.imul(de,Me)|0,g=g+Math.imul(le,Pe)|0,a=a+Math.imul(le,Oe)|0,a=a+Math.imul(me,Pe)|0,v=v+Math.imul(me,Oe)|0,g=g+Math.imul(pe,Re)|0,a=a+Math.imul(pe,Ne)|0,a=a+Math.imul(ge,Re)|0,v=v+Math.imul(ge,Ne)|0,g=g+Math.imul(ue,Be)|0,a=a+Math.imul(ue,Fe)|0,a=a+Math.imul(ie,Be)|0,v=v+Math.imul(ie,Fe)|0,g=g+Math.imul(oe,Le)|0,a=a+Math.imul(oe,qe)|0,a=a+Math.imul(ce,Le)|0,v=v+Math.imul(ce,qe)|0,g=g+Math.imul(X,Ue)|0,a=a+Math.imul(X,je)|0,a=a+Math.imul(Z,Ue)|0,v=v+Math.imul(Z,je)|0;var Wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,g=Math.imul(_e,ve),a=Math.imul(_e,Se),a=a+Math.imul(we,ve)|0,v=Math.imul(we,Se),g=g+Math.imul(xe,Ie)|0,a=a+Math.imul(xe,Me)|0,a=a+Math.imul(Ee,Ie)|0,v=v+Math.imul(Ee,Me)|0,g=g+Math.imul(ye,Pe)|0,a=a+Math.imul(ye,Oe)|0,a=a+Math.imul(de,Pe)|0,v=v+Math.imul(de,Oe)|0,g=g+Math.imul(le,Re)|0,a=a+Math.imul(le,Ne)|0,a=a+Math.imul(me,Re)|0,v=v+Math.imul(me,Ne)|0,g=g+Math.imul(pe,Be)|0,a=a+Math.imul(pe,Fe)|0,a=a+Math.imul(ge,Be)|0,v=v+Math.imul(ge,Fe)|0,g=g+Math.imul(ue,Le)|0,a=a+Math.imul(ue,qe)|0,a=a+Math.imul(ie,Le)|0,v=v+Math.imul(ie,qe)|0,g=g+Math.imul(oe,Ue)|0,a=a+Math.imul(oe,je)|0,a=a+Math.imul(ce,Ue)|0,v=v+Math.imul(ce,je)|0;var fr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(fr>>>26)|0,fr&=67108863,g=Math.imul(_e,Ie),a=Math.imul(_e,Me),a=a+Math.imul(we,Ie)|0,v=Math.imul(we,Me),g=g+Math.imul(xe,Pe)|0,a=a+Math.imul(xe,Oe)|0,a=a+Math.imul(Ee,Pe)|0,v=v+Math.imul(Ee,Oe)|0,g=g+Math.imul(ye,Re)|0,a=a+Math.imul(ye,Ne)|0,a=a+Math.imul(de,Re)|0,v=v+Math.imul(de,Ne)|0,g=g+Math.imul(le,Be)|0,a=a+Math.imul(le,Fe)|0,a=a+Math.imul(me,Be)|0,v=v+Math.imul(me,Fe)|0,g=g+Math.imul(pe,Le)|0,a=a+Math.imul(pe,qe)|0,a=a+Math.imul(ge,Le)|0,v=v+Math.imul(ge,qe)|0,g=g+Math.imul(ue,Ue)|0,a=a+Math.imul(ue,je)|0,a=a+Math.imul(ie,Ue)|0,v=v+Math.imul(ie,je)|0;var Yt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,g=Math.imul(_e,Pe),a=Math.imul(_e,Oe),a=a+Math.imul(we,Pe)|0,v=Math.imul(we,Oe),g=g+Math.imul(xe,Re)|0,a=a+Math.imul(xe,Ne)|0,a=a+Math.imul(Ee,Re)|0,v=v+Math.imul(Ee,Ne)|0,g=g+Math.imul(ye,Be)|0,a=a+Math.imul(ye,Fe)|0,a=a+Math.imul(de,Be)|0,v=v+Math.imul(de,Fe)|0,g=g+Math.imul(le,Le)|0,a=a+Math.imul(le,qe)|0,a=a+Math.imul(me,Le)|0,v=v+Math.imul(me,qe)|0,g=g+Math.imul(pe,Ue)|0,a=a+Math.imul(pe,je)|0,a=a+Math.imul(ge,Ue)|0,v=v+Math.imul(ge,je)|0;var dr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(dr>>>26)|0,dr&=67108863,g=Math.imul(_e,Re),a=Math.imul(_e,Ne),a=a+Math.imul(we,Re)|0,v=Math.imul(we,Ne),g=g+Math.imul(xe,Be)|0,a=a+Math.imul(xe,Fe)|0,a=a+Math.imul(Ee,Be)|0,v=v+Math.imul(Ee,Fe)|0,g=g+Math.imul(ye,Le)|0,a=a+Math.imul(ye,qe)|0,a=a+Math.imul(de,Le)|0,v=v+Math.imul(de,qe)|0,g=g+Math.imul(le,Ue)|0,a=a+Math.imul(le,je)|0,a=a+Math.imul(me,Ue)|0,v=v+Math.imul(me,je)|0;var rr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(rr>>>26)|0,rr&=67108863,g=Math.imul(_e,Be),a=Math.imul(_e,Fe),a=a+Math.imul(we,Be)|0,v=Math.imul(we,Fe),g=g+Math.imul(xe,Le)|0,a=a+Math.imul(xe,qe)|0,a=a+Math.imul(Ee,Le)|0,v=v+Math.imul(Ee,qe)|0,g=g+Math.imul(ye,Ue)|0,a=a+Math.imul(ye,je)|0,a=a+Math.imul(de,Ue)|0,v=v+Math.imul(de,je)|0;var nr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(nr>>>26)|0,nr&=67108863,g=Math.imul(_e,Le),a=Math.imul(_e,qe),a=a+Math.imul(we,Le)|0,v=Math.imul(we,qe),g=g+Math.imul(xe,Ue)|0,a=a+Math.imul(xe,je)|0,a=a+Math.imul(Ee,Ue)|0,v=v+Math.imul(Ee,je)|0;var hr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(hr>>>26)|0,hr&=67108863,g=Math.imul(_e,Ue),a=Math.imul(_e,je),a=a+Math.imul(we,Ue)|0,v=Math.imul(we,je);var xr=(w+g|0)+((a&8191)<<13)|0;return w=(v+(a>>>13)|0)+(xr>>>26)|0,xr&=67108863,b[0]=gr,b[1]=wt,b[2]=xt,b[3]=or,b[4]=yr,b[5]=lr,b[6]=vr,b[7]=br,b[8]=_r,b[9]=wr,b[10]=tr,b[11]=Wt,b[12]=fr,b[13]=Yt,b[14]=dr,b[15]=rr,b[16]=nr,b[17]=hr,b[18]=xr,w!==0&&(b[19]=w,p.length++),p};Math.imul||(M=R);function I(_,s,l){l.negative=s.negative^_.negative,l.length=_.length+s.length;for(var p=0,f=0,h=0;h>>26)|0,f+=b>>>26,b&=67108863}l.words[h]=w,p=b,b=f}return p!==0?l.words[h]=p:l.length--,l.strip()}function D(_,s,l){var p=new O;return p.mulp(_,s,l)}n.prototype.mulTo=function(s,l){var p,f=this.length+s.length;return this.length===10&&s.length===10?p=M(this,s,l):f<63?p=R(this,s,l):f<1024?p=I(this,s,l):p=D(this,s,l),p};function O(_,s){this.x=_,this.y=s}O.prototype.makeRBT=function(s){for(var l=new Array(s),p=n.prototype._countBits(s)-1,f=0;f>=1;return f},O.prototype.permute=function(s,l,p,f,h,b){for(var w=0;w>>1)h++;return 1<>>13,p[2*b+1]=h&8191,h=h>>>13;for(b=2*l;b>=26,l+=f/67108864|0,l+=h>>>26,this.words[p]=h&67108863}return l!==0&&(this.words[p]=l,this.length++),this},n.prototype.muln=function(s){return this.clone().imuln(s)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(s){var l=A(s);if(l.length===0)return new n(1);for(var p=this,f=0;f=0);var l=s%26,p=(s-l)/26,f=67108863>>>26-l<<26-l,h;if(l!==0){var b=0;for(h=0;h>>26-l}b&&(this.words[h]=b,this.length++)}if(p!==0){for(h=this.length-1;h>=0;h--)this.words[h+p]=this.words[h];for(h=0;h=0);var f;l?f=(l-l%26)/26:f=0;var h=s%26,b=Math.min((s-h)/26,this.length),w=67108863^67108863>>>h<b)for(this.length-=b,a=0;a=0&&(v!==0||a>=f);a--){var P=this.words[a]|0;this.words[a]=v<<26-h|P>>>h,v=P&w}return g&&v!==0&&(g.words[g.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(s,l,p){return r(this.negative===0),this.iushrn(s,l,p)},n.prototype.shln=function(s){return this.clone().ishln(s)},n.prototype.ushln=function(s){return this.clone().iushln(s)},n.prototype.shrn=function(s){return this.clone().ishrn(s)},n.prototype.ushrn=function(s){return this.clone().iushrn(s)},n.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,p=(s-l)/26,f=1<=0);var l=s%26,p=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(l!==0&&p++,this.length=Math.min(p,this.length),l!==0){var f=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},n.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(g/67108864|0),this.words[h+p]=b&67108863}for(;h>26,this.words[h+p]=b&67108863;if(w===0)return this.strip();for(r(w===-1),w=0,h=0;h>26,this.words[h]=b&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(s,l){var p=this.length-s.length,f=this.clone(),h=s,b=h.words[h.length-1]|0,w=this._countBits(b);p=26-w,p!==0&&(h=h.ushln(p),f.iushln(p),b=h.words[h.length-1]|0);var g=f.length-h.length,a;if(l!=="mod"){a=new n(null),a.length=g+1,a.words=new Array(a.length);for(var v=0;v=0;k--){var S=(f.words[h.length+k]|0)*67108864+(f.words[h.length+k-1]|0);for(S=Math.min(S/b|0,67108863),f._ishlnsubmul(h,S,k);f.negative!==0;)S--,f.negative=0,f._ishlnsubmul(h,1,k),f.isZero()||(f.negative^=1);a&&(a.words[k]=S)}return a&&a.strip(),f.strip(),l!=="div"&&p!==0&&f.iushrn(p),{div:a||null,mod:f}},n.prototype.divmod=function(s,l,p){if(r(!s.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,b;return this.negative!==0&&s.negative===0?(b=this.neg().divmod(s,l),l!=="mod"&&(f=b.div.neg()),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.iadd(s)),{div:f,mod:h}):this.negative===0&&s.negative!==0?(b=this.divmod(s.neg(),l),l!=="mod"&&(f=b.div.neg()),{div:f,mod:b.mod}):(this.negative&s.negative)!==0?(b=this.neg().divmod(s.neg(),l),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.isub(s)),{div:b.div,mod:h}):s.length>this.length||this.cmp(s)<0?{div:new n(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new n(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new n(this.modn(s.words[0]))}:this._wordDiv(s,l)},n.prototype.div=function(s){return this.divmod(s,"div",!1).div},n.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},n.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},n.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var p=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),h=s.andln(1),b=p.cmp(f);return b<0||h===1&&b===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},n.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,p=0,f=this.length-1;f>=0;f--)p=(l*p+(this.words[f]|0))%s;return p},n.prototype.idivn=function(s){r(s<=67108863);for(var l=0,p=this.length-1;p>=0;p--){var f=(this.words[p]|0)+l*67108864;this.words[p]=f/s|0,l=f%s}return this.strip()},n.prototype.divn=function(s){return this.clone().idivn(s)},n.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=new n(0),w=new n(1),g=0;l.isEven()&&p.isEven();)l.iushrn(1),p.iushrn(1),++g;for(var a=p.clone(),v=l.clone();!l.isZero();){for(var P=0,k=1;(l.words[0]&k)===0&&P<26;++P,k<<=1);if(P>0)for(l.iushrn(P);P-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(a),h.isub(v)),f.iushrn(1),h.iushrn(1);for(var S=0,B=1;(p.words[0]&B)===0&&S<26;++S,B<<=1);if(S>0)for(p.iushrn(S);S-- >0;)(b.isOdd()||w.isOdd())&&(b.iadd(a),w.isub(v)),b.iushrn(1),w.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(b),h.isub(w)):(p.isub(l),b.isub(f),w.isub(h))}return{a:b,b:w,gcd:p.iushln(g)}},n.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=p.clone();l.cmpn(1)>0&&p.cmpn(1)>0;){for(var w=0,g=1;(l.words[0]&g)===0&&w<26;++w,g<<=1);if(w>0)for(l.iushrn(w);w-- >0;)f.isOdd()&&f.iadd(b),f.iushrn(1);for(var a=0,v=1;(p.words[0]&v)===0&&a<26;++a,v<<=1);if(a>0)for(p.iushrn(a);a-- >0;)h.isOdd()&&h.iadd(b),h.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(h)):(p.isub(l),h.isub(f))}var P;return l.cmpn(1)===0?P=f:P=h,P.cmpn(0)<0&&P.iadd(s),P},n.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),p=s.clone();l.negative=0,p.negative=0;for(var f=0;l.isEven()&&p.isEven();f++)l.iushrn(1),p.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;p.isEven();)p.iushrn(1);var h=l.cmp(p);if(h<0){var b=l;l=p,p=b}else if(h===0||p.cmpn(1)===0)break;l.isub(p)}while(!0);return p.iushln(f)},n.prototype.invm=function(s){return this.egcd(s).a.umod(s)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(s){return this.words[0]&s},n.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,p=(s-l)/26,f=1<>>26,w&=67108863,this.words[b]=w}return h!==0&&(this.words[b]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var p;if(this.length>1)p=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;p=f===s?0:fs.length)return 1;if(this.length=0;p--){var f=this.words[p]|0,h=s.words[p]|0;if(f!==h){fh&&(l=1);break}}return l},n.prototype.gtn=function(s){return this.cmpn(s)===1},n.prototype.gt=function(s){return this.cmp(s)===1},n.prototype.gten=function(s){return this.cmpn(s)>=0},n.prototype.gte=function(s){return this.cmp(s)>=0},n.prototype.ltn=function(s){return this.cmpn(s)===-1},n.prototype.lt=function(s){return this.cmp(s)===-1},n.prototype.lten=function(s){return this.cmpn(s)<=0},n.prototype.lte=function(s){return this.cmp(s)<=0},n.prototype.eqn=function(s){return this.cmpn(s)===0},n.prototype.eq=function(s){return this.cmp(s)===0},n.red=function(s){return new q(s)},n.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(s){return this.red=s,this},n.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},n.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},n.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},n.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},n.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},n.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},n.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},n.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var N={k256:null,p224:null,p192:null,p25519:null};function L(_,s){this.name=_,this.p=new n(s,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var s=new n(null);return s.words=new Array(Math.ceil(this.n/13)),s},L.prototype.ireduce=function(s){var l=s,p;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),p=l.bitLength();while(p>this.n);var f=p0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},L.prototype.split=function(s,l){s.iushrn(this.n,0,l)},L.prototype.imulK=function(s){return s.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,L),j.prototype.split=function(s,l){for(var p=4194303,f=Math.min(s.length,9),h=0;h>>22,b=w}b>>>=22,s.words[h-10]=b,b===0&&s.length>10?s.length-=10:s.length-=9},j.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,p=0;p>>=26,s.words[p]=h,l=f}return l!==0&&(s.words[s.length++]=l),s},n._prime=function(s){if(N[s])return N[s];var l;if(s==="k256")l=new j;else if(s==="p224")l=new H;else if(s==="p192")l=new Y;else if(s==="p25519")l=new W;else throw new Error("Unknown prime "+s);return N[s]=l,l};function q(_){if(typeof _=="string"){var s=n._prime(_);this.m=s.p,this.prime=s}else r(_.gtn(1),"modulus must be greater than 1"),this.m=_,this.prime=null}q.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},q.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},q.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},q.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},q.prototype.add=function(s,l){this._verify2(s,l);var p=s.add(l);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},q.prototype.iadd=function(s,l){this._verify2(s,l);var p=s.iadd(l);return p.cmp(this.m)>=0&&p.isub(this.m),p},q.prototype.sub=function(s,l){this._verify2(s,l);var p=s.sub(l);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},q.prototype.isub=function(s,l){this._verify2(s,l);var p=s.isub(l);return p.cmpn(0)<0&&p.iadd(this.m),p},q.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},q.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},q.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},q.prototype.isqr=function(s){return this.imul(s,s.clone())},q.prototype.sqr=function(s){return this.mul(s,s)},q.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var p=this.m.add(new n(1)).iushrn(2);return this.pow(s,p)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);r(!f.isZero());var b=new n(1).toRed(this),w=b.redNeg(),g=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new n(2*a*a).toRed(this);this.pow(a,g).cmp(w)!==0;)a.redIAdd(w);for(var v=this.pow(a,f),P=this.pow(s,f.addn(1).iushrn(1)),k=this.pow(s,f),S=h;k.cmp(b)!==0;){for(var B=k,$=0;B.cmp(b)!==0;$++)B=B.redSqr();r($=0;h--){for(var v=l.words[h],P=a-1;P>=0;P--){var k=v>>P&1;if(b!==f[0]&&(b=this.sqr(b)),k===0&&w===0){g=0;continue}w<<=1,w|=k,g++,!(g!==p&&(h!==0||P!==0))&&(b=this.mul(b,f[w]),g=0,w=0)}a=26}return b},q.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},q.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},n.mont=function(s){return new J(s)};function J(_){q.call(this,_),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(J,q),J.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},J.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},J.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var p=s.imul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new n(0)._forceRed(this);var p=s.mul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof P2>"u"||P2,YB)});var JB=F((QB,B2)=>{m();(function(t,e){"use strict";function r(_,s){if(!_)throw new Error(s||"Assertion failed")}function i(_,s){_.super_=s;var l=function(){};l.prototype=s.prototype,_.prototype=new l,_.prototype.constructor=_}function n(_,s,l){if(n.isBN(_))return _;this.negative=0,this.words=null,this.length=0,this.red=null,_!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(_||0,s||10,l||"be"))}typeof t=="object"?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ac().Buffer}catch{}n.isBN=function(s){return s instanceof n?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===n.wordSize&&Array.isArray(s.words)},n.max=function(s,l){return s.cmp(l)>0?s:l},n.min=function(s,l){return s.cmp(l)<0?s:l},n.prototype._init=function(s,l,p){if(typeof s=="number")return this._initNumber(s,l,p);if(typeof s=="object")return this._initArray(s,l,p);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f=0;f-=3)b=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[h]|=b<>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);else if(p==="le")for(f=0,h=0;f>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);return this.strip()};function c(_,s){var l=_.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function u(_,s,l){var p=c(_,l);return l-1>=s&&(p|=c(_,l-1)<<4),p}n.prototype._parseHex=function(s,l,p){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f=l;f-=2)w=u(s,l,f)<=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8;else{var g=s.length-l;for(f=g%2===0?l+1:l;f=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8}this.strip()};function d(_,s,l,p){for(var f=0,h=Math.min(_.length,l),b=s;b=49?f+=w-49+10:w>=17?f+=w-17+10:f+=w}return f}n.prototype._parseBase=function(s,l,p){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=l)f++;f--,h=h/l|0;for(var b=s.length-p,w=b%f,g=Math.min(b,b-w)+p,a=0,v=p;v1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(s,l){s=s||10,l=l|0||1;var p;if(s===16||s==="hex"){p="";for(var f=0,h=0,b=0;b>>24-f&16777215,h!==0||b!==this.length-1?p=y[6-g.length]+g+p:p=g+p,f+=2,f>=26&&(f-=26,b--)}for(h!==0&&(p=h.toString(16)+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(s===(s|0)&&s>=2&&s<=36){var a=E[s],v=x[s];p="";var P=this.clone();for(P.negative=0;!P.isZero();){var k=P.modn(v).toString(s);P=P.idivn(v),P.isZero()?p=k+p:p=y[a-k.length]+k+p}for(this.isZero()&&(p="0"+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},n.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},n.prototype.toArrayLike=function(s,l,p){var f=this.byteLength(),h=p||Math.max(1,f);r(f<=h,"byte array longer than desired length"),r(h>0,"Requested array length <= 0"),this.strip();var b=l==="le",w=new s(h),g,a,v=this.clone();if(b){for(a=0;!v.isZero();a++)g=v.andln(255),v.iushrn(8),w[a]=g;for(;a=4096&&(p+=13,l>>>=13),l>=64&&(p+=7,l>>>=7),l>=8&&(p+=4,l>>>=4),l>=2&&(p+=2,l>>>=2),p+l},n.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,p=0;return(l&8191)===0&&(p+=13,l>>>=13),(l&127)===0&&(p+=7,l>>>=7),(l&15)===0&&(p+=4,l>>>=4),(l&3)===0&&(p+=2,l>>>=2),(l&1)===0&&p++,p},n.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function A(_){for(var s=new Array(_.bitLength()),l=0;l>>f}return s}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;ls.length?this.clone().ior(s):s.clone().ior(this)},n.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},n.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var p=0;ps.length?this.clone().iand(s):s.clone().iand(this)},n.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},n.prototype.iuxor=function(s){var l,p;this.length>s.length?(l=this,p=s):(l=s,p=this);for(var f=0;fs.length?this.clone().ixor(s):s.clone().ixor(this)},n.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},n.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,p=s%26;this._expand(l),p>0&&l--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-p),this.strip()},n.prototype.notn=function(s){return this.clone().inotn(s)},n.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var p=s/26|0,f=s%26;return this._expand(p+1),l?this.words[p]=this.words[p]|1<s.length?(p=this,f=s):(p=s,f=this);for(var h=0,b=0;b>>26;for(;h!==0&&b>>26;if(this.length=p.length,h!==0)this.words[this.length]=h,this.length++;else if(p!==this)for(;bs.length?this.clone().iadd(s):s.clone().iadd(this)},n.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var p=this.cmp(s);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;p>0?(f=this,h=s):(f=s,h=this);for(var b=0,w=0;w>26,this.words[w]=l&67108863;for(;b!==0&&w>26,this.words[w]=l&67108863;if(b===0&&w>>26,P=g&67108863,k=Math.min(a,s.length-1),S=Math.max(0,a-_.length+1);S<=k;S++){var B=a-S|0;f=_.words[B]|0,h=s.words[S]|0,b=f*h+P,v+=b/67108864|0,P=b&67108863}l.words[a]=P|0,g=v|0}return g!==0?l.words[a]=g|0:l.length--,l.strip()}var M=function(s,l,p){var f=s.words,h=l.words,b=p.words,w=0,g,a,v,P=f[0]|0,k=P&8191,S=P>>>13,B=f[1]|0,$=B&8191,K=B>>>13,he=f[2]|0,X=he&8191,Z=he>>>13,it=f[3]|0,oe=it&8191,ce=it>>>13,Rt=f[4]|0,ue=Rt&8191,ie=Rt>>>13,bt=f[5]|0,pe=bt&8191,ge=bt>>>13,Ct=f[6]|0,le=Ct&8191,me=Ct>>>13,Ht=f[7]|0,ye=Ht&8191,de=Ht>>>13,Mr=f[8]|0,xe=Mr&8191,Ee=Mr>>>13,Ir=f[9]|0,_e=Ir&8191,we=Ir>>>13,Lr=h[0]|0,De=Lr&8191,Ce=Lr>>>13,$r=h[1]|0,Ae=$r&8191,ke=$r>>>13,Lt=h[2]|0,be=Lt&8191,Te=Lt>>>13,Yr=h[3]|0,ve=Yr&8191,Se=Yr>>>13,Qr=h[4]|0,Ie=Qr&8191,Me=Qr>>>13,Jr=h[5]|0,Pe=Jr&8191,Oe=Jr>>>13,Xr=h[6]|0,Re=Xr&8191,Ne=Xr>>>13,Zr=h[7]|0,Be=Zr&8191,Fe=Zr>>>13,Gr=h[8]|0,Le=Gr&8191,qe=Gr>>>13,en=h[9]|0,Ue=en&8191,je=en>>>13;p.negative=s.negative^l.negative,p.length=19,g=Math.imul(k,De),a=Math.imul(k,Ce),a=a+Math.imul(S,De)|0,v=Math.imul(S,Ce);var gr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(gr>>>26)|0,gr&=67108863,g=Math.imul($,De),a=Math.imul($,Ce),a=a+Math.imul(K,De)|0,v=Math.imul(K,Ce),g=g+Math.imul(k,Ae)|0,a=a+Math.imul(k,ke)|0,a=a+Math.imul(S,Ae)|0,v=v+Math.imul(S,ke)|0;var wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,g=Math.imul(X,De),a=Math.imul(X,Ce),a=a+Math.imul(Z,De)|0,v=Math.imul(Z,Ce),g=g+Math.imul($,Ae)|0,a=a+Math.imul($,ke)|0,a=a+Math.imul(K,Ae)|0,v=v+Math.imul(K,ke)|0,g=g+Math.imul(k,be)|0,a=a+Math.imul(k,Te)|0,a=a+Math.imul(S,be)|0,v=v+Math.imul(S,Te)|0;var xt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,g=Math.imul(oe,De),a=Math.imul(oe,Ce),a=a+Math.imul(ce,De)|0,v=Math.imul(ce,Ce),g=g+Math.imul(X,Ae)|0,a=a+Math.imul(X,ke)|0,a=a+Math.imul(Z,Ae)|0,v=v+Math.imul(Z,ke)|0,g=g+Math.imul($,be)|0,a=a+Math.imul($,Te)|0,a=a+Math.imul(K,be)|0,v=v+Math.imul(K,Te)|0,g=g+Math.imul(k,ve)|0,a=a+Math.imul(k,Se)|0,a=a+Math.imul(S,ve)|0,v=v+Math.imul(S,Se)|0;var or=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(or>>>26)|0,or&=67108863,g=Math.imul(ue,De),a=Math.imul(ue,Ce),a=a+Math.imul(ie,De)|0,v=Math.imul(ie,Ce),g=g+Math.imul(oe,Ae)|0,a=a+Math.imul(oe,ke)|0,a=a+Math.imul(ce,Ae)|0,v=v+Math.imul(ce,ke)|0,g=g+Math.imul(X,be)|0,a=a+Math.imul(X,Te)|0,a=a+Math.imul(Z,be)|0,v=v+Math.imul(Z,Te)|0,g=g+Math.imul($,ve)|0,a=a+Math.imul($,Se)|0,a=a+Math.imul(K,ve)|0,v=v+Math.imul(K,Se)|0,g=g+Math.imul(k,Ie)|0,a=a+Math.imul(k,Me)|0,a=a+Math.imul(S,Ie)|0,v=v+Math.imul(S,Me)|0;var yr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(yr>>>26)|0,yr&=67108863,g=Math.imul(pe,De),a=Math.imul(pe,Ce),a=a+Math.imul(ge,De)|0,v=Math.imul(ge,Ce),g=g+Math.imul(ue,Ae)|0,a=a+Math.imul(ue,ke)|0,a=a+Math.imul(ie,Ae)|0,v=v+Math.imul(ie,ke)|0,g=g+Math.imul(oe,be)|0,a=a+Math.imul(oe,Te)|0,a=a+Math.imul(ce,be)|0,v=v+Math.imul(ce,Te)|0,g=g+Math.imul(X,ve)|0,a=a+Math.imul(X,Se)|0,a=a+Math.imul(Z,ve)|0,v=v+Math.imul(Z,Se)|0,g=g+Math.imul($,Ie)|0,a=a+Math.imul($,Me)|0,a=a+Math.imul(K,Ie)|0,v=v+Math.imul(K,Me)|0,g=g+Math.imul(k,Pe)|0,a=a+Math.imul(k,Oe)|0,a=a+Math.imul(S,Pe)|0,v=v+Math.imul(S,Oe)|0;var lr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(lr>>>26)|0,lr&=67108863,g=Math.imul(le,De),a=Math.imul(le,Ce),a=a+Math.imul(me,De)|0,v=Math.imul(me,Ce),g=g+Math.imul(pe,Ae)|0,a=a+Math.imul(pe,ke)|0,a=a+Math.imul(ge,Ae)|0,v=v+Math.imul(ge,ke)|0,g=g+Math.imul(ue,be)|0,a=a+Math.imul(ue,Te)|0,a=a+Math.imul(ie,be)|0,v=v+Math.imul(ie,Te)|0,g=g+Math.imul(oe,ve)|0,a=a+Math.imul(oe,Se)|0,a=a+Math.imul(ce,ve)|0,v=v+Math.imul(ce,Se)|0,g=g+Math.imul(X,Ie)|0,a=a+Math.imul(X,Me)|0,a=a+Math.imul(Z,Ie)|0,v=v+Math.imul(Z,Me)|0,g=g+Math.imul($,Pe)|0,a=a+Math.imul($,Oe)|0,a=a+Math.imul(K,Pe)|0,v=v+Math.imul(K,Oe)|0,g=g+Math.imul(k,Re)|0,a=a+Math.imul(k,Ne)|0,a=a+Math.imul(S,Re)|0,v=v+Math.imul(S,Ne)|0;var vr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(vr>>>26)|0,vr&=67108863,g=Math.imul(ye,De),a=Math.imul(ye,Ce),a=a+Math.imul(de,De)|0,v=Math.imul(de,Ce),g=g+Math.imul(le,Ae)|0,a=a+Math.imul(le,ke)|0,a=a+Math.imul(me,Ae)|0,v=v+Math.imul(me,ke)|0,g=g+Math.imul(pe,be)|0,a=a+Math.imul(pe,Te)|0,a=a+Math.imul(ge,be)|0,v=v+Math.imul(ge,Te)|0,g=g+Math.imul(ue,ve)|0,a=a+Math.imul(ue,Se)|0,a=a+Math.imul(ie,ve)|0,v=v+Math.imul(ie,Se)|0,g=g+Math.imul(oe,Ie)|0,a=a+Math.imul(oe,Me)|0,a=a+Math.imul(ce,Ie)|0,v=v+Math.imul(ce,Me)|0,g=g+Math.imul(X,Pe)|0,a=a+Math.imul(X,Oe)|0,a=a+Math.imul(Z,Pe)|0,v=v+Math.imul(Z,Oe)|0,g=g+Math.imul($,Re)|0,a=a+Math.imul($,Ne)|0,a=a+Math.imul(K,Re)|0,v=v+Math.imul(K,Ne)|0,g=g+Math.imul(k,Be)|0,a=a+Math.imul(k,Fe)|0,a=a+Math.imul(S,Be)|0,v=v+Math.imul(S,Fe)|0;var br=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(br>>>26)|0,br&=67108863,g=Math.imul(xe,De),a=Math.imul(xe,Ce),a=a+Math.imul(Ee,De)|0,v=Math.imul(Ee,Ce),g=g+Math.imul(ye,Ae)|0,a=a+Math.imul(ye,ke)|0,a=a+Math.imul(de,Ae)|0,v=v+Math.imul(de,ke)|0,g=g+Math.imul(le,be)|0,a=a+Math.imul(le,Te)|0,a=a+Math.imul(me,be)|0,v=v+Math.imul(me,Te)|0,g=g+Math.imul(pe,ve)|0,a=a+Math.imul(pe,Se)|0,a=a+Math.imul(ge,ve)|0,v=v+Math.imul(ge,Se)|0,g=g+Math.imul(ue,Ie)|0,a=a+Math.imul(ue,Me)|0,a=a+Math.imul(ie,Ie)|0,v=v+Math.imul(ie,Me)|0,g=g+Math.imul(oe,Pe)|0,a=a+Math.imul(oe,Oe)|0,a=a+Math.imul(ce,Pe)|0,v=v+Math.imul(ce,Oe)|0,g=g+Math.imul(X,Re)|0,a=a+Math.imul(X,Ne)|0,a=a+Math.imul(Z,Re)|0,v=v+Math.imul(Z,Ne)|0,g=g+Math.imul($,Be)|0,a=a+Math.imul($,Fe)|0,a=a+Math.imul(K,Be)|0,v=v+Math.imul(K,Fe)|0,g=g+Math.imul(k,Le)|0,a=a+Math.imul(k,qe)|0,a=a+Math.imul(S,Le)|0,v=v+Math.imul(S,qe)|0;var _r=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(_r>>>26)|0,_r&=67108863,g=Math.imul(_e,De),a=Math.imul(_e,Ce),a=a+Math.imul(we,De)|0,v=Math.imul(we,Ce),g=g+Math.imul(xe,Ae)|0,a=a+Math.imul(xe,ke)|0,a=a+Math.imul(Ee,Ae)|0,v=v+Math.imul(Ee,ke)|0,g=g+Math.imul(ye,be)|0,a=a+Math.imul(ye,Te)|0,a=a+Math.imul(de,be)|0,v=v+Math.imul(de,Te)|0,g=g+Math.imul(le,ve)|0,a=a+Math.imul(le,Se)|0,a=a+Math.imul(me,ve)|0,v=v+Math.imul(me,Se)|0,g=g+Math.imul(pe,Ie)|0,a=a+Math.imul(pe,Me)|0,a=a+Math.imul(ge,Ie)|0,v=v+Math.imul(ge,Me)|0,g=g+Math.imul(ue,Pe)|0,a=a+Math.imul(ue,Oe)|0,a=a+Math.imul(ie,Pe)|0,v=v+Math.imul(ie,Oe)|0,g=g+Math.imul(oe,Re)|0,a=a+Math.imul(oe,Ne)|0,a=a+Math.imul(ce,Re)|0,v=v+Math.imul(ce,Ne)|0,g=g+Math.imul(X,Be)|0,a=a+Math.imul(X,Fe)|0,a=a+Math.imul(Z,Be)|0,v=v+Math.imul(Z,Fe)|0,g=g+Math.imul($,Le)|0,a=a+Math.imul($,qe)|0,a=a+Math.imul(K,Le)|0,v=v+Math.imul(K,qe)|0,g=g+Math.imul(k,Ue)|0,a=a+Math.imul(k,je)|0,a=a+Math.imul(S,Ue)|0,v=v+Math.imul(S,je)|0;var wr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wr>>>26)|0,wr&=67108863,g=Math.imul(_e,Ae),a=Math.imul(_e,ke),a=a+Math.imul(we,Ae)|0,v=Math.imul(we,ke),g=g+Math.imul(xe,be)|0,a=a+Math.imul(xe,Te)|0,a=a+Math.imul(Ee,be)|0,v=v+Math.imul(Ee,Te)|0,g=g+Math.imul(ye,ve)|0,a=a+Math.imul(ye,Se)|0,a=a+Math.imul(de,ve)|0,v=v+Math.imul(de,Se)|0,g=g+Math.imul(le,Ie)|0,a=a+Math.imul(le,Me)|0,a=a+Math.imul(me,Ie)|0,v=v+Math.imul(me,Me)|0,g=g+Math.imul(pe,Pe)|0,a=a+Math.imul(pe,Oe)|0,a=a+Math.imul(ge,Pe)|0,v=v+Math.imul(ge,Oe)|0,g=g+Math.imul(ue,Re)|0,a=a+Math.imul(ue,Ne)|0,a=a+Math.imul(ie,Re)|0,v=v+Math.imul(ie,Ne)|0,g=g+Math.imul(oe,Be)|0,a=a+Math.imul(oe,Fe)|0,a=a+Math.imul(ce,Be)|0,v=v+Math.imul(ce,Fe)|0,g=g+Math.imul(X,Le)|0,a=a+Math.imul(X,qe)|0,a=a+Math.imul(Z,Le)|0,v=v+Math.imul(Z,qe)|0,g=g+Math.imul($,Ue)|0,a=a+Math.imul($,je)|0,a=a+Math.imul(K,Ue)|0,v=v+Math.imul(K,je)|0;var tr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(tr>>>26)|0,tr&=67108863,g=Math.imul(_e,be),a=Math.imul(_e,Te),a=a+Math.imul(we,be)|0,v=Math.imul(we,Te),g=g+Math.imul(xe,ve)|0,a=a+Math.imul(xe,Se)|0,a=a+Math.imul(Ee,ve)|0,v=v+Math.imul(Ee,Se)|0,g=g+Math.imul(ye,Ie)|0,a=a+Math.imul(ye,Me)|0,a=a+Math.imul(de,Ie)|0,v=v+Math.imul(de,Me)|0,g=g+Math.imul(le,Pe)|0,a=a+Math.imul(le,Oe)|0,a=a+Math.imul(me,Pe)|0,v=v+Math.imul(me,Oe)|0,g=g+Math.imul(pe,Re)|0,a=a+Math.imul(pe,Ne)|0,a=a+Math.imul(ge,Re)|0,v=v+Math.imul(ge,Ne)|0,g=g+Math.imul(ue,Be)|0,a=a+Math.imul(ue,Fe)|0,a=a+Math.imul(ie,Be)|0,v=v+Math.imul(ie,Fe)|0,g=g+Math.imul(oe,Le)|0,a=a+Math.imul(oe,qe)|0,a=a+Math.imul(ce,Le)|0,v=v+Math.imul(ce,qe)|0,g=g+Math.imul(X,Ue)|0,a=a+Math.imul(X,je)|0,a=a+Math.imul(Z,Ue)|0,v=v+Math.imul(Z,je)|0;var Wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,g=Math.imul(_e,ve),a=Math.imul(_e,Se),a=a+Math.imul(we,ve)|0,v=Math.imul(we,Se),g=g+Math.imul(xe,Ie)|0,a=a+Math.imul(xe,Me)|0,a=a+Math.imul(Ee,Ie)|0,v=v+Math.imul(Ee,Me)|0,g=g+Math.imul(ye,Pe)|0,a=a+Math.imul(ye,Oe)|0,a=a+Math.imul(de,Pe)|0,v=v+Math.imul(de,Oe)|0,g=g+Math.imul(le,Re)|0,a=a+Math.imul(le,Ne)|0,a=a+Math.imul(me,Re)|0,v=v+Math.imul(me,Ne)|0,g=g+Math.imul(pe,Be)|0,a=a+Math.imul(pe,Fe)|0,a=a+Math.imul(ge,Be)|0,v=v+Math.imul(ge,Fe)|0,g=g+Math.imul(ue,Le)|0,a=a+Math.imul(ue,qe)|0,a=a+Math.imul(ie,Le)|0,v=v+Math.imul(ie,qe)|0,g=g+Math.imul(oe,Ue)|0,a=a+Math.imul(oe,je)|0,a=a+Math.imul(ce,Ue)|0,v=v+Math.imul(ce,je)|0;var fr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(fr>>>26)|0,fr&=67108863,g=Math.imul(_e,Ie),a=Math.imul(_e,Me),a=a+Math.imul(we,Ie)|0,v=Math.imul(we,Me),g=g+Math.imul(xe,Pe)|0,a=a+Math.imul(xe,Oe)|0,a=a+Math.imul(Ee,Pe)|0,v=v+Math.imul(Ee,Oe)|0,g=g+Math.imul(ye,Re)|0,a=a+Math.imul(ye,Ne)|0,a=a+Math.imul(de,Re)|0,v=v+Math.imul(de,Ne)|0,g=g+Math.imul(le,Be)|0,a=a+Math.imul(le,Fe)|0,a=a+Math.imul(me,Be)|0,v=v+Math.imul(me,Fe)|0,g=g+Math.imul(pe,Le)|0,a=a+Math.imul(pe,qe)|0,a=a+Math.imul(ge,Le)|0,v=v+Math.imul(ge,qe)|0,g=g+Math.imul(ue,Ue)|0,a=a+Math.imul(ue,je)|0,a=a+Math.imul(ie,Ue)|0,v=v+Math.imul(ie,je)|0;var Yt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,g=Math.imul(_e,Pe),a=Math.imul(_e,Oe),a=a+Math.imul(we,Pe)|0,v=Math.imul(we,Oe),g=g+Math.imul(xe,Re)|0,a=a+Math.imul(xe,Ne)|0,a=a+Math.imul(Ee,Re)|0,v=v+Math.imul(Ee,Ne)|0,g=g+Math.imul(ye,Be)|0,a=a+Math.imul(ye,Fe)|0,a=a+Math.imul(de,Be)|0,v=v+Math.imul(de,Fe)|0,g=g+Math.imul(le,Le)|0,a=a+Math.imul(le,qe)|0,a=a+Math.imul(me,Le)|0,v=v+Math.imul(me,qe)|0,g=g+Math.imul(pe,Ue)|0,a=a+Math.imul(pe,je)|0,a=a+Math.imul(ge,Ue)|0,v=v+Math.imul(ge,je)|0;var dr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(dr>>>26)|0,dr&=67108863,g=Math.imul(_e,Re),a=Math.imul(_e,Ne),a=a+Math.imul(we,Re)|0,v=Math.imul(we,Ne),g=g+Math.imul(xe,Be)|0,a=a+Math.imul(xe,Fe)|0,a=a+Math.imul(Ee,Be)|0,v=v+Math.imul(Ee,Fe)|0,g=g+Math.imul(ye,Le)|0,a=a+Math.imul(ye,qe)|0,a=a+Math.imul(de,Le)|0,v=v+Math.imul(de,qe)|0,g=g+Math.imul(le,Ue)|0,a=a+Math.imul(le,je)|0,a=a+Math.imul(me,Ue)|0,v=v+Math.imul(me,je)|0;var rr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(rr>>>26)|0,rr&=67108863,g=Math.imul(_e,Be),a=Math.imul(_e,Fe),a=a+Math.imul(we,Be)|0,v=Math.imul(we,Fe),g=g+Math.imul(xe,Le)|0,a=a+Math.imul(xe,qe)|0,a=a+Math.imul(Ee,Le)|0,v=v+Math.imul(Ee,qe)|0,g=g+Math.imul(ye,Ue)|0,a=a+Math.imul(ye,je)|0,a=a+Math.imul(de,Ue)|0,v=v+Math.imul(de,je)|0;var nr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(nr>>>26)|0,nr&=67108863,g=Math.imul(_e,Le),a=Math.imul(_e,qe),a=a+Math.imul(we,Le)|0,v=Math.imul(we,qe),g=g+Math.imul(xe,Ue)|0,a=a+Math.imul(xe,je)|0,a=a+Math.imul(Ee,Ue)|0,v=v+Math.imul(Ee,je)|0;var hr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(hr>>>26)|0,hr&=67108863,g=Math.imul(_e,Ue),a=Math.imul(_e,je),a=a+Math.imul(we,Ue)|0,v=Math.imul(we,je);var xr=(w+g|0)+((a&8191)<<13)|0;return w=(v+(a>>>13)|0)+(xr>>>26)|0,xr&=67108863,b[0]=gr,b[1]=wt,b[2]=xt,b[3]=or,b[4]=yr,b[5]=lr,b[6]=vr,b[7]=br,b[8]=_r,b[9]=wr,b[10]=tr,b[11]=Wt,b[12]=fr,b[13]=Yt,b[14]=dr,b[15]=rr,b[16]=nr,b[17]=hr,b[18]=xr,w!==0&&(b[19]=w,p.length++),p};Math.imul||(M=R);function I(_,s,l){l.negative=s.negative^_.negative,l.length=_.length+s.length;for(var p=0,f=0,h=0;h>>26)|0,f+=b>>>26,b&=67108863}l.words[h]=w,p=b,b=f}return p!==0?l.words[h]=p:l.length--,l.strip()}function D(_,s,l){var p=new O;return p.mulp(_,s,l)}n.prototype.mulTo=function(s,l){var p,f=this.length+s.length;return this.length===10&&s.length===10?p=M(this,s,l):f<63?p=R(this,s,l):f<1024?p=I(this,s,l):p=D(this,s,l),p};function O(_,s){this.x=_,this.y=s}O.prototype.makeRBT=function(s){for(var l=new Array(s),p=n.prototype._countBits(s)-1,f=0;f>=1;return f},O.prototype.permute=function(s,l,p,f,h,b){for(var w=0;w>>1)h++;return 1<>>13,p[2*b+1]=h&8191,h=h>>>13;for(b=2*l;b>=26,l+=f/67108864|0,l+=h>>>26,this.words[p]=h&67108863}return l!==0&&(this.words[p]=l,this.length++),this},n.prototype.muln=function(s){return this.clone().imuln(s)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(s){var l=A(s);if(l.length===0)return new n(1);for(var p=this,f=0;f=0);var l=s%26,p=(s-l)/26,f=67108863>>>26-l<<26-l,h;if(l!==0){var b=0;for(h=0;h>>26-l}b&&(this.words[h]=b,this.length++)}if(p!==0){for(h=this.length-1;h>=0;h--)this.words[h+p]=this.words[h];for(h=0;h=0);var f;l?f=(l-l%26)/26:f=0;var h=s%26,b=Math.min((s-h)/26,this.length),w=67108863^67108863>>>h<b)for(this.length-=b,a=0;a=0&&(v!==0||a>=f);a--){var P=this.words[a]|0;this.words[a]=v<<26-h|P>>>h,v=P&w}return g&&v!==0&&(g.words[g.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(s,l,p){return r(this.negative===0),this.iushrn(s,l,p)},n.prototype.shln=function(s){return this.clone().ishln(s)},n.prototype.ushln=function(s){return this.clone().iushln(s)},n.prototype.shrn=function(s){return this.clone().ishrn(s)},n.prototype.ushrn=function(s){return this.clone().iushrn(s)},n.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,p=(s-l)/26,f=1<=0);var l=s%26,p=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(l!==0&&p++,this.length=Math.min(p,this.length),l!==0){var f=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},n.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(g/67108864|0),this.words[h+p]=b&67108863}for(;h>26,this.words[h+p]=b&67108863;if(w===0)return this.strip();for(r(w===-1),w=0,h=0;h>26,this.words[h]=b&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(s,l){var p=this.length-s.length,f=this.clone(),h=s,b=h.words[h.length-1]|0,w=this._countBits(b);p=26-w,p!==0&&(h=h.ushln(p),f.iushln(p),b=h.words[h.length-1]|0);var g=f.length-h.length,a;if(l!=="mod"){a=new n(null),a.length=g+1,a.words=new Array(a.length);for(var v=0;v=0;k--){var S=(f.words[h.length+k]|0)*67108864+(f.words[h.length+k-1]|0);for(S=Math.min(S/b|0,67108863),f._ishlnsubmul(h,S,k);f.negative!==0;)S--,f.negative=0,f._ishlnsubmul(h,1,k),f.isZero()||(f.negative^=1);a&&(a.words[k]=S)}return a&&a.strip(),f.strip(),l!=="div"&&p!==0&&f.iushrn(p),{div:a||null,mod:f}},n.prototype.divmod=function(s,l,p){if(r(!s.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,b;return this.negative!==0&&s.negative===0?(b=this.neg().divmod(s,l),l!=="mod"&&(f=b.div.neg()),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.iadd(s)),{div:f,mod:h}):this.negative===0&&s.negative!==0?(b=this.divmod(s.neg(),l),l!=="mod"&&(f=b.div.neg()),{div:f,mod:b.mod}):(this.negative&s.negative)!==0?(b=this.neg().divmod(s.neg(),l),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.isub(s)),{div:b.div,mod:h}):s.length>this.length||this.cmp(s)<0?{div:new n(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new n(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new n(this.modn(s.words[0]))}:this._wordDiv(s,l)},n.prototype.div=function(s){return this.divmod(s,"div",!1).div},n.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},n.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},n.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var p=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),h=s.andln(1),b=p.cmp(f);return b<0||h===1&&b===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},n.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,p=0,f=this.length-1;f>=0;f--)p=(l*p+(this.words[f]|0))%s;return p},n.prototype.idivn=function(s){r(s<=67108863);for(var l=0,p=this.length-1;p>=0;p--){var f=(this.words[p]|0)+l*67108864;this.words[p]=f/s|0,l=f%s}return this.strip()},n.prototype.divn=function(s){return this.clone().idivn(s)},n.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=new n(0),w=new n(1),g=0;l.isEven()&&p.isEven();)l.iushrn(1),p.iushrn(1),++g;for(var a=p.clone(),v=l.clone();!l.isZero();){for(var P=0,k=1;(l.words[0]&k)===0&&P<26;++P,k<<=1);if(P>0)for(l.iushrn(P);P-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(a),h.isub(v)),f.iushrn(1),h.iushrn(1);for(var S=0,B=1;(p.words[0]&B)===0&&S<26;++S,B<<=1);if(S>0)for(p.iushrn(S);S-- >0;)(b.isOdd()||w.isOdd())&&(b.iadd(a),w.isub(v)),b.iushrn(1),w.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(b),h.isub(w)):(p.isub(l),b.isub(f),w.isub(h))}return{a:b,b:w,gcd:p.iushln(g)}},n.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=p.clone();l.cmpn(1)>0&&p.cmpn(1)>0;){for(var w=0,g=1;(l.words[0]&g)===0&&w<26;++w,g<<=1);if(w>0)for(l.iushrn(w);w-- >0;)f.isOdd()&&f.iadd(b),f.iushrn(1);for(var a=0,v=1;(p.words[0]&v)===0&&a<26;++a,v<<=1);if(a>0)for(p.iushrn(a);a-- >0;)h.isOdd()&&h.iadd(b),h.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(h)):(p.isub(l),h.isub(f))}var P;return l.cmpn(1)===0?P=f:P=h,P.cmpn(0)<0&&P.iadd(s),P},n.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),p=s.clone();l.negative=0,p.negative=0;for(var f=0;l.isEven()&&p.isEven();f++)l.iushrn(1),p.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;p.isEven();)p.iushrn(1);var h=l.cmp(p);if(h<0){var b=l;l=p,p=b}else if(h===0||p.cmpn(1)===0)break;l.isub(p)}while(!0);return p.iushln(f)},n.prototype.invm=function(s){return this.egcd(s).a.umod(s)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(s){return this.words[0]&s},n.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,p=(s-l)/26,f=1<>>26,w&=67108863,this.words[b]=w}return h!==0&&(this.words[b]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var p;if(this.length>1)p=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;p=f===s?0:fs.length)return 1;if(this.length=0;p--){var f=this.words[p]|0,h=s.words[p]|0;if(f!==h){fh&&(l=1);break}}return l},n.prototype.gtn=function(s){return this.cmpn(s)===1},n.prototype.gt=function(s){return this.cmp(s)===1},n.prototype.gten=function(s){return this.cmpn(s)>=0},n.prototype.gte=function(s){return this.cmp(s)>=0},n.prototype.ltn=function(s){return this.cmpn(s)===-1},n.prototype.lt=function(s){return this.cmp(s)===-1},n.prototype.lten=function(s){return this.cmpn(s)<=0},n.prototype.lte=function(s){return this.cmp(s)<=0},n.prototype.eqn=function(s){return this.cmpn(s)===0},n.prototype.eq=function(s){return this.cmp(s)===0},n.red=function(s){return new q(s)},n.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(s){return this.red=s,this},n.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},n.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},n.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},n.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},n.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},n.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},n.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},n.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var N={k256:null,p224:null,p192:null,p25519:null};function L(_,s){this.name=_,this.p=new n(s,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var s=new n(null);return s.words=new Array(Math.ceil(this.n/13)),s},L.prototype.ireduce=function(s){var l=s,p;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),p=l.bitLength();while(p>this.n);var f=p0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},L.prototype.split=function(s,l){s.iushrn(this.n,0,l)},L.prototype.imulK=function(s){return s.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,L),j.prototype.split=function(s,l){for(var p=4194303,f=Math.min(s.length,9),h=0;h>>22,b=w}b>>>=22,s.words[h-10]=b,b===0&&s.length>10?s.length-=10:s.length-=9},j.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,p=0;p>>=26,s.words[p]=h,l=f}return l!==0&&(s.words[s.length++]=l),s},n._prime=function(s){if(N[s])return N[s];var l;if(s==="k256")l=new j;else if(s==="p224")l=new H;else if(s==="p192")l=new Y;else if(s==="p25519")l=new W;else throw new Error("Unknown prime "+s);return N[s]=l,l};function q(_){if(typeof _=="string"){var s=n._prime(_);this.m=s.p,this.prime=s}else r(_.gtn(1),"modulus must be greater than 1"),this.m=_,this.prime=null}q.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},q.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},q.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},q.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},q.prototype.add=function(s,l){this._verify2(s,l);var p=s.add(l);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},q.prototype.iadd=function(s,l){this._verify2(s,l);var p=s.iadd(l);return p.cmp(this.m)>=0&&p.isub(this.m),p},q.prototype.sub=function(s,l){this._verify2(s,l);var p=s.sub(l);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},q.prototype.isub=function(s,l){this._verify2(s,l);var p=s.isub(l);return p.cmpn(0)<0&&p.iadd(this.m),p},q.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},q.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},q.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},q.prototype.isqr=function(s){return this.imul(s,s.clone())},q.prototype.sqr=function(s){return this.mul(s,s)},q.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var p=this.m.add(new n(1)).iushrn(2);return this.pow(s,p)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);r(!f.isZero());var b=new n(1).toRed(this),w=b.redNeg(),g=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new n(2*a*a).toRed(this);this.pow(a,g).cmp(w)!==0;)a.redIAdd(w);for(var v=this.pow(a,f),P=this.pow(s,f.addn(1).iushrn(1)),k=this.pow(s,f),S=h;k.cmp(b)!==0;){for(var B=k,$=0;B.cmp(b)!==0;$++)B=B.redSqr();r($=0;h--){for(var v=l.words[h],P=a-1;P>=0;P--){var k=v>>P&1;if(b!==f[0]&&(b=this.sqr(b)),k===0&&w===0){g=0;continue}w<<=1,w|=k,g++,!(g!==p&&(h!==0||P!==0))&&(b=this.mul(b,f[w]),g=0,w=0)}a=26}return b},q.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},q.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},n.mont=function(s){return new J(s)};function J(_){q.call(this,_),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(J,q),J.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},J.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},J.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var p=s.imul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new n(0)._forceRed(this);var p=s.mul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof B2>"u"||B2,QB)});var XB=F(()=>{m()});var Iv=F((O9e,q2)=>{m();var F2;q2.exports=function(e){return F2||(F2=new Tc(null)),F2.generate(e)};function Tc(t){this.rand=t}q2.exports.Rand=Tc;Tc.prototype.generate=function(e){return this._rand(e)};Tc.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),i=0;i{m();var dl=JB(),Wye=Iv();function hl(t){this.rand=t||new Wye.Rand}ZB.exports=hl;hl.create=function(e){return new hl(e)};hl.prototype._randbelow=function(e){var r=e.bitLength(),i=Math.ceil(r/8);do var n=new dl(this.rand.generate(i));while(n.cmp(e)>=0);return n};hl.prototype._randrange=function(e,r){var i=r.sub(e);return e.add(this._randbelow(i))};hl.prototype.test=function(e,r,i){var n=e.bitLength(),o=dl.mont(e),c=new dl(1).toRed(o);r||(r=Math.max(1,n/48|0));for(var u=e.subn(1),d=0;!u.testn(d);d++);for(var y=e.shrn(d),E=u.toRed(o),x=!0;r>0;r--){var A=this._randrange(new dl(2),u);i&&i(A);var R=A.toRed(o).redPow(y);if(!(R.cmp(c)===0||R.cmp(E)===0)){for(var M=1;M0;r--){var E=this._randrange(new dl(2),c),x=e.gcd(E);if(x.cmpn(1)!==0)return x;var A=E.toRed(n).redPow(d);if(!(A.cmp(o)===0||A.cmp(y)===0)){for(var R=1;R{m();var Yye=$u();r7.exports=G2;G2.simpleSieve=H2;G2.fermatTest=$2;var Xn=N2(),Qye=new Xn(24),Jye=U2(),e7=new Jye,Xye=new Xn(1),z2=new Xn(2),Zye=new Xn(5),N9e=new Xn(16),B9e=new Xn(8),eve=new Xn(10),tve=new Xn(3),F9e=new Xn(7),rve=new Xn(11),t7=new Xn(4),L9e=new Xn(12),j2=null;function nve(){if(j2!==null)return j2;var t=1048576,e=[];e[0]=2;for(var r=1,i=3;it;)r.ishrn(1);if(r.isEven()&&r.iadd(Xye),r.testn(1)||r.iadd(z2),e.cmp(z2)){if(!e.cmp(Zye))for(;r.mod(eve).cmp(tve);)r.iadd(t7)}else for(;r.mod(Qye).cmp(rve);)r.iadd(t7);if(i=r.shrn(1),H2(i)&&H2(r)&&$2(i)&&$2(r)&&e7.test(i)&&e7.test(r))return r}}});var n7=F((U9e,ive)=>{ive.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}});var a7=F((j9e,s7)=>{m();var bo=N2(),ove=U2(),i7=new ove,sve=new bo(24),ave=new bo(11),cve=new bo(10),uve=new bo(3),lve=new bo(7),o7=K2(),fve=$u();s7.exports=ya;function dve(t,e){return e=e||"utf8",T.isBuffer(t)||(t=new T(t,e)),this._pub=new bo(t),this}function hve(t,e){return e=e||"utf8",T.isBuffer(t)||(t=new T(t,e)),this._priv=new bo(t),this}var Ov={};function pve(t,e){var r=e.toString("hex"),i=[r,t.toString(16)].join("_");if(i in Ov)return Ov[i];var n=0;if(t.isEven()||!o7.simpleSieve||!o7.fermatTest(t)||!i7.test(t))return n+=1,r==="02"||r==="05"?n+=8:n+=4,Ov[i]=n,n;i7.test(t.shrn(1))||(n+=2);var o;switch(r){case"02":t.mod(sve).cmp(ave)&&(n+=8);break;case"05":o=t.mod(cve),o.cmp(uve)&&o.cmp(lve)&&(n+=8);break;default:n+=4}return Ov[i]=n,n}function ya(t,e,r){this.setGenerator(e),this.__prime=new bo(t),this._prime=bo.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=dve,this.setPrivateKey=hve):this._primeCode=8}Object.defineProperty(ya.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=pve(this.__prime,this.__gen)),this._primeCode}});ya.prototype.generateKeys=function(){return this._priv||(this._priv=new bo(fve(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()};ya.prototype.computeSecret=function(t){t=new bo(t),t=t.toRed(this._prime);var e=t.redPow(this._priv).fromRed(),r=new T(e.toArray()),i=this.getPrime();if(r.length{m();var mve=K2(),c7=n7(),V2=a7();function gve(t){var e=new T(c7[t].prime,"hex"),r=new T(c7[t].gen,"hex");return new V2(e,r)}var yve={binary:!0,hex:!0,base64:!0};function u7(t,e,r,i){return T.isBuffer(e)||yve[e]===void 0?u7(t,"binary",e,r):(e=e||"binary",i=i||"binary",r=r||new T([2]),T.isBuffer(r)||(r=new T(r,i)),typeof t=="number"?new V2(mve(t,r),r,!0):(T.isBuffer(t)||(t=new T(t,e)),new V2(t,r,!0)))}Md.DiffieHellmanGroup=Md.createDiffieHellmanGroup=Md.getDiffieHellman=gve;Md.createDiffieHellman=Md.DiffieHellman=u7});var W2=F((H9e,f7)=>{m();f7.exports=aa().EventEmitter});var y7=F(($9e,g7)=>{"use strict";m();function d7(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function h7(t){for(var e=1;e0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return Nv.alloc(0);for(var i=Nv.allocUnsafe(r>>>0),n=this.head,o=0;n;)Cve(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return rc.length?c.length:r;if(u===c.length?o+=c:o+=c.slice(0,r),r-=u,r===0){u===c.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=c.slice(u));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(r){var i=Nv.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var c=n.data,u=r>c.length?c.length:r;if(c.copy(i,i.length-r,0,u),r-=u,r===0){u===c.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=c.slice(u));break}++o}return this.length-=o,i}},{key:Sve,value:function(r,i){return Y2(this,h7(h7({},i),{},{depth:0,customInspect:!1}))}}]),t}()});var J2=F((G9e,b7)=>{"use strict";m();function Ave(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,C.nextTick(Q2,this,t)):C.nextTick(Q2,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?C.nextTick(Bv,r):(r._writableState.errorEmitted=!0,C.nextTick(v7,r,o)):C.nextTick(v7,r,o):e?(C.nextTick(Bv,r),e(o)):C.nextTick(Bv,r)}),this)}function v7(t,e){Q2(t,e),Bv(t)}function Bv(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Tve(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Q2(t,e){t.emit("error",e)}function Mve(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}b7.exports={destroy:Ave,undestroy:Tve,errorOrDestroy:Mve}});var pl=F((K9e,x7)=>{"use strict";m();function Rve(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var w7={};function _o(t,e,r){r||(r=Error);function i(o,c,u){return typeof e=="string"?e:e(o,c,u)}var n=function(o){Rve(c,o);function c(u,d,y){return o.call(this,i(u,d,y))||this}return c}(r);n.prototype.name=r.name,n.prototype.code=t,w7[t]=n}function _7(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(i){return String(i)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function Dve(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function kve(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Ive(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}_o("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);_o("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;typeof e=="string"&&Dve(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";var n;if(kve(t," argument"))n="The ".concat(t," ").concat(i," ").concat(_7(e,"type"));else{var o=Ive(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(_7(e,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);_o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");_o("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});_o("ERR_STREAM_PREMATURE_CLOSE","Premature close");_o("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});_o("ERR_MULTIPLE_CALLBACK","Callback called multiple times");_o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");_o("ERR_STREAM_WRITE_AFTER_END","write after end");_o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);_o("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);_o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");x7.exports.codes=w7});var X2=F((V9e,E7)=>{"use strict";m();var Ove=pl().codes.ERR_INVALID_OPT_VALUE;function Pve(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Nve(t,e,r,i){var n=Pve(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new Ove(o,n)}return Math.floor(n)}return t.objectMode?16:16*1024}E7.exports={getHighWaterMark:Nve}});var tC=F((W9e,R7)=>{"use strict";m();R7.exports=ln;function C7(t){var e=this;this.next=null,this.entry=null,this.finish=function(){cbe(e,t)}}var Rd;ln.WritableState=qm;var Bve={deprecate:ky()},A7=W2(),Lv=xn().Buffer,Fve=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Lve(t){return Lv.from(t)}function qve(t){return Lv.isBuffer(t)||t instanceof Fve}var eC=J2(),Uve=X2(),jve=Uve.getHighWaterMark,Mc=pl().codes,zve=Mc.ERR_INVALID_ARG_TYPE,Hve=Mc.ERR_METHOD_NOT_IMPLEMENTED,$ve=Mc.ERR_MULTIPLE_CALLBACK,Gve=Mc.ERR_STREAM_CANNOT_PIPE,Kve=Mc.ERR_STREAM_DESTROYED,Vve=Mc.ERR_STREAM_NULL_VALUES,Wve=Mc.ERR_STREAM_WRITE_AFTER_END,Yve=Mc.ERR_UNKNOWN_ENCODING,Dd=eC.errorOrDestroy;vt()(ln,A7);function Qve(){}function qm(t,e,r){Rd=Rd||ml(),t=t||{},typeof r!="boolean"&&(r=e instanceof Rd),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=jve(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){nbe(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new C7(this)}qm.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(qm.prototype,"buffer",{get:Bve.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Fv;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Fv=Function.prototype[Symbol.hasInstance],Object.defineProperty(ln,Symbol.hasInstance,{value:function(e){return Fv.call(this,e)?!0:this!==ln?!1:e&&e._writableState instanceof qm}})):Fv=function(e){return e instanceof this};function ln(t){Rd=Rd||ml();var e=this instanceof Rd;if(!e&&!Fv.call(ln,this))return new ln(t);this._writableState=new qm(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),A7.call(this)}ln.prototype.pipe=function(){Dd(this,new Gve)};function Jve(t,e){var r=new Wve;Dd(t,r),C.nextTick(e,r)}function Xve(t,e,r,i){var n;return r===null?n=new Vve:typeof r!="string"&&!e.objectMode&&(n=new zve("chunk",["string","Buffer"],r)),n?(Dd(t,n),C.nextTick(i,n),!1):!0}ln.prototype.write=function(t,e,r){var i=this._writableState,n=!1,o=!i.objectMode&&qve(t);return o&&!Lv.isBuffer(t)&&(t=Lve(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=Qve),i.ending?Jve(this,r):(o||Xve(this,i,t,r))&&(i.pendingcb++,n=ebe(this,i,o,t,e,r)),n};ln.prototype.cork=function(){this._writableState.corked++};ln.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&T7(this,t))};ln.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new Yve(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(ln.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Zve(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Lv.from(e,r)),e}Object.defineProperty(ln.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ebe(t,e,r,i,n,o){if(!r){var c=Zve(e,i,n);i!==c&&(r=!0,n="buffer",i=c)}var u=e.objectMode?1:i.length;e.length+=u;var d=e.length{"use strict";m();var ube=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};k7.exports=As;var D7=iC(),nC=tC();vt()(As,D7);for(rC=ube(nC.prototype),qv=0;qv{"use strict";m();var I7=pl().codes.ERR_STREAM_PREMATURE_CLOSE;function dbe(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n{"use strict";m();var zv;function Rc(t,e,r){return e=mbe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mbe(t){var e=gbe(t,"string");return typeof e=="symbol"?e:String(e)}function gbe(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ybe=jv(),Dc=Symbol("lastResolve"),gl=Symbol("lastReject"),Um=Symbol("error"),Hv=Symbol("ended"),yl=Symbol("lastPromise"),oC=Symbol("handlePromise"),vl=Symbol("stream");function kc(t,e){return{value:t,done:e}}function vbe(t){var e=t[Dc];if(e!==null){var r=t[vl].read();r!==null&&(t[yl]=null,t[Dc]=null,t[gl]=null,e(kc(r,!1)))}}function bbe(t){C.nextTick(vbe,t)}function _be(t,e){return function(r,i){t.then(function(){if(e[Hv]){r(kc(void 0,!0));return}e[oC](r,i)},i)}}var wbe=Object.getPrototypeOf(function(){}),xbe=Object.setPrototypeOf((zv={get stream(){return this[vl]},next:function(){var e=this,r=this[Um];if(r!==null)return Promise.reject(r);if(this[Hv])return Promise.resolve(kc(void 0,!0));if(this[vl].destroyed)return new Promise(function(c,u){C.nextTick(function(){e[Um]?u(e[Um]):c(kc(void 0,!0))})});var i=this[yl],n;if(i)n=new Promise(_be(i,this));else{var o=this[vl].read();if(o!==null)return Promise.resolve(kc(o,!1));n=new Promise(this[oC])}return this[yl]=n,n}},Rc(zv,Symbol.asyncIterator,function(){return this}),Rc(zv,"return",function(){var e=this;return new Promise(function(r,i){e[vl].destroy(null,function(n){if(n){i(n);return}r(kc(void 0,!0))})})}),zv),wbe),Ebe=function(e){var r,i=Object.create(xbe,(r={},Rc(r,vl,{value:e,writable:!0}),Rc(r,Dc,{value:null,writable:!0}),Rc(r,gl,{value:null,writable:!0}),Rc(r,Um,{value:null,writable:!0}),Rc(r,Hv,{value:e._readableState.endEmitted,writable:!0}),Rc(r,oC,{value:function(o,c){var u=i[vl].read();u?(i[yl]=null,i[Dc]=null,i[gl]=null,o(kc(u,!1))):(i[Dc]=o,i[gl]=c)},writable:!0}),r));return i[yl]=null,ybe(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[gl];o!==null&&(i[yl]=null,i[Dc]=null,i[gl]=null,o(n)),i[Um]=n;return}var c=i[Dc];c!==null&&(i[yl]=null,i[Dc]=null,i[gl]=null,c(kc(void 0,!0))),i[Hv]=!0}),e.on("readable",bbe.bind(null,i)),i};N7.exports=Ebe});var L7=F((X9e,F7)=>{m();F7.exports=function(){throw new Error("Readable.from is not available in the browser")}});var iC=F((eLe,W7)=>{"use strict";m();W7.exports=cr;var kd;cr.ReadableState=z7;var Z9e=aa().EventEmitter,j7=function(e,r){return e.listeners(r).length},zm=W2(),$v=xn().Buffer,Sbe=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Cbe(t){return $v.from(t)}function Abe(t){return $v.isBuffer(t)||t instanceof Sbe}var sC=Gu(),jt;sC&&sC.debuglog?jt=sC.debuglog("stream"):jt=function(){};var Tbe=y7(),hC=J2(),Mbe=X2(),Rbe=Mbe.getHighWaterMark,Gv=pl().codes,Dbe=Gv.ERR_INVALID_ARG_TYPE,kbe=Gv.ERR_STREAM_PUSH_AFTER_EOF,Ibe=Gv.ERR_METHOD_NOT_IMPLEMENTED,Obe=Gv.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Id,aC,cC;vt()(cr,zm);var jm=hC.errorOrDestroy,uC=["error","close","destroy","pause","resume"];function Pbe(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function z7(t,e,r){kd=kd||ml(),t=t||{},typeof r!="boolean"&&(r=e instanceof kd),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=Rbe(this,t,"readableHighWaterMark",r),this.buffer=new Tbe,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Id||(Id=mc().StringDecoder),this.decoder=new Id(t.encoding),this.encoding=t.encoding)}function cr(t){if(kd=kd||ml(),!(this instanceof cr))return new cr(t);var e=this instanceof kd;this._readableState=new z7(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),zm.call(this)}Object.defineProperty(cr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});cr.prototype.destroy=hC.destroy;cr.prototype._undestroy=hC.undestroy;cr.prototype._destroy=function(t,e){e(t)};cr.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=$v.from(t,e),e=""),i=!0),H7(this,t,e,!1,i)};cr.prototype.unshift=function(t){return H7(this,t,null,!0,!1)};function H7(t,e,r,i,n){jt("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,Fbe(t,o);else{var c;if(n||(c=Nbe(o,e)),c)jm(t,c);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==$v.prototype&&(e=Cbe(e)),i)o.endEmitted?jm(t,new Obe):lC(t,o,e,!0);else if(o.ended)jm(t,new kbe);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?lC(t,o,e,!1):dC(t,o)):lC(t,o,e,!1)}else i||(o.reading=!1,dC(t,o))}return!o.ended&&(o.length=q7?t=q7:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function U7(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=Bbe(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}cr.prototype.read=function(t){jt("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return jt("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?fC(this):Kv(this),null;if(t=U7(t,e),t===0&&e.ended)return e.length===0&&fC(this),null;var i=e.needReadable;jt("need readable",i),(e.length===0||e.length-t0?n=K7(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&fC(this)),n!==null&&this.emit("data",n),n};function Fbe(t,e){if(jt("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Kv(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,$7(t)))}}function Kv(t){var e=t._readableState;jt("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(jt("emitReadable",e.flowing),e.emittedReadable=!0,C.nextTick($7,t))}function $7(t){var e=t._readableState;jt("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,pC(t)}function dC(t,e){e.readingMore||(e.readingMore=!0,C.nextTick(Lbe,t,e))}function Lbe(t,e){for(;!e.reading&&!e.ended&&(e.length1&&V7(i.pipes,t)!==-1)&&!y&&(jt("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function A(D){jt("onerror",D),I(),t.removeListener("error",A),j7(t,"error")===0&&jm(t,D)}Pbe(t,"error",A);function R(){t.removeListener("finish",M),I()}t.once("close",R);function M(){jt("onfinish"),t.removeListener("close",R),I()}t.once("finish",M);function I(){jt("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(jt("pipe resume"),r.resume()),t};function qbe(t){return function(){var r=t._readableState;jt("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&j7(t,"data")&&(r.flowing=!0,pC(t))}}cr.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,jt("on readable",i.length,i.reading),i.length?Kv(this):i.reading||C.nextTick(Ube,this)),r};cr.prototype.addListener=cr.prototype.on;cr.prototype.removeListener=function(t,e){var r=zm.prototype.removeListener.call(this,t,e);return t==="readable"&&C.nextTick(G7,this),r};cr.prototype.removeAllListeners=function(t){var e=zm.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&C.nextTick(G7,this),e};function G7(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function Ube(t){jt("readable nexttick read 0"),t.read(0)}cr.prototype.resume=function(){var t=this._readableState;return t.flowing||(jt("resume"),t.flowing=!t.readableListening,jbe(this,t)),t.paused=!1,this};function jbe(t,e){e.resumeScheduled||(e.resumeScheduled=!0,C.nextTick(zbe,t,e))}function zbe(t,e){jt("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),pC(t),e.flowing&&!e.reading&&t.read(0)}cr.prototype.pause=function(){return jt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(jt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function pC(t){var e=t._readableState;for(jt("flow",e.flowing);e.flowing&&t.read()!==null;);}cr.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(jt("wrapped end"),r.decoder&&!r.ended){var c=r.decoder.end();c&&c.length&&e.push(c)}e.push(null)}),t.on("data",function(c){if(jt("wrapped data"),r.decoder&&(c=r.decoder.write(c)),!(r.objectMode&&c==null)&&!(!r.objectMode&&(!c||!c.length))){var u=e.push(c);u||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(u){return function(){return t[u].apply(t,arguments)}}(n));for(var o=0;o=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function fC(t){var e=t._readableState;jt("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,C.nextTick(Hbe,e,t))}function Hbe(t,e){if(jt("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(cr.from=function(t,e){return cC===void 0&&(cC=L7()),cC(cr,t,e)});function V7(t,e){for(var r=0,i=t.length;r{"use strict";m();Q7.exports=va;var Vv=pl().codes,$be=Vv.ERR_METHOD_NOT_IMPLEMENTED,Gbe=Vv.ERR_MULTIPLE_CALLBACK,Kbe=Vv.ERR_TRANSFORM_ALREADY_TRANSFORMING,Vbe=Vv.ERR_TRANSFORM_WITH_LENGTH_0,Wv=ml();vt()(va,Wv);function Wbe(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new Gbe);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{"use strict";m();X7.exports=Hm;var J7=mC();vt()(Hm,J7);function Hm(t){if(!(this instanceof Hm))return new Hm(t);J7.call(this,t)}Hm.prototype._transform=function(t,e,r){r(null,t)}});var iF=F((nLe,nF)=>{"use strict";m();var gC;function Qbe(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var rF=pl().codes,Jbe=rF.ERR_MISSING_ARGS,Xbe=rF.ERR_STREAM_DESTROYED;function eF(t){if(t)throw t}function Zbe(t){return t.setHeader&&typeof t.abort=="function"}function e_e(t,e,r,i){i=Qbe(i);var n=!1;t.on("close",function(){n=!0}),gC===void 0&&(gC=jv()),gC(t,{readable:e,writable:r},function(c){if(c)return i(c);n=!0,i()});var o=!1;return function(c){if(!n&&!o){if(o=!0,Zbe(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(c||new Xbe("pipe"))}}}function tF(t){t()}function t_e(t,e){return t.pipe(e)}function r_e(t){return!t.length||typeof t[t.length-1]!="function"?eF:t.pop()}function n_e(){for(var t=arguments.length,e=new Array(t),r=0;r0;return e_e(c,d,y,function(E){n||(n=E),E&&o.forEach(tF),!d&&(o.forEach(tF),i(n))})});return e.reduce(t_e)}nF.exports=n_e});var sF=F((wo,oF)=>{m();wo=oF.exports=iC();wo.Stream=wo;wo.Readable=wo;wo.Writable=tC();wo.Duplex=ml();wo.Transform=mC();wo.PassThrough=Z7();wo.finished=jv();wo.pipeline=iF()});var Yv=F((aF,yC)=>{m();(function(t,e){"use strict";function r(p,f){if(!p)throw new Error(f||"Assertion failed")}function i(p,f){p.super_=f;var h=function(){};h.prototype=f.prototype,p.prototype=new h,p.prototype.constructor=p}function n(p,f,h){if(n.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((f==="le"||f==="be")&&(h=f,f=10),this._init(p||0,f||10,h||"be"))}typeof t=="object"?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ac().Buffer}catch{}n.isBN=function(f){return f instanceof n?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===n.wordSize&&Array.isArray(f.words)},n.max=function(f,h){return f.cmp(h)>0?f:h},n.min=function(f,h){return f.cmp(h)<0?f:h},n.prototype._init=function(f,h,b){if(typeof f=="number")return this._initNumber(f,h,b);if(typeof f=="object")return this._initArray(f,h,b);h==="hex"&&(h=16),r(h===(h|0)&&h>=2&&h<=36),f=f.toString().replace(/\s+/g,"");var w=0;f[0]==="-"&&(w++,this.negative=1),w=0;w-=3)a=f[w]|f[w-1]<<8|f[w-2]<<16,this.words[g]|=a<>>26-v&67108863,v+=24,v>=26&&(v-=26,g++);else if(b==="le")for(w=0,g=0;w>>26-v&67108863,v+=24,v>=26&&(v-=26,g++);return this._strip()};function c(p,f){var h=p.charCodeAt(f);if(h>=48&&h<=57)return h-48;if(h>=65&&h<=70)return h-55;if(h>=97&&h<=102)return h-87;r(!1,"Invalid character in "+p)}function u(p,f,h){var b=c(p,h);return h-1>=f&&(b|=c(p,h-1)<<4),b}n.prototype._parseHex=function(f,h,b){this.length=Math.ceil((f.length-h)/6),this.words=new Array(this.length);for(var w=0;w=h;w-=2)v=u(f,h,w)<=18?(g-=18,a+=1,this.words[a]|=v>>>26):g+=8;else{var P=f.length-h;for(w=P%2===0?h+1:h;w=18?(g-=18,a+=1,this.words[a]|=v>>>26):g+=8}this._strip()};function d(p,f,h,b){for(var w=0,g=0,a=Math.min(p.length,h),v=f;v=49?g=P-49+10:P>=17?g=P-17+10:g=P,r(P>=0&&g1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=E}catch{n.prototype.inspect=E}else n.prototype.inspect=E;function E(){return(this.red?""}var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],R=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(f,h){f=f||10,h=h|0||1;var b;if(f===16||f==="hex"){b="";for(var w=0,g=0,a=0;a>>24-w&16777215,w+=2,w>=26&&(w-=26,a--),g!==0||a!==this.length-1?b=x[6-P.length]+P+b:b=P+b}for(g!==0&&(b=g.toString(16)+b);b.length%h!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(f===(f|0)&&f>=2&&f<=36){var k=A[f],S=R[f];b="";var B=this.clone();for(B.negative=0;!B.isZero();){var $=B.modrn(S).toString(f);B=B.idivn(S),B.isZero()?b=$+b:b=x[k-$.length]+$+b}for(this.isZero()&&(b="0"+b);b.length%h!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(f,h){return this.toArrayLike(o,f,h)}),n.prototype.toArray=function(f,h){return this.toArrayLike(Array,f,h)};var M=function(f,h){return f.allocUnsafe?f.allocUnsafe(h):new f(h)};n.prototype.toArrayLike=function(f,h,b){this._strip();var w=this.byteLength(),g=b||Math.max(1,w);r(w<=g,"byte array longer than desired length"),r(g>0,"Requested array length <= 0");var a=M(f,g),v=h==="le"?"LE":"BE";return this["_toArrayLike"+v](a,w),a},n.prototype._toArrayLikeLE=function(f,h){for(var b=0,w=0,g=0,a=0;g>8&255),b>16&255),a===6?(b>24&255),w=0,a=0):(w=v>>>24,a+=2)}if(b=0&&(f[b--]=v>>8&255),b>=0&&(f[b--]=v>>16&255),a===6?(b>=0&&(f[b--]=v>>24&255),w=0,a=0):(w=v>>>24,a+=2)}if(b>=0)for(f[b--]=w;b>=0;)f[b--]=0},Math.clz32?n.prototype._countBits=function(f){return 32-Math.clz32(f)}:n.prototype._countBits=function(f){var h=f,b=0;return h>=4096&&(b+=13,h>>>=13),h>=64&&(b+=7,h>>>=7),h>=8&&(b+=4,h>>>=4),h>=2&&(b+=2,h>>>=2),b+h},n.prototype._zeroBits=function(f){if(f===0)return 26;var h=f,b=0;return(h&8191)===0&&(b+=13,h>>>=13),(h&127)===0&&(b+=7,h>>>=7),(h&15)===0&&(b+=4,h>>>=4),(h&3)===0&&(b+=2,h>>>=2),(h&1)===0&&b++,b},n.prototype.bitLength=function(){var f=this.words[this.length-1],h=this._countBits(f);return(this.length-1)*26+h};function I(p){for(var f=new Array(p.bitLength()),h=0;h>>w&1}return f}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,h=0;hf.length?this.clone().ior(f):f.clone().ior(this)},n.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},n.prototype.iuand=function(f){var h;this.length>f.length?h=f:h=this;for(var b=0;bf.length?this.clone().iand(f):f.clone().iand(this)},n.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},n.prototype.iuxor=function(f){var h,b;this.length>f.length?(h=this,b=f):(h=f,b=this);for(var w=0;wf.length?this.clone().ixor(f):f.clone().ixor(this)},n.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},n.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var h=Math.ceil(f/26)|0,b=f%26;this._expand(h),b>0&&h--;for(var w=0;w0&&(this.words[w]=~this.words[w]&67108863>>26-b),this._strip()},n.prototype.notn=function(f){return this.clone().inotn(f)},n.prototype.setn=function(f,h){r(typeof f=="number"&&f>=0);var b=f/26|0,w=f%26;return this._expand(b+1),h?this.words[b]=this.words[b]|1<f.length?(b=this,w=f):(b=f,w=this);for(var g=0,a=0;a>>26;for(;g!==0&&a>>26;if(this.length=b.length,g!==0)this.words[this.length]=g,this.length++;else if(b!==this)for(;af.length?this.clone().iadd(f):f.clone().iadd(this)},n.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var h=this.iadd(f);return f.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var b=this.cmp(f);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,g;b>0?(w=this,g=f):(w=f,g=this);for(var a=0,v=0;v>26,this.words[v]=h&67108863;for(;a!==0&&v>26,this.words[v]=h&67108863;if(a===0&&v>>26,B=P&67108863,$=Math.min(k,f.length-1),K=Math.max(0,k-p.length+1);K<=$;K++){var he=k-K|0;w=p.words[he]|0,g=f.words[K]|0,a=w*g+B,S+=a/67108864|0,B=a&67108863}h.words[k]=B|0,P=S|0}return P!==0?h.words[k]=P|0:h.length--,h._strip()}var O=function(f,h,b){var w=f.words,g=h.words,a=b.words,v=0,P,k,S,B=w[0]|0,$=B&8191,K=B>>>13,he=w[1]|0,X=he&8191,Z=he>>>13,it=w[2]|0,oe=it&8191,ce=it>>>13,Rt=w[3]|0,ue=Rt&8191,ie=Rt>>>13,bt=w[4]|0,pe=bt&8191,ge=bt>>>13,Ct=w[5]|0,le=Ct&8191,me=Ct>>>13,Ht=w[6]|0,ye=Ht&8191,de=Ht>>>13,Mr=w[7]|0,xe=Mr&8191,Ee=Mr>>>13,Ir=w[8]|0,_e=Ir&8191,we=Ir>>>13,Lr=w[9]|0,De=Lr&8191,Ce=Lr>>>13,$r=g[0]|0,Ae=$r&8191,ke=$r>>>13,Lt=g[1]|0,be=Lt&8191,Te=Lt>>>13,Yr=g[2]|0,ve=Yr&8191,Se=Yr>>>13,Qr=g[3]|0,Ie=Qr&8191,Me=Qr>>>13,Jr=g[4]|0,Pe=Jr&8191,Oe=Jr>>>13,Xr=g[5]|0,Re=Xr&8191,Ne=Xr>>>13,Zr=g[6]|0,Be=Zr&8191,Fe=Zr>>>13,Gr=g[7]|0,Le=Gr&8191,qe=Gr>>>13,en=g[8]|0,Ue=en&8191,je=en>>>13,gr=g[9]|0,wt=gr&8191,xt=gr>>>13;b.negative=f.negative^h.negative,b.length=19,P=Math.imul($,Ae),k=Math.imul($,ke),k=k+Math.imul(K,Ae)|0,S=Math.imul(K,ke);var or=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(or>>>26)|0,or&=67108863,P=Math.imul(X,Ae),k=Math.imul(X,ke),k=k+Math.imul(Z,Ae)|0,S=Math.imul(Z,ke),P=P+Math.imul($,be)|0,k=k+Math.imul($,Te)|0,k=k+Math.imul(K,be)|0,S=S+Math.imul(K,Te)|0;var yr=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(yr>>>26)|0,yr&=67108863,P=Math.imul(oe,Ae),k=Math.imul(oe,ke),k=k+Math.imul(ce,Ae)|0,S=Math.imul(ce,ke),P=P+Math.imul(X,be)|0,k=k+Math.imul(X,Te)|0,k=k+Math.imul(Z,be)|0,S=S+Math.imul(Z,Te)|0,P=P+Math.imul($,ve)|0,k=k+Math.imul($,Se)|0,k=k+Math.imul(K,ve)|0,S=S+Math.imul(K,Se)|0;var lr=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(lr>>>26)|0,lr&=67108863,P=Math.imul(ue,Ae),k=Math.imul(ue,ke),k=k+Math.imul(ie,Ae)|0,S=Math.imul(ie,ke),P=P+Math.imul(oe,be)|0,k=k+Math.imul(oe,Te)|0,k=k+Math.imul(ce,be)|0,S=S+Math.imul(ce,Te)|0,P=P+Math.imul(X,ve)|0,k=k+Math.imul(X,Se)|0,k=k+Math.imul(Z,ve)|0,S=S+Math.imul(Z,Se)|0,P=P+Math.imul($,Ie)|0,k=k+Math.imul($,Me)|0,k=k+Math.imul(K,Ie)|0,S=S+Math.imul(K,Me)|0;var vr=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(vr>>>26)|0,vr&=67108863,P=Math.imul(pe,Ae),k=Math.imul(pe,ke),k=k+Math.imul(ge,Ae)|0,S=Math.imul(ge,ke),P=P+Math.imul(ue,be)|0,k=k+Math.imul(ue,Te)|0,k=k+Math.imul(ie,be)|0,S=S+Math.imul(ie,Te)|0,P=P+Math.imul(oe,ve)|0,k=k+Math.imul(oe,Se)|0,k=k+Math.imul(ce,ve)|0,S=S+Math.imul(ce,Se)|0,P=P+Math.imul(X,Ie)|0,k=k+Math.imul(X,Me)|0,k=k+Math.imul(Z,Ie)|0,S=S+Math.imul(Z,Me)|0,P=P+Math.imul($,Pe)|0,k=k+Math.imul($,Oe)|0,k=k+Math.imul(K,Pe)|0,S=S+Math.imul(K,Oe)|0;var br=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(br>>>26)|0,br&=67108863,P=Math.imul(le,Ae),k=Math.imul(le,ke),k=k+Math.imul(me,Ae)|0,S=Math.imul(me,ke),P=P+Math.imul(pe,be)|0,k=k+Math.imul(pe,Te)|0,k=k+Math.imul(ge,be)|0,S=S+Math.imul(ge,Te)|0,P=P+Math.imul(ue,ve)|0,k=k+Math.imul(ue,Se)|0,k=k+Math.imul(ie,ve)|0,S=S+Math.imul(ie,Se)|0,P=P+Math.imul(oe,Ie)|0,k=k+Math.imul(oe,Me)|0,k=k+Math.imul(ce,Ie)|0,S=S+Math.imul(ce,Me)|0,P=P+Math.imul(X,Pe)|0,k=k+Math.imul(X,Oe)|0,k=k+Math.imul(Z,Pe)|0,S=S+Math.imul(Z,Oe)|0,P=P+Math.imul($,Re)|0,k=k+Math.imul($,Ne)|0,k=k+Math.imul(K,Re)|0,S=S+Math.imul(K,Ne)|0;var _r=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(_r>>>26)|0,_r&=67108863,P=Math.imul(ye,Ae),k=Math.imul(ye,ke),k=k+Math.imul(de,Ae)|0,S=Math.imul(de,ke),P=P+Math.imul(le,be)|0,k=k+Math.imul(le,Te)|0,k=k+Math.imul(me,be)|0,S=S+Math.imul(me,Te)|0,P=P+Math.imul(pe,ve)|0,k=k+Math.imul(pe,Se)|0,k=k+Math.imul(ge,ve)|0,S=S+Math.imul(ge,Se)|0,P=P+Math.imul(ue,Ie)|0,k=k+Math.imul(ue,Me)|0,k=k+Math.imul(ie,Ie)|0,S=S+Math.imul(ie,Me)|0,P=P+Math.imul(oe,Pe)|0,k=k+Math.imul(oe,Oe)|0,k=k+Math.imul(ce,Pe)|0,S=S+Math.imul(ce,Oe)|0,P=P+Math.imul(X,Re)|0,k=k+Math.imul(X,Ne)|0,k=k+Math.imul(Z,Re)|0,S=S+Math.imul(Z,Ne)|0,P=P+Math.imul($,Be)|0,k=k+Math.imul($,Fe)|0,k=k+Math.imul(K,Be)|0,S=S+Math.imul(K,Fe)|0;var wr=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(wr>>>26)|0,wr&=67108863,P=Math.imul(xe,Ae),k=Math.imul(xe,ke),k=k+Math.imul(Ee,Ae)|0,S=Math.imul(Ee,ke),P=P+Math.imul(ye,be)|0,k=k+Math.imul(ye,Te)|0,k=k+Math.imul(de,be)|0,S=S+Math.imul(de,Te)|0,P=P+Math.imul(le,ve)|0,k=k+Math.imul(le,Se)|0,k=k+Math.imul(me,ve)|0,S=S+Math.imul(me,Se)|0,P=P+Math.imul(pe,Ie)|0,k=k+Math.imul(pe,Me)|0,k=k+Math.imul(ge,Ie)|0,S=S+Math.imul(ge,Me)|0,P=P+Math.imul(ue,Pe)|0,k=k+Math.imul(ue,Oe)|0,k=k+Math.imul(ie,Pe)|0,S=S+Math.imul(ie,Oe)|0,P=P+Math.imul(oe,Re)|0,k=k+Math.imul(oe,Ne)|0,k=k+Math.imul(ce,Re)|0,S=S+Math.imul(ce,Ne)|0,P=P+Math.imul(X,Be)|0,k=k+Math.imul(X,Fe)|0,k=k+Math.imul(Z,Be)|0,S=S+Math.imul(Z,Fe)|0,P=P+Math.imul($,Le)|0,k=k+Math.imul($,qe)|0,k=k+Math.imul(K,Le)|0,S=S+Math.imul(K,qe)|0;var tr=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(tr>>>26)|0,tr&=67108863,P=Math.imul(_e,Ae),k=Math.imul(_e,ke),k=k+Math.imul(we,Ae)|0,S=Math.imul(we,ke),P=P+Math.imul(xe,be)|0,k=k+Math.imul(xe,Te)|0,k=k+Math.imul(Ee,be)|0,S=S+Math.imul(Ee,Te)|0,P=P+Math.imul(ye,ve)|0,k=k+Math.imul(ye,Se)|0,k=k+Math.imul(de,ve)|0,S=S+Math.imul(de,Se)|0,P=P+Math.imul(le,Ie)|0,k=k+Math.imul(le,Me)|0,k=k+Math.imul(me,Ie)|0,S=S+Math.imul(me,Me)|0,P=P+Math.imul(pe,Pe)|0,k=k+Math.imul(pe,Oe)|0,k=k+Math.imul(ge,Pe)|0,S=S+Math.imul(ge,Oe)|0,P=P+Math.imul(ue,Re)|0,k=k+Math.imul(ue,Ne)|0,k=k+Math.imul(ie,Re)|0,S=S+Math.imul(ie,Ne)|0,P=P+Math.imul(oe,Be)|0,k=k+Math.imul(oe,Fe)|0,k=k+Math.imul(ce,Be)|0,S=S+Math.imul(ce,Fe)|0,P=P+Math.imul(X,Le)|0,k=k+Math.imul(X,qe)|0,k=k+Math.imul(Z,Le)|0,S=S+Math.imul(Z,qe)|0,P=P+Math.imul($,Ue)|0,k=k+Math.imul($,je)|0,k=k+Math.imul(K,Ue)|0,S=S+Math.imul(K,je)|0;var Wt=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,P=Math.imul(De,Ae),k=Math.imul(De,ke),k=k+Math.imul(Ce,Ae)|0,S=Math.imul(Ce,ke),P=P+Math.imul(_e,be)|0,k=k+Math.imul(_e,Te)|0,k=k+Math.imul(we,be)|0,S=S+Math.imul(we,Te)|0,P=P+Math.imul(xe,ve)|0,k=k+Math.imul(xe,Se)|0,k=k+Math.imul(Ee,ve)|0,S=S+Math.imul(Ee,Se)|0,P=P+Math.imul(ye,Ie)|0,k=k+Math.imul(ye,Me)|0,k=k+Math.imul(de,Ie)|0,S=S+Math.imul(de,Me)|0,P=P+Math.imul(le,Pe)|0,k=k+Math.imul(le,Oe)|0,k=k+Math.imul(me,Pe)|0,S=S+Math.imul(me,Oe)|0,P=P+Math.imul(pe,Re)|0,k=k+Math.imul(pe,Ne)|0,k=k+Math.imul(ge,Re)|0,S=S+Math.imul(ge,Ne)|0,P=P+Math.imul(ue,Be)|0,k=k+Math.imul(ue,Fe)|0,k=k+Math.imul(ie,Be)|0,S=S+Math.imul(ie,Fe)|0,P=P+Math.imul(oe,Le)|0,k=k+Math.imul(oe,qe)|0,k=k+Math.imul(ce,Le)|0,S=S+Math.imul(ce,qe)|0,P=P+Math.imul(X,Ue)|0,k=k+Math.imul(X,je)|0,k=k+Math.imul(Z,Ue)|0,S=S+Math.imul(Z,je)|0,P=P+Math.imul($,wt)|0,k=k+Math.imul($,xt)|0,k=k+Math.imul(K,wt)|0,S=S+Math.imul(K,xt)|0;var fr=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(fr>>>26)|0,fr&=67108863,P=Math.imul(De,be),k=Math.imul(De,Te),k=k+Math.imul(Ce,be)|0,S=Math.imul(Ce,Te),P=P+Math.imul(_e,ve)|0,k=k+Math.imul(_e,Se)|0,k=k+Math.imul(we,ve)|0,S=S+Math.imul(we,Se)|0,P=P+Math.imul(xe,Ie)|0,k=k+Math.imul(xe,Me)|0,k=k+Math.imul(Ee,Ie)|0,S=S+Math.imul(Ee,Me)|0,P=P+Math.imul(ye,Pe)|0,k=k+Math.imul(ye,Oe)|0,k=k+Math.imul(de,Pe)|0,S=S+Math.imul(de,Oe)|0,P=P+Math.imul(le,Re)|0,k=k+Math.imul(le,Ne)|0,k=k+Math.imul(me,Re)|0,S=S+Math.imul(me,Ne)|0,P=P+Math.imul(pe,Be)|0,k=k+Math.imul(pe,Fe)|0,k=k+Math.imul(ge,Be)|0,S=S+Math.imul(ge,Fe)|0,P=P+Math.imul(ue,Le)|0,k=k+Math.imul(ue,qe)|0,k=k+Math.imul(ie,Le)|0,S=S+Math.imul(ie,qe)|0,P=P+Math.imul(oe,Ue)|0,k=k+Math.imul(oe,je)|0,k=k+Math.imul(ce,Ue)|0,S=S+Math.imul(ce,je)|0,P=P+Math.imul(X,wt)|0,k=k+Math.imul(X,xt)|0,k=k+Math.imul(Z,wt)|0,S=S+Math.imul(Z,xt)|0;var Yt=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,P=Math.imul(De,ve),k=Math.imul(De,Se),k=k+Math.imul(Ce,ve)|0,S=Math.imul(Ce,Se),P=P+Math.imul(_e,Ie)|0,k=k+Math.imul(_e,Me)|0,k=k+Math.imul(we,Ie)|0,S=S+Math.imul(we,Me)|0,P=P+Math.imul(xe,Pe)|0,k=k+Math.imul(xe,Oe)|0,k=k+Math.imul(Ee,Pe)|0,S=S+Math.imul(Ee,Oe)|0,P=P+Math.imul(ye,Re)|0,k=k+Math.imul(ye,Ne)|0,k=k+Math.imul(de,Re)|0,S=S+Math.imul(de,Ne)|0,P=P+Math.imul(le,Be)|0,k=k+Math.imul(le,Fe)|0,k=k+Math.imul(me,Be)|0,S=S+Math.imul(me,Fe)|0,P=P+Math.imul(pe,Le)|0,k=k+Math.imul(pe,qe)|0,k=k+Math.imul(ge,Le)|0,S=S+Math.imul(ge,qe)|0,P=P+Math.imul(ue,Ue)|0,k=k+Math.imul(ue,je)|0,k=k+Math.imul(ie,Ue)|0,S=S+Math.imul(ie,je)|0,P=P+Math.imul(oe,wt)|0,k=k+Math.imul(oe,xt)|0,k=k+Math.imul(ce,wt)|0,S=S+Math.imul(ce,xt)|0;var dr=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(dr>>>26)|0,dr&=67108863,P=Math.imul(De,Ie),k=Math.imul(De,Me),k=k+Math.imul(Ce,Ie)|0,S=Math.imul(Ce,Me),P=P+Math.imul(_e,Pe)|0,k=k+Math.imul(_e,Oe)|0,k=k+Math.imul(we,Pe)|0,S=S+Math.imul(we,Oe)|0,P=P+Math.imul(xe,Re)|0,k=k+Math.imul(xe,Ne)|0,k=k+Math.imul(Ee,Re)|0,S=S+Math.imul(Ee,Ne)|0,P=P+Math.imul(ye,Be)|0,k=k+Math.imul(ye,Fe)|0,k=k+Math.imul(de,Be)|0,S=S+Math.imul(de,Fe)|0,P=P+Math.imul(le,Le)|0,k=k+Math.imul(le,qe)|0,k=k+Math.imul(me,Le)|0,S=S+Math.imul(me,qe)|0,P=P+Math.imul(pe,Ue)|0,k=k+Math.imul(pe,je)|0,k=k+Math.imul(ge,Ue)|0,S=S+Math.imul(ge,je)|0,P=P+Math.imul(ue,wt)|0,k=k+Math.imul(ue,xt)|0,k=k+Math.imul(ie,wt)|0,S=S+Math.imul(ie,xt)|0;var rr=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(rr>>>26)|0,rr&=67108863,P=Math.imul(De,Pe),k=Math.imul(De,Oe),k=k+Math.imul(Ce,Pe)|0,S=Math.imul(Ce,Oe),P=P+Math.imul(_e,Re)|0,k=k+Math.imul(_e,Ne)|0,k=k+Math.imul(we,Re)|0,S=S+Math.imul(we,Ne)|0,P=P+Math.imul(xe,Be)|0,k=k+Math.imul(xe,Fe)|0,k=k+Math.imul(Ee,Be)|0,S=S+Math.imul(Ee,Fe)|0,P=P+Math.imul(ye,Le)|0,k=k+Math.imul(ye,qe)|0,k=k+Math.imul(de,Le)|0,S=S+Math.imul(de,qe)|0,P=P+Math.imul(le,Ue)|0,k=k+Math.imul(le,je)|0,k=k+Math.imul(me,Ue)|0,S=S+Math.imul(me,je)|0,P=P+Math.imul(pe,wt)|0,k=k+Math.imul(pe,xt)|0,k=k+Math.imul(ge,wt)|0,S=S+Math.imul(ge,xt)|0;var nr=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(nr>>>26)|0,nr&=67108863,P=Math.imul(De,Re),k=Math.imul(De,Ne),k=k+Math.imul(Ce,Re)|0,S=Math.imul(Ce,Ne),P=P+Math.imul(_e,Be)|0,k=k+Math.imul(_e,Fe)|0,k=k+Math.imul(we,Be)|0,S=S+Math.imul(we,Fe)|0,P=P+Math.imul(xe,Le)|0,k=k+Math.imul(xe,qe)|0,k=k+Math.imul(Ee,Le)|0,S=S+Math.imul(Ee,qe)|0,P=P+Math.imul(ye,Ue)|0,k=k+Math.imul(ye,je)|0,k=k+Math.imul(de,Ue)|0,S=S+Math.imul(de,je)|0,P=P+Math.imul(le,wt)|0,k=k+Math.imul(le,xt)|0,k=k+Math.imul(me,wt)|0,S=S+Math.imul(me,xt)|0;var hr=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(hr>>>26)|0,hr&=67108863,P=Math.imul(De,Be),k=Math.imul(De,Fe),k=k+Math.imul(Ce,Be)|0,S=Math.imul(Ce,Fe),P=P+Math.imul(_e,Le)|0,k=k+Math.imul(_e,qe)|0,k=k+Math.imul(we,Le)|0,S=S+Math.imul(we,qe)|0,P=P+Math.imul(xe,Ue)|0,k=k+Math.imul(xe,je)|0,k=k+Math.imul(Ee,Ue)|0,S=S+Math.imul(Ee,je)|0,P=P+Math.imul(ye,wt)|0,k=k+Math.imul(ye,xt)|0,k=k+Math.imul(de,wt)|0,S=S+Math.imul(de,xt)|0;var xr=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(xr>>>26)|0,xr&=67108863,P=Math.imul(De,Le),k=Math.imul(De,qe),k=k+Math.imul(Ce,Le)|0,S=Math.imul(Ce,qe),P=P+Math.imul(_e,Ue)|0,k=k+Math.imul(_e,je)|0,k=k+Math.imul(we,Ue)|0,S=S+Math.imul(we,je)|0,P=P+Math.imul(xe,wt)|0,k=k+Math.imul(xe,xt)|0,k=k+Math.imul(Ee,wt)|0,S=S+Math.imul(Ee,xt)|0;var Zs=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(Zs>>>26)|0,Zs&=67108863,P=Math.imul(De,Ue),k=Math.imul(De,je),k=k+Math.imul(Ce,Ue)|0,S=Math.imul(Ce,je),P=P+Math.imul(_e,wt)|0,k=k+Math.imul(_e,xt)|0,k=k+Math.imul(we,wt)|0,S=S+Math.imul(we,xt)|0;var Au=(v+P|0)+((k&8191)<<13)|0;v=(S+(k>>>13)|0)+(Au>>>26)|0,Au&=67108863,P=Math.imul(De,wt),k=Math.imul(De,xt),k=k+Math.imul(Ce,wt)|0,S=Math.imul(Ce,xt);var tc=(v+P|0)+((k&8191)<<13)|0;return v=(S+(k>>>13)|0)+(tc>>>26)|0,tc&=67108863,a[0]=or,a[1]=yr,a[2]=lr,a[3]=vr,a[4]=br,a[5]=_r,a[6]=wr,a[7]=tr,a[8]=Wt,a[9]=fr,a[10]=Yt,a[11]=dr,a[12]=rr,a[13]=nr,a[14]=hr,a[15]=xr,a[16]=Zs,a[17]=Au,a[18]=tc,v!==0&&(a[19]=v,b.length++),b};Math.imul||(O=D);function N(p,f,h){h.negative=f.negative^p.negative,h.length=p.length+f.length;for(var b=0,w=0,g=0;g>>26)|0,w+=a>>>26,a&=67108863}h.words[g]=v,b=a,a=w}return b!==0?h.words[g]=b:h.length--,h._strip()}function L(p,f,h){return N(p,f,h)}n.prototype.mulTo=function(f,h){var b,w=this.length+f.length;return this.length===10&&f.length===10?b=O(this,f,h):w<63?b=D(this,f,h):w<1024?b=N(this,f,h):b=L(this,f,h),b};function j(p,f){this.x=p,this.y=f}j.prototype.makeRBT=function(f){for(var h=new Array(f),b=n.prototype._countBits(f)-1,w=0;w>=1;return w},j.prototype.permute=function(f,h,b,w,g,a){for(var v=0;v>>1)g++;return 1<>>13,b[2*a+1]=g&8191,g=g>>>13;for(a=2*h;a>=26,b+=g/67108864|0,b+=a>>>26,this.words[w]=a&67108863}return b!==0&&(this.words[w]=b,this.length++),h?this.ineg():this},n.prototype.muln=function(f){return this.clone().imuln(f)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(f){var h=I(f);if(h.length===0)return new n(1);for(var b=this,w=0;w=0);var h=f%26,b=(f-h)/26,w=67108863>>>26-h<<26-h,g;if(h!==0){var a=0;for(g=0;g>>26-h}a&&(this.words[g]=a,this.length++)}if(b!==0){for(g=this.length-1;g>=0;g--)this.words[g+b]=this.words[g];for(g=0;g=0);var w;h?w=(h-h%26)/26:w=0;var g=f%26,a=Math.min((f-g)/26,this.length),v=67108863^67108863>>>g<a)for(this.length-=a,k=0;k=0&&(S!==0||k>=w);k--){var B=this.words[k]|0;this.words[k]=S<<26-g|B>>>g,S=B&v}return P&&S!==0&&(P.words[P.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(f,h,b){return r(this.negative===0),this.iushrn(f,h,b)},n.prototype.shln=function(f){return this.clone().ishln(f)},n.prototype.ushln=function(f){return this.clone().iushln(f)},n.prototype.shrn=function(f){return this.clone().ishrn(f)},n.prototype.ushrn=function(f){return this.clone().iushrn(f)},n.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var h=f%26,b=(f-h)/26,w=1<=0);var h=f%26,b=(f-h)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(h!==0&&b++,this.length=Math.min(b,this.length),h!==0){var w=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},n.prototype.isubn=function(f){if(r(typeof f=="number"),r(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h>26)-(P/67108864|0),this.words[g+b]=a&67108863}for(;g>26,this.words[g+b]=a&67108863;if(v===0)return this._strip();for(r(v===-1),v=0,g=0;g>26,this.words[g]=a&67108863;return this.negative=1,this._strip()},n.prototype._wordDiv=function(f,h){var b=this.length-f.length,w=this.clone(),g=f,a=g.words[g.length-1]|0,v=this._countBits(a);b=26-v,b!==0&&(g=g.ushln(b),w.iushln(b),a=g.words[g.length-1]|0);var P=w.length-g.length,k;if(h!=="mod"){k=new n(null),k.length=P+1,k.words=new Array(k.length);for(var S=0;S=0;$--){var K=(w.words[g.length+$]|0)*67108864+(w.words[g.length+$-1]|0);for(K=Math.min(K/a|0,67108863),w._ishlnsubmul(g,K,$);w.negative!==0;)K--,w.negative=0,w._ishlnsubmul(g,1,$),w.isZero()||(w.negative^=1);k&&(k.words[$]=K)}return k&&k._strip(),w._strip(),h!=="div"&&b!==0&&w.iushrn(b),{div:k||null,mod:w}},n.prototype.divmod=function(f,h,b){if(r(!f.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var w,g,a;return this.negative!==0&&f.negative===0?(a=this.neg().divmod(f,h),h!=="mod"&&(w=a.div.neg()),h!=="div"&&(g=a.mod.neg(),b&&g.negative!==0&&g.iadd(f)),{div:w,mod:g}):this.negative===0&&f.negative!==0?(a=this.divmod(f.neg(),h),h!=="mod"&&(w=a.div.neg()),{div:w,mod:a.mod}):(this.negative&f.negative)!==0?(a=this.neg().divmod(f.neg(),h),h!=="div"&&(g=a.mod.neg(),b&&g.negative!==0&&g.isub(f)),{div:a.div,mod:g}):f.length>this.length||this.cmp(f)<0?{div:new n(0),mod:this}:f.length===1?h==="div"?{div:this.divn(f.words[0]),mod:null}:h==="mod"?{div:null,mod:new n(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new n(this.modrn(f.words[0]))}:this._wordDiv(f,h)},n.prototype.div=function(f){return this.divmod(f,"div",!1).div},n.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},n.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},n.prototype.divRound=function(f){var h=this.divmod(f);if(h.mod.isZero())return h.div;var b=h.div.negative!==0?h.mod.isub(f):h.mod,w=f.ushrn(1),g=f.andln(1),a=b.cmp(w);return a<0||g===1&&a===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},n.prototype.modrn=function(f){var h=f<0;h&&(f=-f),r(f<=67108863);for(var b=(1<<26)%f,w=0,g=this.length-1;g>=0;g--)w=(b*w+(this.words[g]|0))%f;return h?-w:w},n.prototype.modn=function(f){return this.modrn(f)},n.prototype.idivn=function(f){var h=f<0;h&&(f=-f),r(f<=67108863);for(var b=0,w=this.length-1;w>=0;w--){var g=(this.words[w]|0)+b*67108864;this.words[w]=g/f|0,b=g%f}return this._strip(),h?this.ineg():this},n.prototype.divn=function(f){return this.clone().idivn(f)},n.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var h=this,b=f.clone();h.negative!==0?h=h.umod(f):h=h.clone();for(var w=new n(1),g=new n(0),a=new n(0),v=new n(1),P=0;h.isEven()&&b.isEven();)h.iushrn(1),b.iushrn(1),++P;for(var k=b.clone(),S=h.clone();!h.isZero();){for(var B=0,$=1;(h.words[0]&$)===0&&B<26;++B,$<<=1);if(B>0)for(h.iushrn(B);B-- >0;)(w.isOdd()||g.isOdd())&&(w.iadd(k),g.isub(S)),w.iushrn(1),g.iushrn(1);for(var K=0,he=1;(b.words[0]&he)===0&&K<26;++K,he<<=1);if(K>0)for(b.iushrn(K);K-- >0;)(a.isOdd()||v.isOdd())&&(a.iadd(k),v.isub(S)),a.iushrn(1),v.iushrn(1);h.cmp(b)>=0?(h.isub(b),w.isub(a),g.isub(v)):(b.isub(h),a.isub(w),v.isub(g))}return{a,b:v,gcd:b.iushln(P)}},n.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var h=this,b=f.clone();h.negative!==0?h=h.umod(f):h=h.clone();for(var w=new n(1),g=new n(0),a=b.clone();h.cmpn(1)>0&&b.cmpn(1)>0;){for(var v=0,P=1;(h.words[0]&P)===0&&v<26;++v,P<<=1);if(v>0)for(h.iushrn(v);v-- >0;)w.isOdd()&&w.iadd(a),w.iushrn(1);for(var k=0,S=1;(b.words[0]&S)===0&&k<26;++k,S<<=1);if(k>0)for(b.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(a),g.iushrn(1);h.cmp(b)>=0?(h.isub(b),w.isub(g)):(b.isub(h),g.isub(w))}var B;return h.cmpn(1)===0?B=w:B=g,B.cmpn(0)<0&&B.iadd(f),B},n.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var h=this.clone(),b=f.clone();h.negative=0,b.negative=0;for(var w=0;h.isEven()&&b.isEven();w++)h.iushrn(1),b.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;b.isEven();)b.iushrn(1);var g=h.cmp(b);if(g<0){var a=h;h=b,b=a}else if(g===0||b.cmpn(1)===0)break;h.isub(b)}while(!0);return b.iushln(w)},n.prototype.invm=function(f){return this.egcd(f).a.umod(f)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(f){return this.words[0]&f},n.prototype.bincn=function(f){r(typeof f=="number");var h=f%26,b=(f-h)/26,w=1<>>26,v&=67108863,this.words[a]=v}return g!==0&&(this.words[a]=g,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(f){var h=f<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var b;if(this.length>1)b=1;else{h&&(f=-f),r(f<=67108863,"Number is too big");var w=this.words[0]|0;b=w===f?0:wf.length)return 1;if(this.length=0;b--){var w=this.words[b]|0,g=f.words[b]|0;if(w!==g){wg&&(h=1);break}}return h},n.prototype.gtn=function(f){return this.cmpn(f)===1},n.prototype.gt=function(f){return this.cmp(f)===1},n.prototype.gten=function(f){return this.cmpn(f)>=0},n.prototype.gte=function(f){return this.cmp(f)>=0},n.prototype.ltn=function(f){return this.cmpn(f)===-1},n.prototype.lt=function(f){return this.cmp(f)===-1},n.prototype.lten=function(f){return this.cmpn(f)<=0},n.prototype.lte=function(f){return this.cmp(f)<=0},n.prototype.eqn=function(f){return this.cmpn(f)===0},n.prototype.eq=function(f){return this.cmp(f)===0},n.red=function(f){return new s(f)},n.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(f){return this.red=f,this},n.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},n.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},n.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},n.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},n.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},n.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},n.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},n.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var H={k256:null,p224:null,p192:null,p25519:null};function Y(p,f){this.name=p,this.p=new n(f,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Y.prototype._tmp=function(){var f=new n(null);return f.words=new Array(Math.ceil(this.n/13)),f},Y.prototype.ireduce=function(f){var h=f,b;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),b=h.bitLength();while(b>this.n);var w=b0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},Y.prototype.split=function(f,h){f.iushrn(this.n,0,h)},Y.prototype.imulK=function(f){return f.imul(this.k)};function W(){Y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(W,Y),W.prototype.split=function(f,h){for(var b=4194303,w=Math.min(f.length,9),g=0;g>>22,a=v}a>>>=22,f.words[g-10]=a,a===0&&f.length>10?f.length-=10:f.length-=9},W.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var h=0,b=0;b>>=26,f.words[b]=g,h=w}return h!==0&&(f.words[f.length++]=h),f},n._prime=function(f){if(H[f])return H[f];var h;if(f==="k256")h=new W;else if(f==="p224")h=new q;else if(f==="p192")h=new J;else if(f==="p25519")h=new _;else throw new Error("Unknown prime "+f);return H[f]=h,h};function s(p){if(typeof p=="string"){var f=n._prime(p);this.m=f.p,this.prime=f}else r(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}s.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},s.prototype._verify2=function(f,h){r((f.negative|h.negative)===0,"red works only with positives"),r(f.red&&f.red===h.red,"red works only with red numbers")},s.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(y(f,f.umod(this.m)._forceRed(this)),f)},s.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},s.prototype.add=function(f,h){this._verify2(f,h);var b=f.add(h);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},s.prototype.iadd=function(f,h){this._verify2(f,h);var b=f.iadd(h);return b.cmp(this.m)>=0&&b.isub(this.m),b},s.prototype.sub=function(f,h){this._verify2(f,h);var b=f.sub(h);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},s.prototype.isub=function(f,h){this._verify2(f,h);var b=f.isub(h);return b.cmpn(0)<0&&b.iadd(this.m),b},s.prototype.shl=function(f,h){return this._verify1(f),this.imod(f.ushln(h))},s.prototype.imul=function(f,h){return this._verify2(f,h),this.imod(f.imul(h))},s.prototype.mul=function(f,h){return this._verify2(f,h),this.imod(f.mul(h))},s.prototype.isqr=function(f){return this.imul(f,f.clone())},s.prototype.sqr=function(f){return this.mul(f,f)},s.prototype.sqrt=function(f){if(f.isZero())return f.clone();var h=this.m.andln(3);if(r(h%2===1),h===3){var b=this.m.add(new n(1)).iushrn(2);return this.pow(f,b)}for(var w=this.m.subn(1),g=0;!w.isZero()&&w.andln(1)===0;)g++,w.iushrn(1);r(!w.isZero());var a=new n(1).toRed(this),v=a.redNeg(),P=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new n(2*k*k).toRed(this);this.pow(k,P).cmp(v)!==0;)k.redIAdd(v);for(var S=this.pow(k,w),B=this.pow(f,w.addn(1).iushrn(1)),$=this.pow(f,w),K=g;$.cmp(a)!==0;){for(var he=$,X=0;he.cmp(a)!==0;X++)he=he.redSqr();r(X=0;g--){for(var S=h.words[g],B=k-1;B>=0;B--){var $=S>>B&1;if(a!==w[0]&&(a=this.sqr(a)),$===0&&v===0){P=0;continue}v<<=1,v|=$,P++,!(P!==b&&(g!==0||B!==0))&&(a=this.mul(a,w[v]),P=0,v=0)}k=26}return a},s.prototype.convertTo=function(f){var h=f.umod(this.m);return h===f?h.clone():h},s.prototype.convertFrom=function(f){var h=f.clone();return h.red=null,h},n.mont=function(f){return new l(f)};function l(p){s.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(l,s),l.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},l.prototype.convertFrom=function(f){var h=this.imod(f.mul(this.rinv));return h.red=null,h},l.prototype.imul=function(f,h){if(f.isZero()||h.isZero())return f.words[0]=0,f.length=1,f;var b=f.imul(h),w=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=b.isub(w).iushrn(this.shift),a=g;return g.cmp(this.m)>=0?a=g.isub(this.m):g.cmpn(0)<0&&(a=g.iadd(this.m)),a._forceRed(this)},l.prototype.mul=function(f,h){if(f.isZero()||h.isZero())return new n(0)._forceRed(this);var b=f.mul(h),w=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=b.isub(w).iushrn(this.shift),a=g;return g.cmp(this.m)>=0?a=g.isub(this.m):g.cmpn(0)<0&&(a=g.iadd(this.m)),a._forceRed(this)},l.prototype.invm=function(f){var h=this.imod(f._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(typeof yC>"u"||yC,aF)});var Qv=F((iLe,lF)=>{m();var Od=Yv(),i_e=$u();function o_e(t){var e=cF(t),r=e.toRed(Od.mont(t.modulus)).redPow(new Od(t.publicExponent)).fromRed();return{blinder:r,unblinder:e.invm(t.modulus)}}function cF(t){var e=t.modulus.byteLength(),r;do r=new Od(i_e(e));while(r.cmp(t.modulus)>=0||!r.umod(t.prime1)||!r.umod(t.prime2));return r}function uF(t,e){var r=o_e(e),i=e.modulus.byteLength(),n=new Od(t).mul(r.blinder).umod(e.modulus),o=n.toRed(Od.mont(e.prime1)),c=n.toRed(Od.mont(e.prime2)),u=e.coefficient,d=e.prime1,y=e.prime2,E=o.redPow(e.exponent1).fromRed(),x=c.redPow(e.exponent2).fromRed(),A=E.isub(x).imul(u).umod(d).imul(y);return x.iadd(A).imul(r.unblinder).umod(e.modulus).toArrayLike(T,"be",i)}uF.getr=cF;lF.exports=uF});var fF=F((oLe,s_e)=>{s_e.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny ",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var Ts=F((dF,vC)=>{m();(function(t,e){"use strict";function r(_,s){if(!_)throw new Error(s||"Assertion failed")}function i(_,s){_.super_=s;var l=function(){};l.prototype=s.prototype,_.prototype=new l,_.prototype.constructor=_}function n(_,s,l){if(n.isBN(_))return _;this.negative=0,this.words=null,this.length=0,this.red=null,_!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(_||0,s||10,l||"be"))}typeof t=="object"?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ac().Buffer}catch{}n.isBN=function(s){return s instanceof n?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===n.wordSize&&Array.isArray(s.words)},n.max=function(s,l){return s.cmp(l)>0?s:l},n.min=function(s,l){return s.cmp(l)<0?s:l},n.prototype._init=function(s,l,p){if(typeof s=="number")return this._initNumber(s,l,p);if(typeof s=="object")return this._initArray(s,l,p);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f=0;f-=3)b=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[h]|=b<>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);else if(p==="le")for(f=0,h=0;f>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);return this.strip()};function c(_,s){var l=_.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function u(_,s,l){var p=c(_,l);return l-1>=s&&(p|=c(_,l-1)<<4),p}n.prototype._parseHex=function(s,l,p){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f=l;f-=2)w=u(s,l,f)<=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8;else{var g=s.length-l;for(f=g%2===0?l+1:l;f=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8}this.strip()};function d(_,s,l,p){for(var f=0,h=Math.min(_.length,l),b=s;b=49?f+=w-49+10:w>=17?f+=w-17+10:f+=w}return f}n.prototype._parseBase=function(s,l,p){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=l)f++;f--,h=h/l|0;for(var b=s.length-p,w=b%f,g=Math.min(b,b-w)+p,a=0,v=p;v1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(s,l){s=s||10,l=l|0||1;var p;if(s===16||s==="hex"){p="";for(var f=0,h=0,b=0;b>>24-f&16777215,h!==0||b!==this.length-1?p=y[6-g.length]+g+p:p=g+p,f+=2,f>=26&&(f-=26,b--)}for(h!==0&&(p=h.toString(16)+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(s===(s|0)&&s>=2&&s<=36){var a=E[s],v=x[s];p="";var P=this.clone();for(P.negative=0;!P.isZero();){var k=P.modn(v).toString(s);P=P.idivn(v),P.isZero()?p=k+p:p=y[a-k.length]+k+p}for(this.isZero()&&(p="0"+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},n.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},n.prototype.toArrayLike=function(s,l,p){var f=this.byteLength(),h=p||Math.max(1,f);r(f<=h,"byte array longer than desired length"),r(h>0,"Requested array length <= 0"),this.strip();var b=l==="le",w=new s(h),g,a,v=this.clone();if(b){for(a=0;!v.isZero();a++)g=v.andln(255),v.iushrn(8),w[a]=g;for(;a=4096&&(p+=13,l>>>=13),l>=64&&(p+=7,l>>>=7),l>=8&&(p+=4,l>>>=4),l>=2&&(p+=2,l>>>=2),p+l},n.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,p=0;return(l&8191)===0&&(p+=13,l>>>=13),(l&127)===0&&(p+=7,l>>>=7),(l&15)===0&&(p+=4,l>>>=4),(l&3)===0&&(p+=2,l>>>=2),(l&1)===0&&p++,p},n.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function A(_){for(var s=new Array(_.bitLength()),l=0;l>>f}return s}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;ls.length?this.clone().ior(s):s.clone().ior(this)},n.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},n.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var p=0;ps.length?this.clone().iand(s):s.clone().iand(this)},n.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},n.prototype.iuxor=function(s){var l,p;this.length>s.length?(l=this,p=s):(l=s,p=this);for(var f=0;fs.length?this.clone().ixor(s):s.clone().ixor(this)},n.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},n.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,p=s%26;this._expand(l),p>0&&l--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-p),this.strip()},n.prototype.notn=function(s){return this.clone().inotn(s)},n.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var p=s/26|0,f=s%26;return this._expand(p+1),l?this.words[p]=this.words[p]|1<s.length?(p=this,f=s):(p=s,f=this);for(var h=0,b=0;b>>26;for(;h!==0&&b>>26;if(this.length=p.length,h!==0)this.words[this.length]=h,this.length++;else if(p!==this)for(;bs.length?this.clone().iadd(s):s.clone().iadd(this)},n.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var p=this.cmp(s);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;p>0?(f=this,h=s):(f=s,h=this);for(var b=0,w=0;w>26,this.words[w]=l&67108863;for(;b!==0&&w>26,this.words[w]=l&67108863;if(b===0&&w>>26,P=g&67108863,k=Math.min(a,s.length-1),S=Math.max(0,a-_.length+1);S<=k;S++){var B=a-S|0;f=_.words[B]|0,h=s.words[S]|0,b=f*h+P,v+=b/67108864|0,P=b&67108863}l.words[a]=P|0,g=v|0}return g!==0?l.words[a]=g|0:l.length--,l.strip()}var M=function(s,l,p){var f=s.words,h=l.words,b=p.words,w=0,g,a,v,P=f[0]|0,k=P&8191,S=P>>>13,B=f[1]|0,$=B&8191,K=B>>>13,he=f[2]|0,X=he&8191,Z=he>>>13,it=f[3]|0,oe=it&8191,ce=it>>>13,Rt=f[4]|0,ue=Rt&8191,ie=Rt>>>13,bt=f[5]|0,pe=bt&8191,ge=bt>>>13,Ct=f[6]|0,le=Ct&8191,me=Ct>>>13,Ht=f[7]|0,ye=Ht&8191,de=Ht>>>13,Mr=f[8]|0,xe=Mr&8191,Ee=Mr>>>13,Ir=f[9]|0,_e=Ir&8191,we=Ir>>>13,Lr=h[0]|0,De=Lr&8191,Ce=Lr>>>13,$r=h[1]|0,Ae=$r&8191,ke=$r>>>13,Lt=h[2]|0,be=Lt&8191,Te=Lt>>>13,Yr=h[3]|0,ve=Yr&8191,Se=Yr>>>13,Qr=h[4]|0,Ie=Qr&8191,Me=Qr>>>13,Jr=h[5]|0,Pe=Jr&8191,Oe=Jr>>>13,Xr=h[6]|0,Re=Xr&8191,Ne=Xr>>>13,Zr=h[7]|0,Be=Zr&8191,Fe=Zr>>>13,Gr=h[8]|0,Le=Gr&8191,qe=Gr>>>13,en=h[9]|0,Ue=en&8191,je=en>>>13;p.negative=s.negative^l.negative,p.length=19,g=Math.imul(k,De),a=Math.imul(k,Ce),a=a+Math.imul(S,De)|0,v=Math.imul(S,Ce);var gr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(gr>>>26)|0,gr&=67108863,g=Math.imul($,De),a=Math.imul($,Ce),a=a+Math.imul(K,De)|0,v=Math.imul(K,Ce),g=g+Math.imul(k,Ae)|0,a=a+Math.imul(k,ke)|0,a=a+Math.imul(S,Ae)|0,v=v+Math.imul(S,ke)|0;var wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,g=Math.imul(X,De),a=Math.imul(X,Ce),a=a+Math.imul(Z,De)|0,v=Math.imul(Z,Ce),g=g+Math.imul($,Ae)|0,a=a+Math.imul($,ke)|0,a=a+Math.imul(K,Ae)|0,v=v+Math.imul(K,ke)|0,g=g+Math.imul(k,be)|0,a=a+Math.imul(k,Te)|0,a=a+Math.imul(S,be)|0,v=v+Math.imul(S,Te)|0;var xt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,g=Math.imul(oe,De),a=Math.imul(oe,Ce),a=a+Math.imul(ce,De)|0,v=Math.imul(ce,Ce),g=g+Math.imul(X,Ae)|0,a=a+Math.imul(X,ke)|0,a=a+Math.imul(Z,Ae)|0,v=v+Math.imul(Z,ke)|0,g=g+Math.imul($,be)|0,a=a+Math.imul($,Te)|0,a=a+Math.imul(K,be)|0,v=v+Math.imul(K,Te)|0,g=g+Math.imul(k,ve)|0,a=a+Math.imul(k,Se)|0,a=a+Math.imul(S,ve)|0,v=v+Math.imul(S,Se)|0;var or=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(or>>>26)|0,or&=67108863,g=Math.imul(ue,De),a=Math.imul(ue,Ce),a=a+Math.imul(ie,De)|0,v=Math.imul(ie,Ce),g=g+Math.imul(oe,Ae)|0,a=a+Math.imul(oe,ke)|0,a=a+Math.imul(ce,Ae)|0,v=v+Math.imul(ce,ke)|0,g=g+Math.imul(X,be)|0,a=a+Math.imul(X,Te)|0,a=a+Math.imul(Z,be)|0,v=v+Math.imul(Z,Te)|0,g=g+Math.imul($,ve)|0,a=a+Math.imul($,Se)|0,a=a+Math.imul(K,ve)|0,v=v+Math.imul(K,Se)|0,g=g+Math.imul(k,Ie)|0,a=a+Math.imul(k,Me)|0,a=a+Math.imul(S,Ie)|0,v=v+Math.imul(S,Me)|0;var yr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(yr>>>26)|0,yr&=67108863,g=Math.imul(pe,De),a=Math.imul(pe,Ce),a=a+Math.imul(ge,De)|0,v=Math.imul(ge,Ce),g=g+Math.imul(ue,Ae)|0,a=a+Math.imul(ue,ke)|0,a=a+Math.imul(ie,Ae)|0,v=v+Math.imul(ie,ke)|0,g=g+Math.imul(oe,be)|0,a=a+Math.imul(oe,Te)|0,a=a+Math.imul(ce,be)|0,v=v+Math.imul(ce,Te)|0,g=g+Math.imul(X,ve)|0,a=a+Math.imul(X,Se)|0,a=a+Math.imul(Z,ve)|0,v=v+Math.imul(Z,Se)|0,g=g+Math.imul($,Ie)|0,a=a+Math.imul($,Me)|0,a=a+Math.imul(K,Ie)|0,v=v+Math.imul(K,Me)|0,g=g+Math.imul(k,Pe)|0,a=a+Math.imul(k,Oe)|0,a=a+Math.imul(S,Pe)|0,v=v+Math.imul(S,Oe)|0;var lr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(lr>>>26)|0,lr&=67108863,g=Math.imul(le,De),a=Math.imul(le,Ce),a=a+Math.imul(me,De)|0,v=Math.imul(me,Ce),g=g+Math.imul(pe,Ae)|0,a=a+Math.imul(pe,ke)|0,a=a+Math.imul(ge,Ae)|0,v=v+Math.imul(ge,ke)|0,g=g+Math.imul(ue,be)|0,a=a+Math.imul(ue,Te)|0,a=a+Math.imul(ie,be)|0,v=v+Math.imul(ie,Te)|0,g=g+Math.imul(oe,ve)|0,a=a+Math.imul(oe,Se)|0,a=a+Math.imul(ce,ve)|0,v=v+Math.imul(ce,Se)|0,g=g+Math.imul(X,Ie)|0,a=a+Math.imul(X,Me)|0,a=a+Math.imul(Z,Ie)|0,v=v+Math.imul(Z,Me)|0,g=g+Math.imul($,Pe)|0,a=a+Math.imul($,Oe)|0,a=a+Math.imul(K,Pe)|0,v=v+Math.imul(K,Oe)|0,g=g+Math.imul(k,Re)|0,a=a+Math.imul(k,Ne)|0,a=a+Math.imul(S,Re)|0,v=v+Math.imul(S,Ne)|0;var vr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(vr>>>26)|0,vr&=67108863,g=Math.imul(ye,De),a=Math.imul(ye,Ce),a=a+Math.imul(de,De)|0,v=Math.imul(de,Ce),g=g+Math.imul(le,Ae)|0,a=a+Math.imul(le,ke)|0,a=a+Math.imul(me,Ae)|0,v=v+Math.imul(me,ke)|0,g=g+Math.imul(pe,be)|0,a=a+Math.imul(pe,Te)|0,a=a+Math.imul(ge,be)|0,v=v+Math.imul(ge,Te)|0,g=g+Math.imul(ue,ve)|0,a=a+Math.imul(ue,Se)|0,a=a+Math.imul(ie,ve)|0,v=v+Math.imul(ie,Se)|0,g=g+Math.imul(oe,Ie)|0,a=a+Math.imul(oe,Me)|0,a=a+Math.imul(ce,Ie)|0,v=v+Math.imul(ce,Me)|0,g=g+Math.imul(X,Pe)|0,a=a+Math.imul(X,Oe)|0,a=a+Math.imul(Z,Pe)|0,v=v+Math.imul(Z,Oe)|0,g=g+Math.imul($,Re)|0,a=a+Math.imul($,Ne)|0,a=a+Math.imul(K,Re)|0,v=v+Math.imul(K,Ne)|0,g=g+Math.imul(k,Be)|0,a=a+Math.imul(k,Fe)|0,a=a+Math.imul(S,Be)|0,v=v+Math.imul(S,Fe)|0;var br=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(br>>>26)|0,br&=67108863,g=Math.imul(xe,De),a=Math.imul(xe,Ce),a=a+Math.imul(Ee,De)|0,v=Math.imul(Ee,Ce),g=g+Math.imul(ye,Ae)|0,a=a+Math.imul(ye,ke)|0,a=a+Math.imul(de,Ae)|0,v=v+Math.imul(de,ke)|0,g=g+Math.imul(le,be)|0,a=a+Math.imul(le,Te)|0,a=a+Math.imul(me,be)|0,v=v+Math.imul(me,Te)|0,g=g+Math.imul(pe,ve)|0,a=a+Math.imul(pe,Se)|0,a=a+Math.imul(ge,ve)|0,v=v+Math.imul(ge,Se)|0,g=g+Math.imul(ue,Ie)|0,a=a+Math.imul(ue,Me)|0,a=a+Math.imul(ie,Ie)|0,v=v+Math.imul(ie,Me)|0,g=g+Math.imul(oe,Pe)|0,a=a+Math.imul(oe,Oe)|0,a=a+Math.imul(ce,Pe)|0,v=v+Math.imul(ce,Oe)|0,g=g+Math.imul(X,Re)|0,a=a+Math.imul(X,Ne)|0,a=a+Math.imul(Z,Re)|0,v=v+Math.imul(Z,Ne)|0,g=g+Math.imul($,Be)|0,a=a+Math.imul($,Fe)|0,a=a+Math.imul(K,Be)|0,v=v+Math.imul(K,Fe)|0,g=g+Math.imul(k,Le)|0,a=a+Math.imul(k,qe)|0,a=a+Math.imul(S,Le)|0,v=v+Math.imul(S,qe)|0;var _r=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(_r>>>26)|0,_r&=67108863,g=Math.imul(_e,De),a=Math.imul(_e,Ce),a=a+Math.imul(we,De)|0,v=Math.imul(we,Ce),g=g+Math.imul(xe,Ae)|0,a=a+Math.imul(xe,ke)|0,a=a+Math.imul(Ee,Ae)|0,v=v+Math.imul(Ee,ke)|0,g=g+Math.imul(ye,be)|0,a=a+Math.imul(ye,Te)|0,a=a+Math.imul(de,be)|0,v=v+Math.imul(de,Te)|0,g=g+Math.imul(le,ve)|0,a=a+Math.imul(le,Se)|0,a=a+Math.imul(me,ve)|0,v=v+Math.imul(me,Se)|0,g=g+Math.imul(pe,Ie)|0,a=a+Math.imul(pe,Me)|0,a=a+Math.imul(ge,Ie)|0,v=v+Math.imul(ge,Me)|0,g=g+Math.imul(ue,Pe)|0,a=a+Math.imul(ue,Oe)|0,a=a+Math.imul(ie,Pe)|0,v=v+Math.imul(ie,Oe)|0,g=g+Math.imul(oe,Re)|0,a=a+Math.imul(oe,Ne)|0,a=a+Math.imul(ce,Re)|0,v=v+Math.imul(ce,Ne)|0,g=g+Math.imul(X,Be)|0,a=a+Math.imul(X,Fe)|0,a=a+Math.imul(Z,Be)|0,v=v+Math.imul(Z,Fe)|0,g=g+Math.imul($,Le)|0,a=a+Math.imul($,qe)|0,a=a+Math.imul(K,Le)|0,v=v+Math.imul(K,qe)|0,g=g+Math.imul(k,Ue)|0,a=a+Math.imul(k,je)|0,a=a+Math.imul(S,Ue)|0,v=v+Math.imul(S,je)|0;var wr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wr>>>26)|0,wr&=67108863,g=Math.imul(_e,Ae),a=Math.imul(_e,ke),a=a+Math.imul(we,Ae)|0,v=Math.imul(we,ke),g=g+Math.imul(xe,be)|0,a=a+Math.imul(xe,Te)|0,a=a+Math.imul(Ee,be)|0,v=v+Math.imul(Ee,Te)|0,g=g+Math.imul(ye,ve)|0,a=a+Math.imul(ye,Se)|0,a=a+Math.imul(de,ve)|0,v=v+Math.imul(de,Se)|0,g=g+Math.imul(le,Ie)|0,a=a+Math.imul(le,Me)|0,a=a+Math.imul(me,Ie)|0,v=v+Math.imul(me,Me)|0,g=g+Math.imul(pe,Pe)|0,a=a+Math.imul(pe,Oe)|0,a=a+Math.imul(ge,Pe)|0,v=v+Math.imul(ge,Oe)|0,g=g+Math.imul(ue,Re)|0,a=a+Math.imul(ue,Ne)|0,a=a+Math.imul(ie,Re)|0,v=v+Math.imul(ie,Ne)|0,g=g+Math.imul(oe,Be)|0,a=a+Math.imul(oe,Fe)|0,a=a+Math.imul(ce,Be)|0,v=v+Math.imul(ce,Fe)|0,g=g+Math.imul(X,Le)|0,a=a+Math.imul(X,qe)|0,a=a+Math.imul(Z,Le)|0,v=v+Math.imul(Z,qe)|0,g=g+Math.imul($,Ue)|0,a=a+Math.imul($,je)|0,a=a+Math.imul(K,Ue)|0,v=v+Math.imul(K,je)|0;var tr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(tr>>>26)|0,tr&=67108863,g=Math.imul(_e,be),a=Math.imul(_e,Te),a=a+Math.imul(we,be)|0,v=Math.imul(we,Te),g=g+Math.imul(xe,ve)|0,a=a+Math.imul(xe,Se)|0,a=a+Math.imul(Ee,ve)|0,v=v+Math.imul(Ee,Se)|0,g=g+Math.imul(ye,Ie)|0,a=a+Math.imul(ye,Me)|0,a=a+Math.imul(de,Ie)|0,v=v+Math.imul(de,Me)|0,g=g+Math.imul(le,Pe)|0,a=a+Math.imul(le,Oe)|0,a=a+Math.imul(me,Pe)|0,v=v+Math.imul(me,Oe)|0,g=g+Math.imul(pe,Re)|0,a=a+Math.imul(pe,Ne)|0,a=a+Math.imul(ge,Re)|0,v=v+Math.imul(ge,Ne)|0,g=g+Math.imul(ue,Be)|0,a=a+Math.imul(ue,Fe)|0,a=a+Math.imul(ie,Be)|0,v=v+Math.imul(ie,Fe)|0,g=g+Math.imul(oe,Le)|0,a=a+Math.imul(oe,qe)|0,a=a+Math.imul(ce,Le)|0,v=v+Math.imul(ce,qe)|0,g=g+Math.imul(X,Ue)|0,a=a+Math.imul(X,je)|0,a=a+Math.imul(Z,Ue)|0,v=v+Math.imul(Z,je)|0;var Wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,g=Math.imul(_e,ve),a=Math.imul(_e,Se),a=a+Math.imul(we,ve)|0,v=Math.imul(we,Se),g=g+Math.imul(xe,Ie)|0,a=a+Math.imul(xe,Me)|0,a=a+Math.imul(Ee,Ie)|0,v=v+Math.imul(Ee,Me)|0,g=g+Math.imul(ye,Pe)|0,a=a+Math.imul(ye,Oe)|0,a=a+Math.imul(de,Pe)|0,v=v+Math.imul(de,Oe)|0,g=g+Math.imul(le,Re)|0,a=a+Math.imul(le,Ne)|0,a=a+Math.imul(me,Re)|0,v=v+Math.imul(me,Ne)|0,g=g+Math.imul(pe,Be)|0,a=a+Math.imul(pe,Fe)|0,a=a+Math.imul(ge,Be)|0,v=v+Math.imul(ge,Fe)|0,g=g+Math.imul(ue,Le)|0,a=a+Math.imul(ue,qe)|0,a=a+Math.imul(ie,Le)|0,v=v+Math.imul(ie,qe)|0,g=g+Math.imul(oe,Ue)|0,a=a+Math.imul(oe,je)|0,a=a+Math.imul(ce,Ue)|0,v=v+Math.imul(ce,je)|0;var fr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(fr>>>26)|0,fr&=67108863,g=Math.imul(_e,Ie),a=Math.imul(_e,Me),a=a+Math.imul(we,Ie)|0,v=Math.imul(we,Me),g=g+Math.imul(xe,Pe)|0,a=a+Math.imul(xe,Oe)|0,a=a+Math.imul(Ee,Pe)|0,v=v+Math.imul(Ee,Oe)|0,g=g+Math.imul(ye,Re)|0,a=a+Math.imul(ye,Ne)|0,a=a+Math.imul(de,Re)|0,v=v+Math.imul(de,Ne)|0,g=g+Math.imul(le,Be)|0,a=a+Math.imul(le,Fe)|0,a=a+Math.imul(me,Be)|0,v=v+Math.imul(me,Fe)|0,g=g+Math.imul(pe,Le)|0,a=a+Math.imul(pe,qe)|0,a=a+Math.imul(ge,Le)|0,v=v+Math.imul(ge,qe)|0,g=g+Math.imul(ue,Ue)|0,a=a+Math.imul(ue,je)|0,a=a+Math.imul(ie,Ue)|0,v=v+Math.imul(ie,je)|0;var Yt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,g=Math.imul(_e,Pe),a=Math.imul(_e,Oe),a=a+Math.imul(we,Pe)|0,v=Math.imul(we,Oe),g=g+Math.imul(xe,Re)|0,a=a+Math.imul(xe,Ne)|0,a=a+Math.imul(Ee,Re)|0,v=v+Math.imul(Ee,Ne)|0,g=g+Math.imul(ye,Be)|0,a=a+Math.imul(ye,Fe)|0,a=a+Math.imul(de,Be)|0,v=v+Math.imul(de,Fe)|0,g=g+Math.imul(le,Le)|0,a=a+Math.imul(le,qe)|0,a=a+Math.imul(me,Le)|0,v=v+Math.imul(me,qe)|0,g=g+Math.imul(pe,Ue)|0,a=a+Math.imul(pe,je)|0,a=a+Math.imul(ge,Ue)|0,v=v+Math.imul(ge,je)|0;var dr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(dr>>>26)|0,dr&=67108863,g=Math.imul(_e,Re),a=Math.imul(_e,Ne),a=a+Math.imul(we,Re)|0,v=Math.imul(we,Ne),g=g+Math.imul(xe,Be)|0,a=a+Math.imul(xe,Fe)|0,a=a+Math.imul(Ee,Be)|0,v=v+Math.imul(Ee,Fe)|0,g=g+Math.imul(ye,Le)|0,a=a+Math.imul(ye,qe)|0,a=a+Math.imul(de,Le)|0,v=v+Math.imul(de,qe)|0,g=g+Math.imul(le,Ue)|0,a=a+Math.imul(le,je)|0,a=a+Math.imul(me,Ue)|0,v=v+Math.imul(me,je)|0;var rr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(rr>>>26)|0,rr&=67108863,g=Math.imul(_e,Be),a=Math.imul(_e,Fe),a=a+Math.imul(we,Be)|0,v=Math.imul(we,Fe),g=g+Math.imul(xe,Le)|0,a=a+Math.imul(xe,qe)|0,a=a+Math.imul(Ee,Le)|0,v=v+Math.imul(Ee,qe)|0,g=g+Math.imul(ye,Ue)|0,a=a+Math.imul(ye,je)|0,a=a+Math.imul(de,Ue)|0,v=v+Math.imul(de,je)|0;var nr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(nr>>>26)|0,nr&=67108863,g=Math.imul(_e,Le),a=Math.imul(_e,qe),a=a+Math.imul(we,Le)|0,v=Math.imul(we,qe),g=g+Math.imul(xe,Ue)|0,a=a+Math.imul(xe,je)|0,a=a+Math.imul(Ee,Ue)|0,v=v+Math.imul(Ee,je)|0;var hr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(hr>>>26)|0,hr&=67108863,g=Math.imul(_e,Ue),a=Math.imul(_e,je),a=a+Math.imul(we,Ue)|0,v=Math.imul(we,je);var xr=(w+g|0)+((a&8191)<<13)|0;return w=(v+(a>>>13)|0)+(xr>>>26)|0,xr&=67108863,b[0]=gr,b[1]=wt,b[2]=xt,b[3]=or,b[4]=yr,b[5]=lr,b[6]=vr,b[7]=br,b[8]=_r,b[9]=wr,b[10]=tr,b[11]=Wt,b[12]=fr,b[13]=Yt,b[14]=dr,b[15]=rr,b[16]=nr,b[17]=hr,b[18]=xr,w!==0&&(b[19]=w,p.length++),p};Math.imul||(M=R);function I(_,s,l){l.negative=s.negative^_.negative,l.length=_.length+s.length;for(var p=0,f=0,h=0;h>>26)|0,f+=b>>>26,b&=67108863}l.words[h]=w,p=b,b=f}return p!==0?l.words[h]=p:l.length--,l.strip()}function D(_,s,l){var p=new O;return p.mulp(_,s,l)}n.prototype.mulTo=function(s,l){var p,f=this.length+s.length;return this.length===10&&s.length===10?p=M(this,s,l):f<63?p=R(this,s,l):f<1024?p=I(this,s,l):p=D(this,s,l),p};function O(_,s){this.x=_,this.y=s}O.prototype.makeRBT=function(s){for(var l=new Array(s),p=n.prototype._countBits(s)-1,f=0;f>=1;return f},O.prototype.permute=function(s,l,p,f,h,b){for(var w=0;w>>1)h++;return 1<>>13,p[2*b+1]=h&8191,h=h>>>13;for(b=2*l;b>=26,l+=f/67108864|0,l+=h>>>26,this.words[p]=h&67108863}return l!==0&&(this.words[p]=l,this.length++),this},n.prototype.muln=function(s){return this.clone().imuln(s)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(s){var l=A(s);if(l.length===0)return new n(1);for(var p=this,f=0;f=0);var l=s%26,p=(s-l)/26,f=67108863>>>26-l<<26-l,h;if(l!==0){var b=0;for(h=0;h>>26-l}b&&(this.words[h]=b,this.length++)}if(p!==0){for(h=this.length-1;h>=0;h--)this.words[h+p]=this.words[h];for(h=0;h=0);var f;l?f=(l-l%26)/26:f=0;var h=s%26,b=Math.min((s-h)/26,this.length),w=67108863^67108863>>>h<b)for(this.length-=b,a=0;a=0&&(v!==0||a>=f);a--){var P=this.words[a]|0;this.words[a]=v<<26-h|P>>>h,v=P&w}return g&&v!==0&&(g.words[g.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(s,l,p){return r(this.negative===0),this.iushrn(s,l,p)},n.prototype.shln=function(s){return this.clone().ishln(s)},n.prototype.ushln=function(s){return this.clone().iushln(s)},n.prototype.shrn=function(s){return this.clone().ishrn(s)},n.prototype.ushrn=function(s){return this.clone().iushrn(s)},n.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,p=(s-l)/26,f=1<=0);var l=s%26,p=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(l!==0&&p++,this.length=Math.min(p,this.length),l!==0){var f=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},n.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(g/67108864|0),this.words[h+p]=b&67108863}for(;h>26,this.words[h+p]=b&67108863;if(w===0)return this.strip();for(r(w===-1),w=0,h=0;h>26,this.words[h]=b&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(s,l){var p=this.length-s.length,f=this.clone(),h=s,b=h.words[h.length-1]|0,w=this._countBits(b);p=26-w,p!==0&&(h=h.ushln(p),f.iushln(p),b=h.words[h.length-1]|0);var g=f.length-h.length,a;if(l!=="mod"){a=new n(null),a.length=g+1,a.words=new Array(a.length);for(var v=0;v=0;k--){var S=(f.words[h.length+k]|0)*67108864+(f.words[h.length+k-1]|0);for(S=Math.min(S/b|0,67108863),f._ishlnsubmul(h,S,k);f.negative!==0;)S--,f.negative=0,f._ishlnsubmul(h,1,k),f.isZero()||(f.negative^=1);a&&(a.words[k]=S)}return a&&a.strip(),f.strip(),l!=="div"&&p!==0&&f.iushrn(p),{div:a||null,mod:f}},n.prototype.divmod=function(s,l,p){if(r(!s.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,b;return this.negative!==0&&s.negative===0?(b=this.neg().divmod(s,l),l!=="mod"&&(f=b.div.neg()),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.iadd(s)),{div:f,mod:h}):this.negative===0&&s.negative!==0?(b=this.divmod(s.neg(),l),l!=="mod"&&(f=b.div.neg()),{div:f,mod:b.mod}):(this.negative&s.negative)!==0?(b=this.neg().divmod(s.neg(),l),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.isub(s)),{div:b.div,mod:h}):s.length>this.length||this.cmp(s)<0?{div:new n(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new n(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new n(this.modn(s.words[0]))}:this._wordDiv(s,l)},n.prototype.div=function(s){return this.divmod(s,"div",!1).div},n.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},n.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},n.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var p=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),h=s.andln(1),b=p.cmp(f);return b<0||h===1&&b===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},n.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,p=0,f=this.length-1;f>=0;f--)p=(l*p+(this.words[f]|0))%s;return p},n.prototype.idivn=function(s){r(s<=67108863);for(var l=0,p=this.length-1;p>=0;p--){var f=(this.words[p]|0)+l*67108864;this.words[p]=f/s|0,l=f%s}return this.strip()},n.prototype.divn=function(s){return this.clone().idivn(s)},n.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=new n(0),w=new n(1),g=0;l.isEven()&&p.isEven();)l.iushrn(1),p.iushrn(1),++g;for(var a=p.clone(),v=l.clone();!l.isZero();){for(var P=0,k=1;(l.words[0]&k)===0&&P<26;++P,k<<=1);if(P>0)for(l.iushrn(P);P-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(a),h.isub(v)),f.iushrn(1),h.iushrn(1);for(var S=0,B=1;(p.words[0]&B)===0&&S<26;++S,B<<=1);if(S>0)for(p.iushrn(S);S-- >0;)(b.isOdd()||w.isOdd())&&(b.iadd(a),w.isub(v)),b.iushrn(1),w.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(b),h.isub(w)):(p.isub(l),b.isub(f),w.isub(h))}return{a:b,b:w,gcd:p.iushln(g)}},n.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=p.clone();l.cmpn(1)>0&&p.cmpn(1)>0;){for(var w=0,g=1;(l.words[0]&g)===0&&w<26;++w,g<<=1);if(w>0)for(l.iushrn(w);w-- >0;)f.isOdd()&&f.iadd(b),f.iushrn(1);for(var a=0,v=1;(p.words[0]&v)===0&&a<26;++a,v<<=1);if(a>0)for(p.iushrn(a);a-- >0;)h.isOdd()&&h.iadd(b),h.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(h)):(p.isub(l),h.isub(f))}var P;return l.cmpn(1)===0?P=f:P=h,P.cmpn(0)<0&&P.iadd(s),P},n.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),p=s.clone();l.negative=0,p.negative=0;for(var f=0;l.isEven()&&p.isEven();f++)l.iushrn(1),p.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;p.isEven();)p.iushrn(1);var h=l.cmp(p);if(h<0){var b=l;l=p,p=b}else if(h===0||p.cmpn(1)===0)break;l.isub(p)}while(!0);return p.iushln(f)},n.prototype.invm=function(s){return this.egcd(s).a.umod(s)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(s){return this.words[0]&s},n.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,p=(s-l)/26,f=1<>>26,w&=67108863,this.words[b]=w}return h!==0&&(this.words[b]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var p;if(this.length>1)p=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;p=f===s?0:fs.length)return 1;if(this.length=0;p--){var f=this.words[p]|0,h=s.words[p]|0;if(f!==h){fh&&(l=1);break}}return l},n.prototype.gtn=function(s){return this.cmpn(s)===1},n.prototype.gt=function(s){return this.cmp(s)===1},n.prototype.gten=function(s){return this.cmpn(s)>=0},n.prototype.gte=function(s){return this.cmp(s)>=0},n.prototype.ltn=function(s){return this.cmpn(s)===-1},n.prototype.lt=function(s){return this.cmp(s)===-1},n.prototype.lten=function(s){return this.cmpn(s)<=0},n.prototype.lte=function(s){return this.cmp(s)<=0},n.prototype.eqn=function(s){return this.cmpn(s)===0},n.prototype.eq=function(s){return this.cmp(s)===0},n.red=function(s){return new q(s)},n.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(s){return this.red=s,this},n.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},n.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},n.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},n.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},n.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},n.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},n.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},n.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var N={k256:null,p224:null,p192:null,p25519:null};function L(_,s){this.name=_,this.p=new n(s,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var s=new n(null);return s.words=new Array(Math.ceil(this.n/13)),s},L.prototype.ireduce=function(s){var l=s,p;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),p=l.bitLength();while(p>this.n);var f=p0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},L.prototype.split=function(s,l){s.iushrn(this.n,0,l)},L.prototype.imulK=function(s){return s.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,L),j.prototype.split=function(s,l){for(var p=4194303,f=Math.min(s.length,9),h=0;h>>22,b=w}b>>>=22,s.words[h-10]=b,b===0&&s.length>10?s.length-=10:s.length-=9},j.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,p=0;p>>=26,s.words[p]=h,l=f}return l!==0&&(s.words[s.length++]=l),s},n._prime=function(s){if(N[s])return N[s];var l;if(s==="k256")l=new j;else if(s==="p224")l=new H;else if(s==="p192")l=new Y;else if(s==="p25519")l=new W;else throw new Error("Unknown prime "+s);return N[s]=l,l};function q(_){if(typeof _=="string"){var s=n._prime(_);this.m=s.p,this.prime=s}else r(_.gtn(1),"modulus must be greater than 1"),this.m=_,this.prime=null}q.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},q.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},q.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},q.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},q.prototype.add=function(s,l){this._verify2(s,l);var p=s.add(l);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},q.prototype.iadd=function(s,l){this._verify2(s,l);var p=s.iadd(l);return p.cmp(this.m)>=0&&p.isub(this.m),p},q.prototype.sub=function(s,l){this._verify2(s,l);var p=s.sub(l);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},q.prototype.isub=function(s,l){this._verify2(s,l);var p=s.isub(l);return p.cmpn(0)<0&&p.iadd(this.m),p},q.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},q.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},q.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},q.prototype.isqr=function(s){return this.imul(s,s.clone())},q.prototype.sqr=function(s){return this.mul(s,s)},q.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var p=this.m.add(new n(1)).iushrn(2);return this.pow(s,p)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);r(!f.isZero());var b=new n(1).toRed(this),w=b.redNeg(),g=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new n(2*a*a).toRed(this);this.pow(a,g).cmp(w)!==0;)a.redIAdd(w);for(var v=this.pow(a,f),P=this.pow(s,f.addn(1).iushrn(1)),k=this.pow(s,f),S=h;k.cmp(b)!==0;){for(var B=k,$=0;B.cmp(b)!==0;$++)B=B.redSqr();r($=0;h--){for(var v=l.words[h],P=a-1;P>=0;P--){var k=v>>P&1;if(b!==f[0]&&(b=this.sqr(b)),k===0&&w===0){g=0;continue}w<<=1,w|=k,g++,!(g!==p&&(h!==0||P!==0))&&(b=this.mul(b,f[w]),g=0,w=0)}a=26}return b},q.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},q.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},n.mont=function(s){return new J(s)};function J(_){q.call(this,_),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(J,q),J.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},J.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},J.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var p=s.imul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new n(0)._forceRed(this);var p=s.mul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof vC>"u"||vC,dF)});var bC=F(mF=>{"use strict";m();var Jv=mF;function a_e(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t!="string"){for(var i=0;i>8,c=n&255;o?r.push(o,c):r.push(c)}return r}Jv.toArray=a_e;function hF(t){return t.length===1?"0"+t:t}Jv.zero2=hF;function pF(t){for(var e="",r=0;r{"use strict";m();var Wo=gF,c_e=Ts(),u_e=Zi(),Xv=bC();Wo.assert=u_e;Wo.toArray=Xv.toArray;Wo.zero2=Xv.zero2;Wo.toHex=Xv.toHex;Wo.encode=Xv.encode;function l_e(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?u=(n>>1)-d:u=d,o.isubn(u)):u=0,i[c]=u,o.iushrn(1)}return i}Wo.getNAF=l_e;function f_e(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i=0,n=0,o;t.cmpn(-i)>0||e.cmpn(-n)>0;){var c=t.andln(3)+i&3,u=e.andln(3)+n&3;c===3&&(c=-1),u===3&&(u=-1);var d;(c&1)===0?d=0:(o=t.andln(7)+i&7,(o===3||o===5)&&u===2?d=-c:d=c),r[0].push(d);var y;(u&1)===0?y=0:(o=e.andln(7)+n&7,(o===3||o===5)&&c===2?y=-u:y=u),r[1].push(y),2*i===d+1&&(i=1-i),2*n===y+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return r}Wo.getJSF=f_e;function d_e(t,e,r){var i="_"+e;t.prototype[e]=function(){return this[i]!==void 0?this[i]:this[i]=r.call(this)}}Wo.cachedProperty=d_e;function h_e(t){return typeof t=="string"?Wo.toArray(t,"hex"):t}Wo.parseBytes=h_e;function p_e(t){return new c_e(t,"hex","le")}Wo.intFromLE=p_e});var Gm=F((cLe,yF)=>{"use strict";m();var bl=Ts(),$m=eo(),Zv=$m.getNAF,m_e=$m.getJSF,eb=$m.assert;function Ic(t,e){this.type=t,this.p=new bl(e.p,16),this.red=e.prime?bl.red(e.prime):bl.mont(this.p),this.zero=new bl(0).toRed(this.red),this.one=new bl(1).toRed(this.red),this.two=new bl(2).toRed(this.red),this.n=e.n&&new bl(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}yF.exports=Ic;Ic.prototype.point=function(){throw new Error("Not implemented")};Ic.prototype.validate=function(){throw new Error("Not implemented")};Ic.prototype._fixedNafMul=function(e,r){eb(e.precomputed);var i=e._getDoubles(),n=Zv(r,1,this._bitLength),o=(1<=u;y--)d=(d<<1)+n[y];c.push(d)}for(var E=this.jpoint(null,null,null),x=this.jpoint(null,null,null),A=o;A>0;A--){for(u=0;u=0;d--){for(var y=0;d>=0&&c[d]===0;d--)y++;if(d>=0&&y++,u=u.dblp(y),d<0)break;var E=c[d];eb(E!==0),e.type==="affine"?E>0?u=u.mixedAdd(o[E-1>>1]):u=u.mixedAdd(o[-E-1>>1].neg()):E>0?u=u.add(o[E-1>>1]):u=u.add(o[-E-1>>1].neg())}return e.type==="affine"?u.toP():u};Ic.prototype._wnafMulAdd=function(e,r,i,n,o){var c=this._wnafT1,u=this._wnafT2,d=this._wnafT3,y=0,E,x,A;for(E=0;E=1;E-=2){var M=E-1,I=E;if(c[M]!==1||c[I]!==1){d[M]=Zv(i[M],c[M],this._bitLength),d[I]=Zv(i[I],c[I],this._bitLength),y=Math.max(d[M].length,y),y=Math.max(d[I].length,y);continue}var D=[r[M],null,null,r[I]];r[M].y.cmp(r[I].y)===0?(D[1]=r[M].add(r[I]),D[2]=r[M].toJ().mixedAdd(r[I].neg())):r[M].y.cmp(r[I].y.redNeg())===0?(D[1]=r[M].toJ().mixedAdd(r[I]),D[2]=r[M].add(r[I].neg())):(D[1]=r[M].toJ().mixedAdd(r[I]),D[2]=r[M].toJ().mixedAdd(r[I].neg()));var O=[-3,-1,-5,-7,0,7,5,1,3],N=m_e(i[M],i[I]);for(y=Math.max(N[0].length,y),d[M]=new Array(y),d[I]=new Array(y),x=0;x=0;E--){for(var W=0;E>=0;){var q=!0;for(x=0;x=0&&W++,H=H.dblp(W),E<0)break;for(x=0;x0?A=u[x][J-1>>1]:J<0&&(A=u[x][-J-1>>1].neg()),A.type==="affine"?H=H.mixedAdd(A):H=H.add(A))}}for(E=0;E=Math.ceil((e.bitLength()+1)/r.step):!1};xo.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,o=0;o{"use strict";m();var g_e=eo(),fn=Ts(),_C=vt(),Pd=Gm(),y_e=g_e.assert;function Eo(t){Pd.call(this,"short",t),this.a=new fn(t.a,16).toRed(this.red),this.b=new fn(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}_C(Eo,Pd);vF.exports=Eo;Eo.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,i;if(e.beta)r=new fn(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);r=n[0].cmp(n[1])<0?n[0]:n[1],r=r.toRed(this.red)}if(e.lambda)i=new fn(e.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(r))===0?i=o[0]:(i=o[1],y_e(this.g.mul(i).x.cmp(this.g.x.redMul(r))===0))}var c;return e.basis?c=e.basis.map(function(u){return{a:new fn(u.a,16),b:new fn(u.b,16)}}):c=this._getEndoBasis(i),{beta:r,lambda:i,basis:c}}};Eo.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:fn.mont(e),i=new fn(2).toRed(r).redInvm(),n=i.redNeg(),o=new fn(3).toRed(r).redNeg().redSqrt().redMul(i),c=n.redAdd(o).fromRed(),u=n.redSub(o).fromRed();return[c,u]};Eo.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=e,n=this.n.clone(),o=new fn(1),c=new fn(0),u=new fn(0),d=new fn(1),y,E,x,A,R,M,I,D=0,O,N;i.cmpn(0)!==0;){var L=n.div(i);O=n.sub(L.mul(i)),N=u.sub(L.mul(o));var j=d.sub(L.mul(c));if(!x&&O.cmp(r)<0)y=I.neg(),E=o,x=O.neg(),A=N;else if(x&&++D===2)break;I=O,n=i,i=O,u=o,o=N,d=c,c=j}R=O.neg(),M=N;var H=x.sqr().add(A.sqr()),Y=R.sqr().add(M.sqr());return Y.cmp(H)>=0&&(R=y,M=E),x.negative&&(x=x.neg(),A=A.neg()),R.negative&&(R=R.neg(),M=M.neg()),[{a:x,b:A},{a:R,b:M}]};Eo.prototype._endoSplit=function(e){var r=this.endo.basis,i=r[0],n=r[1],o=n.b.mul(e).divRound(this.n),c=i.b.neg().mul(e).divRound(this.n),u=o.mul(i.a),d=c.mul(n.a),y=o.mul(i.b),E=c.mul(n.b),x=e.sub(u).sub(d),A=y.add(E).neg();return{k1:x,k2:A}};Eo.prototype.pointFromX=function(e,r){e=new fn(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var o=n.fromRed().isOdd();return(r&&!o||!r&&o)&&(n=n.redNeg()),this.point(e,n)};Eo.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,i=e.y,n=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(o).cmpn(0)===0};Eo.prototype._endoWnafMulAdd=function(e,r,i){for(var n=this._endoWnafT1,o=this._endoWnafT2,c=0;c":""};zn.prototype.isInfinity=function(){return this.inf};zn.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var i=r.redSqr().redISub(this.x).redISub(e.x),n=r.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)};zn.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),o=i.redAdd(i).redIAdd(i).redIAdd(r).redMul(n),c=o.redSqr().redISub(this.x.redAdd(this.x)),u=o.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,u)};zn.prototype.getX=function(){return this.x.fromRed()};zn.prototype.getY=function(){return this.y.fromRed()};zn.prototype.mul=function(e){return e=new fn(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};zn.prototype.mulAdd=function(e,r,i){var n=[this,r],o=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)};zn.prototype.jmulAdd=function(e,r,i){var n=[this,r],o=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)};zn.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};zn.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(o){return o.neg()};r.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return r};zn.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Zn(t,e,r,i){Pd.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new fn(0)):(this.x=new fn(e,16),this.y=new fn(r,16),this.z=new fn(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}_C(Zn,Pd.BasePoint);Eo.prototype.jpoint=function(e,r,i){return new Zn(this,e,r,i)};Zn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),i=this.x.redMul(r),n=this.y.redMul(r).redMul(e);return this.curve.point(i,n)};Zn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Zn.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(r),o=e.x.redMul(i),c=this.y.redMul(r.redMul(e.z)),u=e.y.redMul(i.redMul(this.z)),d=n.redSub(o),y=c.redSub(u);if(d.cmpn(0)===0)return y.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var E=d.redSqr(),x=E.redMul(d),A=n.redMul(E),R=y.redSqr().redIAdd(x).redISub(A).redISub(A),M=y.redMul(A.redISub(R)).redISub(c.redMul(x)),I=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,M,I)};Zn.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),i=this.x,n=e.x.redMul(r),o=this.y,c=e.y.redMul(r).redMul(this.z),u=i.redSub(n),d=o.redSub(c);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=u.redSqr(),E=y.redMul(u),x=i.redMul(y),A=d.redSqr().redIAdd(E).redISub(x).redISub(x),R=d.redMul(x.redISub(A)).redISub(o.redMul(E)),M=this.z.redMul(u);return this.curve.jpoint(A,R,M)};Zn.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var i=this;for(r=0;r=0)return!1;if(i.redIAdd(o),this.x.cmp(i)===0)return!0}};Zn.prototype.inspect=function(){return this.isInfinity()?"":""};Zn.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var xF=F((lLe,wF)=>{"use strict";m();var Nd=Ts(),_F=vt(),tb=Gm(),v_e=eo();function Bd(t){tb.call(this,"mont",t),this.a=new Nd(t.a,16).toRed(this.red),this.b=new Nd(t.b,16).toRed(this.red),this.i4=new Nd(4).toRed(this.red).redInvm(),this.two=new Nd(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}_F(Bd,tb);wF.exports=Bd;Bd.prototype.validate=function(e){var r=e.normalize().x,i=r.redSqr(),n=i.redMul(r).redAdd(i.redMul(this.a)).redAdd(r),o=n.redSqrt();return o.redSqr().cmp(n)===0};function Hn(t,e,r){tb.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Nd(e,16),this.z=new Nd(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}_F(Hn,tb.BasePoint);Bd.prototype.decodePoint=function(e,r){return this.point(v_e.toArray(e,r),1)};Bd.prototype.point=function(e,r){return new Hn(this,e,r)};Bd.prototype.pointFromJSON=function(e){return Hn.fromJSON(this,e)};Hn.prototype.precompute=function(){};Hn.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Hn.fromJSON=function(e,r){return new Hn(e,r[0],r[1]||e.one)};Hn.prototype.inspect=function(){return this.isInfinity()?"":""};Hn.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Hn.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),i=this.x.redSub(this.z),n=i.redSqr(),o=r.redSub(n),c=r.redMul(n),u=o.redMul(n.redAdd(this.curve.a24.redMul(o)));return this.curve.point(c,u)};Hn.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Hn.prototype.diffAdd=function(e,r){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),o=e.x.redAdd(e.z),c=e.x.redSub(e.z),u=c.redMul(i),d=o.redMul(n),y=r.z.redMul(u.redAdd(d).redSqr()),E=r.x.redMul(u.redISub(d).redSqr());return this.curve.point(y,E)};Hn.prototype.mul=function(e){for(var r=e.clone(),i=this,n=this.curve.point(null,null),o=this,c=[];r.cmpn(0)!==0;r.iushrn(1))c.push(r.andln(1));for(var u=c.length-1;u>=0;u--)c[u]===0?(i=i.diffAdd(n,o),n=n.dbl()):(n=i.diffAdd(n,o),i=i.dbl());return n};Hn.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Hn.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Hn.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};Hn.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Hn.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var CF=F((fLe,SF)=>{"use strict";m();var b_e=eo(),ba=Ts(),EF=vt(),rb=Gm(),__e=b_e.assert;function Ms(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,rb.call(this,"edwards",t),this.a=new ba(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new ba(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new ba(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),__e(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}EF(Ms,rb);SF.exports=Ms;Ms.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Ms.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Ms.prototype.jpoint=function(e,r,i,n){return this.point(e,r,i,n)};Ms.prototype.pointFromX=function(e,r){e=new ba(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),o=this.one.redSub(this.c2.redMul(this.d).redMul(i)),c=n.redMul(o.redInvm()),u=c.redSqrt();if(u.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");var d=u.fromRed().isOdd();return(r&&!d||!r&&d)&&(u=u.redNeg()),this.point(e,u)};Ms.prototype.pointFromY=function(e,r){e=new ba(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),o=i.redMul(this.d).redMul(this.c2).redSub(this.a),c=n.redMul(o.redInvm());if(c.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var u=c.redSqrt();if(u.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==r&&(u=u.redNeg()),this.point(u,e)};Ms.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),i=e.y.redSqr(),n=r.redMul(this.a).redAdd(i),o=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(i)));return n.cmp(o)===0};function jr(t,e,r,i,n){rb.BasePoint.call(this,t,"projective"),e===null&&r===null&&i===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new ba(e,16),this.y=new ba(r,16),this.z=i?new ba(i,16):this.curve.one,this.t=n&&new ba(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}EF(jr,rb.BasePoint);Ms.prototype.pointFromJSON=function(e){return jr.fromJSON(this,e)};Ms.prototype.point=function(e,r,i,n){return new jr(this,e,r,i,n)};jr.fromJSON=function(e,r){return new jr(e,r[0],r[1],r[2])};jr.prototype.inspect=function(){return this.isInfinity()?"":""};jr.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};jr.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),c=n.redAdd(r),u=c.redSub(i),d=n.redSub(r),y=o.redMul(u),E=c.redMul(d),x=o.redMul(d),A=u.redMul(c);return this.curve.point(y,E,A,x)};jr.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),i=this.y.redSqr(),n,o,c,u,d,y;if(this.curve.twisted){u=this.curve._mulA(r);var E=u.redAdd(i);this.zOne?(n=e.redSub(r).redSub(i).redMul(E.redSub(this.curve.two)),o=E.redMul(u.redSub(i)),c=E.redSqr().redSub(E).redSub(E)):(d=this.z.redSqr(),y=E.redSub(d).redISub(d),n=e.redSub(r).redISub(i).redMul(y),o=E.redMul(u.redSub(i)),c=E.redMul(y))}else u=r.redAdd(i),d=this.curve._mulC(this.z).redSqr(),y=u.redSub(d).redSub(d),n=this.curve._mulC(e.redISub(u)).redMul(y),o=this.curve._mulC(u).redMul(r.redISub(i)),c=u.redMul(y);return this.curve.point(n,o,c)};jr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};jr.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),c=i.redSub(r),u=o.redSub(n),d=o.redAdd(n),y=i.redAdd(r),E=c.redMul(u),x=d.redMul(y),A=c.redMul(y),R=u.redMul(d);return this.curve.point(E,x,R,A)};jr.prototype._projAdd=function(e){var r=this.z.redMul(e.z),i=r.redSqr(),n=this.x.redMul(e.x),o=this.y.redMul(e.y),c=this.curve.d.redMul(n).redMul(o),u=i.redSub(c),d=i.redAdd(c),y=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(o),E=r.redMul(u).redMul(y),x,A;return this.curve.twisted?(x=r.redMul(d).redMul(o.redSub(this.curve._mulA(n))),A=u.redMul(d)):(x=r.redMul(d).redMul(o.redSub(n)),A=this.curve._mulC(u).redMul(d)),this.curve.point(E,x,A)};jr.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};jr.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};jr.prototype.mulAdd=function(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!1)};jr.prototype.jmulAdd=function(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!0)};jr.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};jr.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};jr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};jr.prototype.getY=function(){return this.normalize(),this.y.fromRed()};jr.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};jr.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),this.x.cmp(r)===0)return!0}};jr.prototype.toP=jr.prototype.normalize;jr.prototype.mixedAdd=jr.prototype.add});var wC=F(AF=>{"use strict";m();var nb=AF;nb.base=Gm();nb.short=bF();nb.mont=xF();nb.edwards=CF()});var Yo=F(Br=>{"use strict";m();var w_e=Zi(),x_e=vt();Br.inherits=x_e;function E_e(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function S_e(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),n=0;n>6|192,r[i++]=o&63|128):E_e(t,n)?(o=65536+((o&1023)<<10)+(t.charCodeAt(++n)&1023),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=o&63|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=o&63|128)}else for(n=0;n>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Br.htonl=TF;function A_e(t,e){for(var r="",i=0;i>>0}return o}Br.join32=T_e;function M_e(t,e){for(var r=new Array(t.length*4),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=o&255):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=o&255)}return r}Br.split32=M_e;function R_e(t,e){return t>>>e|t<<32-e}Br.rotr32=R_e;function D_e(t,e){return t<>>32-e}Br.rotl32=D_e;function k_e(t,e){return t+e>>>0}Br.sum32=k_e;function I_e(t,e,r){return t+e+r>>>0}Br.sum32_3=I_e;function O_e(t,e,r,i){return t+e+r+i>>>0}Br.sum32_4=O_e;function P_e(t,e,r,i,n){return t+e+r+i+n>>>0}Br.sum32_5=P_e;function N_e(t,e,r,i){var n=t[e],o=t[e+1],c=i+o>>>0,u=(c>>0,t[e+1]=c}Br.sum64=N_e;function B_e(t,e,r,i){var n=e+i>>>0,o=(n>>0}Br.sum64_hi=B_e;function F_e(t,e,r,i){var n=e+i;return n>>>0}Br.sum64_lo=F_e;function L_e(t,e,r,i,n,o,c,u){var d=0,y=e;y=y+i>>>0,d+=y>>0,d+=y>>0,d+=y>>0}Br.sum64_4_hi=L_e;function q_e(t,e,r,i,n,o,c,u){var d=e+i+o+u;return d>>>0}Br.sum64_4_lo=q_e;function U_e(t,e,r,i,n,o,c,u,d,y){var E=0,x=e;x=x+i>>>0,E+=x>>0,E+=x>>0,E+=x>>0,E+=x>>0}Br.sum64_5_hi=U_e;function j_e(t,e,r,i,n,o,c,u,d,y){var E=e+i+o+u+y;return E>>>0}Br.sum64_5_lo=j_e;function z_e(t,e,r){var i=e<<32-r|t>>>r;return i>>>0}Br.rotr64_hi=z_e;function H_e(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}Br.rotr64_lo=H_e;function $_e(t,e,r){return t>>>r}Br.shr64_hi=$_e;function G_e(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}Br.shr64_lo=G_e});var Fd=F(kF=>{"use strict";m();var DF=Yo(),K_e=Zi();function ib(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}kF.BlockHash=ib;ib.prototype.update=function(e,r){if(e=DF.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var i=e.length%this._delta8;this.pending=e.slice(e.length-i,e.length),this.pending.length===0&&(this.pending=null),e=DF.join32(e,0,e.length-i,this.endian);for(var n=0;n>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=e&255}else for(n[o++]=e&255,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,c=8;c{"use strict";m();var V_e=Yo(),Rs=V_e.rotr32;function W_e(t,e,r,i){if(t===0)return IF(e,r,i);if(t===1||t===3)return PF(e,r,i);if(t===2)return OF(e,r,i)}_a.ft_1=W_e;function IF(t,e,r){return t&e^~t&r}_a.ch32=IF;function OF(t,e,r){return t&e^t&r^e&r}_a.maj32=OF;function PF(t,e,r){return t^e^r}_a.p32=PF;function Y_e(t){return Rs(t,2)^Rs(t,13)^Rs(t,22)}_a.s0_256=Y_e;function Q_e(t){return Rs(t,6)^Rs(t,11)^Rs(t,25)}_a.s1_256=Q_e;function J_e(t){return Rs(t,7)^Rs(t,18)^t>>>3}_a.g0_256=J_e;function X_e(t){return Rs(t,17)^Rs(t,19)^t>>>10}_a.g1_256=X_e});var FF=F((gLe,BF)=>{"use strict";m();var Ld=Yo(),Z_e=Fd(),e1e=xC(),EC=Ld.rotl32,Km=Ld.sum32,t1e=Ld.sum32_5,r1e=e1e.ft_1,NF=Z_e.BlockHash,n1e=[1518500249,1859775393,2400959708,3395469782];function Ds(){if(!(this instanceof Ds))return new Ds;NF.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ld.inherits(Ds,NF);BF.exports=Ds;Ds.blockSize=512;Ds.outSize=160;Ds.hmacStrength=80;Ds.padLength=64;Ds.prototype._update=function(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n{"use strict";m();var qd=Yo(),i1e=Fd(),Ud=xC(),o1e=Zi(),Qo=qd.sum32,s1e=qd.sum32_4,a1e=qd.sum32_5,c1e=Ud.ch32,u1e=Ud.maj32,l1e=Ud.s0_256,f1e=Ud.s1_256,d1e=Ud.g0_256,h1e=Ud.g1_256,LF=i1e.BlockHash,p1e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function ks(){if(!(this instanceof ks))return new ks;LF.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p1e,this.W=new Array(64)}qd.inherits(ks,LF);qF.exports=ks;ks.blockSize=512;ks.outSize=256;ks.hmacStrength=192;ks.padLength=64;ks.prototype._update=function(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n{"use strict";m();var CC=Yo(),UF=SC();function wa(){if(!(this instanceof wa))return new wa;UF.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}CC.inherits(wa,UF);jF.exports=wa;wa.blockSize=512;wa.outSize=224;wa.hmacStrength=192;wa.padLength=64;wa.prototype._digest=function(e){return e==="hex"?CC.toHex32(this.h.slice(0,7),"big"):CC.split32(this.h.slice(0,7),"big")}});var MC=F((bLe,KF)=>{"use strict";m();var Li=Yo(),m1e=Fd(),g1e=Zi(),Is=Li.rotr64_hi,Os=Li.rotr64_lo,HF=Li.shr64_hi,$F=Li.shr64_lo,Oc=Li.sum64,AC=Li.sum64_hi,TC=Li.sum64_lo,y1e=Li.sum64_4_hi,v1e=Li.sum64_4_lo,b1e=Li.sum64_5_hi,_1e=Li.sum64_5_lo,GF=m1e.BlockHash,w1e=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Jo(){if(!(this instanceof Jo))return new Jo;GF.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=w1e,this.W=new Array(160)}Li.inherits(Jo,GF);KF.exports=Jo;Jo.blockSize=1024;Jo.outSize=512;Jo.hmacStrength=192;Jo.padLength=128;Jo.prototype._prepareBlock=function(e,r){for(var i=this.W,n=0;n<32;n++)i[n]=e[r+n];for(;n{"use strict";m();var RC=Yo(),VF=MC();function xa(){if(!(this instanceof xa))return new xa;VF.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}RC.inherits(xa,VF);WF.exports=xa;xa.blockSize=1024;xa.outSize=384;xa.hmacStrength=192;xa.padLength=128;xa.prototype._digest=function(e){return e==="hex"?RC.toHex32(this.h.slice(0,12),"big"):RC.split32(this.h.slice(0,12),"big")}});var QF=F(jd=>{"use strict";m();jd.sha1=FF();jd.sha224=zF();jd.sha256=SC();jd.sha384=YF();jd.sha512=MC()});var r9=F(t9=>{"use strict";m();var _l=Yo(),P1e=Fd(),ob=_l.rotl32,JF=_l.sum32,Vm=_l.sum32_3,XF=_l.sum32_4,e9=P1e.BlockHash;function Ps(){if(!(this instanceof Ps))return new Ps;e9.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}_l.inherits(Ps,e9);t9.ripemd160=Ps;Ps.blockSize=512;Ps.outSize=160;Ps.hmacStrength=192;Ps.padLength=64;Ps.prototype._update=function(e,r){for(var i=this.h[0],n=this.h[1],o=this.h[2],c=this.h[3],u=this.h[4],d=i,y=n,E=o,x=c,A=u,R=0;R<80;R++){var M=JF(ob(XF(i,ZF(R,n,o,c),e[F1e[R]+r],N1e(R)),q1e[R]),u);i=u,u=c,c=ob(o,10),o=n,n=M,M=JF(ob(XF(d,ZF(79-R,y,E,x),e[L1e[R]+r],B1e(R)),U1e[R]),A),d=A,A=x,x=ob(E,10),E=y,y=M}M=Vm(this.h[1],o,x),this.h[1]=Vm(this.h[2],c,A),this.h[2]=Vm(this.h[3],u,d),this.h[3]=Vm(this.h[4],i,y),this.h[4]=Vm(this.h[0],n,E),this.h[0]=M};Ps.prototype._digest=function(e){return e==="hex"?_l.toHex32(this.h,"little"):_l.split32(this.h,"little")};function ZF(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function N1e(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function B1e(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var F1e=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],L1e=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],q1e=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],U1e=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var i9=F((ELe,n9)=>{"use strict";m();var j1e=Yo(),z1e=Zi();function zd(t,e,r){if(!(this instanceof zd))return new zd(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(j1e.toArray(e,r))}n9.exports=zd;zd.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),z1e(e.length<=this.blockSize);for(var r=e.length;r{m();var ei=o9;ei.utils=Yo();ei.common=Fd();ei.sha=QF();ei.ripemd=r9();ei.hmac=i9();ei.sha1=ei.sha.sha1;ei.sha256=ei.sha.sha256;ei.sha224=ei.sha.sha224;ei.sha384=ei.sha.sha384;ei.sha512=ei.sha.sha512;ei.ripemd160=ei.ripemd.ripemd160});var a9=F((CLe,s9)=>{m();s9.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var ab=F(l9=>{"use strict";m();var kC=l9,Pc=sb(),DC=wC(),H1e=eo(),c9=H1e.assert;function u9(t){t.type==="short"?this.curve=new DC.short(t):t.type==="edwards"?this.curve=new DC.edwards(t):this.curve=new DC.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,c9(this.g.validate(),"Invalid curve"),c9(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}kC.PresetCurve=u9;function Nc(t,e){Object.defineProperty(kC,t,{configurable:!0,enumerable:!0,get:function(){var r=new u9(e);return Object.defineProperty(kC,t,{configurable:!0,enumerable:!0,value:r}),r}})}Nc("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Pc.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Nc("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Pc.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Nc("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Pc.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Nc("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Pc.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});Nc("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Pc.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});Nc("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Pc.sha256,gRed:!1,g:["9"]});Nc("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Pc.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var IC;try{IC=a9()}catch{IC=void 0}Nc("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Pc.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",IC]})});var h9=F((TLe,d9)=>{"use strict";m();var $1e=sb(),wl=bC(),f9=Zi();function Bc(t){if(!(this instanceof Bc))return new Bc(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=wl.toArray(t.entropy,t.entropyEnc||"hex"),r=wl.toArray(t.nonce,t.nonceEnc||"hex"),i=wl.toArray(t.pers,t.persEnc||"hex");f9(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}d9.exports=Bc;Bc.prototype._init=function(e,r,i){var n=e.concat(r).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1};Bc.prototype.generate=function(e,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(n=i,i=r,r=null),i&&(i=wl.toArray(i,n||"hex"),this._update(i));for(var o=[];o.length{"use strict";m();var G1e=Ts(),K1e=eo(),OC=K1e.assert;function di(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}p9.exports=di;di.fromPublic=function(e,r,i){return r instanceof di?r:new di(e,{pub:r,pubEnc:i})};di.fromPrivate=function(e,r,i){return r instanceof di?r:new di(e,{priv:r,privEnc:i})};di.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};di.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};di.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};di.prototype._importPrivate=function(e,r){this.priv=new G1e(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};di.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?OC(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&OC(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};di.prototype.derive=function(e){return e.validate()||OC(e.validate(),"public point not validated"),e.mul(this.priv).getX()};di.prototype.sign=function(e,r,i){return this.ec.sign(e,this,r,i)};di.prototype.verify=function(e,r){return this.ec.verify(e,r,this)};di.prototype.inspect=function(){return""}});var v9=F((RLe,y9)=>{"use strict";m();var cb=Ts(),BC=eo(),V1e=BC.assert;function ub(t,e){if(t instanceof ub)return t;this._importDER(t,e)||(V1e(t.r&&t.s,"Signature without r or s"),this.r=new cb(t.r,16),this.s=new cb(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}y9.exports=ub;function W1e(){this.place=0}function PC(t,e){var r=t[e.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4)return!1;for(var n=0,o=0,c=e.place;o>>=0;return n<=127?!1:(e.place=c,n)}function g9(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}ub.prototype.toDER=function(e){var r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=g9(r),i=g9(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];NC(n,r.length),n=n.concat(r),n.push(2),NC(n,i.length);var o=n.concat(i),c=[48];return NC(c,o.length),c=c.concat(o),BC.encode(c,e)}});var x9=F((DLe,w9)=>{"use strict";m();var xl=Ts(),b9=h9(),Y1e=eo(),FC=ab(),Q1e=Iv(),_9=Y1e.assert,LC=m9(),lb=v9();function So(t){if(!(this instanceof So))return new So(t);typeof t=="string"&&(_9(Object.prototype.hasOwnProperty.call(FC,t),"Unknown curve "+t),t=FC[t]),t instanceof FC.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}w9.exports=So;So.prototype.keyPair=function(e){return new LC(this,e)};So.prototype.keyFromPrivate=function(e,r){return LC.fromPrivate(this,e,r)};So.prototype.keyFromPublic=function(e,r){return LC.fromPublic(this,e,r)};So.prototype.genKeyPair=function(e){e||(e={});for(var r=new b9({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Q1e(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new xl(2));;){var o=new xl(r.generate(i));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}};So.prototype._truncateToN=function(e,r){var i=e.byteLength()*8-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};So.prototype.sign=function(e,r,i,n){typeof i=="object"&&(n=i,i=null),n||(n={}),r=this.keyFromPrivate(r,i),e=this._truncateToN(new xl(e,16));for(var o=this.n.byteLength(),c=r.getPrivate().toArray("be",o),u=e.toArray("be",o),d=new b9({hash:this.hash,entropy:c,nonce:u,pers:n.pers,persEnc:n.persEnc||"utf8"}),y=this.n.sub(new xl(1)),E=0;;E++){var x=n.k?n.k(E):new xl(d.generate(this.n.byteLength()));if(x=this._truncateToN(x,!0),!(x.cmpn(1)<=0||x.cmp(y)>=0)){var A=this.g.mul(x);if(!A.isInfinity()){var R=A.getX(),M=R.umod(this.n);if(M.cmpn(0)!==0){var I=x.invm(this.n).mul(M.mul(r.getPrivate()).iadd(e));if(I=I.umod(this.n),I.cmpn(0)!==0){var D=(A.getY().isOdd()?1:0)|(R.cmp(M)!==0?2:0);return n.canonical&&I.cmp(this.nh)>0&&(I=this.n.sub(I),D^=1),new lb({r:M,s:I,recoveryParam:D})}}}}}};So.prototype.verify=function(e,r,i,n){e=this._truncateToN(new xl(e,16)),i=this.keyFromPublic(i,n),r=new lb(r,"hex");var o=r.r,c=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var u=c.invm(this.n),d=u.mul(e).umod(this.n),y=u.mul(o).umod(this.n),E;return this.curve._maxwellTrick?(E=this.g.jmulAdd(d,i.getPublic(),y),E.isInfinity()?!1:E.eqXToP(o)):(E=this.g.mulAdd(d,i.getPublic(),y),E.isInfinity()?!1:E.getX().umod(this.n).cmp(o)===0)};So.prototype.recoverPubKey=function(t,e,r,i){_9((3&r)===r,"The recovery param is more than two bits"),e=new lb(e,i);var n=this.n,o=new xl(t),c=e.r,u=e.s,d=r&1,y=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&y)throw new Error("Unable to find sencond key candinate");y?c=this.curve.pointFromX(c.add(this.curve.n),d):c=this.curve.pointFromX(c,d);var E=e.r.invm(n),x=n.sub(o).mul(E).umod(n),A=u.mul(E).umod(n);return this.g.mulAdd(x,c,A)};So.prototype.getKeyRecoveryParam=function(t,e,r,i){if(e=new lb(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch{continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}});var A9=F((kLe,C9)=>{"use strict";m();var Wm=eo(),S9=Wm.assert,E9=Wm.parseBytes,Hd=Wm.cachedProperty;function $n(t,e){this.eddsa=t,this._secret=E9(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=E9(e.pub)}$n.fromPublic=function(e,r){return r instanceof $n?r:new $n(e,{pub:r})};$n.fromSecret=function(e,r){return r instanceof $n?r:new $n(e,{secret:r})};$n.prototype.secret=function(){return this._secret};Hd($n,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Hd($n,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Hd($n,"privBytes",function(){var e=this.eddsa,r=this.hash(),i=e.encodingLength-1,n=r.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n});Hd($n,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Hd($n,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Hd($n,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});$n.prototype.sign=function(e){return S9(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};$n.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};$n.prototype.getSecret=function(e){return S9(this._secret,"KeyPair is public only"),Wm.encode(this.secret(),e)};$n.prototype.getPublic=function(e){return Wm.encode(this.pubBytes(),e)};C9.exports=$n});var M9=F((ILe,T9)=>{"use strict";m();var J1e=Ts(),fb=eo(),X1e=fb.assert,db=fb.cachedProperty,Z1e=fb.parseBytes;function El(t,e){this.eddsa=t,typeof e!="object"&&(e=Z1e(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),X1e(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof J1e&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}db(El,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});db(El,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});db(El,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});db(El,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});El.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};El.prototype.toHex=function(){return fb.encode(this.toBytes(),"hex").toUpperCase()};T9.exports=El});var O9=F((OLe,I9)=>{"use strict";m();var ewe=sb(),twe=ab(),$d=eo(),rwe=$d.assert,D9=$d.parseBytes,k9=A9(),R9=M9();function qi(t){if(rwe(t==="ed25519","only tested with ed25519 so far"),!(this instanceof qi))return new qi(t);t=twe[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=ewe.sha512}I9.exports=qi;qi.prototype.sign=function(e,r){e=D9(e);var i=this.keyFromSecret(r),n=this.hashInt(i.messagePrefix(),e),o=this.g.mul(n),c=this.encodePoint(o),u=this.hashInt(c,i.pubBytes(),e).mul(i.priv()),d=n.add(u).umod(this.curve.n);return this.makeSignature({R:o,S:d,Rencoded:c})};qi.prototype.verify=function(e,r,i){e=D9(e),r=this.makeSignature(r);var n=this.keyFromPublic(i),o=this.hashInt(r.Rencoded(),n.pubBytes(),e),c=this.g.mul(r.S()),u=r.R().add(n.pub().mul(o));return u.eq(c)};qi.prototype.hashInt=function(){for(var e=this.hash(),r=0;r{"use strict";m();var Sl=P9;Sl.version=fF().version;Sl.utils=eo();Sl.rand=Iv();Sl.curve=wC();Sl.curves=ab();Sl.ec=x9();Sl.eddsa=O9()});var UC=F((N9,qC)=>{m();(function(t,e){"use strict";function r(_,s){if(!_)throw new Error(s||"Assertion failed")}function i(_,s){_.super_=s;var l=function(){};l.prototype=s.prototype,_.prototype=new l,_.prototype.constructor=_}function n(_,s,l){if(n.isBN(_))return _;this.negative=0,this.words=null,this.length=0,this.red=null,_!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(_||0,s||10,l||"be"))}typeof t=="object"?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ac().Buffer}catch{}n.isBN=function(s){return s instanceof n?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===n.wordSize&&Array.isArray(s.words)},n.max=function(s,l){return s.cmp(l)>0?s:l},n.min=function(s,l){return s.cmp(l)<0?s:l},n.prototype._init=function(s,l,p){if(typeof s=="number")return this._initNumber(s,l,p);if(typeof s=="object")return this._initArray(s,l,p);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f=0;f-=3)b=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[h]|=b<>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);else if(p==="le")for(f=0,h=0;f>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);return this.strip()};function c(_,s){var l=_.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function u(_,s,l){var p=c(_,l);return l-1>=s&&(p|=c(_,l-1)<<4),p}n.prototype._parseHex=function(s,l,p){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f=l;f-=2)w=u(s,l,f)<=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8;else{var g=s.length-l;for(f=g%2===0?l+1:l;f=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8}this.strip()};function d(_,s,l,p){for(var f=0,h=Math.min(_.length,l),b=s;b=49?f+=w-49+10:w>=17?f+=w-17+10:f+=w}return f}n.prototype._parseBase=function(s,l,p){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=l)f++;f--,h=h/l|0;for(var b=s.length-p,w=b%f,g=Math.min(b,b-w)+p,a=0,v=p;v1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(s,l){s=s||10,l=l|0||1;var p;if(s===16||s==="hex"){p="";for(var f=0,h=0,b=0;b>>24-f&16777215,h!==0||b!==this.length-1?p=y[6-g.length]+g+p:p=g+p,f+=2,f>=26&&(f-=26,b--)}for(h!==0&&(p=h.toString(16)+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(s===(s|0)&&s>=2&&s<=36){var a=E[s],v=x[s];p="";var P=this.clone();for(P.negative=0;!P.isZero();){var k=P.modn(v).toString(s);P=P.idivn(v),P.isZero()?p=k+p:p=y[a-k.length]+k+p}for(this.isZero()&&(p="0"+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},n.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},n.prototype.toArrayLike=function(s,l,p){var f=this.byteLength(),h=p||Math.max(1,f);r(f<=h,"byte array longer than desired length"),r(h>0,"Requested array length <= 0"),this.strip();var b=l==="le",w=new s(h),g,a,v=this.clone();if(b){for(a=0;!v.isZero();a++)g=v.andln(255),v.iushrn(8),w[a]=g;for(;a=4096&&(p+=13,l>>>=13),l>=64&&(p+=7,l>>>=7),l>=8&&(p+=4,l>>>=4),l>=2&&(p+=2,l>>>=2),p+l},n.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,p=0;return(l&8191)===0&&(p+=13,l>>>=13),(l&127)===0&&(p+=7,l>>>=7),(l&15)===0&&(p+=4,l>>>=4),(l&3)===0&&(p+=2,l>>>=2),(l&1)===0&&p++,p},n.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function A(_){for(var s=new Array(_.bitLength()),l=0;l>>f}return s}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;ls.length?this.clone().ior(s):s.clone().ior(this)},n.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},n.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var p=0;ps.length?this.clone().iand(s):s.clone().iand(this)},n.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},n.prototype.iuxor=function(s){var l,p;this.length>s.length?(l=this,p=s):(l=s,p=this);for(var f=0;fs.length?this.clone().ixor(s):s.clone().ixor(this)},n.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},n.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,p=s%26;this._expand(l),p>0&&l--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-p),this.strip()},n.prototype.notn=function(s){return this.clone().inotn(s)},n.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var p=s/26|0,f=s%26;return this._expand(p+1),l?this.words[p]=this.words[p]|1<s.length?(p=this,f=s):(p=s,f=this);for(var h=0,b=0;b>>26;for(;h!==0&&b>>26;if(this.length=p.length,h!==0)this.words[this.length]=h,this.length++;else if(p!==this)for(;bs.length?this.clone().iadd(s):s.clone().iadd(this)},n.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var p=this.cmp(s);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;p>0?(f=this,h=s):(f=s,h=this);for(var b=0,w=0;w>26,this.words[w]=l&67108863;for(;b!==0&&w>26,this.words[w]=l&67108863;if(b===0&&w>>26,P=g&67108863,k=Math.min(a,s.length-1),S=Math.max(0,a-_.length+1);S<=k;S++){var B=a-S|0;f=_.words[B]|0,h=s.words[S]|0,b=f*h+P,v+=b/67108864|0,P=b&67108863}l.words[a]=P|0,g=v|0}return g!==0?l.words[a]=g|0:l.length--,l.strip()}var M=function(s,l,p){var f=s.words,h=l.words,b=p.words,w=0,g,a,v,P=f[0]|0,k=P&8191,S=P>>>13,B=f[1]|0,$=B&8191,K=B>>>13,he=f[2]|0,X=he&8191,Z=he>>>13,it=f[3]|0,oe=it&8191,ce=it>>>13,Rt=f[4]|0,ue=Rt&8191,ie=Rt>>>13,bt=f[5]|0,pe=bt&8191,ge=bt>>>13,Ct=f[6]|0,le=Ct&8191,me=Ct>>>13,Ht=f[7]|0,ye=Ht&8191,de=Ht>>>13,Mr=f[8]|0,xe=Mr&8191,Ee=Mr>>>13,Ir=f[9]|0,_e=Ir&8191,we=Ir>>>13,Lr=h[0]|0,De=Lr&8191,Ce=Lr>>>13,$r=h[1]|0,Ae=$r&8191,ke=$r>>>13,Lt=h[2]|0,be=Lt&8191,Te=Lt>>>13,Yr=h[3]|0,ve=Yr&8191,Se=Yr>>>13,Qr=h[4]|0,Ie=Qr&8191,Me=Qr>>>13,Jr=h[5]|0,Pe=Jr&8191,Oe=Jr>>>13,Xr=h[6]|0,Re=Xr&8191,Ne=Xr>>>13,Zr=h[7]|0,Be=Zr&8191,Fe=Zr>>>13,Gr=h[8]|0,Le=Gr&8191,qe=Gr>>>13,en=h[9]|0,Ue=en&8191,je=en>>>13;p.negative=s.negative^l.negative,p.length=19,g=Math.imul(k,De),a=Math.imul(k,Ce),a=a+Math.imul(S,De)|0,v=Math.imul(S,Ce);var gr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(gr>>>26)|0,gr&=67108863,g=Math.imul($,De),a=Math.imul($,Ce),a=a+Math.imul(K,De)|0,v=Math.imul(K,Ce),g=g+Math.imul(k,Ae)|0,a=a+Math.imul(k,ke)|0,a=a+Math.imul(S,Ae)|0,v=v+Math.imul(S,ke)|0;var wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,g=Math.imul(X,De),a=Math.imul(X,Ce),a=a+Math.imul(Z,De)|0,v=Math.imul(Z,Ce),g=g+Math.imul($,Ae)|0,a=a+Math.imul($,ke)|0,a=a+Math.imul(K,Ae)|0,v=v+Math.imul(K,ke)|0,g=g+Math.imul(k,be)|0,a=a+Math.imul(k,Te)|0,a=a+Math.imul(S,be)|0,v=v+Math.imul(S,Te)|0;var xt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,g=Math.imul(oe,De),a=Math.imul(oe,Ce),a=a+Math.imul(ce,De)|0,v=Math.imul(ce,Ce),g=g+Math.imul(X,Ae)|0,a=a+Math.imul(X,ke)|0,a=a+Math.imul(Z,Ae)|0,v=v+Math.imul(Z,ke)|0,g=g+Math.imul($,be)|0,a=a+Math.imul($,Te)|0,a=a+Math.imul(K,be)|0,v=v+Math.imul(K,Te)|0,g=g+Math.imul(k,ve)|0,a=a+Math.imul(k,Se)|0,a=a+Math.imul(S,ve)|0,v=v+Math.imul(S,Se)|0;var or=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(or>>>26)|0,or&=67108863,g=Math.imul(ue,De),a=Math.imul(ue,Ce),a=a+Math.imul(ie,De)|0,v=Math.imul(ie,Ce),g=g+Math.imul(oe,Ae)|0,a=a+Math.imul(oe,ke)|0,a=a+Math.imul(ce,Ae)|0,v=v+Math.imul(ce,ke)|0,g=g+Math.imul(X,be)|0,a=a+Math.imul(X,Te)|0,a=a+Math.imul(Z,be)|0,v=v+Math.imul(Z,Te)|0,g=g+Math.imul($,ve)|0,a=a+Math.imul($,Se)|0,a=a+Math.imul(K,ve)|0,v=v+Math.imul(K,Se)|0,g=g+Math.imul(k,Ie)|0,a=a+Math.imul(k,Me)|0,a=a+Math.imul(S,Ie)|0,v=v+Math.imul(S,Me)|0;var yr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(yr>>>26)|0,yr&=67108863,g=Math.imul(pe,De),a=Math.imul(pe,Ce),a=a+Math.imul(ge,De)|0,v=Math.imul(ge,Ce),g=g+Math.imul(ue,Ae)|0,a=a+Math.imul(ue,ke)|0,a=a+Math.imul(ie,Ae)|0,v=v+Math.imul(ie,ke)|0,g=g+Math.imul(oe,be)|0,a=a+Math.imul(oe,Te)|0,a=a+Math.imul(ce,be)|0,v=v+Math.imul(ce,Te)|0,g=g+Math.imul(X,ve)|0,a=a+Math.imul(X,Se)|0,a=a+Math.imul(Z,ve)|0,v=v+Math.imul(Z,Se)|0,g=g+Math.imul($,Ie)|0,a=a+Math.imul($,Me)|0,a=a+Math.imul(K,Ie)|0,v=v+Math.imul(K,Me)|0,g=g+Math.imul(k,Pe)|0,a=a+Math.imul(k,Oe)|0,a=a+Math.imul(S,Pe)|0,v=v+Math.imul(S,Oe)|0;var lr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(lr>>>26)|0,lr&=67108863,g=Math.imul(le,De),a=Math.imul(le,Ce),a=a+Math.imul(me,De)|0,v=Math.imul(me,Ce),g=g+Math.imul(pe,Ae)|0,a=a+Math.imul(pe,ke)|0,a=a+Math.imul(ge,Ae)|0,v=v+Math.imul(ge,ke)|0,g=g+Math.imul(ue,be)|0,a=a+Math.imul(ue,Te)|0,a=a+Math.imul(ie,be)|0,v=v+Math.imul(ie,Te)|0,g=g+Math.imul(oe,ve)|0,a=a+Math.imul(oe,Se)|0,a=a+Math.imul(ce,ve)|0,v=v+Math.imul(ce,Se)|0,g=g+Math.imul(X,Ie)|0,a=a+Math.imul(X,Me)|0,a=a+Math.imul(Z,Ie)|0,v=v+Math.imul(Z,Me)|0,g=g+Math.imul($,Pe)|0,a=a+Math.imul($,Oe)|0,a=a+Math.imul(K,Pe)|0,v=v+Math.imul(K,Oe)|0,g=g+Math.imul(k,Re)|0,a=a+Math.imul(k,Ne)|0,a=a+Math.imul(S,Re)|0,v=v+Math.imul(S,Ne)|0;var vr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(vr>>>26)|0,vr&=67108863,g=Math.imul(ye,De),a=Math.imul(ye,Ce),a=a+Math.imul(de,De)|0,v=Math.imul(de,Ce),g=g+Math.imul(le,Ae)|0,a=a+Math.imul(le,ke)|0,a=a+Math.imul(me,Ae)|0,v=v+Math.imul(me,ke)|0,g=g+Math.imul(pe,be)|0,a=a+Math.imul(pe,Te)|0,a=a+Math.imul(ge,be)|0,v=v+Math.imul(ge,Te)|0,g=g+Math.imul(ue,ve)|0,a=a+Math.imul(ue,Se)|0,a=a+Math.imul(ie,ve)|0,v=v+Math.imul(ie,Se)|0,g=g+Math.imul(oe,Ie)|0,a=a+Math.imul(oe,Me)|0,a=a+Math.imul(ce,Ie)|0,v=v+Math.imul(ce,Me)|0,g=g+Math.imul(X,Pe)|0,a=a+Math.imul(X,Oe)|0,a=a+Math.imul(Z,Pe)|0,v=v+Math.imul(Z,Oe)|0,g=g+Math.imul($,Re)|0,a=a+Math.imul($,Ne)|0,a=a+Math.imul(K,Re)|0,v=v+Math.imul(K,Ne)|0,g=g+Math.imul(k,Be)|0,a=a+Math.imul(k,Fe)|0,a=a+Math.imul(S,Be)|0,v=v+Math.imul(S,Fe)|0;var br=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(br>>>26)|0,br&=67108863,g=Math.imul(xe,De),a=Math.imul(xe,Ce),a=a+Math.imul(Ee,De)|0,v=Math.imul(Ee,Ce),g=g+Math.imul(ye,Ae)|0,a=a+Math.imul(ye,ke)|0,a=a+Math.imul(de,Ae)|0,v=v+Math.imul(de,ke)|0,g=g+Math.imul(le,be)|0,a=a+Math.imul(le,Te)|0,a=a+Math.imul(me,be)|0,v=v+Math.imul(me,Te)|0,g=g+Math.imul(pe,ve)|0,a=a+Math.imul(pe,Se)|0,a=a+Math.imul(ge,ve)|0,v=v+Math.imul(ge,Se)|0,g=g+Math.imul(ue,Ie)|0,a=a+Math.imul(ue,Me)|0,a=a+Math.imul(ie,Ie)|0,v=v+Math.imul(ie,Me)|0,g=g+Math.imul(oe,Pe)|0,a=a+Math.imul(oe,Oe)|0,a=a+Math.imul(ce,Pe)|0,v=v+Math.imul(ce,Oe)|0,g=g+Math.imul(X,Re)|0,a=a+Math.imul(X,Ne)|0,a=a+Math.imul(Z,Re)|0,v=v+Math.imul(Z,Ne)|0,g=g+Math.imul($,Be)|0,a=a+Math.imul($,Fe)|0,a=a+Math.imul(K,Be)|0,v=v+Math.imul(K,Fe)|0,g=g+Math.imul(k,Le)|0,a=a+Math.imul(k,qe)|0,a=a+Math.imul(S,Le)|0,v=v+Math.imul(S,qe)|0;var _r=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(_r>>>26)|0,_r&=67108863,g=Math.imul(_e,De),a=Math.imul(_e,Ce),a=a+Math.imul(we,De)|0,v=Math.imul(we,Ce),g=g+Math.imul(xe,Ae)|0,a=a+Math.imul(xe,ke)|0,a=a+Math.imul(Ee,Ae)|0,v=v+Math.imul(Ee,ke)|0,g=g+Math.imul(ye,be)|0,a=a+Math.imul(ye,Te)|0,a=a+Math.imul(de,be)|0,v=v+Math.imul(de,Te)|0,g=g+Math.imul(le,ve)|0,a=a+Math.imul(le,Se)|0,a=a+Math.imul(me,ve)|0,v=v+Math.imul(me,Se)|0,g=g+Math.imul(pe,Ie)|0,a=a+Math.imul(pe,Me)|0,a=a+Math.imul(ge,Ie)|0,v=v+Math.imul(ge,Me)|0,g=g+Math.imul(ue,Pe)|0,a=a+Math.imul(ue,Oe)|0,a=a+Math.imul(ie,Pe)|0,v=v+Math.imul(ie,Oe)|0,g=g+Math.imul(oe,Re)|0,a=a+Math.imul(oe,Ne)|0,a=a+Math.imul(ce,Re)|0,v=v+Math.imul(ce,Ne)|0,g=g+Math.imul(X,Be)|0,a=a+Math.imul(X,Fe)|0,a=a+Math.imul(Z,Be)|0,v=v+Math.imul(Z,Fe)|0,g=g+Math.imul($,Le)|0,a=a+Math.imul($,qe)|0,a=a+Math.imul(K,Le)|0,v=v+Math.imul(K,qe)|0,g=g+Math.imul(k,Ue)|0,a=a+Math.imul(k,je)|0,a=a+Math.imul(S,Ue)|0,v=v+Math.imul(S,je)|0;var wr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wr>>>26)|0,wr&=67108863,g=Math.imul(_e,Ae),a=Math.imul(_e,ke),a=a+Math.imul(we,Ae)|0,v=Math.imul(we,ke),g=g+Math.imul(xe,be)|0,a=a+Math.imul(xe,Te)|0,a=a+Math.imul(Ee,be)|0,v=v+Math.imul(Ee,Te)|0,g=g+Math.imul(ye,ve)|0,a=a+Math.imul(ye,Se)|0,a=a+Math.imul(de,ve)|0,v=v+Math.imul(de,Se)|0,g=g+Math.imul(le,Ie)|0,a=a+Math.imul(le,Me)|0,a=a+Math.imul(me,Ie)|0,v=v+Math.imul(me,Me)|0,g=g+Math.imul(pe,Pe)|0,a=a+Math.imul(pe,Oe)|0,a=a+Math.imul(ge,Pe)|0,v=v+Math.imul(ge,Oe)|0,g=g+Math.imul(ue,Re)|0,a=a+Math.imul(ue,Ne)|0,a=a+Math.imul(ie,Re)|0,v=v+Math.imul(ie,Ne)|0,g=g+Math.imul(oe,Be)|0,a=a+Math.imul(oe,Fe)|0,a=a+Math.imul(ce,Be)|0,v=v+Math.imul(ce,Fe)|0,g=g+Math.imul(X,Le)|0,a=a+Math.imul(X,qe)|0,a=a+Math.imul(Z,Le)|0,v=v+Math.imul(Z,qe)|0,g=g+Math.imul($,Ue)|0,a=a+Math.imul($,je)|0,a=a+Math.imul(K,Ue)|0,v=v+Math.imul(K,je)|0;var tr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(tr>>>26)|0,tr&=67108863,g=Math.imul(_e,be),a=Math.imul(_e,Te),a=a+Math.imul(we,be)|0,v=Math.imul(we,Te),g=g+Math.imul(xe,ve)|0,a=a+Math.imul(xe,Se)|0,a=a+Math.imul(Ee,ve)|0,v=v+Math.imul(Ee,Se)|0,g=g+Math.imul(ye,Ie)|0,a=a+Math.imul(ye,Me)|0,a=a+Math.imul(de,Ie)|0,v=v+Math.imul(de,Me)|0,g=g+Math.imul(le,Pe)|0,a=a+Math.imul(le,Oe)|0,a=a+Math.imul(me,Pe)|0,v=v+Math.imul(me,Oe)|0,g=g+Math.imul(pe,Re)|0,a=a+Math.imul(pe,Ne)|0,a=a+Math.imul(ge,Re)|0,v=v+Math.imul(ge,Ne)|0,g=g+Math.imul(ue,Be)|0,a=a+Math.imul(ue,Fe)|0,a=a+Math.imul(ie,Be)|0,v=v+Math.imul(ie,Fe)|0,g=g+Math.imul(oe,Le)|0,a=a+Math.imul(oe,qe)|0,a=a+Math.imul(ce,Le)|0,v=v+Math.imul(ce,qe)|0,g=g+Math.imul(X,Ue)|0,a=a+Math.imul(X,je)|0,a=a+Math.imul(Z,Ue)|0,v=v+Math.imul(Z,je)|0;var Wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,g=Math.imul(_e,ve),a=Math.imul(_e,Se),a=a+Math.imul(we,ve)|0,v=Math.imul(we,Se),g=g+Math.imul(xe,Ie)|0,a=a+Math.imul(xe,Me)|0,a=a+Math.imul(Ee,Ie)|0,v=v+Math.imul(Ee,Me)|0,g=g+Math.imul(ye,Pe)|0,a=a+Math.imul(ye,Oe)|0,a=a+Math.imul(de,Pe)|0,v=v+Math.imul(de,Oe)|0,g=g+Math.imul(le,Re)|0,a=a+Math.imul(le,Ne)|0,a=a+Math.imul(me,Re)|0,v=v+Math.imul(me,Ne)|0,g=g+Math.imul(pe,Be)|0,a=a+Math.imul(pe,Fe)|0,a=a+Math.imul(ge,Be)|0,v=v+Math.imul(ge,Fe)|0,g=g+Math.imul(ue,Le)|0,a=a+Math.imul(ue,qe)|0,a=a+Math.imul(ie,Le)|0,v=v+Math.imul(ie,qe)|0,g=g+Math.imul(oe,Ue)|0,a=a+Math.imul(oe,je)|0,a=a+Math.imul(ce,Ue)|0,v=v+Math.imul(ce,je)|0;var fr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(fr>>>26)|0,fr&=67108863,g=Math.imul(_e,Ie),a=Math.imul(_e,Me),a=a+Math.imul(we,Ie)|0,v=Math.imul(we,Me),g=g+Math.imul(xe,Pe)|0,a=a+Math.imul(xe,Oe)|0,a=a+Math.imul(Ee,Pe)|0,v=v+Math.imul(Ee,Oe)|0,g=g+Math.imul(ye,Re)|0,a=a+Math.imul(ye,Ne)|0,a=a+Math.imul(de,Re)|0,v=v+Math.imul(de,Ne)|0,g=g+Math.imul(le,Be)|0,a=a+Math.imul(le,Fe)|0,a=a+Math.imul(me,Be)|0,v=v+Math.imul(me,Fe)|0,g=g+Math.imul(pe,Le)|0,a=a+Math.imul(pe,qe)|0,a=a+Math.imul(ge,Le)|0,v=v+Math.imul(ge,qe)|0,g=g+Math.imul(ue,Ue)|0,a=a+Math.imul(ue,je)|0,a=a+Math.imul(ie,Ue)|0,v=v+Math.imul(ie,je)|0;var Yt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,g=Math.imul(_e,Pe),a=Math.imul(_e,Oe),a=a+Math.imul(we,Pe)|0,v=Math.imul(we,Oe),g=g+Math.imul(xe,Re)|0,a=a+Math.imul(xe,Ne)|0,a=a+Math.imul(Ee,Re)|0,v=v+Math.imul(Ee,Ne)|0,g=g+Math.imul(ye,Be)|0,a=a+Math.imul(ye,Fe)|0,a=a+Math.imul(de,Be)|0,v=v+Math.imul(de,Fe)|0,g=g+Math.imul(le,Le)|0,a=a+Math.imul(le,qe)|0,a=a+Math.imul(me,Le)|0,v=v+Math.imul(me,qe)|0,g=g+Math.imul(pe,Ue)|0,a=a+Math.imul(pe,je)|0,a=a+Math.imul(ge,Ue)|0,v=v+Math.imul(ge,je)|0;var dr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(dr>>>26)|0,dr&=67108863,g=Math.imul(_e,Re),a=Math.imul(_e,Ne),a=a+Math.imul(we,Re)|0,v=Math.imul(we,Ne),g=g+Math.imul(xe,Be)|0,a=a+Math.imul(xe,Fe)|0,a=a+Math.imul(Ee,Be)|0,v=v+Math.imul(Ee,Fe)|0,g=g+Math.imul(ye,Le)|0,a=a+Math.imul(ye,qe)|0,a=a+Math.imul(de,Le)|0,v=v+Math.imul(de,qe)|0,g=g+Math.imul(le,Ue)|0,a=a+Math.imul(le,je)|0,a=a+Math.imul(me,Ue)|0,v=v+Math.imul(me,je)|0;var rr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(rr>>>26)|0,rr&=67108863,g=Math.imul(_e,Be),a=Math.imul(_e,Fe),a=a+Math.imul(we,Be)|0,v=Math.imul(we,Fe),g=g+Math.imul(xe,Le)|0,a=a+Math.imul(xe,qe)|0,a=a+Math.imul(Ee,Le)|0,v=v+Math.imul(Ee,qe)|0,g=g+Math.imul(ye,Ue)|0,a=a+Math.imul(ye,je)|0,a=a+Math.imul(de,Ue)|0,v=v+Math.imul(de,je)|0;var nr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(nr>>>26)|0,nr&=67108863,g=Math.imul(_e,Le),a=Math.imul(_e,qe),a=a+Math.imul(we,Le)|0,v=Math.imul(we,qe),g=g+Math.imul(xe,Ue)|0,a=a+Math.imul(xe,je)|0,a=a+Math.imul(Ee,Ue)|0,v=v+Math.imul(Ee,je)|0;var hr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(hr>>>26)|0,hr&=67108863,g=Math.imul(_e,Ue),a=Math.imul(_e,je),a=a+Math.imul(we,Ue)|0,v=Math.imul(we,je);var xr=(w+g|0)+((a&8191)<<13)|0;return w=(v+(a>>>13)|0)+(xr>>>26)|0,xr&=67108863,b[0]=gr,b[1]=wt,b[2]=xt,b[3]=or,b[4]=yr,b[5]=lr,b[6]=vr,b[7]=br,b[8]=_r,b[9]=wr,b[10]=tr,b[11]=Wt,b[12]=fr,b[13]=Yt,b[14]=dr,b[15]=rr,b[16]=nr,b[17]=hr,b[18]=xr,w!==0&&(b[19]=w,p.length++),p};Math.imul||(M=R);function I(_,s,l){l.negative=s.negative^_.negative,l.length=_.length+s.length;for(var p=0,f=0,h=0;h>>26)|0,f+=b>>>26,b&=67108863}l.words[h]=w,p=b,b=f}return p!==0?l.words[h]=p:l.length--,l.strip()}function D(_,s,l){var p=new O;return p.mulp(_,s,l)}n.prototype.mulTo=function(s,l){var p,f=this.length+s.length;return this.length===10&&s.length===10?p=M(this,s,l):f<63?p=R(this,s,l):f<1024?p=I(this,s,l):p=D(this,s,l),p};function O(_,s){this.x=_,this.y=s}O.prototype.makeRBT=function(s){for(var l=new Array(s),p=n.prototype._countBits(s)-1,f=0;f>=1;return f},O.prototype.permute=function(s,l,p,f,h,b){for(var w=0;w>>1)h++;return 1<>>13,p[2*b+1]=h&8191,h=h>>>13;for(b=2*l;b>=26,l+=f/67108864|0,l+=h>>>26,this.words[p]=h&67108863}return l!==0&&(this.words[p]=l,this.length++),this},n.prototype.muln=function(s){return this.clone().imuln(s)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(s){var l=A(s);if(l.length===0)return new n(1);for(var p=this,f=0;f=0);var l=s%26,p=(s-l)/26,f=67108863>>>26-l<<26-l,h;if(l!==0){var b=0;for(h=0;h>>26-l}b&&(this.words[h]=b,this.length++)}if(p!==0){for(h=this.length-1;h>=0;h--)this.words[h+p]=this.words[h];for(h=0;h=0);var f;l?f=(l-l%26)/26:f=0;var h=s%26,b=Math.min((s-h)/26,this.length),w=67108863^67108863>>>h<b)for(this.length-=b,a=0;a=0&&(v!==0||a>=f);a--){var P=this.words[a]|0;this.words[a]=v<<26-h|P>>>h,v=P&w}return g&&v!==0&&(g.words[g.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(s,l,p){return r(this.negative===0),this.iushrn(s,l,p)},n.prototype.shln=function(s){return this.clone().ishln(s)},n.prototype.ushln=function(s){return this.clone().iushln(s)},n.prototype.shrn=function(s){return this.clone().ishrn(s)},n.prototype.ushrn=function(s){return this.clone().iushrn(s)},n.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,p=(s-l)/26,f=1<=0);var l=s%26,p=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(l!==0&&p++,this.length=Math.min(p,this.length),l!==0){var f=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},n.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(g/67108864|0),this.words[h+p]=b&67108863}for(;h>26,this.words[h+p]=b&67108863;if(w===0)return this.strip();for(r(w===-1),w=0,h=0;h>26,this.words[h]=b&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(s,l){var p=this.length-s.length,f=this.clone(),h=s,b=h.words[h.length-1]|0,w=this._countBits(b);p=26-w,p!==0&&(h=h.ushln(p),f.iushln(p),b=h.words[h.length-1]|0);var g=f.length-h.length,a;if(l!=="mod"){a=new n(null),a.length=g+1,a.words=new Array(a.length);for(var v=0;v=0;k--){var S=(f.words[h.length+k]|0)*67108864+(f.words[h.length+k-1]|0);for(S=Math.min(S/b|0,67108863),f._ishlnsubmul(h,S,k);f.negative!==0;)S--,f.negative=0,f._ishlnsubmul(h,1,k),f.isZero()||(f.negative^=1);a&&(a.words[k]=S)}return a&&a.strip(),f.strip(),l!=="div"&&p!==0&&f.iushrn(p),{div:a||null,mod:f}},n.prototype.divmod=function(s,l,p){if(r(!s.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,b;return this.negative!==0&&s.negative===0?(b=this.neg().divmod(s,l),l!=="mod"&&(f=b.div.neg()),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.iadd(s)),{div:f,mod:h}):this.negative===0&&s.negative!==0?(b=this.divmod(s.neg(),l),l!=="mod"&&(f=b.div.neg()),{div:f,mod:b.mod}):(this.negative&s.negative)!==0?(b=this.neg().divmod(s.neg(),l),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.isub(s)),{div:b.div,mod:h}):s.length>this.length||this.cmp(s)<0?{div:new n(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new n(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new n(this.modn(s.words[0]))}:this._wordDiv(s,l)},n.prototype.div=function(s){return this.divmod(s,"div",!1).div},n.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},n.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},n.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var p=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),h=s.andln(1),b=p.cmp(f);return b<0||h===1&&b===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},n.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,p=0,f=this.length-1;f>=0;f--)p=(l*p+(this.words[f]|0))%s;return p},n.prototype.idivn=function(s){r(s<=67108863);for(var l=0,p=this.length-1;p>=0;p--){var f=(this.words[p]|0)+l*67108864;this.words[p]=f/s|0,l=f%s}return this.strip()},n.prototype.divn=function(s){return this.clone().idivn(s)},n.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=new n(0),w=new n(1),g=0;l.isEven()&&p.isEven();)l.iushrn(1),p.iushrn(1),++g;for(var a=p.clone(),v=l.clone();!l.isZero();){for(var P=0,k=1;(l.words[0]&k)===0&&P<26;++P,k<<=1);if(P>0)for(l.iushrn(P);P-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(a),h.isub(v)),f.iushrn(1),h.iushrn(1);for(var S=0,B=1;(p.words[0]&B)===0&&S<26;++S,B<<=1);if(S>0)for(p.iushrn(S);S-- >0;)(b.isOdd()||w.isOdd())&&(b.iadd(a),w.isub(v)),b.iushrn(1),w.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(b),h.isub(w)):(p.isub(l),b.isub(f),w.isub(h))}return{a:b,b:w,gcd:p.iushln(g)}},n.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=p.clone();l.cmpn(1)>0&&p.cmpn(1)>0;){for(var w=0,g=1;(l.words[0]&g)===0&&w<26;++w,g<<=1);if(w>0)for(l.iushrn(w);w-- >0;)f.isOdd()&&f.iadd(b),f.iushrn(1);for(var a=0,v=1;(p.words[0]&v)===0&&a<26;++a,v<<=1);if(a>0)for(p.iushrn(a);a-- >0;)h.isOdd()&&h.iadd(b),h.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(h)):(p.isub(l),h.isub(f))}var P;return l.cmpn(1)===0?P=f:P=h,P.cmpn(0)<0&&P.iadd(s),P},n.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),p=s.clone();l.negative=0,p.negative=0;for(var f=0;l.isEven()&&p.isEven();f++)l.iushrn(1),p.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;p.isEven();)p.iushrn(1);var h=l.cmp(p);if(h<0){var b=l;l=p,p=b}else if(h===0||p.cmpn(1)===0)break;l.isub(p)}while(!0);return p.iushln(f)},n.prototype.invm=function(s){return this.egcd(s).a.umod(s)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(s){return this.words[0]&s},n.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,p=(s-l)/26,f=1<>>26,w&=67108863,this.words[b]=w}return h!==0&&(this.words[b]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var p;if(this.length>1)p=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;p=f===s?0:fs.length)return 1;if(this.length=0;p--){var f=this.words[p]|0,h=s.words[p]|0;if(f!==h){fh&&(l=1);break}}return l},n.prototype.gtn=function(s){return this.cmpn(s)===1},n.prototype.gt=function(s){return this.cmp(s)===1},n.prototype.gten=function(s){return this.cmpn(s)>=0},n.prototype.gte=function(s){return this.cmp(s)>=0},n.prototype.ltn=function(s){return this.cmpn(s)===-1},n.prototype.lt=function(s){return this.cmp(s)===-1},n.prototype.lten=function(s){return this.cmpn(s)<=0},n.prototype.lte=function(s){return this.cmp(s)<=0},n.prototype.eqn=function(s){return this.cmpn(s)===0},n.prototype.eq=function(s){return this.cmp(s)===0},n.red=function(s){return new q(s)},n.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(s){return this.red=s,this},n.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},n.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},n.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},n.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},n.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},n.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},n.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},n.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var N={k256:null,p224:null,p192:null,p25519:null};function L(_,s){this.name=_,this.p=new n(s,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var s=new n(null);return s.words=new Array(Math.ceil(this.n/13)),s},L.prototype.ireduce=function(s){var l=s,p;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),p=l.bitLength();while(p>this.n);var f=p0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},L.prototype.split=function(s,l){s.iushrn(this.n,0,l)},L.prototype.imulK=function(s){return s.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,L),j.prototype.split=function(s,l){for(var p=4194303,f=Math.min(s.length,9),h=0;h>>22,b=w}b>>>=22,s.words[h-10]=b,b===0&&s.length>10?s.length-=10:s.length-=9},j.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,p=0;p>>=26,s.words[p]=h,l=f}return l!==0&&(s.words[s.length++]=l),s},n._prime=function(s){if(N[s])return N[s];var l;if(s==="k256")l=new j;else if(s==="p224")l=new H;else if(s==="p192")l=new Y;else if(s==="p25519")l=new W;else throw new Error("Unknown prime "+s);return N[s]=l,l};function q(_){if(typeof _=="string"){var s=n._prime(_);this.m=s.p,this.prime=s}else r(_.gtn(1),"modulus must be greater than 1"),this.m=_,this.prime=null}q.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},q.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},q.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},q.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},q.prototype.add=function(s,l){this._verify2(s,l);var p=s.add(l);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},q.prototype.iadd=function(s,l){this._verify2(s,l);var p=s.iadd(l);return p.cmp(this.m)>=0&&p.isub(this.m),p},q.prototype.sub=function(s,l){this._verify2(s,l);var p=s.sub(l);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},q.prototype.isub=function(s,l){this._verify2(s,l);var p=s.isub(l);return p.cmpn(0)<0&&p.iadd(this.m),p},q.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},q.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},q.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},q.prototype.isqr=function(s){return this.imul(s,s.clone())},q.prototype.sqr=function(s){return this.mul(s,s)},q.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var p=this.m.add(new n(1)).iushrn(2);return this.pow(s,p)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);r(!f.isZero());var b=new n(1).toRed(this),w=b.redNeg(),g=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new n(2*a*a).toRed(this);this.pow(a,g).cmp(w)!==0;)a.redIAdd(w);for(var v=this.pow(a,f),P=this.pow(s,f.addn(1).iushrn(1)),k=this.pow(s,f),S=h;k.cmp(b)!==0;){for(var B=k,$=0;B.cmp(b)!==0;$++)B=B.redSqr();r($=0;h--){for(var v=l.words[h],P=a-1;P>=0;P--){var k=v>>P&1;if(b!==f[0]&&(b=this.sqr(b)),k===0&&w===0){g=0;continue}w<<=1,w|=k,g++,!(g!==p&&(h!==0||P!==0))&&(b=this.mul(b,f[w]),g=0,w=0)}a=26}return b},q.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},q.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},n.mont=function(s){return new J(s)};function J(_){q.call(this,_),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(J,q),J.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},J.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},J.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var p=s.imul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new n(0)._forceRed(this);var p=s.mul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof qC>"u"||qC,N9)});var mb=F((NLe,B9)=>{"use strict";m();var pb=xn(),Gd=pb.Buffer,Co={},Ao;for(Ao in pb)!pb.hasOwnProperty(Ao)||Ao==="SlowBuffer"||Ao==="Buffer"||(Co[Ao]=pb[Ao]);var Kd=Co.Buffer={};for(Ao in Gd)!Gd.hasOwnProperty(Ao)||Ao==="allocUnsafe"||Ao==="allocUnsafeSlow"||(Kd[Ao]=Gd[Ao]);Co.Buffer.prototype=Gd.prototype;(!Kd.from||Kd.from===Uint8Array.from)&&(Kd.from=function(t,e,r){if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&typeof t.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return Gd(t,e,r)});Kd.alloc||(Kd.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var i=Gd(t);return!e||e.length===0?i.fill(0):typeof r=="string"?i.fill(e,r):i.fill(e),i});if(!Co.kStringMaxLength)try{Co.kStringMaxLength=C.binding("buffer").kStringMaxLength}catch{}Co.constants||(Co.constants={MAX_LENGTH:Co.kMaxLength},Co.kStringMaxLength&&(Co.constants.MAX_STRING_LENGTH=Co.kStringMaxLength));B9.exports=Co});var gb=F(F9=>{"use strict";m();var nwe=vt();function To(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}F9.Reporter=To;To.prototype.isError=function(e){return e instanceof Vd};To.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};To.prototype.restore=function(e){let r=this._reporterState;r.obj=e.obj,r.path=r.path.slice(0,e.pathLen)};To.prototype.enterKey=function(e){return this._reporterState.path.push(e)};To.prototype.exitKey=function(e){let r=this._reporterState;r.path=r.path.slice(0,e-1)};To.prototype.leaveKey=function(e,r,i){let n=this._reporterState;this.exitKey(e),n.obj!==null&&(n.obj[r]=i)};To.prototype.path=function(){return this._reporterState.path.join("/")};To.prototype.enterObject=function(){let e=this._reporterState,r=e.obj;return e.obj={},r};To.prototype.leaveObject=function(e){let r=this._reporterState,i=r.obj;return r.obj=e,i};To.prototype.error=function(e){let r,i=this._reporterState,n=e instanceof Vd;if(n?r=e:r=new Vd(i.path.map(function(o){return"["+JSON.stringify(o)+"]"}).join(""),e.message||e,e.stack),!i.options.partial)throw r;return n||i.errors.push(r),r};To.prototype.wrapResult=function(e){let r=this._reporterState;return r.options.partial?{result:this.isError(e)?null:e,errors:r.errors}:e};function Vd(t,e){this.path=t,this.rethrow(e)}nwe(Vd,Error);Vd.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Vd),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this}});var Qd=F(jC=>{"use strict";m();var iwe=vt(),yb=gb().Reporter,Wd=mb().Buffer;function Mo(t,e){if(yb.call(this,e),!Wd.isBuffer(t)){this.error("Input not Buffer");return}this.base=t,this.offset=0,this.length=t.length}iwe(Mo,yb);jC.DecoderBuffer=Mo;Mo.isDecoderBuffer=function(e){return e instanceof Mo?!0:typeof e=="object"&&Wd.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"};Mo.prototype.save=function(){return{offset:this.offset,reporter:yb.prototype.save.call(this)}};Mo.prototype.restore=function(e){let r=new Mo(this.base);return r.offset=e.offset,r.length=this.offset,this.offset=e.offset,yb.prototype.restore.call(this,e.reporter),r};Mo.prototype.isEmpty=function(){return this.offset===this.length};Mo.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};Mo.prototype.skip=function(e,r){if(!(this.offset+e<=this.length))return this.error(r||"DecoderBuffer overrun");let i=new Mo(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i};Mo.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Yd(t,e){if(Array.isArray(t))this.length=0,this.value=t.map(function(r){return Yd.isEncoderBuffer(r)||(r=new Yd(r,e)),this.length+=r.length,r},this);else if(typeof t=="number"){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if(typeof t=="string")this.value=t,this.length=Wd.byteLength(t);else if(Wd.isBuffer(t))this.value=t,this.length=t.length;else return e.error("Unsupported type: "+typeof t)}jC.EncoderBuffer=Yd;Yd.isEncoderBuffer=function(e){return e instanceof Yd?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Yd.prototype.join=function(e,r){return e||(e=Wd.alloc(this.length)),r||(r=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(i){i.join(e,r),r+=i.length}):(typeof this.value=="number"?e[r]=this.value:typeof this.value=="string"?e.write(this.value,r):Wd.isBuffer(this.value)&&this.value.copy(e,r),r+=this.length)),e}});var vb=F((LLe,q9)=>{"use strict";m();var owe=gb().Reporter,swe=Qd().EncoderBuffer,awe=Qd().DecoderBuffer,Ci=Zi(),L9=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],cwe=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(L9),uwe=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Pr(t,e,r){let i={};this._baseState=i,i.name=r,i.enc=t,i.parent=e||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}q9.exports=Pr;var lwe=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Pr.prototype.clone=function(){let e=this._baseState,r={};lwe.forEach(function(n){r[n]=e[n]});let i=new this.constructor(r.parent);return i._baseState=r,i};Pr.prototype._wrap=function(){let e=this._baseState;cwe.forEach(function(r){this[r]=function(){let n=new this.constructor(this);return e.children.push(n),n[r].apply(n,arguments)}},this)};Pr.prototype._init=function(e){let r=this._baseState;Ci(r.parent===null),e.call(this),r.children=r.children.filter(function(i){return i._baseState.parent===this},this),Ci.equal(r.children.length,1,"Root node can have only one child")};Pr.prototype._useArgs=function(e){let r=this._baseState,i=e.filter(function(n){return n instanceof this.constructor},this);e=e.filter(function(n){return!(n instanceof this.constructor)},this),i.length!==0&&(Ci(r.children===null),r.children=i,i.forEach(function(n){n._baseState.parent=this},this)),e.length!==0&&(Ci(r.args===null),r.args=e,r.reverseArgs=e.map(function(n){if(typeof n!="object"||n.constructor!==Object)return n;let o={};return Object.keys(n).forEach(function(c){c==(c|0)&&(c|=0);let u=n[c];o[u]=c}),o}))};uwe.forEach(function(t){Pr.prototype[t]=function(){let r=this._baseState;throw new Error(t+" not implemented for encoding: "+r.enc)}});L9.forEach(function(t){Pr.prototype[t]=function(){let r=this._baseState,i=Array.prototype.slice.call(arguments);return Ci(r.tag===null),r.tag=t,this._useArgs(i),this}});Pr.prototype.use=function(e){Ci(e);let r=this._baseState;return Ci(r.use===null),r.use=e,this};Pr.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};Pr.prototype.def=function(e){let r=this._baseState;return Ci(r.default===null),r.default=e,r.optional=!0,this};Pr.prototype.explicit=function(e){let r=this._baseState;return Ci(r.explicit===null&&r.implicit===null),r.explicit=e,this};Pr.prototype.implicit=function(e){let r=this._baseState;return Ci(r.explicit===null&&r.implicit===null),r.implicit=e,this};Pr.prototype.obj=function(){let e=this._baseState,r=Array.prototype.slice.call(arguments);return e.obj=!0,r.length!==0&&this._useArgs(r),this};Pr.prototype.key=function(e){let r=this._baseState;return Ci(r.key===null),r.key=e,this};Pr.prototype.any=function(){let e=this._baseState;return e.any=!0,this};Pr.prototype.choice=function(e){let r=this._baseState;return Ci(r.choice===null),r.choice=e,this._useArgs(Object.keys(e).map(function(i){return e[i]})),this};Pr.prototype.contains=function(e){let r=this._baseState;return Ci(r.use===null),r.contains=e,this};Pr.prototype._decode=function(e,r){let i=this._baseState;if(i.parent===null)return e.wrapResult(i.children[0]._decode(e,r));let n=i.default,o=!0,c=null;if(i.key!==null&&(c=e.enterKey(i.key)),i.optional){let d=null;if(i.explicit!==null?d=i.explicit:i.implicit!==null?d=i.implicit:i.tag!==null&&(d=i.tag),d===null&&!i.any){let y=e.save();try{i.choice===null?this._decodeGeneric(i.tag,e,r):this._decodeChoice(e,r),o=!0}catch{o=!1}e.restore(y)}else if(o=this._peekTag(e,d,i.any),e.isError(o))return o}let u;if(i.obj&&o&&(u=e.enterObject()),o){if(i.explicit!==null){let y=this._decodeTag(e,i.explicit);if(e.isError(y))return y;e=y}let d=e.offset;if(i.use===null&&i.choice===null){let y;i.any&&(y=e.save());let E=this._decodeTag(e,i.implicit!==null?i.implicit:i.tag,i.any);if(e.isError(E))return E;i.any?n=e.raw(y):e=E}if(r&&r.track&&i.tag!==null&&r.track(e.path(),d,e.length,"tagged"),r&&r.track&&i.tag!==null&&r.track(e.path(),e.offset,e.length,"content"),i.any||(i.choice===null?n=this._decodeGeneric(i.tag,e,r):n=this._decodeChoice(e,r)),e.isError(n))return n;if(!i.any&&i.choice===null&&i.children!==null&&i.children.forEach(function(E){E._decode(e,r)}),i.contains&&(i.tag==="octstr"||i.tag==="bitstr")){let y=new awe(n);n=this._getUse(i.contains,e._reporterState.obj)._decode(y,r)}}return i.obj&&o&&(n=e.leaveObject(u)),i.key!==null&&(n!==null||o===!0)?e.leaveKey(c,i.key,n):c!==null&&e.exitKey(c),n};Pr.prototype._decodeGeneric=function(e,r,i){let n=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(r,e,n.args[0],i):/str$/.test(e)?this._decodeStr(r,e,i):e==="objid"&&n.args?this._decodeObjid(r,n.args[0],n.args[1],i):e==="objid"?this._decodeObjid(r,null,null,i):e==="gentime"||e==="utctime"?this._decodeTime(r,e,i):e==="null_"?this._decodeNull(r,i):e==="bool"?this._decodeBool(r,i):e==="objDesc"?this._decodeStr(r,e,i):e==="int"||e==="enum"?this._decodeInt(r,n.args&&n.args[0],i):n.use!==null?this._getUse(n.use,r._reporterState.obj)._decode(r,i):r.error("unknown tag: "+e)};Pr.prototype._getUse=function(e,r){let i=this._baseState;return i.useDecoder=this._use(e,r),Ci(i.useDecoder._baseState.parent===null),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder};Pr.prototype._decodeChoice=function(e,r){let i=this._baseState,n=null,o=!1;return Object.keys(i.choice).some(function(c){let u=e.save(),d=i.choice[c];try{let y=d._decode(e,r);if(e.isError(y))return!1;n={type:c,value:y},o=!0}catch{return e.restore(u),!1}return!0},this),o?n:e.error("Choice not matched")};Pr.prototype._createEncoderBuffer=function(e){return new swe(e,this.reporter)};Pr.prototype._encode=function(e,r,i){let n=this._baseState;if(n.default!==null&&n.default===e)return;let o=this._encodeValue(e,r,i);if(o!==void 0&&!this._skipDefault(o,r,i))return o};Pr.prototype._encodeValue=function(e,r,i){let n=this._baseState;if(n.parent===null)return n.children[0]._encode(e,r||new owe);let o=null;if(this.reporter=r,n.optional&&e===void 0)if(n.default!==null)e=n.default;else return;let c=null,u=!1;if(n.any)o=this._createEncoderBuffer(e);else if(n.choice)o=this._encodeChoice(e,r);else if(n.contains)c=this._getUse(n.contains,i)._encode(e,r),u=!0;else if(n.children)c=n.children.map(function(d){if(d._baseState.tag==="null_")return d._encode(null,r,e);if(d._baseState.key===null)return r.error("Child should have a key");let y=r.enterKey(d._baseState.key);if(typeof e!="object")return r.error("Child expected, but input is not object");let E=d._encode(e[d._baseState.key],r,e);return r.leaveKey(y),E},this).filter(function(d){return d}),c=this._createEncoderBuffer(c);else if(n.tag==="seqof"||n.tag==="setof"){if(!(n.args&&n.args.length===1))return r.error("Too many args for : "+n.tag);if(!Array.isArray(e))return r.error("seqof/setof, but data is not Array");let d=this.clone();d._baseState.implicit=null,c=this._createEncoderBuffer(e.map(function(y){let E=this._baseState;return this._getUse(E.args[0],e)._encode(y,r)},d))}else n.use!==null?o=this._getUse(n.use,i)._encode(e,r):(c=this._encodePrimitive(n.tag,e),u=!0);if(!n.any&&n.choice===null){let d=n.implicit!==null?n.implicit:n.tag,y=n.implicit===null?"universal":"context";d===null?n.use===null&&r.error("Tag could be omitted only for .use()"):n.use===null&&(o=this._encodeComposite(d,u,y,c))}return n.explicit!==null&&(o=this._encodeComposite(n.explicit,!1,"context",o)),o};Pr.prototype._encodeChoice=function(e,r){let i=this._baseState,n=i.choice[e.type];return n||Ci(!1,e.type+" not found in "+JSON.stringify(Object.keys(i.choice))),n._encode(e.value,r)};Pr.prototype._encodePrimitive=function(e,r){let i=this._baseState;if(/str$/.test(e))return this._encodeStr(r,e);if(e==="objid"&&i.args)return this._encodeObjid(r,i.reverseArgs[0],i.args[1]);if(e==="objid")return this._encodeObjid(r,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(r,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(r,i.args&&i.reverseArgs[0]);if(e==="bool")return this._encodeBool(r);if(e==="objDesc")return this._encodeStr(r,e);throw new Error("Unsupported tag: "+e)};Pr.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};Pr.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var bb=F(Cl=>{"use strict";m();function U9(t){let e={};return Object.keys(t).forEach(function(r){(r|0)==r&&(r=r|0);let i=t[r];e[i]=r}),e}Cl.tagClass={0:"universal",1:"application",2:"context",3:"private"};Cl.tagClassByName=U9(Cl.tagClass);Cl.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};Cl.tagByName=U9(Cl.tag)});var HC=F((ULe,H9)=>{"use strict";m();var fwe=vt(),Ea=mb().Buffer,j9=vb(),zC=bb();function z9(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new Xo,this.tree._init(t.body)}H9.exports=z9;z9.prototype.encode=function(e,r){return this.tree._encode(e,r).join()};function Xo(t){j9.call(this,"der",t)}fwe(Xo,j9);Xo.prototype._encodeComposite=function(e,r,i,n){let o=dwe(e,r,i,this.reporter);if(n.length<128){let d=Ea.alloc(2);return d[0]=o,d[1]=n.length,this._createEncoderBuffer([d,n])}let c=1;for(let d=n.length;d>=256;d>>=8)c++;let u=Ea.alloc(1+1+c);u[0]=o,u[1]=128|c;for(let d=1+c,y=n.length;y>0;d--,y>>=8)u[d]=y&255;return this._createEncoderBuffer([u,n])};Xo.prototype._encodeStr=function(e,r){if(r==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(r==="bmpstr"){let i=Ea.alloc(e.length*2);for(let n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let n=0;for(let u=0;u=128;d>>=7)n++}let o=Ea.alloc(n),c=o.length-1;for(let u=e.length-1;u>=0;u--){let d=e[u];for(o[c--]=d&127;(d>>=7)>0;)o[c--]=128|d&127}return this._createEncoderBuffer(o)};function Ro(t){return t<10?"0"+t:t}Xo.prototype._encodeTime=function(e,r){let i,n=new Date(e);return r==="gentime"?i=[Ro(n.getUTCFullYear()),Ro(n.getUTCMonth()+1),Ro(n.getUTCDate()),Ro(n.getUTCHours()),Ro(n.getUTCMinutes()),Ro(n.getUTCSeconds()),"Z"].join(""):r==="utctime"?i=[Ro(n.getUTCFullYear()%100),Ro(n.getUTCMonth()+1),Ro(n.getUTCDate()),Ro(n.getUTCHours()),Ro(n.getUTCMinutes()),Ro(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+r+" time is not supported yet"),this._encodeStr(i,"octstr")};Xo.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Xo.prototype._encodeInt=function(e,r){if(typeof e=="string"){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=r[e]}if(typeof e!="number"&&!Ea.isBuffer(e)){let o=e.toArray();!e.sign&&o[0]&128&&o.unshift(0),e=Ea.from(o)}if(Ea.isBuffer(e)){let o=e.length;e.length===0&&o++;let c=Ea.alloc(o);return e.copy(c),e.length===0&&(c[0]=0),this._createEncoderBuffer(c)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let i=1;for(let o=e;o>=256;o>>=8)i++;let n=new Array(i);for(let o=n.length-1;o>=0;o--)n[o]=e&255,e>>=8;return n[0]&128&&n.unshift(0),this._createEncoderBuffer(Ea.from(n))};Xo.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};Xo.prototype._use=function(e,r){return typeof e=="function"&&(e=e(r)),e._getEncoder("der").tree};Xo.prototype._skipDefault=function(e,r,i){let n=this._baseState,o;if(n.default===null)return!1;let c=e.join();if(n.defaultBuffer===void 0&&(n.defaultBuffer=this._encodeValue(n.default,r,i).join()),c.length!==n.defaultBuffer.length)return!1;for(o=0;o=31?i.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|=zC.tagClassByName[r||"universal"]<<6,n)}});var G9=F((jLe,$9)=>{"use strict";m();var hwe=vt(),$C=HC();function GC(t){$C.call(this,t),this.enc="pem"}hwe(GC,$C);$9.exports=GC;GC.prototype.encode=function(e,r){let n=$C.prototype.encode.call(this,e).toString("base64"),o=["-----BEGIN "+r.label+"-----"];for(let c=0;c{"use strict";m();var K9=V9;K9.der=HC();K9.pem=G9()});var WC=F((HLe,Z9)=>{"use strict";m();var pwe=vt(),mwe=UC(),W9=Qd().DecoderBuffer,Q9=vb(),Y9=bb();function J9(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new to,this.tree._init(t.body)}Z9.exports=J9;J9.prototype.decode=function(e,r){return W9.isDecoderBuffer(e)||(e=new W9(e,r)),this.tree._decode(e,r)};function to(t){Q9.call(this,"der",t)}pwe(to,Q9);to.prototype._peekTag=function(e,r,i){if(e.isEmpty())return!1;let n=e.save(),o=VC(e,'Failed to peek tag: "'+r+'"');return e.isError(o)?o:(e.restore(n),o.tag===r||o.tagStr===r||o.tagStr+"of"===r||i)};to.prototype._decodeTag=function(e,r,i){let n=VC(e,'Failed to decode tag of "'+r+'"');if(e.isError(n))return n;let o=X9(e,n.primitive,'Failed to get length of "'+r+'"');if(e.isError(o))return o;if(!i&&n.tag!==r&&n.tagStr!==r&&n.tagStr+"of"!==r)return e.error('Failed to match tag: "'+r+'"');if(n.primitive||o!==null)return e.skip(o,'Failed to match body of: "'+r+'"');let c=e.save(),u=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(u)?u:(o=e.offset-c.offset,e.restore(c),e.skip(o,'Failed to match body of: "'+r+'"'))};to.prototype._skipUntilEnd=function(e,r){for(;;){let i=VC(e,r);if(e.isError(i))return i;let n=X9(e,i.primitive,r);if(e.isError(n))return n;let o;if(i.primitive||n!==null?o=e.skip(n):o=this._skipUntilEnd(e,r),e.isError(o))return o;if(i.tagStr==="end")break}};to.prototype._decodeList=function(e,r,i,n){let o=[];for(;!e.isEmpty();){let c=this._peekTag(e,"end");if(e.isError(c))return c;let u=i.decode(e,"der",n);if(e.isError(u)&&c)break;o.push(u)}return o};to.prototype._decodeStr=function(e,r){if(r==="bitstr"){let i=e.readUInt8();return e.isError(i)?i:{unused:i,data:e.raw()}}else if(r==="bmpstr"){let i=e.raw();if(i.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let n="";for(let o=0;o>6],n=(r&32)===0;if((r&31)===31){let c=r;for(r=0;(c&128)===128;){if(c=t.readUInt8(e),t.isError(c))return c;r<<=7,r|=c&127}}else r&=31;let o=Y9.tag[r];return{cls:i,primitive:n,tag:r,tagStr:o}}function X9(t,e,r){let i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&i===128)return null;if((i&128)===0)return i;let n=i&127;if(n>4)return t.error("length octect is too long");i=0;for(let o=0;o{"use strict";m();var gwe=vt(),ywe=mb().Buffer,YC=WC();function QC(t){YC.call(this,t),this.enc="pem"}gwe(QC,YC);eL.exports=QC;QC.prototype.decode=function(e,r){let i=e.toString().split(/[\r\n]+/g),n=r.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/,c=-1,u=-1;for(let E=0;E{"use strict";m();var rL=nL;rL.der=WC();rL.pem=tL()});var oL=F(iL=>{"use strict";m();var vwe=KC(),bwe=JC(),_we=vt(),wwe=iL;wwe.define=function(e,r){return new Jd(e,r)};function Jd(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}Jd.prototype._createNamed=function(e){let r=this.name;function i(n){this._initNamed(n,r)}return _we(i,e),i.prototype._initNamed=function(o,c){e.call(this,o,c)},new i(this)};Jd.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(bwe[e])),this.decoders[e]};Jd.prototype.decode=function(e,r,i){return this._getDecoder(r).decode(e,i)};Jd.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(vwe[e])),this.encoders[e]};Jd.prototype.encode=function(e,r,i){return this._getEncoder(r).encode(e,i)}});var aL=F(sL=>{"use strict";m();var _b=sL;_b.Reporter=gb().Reporter;_b.DecoderBuffer=Qd().DecoderBuffer;_b.EncoderBuffer=Qd().EncoderBuffer;_b.Node=vb()});var lL=F(uL=>{"use strict";m();var cL=uL;cL._reverse=function(e){let r={};return Object.keys(e).forEach(function(i){(i|0)==i&&(i=i|0);let n=e[i];r[n]=i}),r};cL.der=bb()});var XC=F(fL=>{"use strict";m();var Xd=fL;Xd.bignum=UC();Xd.define=oL().define;Xd.base=aL();Xd.constants=lL();Xd.decoders=JC();Xd.encoders=KC()});var mL=F((QLe,pL)=>{"use strict";m();var Zo=XC(),dL=Zo.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),xwe=Zo.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),ZC=Zo.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),Ewe=Zo.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(ZC),this.key("subjectPublicKey").bitstr())}),Swe=Zo.define("RelativeDistinguishedName",function(){this.setof(xwe)}),Cwe=Zo.define("RDNSequence",function(){this.seqof(Swe)}),hL=Zo.define("Name",function(){this.choice({rdnSequence:this.use(Cwe)})}),Awe=Zo.define("Validity",function(){this.seq().obj(this.key("notBefore").use(dL),this.key("notAfter").use(dL))}),Twe=Zo.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),Mwe=Zo.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(ZC),this.key("issuer").use(hL),this.key("validity").use(Awe),this.key("subject").use(hL),this.key("subjectPublicKeyInfo").use(Ewe),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(Twe).optional())}),Rwe=Zo.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(Mwe),this.key("signatureAlgorithm").use(ZC),this.key("signatureValue").bitstr())});pL.exports=Rwe});var yL=F(ts=>{"use strict";m();var es=XC();ts.certificate=mL();var Dwe=es.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});ts.RSAPrivateKey=Dwe;var kwe=es.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});ts.RSAPublicKey=kwe;var Iwe=es.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(gL),this.key("subjectPublicKey").bitstr())});ts.PublicKey=Iwe;var gL=es.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),Owe=es.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(gL),this.key("subjectPrivateKey").octstr())});ts.PrivateKey=Owe;var Pwe=es.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});ts.EncryptedPrivateKey=Pwe;var Nwe=es.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});ts.DSAPrivateKey=Nwe;ts.DSAparam=es.define("DSAparam",function(){this.int()});var Bwe=es.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(Fwe),this.key("publicKey").optional().explicit(1).bitstr())});ts.ECPrivateKey=Bwe;var Fwe=es.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});ts.signature=es.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})});var vL=F((XLe,Lwe)=>{Lwe.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}});var _L=F((ZLe,bL)=>{m();var qwe=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,Uwe=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,jwe=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,zwe=Nm(),Hwe=kv(),wb=At().Buffer;bL.exports=function(t,e){var r=t.toString(),i=r.match(qwe),n;if(i){var c="aes"+i[1],u=wb.from(i[2],"hex"),d=wb.from(i[3].replace(/[\r\n]/g,""),"base64"),y=zwe(e,u.slice(0,8),parseInt(i[1],10)).key,E=[],x=Hwe.createDecipheriv(c,y,u);E.push(x.update(d)),E.push(x.final()),n=wb.concat(E)}else{var o=r.match(jwe);n=wb.from(o[2].replace(/[\r\n]/g,""),"base64")}var A=r.match(Uwe)[1];return{tag:A,data:n}}});var Ym=F((eqe,xL)=>{m();var Ui=yL(),$we=vL(),Gwe=_L(),Kwe=kv(),Vwe=m2(),eA=At().Buffer;xL.exports=wL;function wL(t){var e;typeof t=="object"&&!eA.isBuffer(t)&&(e=t.passphrase,t=t.key),typeof t=="string"&&(t=eA.from(t));var r=Gwe(t,e),i=r.tag,n=r.data,o,c;switch(i){case"CERTIFICATE":c=Ui.certificate.decode(n,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=Ui.PublicKey.decode(n,"der")),o=c.algorithm.algorithm.join("."),o){case"1.2.840.113549.1.1.1":return Ui.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=Ui.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+o)}case"ENCRYPTED PRIVATE KEY":n=Ui.EncryptedPrivateKey.decode(n,"der"),n=Wwe(n,e);case"PRIVATE KEY":switch(c=Ui.PrivateKey.decode(n,"der"),o=c.algorithm.algorithm.join("."),o){case"1.2.840.113549.1.1.1":return Ui.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:Ui.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=Ui.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+o)}case"RSA PUBLIC KEY":return Ui.RSAPublicKey.decode(n,"der");case"RSA PRIVATE KEY":return Ui.RSAPrivateKey.decode(n,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:Ui.DSAPrivateKey.decode(n,"der")};case"EC PRIVATE KEY":return n=Ui.ECPrivateKey.decode(n,"der"),{curve:n.parameters.value,privateKey:n.privateKey};default:throw new Error("unknown key type "+i)}}wL.signature=Ui.signature;function Wwe(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=$we[t.algorithm.decrypt.cipher.algo.join(".")],o=t.algorithm.decrypt.cipher.iv,c=t.subjectPrivateKey,u=parseInt(n.split("-")[1],10)/8,d=Vwe.pbkdf2Sync(e,r,i,u,"sha1"),y=Kwe.createDecipheriv(n,d,o),E=[];return E.push(y.update(c)),E.push(y.final()),eA.concat(E)}});var tA=F((tqe,Ywe)=>{Ywe.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}});var CL=F((rqe,Eb)=>{"use strict";m();var hi=At().Buffer,Al=o2(),Qwe=Qv(),Jwe=hb().ec,xb=Yv(),Xwe=Ym(),Zwe=tA(),exe=1;function txe(t,e,r,i,n){var o=Xwe(e);if(o.curve){if(i!=="ecdsa"&&i!=="ecdsa/rsa")throw new Error("wrong private key type");return rxe(t,o)}else if(o.type==="dsa"){if(i!=="dsa")throw new Error("wrong private key type");return nxe(t,o,r)}if(i!=="rsa"&&i!=="ecdsa/rsa")throw new Error("wrong private key type");if(e.padding!==void 0&&e.padding!==exe)throw new Error("illegal or unsupported padding mode");t=hi.concat([n,t]);for(var c=o.modulus.byteLength(),u=[0,1];t.length+u.length+10&&r.ishrn(i),r}function oxe(t,e){t=rA(t,e),t=t.mod(e);var r=hi.from(t.toArray());if(r.length{"use strict";m();var nA=At().Buffer,Qm=Yv(),axe=hb().ec,TL=Ym(),cxe=tA();function uxe(t,e,r,i,n){var o=TL(r);if(o.type==="ec"){if(i!=="ecdsa"&&i!=="ecdsa/rsa")throw new Error("wrong public key type");return lxe(t,e,o)}else if(o.type==="dsa"){if(i!=="dsa")throw new Error("wrong public key type");return fxe(t,e,o)}if(i!=="rsa"&&i!=="ecdsa/rsa")throw new Error("wrong public key type");e=nA.concat([n,e]);for(var c=o.modulus.byteLength(),u=[1],d=0;e.length+u.length+2=0)throw new Error("invalid sig")}ML.exports=uxe});var NL=F((iqe,PL)=>{"use strict";m();var Sb=At().Buffer,IL=xd(),Cb=sF(),OL=vt(),dxe=CL(),hxe=RL(),Tl=s2();Object.keys(Tl).forEach(function(t){Tl[t].id=Sb.from(Tl[t].id,"hex"),Tl[t.toLowerCase()]=Tl[t]});function Jm(t){Cb.Writable.call(this);var e=Tl[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=IL(e.hash),this._tag=e.id,this._signType=e.sign}OL(Jm,Cb.Writable);Jm.prototype._write=function(e,r,i){this._hash.update(e),i()};Jm.prototype.update=function(e,r){return this._hash.update(typeof e=="string"?Sb.from(e,r):e),this};Jm.prototype.sign=function(e,r){this.end();var i=this._hash.digest(),n=dxe(i,e,this._hashType,this._signType,this._tag);return r?n.toString(r):n};function Xm(t){Cb.Writable.call(this);var e=Tl[t];if(!e)throw new Error("Unknown message digest");this._hash=IL(e.hash),this._tag=e.id,this._signType=e.sign}OL(Xm,Cb.Writable);Xm.prototype._write=function(e,r,i){this._hash.update(e),i()};Xm.prototype.update=function(e,r){return this._hash.update(typeof e=="string"?Sb.from(e,r):e),this};Xm.prototype.verify=function(e,r,i){var n=typeof r=="string"?Sb.from(r,i):r;this.end();var o=this._hash.digest();return hxe(n,o,e,this._signType,this._tag)};function DL(t){return new Jm(t)}function kL(t){return new Xm(t)}PL.exports={Sign:DL,Verify:kL,createSign:DL,createVerify:kL}});var FL=F((BL,iA)=>{m();(function(t,e){"use strict";function r(_,s){if(!_)throw new Error(s||"Assertion failed")}function i(_,s){_.super_=s;var l=function(){};l.prototype=s.prototype,_.prototype=new l,_.prototype.constructor=_}function n(_,s,l){if(n.isBN(_))return _;this.negative=0,this.words=null,this.length=0,this.red=null,_!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(_||0,s||10,l||"be"))}typeof t=="object"?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ac().Buffer}catch{}n.isBN=function(s){return s instanceof n?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===n.wordSize&&Array.isArray(s.words)},n.max=function(s,l){return s.cmp(l)>0?s:l},n.min=function(s,l){return s.cmp(l)<0?s:l},n.prototype._init=function(s,l,p){if(typeof s=="number")return this._initNumber(s,l,p);if(typeof s=="object")return this._initArray(s,l,p);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f=0;f-=3)b=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[h]|=b<>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);else if(p==="le")for(f=0,h=0;f>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);return this.strip()};function c(_,s){var l=_.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function u(_,s,l){var p=c(_,l);return l-1>=s&&(p|=c(_,l-1)<<4),p}n.prototype._parseHex=function(s,l,p){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f=l;f-=2)w=u(s,l,f)<=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8;else{var g=s.length-l;for(f=g%2===0?l+1:l;f=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8}this.strip()};function d(_,s,l,p){for(var f=0,h=Math.min(_.length,l),b=s;b=49?f+=w-49+10:w>=17?f+=w-17+10:f+=w}return f}n.prototype._parseBase=function(s,l,p){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=l)f++;f--,h=h/l|0;for(var b=s.length-p,w=b%f,g=Math.min(b,b-w)+p,a=0,v=p;v1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(s,l){s=s||10,l=l|0||1;var p;if(s===16||s==="hex"){p="";for(var f=0,h=0,b=0;b>>24-f&16777215,h!==0||b!==this.length-1?p=y[6-g.length]+g+p:p=g+p,f+=2,f>=26&&(f-=26,b--)}for(h!==0&&(p=h.toString(16)+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(s===(s|0)&&s>=2&&s<=36){var a=E[s],v=x[s];p="";var P=this.clone();for(P.negative=0;!P.isZero();){var k=P.modn(v).toString(s);P=P.idivn(v),P.isZero()?p=k+p:p=y[a-k.length]+k+p}for(this.isZero()&&(p="0"+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},n.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},n.prototype.toArrayLike=function(s,l,p){var f=this.byteLength(),h=p||Math.max(1,f);r(f<=h,"byte array longer than desired length"),r(h>0,"Requested array length <= 0"),this.strip();var b=l==="le",w=new s(h),g,a,v=this.clone();if(b){for(a=0;!v.isZero();a++)g=v.andln(255),v.iushrn(8),w[a]=g;for(;a=4096&&(p+=13,l>>>=13),l>=64&&(p+=7,l>>>=7),l>=8&&(p+=4,l>>>=4),l>=2&&(p+=2,l>>>=2),p+l},n.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,p=0;return(l&8191)===0&&(p+=13,l>>>=13),(l&127)===0&&(p+=7,l>>>=7),(l&15)===0&&(p+=4,l>>>=4),(l&3)===0&&(p+=2,l>>>=2),(l&1)===0&&p++,p},n.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function A(_){for(var s=new Array(_.bitLength()),l=0;l>>f}return s}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;ls.length?this.clone().ior(s):s.clone().ior(this)},n.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},n.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var p=0;ps.length?this.clone().iand(s):s.clone().iand(this)},n.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},n.prototype.iuxor=function(s){var l,p;this.length>s.length?(l=this,p=s):(l=s,p=this);for(var f=0;fs.length?this.clone().ixor(s):s.clone().ixor(this)},n.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},n.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,p=s%26;this._expand(l),p>0&&l--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-p),this.strip()},n.prototype.notn=function(s){return this.clone().inotn(s)},n.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var p=s/26|0,f=s%26;return this._expand(p+1),l?this.words[p]=this.words[p]|1<s.length?(p=this,f=s):(p=s,f=this);for(var h=0,b=0;b>>26;for(;h!==0&&b>>26;if(this.length=p.length,h!==0)this.words[this.length]=h,this.length++;else if(p!==this)for(;bs.length?this.clone().iadd(s):s.clone().iadd(this)},n.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var p=this.cmp(s);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;p>0?(f=this,h=s):(f=s,h=this);for(var b=0,w=0;w>26,this.words[w]=l&67108863;for(;b!==0&&w>26,this.words[w]=l&67108863;if(b===0&&w>>26,P=g&67108863,k=Math.min(a,s.length-1),S=Math.max(0,a-_.length+1);S<=k;S++){var B=a-S|0;f=_.words[B]|0,h=s.words[S]|0,b=f*h+P,v+=b/67108864|0,P=b&67108863}l.words[a]=P|0,g=v|0}return g!==0?l.words[a]=g|0:l.length--,l.strip()}var M=function(s,l,p){var f=s.words,h=l.words,b=p.words,w=0,g,a,v,P=f[0]|0,k=P&8191,S=P>>>13,B=f[1]|0,$=B&8191,K=B>>>13,he=f[2]|0,X=he&8191,Z=he>>>13,it=f[3]|0,oe=it&8191,ce=it>>>13,Rt=f[4]|0,ue=Rt&8191,ie=Rt>>>13,bt=f[5]|0,pe=bt&8191,ge=bt>>>13,Ct=f[6]|0,le=Ct&8191,me=Ct>>>13,Ht=f[7]|0,ye=Ht&8191,de=Ht>>>13,Mr=f[8]|0,xe=Mr&8191,Ee=Mr>>>13,Ir=f[9]|0,_e=Ir&8191,we=Ir>>>13,Lr=h[0]|0,De=Lr&8191,Ce=Lr>>>13,$r=h[1]|0,Ae=$r&8191,ke=$r>>>13,Lt=h[2]|0,be=Lt&8191,Te=Lt>>>13,Yr=h[3]|0,ve=Yr&8191,Se=Yr>>>13,Qr=h[4]|0,Ie=Qr&8191,Me=Qr>>>13,Jr=h[5]|0,Pe=Jr&8191,Oe=Jr>>>13,Xr=h[6]|0,Re=Xr&8191,Ne=Xr>>>13,Zr=h[7]|0,Be=Zr&8191,Fe=Zr>>>13,Gr=h[8]|0,Le=Gr&8191,qe=Gr>>>13,en=h[9]|0,Ue=en&8191,je=en>>>13;p.negative=s.negative^l.negative,p.length=19,g=Math.imul(k,De),a=Math.imul(k,Ce),a=a+Math.imul(S,De)|0,v=Math.imul(S,Ce);var gr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(gr>>>26)|0,gr&=67108863,g=Math.imul($,De),a=Math.imul($,Ce),a=a+Math.imul(K,De)|0,v=Math.imul(K,Ce),g=g+Math.imul(k,Ae)|0,a=a+Math.imul(k,ke)|0,a=a+Math.imul(S,Ae)|0,v=v+Math.imul(S,ke)|0;var wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,g=Math.imul(X,De),a=Math.imul(X,Ce),a=a+Math.imul(Z,De)|0,v=Math.imul(Z,Ce),g=g+Math.imul($,Ae)|0,a=a+Math.imul($,ke)|0,a=a+Math.imul(K,Ae)|0,v=v+Math.imul(K,ke)|0,g=g+Math.imul(k,be)|0,a=a+Math.imul(k,Te)|0,a=a+Math.imul(S,be)|0,v=v+Math.imul(S,Te)|0;var xt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,g=Math.imul(oe,De),a=Math.imul(oe,Ce),a=a+Math.imul(ce,De)|0,v=Math.imul(ce,Ce),g=g+Math.imul(X,Ae)|0,a=a+Math.imul(X,ke)|0,a=a+Math.imul(Z,Ae)|0,v=v+Math.imul(Z,ke)|0,g=g+Math.imul($,be)|0,a=a+Math.imul($,Te)|0,a=a+Math.imul(K,be)|0,v=v+Math.imul(K,Te)|0,g=g+Math.imul(k,ve)|0,a=a+Math.imul(k,Se)|0,a=a+Math.imul(S,ve)|0,v=v+Math.imul(S,Se)|0;var or=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(or>>>26)|0,or&=67108863,g=Math.imul(ue,De),a=Math.imul(ue,Ce),a=a+Math.imul(ie,De)|0,v=Math.imul(ie,Ce),g=g+Math.imul(oe,Ae)|0,a=a+Math.imul(oe,ke)|0,a=a+Math.imul(ce,Ae)|0,v=v+Math.imul(ce,ke)|0,g=g+Math.imul(X,be)|0,a=a+Math.imul(X,Te)|0,a=a+Math.imul(Z,be)|0,v=v+Math.imul(Z,Te)|0,g=g+Math.imul($,ve)|0,a=a+Math.imul($,Se)|0,a=a+Math.imul(K,ve)|0,v=v+Math.imul(K,Se)|0,g=g+Math.imul(k,Ie)|0,a=a+Math.imul(k,Me)|0,a=a+Math.imul(S,Ie)|0,v=v+Math.imul(S,Me)|0;var yr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(yr>>>26)|0,yr&=67108863,g=Math.imul(pe,De),a=Math.imul(pe,Ce),a=a+Math.imul(ge,De)|0,v=Math.imul(ge,Ce),g=g+Math.imul(ue,Ae)|0,a=a+Math.imul(ue,ke)|0,a=a+Math.imul(ie,Ae)|0,v=v+Math.imul(ie,ke)|0,g=g+Math.imul(oe,be)|0,a=a+Math.imul(oe,Te)|0,a=a+Math.imul(ce,be)|0,v=v+Math.imul(ce,Te)|0,g=g+Math.imul(X,ve)|0,a=a+Math.imul(X,Se)|0,a=a+Math.imul(Z,ve)|0,v=v+Math.imul(Z,Se)|0,g=g+Math.imul($,Ie)|0,a=a+Math.imul($,Me)|0,a=a+Math.imul(K,Ie)|0,v=v+Math.imul(K,Me)|0,g=g+Math.imul(k,Pe)|0,a=a+Math.imul(k,Oe)|0,a=a+Math.imul(S,Pe)|0,v=v+Math.imul(S,Oe)|0;var lr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(lr>>>26)|0,lr&=67108863,g=Math.imul(le,De),a=Math.imul(le,Ce),a=a+Math.imul(me,De)|0,v=Math.imul(me,Ce),g=g+Math.imul(pe,Ae)|0,a=a+Math.imul(pe,ke)|0,a=a+Math.imul(ge,Ae)|0,v=v+Math.imul(ge,ke)|0,g=g+Math.imul(ue,be)|0,a=a+Math.imul(ue,Te)|0,a=a+Math.imul(ie,be)|0,v=v+Math.imul(ie,Te)|0,g=g+Math.imul(oe,ve)|0,a=a+Math.imul(oe,Se)|0,a=a+Math.imul(ce,ve)|0,v=v+Math.imul(ce,Se)|0,g=g+Math.imul(X,Ie)|0,a=a+Math.imul(X,Me)|0,a=a+Math.imul(Z,Ie)|0,v=v+Math.imul(Z,Me)|0,g=g+Math.imul($,Pe)|0,a=a+Math.imul($,Oe)|0,a=a+Math.imul(K,Pe)|0,v=v+Math.imul(K,Oe)|0,g=g+Math.imul(k,Re)|0,a=a+Math.imul(k,Ne)|0,a=a+Math.imul(S,Re)|0,v=v+Math.imul(S,Ne)|0;var vr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(vr>>>26)|0,vr&=67108863,g=Math.imul(ye,De),a=Math.imul(ye,Ce),a=a+Math.imul(de,De)|0,v=Math.imul(de,Ce),g=g+Math.imul(le,Ae)|0,a=a+Math.imul(le,ke)|0,a=a+Math.imul(me,Ae)|0,v=v+Math.imul(me,ke)|0,g=g+Math.imul(pe,be)|0,a=a+Math.imul(pe,Te)|0,a=a+Math.imul(ge,be)|0,v=v+Math.imul(ge,Te)|0,g=g+Math.imul(ue,ve)|0,a=a+Math.imul(ue,Se)|0,a=a+Math.imul(ie,ve)|0,v=v+Math.imul(ie,Se)|0,g=g+Math.imul(oe,Ie)|0,a=a+Math.imul(oe,Me)|0,a=a+Math.imul(ce,Ie)|0,v=v+Math.imul(ce,Me)|0,g=g+Math.imul(X,Pe)|0,a=a+Math.imul(X,Oe)|0,a=a+Math.imul(Z,Pe)|0,v=v+Math.imul(Z,Oe)|0,g=g+Math.imul($,Re)|0,a=a+Math.imul($,Ne)|0,a=a+Math.imul(K,Re)|0,v=v+Math.imul(K,Ne)|0,g=g+Math.imul(k,Be)|0,a=a+Math.imul(k,Fe)|0,a=a+Math.imul(S,Be)|0,v=v+Math.imul(S,Fe)|0;var br=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(br>>>26)|0,br&=67108863,g=Math.imul(xe,De),a=Math.imul(xe,Ce),a=a+Math.imul(Ee,De)|0,v=Math.imul(Ee,Ce),g=g+Math.imul(ye,Ae)|0,a=a+Math.imul(ye,ke)|0,a=a+Math.imul(de,Ae)|0,v=v+Math.imul(de,ke)|0,g=g+Math.imul(le,be)|0,a=a+Math.imul(le,Te)|0,a=a+Math.imul(me,be)|0,v=v+Math.imul(me,Te)|0,g=g+Math.imul(pe,ve)|0,a=a+Math.imul(pe,Se)|0,a=a+Math.imul(ge,ve)|0,v=v+Math.imul(ge,Se)|0,g=g+Math.imul(ue,Ie)|0,a=a+Math.imul(ue,Me)|0,a=a+Math.imul(ie,Ie)|0,v=v+Math.imul(ie,Me)|0,g=g+Math.imul(oe,Pe)|0,a=a+Math.imul(oe,Oe)|0,a=a+Math.imul(ce,Pe)|0,v=v+Math.imul(ce,Oe)|0,g=g+Math.imul(X,Re)|0,a=a+Math.imul(X,Ne)|0,a=a+Math.imul(Z,Re)|0,v=v+Math.imul(Z,Ne)|0,g=g+Math.imul($,Be)|0,a=a+Math.imul($,Fe)|0,a=a+Math.imul(K,Be)|0,v=v+Math.imul(K,Fe)|0,g=g+Math.imul(k,Le)|0,a=a+Math.imul(k,qe)|0,a=a+Math.imul(S,Le)|0,v=v+Math.imul(S,qe)|0;var _r=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(_r>>>26)|0,_r&=67108863,g=Math.imul(_e,De),a=Math.imul(_e,Ce),a=a+Math.imul(we,De)|0,v=Math.imul(we,Ce),g=g+Math.imul(xe,Ae)|0,a=a+Math.imul(xe,ke)|0,a=a+Math.imul(Ee,Ae)|0,v=v+Math.imul(Ee,ke)|0,g=g+Math.imul(ye,be)|0,a=a+Math.imul(ye,Te)|0,a=a+Math.imul(de,be)|0,v=v+Math.imul(de,Te)|0,g=g+Math.imul(le,ve)|0,a=a+Math.imul(le,Se)|0,a=a+Math.imul(me,ve)|0,v=v+Math.imul(me,Se)|0,g=g+Math.imul(pe,Ie)|0,a=a+Math.imul(pe,Me)|0,a=a+Math.imul(ge,Ie)|0,v=v+Math.imul(ge,Me)|0,g=g+Math.imul(ue,Pe)|0,a=a+Math.imul(ue,Oe)|0,a=a+Math.imul(ie,Pe)|0,v=v+Math.imul(ie,Oe)|0,g=g+Math.imul(oe,Re)|0,a=a+Math.imul(oe,Ne)|0,a=a+Math.imul(ce,Re)|0,v=v+Math.imul(ce,Ne)|0,g=g+Math.imul(X,Be)|0,a=a+Math.imul(X,Fe)|0,a=a+Math.imul(Z,Be)|0,v=v+Math.imul(Z,Fe)|0,g=g+Math.imul($,Le)|0,a=a+Math.imul($,qe)|0,a=a+Math.imul(K,Le)|0,v=v+Math.imul(K,qe)|0,g=g+Math.imul(k,Ue)|0,a=a+Math.imul(k,je)|0,a=a+Math.imul(S,Ue)|0,v=v+Math.imul(S,je)|0;var wr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wr>>>26)|0,wr&=67108863,g=Math.imul(_e,Ae),a=Math.imul(_e,ke),a=a+Math.imul(we,Ae)|0,v=Math.imul(we,ke),g=g+Math.imul(xe,be)|0,a=a+Math.imul(xe,Te)|0,a=a+Math.imul(Ee,be)|0,v=v+Math.imul(Ee,Te)|0,g=g+Math.imul(ye,ve)|0,a=a+Math.imul(ye,Se)|0,a=a+Math.imul(de,ve)|0,v=v+Math.imul(de,Se)|0,g=g+Math.imul(le,Ie)|0,a=a+Math.imul(le,Me)|0,a=a+Math.imul(me,Ie)|0,v=v+Math.imul(me,Me)|0,g=g+Math.imul(pe,Pe)|0,a=a+Math.imul(pe,Oe)|0,a=a+Math.imul(ge,Pe)|0,v=v+Math.imul(ge,Oe)|0,g=g+Math.imul(ue,Re)|0,a=a+Math.imul(ue,Ne)|0,a=a+Math.imul(ie,Re)|0,v=v+Math.imul(ie,Ne)|0,g=g+Math.imul(oe,Be)|0,a=a+Math.imul(oe,Fe)|0,a=a+Math.imul(ce,Be)|0,v=v+Math.imul(ce,Fe)|0,g=g+Math.imul(X,Le)|0,a=a+Math.imul(X,qe)|0,a=a+Math.imul(Z,Le)|0,v=v+Math.imul(Z,qe)|0,g=g+Math.imul($,Ue)|0,a=a+Math.imul($,je)|0,a=a+Math.imul(K,Ue)|0,v=v+Math.imul(K,je)|0;var tr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(tr>>>26)|0,tr&=67108863,g=Math.imul(_e,be),a=Math.imul(_e,Te),a=a+Math.imul(we,be)|0,v=Math.imul(we,Te),g=g+Math.imul(xe,ve)|0,a=a+Math.imul(xe,Se)|0,a=a+Math.imul(Ee,ve)|0,v=v+Math.imul(Ee,Se)|0,g=g+Math.imul(ye,Ie)|0,a=a+Math.imul(ye,Me)|0,a=a+Math.imul(de,Ie)|0,v=v+Math.imul(de,Me)|0,g=g+Math.imul(le,Pe)|0,a=a+Math.imul(le,Oe)|0,a=a+Math.imul(me,Pe)|0,v=v+Math.imul(me,Oe)|0,g=g+Math.imul(pe,Re)|0,a=a+Math.imul(pe,Ne)|0,a=a+Math.imul(ge,Re)|0,v=v+Math.imul(ge,Ne)|0,g=g+Math.imul(ue,Be)|0,a=a+Math.imul(ue,Fe)|0,a=a+Math.imul(ie,Be)|0,v=v+Math.imul(ie,Fe)|0,g=g+Math.imul(oe,Le)|0,a=a+Math.imul(oe,qe)|0,a=a+Math.imul(ce,Le)|0,v=v+Math.imul(ce,qe)|0,g=g+Math.imul(X,Ue)|0,a=a+Math.imul(X,je)|0,a=a+Math.imul(Z,Ue)|0,v=v+Math.imul(Z,je)|0;var Wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,g=Math.imul(_e,ve),a=Math.imul(_e,Se),a=a+Math.imul(we,ve)|0,v=Math.imul(we,Se),g=g+Math.imul(xe,Ie)|0,a=a+Math.imul(xe,Me)|0,a=a+Math.imul(Ee,Ie)|0,v=v+Math.imul(Ee,Me)|0,g=g+Math.imul(ye,Pe)|0,a=a+Math.imul(ye,Oe)|0,a=a+Math.imul(de,Pe)|0,v=v+Math.imul(de,Oe)|0,g=g+Math.imul(le,Re)|0,a=a+Math.imul(le,Ne)|0,a=a+Math.imul(me,Re)|0,v=v+Math.imul(me,Ne)|0,g=g+Math.imul(pe,Be)|0,a=a+Math.imul(pe,Fe)|0,a=a+Math.imul(ge,Be)|0,v=v+Math.imul(ge,Fe)|0,g=g+Math.imul(ue,Le)|0,a=a+Math.imul(ue,qe)|0,a=a+Math.imul(ie,Le)|0,v=v+Math.imul(ie,qe)|0,g=g+Math.imul(oe,Ue)|0,a=a+Math.imul(oe,je)|0,a=a+Math.imul(ce,Ue)|0,v=v+Math.imul(ce,je)|0;var fr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(fr>>>26)|0,fr&=67108863,g=Math.imul(_e,Ie),a=Math.imul(_e,Me),a=a+Math.imul(we,Ie)|0,v=Math.imul(we,Me),g=g+Math.imul(xe,Pe)|0,a=a+Math.imul(xe,Oe)|0,a=a+Math.imul(Ee,Pe)|0,v=v+Math.imul(Ee,Oe)|0,g=g+Math.imul(ye,Re)|0,a=a+Math.imul(ye,Ne)|0,a=a+Math.imul(de,Re)|0,v=v+Math.imul(de,Ne)|0,g=g+Math.imul(le,Be)|0,a=a+Math.imul(le,Fe)|0,a=a+Math.imul(me,Be)|0,v=v+Math.imul(me,Fe)|0,g=g+Math.imul(pe,Le)|0,a=a+Math.imul(pe,qe)|0,a=a+Math.imul(ge,Le)|0,v=v+Math.imul(ge,qe)|0,g=g+Math.imul(ue,Ue)|0,a=a+Math.imul(ue,je)|0,a=a+Math.imul(ie,Ue)|0,v=v+Math.imul(ie,je)|0;var Yt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,g=Math.imul(_e,Pe),a=Math.imul(_e,Oe),a=a+Math.imul(we,Pe)|0,v=Math.imul(we,Oe),g=g+Math.imul(xe,Re)|0,a=a+Math.imul(xe,Ne)|0,a=a+Math.imul(Ee,Re)|0,v=v+Math.imul(Ee,Ne)|0,g=g+Math.imul(ye,Be)|0,a=a+Math.imul(ye,Fe)|0,a=a+Math.imul(de,Be)|0,v=v+Math.imul(de,Fe)|0,g=g+Math.imul(le,Le)|0,a=a+Math.imul(le,qe)|0,a=a+Math.imul(me,Le)|0,v=v+Math.imul(me,qe)|0,g=g+Math.imul(pe,Ue)|0,a=a+Math.imul(pe,je)|0,a=a+Math.imul(ge,Ue)|0,v=v+Math.imul(ge,je)|0;var dr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(dr>>>26)|0,dr&=67108863,g=Math.imul(_e,Re),a=Math.imul(_e,Ne),a=a+Math.imul(we,Re)|0,v=Math.imul(we,Ne),g=g+Math.imul(xe,Be)|0,a=a+Math.imul(xe,Fe)|0,a=a+Math.imul(Ee,Be)|0,v=v+Math.imul(Ee,Fe)|0,g=g+Math.imul(ye,Le)|0,a=a+Math.imul(ye,qe)|0,a=a+Math.imul(de,Le)|0,v=v+Math.imul(de,qe)|0,g=g+Math.imul(le,Ue)|0,a=a+Math.imul(le,je)|0,a=a+Math.imul(me,Ue)|0,v=v+Math.imul(me,je)|0;var rr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(rr>>>26)|0,rr&=67108863,g=Math.imul(_e,Be),a=Math.imul(_e,Fe),a=a+Math.imul(we,Be)|0,v=Math.imul(we,Fe),g=g+Math.imul(xe,Le)|0,a=a+Math.imul(xe,qe)|0,a=a+Math.imul(Ee,Le)|0,v=v+Math.imul(Ee,qe)|0,g=g+Math.imul(ye,Ue)|0,a=a+Math.imul(ye,je)|0,a=a+Math.imul(de,Ue)|0,v=v+Math.imul(de,je)|0;var nr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(nr>>>26)|0,nr&=67108863,g=Math.imul(_e,Le),a=Math.imul(_e,qe),a=a+Math.imul(we,Le)|0,v=Math.imul(we,qe),g=g+Math.imul(xe,Ue)|0,a=a+Math.imul(xe,je)|0,a=a+Math.imul(Ee,Ue)|0,v=v+Math.imul(Ee,je)|0;var hr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(hr>>>26)|0,hr&=67108863,g=Math.imul(_e,Ue),a=Math.imul(_e,je),a=a+Math.imul(we,Ue)|0,v=Math.imul(we,je);var xr=(w+g|0)+((a&8191)<<13)|0;return w=(v+(a>>>13)|0)+(xr>>>26)|0,xr&=67108863,b[0]=gr,b[1]=wt,b[2]=xt,b[3]=or,b[4]=yr,b[5]=lr,b[6]=vr,b[7]=br,b[8]=_r,b[9]=wr,b[10]=tr,b[11]=Wt,b[12]=fr,b[13]=Yt,b[14]=dr,b[15]=rr,b[16]=nr,b[17]=hr,b[18]=xr,w!==0&&(b[19]=w,p.length++),p};Math.imul||(M=R);function I(_,s,l){l.negative=s.negative^_.negative,l.length=_.length+s.length;for(var p=0,f=0,h=0;h>>26)|0,f+=b>>>26,b&=67108863}l.words[h]=w,p=b,b=f}return p!==0?l.words[h]=p:l.length--,l.strip()}function D(_,s,l){var p=new O;return p.mulp(_,s,l)}n.prototype.mulTo=function(s,l){var p,f=this.length+s.length;return this.length===10&&s.length===10?p=M(this,s,l):f<63?p=R(this,s,l):f<1024?p=I(this,s,l):p=D(this,s,l),p};function O(_,s){this.x=_,this.y=s}O.prototype.makeRBT=function(s){for(var l=new Array(s),p=n.prototype._countBits(s)-1,f=0;f>=1;return f},O.prototype.permute=function(s,l,p,f,h,b){for(var w=0;w>>1)h++;return 1<>>13,p[2*b+1]=h&8191,h=h>>>13;for(b=2*l;b>=26,l+=f/67108864|0,l+=h>>>26,this.words[p]=h&67108863}return l!==0&&(this.words[p]=l,this.length++),this},n.prototype.muln=function(s){return this.clone().imuln(s)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(s){var l=A(s);if(l.length===0)return new n(1);for(var p=this,f=0;f=0);var l=s%26,p=(s-l)/26,f=67108863>>>26-l<<26-l,h;if(l!==0){var b=0;for(h=0;h>>26-l}b&&(this.words[h]=b,this.length++)}if(p!==0){for(h=this.length-1;h>=0;h--)this.words[h+p]=this.words[h];for(h=0;h=0);var f;l?f=(l-l%26)/26:f=0;var h=s%26,b=Math.min((s-h)/26,this.length),w=67108863^67108863>>>h<b)for(this.length-=b,a=0;a=0&&(v!==0||a>=f);a--){var P=this.words[a]|0;this.words[a]=v<<26-h|P>>>h,v=P&w}return g&&v!==0&&(g.words[g.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(s,l,p){return r(this.negative===0),this.iushrn(s,l,p)},n.prototype.shln=function(s){return this.clone().ishln(s)},n.prototype.ushln=function(s){return this.clone().iushln(s)},n.prototype.shrn=function(s){return this.clone().ishrn(s)},n.prototype.ushrn=function(s){return this.clone().iushrn(s)},n.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,p=(s-l)/26,f=1<=0);var l=s%26,p=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(l!==0&&p++,this.length=Math.min(p,this.length),l!==0){var f=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},n.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(g/67108864|0),this.words[h+p]=b&67108863}for(;h>26,this.words[h+p]=b&67108863;if(w===0)return this.strip();for(r(w===-1),w=0,h=0;h>26,this.words[h]=b&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(s,l){var p=this.length-s.length,f=this.clone(),h=s,b=h.words[h.length-1]|0,w=this._countBits(b);p=26-w,p!==0&&(h=h.ushln(p),f.iushln(p),b=h.words[h.length-1]|0);var g=f.length-h.length,a;if(l!=="mod"){a=new n(null),a.length=g+1,a.words=new Array(a.length);for(var v=0;v=0;k--){var S=(f.words[h.length+k]|0)*67108864+(f.words[h.length+k-1]|0);for(S=Math.min(S/b|0,67108863),f._ishlnsubmul(h,S,k);f.negative!==0;)S--,f.negative=0,f._ishlnsubmul(h,1,k),f.isZero()||(f.negative^=1);a&&(a.words[k]=S)}return a&&a.strip(),f.strip(),l!=="div"&&p!==0&&f.iushrn(p),{div:a||null,mod:f}},n.prototype.divmod=function(s,l,p){if(r(!s.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,b;return this.negative!==0&&s.negative===0?(b=this.neg().divmod(s,l),l!=="mod"&&(f=b.div.neg()),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.iadd(s)),{div:f,mod:h}):this.negative===0&&s.negative!==0?(b=this.divmod(s.neg(),l),l!=="mod"&&(f=b.div.neg()),{div:f,mod:b.mod}):(this.negative&s.negative)!==0?(b=this.neg().divmod(s.neg(),l),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.isub(s)),{div:b.div,mod:h}):s.length>this.length||this.cmp(s)<0?{div:new n(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new n(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new n(this.modn(s.words[0]))}:this._wordDiv(s,l)},n.prototype.div=function(s){return this.divmod(s,"div",!1).div},n.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},n.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},n.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var p=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),h=s.andln(1),b=p.cmp(f);return b<0||h===1&&b===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},n.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,p=0,f=this.length-1;f>=0;f--)p=(l*p+(this.words[f]|0))%s;return p},n.prototype.idivn=function(s){r(s<=67108863);for(var l=0,p=this.length-1;p>=0;p--){var f=(this.words[p]|0)+l*67108864;this.words[p]=f/s|0,l=f%s}return this.strip()},n.prototype.divn=function(s){return this.clone().idivn(s)},n.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=new n(0),w=new n(1),g=0;l.isEven()&&p.isEven();)l.iushrn(1),p.iushrn(1),++g;for(var a=p.clone(),v=l.clone();!l.isZero();){for(var P=0,k=1;(l.words[0]&k)===0&&P<26;++P,k<<=1);if(P>0)for(l.iushrn(P);P-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(a),h.isub(v)),f.iushrn(1),h.iushrn(1);for(var S=0,B=1;(p.words[0]&B)===0&&S<26;++S,B<<=1);if(S>0)for(p.iushrn(S);S-- >0;)(b.isOdd()||w.isOdd())&&(b.iadd(a),w.isub(v)),b.iushrn(1),w.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(b),h.isub(w)):(p.isub(l),b.isub(f),w.isub(h))}return{a:b,b:w,gcd:p.iushln(g)}},n.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=p.clone();l.cmpn(1)>0&&p.cmpn(1)>0;){for(var w=0,g=1;(l.words[0]&g)===0&&w<26;++w,g<<=1);if(w>0)for(l.iushrn(w);w-- >0;)f.isOdd()&&f.iadd(b),f.iushrn(1);for(var a=0,v=1;(p.words[0]&v)===0&&a<26;++a,v<<=1);if(a>0)for(p.iushrn(a);a-- >0;)h.isOdd()&&h.iadd(b),h.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(h)):(p.isub(l),h.isub(f))}var P;return l.cmpn(1)===0?P=f:P=h,P.cmpn(0)<0&&P.iadd(s),P},n.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),p=s.clone();l.negative=0,p.negative=0;for(var f=0;l.isEven()&&p.isEven();f++)l.iushrn(1),p.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;p.isEven();)p.iushrn(1);var h=l.cmp(p);if(h<0){var b=l;l=p,p=b}else if(h===0||p.cmpn(1)===0)break;l.isub(p)}while(!0);return p.iushln(f)},n.prototype.invm=function(s){return this.egcd(s).a.umod(s)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(s){return this.words[0]&s},n.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,p=(s-l)/26,f=1<>>26,w&=67108863,this.words[b]=w}return h!==0&&(this.words[b]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var p;if(this.length>1)p=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;p=f===s?0:fs.length)return 1;if(this.length=0;p--){var f=this.words[p]|0,h=s.words[p]|0;if(f!==h){fh&&(l=1);break}}return l},n.prototype.gtn=function(s){return this.cmpn(s)===1},n.prototype.gt=function(s){return this.cmp(s)===1},n.prototype.gten=function(s){return this.cmpn(s)>=0},n.prototype.gte=function(s){return this.cmp(s)>=0},n.prototype.ltn=function(s){return this.cmpn(s)===-1},n.prototype.lt=function(s){return this.cmp(s)===-1},n.prototype.lten=function(s){return this.cmpn(s)<=0},n.prototype.lte=function(s){return this.cmp(s)<=0},n.prototype.eqn=function(s){return this.cmpn(s)===0},n.prototype.eq=function(s){return this.cmp(s)===0},n.red=function(s){return new q(s)},n.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(s){return this.red=s,this},n.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},n.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},n.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},n.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},n.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},n.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},n.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},n.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var N={k256:null,p224:null,p192:null,p25519:null};function L(_,s){this.name=_,this.p=new n(s,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var s=new n(null);return s.words=new Array(Math.ceil(this.n/13)),s},L.prototype.ireduce=function(s){var l=s,p;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),p=l.bitLength();while(p>this.n);var f=p0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},L.prototype.split=function(s,l){s.iushrn(this.n,0,l)},L.prototype.imulK=function(s){return s.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,L),j.prototype.split=function(s,l){for(var p=4194303,f=Math.min(s.length,9),h=0;h>>22,b=w}b>>>=22,s.words[h-10]=b,b===0&&s.length>10?s.length-=10:s.length-=9},j.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,p=0;p>>=26,s.words[p]=h,l=f}return l!==0&&(s.words[s.length++]=l),s},n._prime=function(s){if(N[s])return N[s];var l;if(s==="k256")l=new j;else if(s==="p224")l=new H;else if(s==="p192")l=new Y;else if(s==="p25519")l=new W;else throw new Error("Unknown prime "+s);return N[s]=l,l};function q(_){if(typeof _=="string"){var s=n._prime(_);this.m=s.p,this.prime=s}else r(_.gtn(1),"modulus must be greater than 1"),this.m=_,this.prime=null}q.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},q.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},q.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},q.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},q.prototype.add=function(s,l){this._verify2(s,l);var p=s.add(l);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},q.prototype.iadd=function(s,l){this._verify2(s,l);var p=s.iadd(l);return p.cmp(this.m)>=0&&p.isub(this.m),p},q.prototype.sub=function(s,l){this._verify2(s,l);var p=s.sub(l);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},q.prototype.isub=function(s,l){this._verify2(s,l);var p=s.isub(l);return p.cmpn(0)<0&&p.iadd(this.m),p},q.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},q.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},q.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},q.prototype.isqr=function(s){return this.imul(s,s.clone())},q.prototype.sqr=function(s){return this.mul(s,s)},q.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var p=this.m.add(new n(1)).iushrn(2);return this.pow(s,p)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);r(!f.isZero());var b=new n(1).toRed(this),w=b.redNeg(),g=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new n(2*a*a).toRed(this);this.pow(a,g).cmp(w)!==0;)a.redIAdd(w);for(var v=this.pow(a,f),P=this.pow(s,f.addn(1).iushrn(1)),k=this.pow(s,f),S=h;k.cmp(b)!==0;){for(var B=k,$=0;B.cmp(b)!==0;$++)B=B.redSqr();r($=0;h--){for(var v=l.words[h],P=a-1;P>=0;P--){var k=v>>P&1;if(b!==f[0]&&(b=this.sqr(b)),k===0&&w===0){g=0;continue}w<<=1,w|=k,g++,!(g!==p&&(h!==0||P!==0))&&(b=this.mul(b,f[w]),g=0,w=0)}a=26}return b},q.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},q.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},n.mont=function(s){return new J(s)};function J(_){q.call(this,_),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(J,q),J.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},J.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},J.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var p=s.imul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new n(0)._forceRed(this);var p=s.mul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof iA>"u"||iA,BL)});var qL=F((oqe,LL)=>{m();var pxe=hb(),mxe=FL();LL.exports=function(e){return new Ml(e)};var ro={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};ro.p224=ro.secp224r1;ro.p256=ro.secp256r1=ro.prime256v1;ro.p192=ro.secp192r1=ro.prime192v1;ro.p384=ro.secp384r1;ro.p521=ro.secp521r1;function Ml(t){this.curveType=ro[t],this.curveType||(this.curveType={name:t}),this.curve=new pxe.ec(this.curveType.name),this.keys=void 0}Ml.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)};Ml.prototype.computeSecret=function(t,e,r){e=e||"utf8",T.isBuffer(t)||(t=new T(t,e));var i=this.curve.keyFromPublic(t).getPublic(),n=i.mul(this.keys.getPrivate()).getX();return oA(n,r,this.curveType.byteLength)};Ml.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic(e==="compressed",!0);return e==="hybrid"&&(r[r.length-1]%2?r[0]=7:r[0]=6),oA(r,t)};Ml.prototype.getPrivateKey=function(t){return oA(this.keys.getPrivate(),t)};Ml.prototype.setPublicKey=function(t,e){return e=e||"utf8",T.isBuffer(t)||(t=new T(t,e)),this.keys._importPublic(t),this};Ml.prototype.setPrivateKey=function(t,e){e=e||"utf8",T.isBuffer(t)||(t=new T(t,e));var r=new mxe(t);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this};function oA(t,e,r){Array.isArray(t)||(t=t.toArray());var i=new T(t);if(r&&i.length{m();var gxe=xd(),sA=At().Buffer;UL.exports=function(t,e){for(var r=sA.alloc(0),i=0,n;r.length{m();jL.exports=function(e,r){for(var i=e.length,n=-1;++n{m();(function(t,e){"use strict";function r(_,s){if(!_)throw new Error(s||"Assertion failed")}function i(_,s){_.super_=s;var l=function(){};l.prototype=s.prototype,_.prototype=new l,_.prototype.constructor=_}function n(_,s,l){if(n.isBN(_))return _;this.negative=0,this.words=null,this.length=0,this.red=null,_!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(_||0,s||10,l||"be"))}typeof t=="object"?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ac().Buffer}catch{}n.isBN=function(s){return s instanceof n?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===n.wordSize&&Array.isArray(s.words)},n.max=function(s,l){return s.cmp(l)>0?s:l},n.min=function(s,l){return s.cmp(l)<0?s:l},n.prototype._init=function(s,l,p){if(typeof s=="number")return this._initNumber(s,l,p);if(typeof s=="object")return this._initArray(s,l,p);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f=0;f-=3)b=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[h]|=b<>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);else if(p==="le")for(f=0,h=0;f>>26-w&67108863,w+=24,w>=26&&(w-=26,h++);return this.strip()};function c(_,s){var l=_.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function u(_,s,l){var p=c(_,l);return l-1>=s&&(p|=c(_,l-1)<<4),p}n.prototype._parseHex=function(s,l,p){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f=l;f-=2)w=u(s,l,f)<=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8;else{var g=s.length-l;for(f=g%2===0?l+1:l;f=18?(h-=18,b+=1,this.words[b]|=w>>>26):h+=8}this.strip()};function d(_,s,l,p){for(var f=0,h=Math.min(_.length,l),b=s;b=49?f+=w-49+10:w>=17?f+=w-17+10:f+=w}return f}n.prototype._parseBase=function(s,l,p){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=l)f++;f--,h=h/l|0;for(var b=s.length-p,w=b%f,g=Math.min(b,b-w)+p,a=0,v=p;v1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(s,l){s=s||10,l=l|0||1;var p;if(s===16||s==="hex"){p="";for(var f=0,h=0,b=0;b>>24-f&16777215,h!==0||b!==this.length-1?p=y[6-g.length]+g+p:p=g+p,f+=2,f>=26&&(f-=26,b--)}for(h!==0&&(p=h.toString(16)+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(s===(s|0)&&s>=2&&s<=36){var a=E[s],v=x[s];p="";var P=this.clone();for(P.negative=0;!P.isZero();){var k=P.modn(v).toString(s);P=P.idivn(v),P.isZero()?p=k+p:p=y[a-k.length]+k+p}for(this.isZero()&&(p="0"+p);p.length%l!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},n.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},n.prototype.toArrayLike=function(s,l,p){var f=this.byteLength(),h=p||Math.max(1,f);r(f<=h,"byte array longer than desired length"),r(h>0,"Requested array length <= 0"),this.strip();var b=l==="le",w=new s(h),g,a,v=this.clone();if(b){for(a=0;!v.isZero();a++)g=v.andln(255),v.iushrn(8),w[a]=g;for(;a=4096&&(p+=13,l>>>=13),l>=64&&(p+=7,l>>>=7),l>=8&&(p+=4,l>>>=4),l>=2&&(p+=2,l>>>=2),p+l},n.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,p=0;return(l&8191)===0&&(p+=13,l>>>=13),(l&127)===0&&(p+=7,l>>>=7),(l&15)===0&&(p+=4,l>>>=4),(l&3)===0&&(p+=2,l>>>=2),(l&1)===0&&p++,p},n.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function A(_){for(var s=new Array(_.bitLength()),l=0;l>>f}return s}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;ls.length?this.clone().ior(s):s.clone().ior(this)},n.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},n.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var p=0;ps.length?this.clone().iand(s):s.clone().iand(this)},n.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},n.prototype.iuxor=function(s){var l,p;this.length>s.length?(l=this,p=s):(l=s,p=this);for(var f=0;fs.length?this.clone().ixor(s):s.clone().ixor(this)},n.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},n.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,p=s%26;this._expand(l),p>0&&l--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-p),this.strip()},n.prototype.notn=function(s){return this.clone().inotn(s)},n.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var p=s/26|0,f=s%26;return this._expand(p+1),l?this.words[p]=this.words[p]|1<s.length?(p=this,f=s):(p=s,f=this);for(var h=0,b=0;b>>26;for(;h!==0&&b>>26;if(this.length=p.length,h!==0)this.words[this.length]=h,this.length++;else if(p!==this)for(;bs.length?this.clone().iadd(s):s.clone().iadd(this)},n.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var p=this.cmp(s);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;p>0?(f=this,h=s):(f=s,h=this);for(var b=0,w=0;w>26,this.words[w]=l&67108863;for(;b!==0&&w>26,this.words[w]=l&67108863;if(b===0&&w>>26,P=g&67108863,k=Math.min(a,s.length-1),S=Math.max(0,a-_.length+1);S<=k;S++){var B=a-S|0;f=_.words[B]|0,h=s.words[S]|0,b=f*h+P,v+=b/67108864|0,P=b&67108863}l.words[a]=P|0,g=v|0}return g!==0?l.words[a]=g|0:l.length--,l.strip()}var M=function(s,l,p){var f=s.words,h=l.words,b=p.words,w=0,g,a,v,P=f[0]|0,k=P&8191,S=P>>>13,B=f[1]|0,$=B&8191,K=B>>>13,he=f[2]|0,X=he&8191,Z=he>>>13,it=f[3]|0,oe=it&8191,ce=it>>>13,Rt=f[4]|0,ue=Rt&8191,ie=Rt>>>13,bt=f[5]|0,pe=bt&8191,ge=bt>>>13,Ct=f[6]|0,le=Ct&8191,me=Ct>>>13,Ht=f[7]|0,ye=Ht&8191,de=Ht>>>13,Mr=f[8]|0,xe=Mr&8191,Ee=Mr>>>13,Ir=f[9]|0,_e=Ir&8191,we=Ir>>>13,Lr=h[0]|0,De=Lr&8191,Ce=Lr>>>13,$r=h[1]|0,Ae=$r&8191,ke=$r>>>13,Lt=h[2]|0,be=Lt&8191,Te=Lt>>>13,Yr=h[3]|0,ve=Yr&8191,Se=Yr>>>13,Qr=h[4]|0,Ie=Qr&8191,Me=Qr>>>13,Jr=h[5]|0,Pe=Jr&8191,Oe=Jr>>>13,Xr=h[6]|0,Re=Xr&8191,Ne=Xr>>>13,Zr=h[7]|0,Be=Zr&8191,Fe=Zr>>>13,Gr=h[8]|0,Le=Gr&8191,qe=Gr>>>13,en=h[9]|0,Ue=en&8191,je=en>>>13;p.negative=s.negative^l.negative,p.length=19,g=Math.imul(k,De),a=Math.imul(k,Ce),a=a+Math.imul(S,De)|0,v=Math.imul(S,Ce);var gr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(gr>>>26)|0,gr&=67108863,g=Math.imul($,De),a=Math.imul($,Ce),a=a+Math.imul(K,De)|0,v=Math.imul(K,Ce),g=g+Math.imul(k,Ae)|0,a=a+Math.imul(k,ke)|0,a=a+Math.imul(S,Ae)|0,v=v+Math.imul(S,ke)|0;var wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,g=Math.imul(X,De),a=Math.imul(X,Ce),a=a+Math.imul(Z,De)|0,v=Math.imul(Z,Ce),g=g+Math.imul($,Ae)|0,a=a+Math.imul($,ke)|0,a=a+Math.imul(K,Ae)|0,v=v+Math.imul(K,ke)|0,g=g+Math.imul(k,be)|0,a=a+Math.imul(k,Te)|0,a=a+Math.imul(S,be)|0,v=v+Math.imul(S,Te)|0;var xt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,g=Math.imul(oe,De),a=Math.imul(oe,Ce),a=a+Math.imul(ce,De)|0,v=Math.imul(ce,Ce),g=g+Math.imul(X,Ae)|0,a=a+Math.imul(X,ke)|0,a=a+Math.imul(Z,Ae)|0,v=v+Math.imul(Z,ke)|0,g=g+Math.imul($,be)|0,a=a+Math.imul($,Te)|0,a=a+Math.imul(K,be)|0,v=v+Math.imul(K,Te)|0,g=g+Math.imul(k,ve)|0,a=a+Math.imul(k,Se)|0,a=a+Math.imul(S,ve)|0,v=v+Math.imul(S,Se)|0;var or=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(or>>>26)|0,or&=67108863,g=Math.imul(ue,De),a=Math.imul(ue,Ce),a=a+Math.imul(ie,De)|0,v=Math.imul(ie,Ce),g=g+Math.imul(oe,Ae)|0,a=a+Math.imul(oe,ke)|0,a=a+Math.imul(ce,Ae)|0,v=v+Math.imul(ce,ke)|0,g=g+Math.imul(X,be)|0,a=a+Math.imul(X,Te)|0,a=a+Math.imul(Z,be)|0,v=v+Math.imul(Z,Te)|0,g=g+Math.imul($,ve)|0,a=a+Math.imul($,Se)|0,a=a+Math.imul(K,ve)|0,v=v+Math.imul(K,Se)|0,g=g+Math.imul(k,Ie)|0,a=a+Math.imul(k,Me)|0,a=a+Math.imul(S,Ie)|0,v=v+Math.imul(S,Me)|0;var yr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(yr>>>26)|0,yr&=67108863,g=Math.imul(pe,De),a=Math.imul(pe,Ce),a=a+Math.imul(ge,De)|0,v=Math.imul(ge,Ce),g=g+Math.imul(ue,Ae)|0,a=a+Math.imul(ue,ke)|0,a=a+Math.imul(ie,Ae)|0,v=v+Math.imul(ie,ke)|0,g=g+Math.imul(oe,be)|0,a=a+Math.imul(oe,Te)|0,a=a+Math.imul(ce,be)|0,v=v+Math.imul(ce,Te)|0,g=g+Math.imul(X,ve)|0,a=a+Math.imul(X,Se)|0,a=a+Math.imul(Z,ve)|0,v=v+Math.imul(Z,Se)|0,g=g+Math.imul($,Ie)|0,a=a+Math.imul($,Me)|0,a=a+Math.imul(K,Ie)|0,v=v+Math.imul(K,Me)|0,g=g+Math.imul(k,Pe)|0,a=a+Math.imul(k,Oe)|0,a=a+Math.imul(S,Pe)|0,v=v+Math.imul(S,Oe)|0;var lr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(lr>>>26)|0,lr&=67108863,g=Math.imul(le,De),a=Math.imul(le,Ce),a=a+Math.imul(me,De)|0,v=Math.imul(me,Ce),g=g+Math.imul(pe,Ae)|0,a=a+Math.imul(pe,ke)|0,a=a+Math.imul(ge,Ae)|0,v=v+Math.imul(ge,ke)|0,g=g+Math.imul(ue,be)|0,a=a+Math.imul(ue,Te)|0,a=a+Math.imul(ie,be)|0,v=v+Math.imul(ie,Te)|0,g=g+Math.imul(oe,ve)|0,a=a+Math.imul(oe,Se)|0,a=a+Math.imul(ce,ve)|0,v=v+Math.imul(ce,Se)|0,g=g+Math.imul(X,Ie)|0,a=a+Math.imul(X,Me)|0,a=a+Math.imul(Z,Ie)|0,v=v+Math.imul(Z,Me)|0,g=g+Math.imul($,Pe)|0,a=a+Math.imul($,Oe)|0,a=a+Math.imul(K,Pe)|0,v=v+Math.imul(K,Oe)|0,g=g+Math.imul(k,Re)|0,a=a+Math.imul(k,Ne)|0,a=a+Math.imul(S,Re)|0,v=v+Math.imul(S,Ne)|0;var vr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(vr>>>26)|0,vr&=67108863,g=Math.imul(ye,De),a=Math.imul(ye,Ce),a=a+Math.imul(de,De)|0,v=Math.imul(de,Ce),g=g+Math.imul(le,Ae)|0,a=a+Math.imul(le,ke)|0,a=a+Math.imul(me,Ae)|0,v=v+Math.imul(me,ke)|0,g=g+Math.imul(pe,be)|0,a=a+Math.imul(pe,Te)|0,a=a+Math.imul(ge,be)|0,v=v+Math.imul(ge,Te)|0,g=g+Math.imul(ue,ve)|0,a=a+Math.imul(ue,Se)|0,a=a+Math.imul(ie,ve)|0,v=v+Math.imul(ie,Se)|0,g=g+Math.imul(oe,Ie)|0,a=a+Math.imul(oe,Me)|0,a=a+Math.imul(ce,Ie)|0,v=v+Math.imul(ce,Me)|0,g=g+Math.imul(X,Pe)|0,a=a+Math.imul(X,Oe)|0,a=a+Math.imul(Z,Pe)|0,v=v+Math.imul(Z,Oe)|0,g=g+Math.imul($,Re)|0,a=a+Math.imul($,Ne)|0,a=a+Math.imul(K,Re)|0,v=v+Math.imul(K,Ne)|0,g=g+Math.imul(k,Be)|0,a=a+Math.imul(k,Fe)|0,a=a+Math.imul(S,Be)|0,v=v+Math.imul(S,Fe)|0;var br=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(br>>>26)|0,br&=67108863,g=Math.imul(xe,De),a=Math.imul(xe,Ce),a=a+Math.imul(Ee,De)|0,v=Math.imul(Ee,Ce),g=g+Math.imul(ye,Ae)|0,a=a+Math.imul(ye,ke)|0,a=a+Math.imul(de,Ae)|0,v=v+Math.imul(de,ke)|0,g=g+Math.imul(le,be)|0,a=a+Math.imul(le,Te)|0,a=a+Math.imul(me,be)|0,v=v+Math.imul(me,Te)|0,g=g+Math.imul(pe,ve)|0,a=a+Math.imul(pe,Se)|0,a=a+Math.imul(ge,ve)|0,v=v+Math.imul(ge,Se)|0,g=g+Math.imul(ue,Ie)|0,a=a+Math.imul(ue,Me)|0,a=a+Math.imul(ie,Ie)|0,v=v+Math.imul(ie,Me)|0,g=g+Math.imul(oe,Pe)|0,a=a+Math.imul(oe,Oe)|0,a=a+Math.imul(ce,Pe)|0,v=v+Math.imul(ce,Oe)|0,g=g+Math.imul(X,Re)|0,a=a+Math.imul(X,Ne)|0,a=a+Math.imul(Z,Re)|0,v=v+Math.imul(Z,Ne)|0,g=g+Math.imul($,Be)|0,a=a+Math.imul($,Fe)|0,a=a+Math.imul(K,Be)|0,v=v+Math.imul(K,Fe)|0,g=g+Math.imul(k,Le)|0,a=a+Math.imul(k,qe)|0,a=a+Math.imul(S,Le)|0,v=v+Math.imul(S,qe)|0;var _r=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(_r>>>26)|0,_r&=67108863,g=Math.imul(_e,De),a=Math.imul(_e,Ce),a=a+Math.imul(we,De)|0,v=Math.imul(we,Ce),g=g+Math.imul(xe,Ae)|0,a=a+Math.imul(xe,ke)|0,a=a+Math.imul(Ee,Ae)|0,v=v+Math.imul(Ee,ke)|0,g=g+Math.imul(ye,be)|0,a=a+Math.imul(ye,Te)|0,a=a+Math.imul(de,be)|0,v=v+Math.imul(de,Te)|0,g=g+Math.imul(le,ve)|0,a=a+Math.imul(le,Se)|0,a=a+Math.imul(me,ve)|0,v=v+Math.imul(me,Se)|0,g=g+Math.imul(pe,Ie)|0,a=a+Math.imul(pe,Me)|0,a=a+Math.imul(ge,Ie)|0,v=v+Math.imul(ge,Me)|0,g=g+Math.imul(ue,Pe)|0,a=a+Math.imul(ue,Oe)|0,a=a+Math.imul(ie,Pe)|0,v=v+Math.imul(ie,Oe)|0,g=g+Math.imul(oe,Re)|0,a=a+Math.imul(oe,Ne)|0,a=a+Math.imul(ce,Re)|0,v=v+Math.imul(ce,Ne)|0,g=g+Math.imul(X,Be)|0,a=a+Math.imul(X,Fe)|0,a=a+Math.imul(Z,Be)|0,v=v+Math.imul(Z,Fe)|0,g=g+Math.imul($,Le)|0,a=a+Math.imul($,qe)|0,a=a+Math.imul(K,Le)|0,v=v+Math.imul(K,qe)|0,g=g+Math.imul(k,Ue)|0,a=a+Math.imul(k,je)|0,a=a+Math.imul(S,Ue)|0,v=v+Math.imul(S,je)|0;var wr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(wr>>>26)|0,wr&=67108863,g=Math.imul(_e,Ae),a=Math.imul(_e,ke),a=a+Math.imul(we,Ae)|0,v=Math.imul(we,ke),g=g+Math.imul(xe,be)|0,a=a+Math.imul(xe,Te)|0,a=a+Math.imul(Ee,be)|0,v=v+Math.imul(Ee,Te)|0,g=g+Math.imul(ye,ve)|0,a=a+Math.imul(ye,Se)|0,a=a+Math.imul(de,ve)|0,v=v+Math.imul(de,Se)|0,g=g+Math.imul(le,Ie)|0,a=a+Math.imul(le,Me)|0,a=a+Math.imul(me,Ie)|0,v=v+Math.imul(me,Me)|0,g=g+Math.imul(pe,Pe)|0,a=a+Math.imul(pe,Oe)|0,a=a+Math.imul(ge,Pe)|0,v=v+Math.imul(ge,Oe)|0,g=g+Math.imul(ue,Re)|0,a=a+Math.imul(ue,Ne)|0,a=a+Math.imul(ie,Re)|0,v=v+Math.imul(ie,Ne)|0,g=g+Math.imul(oe,Be)|0,a=a+Math.imul(oe,Fe)|0,a=a+Math.imul(ce,Be)|0,v=v+Math.imul(ce,Fe)|0,g=g+Math.imul(X,Le)|0,a=a+Math.imul(X,qe)|0,a=a+Math.imul(Z,Le)|0,v=v+Math.imul(Z,qe)|0,g=g+Math.imul($,Ue)|0,a=a+Math.imul($,je)|0,a=a+Math.imul(K,Ue)|0,v=v+Math.imul(K,je)|0;var tr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(tr>>>26)|0,tr&=67108863,g=Math.imul(_e,be),a=Math.imul(_e,Te),a=a+Math.imul(we,be)|0,v=Math.imul(we,Te),g=g+Math.imul(xe,ve)|0,a=a+Math.imul(xe,Se)|0,a=a+Math.imul(Ee,ve)|0,v=v+Math.imul(Ee,Se)|0,g=g+Math.imul(ye,Ie)|0,a=a+Math.imul(ye,Me)|0,a=a+Math.imul(de,Ie)|0,v=v+Math.imul(de,Me)|0,g=g+Math.imul(le,Pe)|0,a=a+Math.imul(le,Oe)|0,a=a+Math.imul(me,Pe)|0,v=v+Math.imul(me,Oe)|0,g=g+Math.imul(pe,Re)|0,a=a+Math.imul(pe,Ne)|0,a=a+Math.imul(ge,Re)|0,v=v+Math.imul(ge,Ne)|0,g=g+Math.imul(ue,Be)|0,a=a+Math.imul(ue,Fe)|0,a=a+Math.imul(ie,Be)|0,v=v+Math.imul(ie,Fe)|0,g=g+Math.imul(oe,Le)|0,a=a+Math.imul(oe,qe)|0,a=a+Math.imul(ce,Le)|0,v=v+Math.imul(ce,qe)|0,g=g+Math.imul(X,Ue)|0,a=a+Math.imul(X,je)|0,a=a+Math.imul(Z,Ue)|0,v=v+Math.imul(Z,je)|0;var Wt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,g=Math.imul(_e,ve),a=Math.imul(_e,Se),a=a+Math.imul(we,ve)|0,v=Math.imul(we,Se),g=g+Math.imul(xe,Ie)|0,a=a+Math.imul(xe,Me)|0,a=a+Math.imul(Ee,Ie)|0,v=v+Math.imul(Ee,Me)|0,g=g+Math.imul(ye,Pe)|0,a=a+Math.imul(ye,Oe)|0,a=a+Math.imul(de,Pe)|0,v=v+Math.imul(de,Oe)|0,g=g+Math.imul(le,Re)|0,a=a+Math.imul(le,Ne)|0,a=a+Math.imul(me,Re)|0,v=v+Math.imul(me,Ne)|0,g=g+Math.imul(pe,Be)|0,a=a+Math.imul(pe,Fe)|0,a=a+Math.imul(ge,Be)|0,v=v+Math.imul(ge,Fe)|0,g=g+Math.imul(ue,Le)|0,a=a+Math.imul(ue,qe)|0,a=a+Math.imul(ie,Le)|0,v=v+Math.imul(ie,qe)|0,g=g+Math.imul(oe,Ue)|0,a=a+Math.imul(oe,je)|0,a=a+Math.imul(ce,Ue)|0,v=v+Math.imul(ce,je)|0;var fr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(fr>>>26)|0,fr&=67108863,g=Math.imul(_e,Ie),a=Math.imul(_e,Me),a=a+Math.imul(we,Ie)|0,v=Math.imul(we,Me),g=g+Math.imul(xe,Pe)|0,a=a+Math.imul(xe,Oe)|0,a=a+Math.imul(Ee,Pe)|0,v=v+Math.imul(Ee,Oe)|0,g=g+Math.imul(ye,Re)|0,a=a+Math.imul(ye,Ne)|0,a=a+Math.imul(de,Re)|0,v=v+Math.imul(de,Ne)|0,g=g+Math.imul(le,Be)|0,a=a+Math.imul(le,Fe)|0,a=a+Math.imul(me,Be)|0,v=v+Math.imul(me,Fe)|0,g=g+Math.imul(pe,Le)|0,a=a+Math.imul(pe,qe)|0,a=a+Math.imul(ge,Le)|0,v=v+Math.imul(ge,qe)|0,g=g+Math.imul(ue,Ue)|0,a=a+Math.imul(ue,je)|0,a=a+Math.imul(ie,Ue)|0,v=v+Math.imul(ie,je)|0;var Yt=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,g=Math.imul(_e,Pe),a=Math.imul(_e,Oe),a=a+Math.imul(we,Pe)|0,v=Math.imul(we,Oe),g=g+Math.imul(xe,Re)|0,a=a+Math.imul(xe,Ne)|0,a=a+Math.imul(Ee,Re)|0,v=v+Math.imul(Ee,Ne)|0,g=g+Math.imul(ye,Be)|0,a=a+Math.imul(ye,Fe)|0,a=a+Math.imul(de,Be)|0,v=v+Math.imul(de,Fe)|0,g=g+Math.imul(le,Le)|0,a=a+Math.imul(le,qe)|0,a=a+Math.imul(me,Le)|0,v=v+Math.imul(me,qe)|0,g=g+Math.imul(pe,Ue)|0,a=a+Math.imul(pe,je)|0,a=a+Math.imul(ge,Ue)|0,v=v+Math.imul(ge,je)|0;var dr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(dr>>>26)|0,dr&=67108863,g=Math.imul(_e,Re),a=Math.imul(_e,Ne),a=a+Math.imul(we,Re)|0,v=Math.imul(we,Ne),g=g+Math.imul(xe,Be)|0,a=a+Math.imul(xe,Fe)|0,a=a+Math.imul(Ee,Be)|0,v=v+Math.imul(Ee,Fe)|0,g=g+Math.imul(ye,Le)|0,a=a+Math.imul(ye,qe)|0,a=a+Math.imul(de,Le)|0,v=v+Math.imul(de,qe)|0,g=g+Math.imul(le,Ue)|0,a=a+Math.imul(le,je)|0,a=a+Math.imul(me,Ue)|0,v=v+Math.imul(me,je)|0;var rr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(rr>>>26)|0,rr&=67108863,g=Math.imul(_e,Be),a=Math.imul(_e,Fe),a=a+Math.imul(we,Be)|0,v=Math.imul(we,Fe),g=g+Math.imul(xe,Le)|0,a=a+Math.imul(xe,qe)|0,a=a+Math.imul(Ee,Le)|0,v=v+Math.imul(Ee,qe)|0,g=g+Math.imul(ye,Ue)|0,a=a+Math.imul(ye,je)|0,a=a+Math.imul(de,Ue)|0,v=v+Math.imul(de,je)|0;var nr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(nr>>>26)|0,nr&=67108863,g=Math.imul(_e,Le),a=Math.imul(_e,qe),a=a+Math.imul(we,Le)|0,v=Math.imul(we,qe),g=g+Math.imul(xe,Ue)|0,a=a+Math.imul(xe,je)|0,a=a+Math.imul(Ee,Ue)|0,v=v+Math.imul(Ee,je)|0;var hr=(w+g|0)+((a&8191)<<13)|0;w=(v+(a>>>13)|0)+(hr>>>26)|0,hr&=67108863,g=Math.imul(_e,Ue),a=Math.imul(_e,je),a=a+Math.imul(we,Ue)|0,v=Math.imul(we,je);var xr=(w+g|0)+((a&8191)<<13)|0;return w=(v+(a>>>13)|0)+(xr>>>26)|0,xr&=67108863,b[0]=gr,b[1]=wt,b[2]=xt,b[3]=or,b[4]=yr,b[5]=lr,b[6]=vr,b[7]=br,b[8]=_r,b[9]=wr,b[10]=tr,b[11]=Wt,b[12]=fr,b[13]=Yt,b[14]=dr,b[15]=rr,b[16]=nr,b[17]=hr,b[18]=xr,w!==0&&(b[19]=w,p.length++),p};Math.imul||(M=R);function I(_,s,l){l.negative=s.negative^_.negative,l.length=_.length+s.length;for(var p=0,f=0,h=0;h>>26)|0,f+=b>>>26,b&=67108863}l.words[h]=w,p=b,b=f}return p!==0?l.words[h]=p:l.length--,l.strip()}function D(_,s,l){var p=new O;return p.mulp(_,s,l)}n.prototype.mulTo=function(s,l){var p,f=this.length+s.length;return this.length===10&&s.length===10?p=M(this,s,l):f<63?p=R(this,s,l):f<1024?p=I(this,s,l):p=D(this,s,l),p};function O(_,s){this.x=_,this.y=s}O.prototype.makeRBT=function(s){for(var l=new Array(s),p=n.prototype._countBits(s)-1,f=0;f>=1;return f},O.prototype.permute=function(s,l,p,f,h,b){for(var w=0;w>>1)h++;return 1<>>13,p[2*b+1]=h&8191,h=h>>>13;for(b=2*l;b>=26,l+=f/67108864|0,l+=h>>>26,this.words[p]=h&67108863}return l!==0&&(this.words[p]=l,this.length++),this},n.prototype.muln=function(s){return this.clone().imuln(s)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(s){var l=A(s);if(l.length===0)return new n(1);for(var p=this,f=0;f=0);var l=s%26,p=(s-l)/26,f=67108863>>>26-l<<26-l,h;if(l!==0){var b=0;for(h=0;h>>26-l}b&&(this.words[h]=b,this.length++)}if(p!==0){for(h=this.length-1;h>=0;h--)this.words[h+p]=this.words[h];for(h=0;h=0);var f;l?f=(l-l%26)/26:f=0;var h=s%26,b=Math.min((s-h)/26,this.length),w=67108863^67108863>>>h<b)for(this.length-=b,a=0;a=0&&(v!==0||a>=f);a--){var P=this.words[a]|0;this.words[a]=v<<26-h|P>>>h,v=P&w}return g&&v!==0&&(g.words[g.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(s,l,p){return r(this.negative===0),this.iushrn(s,l,p)},n.prototype.shln=function(s){return this.clone().ishln(s)},n.prototype.ushln=function(s){return this.clone().iushln(s)},n.prototype.shrn=function(s){return this.clone().ishrn(s)},n.prototype.ushrn=function(s){return this.clone().iushrn(s)},n.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,p=(s-l)/26,f=1<=0);var l=s%26,p=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(l!==0&&p++,this.length=Math.min(p,this.length),l!==0){var f=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},n.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(g/67108864|0),this.words[h+p]=b&67108863}for(;h>26,this.words[h+p]=b&67108863;if(w===0)return this.strip();for(r(w===-1),w=0,h=0;h>26,this.words[h]=b&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(s,l){var p=this.length-s.length,f=this.clone(),h=s,b=h.words[h.length-1]|0,w=this._countBits(b);p=26-w,p!==0&&(h=h.ushln(p),f.iushln(p),b=h.words[h.length-1]|0);var g=f.length-h.length,a;if(l!=="mod"){a=new n(null),a.length=g+1,a.words=new Array(a.length);for(var v=0;v=0;k--){var S=(f.words[h.length+k]|0)*67108864+(f.words[h.length+k-1]|0);for(S=Math.min(S/b|0,67108863),f._ishlnsubmul(h,S,k);f.negative!==0;)S--,f.negative=0,f._ishlnsubmul(h,1,k),f.isZero()||(f.negative^=1);a&&(a.words[k]=S)}return a&&a.strip(),f.strip(),l!=="div"&&p!==0&&f.iushrn(p),{div:a||null,mod:f}},n.prototype.divmod=function(s,l,p){if(r(!s.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,b;return this.negative!==0&&s.negative===0?(b=this.neg().divmod(s,l),l!=="mod"&&(f=b.div.neg()),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.iadd(s)),{div:f,mod:h}):this.negative===0&&s.negative!==0?(b=this.divmod(s.neg(),l),l!=="mod"&&(f=b.div.neg()),{div:f,mod:b.mod}):(this.negative&s.negative)!==0?(b=this.neg().divmod(s.neg(),l),l!=="div"&&(h=b.mod.neg(),p&&h.negative!==0&&h.isub(s)),{div:b.div,mod:h}):s.length>this.length||this.cmp(s)<0?{div:new n(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new n(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new n(this.modn(s.words[0]))}:this._wordDiv(s,l)},n.prototype.div=function(s){return this.divmod(s,"div",!1).div},n.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},n.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},n.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var p=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),h=s.andln(1),b=p.cmp(f);return b<0||h===1&&b===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},n.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,p=0,f=this.length-1;f>=0;f--)p=(l*p+(this.words[f]|0))%s;return p},n.prototype.idivn=function(s){r(s<=67108863);for(var l=0,p=this.length-1;p>=0;p--){var f=(this.words[p]|0)+l*67108864;this.words[p]=f/s|0,l=f%s}return this.strip()},n.prototype.divn=function(s){return this.clone().idivn(s)},n.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=new n(0),w=new n(1),g=0;l.isEven()&&p.isEven();)l.iushrn(1),p.iushrn(1),++g;for(var a=p.clone(),v=l.clone();!l.isZero();){for(var P=0,k=1;(l.words[0]&k)===0&&P<26;++P,k<<=1);if(P>0)for(l.iushrn(P);P-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(a),h.isub(v)),f.iushrn(1),h.iushrn(1);for(var S=0,B=1;(p.words[0]&B)===0&&S<26;++S,B<<=1);if(S>0)for(p.iushrn(S);S-- >0;)(b.isOdd()||w.isOdd())&&(b.iadd(a),w.isub(v)),b.iushrn(1),w.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(b),h.isub(w)):(p.isub(l),b.isub(f),w.isub(h))}return{a:b,b:w,gcd:p.iushln(g)}},n.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,p=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new n(1),h=new n(0),b=p.clone();l.cmpn(1)>0&&p.cmpn(1)>0;){for(var w=0,g=1;(l.words[0]&g)===0&&w<26;++w,g<<=1);if(w>0)for(l.iushrn(w);w-- >0;)f.isOdd()&&f.iadd(b),f.iushrn(1);for(var a=0,v=1;(p.words[0]&v)===0&&a<26;++a,v<<=1);if(a>0)for(p.iushrn(a);a-- >0;)h.isOdd()&&h.iadd(b),h.iushrn(1);l.cmp(p)>=0?(l.isub(p),f.isub(h)):(p.isub(l),h.isub(f))}var P;return l.cmpn(1)===0?P=f:P=h,P.cmpn(0)<0&&P.iadd(s),P},n.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),p=s.clone();l.negative=0,p.negative=0;for(var f=0;l.isEven()&&p.isEven();f++)l.iushrn(1),p.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;p.isEven();)p.iushrn(1);var h=l.cmp(p);if(h<0){var b=l;l=p,p=b}else if(h===0||p.cmpn(1)===0)break;l.isub(p)}while(!0);return p.iushln(f)},n.prototype.invm=function(s){return this.egcd(s).a.umod(s)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(s){return this.words[0]&s},n.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,p=(s-l)/26,f=1<>>26,w&=67108863,this.words[b]=w}return h!==0&&(this.words[b]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var p;if(this.length>1)p=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;p=f===s?0:fs.length)return 1;if(this.length=0;p--){var f=this.words[p]|0,h=s.words[p]|0;if(f!==h){fh&&(l=1);break}}return l},n.prototype.gtn=function(s){return this.cmpn(s)===1},n.prototype.gt=function(s){return this.cmp(s)===1},n.prototype.gten=function(s){return this.cmpn(s)>=0},n.prototype.gte=function(s){return this.cmp(s)>=0},n.prototype.ltn=function(s){return this.cmpn(s)===-1},n.prototype.lt=function(s){return this.cmp(s)===-1},n.prototype.lten=function(s){return this.cmpn(s)<=0},n.prototype.lte=function(s){return this.cmp(s)<=0},n.prototype.eqn=function(s){return this.cmpn(s)===0},n.prototype.eq=function(s){return this.cmp(s)===0},n.red=function(s){return new q(s)},n.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(s){return this.red=s,this},n.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},n.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},n.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},n.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},n.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},n.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},n.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},n.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var N={k256:null,p224:null,p192:null,p25519:null};function L(_,s){this.name=_,this.p=new n(s,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var s=new n(null);return s.words=new Array(Math.ceil(this.n/13)),s},L.prototype.ireduce=function(s){var l=s,p;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),p=l.bitLength();while(p>this.n);var f=p0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},L.prototype.split=function(s,l){s.iushrn(this.n,0,l)},L.prototype.imulK=function(s){return s.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,L),j.prototype.split=function(s,l){for(var p=4194303,f=Math.min(s.length,9),h=0;h>>22,b=w}b>>>=22,s.words[h-10]=b,b===0&&s.length>10?s.length-=10:s.length-=9},j.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,p=0;p>>=26,s.words[p]=h,l=f}return l!==0&&(s.words[s.length++]=l),s},n._prime=function(s){if(N[s])return N[s];var l;if(s==="k256")l=new j;else if(s==="p224")l=new H;else if(s==="p192")l=new Y;else if(s==="p25519")l=new W;else throw new Error("Unknown prime "+s);return N[s]=l,l};function q(_){if(typeof _=="string"){var s=n._prime(_);this.m=s.p,this.prime=s}else r(_.gtn(1),"modulus must be greater than 1"),this.m=_,this.prime=null}q.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},q.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},q.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},q.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},q.prototype.add=function(s,l){this._verify2(s,l);var p=s.add(l);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},q.prototype.iadd=function(s,l){this._verify2(s,l);var p=s.iadd(l);return p.cmp(this.m)>=0&&p.isub(this.m),p},q.prototype.sub=function(s,l){this._verify2(s,l);var p=s.sub(l);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},q.prototype.isub=function(s,l){this._verify2(s,l);var p=s.isub(l);return p.cmpn(0)<0&&p.iadd(this.m),p},q.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},q.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},q.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},q.prototype.isqr=function(s){return this.imul(s,s.clone())},q.prototype.sqr=function(s){return this.mul(s,s)},q.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var p=this.m.add(new n(1)).iushrn(2);return this.pow(s,p)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);r(!f.isZero());var b=new n(1).toRed(this),w=b.redNeg(),g=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new n(2*a*a).toRed(this);this.pow(a,g).cmp(w)!==0;)a.redIAdd(w);for(var v=this.pow(a,f),P=this.pow(s,f.addn(1).iushrn(1)),k=this.pow(s,f),S=h;k.cmp(b)!==0;){for(var B=k,$=0;B.cmp(b)!==0;$++)B=B.redSqr();r($=0;h--){for(var v=l.words[h],P=a-1;P>=0;P--){var k=v>>P&1;if(b!==f[0]&&(b=this.sqr(b)),k===0&&w===0){g=0;continue}w<<=1,w|=k,g++,!(g!==p&&(h!==0||P!==0))&&(b=this.mul(b,f[w]),g=0,w=0)}a=26}return b},q.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},q.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},n.mont=function(s){return new J(s)};function J(_){q.call(this,_),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(J,q),J.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},J.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},J.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var p=s.imul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new n(0)._forceRed(this);var p=s.mul(l),f=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=p.isub(f).iushrn(this.shift),b=h;return h.cmp(this.m)>=0?b=h.isub(this.m):h.cmpn(0)<0&&(b=h.iadd(this.m)),b._forceRed(this)},J.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof uA>"u"||uA,zL)});var lA=F((cqe,$L)=>{m();var HL=Ab(),vxe=At().Buffer;function bxe(t,e){return vxe.from(t.toRed(HL.mont(e.modulus)).redPow(new HL(e.publicExponent)).fromRed().toArray())}$L.exports=bxe});var WL=F((uqe,VL)=>{m();var _xe=Ym(),fA=$u(),wxe=xd(),GL=aA(),KL=cA(),dA=Ab(),xxe=lA(),Exe=Qv(),rs=At().Buffer;VL.exports=function(e,r,i){var n;e.padding?n=e.padding:i?n=1:n=4;var o=_xe(e),c;if(n===4)c=Sxe(o,r);else if(n===1)c=Cxe(o,r,i);else if(n===3){if(c=new dA(r),c.cmp(o.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return i?Exe(c,o):xxe(c,o)};function Sxe(t,e){var r=t.modulus.byteLength(),i=e.length,n=wxe("sha1").update(rs.alloc(0)).digest(),o=n.length,c=2*o;if(i>r-c-2)throw new Error("message too long");var u=rs.alloc(r-i-c-2),d=r-o-1,y=fA(o),E=KL(rs.concat([n,u,rs.alloc(1,1),e],d),GL(y,d)),x=KL(y,GL(E,o));return new dA(rs.concat([rs.alloc(1),x,E],r))}function Cxe(t,e,r){var i=e.length,n=t.modulus.byteLength();if(i>n-11)throw new Error("message too long");var o;return r?o=rs.alloc(n-i-3,255):o=Axe(n-i-3),new dA(rs.concat([rs.from([0,r?1:2]),o,rs.alloc(1),e],n))}function Axe(t){for(var e=rs.allocUnsafe(t),r=0,i=fA(t*2),n=0,o;r{m();var Txe=Ym(),YL=aA(),QL=cA(),JL=Ab(),Mxe=Qv(),Rxe=xd(),Dxe=lA(),Zm=At().Buffer;XL.exports=function(e,r,i){var n;e.padding?n=e.padding:i?n=1:n=4;var o=Txe(e),c=o.modulus.byteLength();if(r.length>c||new JL(r).cmp(o.modulus)>=0)throw new Error("decryption error");var u;i?u=Dxe(new JL(r),o):u=Mxe(r,o);var d=Zm.alloc(c-u.length);if(u=Zm.concat([d,u],c),n===4)return kxe(o,u);if(n===1)return Ixe(o,u,i);if(n===3)return u;throw new Error("unknown padding")};function kxe(t,e){var r=t.modulus.byteLength(),i=Rxe("sha1").update(Zm.alloc(0)).digest(),n=i.length;if(e[0]!==0)throw new Error("decryption error");var o=e.slice(1,n+1),c=e.slice(n+1),u=QL(o,YL(c,n)),d=QL(c,YL(u,r-n-1));if(Oxe(i,d.slice(0,n)))throw new Error("decryption error");for(var y=n;d[y]===0;)y++;if(d[y++]!==1)throw new Error("decryption error");return d.slice(y)}function Ixe(t,e,r){for(var i=e.slice(0,2),n=2,o=0;e[n++]!==0;)if(n>=e.length){o++;break}var c=e.slice(2,n-1);if((i.toString("hex")!=="0002"&&!r||i.toString("hex")!=="0001"&&r)&&o++,c.length<8&&o++,o)throw new Error("decryption error");return e.slice(n)}function Oxe(t,e){t=Zm.from(t),e=Zm.from(e);var r=0,i=t.length;t.length!==e.length&&(r++,i=Math.min(t.length,e.length));for(var n=-1;++n{m();Rl.publicEncrypt=WL();Rl.privateDecrypt=ZL();Rl.privateEncrypt=function(e,r){return Rl.publicEncrypt(e,r,!0)};Rl.publicDecrypt=function(e,r){return Rl.privateDecrypt(e,r,!0)}});var lq=F(e0=>{"use strict";m();function tq(){throw new Error(`secure random number generation not supported by this browser -use chrome, FireFox or Internet Explorer 11`)}var nq=At(),rq=$u(),iq=nq.Buffer,oq=nq.kMaxLength,hA=window.crypto||window.msCrypto,sq=Math.pow(2,32)-1;function aq(t,e){if(typeof t!="number"||t!==t)throw new TypeError("offset must be a number");if(t>sq||t<0)throw new TypeError("offset must be a uint32");if(t>oq||t>e)throw new RangeError("offset out of range")}function cq(t,e,r){if(typeof t!="number"||t!==t)throw new TypeError("size must be a number");if(t>sq||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>oq)throw new RangeError("buffer too small")}hA&&hA.getRandomValues||!C.browser?(e0.randomFill=Pxe,e0.randomFillSync=Nxe):(e0.randomFill=tq,e0.randomFillSync=tq);function Pxe(t,e,r,i){if(!iq.isBuffer(t)&&!(t instanceof window.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof e=="function")i=e,e=0,r=t.length;else if(typeof r=="function")i=r,r=t.length-e;else if(typeof i!="function")throw new TypeError('"cb" argument must be a function');return aq(e,t.length),cq(r,e,t.length),uq(t,e,r,i)}function uq(t,e,r,i){if(C.browser){var n=t.buffer,o=new Uint8Array(n,e,r);if(hA.getRandomValues(o),i){C.nextTick(function(){i(null,t)});return}return t}if(i){rq(r,function(u,d){if(u)return i(u);d.copy(t,e),i(null,t)});return}var c=rq(r);return c.copy(t,e),t}function Nxe(t,e,r){if(typeof e>"u"&&(e=0),!iq.isBuffer(t)&&!(t instanceof window.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return aq(e,t.length),r===void 0&&(r=t.length-e),cq(r,e,t.length),uq(t,e,r)}});var Dl=F(It=>{"use strict";m();It.randomBytes=It.rng=It.pseudoRandomBytes=It.prng=$u();It.createHash=It.Hash=xd();It.createHmac=It.Hmac=o2();var Bxe=AN(),Fxe=Object.keys(Bxe),Lxe=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(Fxe);It.getHashes=function(){return Lxe};var fq=m2();It.pbkdf2=fq.pbkdf2;It.pbkdf2Sync=fq.pbkdf2Sync;var Ns=WB();It.Cipher=Ns.Cipher;It.createCipher=Ns.createCipher;It.Cipheriv=Ns.Cipheriv;It.createCipheriv=Ns.createCipheriv;It.Decipher=Ns.Decipher;It.createDecipher=Ns.createDecipher;It.Decipheriv=Ns.Decipheriv;It.createDecipheriv=Ns.createDecipheriv;It.getCiphers=Ns.getCiphers;It.listCiphers=Ns.listCiphers;var t0=l7();It.DiffieHellmanGroup=t0.DiffieHellmanGroup;It.createDiffieHellmanGroup=t0.createDiffieHellmanGroup;It.getDiffieHellman=t0.getDiffieHellman;It.createDiffieHellman=t0.createDiffieHellman;It.DiffieHellman=t0.DiffieHellman;var Tb=NL();It.createSign=Tb.createSign;It.Sign=Tb.Sign;It.createVerify=Tb.createVerify;It.Verify=Tb.Verify;It.createECDH=qL();var Mb=eq();It.publicEncrypt=Mb.publicEncrypt;It.privateEncrypt=Mb.privateEncrypt;It.publicDecrypt=Mb.publicDecrypt;It.privateDecrypt=Mb.privateDecrypt;var dq=lq();It.randomFill=dq.randomFill;It.randomFillSync=dq.randomFillSync;It.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(` -`))};It.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}});var pA=F((pqe,hq)=>{"use strict";m();hq.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(e,r);if(c.value!==n||c.enumerable!==!0)return!1}return!0}});var Rb=F((mqe,pq)=>{"use strict";m();var qxe=pA();pq.exports=function(){return qxe()&&!!Symbol.toStringTag}});var yq=F((gqe,gq)=>{"use strict";m();var mq=typeof Symbol<"u"&&Symbol,Uxe=pA();gq.exports=function(){return typeof mq!="function"||typeof Symbol!="function"||typeof mq("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Uxe()}});var _q=F((yqe,bq)=>{"use strict";m();var vq={foo:{}},jxe=Object;bq.exports=function(){return{__proto__:vq}.foo===vq.foo&&!({__proto__:null}instanceof jxe)}});var xq=F((vqe,wq)=>{"use strict";m();var zxe="Function.prototype.bind called on incompatible ",mA=Array.prototype.slice,Hxe=Object.prototype.toString,$xe="[object Function]";wq.exports=function(e){var r=this;if(typeof r!="function"||Hxe.call(r)!==$xe)throw new TypeError(zxe+r);for(var i=mA.call(arguments,1),n,o=function(){if(this instanceof n){var E=r.apply(this,i.concat(mA.call(arguments)));return Object(E)===E?E:this}else return r.apply(e,i.concat(mA.call(arguments)))},c=Math.max(0,r.length-i.length),u=[],d=0;d{"use strict";m();var Gxe=xq();Eq.exports=Function.prototype.bind||Gxe});var Aq=F((_qe,Cq)=>{"use strict";m();var Sq={}.hasOwnProperty,yA=Function.prototype.call;Cq.exports=yA.bind?yA.bind(Sq):function(t,e){return yA.call(Sq,t,e)}});var Ib=F((wqe,kq)=>{"use strict";m();var Qt,rh=SyntaxError,Dq=Function,th=TypeError,vA=function(t){try{return Dq('"use strict"; return ('+t+").constructor;")()}catch{}},kl=Object.getOwnPropertyDescriptor;if(kl)try{kl({},"")}catch{kl=null}var bA=function(){throw new th},Kxe=kl?function(){try{return arguments.callee,bA}catch{try{return kl(arguments,"callee").get}catch{return bA}}}():bA,Zd=yq()(),Vxe=_q()(),Gn=Object.getPrototypeOf||(Vxe?function(t){return t.__proto__}:null),eh={},Wxe=typeof Uint8Array>"u"||!Gn?Qt:Gn(Uint8Array),Il={"%AggregateError%":typeof AggregateError>"u"?Qt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Qt:ArrayBuffer,"%ArrayIteratorPrototype%":Zd&&Gn?Gn([][Symbol.iterator]()):Qt,"%AsyncFromSyncIteratorPrototype%":Qt,"%AsyncFunction%":eh,"%AsyncGenerator%":eh,"%AsyncGeneratorFunction%":eh,"%AsyncIteratorPrototype%":eh,"%Atomics%":typeof Atomics>"u"?Qt:Atomics,"%BigInt%":typeof BigInt>"u"?Qt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Qt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Qt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Qt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Qt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Qt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Qt:FinalizationRegistry,"%Function%":Dq,"%GeneratorFunction%":eh,"%Int8Array%":typeof Int8Array>"u"?Qt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Qt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Qt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Zd&&Gn?Gn(Gn([][Symbol.iterator]())):Qt,"%JSON%":typeof JSON=="object"?JSON:Qt,"%Map%":typeof Map>"u"?Qt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Zd||!Gn?Qt:Gn(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Qt:Promise,"%Proxy%":typeof Proxy>"u"?Qt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Qt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Qt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Zd||!Gn?Qt:Gn(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Qt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Zd&&Gn?Gn(""[Symbol.iterator]()):Qt,"%Symbol%":Zd?Symbol:Qt,"%SyntaxError%":rh,"%ThrowTypeError%":Kxe,"%TypedArray%":Wxe,"%TypeError%":th,"%Uint8Array%":typeof Uint8Array>"u"?Qt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Qt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Qt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Qt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Qt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Qt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Qt:WeakSet};if(Gn)try{null.error}catch(t){Tq=Gn(Gn(t)),Il["%Error.prototype%"]=Tq}var Tq,Yxe=function t(e){var r;if(e==="%AsyncFunction%")r=vA("async function () {}");else if(e==="%GeneratorFunction%")r=vA("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=vA("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Gn&&(r=Gn(n.prototype))}return Il[e]=r,r},Mq={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},r0=gA(),Db=Aq(),Qxe=r0.call(Function.call,Array.prototype.concat),Jxe=r0.call(Function.apply,Array.prototype.splice),Rq=r0.call(Function.call,String.prototype.replace),kb=r0.call(Function.call,String.prototype.slice),Xxe=r0.call(Function.call,RegExp.prototype.exec),Zxe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,eEe=/\\(\\)?/g,tEe=function(e){var r=kb(e,0,1),i=kb(e,-1);if(r==="%"&&i!=="%")throw new rh("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new rh("invalid intrinsic syntax, expected opening `%`");var n=[];return Rq(e,Zxe,function(o,c,u,d){n[n.length]=u?Rq(d,eEe,"$1"):c||o}),n},rEe=function(e,r){var i=e,n;if(Db(Mq,i)&&(n=Mq[i],i="%"+n[0]+"%"),Db(Il,i)){var o=Il[i];if(o===eh&&(o=Yxe(i)),typeof o>"u"&&!r)throw new th("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new rh("intrinsic "+e+" does not exist!")};kq.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new th("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new th('"allowMissing" argument must be a boolean');if(Xxe(/^%?[^%]*%?$/,e)===null)throw new rh("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=tEe(e),n=i.length>0?i[0]:"",o=rEe("%"+n+"%",r),c=o.name,u=o.value,d=!1,y=o.alias;y&&(n=y[0],Jxe(i,Qxe([0,1],y)));for(var E=1,x=!0;E=i.length){var I=kl(u,A);x=!!I,x&&"get"in I&&!("originalValue"in I.get)?u=I.get:u=u[A]}else x=Db(u,A),u=u[A];x&&!d&&(Il[c]=u)}}return u}});var wA=F((xqe,Ob)=>{"use strict";m();var _A=gA(),nh=Ib(),Pq=nh("%Function.prototype.apply%"),Nq=nh("%Function.prototype.call%"),Bq=nh("%Reflect.apply%",!0)||_A.call(Nq,Pq),Iq=nh("%Object.getOwnPropertyDescriptor%",!0),Ol=nh("%Object.defineProperty%",!0),nEe=nh("%Math.max%");if(Ol)try{Ol({},"a",{value:1})}catch{Ol=null}Ob.exports=function(e){var r=Bq(_A,Nq,arguments);if(Iq&&Ol){var i=Iq(r,"length");i.configurable&&Ol(r,"length",{value:1+nEe(0,e.length-(arguments.length-1))})}return r};var Oq=function(){return Bq(_A,Pq,arguments)};Ol?Ol(Ob.exports,"apply",{value:Oq}):Ob.exports.apply=Oq});var xA=F((Eqe,qq)=>{"use strict";m();var Fq=Ib(),Lq=wA(),iEe=Lq(Fq("String.prototype.indexOf"));qq.exports=function(e,r){var i=Fq(e,!!r);return typeof i=="function"&&iEe(e,".prototype.")>-1?Lq(i):i}});var zq=F((Sqe,jq)=>{"use strict";m();var oEe=Rb()(),sEe=xA(),EA=sEe("Object.prototype.toString"),Pb=function(e){return oEe&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:EA(e)==="[object Arguments]"},Uq=function(e){return Pb(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&EA(e)!=="[object Array]"&&EA(e.callee)==="[object Function]"},aEe=function(){return Pb(arguments)}();Pb.isLegacyArguments=Uq;jq.exports=aEe?Pb:Uq});var Gq=F((Cqe,$q)=>{"use strict";m();var cEe=Object.prototype.toString,uEe=Function.prototype.toString,lEe=/^\s*(?:function)?\*/,Hq=Rb()(),SA=Object.getPrototypeOf,fEe=function(){if(!Hq)return!1;try{return Function("return function*() {}")()}catch{}},CA;$q.exports=function(e){if(typeof e!="function")return!1;if(lEe.test(uEe.call(e)))return!0;if(!Hq){var r=cEe.call(e);return r==="[object GeneratorFunction]"}if(!SA)return!1;if(typeof CA>"u"){var i=fEe();CA=i?SA(i):!1}return SA(e)===CA}});var Yq=F((Aqe,Wq)=>{"use strict";m();var Vq=Function.prototype.toString,ih=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,TA,Nb;if(typeof ih=="function"&&typeof Object.defineProperty=="function")try{TA=Object.defineProperty({},"length",{get:function(){throw Nb}}),Nb={},ih(function(){throw 42},null,TA)}catch(t){t!==Nb&&(ih=null)}else ih=null;var dEe=/^\s*class\b/,MA=function(e){try{var r=Vq.call(e);return dEe.test(r)}catch{return!1}},AA=function(e){try{return MA(e)?!1:(Vq.call(e),!0)}catch{return!1}},Bb=Object.prototype.toString,hEe="[object Object]",pEe="[object Function]",mEe="[object GeneratorFunction]",gEe="[object HTMLAllCollection]",yEe="[object HTML document.all class]",vEe="[object HTMLCollection]",bEe=typeof Symbol=="function"&&!!Symbol.toStringTag,_Ee=!(0 in[,]),RA=function(){return!1};typeof document=="object"&&(Kq=document.all,Bb.call(Kq)===Bb.call(document.all)&&(RA=function(e){if((_Ee||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=Bb.call(e);return(r===gEe||r===yEe||r===vEe||r===hEe)&&e("")==null}catch{}return!1}));var Kq;Wq.exports=ih?function(e){if(RA(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{ih(e,null,TA)}catch(r){if(r!==Nb)return!1}return!MA(e)&&AA(e)}:function(e){if(RA(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(bEe)return AA(e);if(MA(e))return!1;var r=Bb.call(e);return r!==pEe&&r!==mEe&&!/^\[object HTML/.test(r)?!1:AA(e)}});var Xq=F((Tqe,Jq)=>{"use strict";m();var wEe=Yq(),xEe=Object.prototype.toString,Qq=Object.prototype.hasOwnProperty,EEe=function(e,r,i){for(var n=0,o=e.length;n=3&&(n=i),xEe.call(e)==="[object Array]"?EEe(e,r,n):typeof e=="string"?SEe(e,r,n):CEe(e,r,n)};Jq.exports=AEe});var eU=F((Mqe,Zq)=>{"use strict";m();var DA=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],TEe=typeof globalThis>"u"?window:globalThis;Zq.exports=function(){for(var e=[],r=0;r{"use strict";m();var MEe=Ib(),Fb=MEe("%Object.getOwnPropertyDescriptor%",!0);if(Fb)try{Fb([],"length")}catch{Fb=null}tU.exports=Fb});var NA=F((Dqe,sU)=>{"use strict";m();var qb=Xq(),REe=eU(),nU=wA(),OA=xA(),Lb=rU(),DEe=OA("Object.prototype.toString"),oU=Rb()(),iU=typeof globalThis>"u"?window:globalThis,IA=REe(),PA=OA("String.prototype.slice"),kA=Object.getPrototypeOf,kEe=OA("Array.prototype.indexOf",!0)||function(e,r){for(var i=0;i-1?r:r!=="Object"?!1:OEe(e)}return Lb?IEe(e):null}});var cU=F((kqe,aU)=>{"use strict";m();var PEe=NA();aU.exports=function(e){return!!PEe(e)}});var xU=F(Gt=>{"use strict";m();var NEe=zq(),BEe=Gq(),ns=NA(),uU=cU();function oh(t){return t.call.bind(t)}var lU=typeof BigInt<"u",fU=typeof Symbol<"u",Do=oh(Object.prototype.toString),FEe=oh(Number.prototype.valueOf),LEe=oh(String.prototype.valueOf),qEe=oh(Boolean.prototype.valueOf);lU&&(dU=oh(BigInt.prototype.valueOf));var dU;fU&&(hU=oh(Symbol.prototype.valueOf));var hU;function i0(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}Gt.isArgumentsObject=NEe;Gt.isGeneratorFunction=BEe;Gt.isTypedArray=uU;function UEe(t){return typeof Promise<"u"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"}Gt.isPromise=UEe;function jEe(t){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(t):uU(t)||mU(t)}Gt.isArrayBufferView=jEe;function zEe(t){return ns(t)==="Uint8Array"}Gt.isUint8Array=zEe;function HEe(t){return ns(t)==="Uint8ClampedArray"}Gt.isUint8ClampedArray=HEe;function $Ee(t){return ns(t)==="Uint16Array"}Gt.isUint16Array=$Ee;function GEe(t){return ns(t)==="Uint32Array"}Gt.isUint32Array=GEe;function KEe(t){return ns(t)==="Int8Array"}Gt.isInt8Array=KEe;function VEe(t){return ns(t)==="Int16Array"}Gt.isInt16Array=VEe;function WEe(t){return ns(t)==="Int32Array"}Gt.isInt32Array=WEe;function YEe(t){return ns(t)==="Float32Array"}Gt.isFloat32Array=YEe;function QEe(t){return ns(t)==="Float64Array"}Gt.isFloat64Array=QEe;function JEe(t){return ns(t)==="BigInt64Array"}Gt.isBigInt64Array=JEe;function XEe(t){return ns(t)==="BigUint64Array"}Gt.isBigUint64Array=XEe;function jb(t){return Do(t)==="[object Map]"}jb.working=typeof Map<"u"&&jb(new Map);function ZEe(t){return typeof Map>"u"?!1:jb.working?jb(t):t instanceof Map}Gt.isMap=ZEe;function zb(t){return Do(t)==="[object Set]"}zb.working=typeof Set<"u"&&zb(new Set);function eSe(t){return typeof Set>"u"?!1:zb.working?zb(t):t instanceof Set}Gt.isSet=eSe;function Hb(t){return Do(t)==="[object WeakMap]"}Hb.working=typeof WeakMap<"u"&&Hb(new WeakMap);function tSe(t){return typeof WeakMap>"u"?!1:Hb.working?Hb(t):t instanceof WeakMap}Gt.isWeakMap=tSe;function FA(t){return Do(t)==="[object WeakSet]"}FA.working=typeof WeakSet<"u"&&FA(new WeakSet);function rSe(t){return FA(t)}Gt.isWeakSet=rSe;function $b(t){return Do(t)==="[object ArrayBuffer]"}$b.working=typeof ArrayBuffer<"u"&&$b(new ArrayBuffer);function pU(t){return typeof ArrayBuffer>"u"?!1:$b.working?$b(t):t instanceof ArrayBuffer}Gt.isArrayBuffer=pU;function Gb(t){return Do(t)==="[object DataView]"}Gb.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Gb(new DataView(new ArrayBuffer(1),0,1));function mU(t){return typeof DataView>"u"?!1:Gb.working?Gb(t):t instanceof DataView}Gt.isDataView=mU;var BA=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function n0(t){return Do(t)==="[object SharedArrayBuffer]"}function gU(t){return typeof BA>"u"?!1:(typeof n0.working>"u"&&(n0.working=n0(new BA)),n0.working?n0(t):t instanceof BA)}Gt.isSharedArrayBuffer=gU;function nSe(t){return Do(t)==="[object AsyncFunction]"}Gt.isAsyncFunction=nSe;function iSe(t){return Do(t)==="[object Map Iterator]"}Gt.isMapIterator=iSe;function oSe(t){return Do(t)==="[object Set Iterator]"}Gt.isSetIterator=oSe;function sSe(t){return Do(t)==="[object Generator]"}Gt.isGeneratorObject=sSe;function aSe(t){return Do(t)==="[object WebAssembly.Module]"}Gt.isWebAssemblyCompiledModule=aSe;function yU(t){return i0(t,FEe)}Gt.isNumberObject=yU;function vU(t){return i0(t,LEe)}Gt.isStringObject=vU;function bU(t){return i0(t,qEe)}Gt.isBooleanObject=bU;function _U(t){return lU&&i0(t,dU)}Gt.isBigIntObject=_U;function wU(t){return fU&&i0(t,hU)}Gt.isSymbolObject=wU;function cSe(t){return yU(t)||vU(t)||bU(t)||_U(t)||wU(t)}Gt.isBoxedPrimitive=cSe;function uSe(t){return typeof Uint8Array<"u"&&(pU(t)||gU(t))}Gt.isAnyArrayBuffer=uSe;["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(Gt,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})})});var SU=F((Oqe,EU)=>{m();EU.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var ah=F(Kt=>{m();var CU=Object.getOwnPropertyDescriptors||function(e){for(var r=Object.keys(e),i={},n=0;n=n)return u;switch(u){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch{return"[Circular]"}default:return u}}),c=i[r];r"u")return function(){return Kt.deprecate(t,e).apply(this,arguments)};var r=!1;function i(){if(!r){if(C.throwDeprecation)throw new Error(e);C.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return i};var Kb={},fSe=/^$/;Kt.debuglog=function(t){if(t=t.toUpperCase(),!Kb[t])if(fSe.test(t)){var e=C.pid;Kb[t]=function(){var r=Kt.format.apply(Kt,arguments);console.error("%s %d: %s",t,e,r)}}else Kb[t]=function(){};return Kb[t]};function Fc(t,e){var r={seen:[],stylize:hSe};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),jA(e)?r.showHidden=e:e&&Kt._extend(r,e),Nl(r.showHidden)&&(r.showHidden=!1),Nl(r.depth)&&(r.depth=2),Nl(r.colors)&&(r.colors=!1),Nl(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=dSe),Wb(r,t,r.depth)}Kt.inspect=Fc;Fc.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Fc.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function dSe(t,e){var r=Fc.styles[e];return r?"\x1B["+Fc.colors[r][0]+"m"+t+"\x1B["+Fc.colors[r][1]+"m":t}function hSe(t,e){return t}function pSe(t){var e={};return t.forEach(function(r,i){e[r]=!0}),e}function Wb(t,e,r){if(t.customInspect&&e&&Vb(e.inspect)&&e.inspect!==Kt.inspect&&!(e.constructor&&e.constructor.prototype===e)){var i=e.inspect(r,t);return Jb(i)||(i=Wb(t,i,r)),i}var n=mSe(t,e);if(n)return n;var o=Object.keys(e),c=pSe(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),s0(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return LA(e);if(o.length===0){if(Vb(e)){var u=e.name?": "+e.name:"";return t.stylize("[Function"+u+"]","special")}if(o0(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Yb(e))return t.stylize(Date.prototype.toString.call(e),"date");if(s0(e))return LA(e)}var d="",y=!1,E=["{","}"];if(AU(e)&&(y=!0,E=["[","]"]),Vb(e)){var x=e.name?": "+e.name:"";d=" [Function"+x+"]"}if(o0(e)&&(d=" "+RegExp.prototype.toString.call(e)),Yb(e)&&(d=" "+Date.prototype.toUTCString.call(e)),s0(e)&&(d=" "+LA(e)),o.length===0&&(!y||e.length==0))return E[0]+d+E[1];if(r<0)return o0(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var A;return y?A=gSe(t,e,r,c,o):A=o.map(function(R){return UA(t,e,r,c,R,y)}),t.seen.pop(),ySe(A,d,E)}function mSe(t,e){if(Nl(e))return t.stylize("undefined","undefined");if(Jb(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(TU(e))return t.stylize(""+e,"number");if(jA(e))return t.stylize(""+e,"boolean");if(Qb(e))return t.stylize("null","null")}function LA(t){return"["+Error.prototype.toString.call(t)+"]"}function gSe(t,e,r,i,n){for(var o=[],c=0,u=e.length;c-1&&(o?u=u.split(` -`).map(function(y){return" "+y}).join(` -`).slice(2):u=` -`+u.split(` -`).map(function(y){return" "+y}).join(` -`))):u=t.stylize("[Circular]","special")),Nl(c)){if(o&&n.match(/^\d+$/))return u;c=JSON.stringify(""+n),c.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.slice(1,-1),c=t.stylize(c,"name")):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=t.stylize(c,"string"))}return c+": "+u}function ySe(t,e,r){var i=0,n=t.reduce(function(o,c){return i++,c.indexOf(` -`)>=0&&i++,o+c.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(e===""?"":e+` - `)+" "+t.join(`, - `)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}Kt.types=xU();function AU(t){return Array.isArray(t)}Kt.isArray=AU;function jA(t){return typeof t=="boolean"}Kt.isBoolean=jA;function Qb(t){return t===null}Kt.isNull=Qb;function vSe(t){return t==null}Kt.isNullOrUndefined=vSe;function TU(t){return typeof t=="number"}Kt.isNumber=TU;function Jb(t){return typeof t=="string"}Kt.isString=Jb;function bSe(t){return typeof t=="symbol"}Kt.isSymbol=bSe;function Nl(t){return t===void 0}Kt.isUndefined=Nl;function o0(t){return sh(t)&&zA(t)==="[object RegExp]"}Kt.isRegExp=o0;Kt.types.isRegExp=o0;function sh(t){return typeof t=="object"&&t!==null}Kt.isObject=sh;function Yb(t){return sh(t)&&zA(t)==="[object Date]"}Kt.isDate=Yb;Kt.types.isDate=Yb;function s0(t){return sh(t)&&(zA(t)==="[object Error]"||t instanceof Error)}Kt.isError=s0;Kt.types.isNativeError=s0;function Vb(t){return typeof t=="function"}Kt.isFunction=Vb;function _Se(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t>"u"}Kt.isPrimitive=_Se;Kt.isBuffer=SU();function zA(t){return Object.prototype.toString.call(t)}function qA(t){return t<10?"0"+t.toString(10):t.toString(10)}var wSe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xSe(){var t=new Date,e=[qA(t.getHours()),qA(t.getMinutes()),qA(t.getSeconds())].join(":");return[t.getDate(),wSe[t.getMonth()],e].join(" ")}Kt.log=function(){console.log("%s - %s",xSe(),Kt.format.apply(Kt,arguments))};Kt.inherits=vt();Kt._extend=function(t,e){if(!e||!sh(e))return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t};function MU(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Pl=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Kt.promisify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(Pl&&e[Pl]){var r=e[Pl];if(typeof r!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,Pl,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var i,n,o=new Promise(function(d,y){i=d,n=y}),c=[],u=0;u{m();(function(t,e){typeof Xb=="object"&&typeof HA<"u"?e(Xb):typeof define=="function"&&define.amd?define(["exports"],e):e((t=typeof globalThis<"u"?globalThis:t||self).Dropbox={})})(Xb,function(t){"use strict";function e(S,B){if(!(S instanceof B))throw new TypeError("Cannot call a class as a function")}function r(S,B){for(var $=0;B.length>$;$++){var K=B[$];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(S,K.key,K)}}function i(S,B,$){return B&&r(S.prototype,B),$&&r(S,$),S}function n(S){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(B){return B.__proto__||Object.getPrototypeOf(B)})(S)}function o(S,B){return(o=Object.setPrototypeOf||function($,K){return $.__proto__=K,$})(S,B)}function c(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function u(S,B,$){return(u=c()?Reflect.construct:function(K,he,X){var Z=[null];Z.push.apply(Z,he);var it=new(Function.bind.apply(K,Z));return X&&o(it,X.prototype),it}).apply(null,arguments)}function d(S){var B=typeof Map=="function"?new Map:void 0;return(d=function($){if($===null||Function.toString.call($).indexOf("[native code]")===-1)return $;if(typeof $!="function")throw new TypeError("Super expression must either be null or a function");if(B!==void 0){if(B.has($))return B.get($);B.set($,K)}function K(){return u($,arguments,n(this).constructor)}return K.prototype=Object.create($.prototype,{constructor:{value:K,enumerable:!1,writable:!0,configurable:!0}}),o(K,$)})(S)}function y(S,B){return!B||typeof B!="object"&&typeof B!="function"?function($){if($===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $}(S):B}var E="app",x="user",A="team",R="dropboxapi.com",M="dropbox.com",I={api:"api",notify:"bolt",content:"api-content"},D={};function O(S){var B="000".concat(S.charCodeAt(0).toString(16)).slice(-4);return"\\u".concat(B)}D.accountSetProfilePhoto=function(S){return this.request("account/set_profile_photo",S,"user","api","rpc","account_info.write")},D.authTokenFromOauth1=function(S){return this.request("auth/token/from_oauth1",S,"app","api","rpc",null)},D.authTokenRevoke=function(){return this.request("auth/token/revoke",null,"user","api","rpc",null)},D.checkApp=function(S){return this.request("check/app",S,"app","api","rpc",null)},D.checkUser=function(S){return this.request("check/user",S,"user","api","rpc","account_info.read")},D.contactsDeleteManualContacts=function(){return this.request("contacts/delete_manual_contacts",null,"user","api","rpc","contacts.write")},D.contactsDeleteManualContactsBatch=function(S){return this.request("contacts/delete_manual_contacts_batch",S,"user","api","rpc","contacts.write")},D.filePropertiesPropertiesAdd=function(S){return this.request("file_properties/properties/add",S,"user","api","rpc","files.metadata.write")},D.filePropertiesPropertiesOverwrite=function(S){return this.request("file_properties/properties/overwrite",S,"user","api","rpc","files.metadata.write")},D.filePropertiesPropertiesRemove=function(S){return this.request("file_properties/properties/remove",S,"user","api","rpc","files.metadata.write")},D.filePropertiesPropertiesSearch=function(S){return this.request("file_properties/properties/search",S,"user","api","rpc","files.metadata.read")},D.filePropertiesPropertiesSearchContinue=function(S){return this.request("file_properties/properties/search/continue",S,"user","api","rpc","files.metadata.read")},D.filePropertiesPropertiesUpdate=function(S){return this.request("file_properties/properties/update",S,"user","api","rpc","files.metadata.write")},D.filePropertiesTemplatesAddForTeam=function(S){return this.request("file_properties/templates/add_for_team",S,"team","api","rpc","files.team_metadata.write")},D.filePropertiesTemplatesAddForUser=function(S){return this.request("file_properties/templates/add_for_user",S,"user","api","rpc","files.metadata.write")},D.filePropertiesTemplatesGetForTeam=function(S){return this.request("file_properties/templates/get_for_team",S,"team","api","rpc","files.team_metadata.write")},D.filePropertiesTemplatesGetForUser=function(S){return this.request("file_properties/templates/get_for_user",S,"user","api","rpc","files.metadata.read")},D.filePropertiesTemplatesListForTeam=function(){return this.request("file_properties/templates/list_for_team",null,"team","api","rpc","files.team_metadata.write")},D.filePropertiesTemplatesListForUser=function(){return this.request("file_properties/templates/list_for_user",null,"user","api","rpc","files.metadata.read")},D.filePropertiesTemplatesRemoveForTeam=function(S){return this.request("file_properties/templates/remove_for_team",S,"team","api","rpc","files.team_metadata.write")},D.filePropertiesTemplatesRemoveForUser=function(S){return this.request("file_properties/templates/remove_for_user",S,"user","api","rpc","files.metadata.write")},D.filePropertiesTemplatesUpdateForTeam=function(S){return this.request("file_properties/templates/update_for_team",S,"team","api","rpc","files.team_metadata.write")},D.filePropertiesTemplatesUpdateForUser=function(S){return this.request("file_properties/templates/update_for_user",S,"user","api","rpc","files.metadata.write")},D.fileRequestsCount=function(){return this.request("file_requests/count",null,"user","api","rpc","file_requests.read")},D.fileRequestsCreate=function(S){return this.request("file_requests/create",S,"user","api","rpc","file_requests.write")},D.fileRequestsDelete=function(S){return this.request("file_requests/delete",S,"user","api","rpc","file_requests.write")},D.fileRequestsDeleteAllClosed=function(){return this.request("file_requests/delete_all_closed",null,"user","api","rpc","file_requests.write")},D.fileRequestsGet=function(S){return this.request("file_requests/get",S,"user","api","rpc","file_requests.read")},D.fileRequestsListV2=function(S){return this.request("file_requests/list_v2",S,"user","api","rpc","file_requests.read")},D.fileRequestsList=function(){return this.request("file_requests/list",null,"user","api","rpc","file_requests.read")},D.fileRequestsListContinue=function(S){return this.request("file_requests/list/continue",S,"user","api","rpc","file_requests.read")},D.fileRequestsUpdate=function(S){return this.request("file_requests/update",S,"user","api","rpc","file_requests.write")},D.filesAlphaGetMetadata=function(S){return this.request("files/alpha/get_metadata",S,"user","api","rpc","files.metadata.read")},D.filesAlphaUpload=function(S){return this.request("files/alpha/upload",S,"user","content","upload","files.content.write")},D.filesCopyV2=function(S){return this.request("files/copy_v2",S,"user","api","rpc","files.content.write")},D.filesCopy=function(S){return this.request("files/copy",S,"user","api","rpc","files.content.write")},D.filesCopyBatchV2=function(S){return this.request("files/copy_batch_v2",S,"user","api","rpc","files.content.write")},D.filesCopyBatch=function(S){return this.request("files/copy_batch",S,"user","api","rpc","files.content.write")},D.filesCopyBatchCheckV2=function(S){return this.request("files/copy_batch/check_v2",S,"user","api","rpc","files.content.write")},D.filesCopyBatchCheck=function(S){return this.request("files/copy_batch/check",S,"user","api","rpc","files.content.write")},D.filesCopyReferenceGet=function(S){return this.request("files/copy_reference/get",S,"user","api","rpc","files.content.write")},D.filesCopyReferenceSave=function(S){return this.request("files/copy_reference/save",S,"user","api","rpc","files.content.write")},D.filesCreateFolderV2=function(S){return this.request("files/create_folder_v2",S,"user","api","rpc","files.content.write")},D.filesCreateFolder=function(S){return this.request("files/create_folder",S,"user","api","rpc","files.content.write")},D.filesCreateFolderBatch=function(S){return this.request("files/create_folder_batch",S,"user","api","rpc","files.content.write")},D.filesCreateFolderBatchCheck=function(S){return this.request("files/create_folder_batch/check",S,"user","api","rpc","files.content.write")},D.filesDeleteV2=function(S){return this.request("files/delete_v2",S,"user","api","rpc","files.content.write")},D.filesDelete=function(S){return this.request("files/delete",S,"user","api","rpc","files.content.write")},D.filesDeleteBatch=function(S){return this.request("files/delete_batch",S,"user","api","rpc","files.content.write")},D.filesDeleteBatchCheck=function(S){return this.request("files/delete_batch/check",S,"user","api","rpc","files.content.write")},D.filesDownload=function(S){return this.request("files/download",S,"user","content","download","files.content.read")},D.filesDownloadZip=function(S){return this.request("files/download_zip",S,"user","content","download","files.content.read")},D.filesExport=function(S){return this.request("files/export",S,"user","content","download","files.content.read")},D.filesGetFileLockBatch=function(S){return this.request("files/get_file_lock_batch",S,"user","api","rpc","files.content.read")},D.filesGetMetadata=function(S){return this.request("files/get_metadata",S,"user","api","rpc","files.metadata.read")},D.filesGetPreview=function(S){return this.request("files/get_preview",S,"user","content","download","files.content.read")},D.filesGetTemporaryLink=function(S){return this.request("files/get_temporary_link",S,"user","api","rpc","files.content.read")},D.filesGetTemporaryUploadLink=function(S){return this.request("files/get_temporary_upload_link",S,"user","api","rpc","files.content.write")},D.filesGetThumbnail=function(S){return this.request("files/get_thumbnail",S,"user","content","download","files.content.read")},D.filesGetThumbnailV2=function(S){return this.request("files/get_thumbnail_v2",S,"app, user","content","download","files.content.read")},D.filesGetThumbnailBatch=function(S){return this.request("files/get_thumbnail_batch",S,"user","content","rpc","files.content.read")},D.filesListFolder=function(S){return this.request("files/list_folder",S,"app, user","api","rpc","files.metadata.read")},D.filesListFolderContinue=function(S){return this.request("files/list_folder/continue",S,"app, user","api","rpc","files.metadata.read")},D.filesListFolderGetLatestCursor=function(S){return this.request("files/list_folder/get_latest_cursor",S,"user","api","rpc","files.metadata.read")},D.filesListFolderLongpoll=function(S){return this.request("files/list_folder/longpoll",S,"noauth","notify","rpc","files.metadata.read")},D.filesListRevisions=function(S){return this.request("files/list_revisions",S,"user","api","rpc","files.metadata.read")},D.filesLockFileBatch=function(S){return this.request("files/lock_file_batch",S,"user","api","rpc","files.content.write")},D.filesMoveV2=function(S){return this.request("files/move_v2",S,"user","api","rpc","files.content.write")},D.filesMove=function(S){return this.request("files/move",S,"user","api","rpc","files.content.write")},D.filesMoveBatchV2=function(S){return this.request("files/move_batch_v2",S,"user","api","rpc","files.content.write")},D.filesMoveBatch=function(S){return this.request("files/move_batch",S,"user","api","rpc","files.content.write")},D.filesMoveBatchCheckV2=function(S){return this.request("files/move_batch/check_v2",S,"user","api","rpc","files.content.write")},D.filesMoveBatchCheck=function(S){return this.request("files/move_batch/check",S,"user","api","rpc","files.content.write")},D.filesPaperCreate=function(S){return this.request("files/paper/create",S,"user","api","upload","files.content.write")},D.filesPaperUpdate=function(S){return this.request("files/paper/update",S,"user","api","upload","files.content.write")},D.filesPermanentlyDelete=function(S){return this.request("files/permanently_delete",S,"user","api","rpc","files.permanent_delete")},D.filesPropertiesAdd=function(S){return this.request("files/properties/add",S,"user","api","rpc","files.metadata.write")},D.filesPropertiesOverwrite=function(S){return this.request("files/properties/overwrite",S,"user","api","rpc","files.metadata.write")},D.filesPropertiesRemove=function(S){return this.request("files/properties/remove",S,"user","api","rpc","files.metadata.write")},D.filesPropertiesTemplateGet=function(S){return this.request("files/properties/template/get",S,"user","api","rpc","files.metadata.read")},D.filesPropertiesTemplateList=function(){return this.request("files/properties/template/list",null,"user","api","rpc","files.metadata.read")},D.filesPropertiesUpdate=function(S){return this.request("files/properties/update",S,"user","api","rpc","files.metadata.write")},D.filesRestore=function(S){return this.request("files/restore",S,"user","api","rpc","files.content.write")},D.filesSaveUrl=function(S){return this.request("files/save_url",S,"user","api","rpc","files.content.write")},D.filesSaveUrlCheckJobStatus=function(S){return this.request("files/save_url/check_job_status",S,"user","api","rpc","files.content.write")},D.filesSearch=function(S){return this.request("files/search",S,"user","api","rpc","files.metadata.read")},D.filesSearchV2=function(S){return this.request("files/search_v2",S,"user","api","rpc","files.metadata.read")},D.filesSearchContinueV2=function(S){return this.request("files/search/continue_v2",S,"user","api","rpc","files.metadata.read")},D.filesTagsAdd=function(S){return this.request("files/tags/add",S,"user","api","rpc","files.metadata.write")},D.filesTagsGet=function(S){return this.request("files/tags/get",S,"user","api","rpc","files.metadata.read")},D.filesTagsRemove=function(S){return this.request("files/tags/remove",S,"user","api","rpc","files.metadata.write")},D.filesUnlockFileBatch=function(S){return this.request("files/unlock_file_batch",S,"user","api","rpc","files.content.write")},D.filesUpload=function(S){return this.request("files/upload",S,"user","content","upload","files.content.write")},D.filesUploadSessionAppendV2=function(S){return this.request("files/upload_session/append_v2",S,"user","content","upload","files.content.write")},D.filesUploadSessionAppend=function(S){return this.request("files/upload_session/append",S,"user","content","upload","files.content.write")},D.filesUploadSessionFinish=function(S){return this.request("files/upload_session/finish",S,"user","content","upload","files.content.write")},D.filesUploadSessionFinishBatch=function(S){return this.request("files/upload_session/finish_batch",S,"user","api","rpc","files.content.write")},D.filesUploadSessionFinishBatchV2=function(S){return this.request("files/upload_session/finish_batch_v2",S,"user","api","rpc","files.content.write")},D.filesUploadSessionFinishBatchCheck=function(S){return this.request("files/upload_session/finish_batch/check",S,"user","api","rpc","files.content.write")},D.filesUploadSessionStart=function(S){return this.request("files/upload_session/start",S,"user","content","upload","files.content.write")},D.filesUploadSessionStartBatch=function(S){return this.request("files/upload_session/start_batch",S,"user","api","rpc","files.content.write")},D.openidUserinfo=function(S){return this.request("openid/userinfo",S,"user","api","rpc","openid")},D.paperDocsArchive=function(S){return this.request("paper/docs/archive",S,"user","api","rpc","files.content.write")},D.paperDocsCreate=function(S){return this.request("paper/docs/create",S,"user","api","upload","files.content.write")},D.paperDocsDownload=function(S){return this.request("paper/docs/download",S,"user","api","download","files.content.read")},D.paperDocsFolderUsersList=function(S){return this.request("paper/docs/folder_users/list",S,"user","api","rpc","sharing.read")},D.paperDocsFolderUsersListContinue=function(S){return this.request("paper/docs/folder_users/list/continue",S,"user","api","rpc","sharing.read")},D.paperDocsGetFolderInfo=function(S){return this.request("paper/docs/get_folder_info",S,"user","api","rpc","sharing.read")},D.paperDocsList=function(S){return this.request("paper/docs/list",S,"user","api","rpc","files.metadata.read")},D.paperDocsListContinue=function(S){return this.request("paper/docs/list/continue",S,"user","api","rpc","files.metadata.read")},D.paperDocsPermanentlyDelete=function(S){return this.request("paper/docs/permanently_delete",S,"user","api","rpc","files.permanent_delete")},D.paperDocsSharingPolicyGet=function(S){return this.request("paper/docs/sharing_policy/get",S,"user","api","rpc","sharing.read")},D.paperDocsSharingPolicySet=function(S){return this.request("paper/docs/sharing_policy/set",S,"user","api","rpc","sharing.write")},D.paperDocsUpdate=function(S){return this.request("paper/docs/update",S,"user","api","upload","files.content.write")},D.paperDocsUsersAdd=function(S){return this.request("paper/docs/users/add",S,"user","api","rpc","sharing.write")},D.paperDocsUsersList=function(S){return this.request("paper/docs/users/list",S,"user","api","rpc","sharing.read")},D.paperDocsUsersListContinue=function(S){return this.request("paper/docs/users/list/continue",S,"user","api","rpc","sharing.read")},D.paperDocsUsersRemove=function(S){return this.request("paper/docs/users/remove",S,"user","api","rpc","sharing.write")},D.paperFoldersCreate=function(S){return this.request("paper/folders/create",S,"user","api","rpc","files.content.write")},D.sharingAddFileMember=function(S){return this.request("sharing/add_file_member",S,"user","api","rpc","sharing.write")},D.sharingAddFolderMember=function(S){return this.request("sharing/add_folder_member",S,"user","api","rpc","sharing.write")},D.sharingCheckJobStatus=function(S){return this.request("sharing/check_job_status",S,"user","api","rpc","sharing.write")},D.sharingCheckRemoveMemberJobStatus=function(S){return this.request("sharing/check_remove_member_job_status",S,"user","api","rpc","sharing.write")},D.sharingCheckShareJobStatus=function(S){return this.request("sharing/check_share_job_status",S,"user","api","rpc","sharing.write")},D.sharingCreateSharedLink=function(S){return this.request("sharing/create_shared_link",S,"user","api","rpc","sharing.write")},D.sharingCreateSharedLinkWithSettings=function(S){return this.request("sharing/create_shared_link_with_settings",S,"user","api","rpc","sharing.write")},D.sharingGetFileMetadata=function(S){return this.request("sharing/get_file_metadata",S,"user","api","rpc","sharing.read")},D.sharingGetFileMetadataBatch=function(S){return this.request("sharing/get_file_metadata/batch",S,"user","api","rpc","sharing.read")},D.sharingGetFolderMetadata=function(S){return this.request("sharing/get_folder_metadata",S,"user","api","rpc","sharing.read")},D.sharingGetSharedLinkFile=function(S){return this.request("sharing/get_shared_link_file",S,"user","content","download","sharing.read")},D.sharingGetSharedLinkMetadata=function(S){return this.request("sharing/get_shared_link_metadata",S,"app, user","api","rpc","sharing.read")},D.sharingGetSharedLinks=function(S){return this.request("sharing/get_shared_links",S,"user","api","rpc","sharing.read")},D.sharingListFileMembers=function(S){return this.request("sharing/list_file_members",S,"user","api","rpc","sharing.read")},D.sharingListFileMembersBatch=function(S){return this.request("sharing/list_file_members/batch",S,"user","api","rpc","sharing.read")},D.sharingListFileMembersContinue=function(S){return this.request("sharing/list_file_members/continue",S,"user","api","rpc","sharing.read")},D.sharingListFolderMembers=function(S){return this.request("sharing/list_folder_members",S,"user","api","rpc","sharing.read")},D.sharingListFolderMembersContinue=function(S){return this.request("sharing/list_folder_members/continue",S,"user","api","rpc","sharing.read")},D.sharingListFolders=function(S){return this.request("sharing/list_folders",S,"user","api","rpc","sharing.read")},D.sharingListFoldersContinue=function(S){return this.request("sharing/list_folders/continue",S,"user","api","rpc","sharing.read")},D.sharingListMountableFolders=function(S){return this.request("sharing/list_mountable_folders",S,"user","api","rpc","sharing.read")},D.sharingListMountableFoldersContinue=function(S){return this.request("sharing/list_mountable_folders/continue",S,"user","api","rpc","sharing.read")},D.sharingListReceivedFiles=function(S){return this.request("sharing/list_received_files",S,"user","api","rpc","sharing.read")},D.sharingListReceivedFilesContinue=function(S){return this.request("sharing/list_received_files/continue",S,"user","api","rpc","sharing.read")},D.sharingListSharedLinks=function(S){return this.request("sharing/list_shared_links",S,"user","api","rpc","sharing.read")},D.sharingModifySharedLinkSettings=function(S){return this.request("sharing/modify_shared_link_settings",S,"user","api","rpc","sharing.write")},D.sharingMountFolder=function(S){return this.request("sharing/mount_folder",S,"user","api","rpc","sharing.write")},D.sharingRelinquishFileMembership=function(S){return this.request("sharing/relinquish_file_membership",S,"user","api","rpc","sharing.write")},D.sharingRelinquishFolderMembership=function(S){return this.request("sharing/relinquish_folder_membership",S,"user","api","rpc","sharing.write")},D.sharingRemoveFileMember=function(S){return this.request("sharing/remove_file_member",S,"user","api","rpc","sharing.write")},D.sharingRemoveFileMember2=function(S){return this.request("sharing/remove_file_member_2",S,"user","api","rpc","sharing.write")},D.sharingRemoveFolderMember=function(S){return this.request("sharing/remove_folder_member",S,"user","api","rpc","sharing.write")},D.sharingRevokeSharedLink=function(S){return this.request("sharing/revoke_shared_link",S,"user","api","rpc","sharing.write")},D.sharingSetAccessInheritance=function(S){return this.request("sharing/set_access_inheritance",S,"user","api","rpc","sharing.write")},D.sharingShareFolder=function(S){return this.request("sharing/share_folder",S,"user","api","rpc","sharing.write")},D.sharingTransferFolder=function(S){return this.request("sharing/transfer_folder",S,"user","api","rpc","sharing.write")},D.sharingUnmountFolder=function(S){return this.request("sharing/unmount_folder",S,"user","api","rpc","sharing.write")},D.sharingUnshareFile=function(S){return this.request("sharing/unshare_file",S,"user","api","rpc","sharing.write")},D.sharingUnshareFolder=function(S){return this.request("sharing/unshare_folder",S,"user","api","rpc","sharing.write")},D.sharingUpdateFileMember=function(S){return this.request("sharing/update_file_member",S,"user","api","rpc","sharing.write")},D.sharingUpdateFolderMember=function(S){return this.request("sharing/update_folder_member",S,"user","api","rpc","sharing.write")},D.sharingUpdateFolderPolicy=function(S){return this.request("sharing/update_folder_policy",S,"user","api","rpc","sharing.write")},D.teamDevicesListMemberDevices=function(S){return this.request("team/devices/list_member_devices",S,"team","api","rpc","sessions.list")},D.teamDevicesListMembersDevices=function(S){return this.request("team/devices/list_members_devices",S,"team","api","rpc","sessions.list")},D.teamDevicesListTeamDevices=function(S){return this.request("team/devices/list_team_devices",S,"team","api","rpc","sessions.list")},D.teamDevicesRevokeDeviceSession=function(S){return this.request("team/devices/revoke_device_session",S,"team","api","rpc","sessions.modify")},D.teamDevicesRevokeDeviceSessionBatch=function(S){return this.request("team/devices/revoke_device_session_batch",S,"team","api","rpc","sessions.modify")},D.teamFeaturesGetValues=function(S){return this.request("team/features/get_values",S,"team","api","rpc","team_info.read")},D.teamGetInfo=function(){return this.request("team/get_info",null,"team","api","rpc","team_info.read")},D.teamGroupsCreate=function(S){return this.request("team/groups/create",S,"team","api","rpc","groups.write")},D.teamGroupsDelete=function(S){return this.request("team/groups/delete",S,"team","api","rpc","groups.write")},D.teamGroupsGetInfo=function(S){return this.request("team/groups/get_info",S,"team","api","rpc","groups.read")},D.teamGroupsJobStatusGet=function(S){return this.request("team/groups/job_status/get",S,"team","api","rpc","groups.write")},D.teamGroupsList=function(S){return this.request("team/groups/list",S,"team","api","rpc","groups.read")},D.teamGroupsListContinue=function(S){return this.request("team/groups/list/continue",S,"team","api","rpc","groups.read")},D.teamGroupsMembersAdd=function(S){return this.request("team/groups/members/add",S,"team","api","rpc","groups.write")},D.teamGroupsMembersList=function(S){return this.request("team/groups/members/list",S,"team","api","rpc","groups.read")},D.teamGroupsMembersListContinue=function(S){return this.request("team/groups/members/list/continue",S,"team","api","rpc","groups.read")},D.teamGroupsMembersRemove=function(S){return this.request("team/groups/members/remove",S,"team","api","rpc","groups.write")},D.teamGroupsMembersSetAccessType=function(S){return this.request("team/groups/members/set_access_type",S,"team","api","rpc","groups.write")},D.teamGroupsUpdate=function(S){return this.request("team/groups/update",S,"team","api","rpc","groups.write")},D.teamLegalHoldsCreatePolicy=function(S){return this.request("team/legal_holds/create_policy",S,"team","api","rpc","team_data.governance.write")},D.teamLegalHoldsGetPolicy=function(S){return this.request("team/legal_holds/get_policy",S,"team","api","rpc","team_data.governance.write")},D.teamLegalHoldsListHeldRevisions=function(S){return this.request("team/legal_holds/list_held_revisions",S,"team","api","rpc","team_data.governance.write")},D.teamLegalHoldsListHeldRevisionsContinue=function(S){return this.request("team/legal_holds/list_held_revisions_continue",S,"team","api","rpc","team_data.governance.write")},D.teamLegalHoldsListPolicies=function(S){return this.request("team/legal_holds/list_policies",S,"team","api","rpc","team_data.governance.write")},D.teamLegalHoldsReleasePolicy=function(S){return this.request("team/legal_holds/release_policy",S,"team","api","rpc","team_data.governance.write")},D.teamLegalHoldsUpdatePolicy=function(S){return this.request("team/legal_holds/update_policy",S,"team","api","rpc","team_data.governance.write")},D.teamLinkedAppsListMemberLinkedApps=function(S){return this.request("team/linked_apps/list_member_linked_apps",S,"team","api","rpc","sessions.list")},D.teamLinkedAppsListMembersLinkedApps=function(S){return this.request("team/linked_apps/list_members_linked_apps",S,"team","api","rpc","sessions.list")},D.teamLinkedAppsListTeamLinkedApps=function(S){return this.request("team/linked_apps/list_team_linked_apps",S,"team","api","rpc","sessions.list")},D.teamLinkedAppsRevokeLinkedApp=function(S){return this.request("team/linked_apps/revoke_linked_app",S,"team","api","rpc","sessions.modify")},D.teamLinkedAppsRevokeLinkedAppBatch=function(S){return this.request("team/linked_apps/revoke_linked_app_batch",S,"team","api","rpc","sessions.modify")},D.teamMemberSpaceLimitsExcludedUsersAdd=function(S){return this.request("team/member_space_limits/excluded_users/add",S,"team","api","rpc","members.write")},D.teamMemberSpaceLimitsExcludedUsersList=function(S){return this.request("team/member_space_limits/excluded_users/list",S,"team","api","rpc","members.read")},D.teamMemberSpaceLimitsExcludedUsersListContinue=function(S){return this.request("team/member_space_limits/excluded_users/list/continue",S,"team","api","rpc","members.read")},D.teamMemberSpaceLimitsExcludedUsersRemove=function(S){return this.request("team/member_space_limits/excluded_users/remove",S,"team","api","rpc","members.write")},D.teamMemberSpaceLimitsGetCustomQuota=function(S){return this.request("team/member_space_limits/get_custom_quota",S,"team","api","rpc","members.read")},D.teamMemberSpaceLimitsRemoveCustomQuota=function(S){return this.request("team/member_space_limits/remove_custom_quota",S,"team","api","rpc","members.write")},D.teamMemberSpaceLimitsSetCustomQuota=function(S){return this.request("team/member_space_limits/set_custom_quota",S,"team","api","rpc","members.read")},D.teamMembersAddV2=function(S){return this.request("team/members/add_v2",S,"team","api","rpc","members.write")},D.teamMembersAdd=function(S){return this.request("team/members/add",S,"team","api","rpc","members.write")},D.teamMembersAddJobStatusGetV2=function(S){return this.request("team/members/add/job_status/get_v2",S,"team","api","rpc","members.write")},D.teamMembersAddJobStatusGet=function(S){return this.request("team/members/add/job_status/get",S,"team","api","rpc","members.write")},D.teamMembersDeleteProfilePhotoV2=function(S){return this.request("team/members/delete_profile_photo_v2",S,"team","api","rpc","members.write")},D.teamMembersDeleteProfilePhoto=function(S){return this.request("team/members/delete_profile_photo",S,"team","api","rpc","members.write")},D.teamMembersGetAvailableTeamMemberRoles=function(){return this.request("team/members/get_available_team_member_roles",null,"team","api","rpc","members.read")},D.teamMembersGetInfoV2=function(S){return this.request("team/members/get_info_v2",S,"team","api","rpc","members.read")},D.teamMembersGetInfo=function(S){return this.request("team/members/get_info",S,"team","api","rpc","members.read")},D.teamMembersListV2=function(S){return this.request("team/members/list_v2",S,"team","api","rpc","members.read")},D.teamMembersList=function(S){return this.request("team/members/list",S,"team","api","rpc","members.read")},D.teamMembersListContinueV2=function(S){return this.request("team/members/list/continue_v2",S,"team","api","rpc","members.read")},D.teamMembersListContinue=function(S){return this.request("team/members/list/continue",S,"team","api","rpc","members.read")},D.teamMembersMoveFormerMemberFiles=function(S){return this.request("team/members/move_former_member_files",S,"team","api","rpc","members.write")},D.teamMembersMoveFormerMemberFilesJobStatusCheck=function(S){return this.request("team/members/move_former_member_files/job_status/check",S,"team","api","rpc","members.write")},D.teamMembersRecover=function(S){return this.request("team/members/recover",S,"team","api","rpc","members.delete")},D.teamMembersRemove=function(S){return this.request("team/members/remove",S,"team","api","rpc","members.delete")},D.teamMembersRemoveJobStatusGet=function(S){return this.request("team/members/remove/job_status/get",S,"team","api","rpc","members.delete")},D.teamMembersSecondaryEmailsAdd=function(S){return this.request("team/members/secondary_emails/add",S,"team","api","rpc","members.write")},D.teamMembersSecondaryEmailsDelete=function(S){return this.request("team/members/secondary_emails/delete",S,"team","api","rpc","members.write")},D.teamMembersSecondaryEmailsResendVerificationEmails=function(S){return this.request("team/members/secondary_emails/resend_verification_emails",S,"team","api","rpc","members.write")},D.teamMembersSendWelcomeEmail=function(S){return this.request("team/members/send_welcome_email",S,"team","api","rpc","members.write")},D.teamMembersSetAdminPermissionsV2=function(S){return this.request("team/members/set_admin_permissions_v2",S,"team","api","rpc","members.write")},D.teamMembersSetAdminPermissions=function(S){return this.request("team/members/set_admin_permissions",S,"team","api","rpc","members.write")},D.teamMembersSetProfileV2=function(S){return this.request("team/members/set_profile_v2",S,"team","api","rpc","members.write")},D.teamMembersSetProfile=function(S){return this.request("team/members/set_profile",S,"team","api","rpc","members.write")},D.teamMembersSetProfilePhotoV2=function(S){return this.request("team/members/set_profile_photo_v2",S,"team","api","rpc","members.write")},D.teamMembersSetProfilePhoto=function(S){return this.request("team/members/set_profile_photo",S,"team","api","rpc","members.write")},D.teamMembersSuspend=function(S){return this.request("team/members/suspend",S,"team","api","rpc","members.write")},D.teamMembersUnsuspend=function(S){return this.request("team/members/unsuspend",S,"team","api","rpc","members.write")},D.teamNamespacesList=function(S){return this.request("team/namespaces/list",S,"team","api","rpc","team_data.member")},D.teamNamespacesListContinue=function(S){return this.request("team/namespaces/list/continue",S,"team","api","rpc","team_data.member")},D.teamPropertiesTemplateAdd=function(S){return this.request("team/properties/template/add",S,"team","api","rpc","files.team_metadata.write")},D.teamPropertiesTemplateGet=function(S){return this.request("team/properties/template/get",S,"team","api","rpc","files.team_metadata.write")},D.teamPropertiesTemplateList=function(){return this.request("team/properties/template/list",null,"team","api","rpc","files.team_metadata.write")},D.teamPropertiesTemplateUpdate=function(S){return this.request("team/properties/template/update",S,"team","api","rpc","files.team_metadata.write")},D.teamReportsGetActivity=function(S){return this.request("team/reports/get_activity",S,"team","api","rpc","team_info.read")},D.teamReportsGetDevices=function(S){return this.request("team/reports/get_devices",S,"team","api","rpc","team_info.read")},D.teamReportsGetMembership=function(S){return this.request("team/reports/get_membership",S,"team","api","rpc","team_info.read")},D.teamReportsGetStorage=function(S){return this.request("team/reports/get_storage",S,"team","api","rpc","team_info.read")},D.teamSharingAllowlistAdd=function(S){return this.request("team/sharing_allowlist/add",S,"team","api","rpc","team_info.write")},D.teamSharingAllowlistList=function(S){return this.request("team/sharing_allowlist/list",S,"team","api","rpc","team_info.read")},D.teamSharingAllowlistListContinue=function(S){return this.request("team/sharing_allowlist/list/continue",S,"team","api","rpc","team_info.read")},D.teamSharingAllowlistRemove=function(S){return this.request("team/sharing_allowlist/remove",S,"team","api","rpc","team_info.write")},D.teamTeamFolderActivate=function(S){return this.request("team/team_folder/activate",S,"team","api","rpc","team_data.content.write")},D.teamTeamFolderArchive=function(S){return this.request("team/team_folder/archive",S,"team","api","rpc","team_data.content.write")},D.teamTeamFolderArchiveCheck=function(S){return this.request("team/team_folder/archive/check",S,"team","api","rpc","team_data.content.write")},D.teamTeamFolderCreate=function(S){return this.request("team/team_folder/create",S,"team","api","rpc","team_data.content.write")},D.teamTeamFolderGetInfo=function(S){return this.request("team/team_folder/get_info",S,"team","api","rpc","team_data.content.read")},D.teamTeamFolderList=function(S){return this.request("team/team_folder/list",S,"team","api","rpc","team_data.content.read")},D.teamTeamFolderListContinue=function(S){return this.request("team/team_folder/list/continue",S,"team","api","rpc","team_data.content.read")},D.teamTeamFolderPermanentlyDelete=function(S){return this.request("team/team_folder/permanently_delete",S,"team","api","rpc","team_data.content.write")},D.teamTeamFolderRename=function(S){return this.request("team/team_folder/rename",S,"team","api","rpc","team_data.content.write")},D.teamTeamFolderUpdateSyncSettings=function(S){return this.request("team/team_folder/update_sync_settings",S,"team","api","rpc","team_data.content.write")},D.teamTokenGetAuthenticatedAdmin=function(){return this.request("team/token/get_authenticated_admin",null,"team","api","rpc","team_info.read")},D.teamLogGetEvents=function(S){return this.request("team_log/get_events",S,"team","api","rpc","events.read")},D.teamLogGetEventsContinue=function(S){return this.request("team_log/get_events/continue",S,"team","api","rpc","events.read")},D.usersFeaturesGetValues=function(S){return this.request("users/features/get_values",S,"user","api","rpc","account_info.read")},D.usersGetAccount=function(S){return this.request("users/get_account",S,"user","api","rpc","sharing.read")},D.usersGetAccountBatch=function(S){return this.request("users/get_account_batch",S,"user","api","rpc","sharing.read")},D.usersGetCurrentAccount=function(){return this.request("users/get_current_account",null,"user","api","rpc","account_info.read")},D.usersGetSpaceUsage=function(){return this.request("users/get_space_usage",null,"user","api","rpc","account_info.read")};var N=function(S){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";return $?(B!==R&&I[S]!==void 0&&(S=I[S],$="-"),"https://".concat(S).concat($).concat(B,"/2/")):"https://".concat(B,"/2/")},L=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M;return S!==M&&(S="meta-".concat(S)),"https://".concat(S,"/oauth2/authorize")},j=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",$="api";return S!==R&&($=I[$],B="-"),"https://".concat($).concat(B).concat(S,"/oauth2/token")};function H(S){return JSON.stringify(S).replace(/[\u007f-\uffff]/g,O)}function Y(S){return new Date(Date.now()+1e3*S)}function W(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope||typeof HA>"u"||typeof window<"u"}function q(){return typeof window<"u"}function J(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function _(S){return S.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var s,l,p,f=function(S){(function(X,Z){if(typeof Z!="function"&&Z!==null)throw new TypeError("Super expression must either be null or a function");X.prototype=Object.create(Z&&Z.prototype,{constructor:{value:X,writable:!0,configurable:!0}}),Z&&o(X,Z)})(he,S);var B,$,K=(B=he,$=c(),function(){var X,Z=n(B);if($){var it=n(this).constructor;X=Reflect.construct(Z,arguments,it)}else X=Z.apply(this,arguments);return y(this,X)});function he(X,Z,it){var oe;return e(this,he),(oe=K.call(this,"Response failed with a ".concat(X," code"))).name="DropboxResponseError",oe.status=X,oe.headers=Z,oe.error=it,oe}return he}(d(Error)),h=function S(B,$,K){e(this,S),this.status=B,this.headers=$,this.result=K};function b(S){return S.text().then(function(B){var $;try{$=JSON.parse(B)}catch{$=B}throw new f(S.status,S.headers,$)})}function w(S){return S.ok?S.text().then(function(B){var $;try{$=JSON.parse(B)}catch{$=B}return new h(S.status,S.headers,$)}):b(S)}var g=["legacy","offline","online"],a=["code","token"],v=["none","user","team"],P=function(){function S(B){e(this,S),B=B||{},q()?(s=window.fetch.bind(window),l=window.crypto||window.msCrypto):J()?(s=self.fetch.bind(self),l=self.crypto):(s=C8(),l=Dl()),p=typeof TextEncoder>"u"?ah().TextEncoder:TextEncoder,this.fetch=B.fetch||s,this.accessToken=B.accessToken,this.accessTokenExpiresAt=B.accessTokenExpiresAt,this.refreshToken=B.refreshToken,this.clientId=B.clientId,this.clientSecret=B.clientSecret,this.domain=B.domain,this.domainDelimiter=B.domainDelimiter,this.customHeaders=B.customHeaders,this.dataOnBody=B.dataOnBody}return i(S,[{key:"setAccessToken",value:function(B){this.accessToken=B}},{key:"getAccessToken",value:function(){return this.accessToken}},{key:"setClientId",value:function(B){this.clientId=B}},{key:"getClientId",value:function(){return this.clientId}},{key:"setClientSecret",value:function(B){this.clientSecret=B}},{key:"getClientSecret",value:function(){return this.clientSecret}},{key:"getRefreshToken",value:function(){return this.refreshToken}},{key:"setRefreshToken",value:function(B){this.refreshToken=B}},{key:"getAccessTokenExpiresAt",value:function(){return this.accessTokenExpiresAt}},{key:"setAccessTokenExpiresAt",value:function(B){this.accessTokenExpiresAt=B}},{key:"setCodeVerifier",value:function(B){this.codeVerifier=B}},{key:"getCodeVerifier",value:function(){return this.codeVerifier}},{key:"generateCodeChallenge",value:function(){var B,$=this,K=new p().encode(this.codeVerifier);if(q()||J())return l.subtle.digest("SHA-256",K).then(function(X){var Z=btoa(String.fromCharCode.apply(null,new Uint8Array(X)));B=_(Z).substr(0,128),$.codeChallenge=B});var he=l.createHash("sha256").update(K).digest();return B=_(he),this.codeChallenge=B,Promise.resolve()}},{key:"generatePKCECodes",value:function(){var B;if(q()||J()){var $=new Uint8Array(128),K=l.getRandomValues($);B=_(btoa(K)).substr(0,128)}else B=_(l.randomBytes(128)).substr(0,128);return this.codeVerifier=B,this.generateCodeChallenge()}},{key:"getAuthenticationUrl",value:function(B,$){var K,he=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"token",Z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,it=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,oe=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"none",ce=arguments.length>6&&arguments[6]!==void 0&&arguments[6],Rt=this.getClientId(),ue=L(this.domain);if(!Rt)throw Error("A client id is required. You can set the client id using .setClientId().");if(X!=="code"&&!B)throw Error("A redirect uri is required.");if(!a.includes(X))throw Error("Authorization type must be code or token");if(Z&&!g.includes(Z))throw Error("Token Access Type must be legacy, offline, or online");if(it&&!(it instanceof Array))throw Error("Scope must be an array of strings");if(!v.includes(oe))throw Error("includeGrantedScopes must be none, user, or team");return K=X==="code"?"".concat(ue,"?response_type=code&client_id=").concat(Rt):"".concat(ue,"?response_type=token&client_id=").concat(Rt),B&&(K+="&redirect_uri=".concat(B)),$&&(K+="&state=".concat($)),Z&&(K+="&token_access_type=".concat(Z)),it&&(K+="&scope=".concat(it.join(" "))),oe!=="none"&&(K+="&include_granted_scopes=".concat(oe)),ce?this.generatePKCECodes().then(function(){return K+="&code_challenge_method=S256",K+="&code_challenge=".concat(he.codeChallenge)}):Promise.resolve(K)}},{key:"getAccessTokenFromCode",value:function(B,$){var K=this.getClientId(),he=this.getClientSecret();if(!K)throw Error("A client id is required. You can set the client id using .setClientId().");var X=j(this.domain,this.domainDelimiter);if(X+="?grant_type=authorization_code",X+="&code=".concat($),X+="&client_id=".concat(K),he)X+="&client_secret=".concat(he);else{if(!this.codeVerifier)throw Error("You must use PKCE when generating the authorization URL to not include a client secret");X+="&code_verifier=".concat(this.codeVerifier)}return B&&(X+="&redirect_uri=".concat(B)),this.fetch(X,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(Z){return w(Z)})}},{key:"checkAndRefreshAccessToken",value:function(){var B=this.getRefreshToken()&&this.getClientId(),$=!this.getAccessTokenExpiresAt()||new Date(Date.now()+3e5)>=this.getAccessTokenExpiresAt(),K=!this.getAccessToken();return($||K)&&B?this.refreshAccessToken():Promise.resolve()}},{key:"refreshAccessToken",value:function(){var B=this,$=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,K=this.getClientId(),he=this.getClientSecret();if(!K)throw Error("A client id is required. You can set the client id using .setClientId().");if($&&!($ instanceof Array))throw Error("Scope must be an array of strings");var X=j(this.domain,this.domainDelimiter),Z={headers:{"Content-Type":"application/json"},method:"POST"};if(this.dataOnBody){var it={grant_type:"refresh_token",client_id:K,refresh_token:this.getRefreshToken()};he&&(it.client_secret=he),$&&(it.scope=$.join(" ")),Z.body=it}else X+="?grant_type=refresh_token&refresh_token=".concat(this.getRefreshToken()),X+="&client_id=".concat(K),he&&(X+="&client_secret=".concat(he)),$&&(X+="&scope=".concat($.join(" ")));return this.fetch(X,Z).then(function(oe){return w(oe)}).then(function(oe){B.setAccessToken(oe.result.access_token),B.setAccessTokenExpiresAt(Y(oe.result.expires_in))})}}]),S}(),k=typeof btoa>"u"?function(S){return T.from(S).toString("base64")}:btoa;t.Dropbox=function(){function S(B){e(this,S),this.auth=(B=B||{}).auth?B.auth:new P(B),this.fetch=B.fetch||this.auth.fetch,this.selectUser=B.selectUser,this.selectAdmin=B.selectAdmin,this.pathRoot=B.pathRoot,this.domain=B.domain||this.auth.domain,this.domainDelimiter=B.domainDelimiter||this.auth.domainDelimiter,this.customHeaders=B.customHeaders||this.auth.customHeaders,Object.assign(this,D)}return i(S,[{key:"request",value:function(B,$,K,he,X){switch(X){case"rpc":return this.rpcRequest(B,$,K,he);case"download":return this.downloadRequest(B,$,K,he);case"upload":return this.uploadRequest(B,$,K,he);default:throw Error("Invalid request style: ".concat(X))}}},{key:"rpcRequest",value:function(B,$,K,he){var X=this;return this.auth.checkAndRefreshAccessToken().then(function(){var Z={method:"POST",body:$?JSON.stringify($):null,headers:{}};return $&&(Z.headers["Content-Type"]="application/json"),X.setAuthHeaders(K,Z),X.setCommonHeaders(Z),Z}).then(function(Z){return X.fetch(N(he,X.domain,X.domainDelimiter)+B,Z)}).then(function(Z){return w(Z)})}},{key:"downloadRequest",value:function(B,$,K,he){var X=this;return this.auth.checkAndRefreshAccessToken().then(function(){var Z={method:"POST",headers:{"Dropbox-API-Arg":H($)}};return X.setAuthHeaders(K,Z),X.setCommonHeaders(Z),Z}).then(function(Z){return X.fetch(N(he,X.domain,X.domainDelimiter)+B,Z)}).then(function(Z){return function(it){return it.ok?new Promise(function(oe){W()?it.blob().then(function(ce){return oe(ce)}):it.buffer().then(function(ce){return oe(ce)})}).then(function(oe){var ce=JSON.parse(it.headers.get("dropbox-api-result"));return W()?ce.fileBlob=oe:ce.fileBinary=oe,new h(it.status,it.headers,ce)}):b(it)}(Z)})}},{key:"uploadRequest",value:function(B,$,K,he){var X=this;return this.auth.checkAndRefreshAccessToken().then(function(){var Z=$.contents;delete $.contents;var it={body:Z,method:"POST",headers:{"Content-Type":"application/octet-stream","Dropbox-API-Arg":H($)}};return X.setAuthHeaders(K,it),X.setCommonHeaders(it),it}).then(function(Z){return X.fetch(N(he,X.domain,X.domainDelimiter)+B,Z)}).then(function(Z){return w(Z)})}},{key:"setAuthHeaders",value:function(B,$){if(B.split(",").length>1){var K=B.replace(" ","").split(",");K.includes(x)&&this.auth.getAccessToken()?B=x:K.includes(A)&&this.auth.getAccessToken()?B=A:K.includes(E)&&(B=E)}switch(B){case E:if(this.auth.clientId&&this.auth.clientSecret){var he=k("".concat(this.auth.clientId,":").concat(this.auth.clientSecret));$.headers.Authorization="Basic ".concat(he)}break;case A:case x:this.auth.getAccessToken()&&($.headers.Authorization="Bearer ".concat(this.auth.getAccessToken()));break;case"noauth":case"cookie":break;default:throw Error("Unhandled auth type: ".concat(B))}}},{key:"setCommonHeaders",value:function(B){var $=this;this.selectUser&&(B.headers["Dropbox-API-Select-User"]=this.selectUser),this.selectAdmin&&(B.headers["Dropbox-API-Select-Admin"]=this.selectAdmin),this.pathRoot&&(B.headers["Dropbox-API-Path-Root"]=this.pathRoot),this.customHeaders&&Object.keys(this.customHeaders).forEach(function(K){B.headers[K]=$.customHeaders[K]})}}]),S}(),t.DropboxAuth=P,t.DropboxResponse=h,t.DropboxResponseError=f,Object.defineProperty(t,"__esModule",{value:!0})})});var d3=F((wKe,gj)=>{m();var O_=At().Buffer,d2e=il(),h2e=ah();function P_(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=O_.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=O_.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,C.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}h2e.inherits(P_,d2e);P_.prototype.write=function(e){this.buffer=O_.concat([this.buffer,O_.from(e)]),this.emit("data",e)};P_.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};gj.exports=P_});var vj=F((xKe,yj)=>{"use strict";m();var $0=xn().Buffer,h3=xn().SlowBuffer;yj.exports=N_;function N_(t,e){if(!$0.isBuffer(t)||!$0.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,i=0;i{"use strict";m();function p3(t){var e=(t/8|0)+(t%8===0?0:1);return e}var g2e={ES256:p3(256),ES384:p3(384),ES512:p3(521)};function y2e(t){var e=g2e[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}bj.exports=y2e});var Tj=F((SKe,Aj)=>{"use strict";m();var B_=At().Buffer,xj=_j(),F_=128,Ej=0,v2e=32,b2e=16,_2e=2,Sj=b2e|v2e|Ej<<6,L_=_2e|Ej<<6;function w2e(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Cj(t){if(B_.isBuffer(t))return t;if(typeof t=="string")return B_.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function x2e(t,e){t=Cj(t);var r=xj(e),i=r+1,n=t.length,o=0;if(t[o++]!==Sj)throw new Error('Could not find expected "seq"');var c=t[o++];if(c===(F_|1)&&(c=t[o++]),n-o=F_;return n&&--i,i}function E2e(t,e){t=Cj(t);var r=xj(e),i=t.length;if(i!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+i+'"');var n=wj(t,0,r),o=wj(t,r,t.length),c=r-n,u=r-o,d=1+1+c+1+1+u,y=d{m();var S2e=vj(),Rh=At().Buffer,js=Dl(),Rj=Tj(),Mj=ah(),C2e=`"%s" is not a valid algorithm. - Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,G0="secret must be a string or buffer",Mh="key must be a string or a buffer",A2e="key must be a string, a buffer or an object",m3=typeof js.createPublicKey=="function";m3&&(Mh+=" or a KeyObject",G0+="or a KeyObject");function Dj(t){if(!Rh.isBuffer(t)&&typeof t!="string"&&(!m3||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw cs(Mh)}function kj(t){if(!Rh.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw cs(A2e)}function T2e(t){if(!Rh.isBuffer(t)){if(typeof t=="string")return t;if(!m3||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw cs(G0)}}function g3(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ij(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{m();var B2e=xn().Buffer;Fj.exports=function(e){return typeof e=="string"?e:typeof e=="number"||B2e.isBuffer(e)?e.toString():JSON.stringify(e)}});var Hj=F((TKe,zj)=>{m();var F2e=At().Buffer,Lj=d3(),L2e=y3(),q2e=il(),qj=v3(),b3=ah();function Uj(t,e){return F2e.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function U2e(t,e,r){r=r||"utf8";var i=Uj(qj(t),"binary"),n=Uj(qj(e),r);return b3.format("%s.%s",i,n)}function jj(t){var e=t.header,r=t.payload,i=t.secret||t.privateKey,n=t.encoding,o=L2e(e.alg),c=U2e(e,r,n),u=o.sign(c,i);return b3.format("%s.%s",c,u)}function q_(t){var e=t.secret||t.privateKey||t.key,r=new Lj(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Lj(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}b3.inherits(q_,q2e);q_.prototype.sign=function(){try{var e=jj({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};q_.sign=jj;zj.exports=q_});var Zj=F((MKe,Xj)=>{m();var Gj=At().Buffer,$j=d3(),j2e=y3(),z2e=il(),Kj=v3(),H2e=ah(),$2e=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function G2e(t){return Object.prototype.toString.call(t)==="[object Object]"}function K2e(t){if(G2e(t))return t;try{return JSON.parse(t)}catch{return}}function Vj(t){var e=t.split(".",1)[0];return K2e(Gj.from(e,"base64").toString("binary"))}function V2e(t){return t.split(".",2).join(".")}function Wj(t){return t.split(".")[2]}function W2e(t,e){e=e||"utf8";var r=t.split(".")[1];return Gj.from(r,"base64").toString(e)}function Yj(t){return $2e.test(t)&&!!Vj(t)}function Qj(t,e,r){if(!e){var i=new Error("Missing algorithm parameter for jws.verify");throw i.code="MISSING_ALGORITHM",i}t=Kj(t);var n=Wj(t),o=V2e(t),c=j2e(e);return c.verify(o,n,r)}function Jj(t,e){if(e=e||{},t=Kj(t),!Yj(t))return null;var r=Vj(t);if(!r)return null;var i=W2e(t);return(r.typ==="JWT"||e.json)&&(i=JSON.parse(i,e.encoding)),{header:r,payload:i,signature:Wj(t)}}function Dh(t){t=t||{};var e=t.secret||t.publicKey||t.key,r=new $j(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new $j(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}H2e.inherits(Dh,z2e);Dh.prototype.verify=function(){try{var e=Qj(this.signature.buffer,this.algorithm,this.key.buffer),r=Jj(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(i){this.readable=!1,this.emit("error",i),this.emit("close")}};Dh.decode=Jj;Dh.isValid=Yj;Dh.verify=Qj;Xj.exports=Dh});var j_=F(ru=>{m();var ez=Hj(),U_=Zj(),Y2e=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];ru.ALGORITHMS=Y2e;ru.sign=ez.sign;ru.verify=U_.verify;ru.decode=U_.decode;ru.isValid=U_.isValid;ru.createSign=function(e){return new ez(e)};ru.createVerify=function(e){return new U_(e)}});var _3=F((DKe,tz)=>{m();var Q2e=j_();tz.exports=function(t,e){e=e||{};var r=Q2e.decode(t,e);if(!r)return null;var i=r.payload;if(typeof i=="string")try{var n=JSON.parse(i);n!==null&&typeof n=="object"&&(i=n)}catch{}return e.complete===!0?{header:r.header,payload:i,signature:r.signature}:i}});var V0=F((kKe,rz)=>{m();var z_=function(t,e){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,e&&(this.inner=e)};z_.prototype=Object.create(Error.prototype);z_.prototype.constructor=z_;rz.exports=z_});var w3=F((IKe,iz)=>{m();var nz=V0(),H_=function(t,e){nz.call(this,t),this.name="NotBeforeError",this.date=e};H_.prototype=Object.create(nz.prototype);H_.prototype.constructor=H_;iz.exports=H_});var x3=F((OKe,sz)=>{m();var oz=V0(),$_=function(t,e){oz.call(this,t),this.name="TokenExpiredError",this.expiredAt=e};$_.prototype=Object.create(oz.prototype);$_.prototype.constructor=$_;sz.exports=$_});var cz=F((PKe,az)=>{m();var kh=1e3,Ih=kh*60,Oh=Ih*60,hf=Oh*24,J2e=hf*7,X2e=hf*365.25;az.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Z2e(t);if(r==="number"&&isFinite(t))return e.long?tCe(t):eCe(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Z2e(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!!e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*X2e;case"weeks":case"week":case"w":return r*J2e;case"days":case"day":case"d":return r*hf;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Oh;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ih;case"seconds":case"second":case"secs":case"sec":case"s":return r*kh;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function eCe(t){var e=Math.abs(t);return e>=hf?Math.round(t/hf)+"d":e>=Oh?Math.round(t/Oh)+"h":e>=Ih?Math.round(t/Ih)+"m":e>=kh?Math.round(t/kh)+"s":t+"ms"}function tCe(t){var e=Math.abs(t);return e>=hf?G_(t,e,hf,"day"):e>=Oh?G_(t,e,Oh,"hour"):e>=Ih?G_(t,e,Ih,"minute"):e>=kh?G_(t,e,kh,"second"):t+" ms"}function G_(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var E3=F((NKe,uz)=>{m();var rCe=cz();uz.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var i=rCe(t);return typeof i>"u"?void 0:Math.floor(r+i/1e3)}else return typeof t=="number"?r+t:void 0}});var W0=F((BKe,lz)=>{m();var nCe="2.0.0",iCe=Number.MAX_SAFE_INTEGER||9007199254740991,oCe=16,sCe=256-6,aCe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];lz.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:oCe,MAX_SAFE_BUILD_LENGTH:sCe,MAX_SAFE_INTEGER:iCe,RELEASE_TYPES:aCe,SEMVER_SPEC_VERSION:nCe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Y0=F((FKe,fz)=>{m();var cCe=(typeof C=="object"&&C.env,()=>{});fz.exports=cCe});var Ph=F((Fa,dz)=>{m();var{MAX_SAFE_COMPONENT_LENGTH:S3,MAX_SAFE_BUILD_LENGTH:uCe,MAX_LENGTH:lCe}=W0(),fCe=Y0();Fa=dz.exports={};var dCe=Fa.re=[],hCe=Fa.safeRe=[],ut=Fa.src=[],lt=Fa.t={},pCe=0,C3="[a-zA-Z0-9-]",mCe=[["\\s",1],["\\d",lCe],[C3,uCe]],gCe=t=>{for(let[e,r]of mCe)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Pt=(t,e,r)=>{let i=gCe(e),n=pCe++;fCe(t,n,e),lt[t]=n,ut[n]=e,dCe[n]=new RegExp(e,r?"g":void 0),hCe[n]=new RegExp(i,r?"g":void 0)};Pt("NUMERICIDENTIFIER","0|[1-9]\\d*");Pt("NUMERICIDENTIFIERLOOSE","\\d+");Pt("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${C3}*`);Pt("MAINVERSION",`(${ut[lt.NUMERICIDENTIFIER]})\\.(${ut[lt.NUMERICIDENTIFIER]})\\.(${ut[lt.NUMERICIDENTIFIER]})`);Pt("MAINVERSIONLOOSE",`(${ut[lt.NUMERICIDENTIFIERLOOSE]})\\.(${ut[lt.NUMERICIDENTIFIERLOOSE]})\\.(${ut[lt.NUMERICIDENTIFIERLOOSE]})`);Pt("PRERELEASEIDENTIFIER",`(?:${ut[lt.NUMERICIDENTIFIER]}|${ut[lt.NONNUMERICIDENTIFIER]})`);Pt("PRERELEASEIDENTIFIERLOOSE",`(?:${ut[lt.NUMERICIDENTIFIERLOOSE]}|${ut[lt.NONNUMERICIDENTIFIER]})`);Pt("PRERELEASE",`(?:-(${ut[lt.PRERELEASEIDENTIFIER]}(?:\\.${ut[lt.PRERELEASEIDENTIFIER]})*))`);Pt("PRERELEASELOOSE",`(?:-?(${ut[lt.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ut[lt.PRERELEASEIDENTIFIERLOOSE]})*))`);Pt("BUILDIDENTIFIER",`${C3}+`);Pt("BUILD",`(?:\\+(${ut[lt.BUILDIDENTIFIER]}(?:\\.${ut[lt.BUILDIDENTIFIER]})*))`);Pt("FULLPLAIN",`v?${ut[lt.MAINVERSION]}${ut[lt.PRERELEASE]}?${ut[lt.BUILD]}?`);Pt("FULL",`^${ut[lt.FULLPLAIN]}$`);Pt("LOOSEPLAIN",`[v=\\s]*${ut[lt.MAINVERSIONLOOSE]}${ut[lt.PRERELEASELOOSE]}?${ut[lt.BUILD]}?`);Pt("LOOSE",`^${ut[lt.LOOSEPLAIN]}$`);Pt("GTLT","((?:<|>)?=?)");Pt("XRANGEIDENTIFIERLOOSE",`${ut[lt.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Pt("XRANGEIDENTIFIER",`${ut[lt.NUMERICIDENTIFIER]}|x|X|\\*`);Pt("XRANGEPLAIN",`[v=\\s]*(${ut[lt.XRANGEIDENTIFIER]})(?:\\.(${ut[lt.XRANGEIDENTIFIER]})(?:\\.(${ut[lt.XRANGEIDENTIFIER]})(?:${ut[lt.PRERELEASE]})?${ut[lt.BUILD]}?)?)?`);Pt("XRANGEPLAINLOOSE",`[v=\\s]*(${ut[lt.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ut[lt.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ut[lt.XRANGEIDENTIFIERLOOSE]})(?:${ut[lt.PRERELEASELOOSE]})?${ut[lt.BUILD]}?)?)?`);Pt("XRANGE",`^${ut[lt.GTLT]}\\s*${ut[lt.XRANGEPLAIN]}$`);Pt("XRANGELOOSE",`^${ut[lt.GTLT]}\\s*${ut[lt.XRANGEPLAINLOOSE]}$`);Pt("COERCE",`(^|[^\\d])(\\d{1,${S3}})(?:\\.(\\d{1,${S3}}))?(?:\\.(\\d{1,${S3}}))?(?:$|[^\\d])`);Pt("COERCERTL",ut[lt.COERCE],!0);Pt("LONETILDE","(?:~>?)");Pt("TILDETRIM",`(\\s*)${ut[lt.LONETILDE]}\\s+`,!0);Fa.tildeTrimReplace="$1~";Pt("TILDE",`^${ut[lt.LONETILDE]}${ut[lt.XRANGEPLAIN]}$`);Pt("TILDELOOSE",`^${ut[lt.LONETILDE]}${ut[lt.XRANGEPLAINLOOSE]}$`);Pt("LONECARET","(?:\\^)");Pt("CARETTRIM",`(\\s*)${ut[lt.LONECARET]}\\s+`,!0);Fa.caretTrimReplace="$1^";Pt("CARET",`^${ut[lt.LONECARET]}${ut[lt.XRANGEPLAIN]}$`);Pt("CARETLOOSE",`^${ut[lt.LONECARET]}${ut[lt.XRANGEPLAINLOOSE]}$`);Pt("COMPARATORLOOSE",`^${ut[lt.GTLT]}\\s*(${ut[lt.LOOSEPLAIN]})$|^$`);Pt("COMPARATOR",`^${ut[lt.GTLT]}\\s*(${ut[lt.FULLPLAIN]})$|^$`);Pt("COMPARATORTRIM",`(\\s*)${ut[lt.GTLT]}\\s*(${ut[lt.LOOSEPLAIN]}|${ut[lt.XRANGEPLAIN]})`,!0);Fa.comparatorTrimReplace="$1$2$3";Pt("HYPHENRANGE",`^\\s*(${ut[lt.XRANGEPLAIN]})\\s+-\\s+(${ut[lt.XRANGEPLAIN]})\\s*$`);Pt("HYPHENRANGELOOSE",`^\\s*(${ut[lt.XRANGEPLAINLOOSE]})\\s+-\\s+(${ut[lt.XRANGEPLAINLOOSE]})\\s*$`);Pt("STAR","(<|>)?=?\\s*\\*");Pt("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Pt("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var K_=F((LKe,hz)=>{m();var yCe=Object.freeze({loose:!0}),vCe=Object.freeze({}),bCe=t=>t?typeof t!="object"?yCe:t:vCe;hz.exports=bCe});var A3=F((qKe,gz)=>{m();var pz=/^[0-9]+$/,mz=(t,e)=>{let r=pz.test(t),i=pz.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:tmz(e,t);gz.exports={compareIdentifiers:mz,rcompareIdentifiers:_Ce}});var gi=F((UKe,_z)=>{m();var V_=Y0(),{MAX_LENGTH:yz,MAX_SAFE_INTEGER:W_}=W0(),{safeRe:vz,t:bz}=Ph(),wCe=K_(),{compareIdentifiers:Nh}=A3(),oo=class{constructor(e,r){if(r=wCe(r),e instanceof oo){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>yz)throw new TypeError(`version is longer than ${yz} characters`);V_("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=e.trim().match(r.loose?vz[bz.LOOSE]:vz[bz.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>W_||this.major<0)throw new TypeError("Invalid major version");if(this.minor>W_||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>W_||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let o=[r,n];i===!1&&(o=[r]),Nh(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};_z.exports=oo});var pf=F((jKe,xz)=>{m();var wz=gi(),xCe=(t,e,r=!1)=>{if(t instanceof wz)return t;try{return new wz(t,e)}catch(i){if(!r)return null;throw i}};xz.exports=xCe});var Sz=F((zKe,Ez)=>{m();var ECe=pf(),SCe=(t,e)=>{let r=ECe(t,e);return r?r.version:null};Ez.exports=SCe});var Az=F((HKe,Cz)=>{m();var CCe=pf(),ACe=(t,e)=>{let r=CCe(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};Cz.exports=ACe});var Rz=F(($Ke,Mz)=>{m();var Tz=gi(),TCe=(t,e,r,i,n)=>{typeof r=="string"&&(n=i,i=r,r=void 0);try{return new Tz(t instanceof Tz?t.version:t,r).inc(e,i,n).version}catch{return null}};Mz.exports=TCe});var Iz=F((GKe,kz)=>{m();var Dz=pf(),MCe=(t,e)=>{let r=Dz(t,null,!0),i=Dz(e,null,!0),n=r.compare(i);if(n===0)return null;let o=n>0,c=o?r:i,u=o?i:r,d=!!c.prerelease.length;if(!!u.prerelease.length&&!d)return!u.patch&&!u.minor?"major":c.patch?"patch":c.minor?"minor":"major";let E=d?"pre":"";return r.major!==i.major?E+"major":r.minor!==i.minor?E+"minor":r.patch!==i.patch?E+"patch":"prerelease"};kz.exports=MCe});var Pz=F((KKe,Oz)=>{m();var RCe=gi(),DCe=(t,e)=>new RCe(t,e).major;Oz.exports=DCe});var Bz=F((VKe,Nz)=>{m();var kCe=gi(),ICe=(t,e)=>new kCe(t,e).minor;Nz.exports=ICe});var Lz=F((WKe,Fz)=>{m();var OCe=gi(),PCe=(t,e)=>new OCe(t,e).patch;Fz.exports=PCe});var Uz=F((YKe,qz)=>{m();var NCe=pf(),BCe=(t,e)=>{let r=NCe(t,e);return r&&r.prerelease.length?r.prerelease:null};qz.exports=BCe});var Oo=F((QKe,zz)=>{m();var jz=gi(),FCe=(t,e,r)=>new jz(t,r).compare(new jz(e,r));zz.exports=FCe});var $z=F((JKe,Hz)=>{m();var LCe=Oo(),qCe=(t,e,r)=>LCe(e,t,r);Hz.exports=qCe});var Kz=F((XKe,Gz)=>{m();var UCe=Oo(),jCe=(t,e)=>UCe(t,e,!0);Gz.exports=jCe});var Y_=F((ZKe,Wz)=>{m();var Vz=gi(),zCe=(t,e,r)=>{let i=new Vz(t,r),n=new Vz(e,r);return i.compare(n)||i.compareBuild(n)};Wz.exports=zCe});var Qz=F((eVe,Yz)=>{m();var HCe=Y_(),$Ce=(t,e)=>t.sort((r,i)=>HCe(r,i,e));Yz.exports=$Ce});var Xz=F((tVe,Jz)=>{m();var GCe=Y_(),KCe=(t,e)=>t.sort((r,i)=>GCe(i,r,e));Jz.exports=KCe});var Q0=F((rVe,Zz)=>{m();var VCe=Oo(),WCe=(t,e,r)=>VCe(t,e,r)>0;Zz.exports=WCe});var Q_=F((nVe,eH)=>{m();var YCe=Oo(),QCe=(t,e,r)=>YCe(t,e,r)<0;eH.exports=QCe});var T3=F((iVe,tH)=>{m();var JCe=Oo(),XCe=(t,e,r)=>JCe(t,e,r)===0;tH.exports=XCe});var M3=F((oVe,rH)=>{m();var ZCe=Oo(),eAe=(t,e,r)=>ZCe(t,e,r)!==0;rH.exports=eAe});var J_=F((sVe,nH)=>{m();var tAe=Oo(),rAe=(t,e,r)=>tAe(t,e,r)>=0;nH.exports=rAe});var X_=F((aVe,iH)=>{m();var nAe=Oo(),iAe=(t,e,r)=>nAe(t,e,r)<=0;iH.exports=iAe});var R3=F((cVe,oH)=>{m();var oAe=T3(),sAe=M3(),aAe=Q0(),cAe=J_(),uAe=Q_(),lAe=X_(),fAe=(t,e,r,i)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return oAe(t,r,i);case"!=":return sAe(t,r,i);case">":return aAe(t,r,i);case">=":return cAe(t,r,i);case"<":return uAe(t,r,i);case"<=":return lAe(t,r,i);default:throw new TypeError(`Invalid operator: ${e}`)}};oH.exports=fAe});var aH=F((uVe,sH)=>{m();var dAe=gi(),hAe=pf(),{safeRe:Z_,t:e1}=Ph(),pAe=(t,e)=>{if(t instanceof dAe)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(Z_[e1.COERCE]);else{let i;for(;(i=Z_[e1.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||i.index+i[0].length!==r.index+r[0].length)&&(r=i),Z_[e1.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;Z_[e1.COERCERTL].lastIndex=-1}return r===null?null:hAe(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};sH.exports=pAe});var uH=F((lVe,cH)=>{"use strict";m();cH.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var fH=F((fVe,lH)=>{"use strict";m();lH.exports=mr;mr.Node=mf;mr.create=mr;function mr(t){var e=this;if(e instanceof mr||(e=new mr),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=e;else if(this.head)i=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)r=t(r,i.value,n),i=i.next;return r};mr.prototype.reduceReverse=function(t,e){var r,i=this.tail;if(arguments.length>1)r=e;else if(this.tail)i=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)r=t(r,i.value,n),i=i.prev;return r};mr.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};mr.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};mr.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new mr;if(ethis.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&ithis.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>t;i--,n=n.prev)r.push(n.value);return r};mr.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,n=this.head;n!==null&&i{"use strict";m();var vAe=fH(),gf=Symbol("max"),qa=Symbol("length"),Bh=Symbol("lengthCalculator"),X0=Symbol("allowStale"),yf=Symbol("maxAge"),La=Symbol("dispose"),dH=Symbol("noDisposeOnSet"),Kn=Symbol("lruList"),us=Symbol("cache"),pH=Symbol("updateAgeOnGet"),D3=()=>1,I3=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let r=this[gf]=e.max||1/0,i=e.length||D3;if(this[Bh]=typeof i!="function"?D3:i,this[X0]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[yf]=e.maxAge||0,this[La]=e.dispose,this[dH]=e.noDisposeOnSet||!1,this[pH]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[gf]=e||1/0,J0(this)}get max(){return this[gf]}set allowStale(e){this[X0]=!!e}get allowStale(){return this[X0]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[yf]=e,J0(this)}get maxAge(){return this[yf]}set lengthCalculator(e){typeof e!="function"&&(e=D3),e!==this[Bh]&&(this[Bh]=e,this[qa]=0,this[Kn].forEach(r=>{r.length=this[Bh](r.value,r.key),this[qa]+=r.length})),J0(this)}get lengthCalculator(){return this[Bh]}get length(){return this[qa]}get itemCount(){return this[Kn].length}rforEach(e,r){r=r||this;for(let i=this[Kn].tail;i!==null;){let n=i.prev;hH(this,e,i,r),i=n}}forEach(e,r){r=r||this;for(let i=this[Kn].head;i!==null;){let n=i.next;hH(this,e,i,r),i=n}}keys(){return this[Kn].toArray().map(e=>e.key)}values(){return this[Kn].toArray().map(e=>e.value)}reset(){this[La]&&this[Kn]&&this[Kn].length&&this[Kn].forEach(e=>this[La](e.key,e.value)),this[us]=new Map,this[Kn]=new vAe,this[qa]=0}dump(){return this[Kn].map(e=>t1(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[Kn]}set(e,r,i){if(i=i||this[yf],i&&typeof i!="number")throw new TypeError("maxAge must be a number");let n=i?Date.now():0,o=this[Bh](r,e);if(this[us].has(e)){if(o>this[gf])return Fh(this,this[us].get(e)),!1;let d=this[us].get(e).value;return this[La]&&(this[dH]||this[La](e,d.value)),d.now=n,d.maxAge=i,d.value=r,this[qa]+=o-d.length,d.length=o,this.get(e),J0(this),!0}let c=new O3(e,r,o,n,i);return c.length>this[gf]?(this[La]&&this[La](e,r),!1):(this[qa]+=c.length,this[Kn].unshift(c),this[us].set(e,this[Kn].head),J0(this),!0)}has(e){if(!this[us].has(e))return!1;let r=this[us].get(e).value;return!t1(this,r)}get(e){return k3(this,e,!0)}peek(e){return k3(this,e,!1)}pop(){let e=this[Kn].tail;return e?(Fh(this,e),e.value):null}del(e){Fh(this,this[us].get(e))}load(e){this.reset();let r=Date.now();for(let i=e.length-1;i>=0;i--){let n=e[i],o=n.e||0;if(o===0)this.set(n.k,n.v);else{let c=o-r;c>0&&this.set(n.k,n.v,c)}}}prune(){this[us].forEach((e,r)=>k3(this,r,!1))}},k3=(t,e,r)=>{let i=t[us].get(e);if(i){let n=i.value;if(t1(t,n)){if(Fh(t,i),!t[X0])return}else r&&(t[pH]&&(i.value.now=Date.now()),t[Kn].unshiftNode(i));return n.value}},t1=(t,e)=>{if(!e||!e.maxAge&&!t[yf])return!1;let r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[yf]&&r>t[yf]},J0=t=>{if(t[qa]>t[gf])for(let e=t[Kn].tail;t[qa]>t[gf]&&e!==null;){let r=e.prev;Fh(t,e),e=r}},Fh=(t,e)=>{if(e){let r=e.value;t[La]&&t[La](r.key,r.value),t[qa]-=r.length,t[us].delete(r.key),t[Kn].removeNode(e)}},O3=class{constructor(e,r,i,n,o){this.key=e,this.value=r,this.length=i,this.now=n,this.maxAge=o||0}},hH=(t,e,r,i)=>{let n=r.value;t1(t,n)&&(Fh(t,r),t[X0]||(n=void 0)),n&&e.call(i,n.value,n.key,t)};mH.exports=I3});var Po=F((hVe,_H)=>{m();var vf=class{constructor(e,r){if(r=_Ae(r),e instanceof vf)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new vf(e.raw,r);if(e instanceof P3)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!vH(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&TAe(n[0])){this.set=[n];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let i=((this.options.includePrerelease&&CAe)|(this.options.loose&&AAe))+":"+e,n=yH.get(i);if(n)return n;let o=this.options.loose,c=o?$i[Di.HYPHENRANGELOOSE]:$i[Di.HYPHENRANGE];e=e.replace(c,FAe(this.options.includePrerelease)),Vr("hyphen replace",e),e=e.replace($i[Di.COMPARATORTRIM],xAe),Vr("comparator trim",e),e=e.replace($i[Di.TILDETRIM],EAe),Vr("tilde trim",e),e=e.replace($i[Di.CARETTRIM],SAe),Vr("caret trim",e);let u=e.split(" ").map(x=>MAe(x,this.options)).join(" ").split(/\s+/).map(x=>BAe(x,this.options));o&&(u=u.filter(x=>(Vr("loose invalid filter",x,this.options),!!x.match($i[Di.COMPARATORLOOSE])))),Vr("range list",u);let d=new Map,y=u.map(x=>new P3(x,this.options));for(let x of y){if(vH(x))return[x];d.set(x.value,x)}d.size>1&&d.has("")&&d.delete("");let E=[...d.values()];return yH.set(i,E),E}intersects(e,r){if(!(e instanceof vf))throw new TypeError("a Range is required");return this.set.some(i=>bH(i,r)&&e.set.some(n=>bH(n,r)&&i.every(o=>n.every(c=>o.intersects(c,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new wAe(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0",TAe=t=>t.value==="",bH=(t,e)=>{let r=!0,i=t.slice(),n=i.pop();for(;r&&i.length;)r=i.every(o=>n.intersects(o,e)),n=i.pop();return r},MAe=(t,e)=>(Vr("comp",t,e),t=kAe(t,e),Vr("caret",t),t=RAe(t,e),Vr("tildes",t),t=OAe(t,e),Vr("xrange",t),t=NAe(t,e),Vr("stars",t),t),ki=t=>!t||t.toLowerCase()==="x"||t==="*",RAe=(t,e)=>t.trim().split(/\s+/).map(r=>DAe(r,e)).join(" "),DAe=(t,e)=>{let r=e.loose?$i[Di.TILDELOOSE]:$i[Di.TILDE];return t.replace(r,(i,n,o,c,u)=>{Vr("tilde",t,i,n,o,c,u);let d;return ki(n)?d="":ki(o)?d=`>=${n}.0.0 <${+n+1}.0.0-0`:ki(c)?d=`>=${n}.${o}.0 <${n}.${+o+1}.0-0`:u?(Vr("replaceTilde pr",u),d=`>=${n}.${o}.${c}-${u} <${n}.${+o+1}.0-0`):d=`>=${n}.${o}.${c} <${n}.${+o+1}.0-0`,Vr("tilde return",d),d})},kAe=(t,e)=>t.trim().split(/\s+/).map(r=>IAe(r,e)).join(" "),IAe=(t,e)=>{Vr("caret",t,e);let r=e.loose?$i[Di.CARETLOOSE]:$i[Di.CARET],i=e.includePrerelease?"-0":"";return t.replace(r,(n,o,c,u,d)=>{Vr("caret",t,n,o,c,u,d);let y;return ki(o)?y="":ki(c)?y=`>=${o}.0.0${i} <${+o+1}.0.0-0`:ki(u)?o==="0"?y=`>=${o}.${c}.0${i} <${o}.${+c+1}.0-0`:y=`>=${o}.${c}.0${i} <${+o+1}.0.0-0`:d?(Vr("replaceCaret pr",d),o==="0"?c==="0"?y=`>=${o}.${c}.${u}-${d} <${o}.${c}.${+u+1}-0`:y=`>=${o}.${c}.${u}-${d} <${o}.${+c+1}.0-0`:y=`>=${o}.${c}.${u}-${d} <${+o+1}.0.0-0`):(Vr("no pr"),o==="0"?c==="0"?y=`>=${o}.${c}.${u}${i} <${o}.${c}.${+u+1}-0`:y=`>=${o}.${c}.${u}${i} <${o}.${+c+1}.0-0`:y=`>=${o}.${c}.${u} <${+o+1}.0.0-0`),Vr("caret return",y),y})},OAe=(t,e)=>(Vr("replaceXRanges",t,e),t.split(/\s+/).map(r=>PAe(r,e)).join(" ")),PAe=(t,e)=>{t=t.trim();let r=e.loose?$i[Di.XRANGELOOSE]:$i[Di.XRANGE];return t.replace(r,(i,n,o,c,u,d)=>{Vr("xRange",t,i,n,o,c,u,d);let y=ki(o),E=y||ki(c),x=E||ki(u),A=x;return n==="="&&A&&(n=""),d=e.includePrerelease?"-0":"",y?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&A?(E&&(c=0),u=0,n===">"?(n=">=",E?(o=+o+1,c=0,u=0):(c=+c+1,u=0)):n==="<="&&(n="<",E?o=+o+1:c=+c+1),n==="<"&&(d="-0"),i=`${n+o}.${c}.${u}${d}`):E?i=`>=${o}.0.0${d} <${+o+1}.0.0-0`:x&&(i=`>=${o}.${c}.0${d} <${o}.${+c+1}.0-0`),Vr("xRange return",i),i})},NAe=(t,e)=>(Vr("replaceStars",t,e),t.trim().replace($i[Di.STAR],"")),BAe=(t,e)=>(Vr("replaceGTE0",t,e),t.trim().replace($i[e.includePrerelease?Di.GTE0PRE:Di.GTE0],"")),FAe=t=>(e,r,i,n,o,c,u,d,y,E,x,A,R)=>(ki(i)?r="":ki(n)?r=`>=${i}.0.0${t?"-0":""}`:ki(o)?r=`>=${i}.${n}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,ki(y)?d="":ki(E)?d=`<${+y+1}.0.0-0`:ki(x)?d=`<${y}.${+E+1}.0-0`:A?d=`<=${y}.${E}.${x}-${A}`:t?d=`<${y}.${E}.${+x+1}-0`:d=`<=${d}`,`${r} ${d}`.trim()),LAe=(t,e,r)=>{for(let i=0;i0){let n=t[i].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var Z0=F((pVe,AH)=>{m();var eg=Symbol("SemVer ANY"),Lh=class{static get ANY(){return eg}constructor(e,r){if(r=wH(r),e instanceof Lh){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),B3("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===eg?this.value="":this.value=this.operator+this.semver.version,B3("comp",this)}parse(e){let r=this.options.loose?xH[EH.COMPARATORLOOSE]:xH[EH.COMPARATOR],i=e.match(r);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new SH(i[2],this.options.loose):this.semver=eg}toString(){return this.value}test(e){if(B3("Comparator.test",e,this.options.loose),this.semver===eg||e===eg)return!0;if(typeof e=="string")try{e=new SH(e,this.options)}catch{return!1}return N3(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof Lh))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new CH(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new CH(this.value,r).test(e.semver):(r=wH(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||N3(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||N3(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};AH.exports=Lh;var wH=K_(),{safeRe:xH,t:EH}=Ph(),N3=R3(),B3=Y0(),SH=gi(),CH=Po()});var tg=F((mVe,TH)=>{m();var qAe=Po(),UAe=(t,e,r)=>{try{e=new qAe(e,r)}catch{return!1}return e.test(t)};TH.exports=UAe});var RH=F((gVe,MH)=>{m();var jAe=Po(),zAe=(t,e)=>new jAe(t,e).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));MH.exports=zAe});var kH=F((yVe,DH)=>{m();var HAe=gi(),$Ae=Po(),GAe=(t,e,r)=>{let i=null,n=null,o=null;try{o=new $Ae(e,r)}catch{return null}return t.forEach(c=>{o.test(c)&&(!i||n.compare(c)===-1)&&(i=c,n=new HAe(i,r))}),i};DH.exports=GAe});var OH=F((vVe,IH)=>{m();var KAe=gi(),VAe=Po(),WAe=(t,e,r)=>{let i=null,n=null,o=null;try{o=new VAe(e,r)}catch{return null}return t.forEach(c=>{o.test(c)&&(!i||n.compare(c)===1)&&(i=c,n=new KAe(i,r))}),i};IH.exports=WAe});var BH=F((bVe,NH)=>{m();var F3=gi(),YAe=Po(),PH=Q0(),QAe=(t,e)=>{t=new YAe(t,e);let r=new F3("0.0.0");if(t.test(r)||(r=new F3("0.0.0-0"),t.test(r)))return r;r=null;for(let i=0;i{let u=new F3(c.semver.version);switch(c.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!o||PH(u,o))&&(o=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),o&&(!r||PH(r,o))&&(r=o)}return r&&t.test(r)?r:null};NH.exports=QAe});var LH=F((_Ve,FH)=>{m();var JAe=Po(),XAe=(t,e)=>{try{return new JAe(t,e).range||"*"}catch{return null}};FH.exports=XAe});var r1=F((wVe,zH)=>{m();var ZAe=gi(),jH=Z0(),{ANY:e3e}=jH,t3e=Po(),r3e=tg(),qH=Q0(),UH=Q_(),n3e=X_(),i3e=J_(),o3e=(t,e,r,i)=>{t=new ZAe(t,i),e=new t3e(e,i);let n,o,c,u,d;switch(r){case">":n=qH,o=n3e,c=UH,u=">",d=">=";break;case"<":n=UH,o=i3e,c=qH,u="<",d="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(r3e(t,e,i))return!1;for(let y=0;y{R.semver===e3e&&(R=new jH(">=0.0.0")),x=x||R,A=A||R,n(R.semver,x.semver,i)?x=R:c(R.semver,A.semver,i)&&(A=R)}),x.operator===u||x.operator===d||(!A.operator||A.operator===u)&&o(t,A.semver))return!1;if(A.operator===d&&c(t,A.semver))return!1}return!0};zH.exports=o3e});var $H=F((xVe,HH)=>{m();var s3e=r1(),a3e=(t,e,r)=>s3e(t,e,">",r);HH.exports=a3e});var KH=F((EVe,GH)=>{m();var c3e=r1(),u3e=(t,e,r)=>c3e(t,e,"<",r);GH.exports=u3e});var YH=F((SVe,WH)=>{m();var VH=Po(),l3e=(t,e,r)=>(t=new VH(t,r),e=new VH(e,r),t.intersects(e,r));WH.exports=l3e});var JH=F((CVe,QH)=>{m();var f3e=tg(),d3e=Oo();QH.exports=(t,e,r)=>{let i=[],n=null,o=null,c=t.sort((E,x)=>d3e(E,x,r));for(let E of c)f3e(E,e,r)?(o=E,n||(n=E)):(o&&i.push([n,o]),o=null,n=null);n&&i.push([n,null]);let u=[];for(let[E,x]of i)E===x?u.push(E):!x&&E===c[0]?u.push("*"):x?E===c[0]?u.push(`<=${x}`):u.push(`${E} - ${x}`):u.push(`>=${E}`);let d=u.join(" || "),y=typeof e.raw=="string"?e.raw:String(e);return d.length{m();var XH=Po(),q3=Z0(),{ANY:L3}=q3,rg=tg(),U3=Oo(),h3e=(t,e,r={})=>{if(t===e)return!0;t=new XH(t,r),e=new XH(e,r);let i=!1;e:for(let n of t.set){for(let o of e.set){let c=m3e(n,o,r);if(i=i||c!==null,c)continue e}if(i)return!1}return!0},p3e=[new q3(">=0.0.0-0")],ZH=[new q3(">=0.0.0")],m3e=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===L3){if(e.length===1&&e[0].semver===L3)return!0;r.includePrerelease?t=p3e:t=ZH}if(e.length===1&&e[0].semver===L3){if(r.includePrerelease)return!0;e=ZH}let i=new Set,n,o;for(let R of t)R.operator===">"||R.operator===">="?n=e$(n,R,r):R.operator==="<"||R.operator==="<="?o=t$(o,R,r):i.add(R.semver);if(i.size>1)return null;let c;if(n&&o){if(c=U3(n.semver,o.semver,r),c>0)return null;if(c===0&&(n.operator!==">="||o.operator!=="<="))return null}for(let R of i){if(n&&!rg(R,String(n),r)||o&&!rg(R,String(o),r))return null;for(let M of e)if(!rg(R,String(M),r))return!1;return!0}let u,d,y,E,x=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,A=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1;x&&x.prerelease.length===1&&o.operator==="<"&&x.prerelease[0]===0&&(x=!1);for(let R of e){if(E=E||R.operator===">"||R.operator===">=",y=y||R.operator==="<"||R.operator==="<=",n){if(A&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===A.major&&R.semver.minor===A.minor&&R.semver.patch===A.patch&&(A=!1),R.operator===">"||R.operator===">="){if(u=e$(n,R,r),u===R&&u!==n)return!1}else if(n.operator===">="&&!rg(n.semver,String(R),r))return!1}if(o){if(x&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===x.major&&R.semver.minor===x.minor&&R.semver.patch===x.patch&&(x=!1),R.operator==="<"||R.operator==="<="){if(d=t$(o,R,r),d===R&&d!==o)return!1}else if(o.operator==="<="&&!rg(o.semver,String(R),r))return!1}if(!R.operator&&(o||n)&&c!==0)return!1}return!(n&&y&&!o&&c!==0||o&&E&&!n&&c!==0||A||x)},e$=(t,e,r)=>{if(!t)return e;let i=U3(t.semver,e.semver,r);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},t$=(t,e,r)=>{if(!t)return e;let i=U3(t.semver,e.semver,r);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};r$.exports=h3e});var n1=F((TVe,s$)=>{m();var j3=Ph(),i$=W0(),g3e=gi(),o$=A3(),y3e=pf(),v3e=Sz(),b3e=Az(),_3e=Rz(),w3e=Iz(),x3e=Pz(),E3e=Bz(),S3e=Lz(),C3e=Uz(),A3e=Oo(),T3e=$z(),M3e=Kz(),R3e=Y_(),D3e=Qz(),k3e=Xz(),I3e=Q0(),O3e=Q_(),P3e=T3(),N3e=M3(),B3e=J_(),F3e=X_(),L3e=R3(),q3e=aH(),U3e=Z0(),j3e=Po(),z3e=tg(),H3e=RH(),$3e=kH(),G3e=OH(),K3e=BH(),V3e=LH(),W3e=r1(),Y3e=$H(),Q3e=KH(),J3e=YH(),X3e=JH(),Z3e=n$();s$.exports={parse:y3e,valid:v3e,clean:b3e,inc:_3e,diff:w3e,major:x3e,minor:E3e,patch:S3e,prerelease:C3e,compare:A3e,rcompare:T3e,compareLoose:M3e,compareBuild:R3e,sort:D3e,rsort:k3e,gt:I3e,lt:O3e,eq:P3e,neq:N3e,gte:B3e,lte:F3e,cmp:L3e,coerce:q3e,Comparator:U3e,Range:j3e,satisfies:z3e,toComparators:H3e,maxSatisfying:$3e,minSatisfying:G3e,minVersion:K3e,validRange:V3e,outside:W3e,gtr:Y3e,ltr:Q3e,intersects:J3e,simplifyRange:X3e,subset:Z3e,SemVer:g3e,re:j3.re,src:j3.src,tokens:j3.t,SEMVER_SPEC_VERSION:i$.SEMVER_SPEC_VERSION,RELEASE_TYPES:i$.RELEASE_TYPES,compareIdentifiers:o$.compareIdentifiers,rcompareIdentifiers:o$.rcompareIdentifiers}});var c$=F((MVe,a$)=>{m();var eTe=n1();a$.exports=eTe.satisfies(C.version,">=15.7.0")});var l$=F((RVe,u$)=>{m();var tTe=n1();u$.exports=tTe.satisfies(C.version,">=16.9.0")});var z3=F((DVe,f$)=>{m();var rTe=c$(),nTe=l$(),iTe={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},oTe={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};f$.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let i=iTe[r];if(!i)throw new Error(`Unknown key type "${r}".`);if(!i.includes(t))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${i.join(", ")}.`);if(rTe)switch(r){case"ec":let n=e.asymmetricKeyDetails.namedCurve,o=oTe[t];if(n!==o)throw new Error(`"alg" parameter "${t}" requires curve "${o}".`);break;case"rsa-pss":if(nTe){let c=parseInt(t.slice(-3),10),{hashAlgorithm:u,mgf1HashAlgorithm:d,saltLength:y}=e.asymmetricKeyDetails;if(u!==`sha${c}`||d!==u)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${t}.`);if(y!==void 0&&y>c>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${t}.`)}break}}});var H3=F((kVe,d$)=>{m();var sTe=n1();d$.exports=sTe.satisfies(C.version,"^6.12.0 || >=8.0.0")});var m$=F((IVe,p$)=>{m();var zr=V0(),aTe=w3(),h$=x3(),cTe=_3(),uTe=E3(),lTe=z3(),fTe=H3(),dTe=j_(),{KeyObject:hTe,createSecretKey:pTe,createPublicKey:mTe}=Dl(),$3=["RS256","RS384","RS512"],gTe=["ES256","ES384","ES512"],G3=["RS256","RS384","RS512"],yTe=["HS256","HS384","HS512"];fTe&&($3.splice($3.length,0,"PS256","PS384","PS512"),G3.splice(G3.length,0,"PS256","PS384","PS512"));p$.exports=function(t,e,r,i){typeof r=="function"&&!i&&(i=r,r={}),r||(r={}),r=Object.assign({},r);let n;if(i?n=i:n=function(E,x){if(E)throw E;return x},r.clockTimestamp&&typeof r.clockTimestamp!="number")return n(new zr("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return n(new zr("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return n(new zr("allowInvalidAsymmetricKeyTypes must be a boolean"));let o=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return n(new zr("jwt must be provided"));if(typeof t!="string")return n(new zr("jwt must be a string"));let c=t.split(".");if(c.length!==3)return n(new zr("jwt malformed"));let u;try{u=cTe(t,{complete:!0})}catch(E){return n(E)}if(!u)return n(new zr("invalid token"));let d=u.header,y;if(typeof e=="function"){if(!i)return n(new zr("verify must be called asynchronous if secret or public key is provided as a callback"));y=e}else y=function(E,x){return x(null,e)};return y(d,function(E,x){if(E)return n(new zr("error in secret or public key callback: "+E.message));let A=c[2].trim()!=="";if(!A&&x)return n(new zr("jwt signature is required"));if(A&&!x)return n(new zr("secret or public key must be provided"));if(!A&&!r.algorithms)return n(new zr('please specify "none" in "algorithms" to verify unsigned tokens'));if(x!=null&&!(x instanceof hTe))try{x=mTe(x)}catch{try{x=pTe(typeof x=="string"?T.from(x):x)}catch{return n(new zr("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(x.type==="secret"?r.algorithms=yTe:["rsa","rsa-pss"].includes(x.asymmetricKeyType)?r.algorithms=G3:x.asymmetricKeyType==="ec"?r.algorithms=gTe:r.algorithms=$3),r.algorithms.indexOf(u.header.alg)===-1)return n(new zr("invalid algorithm"));if(d.alg.startsWith("HS")&&x.type!=="secret")return n(new zr(`secretOrPublicKey must be a symmetric key when using ${d.alg}`));if(/^(?:RS|PS|ES)/.test(d.alg)&&x.type!=="public")return n(new zr(`secretOrPublicKey must be an asymmetric key when using ${d.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{lTe(d.alg,x)}catch(I){return n(I)}let R;try{R=dTe.verify(t,u.header.alg,x)}catch(I){return n(I)}if(!R)return n(new zr("invalid signature"));let M=u.payload;if(typeof M.nbf<"u"&&!r.ignoreNotBefore){if(typeof M.nbf!="number")return n(new zr("invalid nbf value"));if(M.nbf>o+(r.clockTolerance||0))return n(new aTe("jwt not active",new Date(M.nbf*1e3)))}if(typeof M.exp<"u"&&!r.ignoreExpiration){if(typeof M.exp!="number")return n(new zr("invalid exp value"));if(o>=M.exp+(r.clockTolerance||0))return n(new h$("jwt expired",new Date(M.exp*1e3)))}if(r.audience){let I=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(M.aud)?M.aud:[M.aud]).some(function(N){return I.some(function(L){return L instanceof RegExp?L.test(N):L===N})}))return n(new zr("jwt audience invalid. expected: "+I.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&M.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(M.iss)===-1))return n(new zr("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&M.sub!==r.subject)return n(new zr("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&M.jti!==r.jwtid)return n(new zr("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&M.nonce!==r.nonce)return n(new zr("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof M.iat!="number")return n(new zr("iat required when maxAge is specified"));let I=uTe(r.maxAge,M.iat);if(typeof I>"u")return n(new zr('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(o>=I+(r.clockTolerance||0))return n(new h$("maxAge exceeded",new Date(I*1e3)))}if(r.complete===!0){let I=u.signature;return n(null,{header:d,payload:M,signature:I})}return n(null,M)})}});var w$=F((OVe,_$)=>{m();var g$=1/0,v$=9007199254740991,vTe=17976931348623157e292,y$=0/0,bTe="[object Arguments]",_Te="[object Function]",wTe="[object GeneratorFunction]",xTe="[object String]",ETe="[object Symbol]",STe=/^\s+|\s+$/g,CTe=/^[-+]0x[0-9a-f]+$/i,ATe=/^0b[01]+$/i,TTe=/^0o[0-7]+$/i,MTe=/^(?:0|[1-9]\d*)$/,RTe=parseInt;function DTe(t,e){for(var r=-1,i=t?t.length:0,n=Array(i);++r-1&&t%1==0&&t-1:!!n&&ITe(t,e,r)>-1}function GTe(t){return KTe(t)&&V3.call(t,"callee")&&(!FTe.call(t,"callee")||o1.call(t)==bTe)}var b$=Array.isArray;function W3(t){return t!=null&&WTe(t.length)&&!VTe(t)}function KTe(t){return Y3(t)&&W3(t)}function VTe(t){var e=K3(t)?o1.call(t):"";return e==_Te||e==wTe}function WTe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=v$}function K3(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Y3(t){return!!t&&typeof t=="object"}function YTe(t){return typeof t=="string"||!b$(t)&&Y3(t)&&o1.call(t)==xTe}function QTe(t){return typeof t=="symbol"||Y3(t)&&o1.call(t)==ETe}function JTe(t){if(!t)return t===0?t:0;if(t=ZTe(t),t===g$||t===-g$){var e=t<0?-1:1;return e*vTe}return t===t?t:0}function XTe(t){var e=JTe(t),r=e%1;return e===e?r?e-r:e:0}function ZTe(t){if(typeof t=="number")return t;if(QTe(t))return y$;if(K3(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=K3(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(STe,"");var r=ATe.test(t);return r||TTe.test(t)?RTe(t.slice(2),r?2:8):CTe.test(t)?y$:+t}function eMe(t){return W3(t)?UTe(t):jTe(t)}function tMe(t){return t?NTe(t,eMe(t)):[]}_$.exports=$Te});var E$=F((PVe,x$)=>{m();var rMe="[object Boolean]",nMe=Object.prototype,iMe=nMe.toString;function oMe(t){return t===!0||t===!1||sMe(t)&&iMe.call(t)==rMe}function sMe(t){return!!t&&typeof t=="object"}x$.exports=oMe});var M$=F((NVe,T$)=>{m();var S$=1/0,aMe=17976931348623157e292,C$=0/0,cMe="[object Symbol]",uMe=/^\s+|\s+$/g,lMe=/^[-+]0x[0-9a-f]+$/i,fMe=/^0b[01]+$/i,dMe=/^0o[0-7]+$/i,hMe=parseInt,pMe=Object.prototype,mMe=pMe.toString;function gMe(t){return typeof t=="number"&&t==_Me(t)}function A$(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function yMe(t){return!!t&&typeof t=="object"}function vMe(t){return typeof t=="symbol"||yMe(t)&&mMe.call(t)==cMe}function bMe(t){if(!t)return t===0?t:0;if(t=wMe(t),t===S$||t===-S$){var e=t<0?-1:1;return e*aMe}return t===t?t:0}function _Me(t){var e=bMe(t),r=e%1;return e===e?r?e-r:e:0}function wMe(t){if(typeof t=="number")return t;if(vMe(t))return C$;if(A$(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=A$(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(uMe,"");var r=fMe.test(t);return r||dMe.test(t)?hMe(t.slice(2),r?2:8):lMe.test(t)?C$:+t}T$.exports=gMe});var D$=F((BVe,R$)=>{m();var xMe="[object Number]",EMe=Object.prototype,SMe=EMe.toString;function CMe(t){return!!t&&typeof t=="object"}function AMe(t){return typeof t=="number"||CMe(t)&&SMe.call(t)==xMe}R$.exports=AMe});var P$=F((FVe,O$)=>{m();var TMe="[object Object]";function MMe(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function RMe(t,e){return function(r){return t(e(r))}}var DMe=Function.prototype,k$=Object.prototype,I$=DMe.toString,kMe=k$.hasOwnProperty,IMe=I$.call(Object),OMe=k$.toString,PMe=RMe(Object.getPrototypeOf,Object);function NMe(t){return!!t&&typeof t=="object"}function BMe(t){if(!NMe(t)||OMe.call(t)!=TMe||MMe(t))return!1;var e=PMe(t);if(e===null)return!0;var r=kMe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&I$.call(r)==IMe}O$.exports=BMe});var B$=F((LVe,N$)=>{m();var FMe="[object String]",LMe=Object.prototype,qMe=LMe.toString,UMe=Array.isArray;function jMe(t){return!!t&&typeof t=="object"}function zMe(t){return typeof t=="string"||!UMe(t)&&jMe(t)&&qMe.call(t)==FMe}N$.exports=zMe});var j$=F((qVe,U$)=>{m();var HMe="Expected a function",F$=1/0,$Me=17976931348623157e292,L$=0/0,GMe="[object Symbol]",KMe=/^\s+|\s+$/g,VMe=/^[-+]0x[0-9a-f]+$/i,WMe=/^0b[01]+$/i,YMe=/^0o[0-7]+$/i,QMe=parseInt,JMe=Object.prototype,XMe=JMe.toString;function ZMe(t,e){var r;if(typeof e!="function")throw new TypeError(HMe);return t=iRe(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}function eRe(t){return ZMe(2,t)}function q$(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function tRe(t){return!!t&&typeof t=="object"}function rRe(t){return typeof t=="symbol"||tRe(t)&&XMe.call(t)==GMe}function nRe(t){if(!t)return t===0?t:0;if(t=oRe(t),t===F$||t===-F$){var e=t<0?-1:1;return e*$Me}return t===t?t:0}function iRe(t){var e=nRe(t),r=e%1;return e===e?r?e-r:e:0}function oRe(t){if(typeof t=="number")return t;if(rRe(t))return L$;if(q$(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=q$(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(KMe,"");var r=WMe.test(t);return r||YMe.test(t)?QMe(t.slice(2),r?2:8):VMe.test(t)?L$:+t}U$.exports=eRe});var Q$=F((UVe,Y$)=>{m();var z$=E3(),sRe=H3(),aRe=z3(),H$=j_(),cRe=w$(),s1=E$(),$$=M$(),Q3=D$(),K$=P$(),nu=B$(),uRe=j$(),{KeyObject:lRe,createSecretKey:fRe,createPrivateKey:dRe}=Dl(),V$=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];sRe&&V$.splice(3,0,"PS256","PS384","PS512");var hRe={expiresIn:{isValid:function(t){return $$(t)||nu(t)&&t},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(t){return $$(t)||nu(t)&&t},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(t){return nu(t)||Array.isArray(t)},message:'"audience" must be a string or array'},algorithm:{isValid:cRe.bind(null,V$),message:'"algorithm" must be a valid string enum value'},header:{isValid:K$,message:'"header" must be an object'},encoding:{isValid:nu,message:'"encoding" must be a string'},issuer:{isValid:nu,message:'"issuer" must be a string'},subject:{isValid:nu,message:'"subject" must be a string'},jwtid:{isValid:nu,message:'"jwtid" must be a string'},noTimestamp:{isValid:s1,message:'"noTimestamp" must be a boolean'},keyid:{isValid:nu,message:'"keyid" must be a string'},mutatePayload:{isValid:s1,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:s1,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:s1,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},pRe={iat:{isValid:Q3,message:'"iat" should be a number of seconds'},exp:{isValid:Q3,message:'"exp" should be a number of seconds'},nbf:{isValid:Q3,message:'"nbf" should be a number of seconds'}};function W$(t,e,r,i){if(!K$(r))throw new Error('Expected "'+i+'" to be a plain object.');Object.keys(r).forEach(function(n){let o=t[n];if(!o){if(!e)throw new Error('"'+n+'" is not allowed in "'+i+'"');return}if(!o.isValid(r[n]))throw new Error(o.message)})}function mRe(t){return W$(hRe,!1,t,"options")}function gRe(t){return W$(pRe,!0,t,"payload")}var G$={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},yRe=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Y$.exports=function(t,e,r,i){typeof r=="function"?(i=r,r={}):r=r||{};let n=typeof t=="object"&&!T.isBuffer(t),o=Object.assign({alg:r.algorithm||"HS256",typ:n?"JWT":void 0,kid:r.keyid},r.header);function c(y){if(i)return i(y);throw y}if(!e&&r.algorithm!=="none")return c(new Error("secretOrPrivateKey must have a value"));if(e!=null&&!(e instanceof lRe))try{e=dRe(e)}catch{try{e=fRe(typeof e=="string"?T.from(e):e)}catch{return c(new Error("secretOrPrivateKey is not valid key material"))}}if(o.alg.startsWith("HS")&&e.type!=="secret")return c(new Error(`secretOrPrivateKey must be a symmetric key when using ${o.alg}`));if(/^(?:RS|PS|ES)/.test(o.alg)){if(e.type!=="private")return c(new Error(`secretOrPrivateKey must be an asymmetric key when using ${o.alg}`));if(!r.allowInsecureKeySizes&&!o.alg.startsWith("ES")&&e.asymmetricKeyDetails!==void 0&&e.asymmetricKeyDetails.modulusLength<2048)return c(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`))}if(typeof t>"u")return c(new Error("payload is required"));if(n){try{gRe(t)}catch(y){return c(y)}r.mutatePayload||(t=Object.assign({},t))}else{let y=yRe.filter(function(E){return typeof r[E]<"u"});if(y.length>0)return c(new Error("invalid "+y.join(",")+" option for "+typeof t+" payload"))}if(typeof t.exp<"u"&&typeof r.expiresIn<"u")return c(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof t.nbf<"u"&&typeof r.notBefore<"u")return c(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{mRe(r)}catch(y){return c(y)}if(!r.allowInvalidAsymmetricKeyTypes)try{aRe(o.alg,e)}catch(y){return c(y)}let u=t.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete t.iat:n&&(t.iat=u),typeof r.notBefore<"u"){try{t.nbf=z$(r.notBefore,u)}catch(y){return c(y)}if(typeof t.nbf>"u")return c(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof t=="object"){try{t.exp=z$(r.expiresIn,u)}catch(y){return c(y)}if(typeof t.exp>"u")return c(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(G$).forEach(function(y){let E=G$[y];if(typeof r[y]<"u"){if(typeof t[E]<"u")return c(new Error('Bad "options.'+y+'" option. The payload already has an "'+E+'" property.'));t[E]=r[y]}});let d=r.encoding||"utf8";if(typeof i=="function")i=i&&uRe(i),H$.createSign({header:o,privateKey:e,payload:t,encoding:d}).once("error",i).once("done",function(y){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&y.length<256)return i(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`));i(null,y)});else{let y=H$.sign({header:o,payload:t,secret:e,encoding:d});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&y.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`);return y}}});var X$=F((jVe,J$)=>{m();J$.exports={decode:_3(),verify:m$(),sign:Q$(),JsonWebTokenError:V0(),NotBeforeError:w3(),TokenExpiredError:x3()}});var hT=F((XXe,g1)=>{m();var sK,aK,cK,uK,lK,fK,dK,hK,pK,m1,dT,mK,gK,Vh,yK,vK,bK,_K,wK,xK,EK,SK,CK;(function(t){var e=typeof window=="object"?window:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){t(r(e,r(i)))}):typeof g1=="object"&&typeof g1.exports=="object"?t(r(e,r(g1.exports))):t(r(e));function r(i,n){return i!==e&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(o,c){return i[o]=n?n(o,c):c}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])};sK=function(r,i){e(r,i);function n(){this.constructor=r}r.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)},aK=Object.assign||function(r){for(var i,n=1,o=arguments.length;n=0;y--)(d=r[y])&&(u=(c<3?d(u):c>3?d(i,n,u):d(i,n))||u);return c>3&&u&&Object.defineProperty(i,n,u),u},lK=function(r,i){return function(n,o){i(n,o,r)}},fK=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},dK=function(r,i,n,o){function c(u){return u instanceof n?u:new n(function(d){d(u)})}return new(n||(n=Promise))(function(u,d){function y(A){try{x(o.next(A))}catch(R){d(R)}}function E(A){try{x(o.throw(A))}catch(R){d(R)}}function x(A){A.done?u(A.value):c(A.value).then(y,E)}x((o=o.apply(r,i||[])).next())})},hK=function(r,i){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,c,u,d;return d={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function y(x){return function(A){return E([x,A])}}function E(x){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,c&&(u=x[0]&2?c.return:x[0]?c.throw||((u=c.return)&&u.call(c),0):c.next)&&!(u=u.call(c,x[1])).done)return u;switch(c=0,u&&(x=[x[0]&2,u.value]),x[0]){case 0:case 1:u=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!u||x[1]>u[0]&&x[1]=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},dT=function(r,i){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var o=n.call(r),c,u=[],d;try{for(;(i===void 0||i-- >0)&&!(c=o.next()).done;)u.push(c.value)}catch(y){d={error:y}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(d)throw d.error}}return u},mK=function(){for(var r=[],i=0;i1||y(M,I)})})}function y(M,I){try{E(o[M](I))}catch(D){R(u[0][3],D)}}function E(M){M.value instanceof Vh?Promise.resolve(M.value.v).then(x,A):R(u[0][2],M)}function x(M){y("next",M)}function A(M){y("throw",M)}function R(M,I){M(I),u.shift(),u.length&&y(u[0][0],u[0][1])}},vK=function(r){var i,n;return i={},o("next"),o("throw",function(c){throw c}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(c,u){i[c]=r[c]?function(d){return(n=!n)?{value:Vh(r[c](d)),done:c==="return"}:u?u(d):d}:u}},bK=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],n;return i?i.call(r):(r=typeof m1=="function"?m1(r):r[Symbol.iterator](),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(u){n[u]=r[u]&&function(d){return new Promise(function(y,E){d=r[u](d),c(y,E,d.done,d.value)})}}function c(u,d,y,E){Promise.resolve(E).then(function(x){u({value:x,done:y})},d)}},_K=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r},wK=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var n in r)Object.hasOwnProperty.call(r,n)&&(i[n]=r[n]);return i.default=r,i},xK=function(r){return r&&r.__esModule?r:{default:r}},EK=function(r,i){if(!i.has(r))throw new TypeError("attempted to get private field on non-instance");return i.get(r)},SK=function(r,i,n){if(!i.has(r))throw new TypeError("attempted to set private field on non-instance");return i.set(r,n),n},t("__extends",sK),t("__assign",aK),t("__rest",cK),t("__decorate",uK),t("__param",lK),t("__metadata",fK),t("__awaiter",dK),t("__generator",hK),t("__exportStar",pK),t("__createBinding",CK),t("__values",m1),t("__read",dT),t("__spread",mK),t("__spreadArrays",gK),t("__await",Vh),t("__asyncGenerator",yK),t("__asyncDelegator",vK),t("__asyncValues",bK),t("__makeTemplateObject",_K),t("__importStar",wK),t("__importDefault",xK),t("__classPrivateFieldGet",EK),t("__classPrivateFieldSet",SK)})});var AK=F(Wh=>{"use strict";m();Object.defineProperty(Wh,"__esModule",{value:!0});Wh.toUtf8=Wh.fromUtf8=void 0;var _6e=t=>{let e=[];for(let r=0,i=t.length;r>6|192,n&63|128);else if(r+1>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else e.push(n>>12|224,n>>6&63|128,n&63|128)}return Uint8Array.from(e)};Wh.fromUtf8=_6e;var w6e=t=>{let e="";for(let r=0,i=t.length;ru.toString(16)).join("%");e+=decodeURIComponent(c)}else e+=String.fromCharCode((n&15)<<12|(t[++r]&63)<<6|t[++r]&63)}return e};Wh.toUtf8=w6e});var TK=F(Yh=>{"use strict";m();Object.defineProperty(Yh,"__esModule",{value:!0});Yh.toUtf8=Yh.fromUtf8=void 0;function x6e(t){return new TextEncoder().encode(t)}Yh.fromUtf8=x6e;function E6e(t){return new TextDecoder("utf-8").decode(t)}Yh.toUtf8=E6e});var ug=F(Qh=>{"use strict";m();Object.defineProperty(Qh,"__esModule",{value:!0});Qh.toUtf8=Qh.fromUtf8=void 0;var MK=AK(),RK=TK(),S6e=t=>typeof TextEncoder=="function"?(0,RK.fromUtf8)(t):(0,MK.fromUtf8)(t);Qh.fromUtf8=S6e;var C6e=t=>typeof TextDecoder=="function"?(0,RK.toUtf8)(t):(0,MK.toUtf8)(t);Qh.toUtf8=C6e});var DK=F(y1=>{"use strict";m();Object.defineProperty(y1,"__esModule",{value:!0});y1.convertToBuffer=void 0;var A6e=ug(),T6e=typeof T<"u"&&T.from?function(t){return T.from(t,"utf8")}:A6e.fromUtf8;function M6e(t){return t instanceof Uint8Array?t:typeof t=="string"?T6e(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}y1.convertToBuffer=M6e});var kK=F(v1=>{"use strict";m();Object.defineProperty(v1,"__esModule",{value:!0});v1.isEmptyData=void 0;function R6e(t){return typeof t=="string"?t.length===0:t.byteLength===0}v1.isEmptyData=R6e});var IK=F(b1=>{"use strict";m();Object.defineProperty(b1,"__esModule",{value:!0});b1.numToUint8=void 0;function D6e(t){return new Uint8Array([(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255])}b1.numToUint8=D6e});var OK=F(_1=>{"use strict";m();Object.defineProperty(_1,"__esModule",{value:!0});_1.uint32ArrayFrom=void 0;function k6e(t){if(!Uint32Array.from){for(var e=new Uint32Array(t.length),r=0;r{"use strict";m();Object.defineProperty(Ks,"__esModule",{value:!0});Ks.uint32ArrayFrom=Ks.numToUint8=Ks.isEmptyData=Ks.convertToBuffer=void 0;var I6e=DK();Object.defineProperty(Ks,"convertToBuffer",{enumerable:!0,get:function(){return I6e.convertToBuffer}});var O6e=kK();Object.defineProperty(Ks,"isEmptyData",{enumerable:!0,get:function(){return O6e.isEmptyData}});var P6e=IK();Object.defineProperty(Ks,"numToUint8",{enumerable:!0,get:function(){return P6e.numToUint8}});var N6e=OK();Object.defineProperty(Ks,"uint32ArrayFrom",{enumerable:!0,get:function(){return N6e.uint32ArrayFrom}})});var BK=F(w1=>{"use strict";m();Object.defineProperty(w1,"__esModule",{value:!0});w1.AwsCrc32=void 0;var PK=hT(),pT=ja(),NK=lg(),B6e=function(){function t(){this.crc32=new NK.Crc32}return t.prototype.update=function(e){(0,pT.isEmptyData)(e)||this.crc32.update((0,pT.convertToBuffer)(e))},t.prototype.digest=function(){return PK.__awaiter(this,void 0,void 0,function(){return PK.__generator(this,function(e){return[2,(0,pT.numToUint8)(this.crc32.digest())]})})},t.prototype.reset=function(){this.crc32=new NK.Crc32},t}();w1.AwsCrc32=B6e});var lg=F(fu=>{"use strict";m();Object.defineProperty(fu,"__esModule",{value:!0});fu.AwsCrc32=fu.Crc32=fu.crc32=void 0;var F6e=hT(),L6e=ja();function q6e(t){return new FK().update(t).digest()}fu.crc32=q6e;var FK=function(){function t(){this.checksum=4294967295}return t.prototype.update=function(e){var r,i;try{for(var n=F6e.__values(e),o=n.next();!o.done;o=n.next()){var c=o.value;this.checksum=this.checksum>>>8^j6e[(this.checksum^c)&255]}}catch(u){r={error:u}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return this},t.prototype.digest=function(){return(this.checksum^4294967295)>>>0},t}();fu.Crc32=FK;var U6e=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],j6e=(0,L6e.uint32ArrayFrom)(U6e),z6e=BK();Object.defineProperty(fu,"AwsCrc32",{enumerable:!0,get:function(){return z6e.AwsCrc32}})});var AW=F((nat,Z1)=>{m();var sW,aW,cW,uW,lW,fW,dW,hW,pW,X1,zT,mW,gW,np,yW,vW,bW,_W,wW,xW,EW,SW,CW;(function(t){var e=typeof window=="object"?window:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){t(r(e,r(i)))}):typeof Z1=="object"&&typeof Z1.exports=="object"?t(r(e,r(Z1.exports))):t(r(e));function r(i,n){return i!==e&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(o,c){return i[o]=n?n(o,c):c}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])};sW=function(r,i){e(r,i);function n(){this.constructor=r}r.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)},aW=Object.assign||function(r){for(var i,n=1,o=arguments.length;n=0;y--)(d=r[y])&&(u=(c<3?d(u):c>3?d(i,n,u):d(i,n))||u);return c>3&&u&&Object.defineProperty(i,n,u),u},lW=function(r,i){return function(n,o){i(n,o,r)}},fW=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},dW=function(r,i,n,o){function c(u){return u instanceof n?u:new n(function(d){d(u)})}return new(n||(n=Promise))(function(u,d){function y(A){try{x(o.next(A))}catch(R){d(R)}}function E(A){try{x(o.throw(A))}catch(R){d(R)}}function x(A){A.done?u(A.value):c(A.value).then(y,E)}x((o=o.apply(r,i||[])).next())})},hW=function(r,i){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,c,u,d;return d={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function y(x){return function(A){return E([x,A])}}function E(x){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,c&&(u=x[0]&2?c.return:x[0]?c.throw||((u=c.return)&&u.call(c),0):c.next)&&!(u=u.call(c,x[1])).done)return u;switch(c=0,u&&(x=[x[0]&2,u.value]),x[0]){case 0:case 1:u=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!u||x[1]>u[0]&&x[1]=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},zT=function(r,i){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var o=n.call(r),c,u=[],d;try{for(;(i===void 0||i-- >0)&&!(c=o.next()).done;)u.push(c.value)}catch(y){d={error:y}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(d)throw d.error}}return u},mW=function(){for(var r=[],i=0;i1||y(M,I)})})}function y(M,I){try{E(o[M](I))}catch(D){R(u[0][3],D)}}function E(M){M.value instanceof np?Promise.resolve(M.value.v).then(x,A):R(u[0][2],M)}function x(M){y("next",M)}function A(M){y("throw",M)}function R(M,I){M(I),u.shift(),u.length&&y(u[0][0],u[0][1])}},vW=function(r){var i,n;return i={},o("next"),o("throw",function(c){throw c}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(c,u){i[c]=r[c]?function(d){return(n=!n)?{value:np(r[c](d)),done:c==="return"}:u?u(d):d}:u}},bW=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],n;return i?i.call(r):(r=typeof X1=="function"?X1(r):r[Symbol.iterator](),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(u){n[u]=r[u]&&function(d){return new Promise(function(y,E){d=r[u](d),c(y,E,d.done,d.value)})}}function c(u,d,y,E){Promise.resolve(E).then(function(x){u({value:x,done:y})},d)}},_W=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r},wW=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var n in r)Object.hasOwnProperty.call(r,n)&&(i[n]=r[n]);return i.default=r,i},xW=function(r){return r&&r.__esModule?r:{default:r}},EW=function(r,i){if(!i.has(r))throw new TypeError("attempted to get private field on non-instance");return i.get(r)},SW=function(r,i,n){if(!i.has(r))throw new TypeError("attempted to set private field on non-instance");return i.set(r,n),n},t("__extends",sW),t("__assign",aW),t("__rest",cW),t("__decorate",uW),t("__param",lW),t("__metadata",fW),t("__awaiter",dW),t("__generator",hW),t("__exportStar",pW),t("__createBinding",CW),t("__values",X1),t("__read",zT),t("__spread",mW),t("__spreadArrays",gW),t("__await",np),t("__asyncGenerator",yW),t("__asyncDelegator",vW),t("__asyncValues",bW),t("__makeTemplateObject",_W),t("__importStar",wW),t("__importDefault",xW),t("__classPrivateFieldGet",EW),t("__classPrivateFieldSet",SW)})});var HT=F(ew=>{"use strict";m();Object.defineProperty(ew,"__esModule",{value:!0});ew.isEmptyData=void 0;function qDe(t){return typeof t=="string"?t.length===0:t.byteLength===0}ew.isEmptyData=qDe});var $T=F(Ha=>{"use strict";m();Object.defineProperty(Ha,"__esModule",{value:!0});Ha.EMPTY_DATA_SHA_1=Ha.SHA_1_HMAC_ALGO=Ha.SHA_1_HASH=void 0;Ha.SHA_1_HASH={name:"SHA-1"};Ha.SHA_1_HMAC_ALGO={name:"HMAC",hash:Ha.SHA_1_HASH};Ha.EMPTY_DATA_SHA_1=new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9])});var Tf=F(tw=>{m();Object.defineProperty(tw,"__esModule",{value:!0});tw.locateWindow=void 0;var UDe={};function jDe(){return typeof window<"u"?window:typeof self<"u"?self:UDe}tw.locateWindow=jDe});var KT=F(rw=>{"use strict";m();Object.defineProperty(rw,"__esModule",{value:!0});rw.Sha1=void 0;var zDe=HT(),TW=$T(),HDe=ug(),GT=Tf(),$De=function(){function t(e){this.secret=e,this.reset()}return t.prototype.update=function(e){var r=this;(0,zDe.isEmptyData)(e)||(this.operation=this.operation.then(function(i){return i.onerror=function(){r.operation=Promise.reject(new Error("Error encountered updating hash"))},i.process(MW(e)),i}),this.operation.catch(function(){}))},t.prototype.digest=function(){return this.operation.then(function(e){return new Promise(function(r,i){e.onerror=function(){i(new Error("Error encountered finalizing hash"))},e.oncomplete=function(){e.result&&r(new Uint8Array(e.result)),i(new Error("Error encountered finalizing hash"))},e.finish()})})},t.prototype.reset=function(){this.secret?(this.operation=GDe(this.secret).then(function(e){return(0,GT.locateWindow)().msCrypto.subtle.sign(TW.SHA_1_HMAC_ALGO,e)}),this.operation.catch(function(){})):this.operation=Promise.resolve((0,GT.locateWindow)().msCrypto.subtle.digest("SHA-1"))},t}();rw.Sha1=$De;function GDe(t){return new Promise(function(e,r){var i=(0,GT.locateWindow)().msCrypto.subtle.importKey("raw",MW(t),TW.SHA_1_HMAC_ALGO,!1,["sign"]);i.oncomplete=function(){i.result&&e(i.result),r(new Error("ImportKey completed without importing key."))},i.onerror=function(){r(new Error("ImportKey failed to import key."))}})}function MW(t){return typeof t=="string"?(0,HDe.fromUtf8)(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}});var WT=F(iw=>{"use strict";m();Object.defineProperty(iw,"__esModule",{value:!0});iw.Sha1=void 0;var KDe=ug(),RW=HT(),nw=$T(),VT=Tf(),VDe=function(){function t(e){this.toHash=new Uint8Array(0),e!==void 0&&(this.key=new Promise(function(r,i){(0,VT.locateWindow)().crypto.subtle.importKey("raw",DW(e),nw.SHA_1_HMAC_ALGO,!1,["sign"]).then(r,i)}),this.key.catch(function(){}))}return t.prototype.update=function(e){if(!(0,RW.isEmptyData)(e)){var r=DW(e),i=new Uint8Array(this.toHash.byteLength+r.byteLength);i.set(this.toHash,0),i.set(r,this.toHash.byteLength),this.toHash=i}},t.prototype.digest=function(){var e=this;return this.key?this.key.then(function(r){return(0,VT.locateWindow)().crypto.subtle.sign(nw.SHA_1_HMAC_ALGO,r,e.toHash).then(function(i){return new Uint8Array(i)})}):(0,RW.isEmptyData)(this.toHash)?Promise.resolve(nw.EMPTY_DATA_SHA_1):Promise.resolve().then(function(){return(0,VT.locateWindow)().crypto.subtle.digest(nw.SHA_1_HASH,e.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},t.prototype.reset=function(){this.toHash=new Uint8Array(0)},t}();iw.Sha1=VDe;function DW(t){return typeof t=="string"?(0,KDe.fromUtf8)(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}});var QT=F((uat,sw)=>{m();var kW,IW,OW,PW,NW,BW,FW,LW,qW,ow,YT,UW,jW,ip,zW,HW,$W,GW,KW,VW,WW,YW,QW;(function(t){var e=typeof window=="object"?window:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){t(r(e,r(i)))}):typeof sw=="object"&&typeof sw.exports=="object"?t(r(e,r(sw.exports))):t(r(e));function r(i,n){return i!==e&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(o,c){return i[o]=n?n(o,c):c}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])};kW=function(r,i){e(r,i);function n(){this.constructor=r}r.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)},IW=Object.assign||function(r){for(var i,n=1,o=arguments.length;n=0;y--)(d=r[y])&&(u=(c<3?d(u):c>3?d(i,n,u):d(i,n))||u);return c>3&&u&&Object.defineProperty(i,n,u),u},NW=function(r,i){return function(n,o){i(n,o,r)}},BW=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},FW=function(r,i,n,o){function c(u){return u instanceof n?u:new n(function(d){d(u)})}return new(n||(n=Promise))(function(u,d){function y(A){try{x(o.next(A))}catch(R){d(R)}}function E(A){try{x(o.throw(A))}catch(R){d(R)}}function x(A){A.done?u(A.value):c(A.value).then(y,E)}x((o=o.apply(r,i||[])).next())})},LW=function(r,i){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,c,u,d;return d={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function y(x){return function(A){return E([x,A])}}function E(x){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,c&&(u=x[0]&2?c.return:x[0]?c.throw||((u=c.return)&&u.call(c),0):c.next)&&!(u=u.call(c,x[1])).done)return u;switch(c=0,u&&(x=[x[0]&2,u.value]),x[0]){case 0:case 1:u=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!u||x[1]>u[0]&&x[1]=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},YT=function(r,i){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var o=n.call(r),c,u=[],d;try{for(;(i===void 0||i-- >0)&&!(c=o.next()).done;)u.push(c.value)}catch(y){d={error:y}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(d)throw d.error}}return u},UW=function(){for(var r=[],i=0;i1||y(M,I)})})}function y(M,I){try{E(o[M](I))}catch(D){R(u[0][3],D)}}function E(M){M.value instanceof ip?Promise.resolve(M.value.v).then(x,A):R(u[0][2],M)}function x(M){y("next",M)}function A(M){y("throw",M)}function R(M,I){M(I),u.shift(),u.length&&y(u[0][0],u[0][1])}},HW=function(r){var i,n;return i={},o("next"),o("throw",function(c){throw c}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(c,u){i[c]=r[c]?function(d){return(n=!n)?{value:ip(r[c](d)),done:c==="return"}:u?u(d):d}:u}},$W=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],n;return i?i.call(r):(r=typeof ow=="function"?ow(r):r[Symbol.iterator](),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(u){n[u]=r[u]&&function(d){return new Promise(function(y,E){d=r[u](d),c(y,E,d.done,d.value)})}}function c(u,d,y,E){Promise.resolve(E).then(function(x){u({value:x,done:y})},d)}},GW=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r},KW=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var n in r)Object.hasOwnProperty.call(r,n)&&(i[n]=r[n]);return i.default=r,i},VW=function(r){return r&&r.__esModule?r:{default:r}},WW=function(r,i){if(!i.has(r))throw new TypeError("attempted to get private field on non-instance");return i.get(r)},YW=function(r,i,n){if(!i.has(r))throw new TypeError("attempted to set private field on non-instance");return i.set(r,n),n},t("__extends",kW),t("__assign",IW),t("__rest",OW),t("__decorate",PW),t("__param",NW),t("__metadata",BW),t("__awaiter",FW),t("__generator",LW),t("__exportStar",qW),t("__createBinding",QW),t("__values",ow),t("__read",YT),t("__spread",UW),t("__spreadArrays",jW),t("__await",ip),t("__asyncGenerator",zW),t("__asyncDelegator",HW),t("__asyncValues",$W),t("__makeTemplateObject",GW),t("__importStar",KW),t("__importDefault",VW),t("__classPrivateFieldGet",WW),t("__classPrivateFieldSet",YW)})});var ZW=F(Vs=>{"use strict";m();Object.defineProperty(Vs,"__esModule",{value:!0});Vs.supportsZeroByteGCM=Vs.supportsSubtleCrypto=Vs.supportsSecureRandom=Vs.supportsWebCrypto=void 0;var JW=QT(),WDe=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function YDe(t){if(XW(t)&&typeof t.crypto.subtle=="object"){var e=t.crypto.subtle;return JT(e)}return!1}Vs.supportsWebCrypto=YDe;function XW(t){if(typeof t=="object"&&typeof t.crypto=="object"){var e=t.crypto.getRandomValues;return typeof e=="function"}return!1}Vs.supportsSecureRandom=XW;function JT(t){return t&&WDe.every(function(e){return typeof t[e]=="function"})}Vs.supportsSubtleCrypto=JT;function QDe(t){return JW.__awaiter(this,void 0,void 0,function(){var e,r,i;return JW.__generator(this,function(n){switch(n.label){case 0:if(!JT(t))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,t.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return e=n.sent(),[4,t.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},e,new Uint8Array(0))];case 3:return r=n.sent(),[2,r.byteLength===16];case 4:return i=n.sent(),[2,!1];case 5:return[2]}})})}Vs.supportsZeroByteGCM=QDe});var ZT=F(XT=>{"use strict";m();Object.defineProperty(XT,"__esModule",{value:!0});var JDe=QT();JDe.__exportStar(ZW(),XT)});var _Y=F((dat,cw)=>{m();var eY,tY,rY,nY,iY,oY,sY,aY,cY,aw,eM,uY,lY,op,fY,dY,hY,pY,mY,gY,yY,vY,bY;(function(t){var e=typeof window=="object"?window:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){t(r(e,r(i)))}):typeof cw=="object"&&typeof cw.exports=="object"?t(r(e,r(cw.exports))):t(r(e));function r(i,n){return i!==e&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(o,c){return i[o]=n?n(o,c):c}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])};eY=function(r,i){e(r,i);function n(){this.constructor=r}r.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)},tY=Object.assign||function(r){for(var i,n=1,o=arguments.length;n=0;y--)(d=r[y])&&(u=(c<3?d(u):c>3?d(i,n,u):d(i,n))||u);return c>3&&u&&Object.defineProperty(i,n,u),u},iY=function(r,i){return function(n,o){i(n,o,r)}},oY=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},sY=function(r,i,n,o){function c(u){return u instanceof n?u:new n(function(d){d(u)})}return new(n||(n=Promise))(function(u,d){function y(A){try{x(o.next(A))}catch(R){d(R)}}function E(A){try{x(o.throw(A))}catch(R){d(R)}}function x(A){A.done?u(A.value):c(A.value).then(y,E)}x((o=o.apply(r,i||[])).next())})},aY=function(r,i){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,c,u,d;return d={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function y(x){return function(A){return E([x,A])}}function E(x){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,c&&(u=x[0]&2?c.return:x[0]?c.throw||((u=c.return)&&u.call(c),0):c.next)&&!(u=u.call(c,x[1])).done)return u;switch(c=0,u&&(x=[x[0]&2,u.value]),x[0]){case 0:case 1:u=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!u||x[1]>u[0]&&x[1]=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},eM=function(r,i){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var o=n.call(r),c,u=[],d;try{for(;(i===void 0||i-- >0)&&!(c=o.next()).done;)u.push(c.value)}catch(y){d={error:y}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(d)throw d.error}}return u},uY=function(){for(var r=[],i=0;i1||y(M,I)})})}function y(M,I){try{E(o[M](I))}catch(D){R(u[0][3],D)}}function E(M){M.value instanceof op?Promise.resolve(M.value.v).then(x,A):R(u[0][2],M)}function x(M){y("next",M)}function A(M){y("throw",M)}function R(M,I){M(I),u.shift(),u.length&&y(u[0][0],u[0][1])}},dY=function(r){var i,n;return i={},o("next"),o("throw",function(c){throw c}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(c,u){i[c]=r[c]?function(d){return(n=!n)?{value:op(r[c](d)),done:c==="return"}:u?u(d):d}:u}},hY=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],n;return i?i.call(r):(r=typeof aw=="function"?aw(r):r[Symbol.iterator](),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(u){n[u]=r[u]&&function(d){return new Promise(function(y,E){d=r[u](d),c(y,E,d.done,d.value)})}}function c(u,d,y,E){Promise.resolve(E).then(function(x){u({value:x,done:y})},d)}},pY=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r},mY=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var n in r)Object.hasOwnProperty.call(r,n)&&(i[n]=r[n]);return i.default=r,i},gY=function(r){return r&&r.__esModule?r:{default:r}},yY=function(r,i){if(!i.has(r))throw new TypeError("attempted to get private field on non-instance");return i.get(r)},vY=function(r,i,n){if(!i.has(r))throw new TypeError("attempted to set private field on non-instance");return i.set(r,n),n},t("__extends",eY),t("__assign",tY),t("__rest",rY),t("__decorate",nY),t("__param",iY),t("__metadata",oY),t("__awaiter",sY),t("__generator",aY),t("__exportStar",cY),t("__createBinding",bY),t("__values",aw),t("__read",eM),t("__spread",uY),t("__spreadArrays",lY),t("__await",op),t("__asyncGenerator",fY),t("__asyncDelegator",dY),t("__asyncValues",hY),t("__makeTemplateObject",pY),t("__importStar",mY),t("__importDefault",gY),t("__classPrivateFieldGet",yY),t("__classPrivateFieldSet",vY)})});var xY=F(wY=>{"use strict";m();Object.defineProperty(wY,"__esModule",{value:!0})});var SY=F(EY=>{"use strict";m();Object.defineProperty(EY,"__esModule",{value:!0})});var AY=F(CY=>{"use strict";m();Object.defineProperty(CY,"__esModule",{value:!0})});var MY=F(TY=>{"use strict";m();Object.defineProperty(TY,"__esModule",{value:!0})});var RY=F(uw=>{"use strict";m();Object.defineProperty(uw,"__esModule",{value:!0});uw.isMsWindow=void 0;var XDe=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function ZDe(t){return"MSInputMethodContext"in t&&"msCrypto"in t}function eke(t){if(ZDe(t)&&t.msCrypto.subtle!==void 0){var e=t.msCrypto,r=e.getRandomValues,i=e.subtle;return XDe.map(function(n){return i[n]}).concat(r).every(function(n){return typeof n=="function"})}return!1}uw.isMsWindow=eke});var tM=F(Mf=>{"use strict";m();Object.defineProperty(Mf,"__esModule",{value:!0});var pg=_Y();pg.__exportStar(xY(),Mf);pg.__exportStar(SY(),Mf);pg.__exportStar(AY(),Mf);pg.__exportStar(MY(),Mf);pg.__exportStar(RY(),Mf)});var kY=F(lw=>{"use strict";m();Object.defineProperty(lw,"__esModule",{value:!0});lw.Sha1=void 0;var tke=KT(),rke=WT(),nke=ZT(),ike=tM(),DY=Tf(),oke=ja(),ske=function(){function t(e){if((0,nke.supportsWebCrypto)((0,DY.locateWindow)()))this.hash=new rke.Sha1(e);else if((0,ike.isMsWindow)((0,DY.locateWindow)()))this.hash=new tke.Sha1(e);else throw new Error("SHA1 not supported")}return t.prototype.update=function(e,r){this.hash.update((0,oke.convertToBuffer)(e))},t.prototype.digest=function(){return this.hash.digest()},t.prototype.reset=function(){this.hash.reset()},t}();lw.Sha1=ske});var IY=F(Rf=>{"use strict";m();Object.defineProperty(Rf,"__esModule",{value:!0});Rf.WebCryptoSha1=Rf.Ie11Sha1=void 0;var ake=AW();ake.__exportStar(kY(),Rf);var cke=KT();Object.defineProperty(Rf,"Ie11Sha1",{enumerable:!0,get:function(){return cke.Sha1}});var uke=WT();Object.defineProperty(Rf,"WebCryptoSha1",{enumerable:!0,get:function(){return uke.Sha1}})});var ZY=F((wat,dw)=>{m();var OY,PY,NY,BY,FY,LY,qY,UY,jY,fw,rM,zY,HY,sp,$Y,GY,KY,VY,WY,YY,QY,JY,XY;(function(t){var e=typeof window=="object"?window:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){t(r(e,r(i)))}):typeof dw=="object"&&typeof dw.exports=="object"?t(r(e,r(dw.exports))):t(r(e));function r(i,n){return i!==e&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(o,c){return i[o]=n?n(o,c):c}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])};OY=function(r,i){e(r,i);function n(){this.constructor=r}r.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)},PY=Object.assign||function(r){for(var i,n=1,o=arguments.length;n=0;y--)(d=r[y])&&(u=(c<3?d(u):c>3?d(i,n,u):d(i,n))||u);return c>3&&u&&Object.defineProperty(i,n,u),u},FY=function(r,i){return function(n,o){i(n,o,r)}},LY=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},qY=function(r,i,n,o){function c(u){return u instanceof n?u:new n(function(d){d(u)})}return new(n||(n=Promise))(function(u,d){function y(A){try{x(o.next(A))}catch(R){d(R)}}function E(A){try{x(o.throw(A))}catch(R){d(R)}}function x(A){A.done?u(A.value):c(A.value).then(y,E)}x((o=o.apply(r,i||[])).next())})},UY=function(r,i){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,c,u,d;return d={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function y(x){return function(A){return E([x,A])}}function E(x){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,c&&(u=x[0]&2?c.return:x[0]?c.throw||((u=c.return)&&u.call(c),0):c.next)&&!(u=u.call(c,x[1])).done)return u;switch(c=0,u&&(x=[x[0]&2,u.value]),x[0]){case 0:case 1:u=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!u||x[1]>u[0]&&x[1]=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},rM=function(r,i){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var o=n.call(r),c,u=[],d;try{for(;(i===void 0||i-- >0)&&!(c=o.next()).done;)u.push(c.value)}catch(y){d={error:y}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(d)throw d.error}}return u},zY=function(){for(var r=[],i=0;i1||y(M,I)})})}function y(M,I){try{E(o[M](I))}catch(D){R(u[0][3],D)}}function E(M){M.value instanceof sp?Promise.resolve(M.value.v).then(x,A):R(u[0][2],M)}function x(M){y("next",M)}function A(M){y("throw",M)}function R(M,I){M(I),u.shift(),u.length&&y(u[0][0],u[0][1])}},GY=function(r){var i,n;return i={},o("next"),o("throw",function(c){throw c}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(c,u){i[c]=r[c]?function(d){return(n=!n)?{value:sp(r[c](d)),done:c==="return"}:u?u(d):d}:u}},KY=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],n;return i?i.call(r):(r=typeof fw=="function"?fw(r):r[Symbol.iterator](),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(u){n[u]=r[u]&&function(d){return new Promise(function(y,E){d=r[u](d),c(y,E,d.done,d.value)})}}function c(u,d,y,E){Promise.resolve(E).then(function(x){u({value:x,done:y})},d)}},VY=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r},WY=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var n in r)Object.hasOwnProperty.call(r,n)&&(i[n]=r[n]);return i.default=r,i},YY=function(r){return r&&r.__esModule?r:{default:r}},QY=function(r,i){if(!i.has(r))throw new TypeError("attempted to get private field on non-instance");return i.get(r)},JY=function(r,i,n){if(!i.has(r))throw new TypeError("attempted to set private field on non-instance");return i.set(r,n),n},t("__extends",OY),t("__assign",PY),t("__rest",NY),t("__decorate",BY),t("__param",FY),t("__metadata",LY),t("__awaiter",qY),t("__generator",UY),t("__exportStar",jY),t("__createBinding",XY),t("__values",fw),t("__read",rM),t("__spread",zY),t("__spreadArrays",HY),t("__await",sp),t("__asyncGenerator",$Y),t("__asyncDelegator",GY),t("__asyncValues",KY),t("__makeTemplateObject",VY),t("__importStar",WY),t("__importDefault",YY),t("__classPrivateFieldGet",QY),t("__classPrivateFieldSet",JY)})});var eQ=F(hw=>{"use strict";m();Object.defineProperty(hw,"__esModule",{value:!0});hw.isEmptyData=void 0;function lke(t){return typeof t=="string"?t.length===0:t.byteLength===0}hw.isEmptyData=lke});var nM=F($a=>{"use strict";m();Object.defineProperty($a,"__esModule",{value:!0});$a.EMPTY_DATA_SHA_256=$a.SHA_256_HMAC_ALGO=$a.SHA_256_HASH=void 0;$a.SHA_256_HASH={name:"SHA-256"};$a.SHA_256_HMAC_ALGO={name:"HMAC",hash:$a.SHA_256_HASH};$a.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])});var oM=F(pw=>{"use strict";m();Object.defineProperty(pw,"__esModule",{value:!0});pw.Sha256=void 0;var fke=eQ(),tQ=nM(),dke=ug(),iM=Tf(),hke=function(){function t(e){this.secret=e,this.reset()}return t.prototype.update=function(e){var r=this;(0,fke.isEmptyData)(e)||(this.operation=this.operation.then(function(i){return i.onerror=function(){r.operation=Promise.reject(new Error("Error encountered updating hash"))},i.process(rQ(e)),i}),this.operation.catch(function(){}))},t.prototype.digest=function(){return this.operation.then(function(e){return new Promise(function(r,i){e.onerror=function(){i(new Error("Error encountered finalizing hash"))},e.oncomplete=function(){e.result&&r(new Uint8Array(e.result)),i(new Error("Error encountered finalizing hash"))},e.finish()})})},t.prototype.reset=function(){this.secret?(this.operation=pke(this.secret).then(function(e){return(0,iM.locateWindow)().msCrypto.subtle.sign(tQ.SHA_256_HMAC_ALGO,e)}),this.operation.catch(function(){})):this.operation=Promise.resolve((0,iM.locateWindow)().msCrypto.subtle.digest("SHA-256"))},t}();pw.Sha256=hke;function pke(t){return new Promise(function(e,r){var i=(0,iM.locateWindow)().msCrypto.subtle.importKey("raw",rQ(t),tQ.SHA_256_HMAC_ALGO,!1,["sign"]);i.oncomplete=function(){i.result&&e(i.result),r(new Error("ImportKey completed without importing key."))},i.onerror=function(){r(new Error("ImportKey failed to import key."))}})}function rQ(t){return typeof t=="string"?(0,dke.fromUtf8)(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}});var aM=F(yw=>{"use strict";m();Object.defineProperty(yw,"__esModule",{value:!0});yw.Sha256=void 0;var mw=ja(),gw=nM(),sM=Tf(),mke=function(){function t(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return t.prototype.update=function(e){if(!(0,mw.isEmptyData)(e)){var r=(0,mw.convertToBuffer)(e),i=new Uint8Array(this.toHash.byteLength+r.byteLength);i.set(this.toHash,0),i.set(r,this.toHash.byteLength),this.toHash=i}},t.prototype.digest=function(){var e=this;return this.key?this.key.then(function(r){return(0,sM.locateWindow)().crypto.subtle.sign(gw.SHA_256_HMAC_ALGO,r,e.toHash).then(function(i){return new Uint8Array(i)})}):(0,mw.isEmptyData)(this.toHash)?Promise.resolve(gw.EMPTY_DATA_SHA_256):Promise.resolve().then(function(){return(0,sM.locateWindow)().crypto.subtle.digest(gw.SHA_256_HASH,e.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},t.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(r,i){(0,sM.locateWindow)().crypto.subtle.importKey("raw",(0,mw.convertToBuffer)(e.secret),gw.SHA_256_HMAC_ALGO,!1,["sign"]).then(r,i)}),this.key.catch(function(){}))},t}();yw.Sha256=mke});var uM=F((Aat,bw)=>{m();var nQ,iQ,oQ,sQ,aQ,cQ,uQ,lQ,fQ,vw,cM,dQ,hQ,ap,pQ,mQ,gQ,yQ,vQ,bQ,_Q,wQ,xQ;(function(t){var e=typeof window=="object"?window:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){t(r(e,r(i)))}):typeof bw=="object"&&typeof bw.exports=="object"?t(r(e,r(bw.exports))):t(r(e));function r(i,n){return i!==e&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(o,c){return i[o]=n?n(o,c):c}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])};nQ=function(r,i){e(r,i);function n(){this.constructor=r}r.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)},iQ=Object.assign||function(r){for(var i,n=1,o=arguments.length;n=0;y--)(d=r[y])&&(u=(c<3?d(u):c>3?d(i,n,u):d(i,n))||u);return c>3&&u&&Object.defineProperty(i,n,u),u},aQ=function(r,i){return function(n,o){i(n,o,r)}},cQ=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},uQ=function(r,i,n,o){function c(u){return u instanceof n?u:new n(function(d){d(u)})}return new(n||(n=Promise))(function(u,d){function y(A){try{x(o.next(A))}catch(R){d(R)}}function E(A){try{x(o.throw(A))}catch(R){d(R)}}function x(A){A.done?u(A.value):c(A.value).then(y,E)}x((o=o.apply(r,i||[])).next())})},lQ=function(r,i){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,c,u,d;return d={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function y(x){return function(A){return E([x,A])}}function E(x){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,c&&(u=x[0]&2?c.return:x[0]?c.throw||((u=c.return)&&u.call(c),0):c.next)&&!(u=u.call(c,x[1])).done)return u;switch(c=0,u&&(x=[x[0]&2,u.value]),x[0]){case 0:case 1:u=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!u||x[1]>u[0]&&x[1]=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},cM=function(r,i){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var o=n.call(r),c,u=[],d;try{for(;(i===void 0||i-- >0)&&!(c=o.next()).done;)u.push(c.value)}catch(y){d={error:y}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(d)throw d.error}}return u},dQ=function(){for(var r=[],i=0;i1||y(M,I)})})}function y(M,I){try{E(o[M](I))}catch(D){R(u[0][3],D)}}function E(M){M.value instanceof ap?Promise.resolve(M.value.v).then(x,A):R(u[0][2],M)}function x(M){y("next",M)}function A(M){y("throw",M)}function R(M,I){M(I),u.shift(),u.length&&y(u[0][0],u[0][1])}},mQ=function(r){var i,n;return i={},o("next"),o("throw",function(c){throw c}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(c,u){i[c]=r[c]?function(d){return(n=!n)?{value:ap(r[c](d)),done:c==="return"}:u?u(d):d}:u}},gQ=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],n;return i?i.call(r):(r=typeof vw=="function"?vw(r):r[Symbol.iterator](),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(u){n[u]=r[u]&&function(d){return new Promise(function(y,E){d=r[u](d),c(y,E,d.done,d.value)})}}function c(u,d,y,E){Promise.resolve(E).then(function(x){u({value:x,done:y})},d)}},yQ=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r},vQ=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var n in r)Object.hasOwnProperty.call(r,n)&&(i[n]=r[n]);return i.default=r,i},bQ=function(r){return r&&r.__esModule?r:{default:r}},_Q=function(r,i){if(!i.has(r))throw new TypeError("attempted to get private field on non-instance");return i.get(r)},wQ=function(r,i,n){if(!i.has(r))throw new TypeError("attempted to set private field on non-instance");return i.set(r,n),n},t("__extends",nQ),t("__assign",iQ),t("__rest",oQ),t("__decorate",sQ),t("__param",aQ),t("__metadata",cQ),t("__awaiter",uQ),t("__generator",lQ),t("__exportStar",fQ),t("__createBinding",xQ),t("__values",vw),t("__read",cM),t("__spread",dQ),t("__spreadArrays",hQ),t("__await",ap),t("__asyncGenerator",pQ),t("__asyncDelegator",mQ),t("__asyncValues",gQ),t("__makeTemplateObject",yQ),t("__importStar",vQ),t("__importDefault",bQ),t("__classPrivateFieldGet",_Q),t("__classPrivateFieldSet",wQ)})});var lM=F(Lo=>{"use strict";m();Object.defineProperty(Lo,"__esModule",{value:!0});Lo.MAX_HASHABLE_LENGTH=Lo.INIT=Lo.KEY=Lo.DIGEST_LENGTH=Lo.BLOCK_SIZE=void 0;Lo.BLOCK_SIZE=64;Lo.DIGEST_LENGTH=32;Lo.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);Lo.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];Lo.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1});var EQ=F(_w=>{"use strict";m();Object.defineProperty(_w,"__esModule",{value:!0});_w.RawSha256=void 0;var qo=lM(),gke=function(){function t(){this.state=Int32Array.from(qo.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var r=0,i=e.byteLength;if(this.bytesHashed+=i,this.bytesHashed*8>qo.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;i>0;)this.buffer[this.bufferLength++]=e[r++],i--,this.bufferLength===qo.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,r=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(r.setUint8(this.bufferLength++,128),i%qo.BLOCK_SIZE>=qo.BLOCK_SIZE-8){for(var n=this.bufferLength;n>>24&255,o[n*4+1]=this.state[n]>>>16&255,o[n*4+2]=this.state[n]>>>8&255,o[n*4+3]=this.state[n]>>>0&255;return o},t.prototype.hashBuffer=function(){for(var e=this,r=e.buffer,i=e.state,n=i[0],o=i[1],c=i[2],u=i[3],d=i[4],y=i[5],E=i[6],x=i[7],A=0;A>>17|R<<15)^(R>>>19|R<<13)^R>>>10;R=this.temp[A-15];var I=(R>>>7|R<<25)^(R>>>18|R<<14)^R>>>3;this.temp[A]=(M+this.temp[A-7]|0)+(I+this.temp[A-16]|0)}var D=(((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&y^~d&E)|0)+(x+(qo.KEY[A]+this.temp[A]|0)|0)|0,O=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&o^n&c^o&c)|0;x=E,E=y,y=d,d=u+D|0,u=c,c=o,o=n,n=D+O|0}i[0]+=n,i[1]+=o,i[2]+=c,i[3]+=u,i[4]+=d,i[5]+=y,i[6]+=E,i[7]+=x},t}();_w.RawSha256=gke});var CQ=F(Ew=>{"use strict";m();Object.defineProperty(Ew,"__esModule",{value:!0});Ew.Sha256=void 0;var SQ=uM(),xw=lM(),ww=EQ(),fM=ja(),yke=function(){function t(e){this.secret=e,this.hash=new ww.RawSha256,this.reset()}return t.prototype.update=function(e){if(!((0,fM.isEmptyData)(e)||this.error))try{this.hash.update((0,fM.convertToBuffer)(e))}catch(r){this.error=r}},t.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},t.prototype.digest=function(){return SQ.__awaiter(this,void 0,void 0,function(){return SQ.__generator(this,function(e){return[2,this.digestSync()]})})},t.prototype.reset=function(){if(this.hash=new ww.RawSha256,this.secret){this.outer=new ww.RawSha256;var e=vke(this.secret),r=new Uint8Array(xw.BLOCK_SIZE);r.set(e);for(var i=0;ixw.BLOCK_SIZE){var r=new ww.RawSha256;r.update(e),e=r.digest()}var i=new Uint8Array(xw.BLOCK_SIZE);return i.set(e),i}});var AQ=F(dM=>{"use strict";m();Object.defineProperty(dM,"__esModule",{value:!0});var bke=uM();bke.__exportStar(CQ(),dM)});var MQ=F(Sw=>{"use strict";m();Object.defineProperty(Sw,"__esModule",{value:!0});Sw.Sha256=void 0;var _ke=oM(),wke=aM(),xke=AQ(),Eke=ZT(),Ske=tM(),TQ=Tf(),Cke=ja(),Ake=function(){function t(e){(0,Eke.supportsWebCrypto)((0,TQ.locateWindow)())?this.hash=new wke.Sha256(e):(0,Ske.isMsWindow)((0,TQ.locateWindow)())?this.hash=new _ke.Sha256(e):this.hash=new xke.Sha256(e)}return t.prototype.update=function(e,r){this.hash.update((0,Cke.convertToBuffer)(e))},t.prototype.digest=function(){return this.hash.digest()},t.prototype.reset=function(){this.hash.reset()},t}();Sw.Sha256=Ake});var RQ=F(Df=>{"use strict";m();Object.defineProperty(Df,"__esModule",{value:!0});Df.WebCryptoSha256=Df.Ie11Sha256=void 0;var Tke=ZY();Tke.__exportStar(MQ(),Df);var Mke=oM();Object.defineProperty(Df,"Ie11Sha256",{enumerable:!0,get:function(){return Mke.Sha256}});var Rke=aM();Object.defineProperty(Df,"WebCryptoSha256",{enumerable:!0,get:function(){return Rke.Sha256}})});var pM=F((mg,hM)=>{m();(function(t,e){typeof mg=="object"&&typeof hM=="object"?hM.exports=e():typeof define=="function"&&define.amd?define([],e):typeof mg=="object"?mg.bowser=e():t.bowser=e()})(mg,function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(i,n,o){r.o(i,n)||Object.defineProperty(i,n,{enumerable:!0,get:o})},r.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,n){if(1&n&&(i=r(i)),8&n||4&n&&typeof i=="object"&&i&&i.__esModule)return i;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),2&n&&typeof i!="string")for(var c in i)r.d(o,c,function(u){return i[u]}.bind(null,c));return o},r.n=function(i){var n=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(n,"a",n),n},r.o=function(i,n){return Object.prototype.hasOwnProperty.call(i,n)},r.p="",r(r.s=90)}({17:function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var i=r(18),n=function(){function o(){}return o.getFirstMatch=function(c,u){var d=u.match(c);return d&&d.length>0&&d[1]||""},o.getSecondMatch=function(c,u){var d=u.match(c);return d&&d.length>1&&d[2]||""},o.matchAndReturnConst=function(c,u,d){if(c.test(u))return d},o.getWindowsVersionName=function(c){switch(c){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},o.getMacOSVersionName=function(c){var u=c.split(".").splice(0,2).map(function(d){return parseInt(d,10)||0});if(u.push(0),u[0]===10)switch(u[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},o.getAndroidVersionName=function(c){var u=c.split(".").splice(0,2).map(function(d){return parseInt(d,10)||0});if(u.push(0),!(u[0]===1&&u[1]<5))return u[0]===1&&u[1]<6?"Cupcake":u[0]===1&&u[1]>=6?"Donut":u[0]===2&&u[1]<2?"Eclair":u[0]===2&&u[1]===2?"Froyo":u[0]===2&&u[1]>2?"Gingerbread":u[0]===3?"Honeycomb":u[0]===4&&u[1]<1?"Ice Cream Sandwich":u[0]===4&&u[1]<4?"Jelly Bean":u[0]===4&&u[1]>=4?"KitKat":u[0]===5?"Lollipop":u[0]===6?"Marshmallow":u[0]===7?"Nougat":u[0]===8?"Oreo":u[0]===9?"Pie":void 0},o.getVersionPrecision=function(c){return c.split(".").length},o.compareVersions=function(c,u,d){d===void 0&&(d=!1);var y=o.getVersionPrecision(c),E=o.getVersionPrecision(u),x=Math.max(y,E),A=0,R=o.map([c,u],function(M){var I=x-o.getVersionPrecision(M),D=M+new Array(I+1).join(".0");return o.map(D.split("."),function(O){return new Array(20-O.length).join("0")+O}).reverse()});for(d&&(A=x-Math.min(y,E)),x-=1;x>=A;){if(R[0][x]>R[1][x])return 1;if(R[0][x]===R[1][x]){if(x===A)return 0;x-=1}else if(R[0][x]1?E-1:0),A=1;A0){var N=Object.keys(M),L=u.default.find(N,function(J){return R.isOS(J)});if(L){var j=this.satisfies(M[L]);if(j!==void 0)return j}var H=u.default.find(N,function(J){return R.isPlatform(J)});if(H){var Y=this.satisfies(M[H]);if(Y!==void 0)return Y}}if(O>0){var W=Object.keys(D),q=u.default.find(W,function(J){return R.isBrowser(J,!0)});if(q!==void 0)return this.compareVersion(D[q])}},x.isBrowser=function(A,R){R===void 0&&(R=!1);var M=this.getBrowserName().toLowerCase(),I=A.toLowerCase(),D=u.default.getBrowserTypeByAlias(I);return R&&D&&(I=D.toLowerCase()),I===M},x.compareVersion=function(A){var R=[0],M=A,I=!1,D=this.getBrowserVersion();if(typeof D=="string")return A[0]===">"||A[0]==="<"?(M=A.substr(1),A[1]==="="?(I=!0,M=A.substr(2)):R=[],A[0]===">"?R.push(1):R.push(-1)):A[0]==="="?M=A.substr(1):A[0]==="~"&&(I=!0,M=A.substr(1)),R.indexOf(u.default.compareVersions(D,M,I))>-1},x.isOS=function(A){return this.getOSName(!0)===String(A).toLowerCase()},x.isPlatform=function(A){return this.getPlatformType(!0)===String(A).toLowerCase()},x.isEngine=function(A){return this.getEngineName(!0)===String(A).toLowerCase()},x.is=function(A,R){return R===void 0&&(R=!1),this.isBrowser(A,R)||this.isOS(A)||this.isPlatform(A)},x.some=function(A){var R=this;return A===void 0&&(A=[]),A.some(function(M){return R.is(M)})},E}();e.default=y,t.exports=e.default},92:function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},o=/version\/(\d+(\.?_?\d+)+)/i,c=[{test:[/googlebot/i],describe:function(u){var d={name:"Googlebot"},y=n.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/opera/i],describe:function(u){var d={name:"Opera"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/opr\/|opios/i],describe:function(u){var d={name:"Opera"},y=n.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/SamsungBrowser/i],describe:function(u){var d={name:"Samsung Internet for Android"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/Whale/i],describe:function(u){var d={name:"NAVER Whale Browser"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/MZBrowser/i],describe:function(u){var d={name:"MZ Browser"},y=n.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/focus/i],describe:function(u){var d={name:"Focus"},y=n.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/swing/i],describe:function(u){var d={name:"Swing"},y=n.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/coast/i],describe:function(u){var d={name:"Opera Coast"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(u){var d={name:"Opera Touch"},y=n.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/yabrowser/i],describe:function(u){var d={name:"Yandex Browser"},y=n.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/ucbrowser/i],describe:function(u){var d={name:"UC Browser"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/Maxthon|mxios/i],describe:function(u){var d={name:"Maxthon"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/epiphany/i],describe:function(u){var d={name:"Epiphany"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/puffin/i],describe:function(u){var d={name:"Puffin"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/sleipnir/i],describe:function(u){var d={name:"Sleipnir"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/k-meleon/i],describe:function(u){var d={name:"K-Meleon"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/micromessenger/i],describe:function(u){var d={name:"WeChat"},y=n.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/qqbrowser/i],describe:function(u){var d={name:/qqbrowserlite/i.test(u)?"QQ Browser Lite":"QQ Browser"},y=n.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/msie|trident/i],describe:function(u){var d={name:"Internet Explorer"},y=n.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/\sedg\//i],describe:function(u){var d={name:"Microsoft Edge"},y=n.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/edg([ea]|ios)/i],describe:function(u){var d={name:"Microsoft Edge"},y=n.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/vivaldi/i],describe:function(u){var d={name:"Vivaldi"},y=n.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/seamonkey/i],describe:function(u){var d={name:"SeaMonkey"},y=n.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/sailfish/i],describe:function(u){var d={name:"Sailfish"},y=n.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,u);return y&&(d.version=y),d}},{test:[/silk/i],describe:function(u){var d={name:"Amazon Silk"},y=n.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/phantom/i],describe:function(u){var d={name:"PhantomJS"},y=n.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/slimerjs/i],describe:function(u){var d={name:"SlimerJS"},y=n.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(u){var d={name:"BlackBerry"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/(web|hpw)[o0]s/i],describe:function(u){var d={name:"WebOS Browser"},y=n.default.getFirstMatch(o,u)||n.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/bada/i],describe:function(u){var d={name:"Bada"},y=n.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/tizen/i],describe:function(u){var d={name:"Tizen"},y=n.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/qupzilla/i],describe:function(u){var d={name:"QupZilla"},y=n.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/firefox|iceweasel|fxios/i],describe:function(u){var d={name:"Firefox"},y=n.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/electron/i],describe:function(u){var d={name:"Electron"},y=n.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/MiuiBrowser/i],describe:function(u){var d={name:"Miui"},y=n.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/chromium/i],describe:function(u){var d={name:"Chromium"},y=n.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,u)||n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/chrome|crios|crmo/i],describe:function(u){var d={name:"Chrome"},y=n.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/GSA/i],describe:function(u){var d={name:"Google Search"},y=n.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:function(u){var d=!u.test(/like android/i),y=u.test(/android/i);return d&&y},describe:function(u){var d={name:"Android Browser"},y=n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/playstation 4/i],describe:function(u){var d={name:"PlayStation 4"},y=n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/safari|applewebkit/i],describe:function(u){var d={name:"Safari"},y=n.default.getFirstMatch(o,u);return y&&(d.version=y),d}},{test:[/.*/i],describe:function(u){var d=u.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:n.default.getFirstMatch(d,u),version:n.default.getSecondMatch(d,u)}}}];e.default=c,t.exports=e.default},93:function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},o=r(18),c=[{test:[/Roku\/DVP/],describe:function(u){var d=n.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,u);return{name:o.OS_MAP.Roku,version:d}}},{test:[/windows phone/i],describe:function(u){var d=n.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,u);return{name:o.OS_MAP.WindowsPhone,version:d}}},{test:[/windows /i],describe:function(u){var d=n.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,u),y=n.default.getWindowsVersionName(d);return{name:o.OS_MAP.Windows,version:d,versionName:y}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(u){var d={name:o.OS_MAP.iOS},y=n.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,u);return y&&(d.version=y),d}},{test:[/macintosh/i],describe:function(u){var d=n.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,u).replace(/[_\s]/g,"."),y=n.default.getMacOSVersionName(d),E={name:o.OS_MAP.MacOS,version:d};return y&&(E.versionName=y),E}},{test:[/(ipod|iphone|ipad)/i],describe:function(u){var d=n.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,u).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:d}}},{test:function(u){var d=!u.test(/like android/i),y=u.test(/android/i);return d&&y},describe:function(u){var d=n.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,u),y=n.default.getAndroidVersionName(d),E={name:o.OS_MAP.Android,version:d};return y&&(E.versionName=y),E}},{test:[/(web|hpw)[o0]s/i],describe:function(u){var d=n.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,u),y={name:o.OS_MAP.WebOS};return d&&d.length&&(y.version=d),y}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(u){var d=n.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,u)||n.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,u)||n.default.getFirstMatch(/\bbb(\d+)/i,u);return{name:o.OS_MAP.BlackBerry,version:d}}},{test:[/bada/i],describe:function(u){var d=n.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,u);return{name:o.OS_MAP.Bada,version:d}}},{test:[/tizen/i],describe:function(u){var d=n.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,u);return{name:o.OS_MAP.Tizen,version:d}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(u){var d=n.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,u);return{name:o.OS_MAP.PlayStation4,version:d}}}];e.default=c,t.exports=e.default},94:function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},o=r(18),c=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(u){var d=n.default.getFirstMatch(/(can-l01)/i,u)&&"Nova",y={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return d&&(y.model=d),y}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(u){var d=u.test(/ipod|iphone/i),y=u.test(/like (ipod|iphone)/i);return d&&!y},describe:function(u){var d=n.default.getFirstMatch(/(ipod|iphone)/i,u);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:d}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(u){return u.getBrowserName(!0)==="blackberry"},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(u){return u.getBrowserName(!0)==="bada"},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(u){return u.getBrowserName()==="windows phone"},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(u){var d=Number(String(u.getOSVersion()).split(".")[0]);return u.getOSName(!0)==="android"&&d>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(u){return u.getOSName(!0)==="android"},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(u){return u.getOSName(!0)==="macos"},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(u){return u.getOSName(!0)==="windows"},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(u){return u.getOSName(!0)==="linux"},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(u){return u.getOSName(!0)==="playstation 4"},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(u){return u.getOSName(!0)==="roku"},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];e.default=c,t.exports=e.default},95:function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},o=r(18),c=[{test:function(u){return u.getBrowserName(!0)==="microsoft edge"},describe:function(u){if(/\sedg\//i.test(u))return{name:o.ENGINE_MAP.Blink};var d=n.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,u);return{name:o.ENGINE_MAP.EdgeHTML,version:d}}},{test:[/trident/i],describe:function(u){var d={name:o.ENGINE_MAP.Trident},y=n.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:function(u){return u.test(/presto/i)},describe:function(u){var d={name:o.ENGINE_MAP.Presto},y=n.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:function(u){var d=u.test(/gecko/i),y=u.test(/like gecko/i);return d&&!y},describe:function(u){var d={name:o.ENGINE_MAP.Gecko},y=n.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(u){var d={name:o.ENGINE_MAP.WebKit},y=n.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,u);return y&&(d.version=y),d}}];e.default=c,t.exports=e.default}})})});var Nw=F(Ya=>{"use strict";m();var dX=":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",jke=dX+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",hX="["+dX+"]["+jke+"]*",zke=new RegExp("^"+hX+"$"),Hke=function(t,e){let r=[],i=e.exec(t);for(;i;){let n=[];n.startIndex=e.lastIndex-i[0].length;let o=i.length;for(let c=0;c"u")};Ya.isExist=function(t){return typeof t<"u"};Ya.isEmptyObject=function(t){return Object.keys(t).length===0};Ya.merge=function(t,e,r){if(e){let i=Object.keys(e),n=i.length;for(let o=0;o{"use strict";m();var VM=Nw(),Gke={allowBooleanAttributes:!1,unpairedTags:[]};vX.validate=function(t,e){e=Object.assign({},Gke,e);let r=[],i=!1,n=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(let o=0;o"&&t[o]!==" "&&t[o]!==" "&&t[o]!==` -`&&t[o]!=="\r";o++)d+=t[o];if(d=d.trim(),d[d.length-1]==="/"&&(d=d.substring(0,d.length-1),o--),!Zke(d)){let x;return d.trim().length===0?x="Invalid space after '<'.":x="Tag '"+d+"' is an invalid name.",kn("InvalidTag",x,Ki(t,o))}let y=Wke(t,o);if(y===!1)return kn("InvalidAttr","Attributes for '"+d+"' have open quote.",Ki(t,o));let E=y.value;if(o=y.index,E[E.length-1]==="/"){let x=o-E.length;E=E.substring(0,E.length-1);let A=yX(E,e);if(A===!0)i=!0;else return kn(A.err.code,A.err.msg,Ki(t,x+A.err.line))}else if(u)if(y.tagClosed){if(E.trim().length>0)return kn("InvalidTag","Closing tag '"+d+"' can't have attributes or invalid starting.",Ki(t,c));{let x=r.pop();if(d!==x.tagName){let A=Ki(t,x.tagStartPos);return kn("InvalidTag","Expected closing tag '"+x.tagName+"' (opened in line "+A.line+", col "+A.col+") instead of closing tag '"+d+"'.",Ki(t,c))}r.length==0&&(n=!0)}}else return kn("InvalidTag","Closing tag '"+d+"' doesn't have proper closing.",Ki(t,o));else{let x=yX(E,e);if(x!==!0)return kn(x.err.code,x.err.msg,Ki(t,o-E.length+x.err.line));if(n===!0)return kn("InvalidXml","Multiple possible root nodes found.",Ki(t,o));e.unpairedTags.indexOf(d)!==-1||r.push({tagName:d,tagStartPos:c}),i=!0}for(o++;o0)return kn("InvalidXml","Invalid '"+JSON.stringify(r.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return kn("InvalidXml","Start tag expected.",1);return!0};function pX(t){return t===" "||t===" "||t===` -`||t==="\r"}function mX(t,e){let r=e;for(;e5&&i==="xml")return kn("InvalidXml","XML declaration allowed only at the start of the document.",Ki(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function gX(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let r=1;for(e+=8;e"&&(r--,r===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}var Kke='"',Vke="'";function Wke(t,e){let r="",i="",n=!1;for(;e"&&i===""){n=!0;break}r+=t[e]}return i!==""?!1:{value:r,index:e,tagClosed:n}}var Yke=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function yX(t,e){let r=VM.getAllMatches(t,Yke),i={};for(let n=0;n{m();var bX={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t}},eIe=function(t){return Object.assign({},bX,t)};YM.buildOptions=eIe;YM.defaultOptions=bX});var xX=F((elt,wX)=>{"use strict";m();var QM=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,r){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:r})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,[":@"]:e[":@"]}):this.child.push({[e.tagname]:e.child})}};wX.exports=QM});var SX=F((tlt,EX)=>{m();var tIe=Nw();function rIe(t,e){let r={};if(t[e+3]==="O"&&t[e+4]==="C"&&t[e+5]==="T"&&t[e+6]==="Y"&&t[e+7]==="P"&&t[e+8]==="E"){e=e+9;let i=1,n=!1,o=!1,c="";for(;e"){if(o?t[e-1]==="-"&&t[e-2]==="-"&&(o=!1,i--):i--,i===0)break}else t[e]==="["?n=!0:c+=t[e];if(i!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:e}}function nIe(t,e){let r="";for(;e{m();var lIe=/^[-+]?0x[a-fA-F0-9]+$/,fIe=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var dIe={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function hIe(t,e={}){if(e=Object.assign({},dIe,e),!t||typeof t!="string")return t;let r=t.trim();if(e.skipLike!==void 0&&e.skipLike.test(r))return t;if(e.hex&&lIe.test(r))return Number.parseInt(r,16);{let i=fIe.exec(r);if(i){let n=i[1],o=i[2],c=pIe(i[3]),u=i[4]||i[6];if(!e.leadingZeros&&o.length>0&&n&&r[2]!==".")return t;if(!e.leadingZeros&&o.length>0&&!n&&r[1]!==".")return t;{let d=Number(r),y=""+d;return y.search(/[eE]/)!==-1||u?e.eNotation?d:t:r.indexOf(".")!==-1?y==="0"&&c===""||y===c||n&&y==="-"+c?d:t:o?c===y||n+c===y?d:t:r===y||r===n+y?d:t}}else return t}}function pIe(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substr(0,t.length-1))),t}CX.exports=hIe});var MX=F((ilt,TX)=>{"use strict";m();var eR=Nw(),xg=xX(),mIe=SX(),gIe=AX(),nlt="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,eR.nameRegexp),JM=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"}},this.addExternalEntities=yIe,this.parseXml=xIe,this.parseTextData=vIe,this.resolveNameSpace=bIe,this.buildAttributesMap=wIe,this.isItStopNode=AIe,this.replaceEntitiesValue=SIe,this.readStopNodeData=MIe,this.saveTextToParentTag=CIe,this.addChild=EIe}};function yIe(t){let e=Object.keys(t);for(let r=0;r0)){c||(t=this.replaceEntitiesValue(t));let u=this.options.tagValueProcessor(e,t,r,n,o);return u==null?t:typeof u!=typeof t||u!==t?u:this.options.trimValues?ZM(t,this.options.parseTagValue,this.options.numberParseOptions):t.trim()===t?ZM(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function bIe(t){if(this.options.removeNSPrefix){let e=t.split(":"),r=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(t=r+e[1])}return t}var _Ie=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function wIe(t,e,r){if(!this.options.ignoreAttributes&&typeof t=="string"){let i=eR.getAllMatches(t,_Ie),n=i.length,o={};for(let c=0;c",o,"Closing Tag is not closed."),d=t.substring(o+2,u).trim();if(this.options.removeNSPrefix){let x=d.indexOf(":");x!==-1&&(d=d.substr(x+1))}this.options.transformTagName&&(d=this.options.transformTagName(d)),r&&(i=this.saveTextToParentTag(i,r,n));let y=n.substring(n.lastIndexOf(".")+1);if(d&&this.options.unpairedTags.indexOf(d)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let E=0;y&&this.options.unpairedTags.indexOf(y)!==-1?(E=n.lastIndexOf(".",n.lastIndexOf(".")-1),this.tagsNodeStack.pop()):E=n.lastIndexOf("."),n=n.substring(0,E),r=this.tagsNodeStack.pop(),i="",o=u}else if(t[o+1]==="?"){let u=XM(t,o,!1,"?>");if(!u)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,r,n),!(this.options.ignoreDeclaration&&u.tagName==="?xml"||this.options.ignorePiTags)){let d=new xg(u.tagName);d.add(this.options.textNodeName,""),u.tagName!==u.tagExp&&u.attrExpPresent&&(d[":@"]=this.buildAttributesMap(u.tagExp,n,u.tagName)),this.addChild(r,d,n)}o=u.closeIndex+1}else if(t.substr(o+1,3)==="!--"){let u=If(t,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){let d=t.substring(o+4,u-2);i=this.saveTextToParentTag(i,r,n),r.add(this.options.commentPropName,[{[this.options.textNodeName]:d}])}o=u}else if(t.substr(o+1,2)==="!D"){let u=mIe(t,o);this.docTypeEntities=u.entities,o=u.i}else if(t.substr(o+1,2)==="!["){let u=If(t,"]]>",o,"CDATA is not closed.")-2,d=t.substring(o+9,u);if(i=this.saveTextToParentTag(i,r,n),this.options.cdataPropName)r.add(this.options.cdataPropName,[{[this.options.textNodeName]:d}]);else{let y=this.parseTextData(d,r.tagname,n,!0,!1,!0);y==null&&(y=""),r.add(this.options.textNodeName,y)}o=u+2}else{let u=XM(t,o,this.options.removeNSPrefix),d=u.tagName,y=u.tagExp,E=u.attrExpPresent,x=u.closeIndex;this.options.transformTagName&&(d=this.options.transformTagName(d)),r&&i&&r.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,r,n,!1));let A=r;if(A&&this.options.unpairedTags.indexOf(A.tagname)!==-1&&(r=this.tagsNodeStack.pop(),n=n.substring(0,n.lastIndexOf("."))),d!==e.tagname&&(n+=n?"."+d:d),this.isItStopNode(this.options.stopNodes,n,d)){let R="";if(y.length>0&&y.lastIndexOf("/")===y.length-1)o=u.closeIndex;else if(this.options.unpairedTags.indexOf(d)!==-1)o=u.closeIndex;else{let I=this.readStopNodeData(t,d,x+1);if(!I)throw new Error(`Unexpected end of ${d}`);o=I.i,R=I.tagContent}let M=new xg(d);d!==y&&E&&(M[":@"]=this.buildAttributesMap(y,n,d)),R&&(R=this.parseTextData(R,d,n,!0,E,!0,!0)),n=n.substr(0,n.lastIndexOf(".")),M.add(this.options.textNodeName,R),this.addChild(r,M,n)}else{if(y.length>0&&y.lastIndexOf("/")===y.length-1){d[d.length-1]==="/"?(d=d.substr(0,d.length-1),y=d):y=y.substr(0,y.length-1),this.options.transformTagName&&(d=this.options.transformTagName(d));let R=new xg(d);d!==y&&E&&(R[":@"]=this.buildAttributesMap(y,n,d)),this.addChild(r,R,n),n=n.substr(0,n.lastIndexOf("."))}else{let R=new xg(d);this.tagsNodeStack.push(r),d!==y&&E&&(R[":@"]=this.buildAttributesMap(y,n,d)),this.addChild(r,R,n),r=R}i="",o=x}}else i+=t[o];return e.child};function EIe(t,e,r){let i=this.options.updateTag(e.tagname,r,e[":@"]);i===!1||(typeof i=="string"&&(e.tagname=i),t.addChild(e))}var SIe=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){let r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(let e in this.lastEntities){let r=this.lastEntities[e];t=t.replace(r.regex,r.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){let r=this.htmlEntities[e];t=t.replace(r.regex,r.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function CIe(t,e,r,i){return t&&(i===void 0&&(i=Object.keys(e.child).length===0),t=this.parseTextData(t,e.tagname,r,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,i),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function AIe(t,e,r){let i="*."+r;for(let n in t){let o=t[n];if(i===o||e===o)return!0}return!1}function TIe(t,e,r=">"){let i,n="";for(let o=e;o",r,`${e} is not closed`);if(t.substring(r+2,o).trim()===e&&(n--,n===0))return{tagContent:t.substring(i,r),i:o};r=o}else if(t[r+1]==="?")r=If(t,"?>",r+1,"StopNode is not closed.");else if(t.substr(r+1,3)==="!--")r=If(t,"-->",r+3,"StopNode is not closed.");else if(t.substr(r+1,2)==="![")r=If(t,"]]>",r,"StopNode is not closed.")-2;else{let o=XM(t,r,">");o&&((o&&o.tagName)===e&&o.tagExp[o.tagExp.length-1]!=="/"&&n++,r=o.closeIndex)}}function ZM(t,e,r){if(e&&typeof t=="string"){let i=t.trim();return i==="true"?!0:i==="false"?!1:gIe(t,r)}else return eR.isExist(t)?t:""}TX.exports=JM});var kX=F(DX=>{"use strict";m();function RIe(t,e){return RX(t,e)}function RX(t,e,r){let i,n={};for(let o=0;o0&&(n[e.textNodeName]=i):i!==void 0&&(n[e.textNodeName]=i),n}function DIe(t){let e=Object.keys(t);for(let r=0;r{m();var{buildOptions:OIe}=_X(),PIe=MX(),{prettify:NIe}=kX(),BIe=WM(),tR=class{constructor(e){this.externalEntities={},this.options=OIe(e)}parse(e,r){if(typeof e!="string")if(e.toString)e=e.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});let o=BIe.validate(e,r);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}let i=new PIe(this.options);i.addExternalEntities(this.externalEntities);let n=i.parseXml(e);return this.options.preserveOrder||n===void 0?n:NIe(n,this.options)}addEntity(e,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=r}};IX.exports=tR});var LX=F((alt,FX)=>{m();var FIe=` -`;function LIe(t,e){let r="";return e.format&&e.indentBy.length>0&&(r=FIe),NX(t,e,"",r)}function NX(t,e,r,i){let n="",o=!1;for(let c=0;c`,o=!1;continue}else if(d===e.commentPropName){n+=i+``,o=!0;continue}else if(d[0]==="?"){let M=PX(u[":@"],e),I=d==="?xml"?"":i,D=u[d][0][e.textNodeName];D=D.length!==0?" "+D:"",n+=I+`<${d}${D}${M}?>`,o=!0;continue}let E=i;E!==""&&(E+=e.indentBy);let x=PX(u[":@"],e),A=i+`<${d}${x}`,R=NX(u[d],e,y,E);e.unpairedTags.indexOf(d)!==-1?e.suppressUnpairedNode?n+=A+">":n+=A+"/>":(!R||R.length===0)&&e.suppressEmptyNode?n+=A+"/>":R&&R.endsWith(">")?n+=A+`>${R}${i}`:(n+=A+">",R&&i!==""&&(R.includes("/>")||R.includes("`),o=!0}return n}function qIe(t){let e=Object.keys(t);for(let r=0;r0&&e.processEntities)for(let r=0;r{"use strict";m();var jIe=LX(),zIe={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function _u(t){this.options=Object.assign({},zIe,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=GIe),this.processTextOrObjNode=HIe,this.options.format?(this.indentate=$Ie,this.tagEndChar=`> -`,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}_u.prototype.build=function(t){return this.options.preserveOrder?jIe(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)};_u.prototype.j2x=function(t,e){let r="",i="";for(let n in t)if(!(typeof t[n]>"u"))if(t[n]===null)n[0]==="?"?i+=this.indentate(e)+"<"+n+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+n+"/"+this.tagEndChar;else if(t[n]instanceof Date)i+=this.buildTextValNode(t[n],n,"",e);else if(typeof t[n]!="object"){let o=this.isAttribute(n);if(o)r+=this.buildAttrPairStr(o,""+t[n]);else if(n===this.options.textNodeName){let c=this.options.tagValueProcessor(n,""+t[n]);i+=this.replaceEntitiesValue(c)}else i+=this.buildTextValNode(t[n],n,"",e)}else if(Array.isArray(t[n])){let o=t[n].length,c="";for(let u=0;u"u"||(d===null?n[0]==="?"?i+=this.indentate(e)+"<"+n+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+n+"/"+this.tagEndChar:typeof d=="object"?this.options.oneListGroup?c+=this.j2x(d,e+1).val:c+=this.processTextOrObjNode(d,n,e):c+=this.buildTextValNode(d,n,"",e))}this.options.oneListGroup&&(c=this.buildObjectNode(c,n,"",e)),i+=c}else if(this.options.attributesGroupName&&n===this.options.attributesGroupName){let o=Object.keys(t[n]),c=o.length;for(let u=0;u"+t+n:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(i)+``+this.newLine:this.indentate(i)+"<"+e+r+o+this.tagEndChar+t+this.indentate(i)+n}};_u.prototype.closeTag=function(t){let e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(i)+``+this.newLine;if(e[0]==="?")return this.indentate(i)+"<"+e+r+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(e,t);return n=this.replaceEntitiesValue(n),n===""?this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+r+">"+n+"0&&this.options.processEntities)for(let e=0;e{"use strict";m();var KIe=WM(),VIe=OX(),WIe=UX();jX.exports={XMLParser:VIe,XMLValidator:KIe,XMLBuilder:WIe}});var aR=F((lft,qw)=>{m();var DZ,kZ,IZ,OZ,PZ,NZ,BZ,FZ,LZ,Lw,sR,qZ,UZ,yp,jZ,zZ,HZ,$Z,GZ,KZ,VZ,WZ,YZ;(function(t){var e=typeof window=="object"?window:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){t(r(e,r(i)))}):typeof qw=="object"&&typeof qw.exports=="object"?t(r(e,r(qw.exports))):t(r(e));function r(i,n){return i!==e&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(o,c){return i[o]=n?n(o,c):c}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])};DZ=function(r,i){e(r,i);function n(){this.constructor=r}r.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)},kZ=Object.assign||function(r){for(var i,n=1,o=arguments.length;n=0;y--)(d=r[y])&&(u=(c<3?d(u):c>3?d(i,n,u):d(i,n))||u);return c>3&&u&&Object.defineProperty(i,n,u),u},PZ=function(r,i){return function(n,o){i(n,o,r)}},NZ=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},BZ=function(r,i,n,o){function c(u){return u instanceof n?u:new n(function(d){d(u)})}return new(n||(n=Promise))(function(u,d){function y(A){try{x(o.next(A))}catch(R){d(R)}}function E(A){try{x(o.throw(A))}catch(R){d(R)}}function x(A){A.done?u(A.value):c(A.value).then(y,E)}x((o=o.apply(r,i||[])).next())})},FZ=function(r,i){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,c,u,d;return d={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function y(x){return function(A){return E([x,A])}}function E(x){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,c&&(u=x[0]&2?c.return:x[0]?c.throw||((u=c.return)&&u.call(c),0):c.next)&&!(u=u.call(c,x[1])).done)return u;switch(c=0,u&&(x=[x[0]&2,u.value]),x[0]){case 0:case 1:u=x;break;case 4:return n.label++,{value:x[1],done:!1};case 5:n.label++,c=x[1],x=[0];continue;case 7:x=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(x[0]===6||x[0]===2)){n=0;continue}if(x[0]===3&&(!u||x[1]>u[0]&&x[1]=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},sR=function(r,i){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var o=n.call(r),c,u=[],d;try{for(;(i===void 0||i-- >0)&&!(c=o.next()).done;)u.push(c.value)}catch(y){d={error:y}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(d)throw d.error}}return u},qZ=function(){for(var r=[],i=0;i1||y(M,I)})})}function y(M,I){try{E(o[M](I))}catch(D){R(u[0][3],D)}}function E(M){M.value instanceof yp?Promise.resolve(M.value.v).then(x,A):R(u[0][2],M)}function x(M){y("next",M)}function A(M){y("throw",M)}function R(M,I){M(I),u.shift(),u.length&&y(u[0][0],u[0][1])}},zZ=function(r){var i,n;return i={},o("next"),o("throw",function(c){throw c}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(c,u){i[c]=r[c]?function(d){return(n=!n)?{value:yp(r[c](d)),done:c==="return"}:u?u(d):d}:u}},HZ=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],n;return i?i.call(r):(r=typeof Lw=="function"?Lw(r):r[Symbol.iterator](),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(u){n[u]=r[u]&&function(d){return new Promise(function(y,E){d=r[u](d),c(y,E,d.done,d.value)})}}function c(u,d,y,E){Promise.resolve(E).then(function(x){u({value:x,done:y})},d)}},$Z=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r},GZ=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var n in r)Object.hasOwnProperty.call(r,n)&&(i[n]=r[n]);return i.default=r,i},KZ=function(r){return r&&r.__esModule?r:{default:r}},VZ=function(r,i){if(!i.has(r))throw new TypeError("attempted to get private field on non-instance");return i.get(r)},WZ=function(r,i,n){if(!i.has(r))throw new TypeError("attempted to set private field on non-instance");return i.set(r,n),n},t("__extends",DZ),t("__assign",kZ),t("__rest",IZ),t("__decorate",OZ),t("__param",PZ),t("__metadata",NZ),t("__awaiter",BZ),t("__generator",FZ),t("__exportStar",LZ),t("__createBinding",YZ),t("__values",Lw),t("__read",sR),t("__spread",qZ),t("__spreadArrays",UZ),t("__await",yp),t("__asyncGenerator",jZ),t("__asyncDelegator",zZ),t("__asyncValues",HZ),t("__makeTemplateObject",$Z),t("__importStar",GZ),t("__importDefault",KZ),t("__classPrivateFieldGet",VZ),t("__classPrivateFieldSet",WZ)})});var XZ=F(Uw=>{"use strict";m();Object.defineProperty(Uw,"__esModule",{value:!0});Uw.AwsCrc32c=void 0;var QZ=aR(),cR=ja(),JZ=uR(),x4e=function(){function t(){this.crc32c=new JZ.Crc32c}return t.prototype.update=function(e){(0,cR.isEmptyData)(e)||this.crc32c.update((0,cR.convertToBuffer)(e))},t.prototype.digest=function(){return QZ.__awaiter(this,void 0,void 0,function(){return QZ.__generator(this,function(e){return[2,(0,cR.numToUint8)(this.crc32c.digest())]})})},t.prototype.reset=function(){this.crc32c=new JZ.Crc32c},t}();Uw.AwsCrc32c=x4e});var uR=F(wu=>{"use strict";m();Object.defineProperty(wu,"__esModule",{value:!0});wu.AwsCrc32c=wu.Crc32c=wu.crc32c=void 0;var E4e=aR(),S4e=ja();function C4e(t){return new ZZ().update(t).digest()}wu.crc32c=C4e;var ZZ=function(){function t(){this.checksum=4294967295}return t.prototype.update=function(e){var r,i;try{for(var n=E4e.__values(e),o=n.next();!o.done;o=n.next()){var c=o.value;this.checksum=this.checksum>>>8^T4e[(this.checksum^c)&255]}}catch(u){r={error:u}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return this},t.prototype.digest=function(){return(this.checksum^4294967295)>>>0},t}();wu.Crc32c=ZZ;var A4e=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],T4e=(0,S4e.uint32ArrayFrom)(A4e),M4e=XZ();Object.defineProperty(wu,"AwsCrc32c",{enumerable:!0,get:function(){return M4e.AwsCrc32c}})});var Sg=F(Cp=>{"use strict";m();var fR=Ix(),Sp=Px(),lee=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Cp.Buffer=We;Cp.SlowBuffer=P4e;Cp.INSPECT_MAX_BYTES=50;var Kw=2147483647;Cp.kMaxLength=Kw;We.TYPED_ARRAY_SUPPORT=D4e();!We.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function D4e(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(We.prototype,"parent",{enumerable:!0,get:function(){if(!!We.isBuffer(this))return this.buffer}});Object.defineProperty(We.prototype,"offset",{enumerable:!0,get:function(){if(!!We.isBuffer(this))return this.byteOffset}});function Ja(t){if(t>Kw)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,We.prototype),e}function We(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return pR(t)}return pee(t,e,r)}We.poolSize=8192;function pee(t,e,r){if(typeof t=="string")return I4e(t,e);if(ArrayBuffer.isView(t))return dR(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Xa(t,ArrayBuffer)||t&&Xa(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Xa(t,SharedArrayBuffer)||t&&Xa(t.buffer,SharedArrayBuffer)))return fee(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return We.from(i,e,r);var n=O4e(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return We.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}We.from=function(t,e,r){return pee(t,e,r)};Object.setPrototypeOf(We.prototype,Uint8Array.prototype);Object.setPrototypeOf(We,Uint8Array);function mee(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function k4e(t,e,r){return mee(t),t<=0?Ja(t):e!==void 0?typeof r=="string"?Ja(t).fill(e,r):Ja(t).fill(e):Ja(t)}We.alloc=function(t,e,r){return k4e(t,e,r)};function pR(t){return mee(t),Ja(t<0?0:mR(t)|0)}We.allocUnsafe=function(t){return pR(t)};We.allocUnsafeSlow=function(t){return pR(t)};function I4e(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!We.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=gee(t,e)|0,i=Ja(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function dR(t){for(var e=t.length<0?0:mR(t.length)|0,r=Ja(e),i=0;i=Kw)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Kw.toString(16)+" bytes");return t|0}function P4e(t){return+t!=t&&(t=0),We.alloc(+t)}We.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==We.prototype};We.compare=function(e,r){if(Xa(e,Uint8Array)&&(e=We.from(e,e.offset,e.byteLength)),Xa(r,Uint8Array)&&(r=We.from(r,r.offset,r.byteLength)),!We.isBuffer(e)||!We.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var i=e.length,n=r.length,o=0,c=Math.min(i,n);o2&&arguments[2]===!0;if(!i&&r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return hR(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Eee(t).length;default:if(n)return i?-1:hR(t).length;e=(""+e).toLowerCase(),n=!0}}We.byteLength=gee;function N4e(t,e,r){var i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return G4e(this,e,r);case"utf8":case"utf-8":return bee(this,e,r);case"ascii":return H4e(this,e,r);case"latin1":case"binary":return $4e(this,e,r);case"base64":return j4e(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K4e(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}We.prototype._isBuffer=!0;function Pf(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}We.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;rr&&(e+=" ... "),""};lee&&(We.prototype[lee]=We.prototype.inspect);We.prototype.compare=function(e,r,i,n,o){if(Xa(e,Uint8Array)&&(e=We.from(e,e.offset,e.byteLength)),!We.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;for(var c=o-n,u=i-r,d=Math.min(c,u),y=this.slice(n,o),E=e.slice(r,i),x=0;x2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,gR(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=We.from(e,i)),We.isBuffer(e))return e.length===0?-1:dee(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):dee(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function dee(t,e,r,i,n){var o=1,c=t.length,u=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,c/=2,u/=2,r/=2}function d(R,M){return o===1?R[M]:R.readUInt16BE(M*o)}var y;if(n){var E=-1;for(y=r;yc&&(r=c-u),y=r;y>=0;y--){for(var x=!0,A=0;An&&(i=n)):i=n;var o=e.length;i>o/2&&(i=o/2);for(var c=0;c>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var c=!1;;)switch(n){case"hex":return B4e(this,e,r,i);case"utf8":case"utf-8":return F4e(this,e,r,i);case"ascii":return vee(this,e,r,i);case"latin1":case"binary":return L4e(this,e,r,i);case"base64":return q4e(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U4e(this,e,r,i);default:if(c)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),c=!0}};We.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j4e(t,e,r){return e===0&&r===t.length?fR.fromByteArray(t):fR.fromByteArray(t.slice(e,r))}function bee(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:o>223?3:o>191?2:1;if(n+u<=r){var d,y,E,x;switch(u){case 1:o<128&&(c=o);break;case 2:d=t[n+1],(d&192)===128&&(x=(o&31)<<6|d&63,x>127&&(c=x));break;case 3:d=t[n+1],y=t[n+2],(d&192)===128&&(y&192)===128&&(x=(o&15)<<12|(d&63)<<6|y&63,x>2047&&(x<55296||x>57343)&&(c=x));break;case 4:d=t[n+1],y=t[n+2],E=t[n+3],(d&192)===128&&(y&192)===128&&(E&192)===128&&(x=(o&15)<<18|(d&63)<<12|(y&63)<<6|E&63,x>65535&&x<1114112&&(c=x))}}c===null?(c=65533,u=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|c&1023),i.push(c),n+=u}return z4e(i)}var hee=4096;function z4e(t){var e=t.length;if(e<=hee)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii)&&(r=i);for(var n="",o=e;oi&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),rr)throw new RangeError("Trying to access beyond buffer length")}We.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Jn(e,r,this.length);for(var n=this[e],o=1,c=0;++c>>0,r=r>>>0,i||Jn(e,r,this.length);for(var n=this[e+--r],o=1;r>0&&(o*=256);)n+=this[e+--r]*o;return n};We.prototype.readUInt8=function(e,r){return e=e>>>0,r||Jn(e,1,this.length),this[e]};We.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Jn(e,2,this.length),this[e]|this[e+1]<<8};We.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Jn(e,2,this.length),this[e]<<8|this[e+1]};We.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Jn(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};We.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Jn(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};We.prototype.readIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Jn(e,r,this.length);for(var n=this[e],o=1,c=0;++c=o&&(n-=Math.pow(2,8*r)),n};We.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Jn(e,r,this.length);for(var n=r,o=1,c=this[e+--n];n>0&&(o*=256);)c+=this[e+--n]*o;return o*=128,c>=o&&(c-=Math.pow(2,8*r)),c};We.prototype.readInt8=function(e,r){return e=e>>>0,r||Jn(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};We.prototype.readInt16LE=function(e,r){e=e>>>0,r||Jn(e,2,this.length);var i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};We.prototype.readInt16BE=function(e,r){e=e>>>0,r||Jn(e,2,this.length);var i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};We.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Jn(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};We.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Jn(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};We.prototype.readFloatLE=function(e,r){return e=e>>>0,r||Jn(e,4,this.length),Sp.read(this,e,!0,23,4)};We.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Jn(e,4,this.length),Sp.read(this,e,!1,23,4)};We.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Jn(e,8,this.length),Sp.read(this,e,!0,52,8)};We.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Jn(e,8,this.length),Sp.read(this,e,!1,52,8)};function Wi(t,e,r,i,n,o){if(!We.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}We.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;Wi(this,e,r,i,o,0)}var c=1,u=0;for(this[r]=e&255;++u>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;Wi(this,e,r,i,o,0)}var c=i-1,u=1;for(this[r+c]=e&255;--c>=0&&(u*=256);)this[r+c]=e/u&255;return r+i};We.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||Wi(this,e,r,1,255,0),this[r]=e&255,r+1};We.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||Wi(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};We.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||Wi(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};We.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||Wi(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};We.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||Wi(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};We.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){var o=Math.pow(2,8*i-1);Wi(this,e,r,i,o-1,-o)}var c=0,u=1,d=0;for(this[r]=e&255;++c>0)-d&255;return r+i};We.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){var o=Math.pow(2,8*i-1);Wi(this,e,r,i,o-1,-o)}var c=i-1,u=1,d=0;for(this[r+c]=e&255;--c>=0&&(u*=256);)e<0&&d===0&&this[r+c+1]!==0&&(d=1),this[r+c]=(e/u>>0)-d&255;return r+i};We.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||Wi(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};We.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||Wi(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};We.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||Wi(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};We.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||Wi(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};We.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||Wi(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function _ee(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function wee(t,e,r,i,n){return e=+e,r=r>>>0,n||_ee(t,e,r,4,34028234663852886e22,-34028234663852886e22),Sp.write(t,e,r,i,23,4),r+4}We.prototype.writeFloatLE=function(e,r,i){return wee(this,e,r,!0,i)};We.prototype.writeFloatBE=function(e,r,i){return wee(this,e,r,!1,i)};function xee(t,e,r,i,n){return e=+e,r=r>>>0,n||_ee(t,e,r,8,17976931348623157e292,-17976931348623157e292),Sp.write(t,e,r,i,52,8),r+8}We.prototype.writeDoubleLE=function(e,r,i){return xee(this,e,r,!0,i)};We.prototype.writeDoubleBE=function(e,r,i){return xee(this,e,r,!1,i)};We.prototype.copy=function(e,r,i,n){if(!We.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r=0;--c)e[c+r]=this[c+i];else Uint8Array.prototype.set.call(e,this.subarray(i,n),r);return o};We.prototype.fill=function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!We.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){var o=e.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var c;if(typeof e=="number")for(c=r;c55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(c+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Y4e(t){for(var e=[],r=0;r>8,n=r%256,o.push(n),o.push(i);return o}function Eee(t){return fR.toByteArray(W4e(t))}function Vw(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Xa(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function gR(t){return t!==t}var J4e=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var i=r*16,n=0;n<16;++n)e[i+n]=t[r]+t[n];return e}()});var Iee=F((opt,eOe)=>{eOe.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"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:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,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"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var Pee=F((spt,Oee)=>{m();Oee.exports=Iee()});var Fee=F((apt,Bee)=>{"use strict";m();function Xs(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function Nee(t,e){for(var r="",i=0,n=-1,o=0,c,u=0;u<=t.length;++u){if(u2){var d=r.lastIndexOf("/");if(d!==r.length-1){d===-1?(r="",i=0):(r=r.slice(0,d),i=r.length-1-r.lastIndexOf("/")),n=u,o=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=u,o=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+t.slice(n+1,u):r=t.slice(n+1,u),i=u-n-1;n=u,o=0}else c===46&&o!==-1?++o:o=-1}return r}function tOe(t,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+t+i:i}var Tp={resolve:function(){for(var e="",r=!1,i,n=arguments.length-1;n>=-1&&!r;n--){var o;n>=0?o=arguments[n]:(i===void 0&&(i=C.cwd()),o=i),Xs(o),o.length!==0&&(e=o+"/"+e,r=o.charCodeAt(0)===47)}return e=Nee(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(Xs(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=Nee(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return Xs(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":Tp.normalize(e)},relative:function(e,r){if(Xs(e),Xs(r),e===r||(e=Tp.resolve(e),r=Tp.resolve(r),e===r))return"";for(var i=1;iy){if(r.charCodeAt(c+x)===47)return r.slice(c+x+1);if(x===0)return r.slice(c+x)}else o>y&&(e.charCodeAt(i+x)===47?E=x:x===0&&(E=0));break}var A=e.charCodeAt(i+x),R=r.charCodeAt(c+x);if(A!==R)break;A===47&&(E=x)}var M="";for(x=i+E+1;x<=n;++x)(x===n||e.charCodeAt(x)===47)&&(M.length===0?M+="..":M+="/..");return M.length>0?M+r.slice(c+E):(c+=E,r.charCodeAt(c)===47&&++c,r.slice(c))},_makeLong:function(e){return e},dirname:function(e){if(Xs(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,n=-1,o=!0,c=e.length-1;c>=1;--c)if(r=e.charCodeAt(c),r===47){if(!o){n=c;break}}else o=!1;return n===-1?i?"/":".":i&&n===1?"//":e.slice(0,n)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Xs(e);var i=0,n=-1,o=!0,c;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var u=r.length-1,d=-1;for(c=e.length-1;c>=0;--c){var y=e.charCodeAt(c);if(y===47){if(!o){i=c+1;break}}else d===-1&&(o=!1,d=c+1),u>=0&&(y===r.charCodeAt(u)?--u===-1&&(n=c):(u=-1,n=d))}return i===n?n=d:n===-1&&(n=e.length),e.slice(i,n)}else{for(c=e.length-1;c>=0;--c)if(e.charCodeAt(c)===47){if(!o){i=c+1;break}}else n===-1&&(o=!1,n=c+1);return n===-1?"":e.slice(i,n)}},extname:function(e){Xs(e);for(var r=-1,i=0,n=-1,o=!0,c=0,u=e.length-1;u>=0;--u){var d=e.charCodeAt(u);if(d===47){if(!o){i=u+1;break}continue}n===-1&&(o=!1,n=u+1),d===46?r===-1?r=u:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||n===-1||c===0||c===1&&r===n-1&&r===i+1?"":e.slice(r,n)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return tOe("/",e)},parse:function(e){Xs(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),n=i===47,o;n?(r.root="/",o=1):o=0;for(var c=-1,u=0,d=-1,y=!0,E=e.length-1,x=0;E>=o;--E){if(i=e.charCodeAt(E),i===47){if(!y){u=E+1;break}continue}d===-1&&(y=!1,d=E+1),i===46?c===-1?c=E:x!==1&&(x=1):c!==-1&&(x=-1)}return c===-1||d===-1||x===0||x===1&&c===d-1&&c===u+1?d!==-1&&(u===0&&n?r.base=r.name=e.slice(1,d):r.base=r.name=e.slice(u,d)):(u===0&&n?(r.name=e.slice(1,c),r.base=e.slice(1,d)):(r.name=e.slice(u,c),r.base=e.slice(u,d)),r.ext=e.slice(c,d)),u>0?r.dir=e.slice(0,u-1):n&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};Tp.posix=Tp;Bee.exports=Tp});var Uee=F(Yi=>{"use strict";m();var ex=Pee(),rOe=Fee().extname,Lee=/^\s*([^;\s]*)(?:;|\s|$)/,nOe=/^text\//i;Yi.charset=qee;Yi.charsets={lookup:qee};Yi.contentType=iOe;Yi.extension=oOe;Yi.extensions=Object.create(null);Yi.lookup=sOe;Yi.types=Object.create(null);aOe(Yi.extensions,Yi.types);function qee(t){if(!t||typeof t!="string")return!1;var e=Lee.exec(t),r=e&&ex[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&nOe.test(e[1])?"UTF-8":!1}function iOe(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Yi.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Yi.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}function oOe(t){if(!t||typeof t!="string")return!1;var e=Lee.exec(t),r=e&&Yi.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}function sOe(t){if(!t||typeof t!="string")return!1;var e=rOe("x."+t).toLowerCase().substr(1);return e&&Yi.types[e]||!1}function aOe(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(ex).forEach(function(n){var o=ex[n],c=o.extensions;if(!(!c||!c.length)){t[n]=c;for(var u=0;uE||y===E&&e[d].substr(0,12)==="application/"))continue}e[d]=n}}})}});var jee=F(()=>{m()});var IR=F(Rp=>{"use strict";m();Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Queue=Rp.Stack=void 0;var DR=class{constructor(e){e===void 0?(this.stackBack=[],this.length=0):(this.stackBack=[...e],this.length=this.stackBack.length)}push(e){this.stackBack.push(e),this.length+=1}pop(){if(this.length!==0)return this.length-=1,this.stackBack.pop()}size(){return this.length}back(){if(this.length!==0)return this.stackBack[this.stackBack.length-1]}};Rp.Stack=DR;var kR=class{constructor(e){if(e===void 0)this.stackBack=[],this.stackFront=[],this.length=0;else{this.stackFront=[];for(let r=e.length-1;r>=0;r--)this.stackFront.push(e[r]);this.stackBack=[],this.length=this.stackFront.length}}push(e){this.stackBack.push(e),this.length+=1}pop(){if(this.length!==0){if(this.stackFront.length===0)for(;this.stackBack.length>0;)this.stackFront.push(this.stackBack.pop());return this.length-=1,this.stackFront.pop()}}shift(){return this.pop()}size(){return this.length}front(){if(this.length!==0){if(this.stackFront.length===0)for(;this.stackBack.length>0;)this.stackFront.push(this.stackBack.pop());return this.stackFront[this.stackFront.length-1]}}back(){if(this.length!==0)return this.stackBack.length>0?this.stackBack[this.stackBack.length-1]:this.stackFront[0]}};Rp.Queue=kR});var Zee=F((Upt,Xee)=>{m();function gOe(t,e,r){var i=-1,n=t.length;e<0&&(e=-e>n?0:n+e),r=r>n?n:r,r<0&&(r+=n),n=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(n);++i{m();var yOe=Fp(),vOe=Xg(),bOe=eE(),_Oe=nc();function wOe(t,e,r){if(!_Oe(r))return!1;var i=typeof e;return(i=="number"?vOe(r)&&bOe(e,r.length):i=="string"&&e in r)?yOe(r[e],t):!1}ete.exports=wOe});var nte=F((zpt,rte)=>{m();var xOe=/\s/;function EOe(t){for(var e=t.length;e--&&xOe.test(t.charAt(e)););return e}rte.exports=EOe});var ote=F((Hpt,ite)=>{m();var SOe=nte(),COe=/^\s+/;function AOe(t){return t&&t.slice(0,SOe(t)+1).replace(COe,"")}ite.exports=AOe});var ate=F(($pt,ste)=>{m();var TOe=Vf(),MOe=oc(),ROe="[object Symbol]";function DOe(t){return typeof t=="symbol"||MOe(t)&&TOe(t)==ROe}ste.exports=DOe});var fte=F((Gpt,lte)=>{m();var kOe=ote(),cte=nc(),IOe=ate(),ute=0/0,OOe=/^[-+]0x[0-9a-f]+$/i,POe=/^0b[01]+$/i,NOe=/^0o[0-7]+$/i,BOe=parseInt;function FOe(t){if(typeof t=="number")return t;if(IOe(t))return ute;if(cte(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=cte(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=kOe(t);var r=POe.test(t);return r||NOe.test(t)?BOe(t.slice(2),r?2:8):OOe.test(t)?ute:+t}lte.exports=FOe});var pte=F((Kpt,hte)=>{m();var LOe=fte(),dte=1/0,qOe=17976931348623157e292;function UOe(t){if(!t)return t===0?t:0;if(t=LOe(t),t===dte||t===-dte){var e=t<0?-1:1;return e*qOe}return t===t?t:0}hte.exports=UOe});var gte=F((Vpt,mte)=>{m();var jOe=pte();function zOe(t){var e=jOe(t),r=e%1;return e===e?r?e-r:e:0}mte.exports=zOe});var OR=F((Wpt,yte)=>{m();var HOe=Zee(),$Oe=tte(),GOe=gte(),KOe=Math.ceil,VOe=Math.max;function WOe(t,e,r){(r?$Oe(t,e,r):e===void 0)?e=1:e=VOe(GOe(e),0);var i=t==null?0:t.length;if(!i||e<1)return[];for(var n=0,o=0,c=Array(KOe(i/e));n{m();var vte=Kf(),YOe=Zx(),QOe=Jf(),bte=vte?vte.isConcatSpreadable:void 0;function JOe(t){return QOe(t)||YOe(t)||!!(bte&&t&&t[bte])}_te.exports=JOe});var Ste=F((Qpt,Ete)=>{m();var XOe=ry(),ZOe=wte();function xte(t,e,r,i,n){var o=-1,c=t.length;for(r||(r=ZOe),n||(n=[]);++o0&&r(u)?e>1?xte(u,e-1,r,i,n):XOe(n,u):i||(n[n.length]=u)}return n}Ete.exports=xte});var PR=F((Jpt,Cte)=>{m();var e8e=Ste();function t8e(t){var e=t==null?0:t.length;return e?e8e(t,1):[]}Cte.exports=t8e});var LR=F((nx,FR)=>{m();(function(t,e){typeof nx=="object"&&typeof FR=="object"?FR.exports=e():typeof define=="function"&&define.amd?define([],e):typeof nx=="object"?nx.WebDAV=e():t.WebDAV=e()})(self,()=>(()=>{var t={5056:(n,o,c)=>{n.exports=c(203)},3198:(n,o,c)=>{"use strict";var u=c(3401),d=c(5888),y=c(4963),E=c(8826),x=c(4466),A=c(8418),R=c(6130),M=c(8760),I=c(4200),D=c(2800),O=c(4830);n.exports=function(N){return new Promise(function(L,j){var H,Y=N.data,W=N.headers,q=N.responseType;function J(){N.cancelToken&&N.cancelToken.unsubscribe(H),N.signal&&N.signal.removeEventListener("abort",H)}u.isFormData(Y)&&u.isStandardBrowserEnv()&&delete W["Content-Type"];var _=new XMLHttpRequest;if(N.auth){var s=N.auth.username||"",l=N.auth.password?unescape(encodeURIComponent(N.auth.password)):"";W.Authorization="Basic "+btoa(s+":"+l)}var p=x(N.baseURL,N.url);function f(){if(_){var w="getAllResponseHeaders"in _?A(_.getAllResponseHeaders()):null,g={data:q&&q!=="text"&&q!=="json"?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:w,config:N,request:_};d(function(a){L(a),J()},function(a){j(a),J()},g),_=null}}if(_.open(N.method.toUpperCase(),E(p,N.params,N.paramsSerializer),!0),_.timeout=N.timeout,"onloadend"in _?_.onloadend=f:_.onreadystatechange=function(){_&&_.readyState===4&&(_.status!==0||_.responseURL&&_.responseURL.indexOf("file:")===0)&&setTimeout(f)},_.onabort=function(){_&&(j(new I("Request aborted",I.ECONNABORTED,N,_)),_=null)},_.onerror=function(){j(new I("Network Error",I.ERR_NETWORK,N,_,_)),_=null},_.ontimeout=function(){var w=N.timeout?"timeout of "+N.timeout+"ms exceeded":"timeout exceeded",g=N.transitional||M;N.timeoutErrorMessage&&(w=N.timeoutErrorMessage),j(new I(w,g.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,N,_)),_=null},u.isStandardBrowserEnv()){var h=(N.withCredentials||R(p))&&N.xsrfCookieName?y.read(N.xsrfCookieName):void 0;h&&(W[N.xsrfHeaderName]=h)}"setRequestHeader"in _&&u.forEach(W,function(w,g){Y===void 0&&g.toLowerCase()==="content-type"?delete W[g]:_.setRequestHeader(g,w)}),u.isUndefined(N.withCredentials)||(_.withCredentials=!!N.withCredentials),q&&q!=="json"&&(_.responseType=N.responseType),typeof N.onDownloadProgress=="function"&&_.addEventListener("progress",N.onDownloadProgress),typeof N.onUploadProgress=="function"&&_.upload&&_.upload.addEventListener("progress",N.onUploadProgress),(N.cancelToken||N.signal)&&(H=function(w){_&&(j(!w||w&&w.type?new D:w),_.abort(),_=null)},N.cancelToken&&N.cancelToken.subscribe(H),N.signal&&(N.signal.aborted?H():N.signal.addEventListener("abort",H))),Y||(Y=null);var b=O(p);b&&["http","https","file"].indexOf(b)===-1?j(new I("Unsupported protocol "+b+":",I.ERR_BAD_REQUEST,N)):_.send(Y)})}},203:(n,o,c)=>{"use strict";var u=c(3401),d=c(9366),y=c(1112),E=c(3674),x=function A(R){var M=new y(R),I=d(y.prototype.request,M);return u.extend(I,y.prototype,M),u.extend(I,M),I.create=function(D){return A(E(R,D))},I}(c(9050));x.Axios=y,x.CanceledError=c(2800),x.CancelToken=c(4078),x.isCancel=c(1907),x.VERSION=c(8963).version,x.toFormData=c(7427),x.AxiosError=c(4200),x.Cancel=x.CanceledError,x.all=function(A){return Promise.all(A)},x.spread=c(7998),x.isAxiosError=c(1720),n.exports=x,n.exports.default=x},4078:(n,o,c)=>{"use strict";var u=c(2800);function d(y){if(typeof y!="function")throw new TypeError("executor must be a function.");var E;this.promise=new Promise(function(A){E=A});var x=this;this.promise.then(function(A){if(x._listeners){var R,M=x._listeners.length;for(R=0;R{"use strict";var u=c(4200);function d(y){u.call(this,y??"canceled",u.ERR_CANCELED),this.name="CanceledError"}c(3401).inherits(d,u,{__CANCEL__:!0}),n.exports=d},1907:n=>{"use strict";n.exports=function(o){return!(!o||!o.__CANCEL__)}},1112:(n,o,c)=>{"use strict";var u=c(3401),d=c(8826),y=c(9655),E=c(4412),x=c(3674),A=c(4466),R=c(3465),M=R.validators;function I(D){this.defaults=D,this.interceptors={request:new y,response:new y}}I.prototype.request=function(D,O){typeof D=="string"?(O=O||{}).url=D:O=D||{},(O=x(this.defaults,O)).method?O.method=O.method.toLowerCase():this.defaults.method?O.method=this.defaults.method.toLowerCase():O.method="get";var N=O.transitional;N!==void 0&&R.assertOptions(N,{silentJSONParsing:M.transitional(M.boolean),forcedJSONParsing:M.transitional(M.boolean),clarifyTimeoutError:M.transitional(M.boolean)},!1);var L=[],j=!0;this.interceptors.request.forEach(function(s){typeof s.runWhen=="function"&&s.runWhen(O)===!1||(j=j&&s.synchronous,L.unshift(s.fulfilled,s.rejected))});var H,Y=[];if(this.interceptors.response.forEach(function(s){Y.push(s.fulfilled,s.rejected)}),!j){var W=[E,void 0];for(Array.prototype.unshift.apply(W,L),W=W.concat(Y),H=Promise.resolve(O);W.length;)H=H.then(W.shift(),W.shift());return H}for(var q=O;L.length;){var J=L.shift(),_=L.shift();try{q=J(q)}catch(s){_(s);break}}try{H=E(q)}catch(s){return Promise.reject(s)}for(;Y.length;)H=H.then(Y.shift(),Y.shift());return H},I.prototype.getUri=function(D){D=x(this.defaults,D);var O=A(D.baseURL,D.url);return d(O,D.params,D.paramsSerializer)},u.forEach(["delete","get","head","options"],function(D){I.prototype[D]=function(O,N){return this.request(x(N||{},{method:D,url:O,data:(N||{}).data}))}}),u.forEach(["post","put","patch"],function(D){function O(N){return function(L,j,H){return this.request(x(H||{},{method:D,headers:N?{"Content-Type":"multipart/form-data"}:{},url:L,data:j}))}}I.prototype[D]=O(),I.prototype[D+"Form"]=O(!0)}),n.exports=I},4200:(n,o,c)=>{"use strict";var u=c(3401);function d(x,A,R,M,I){Error.call(this),this.message=x,this.name="AxiosError",A&&(this.code=A),R&&(this.config=R),M&&(this.request=M),I&&(this.response=I)}u.inherits(d,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var y=d.prototype,E={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(x){E[x]={value:x}}),Object.defineProperties(d,E),Object.defineProperty(y,"isAxiosError",{value:!0}),d.from=function(x,A,R,M,I,D){var O=Object.create(y);return u.toFlatObject(x,O,function(N){return N!==Error.prototype}),d.call(O,x.message,A,R,M,I),O.name=x.name,D&&Object.assign(O,D),O},n.exports=d},9655:(n,o,c)=>{"use strict";var u=c(3401);function d(){this.handlers=[]}d.prototype.use=function(y,E,x){return this.handlers.push({fulfilled:y,rejected:E,synchronous:!!x&&x.synchronous,runWhen:x?x.runWhen:null}),this.handlers.length-1},d.prototype.eject=function(y){this.handlers[y]&&(this.handlers[y]=null)},d.prototype.forEach=function(y){u.forEach(this.handlers,function(E){E!==null&&y(E)})},n.exports=d},4466:(n,o,c)=>{"use strict";var u=c(4206),d=c(7955);n.exports=function(y,E){return y&&!u(E)?d(y,E):E}},4412:(n,o,c)=>{"use strict";var u=c(3401),d=c(8092),y=c(1907),E=c(9050),x=c(2800);function A(R){if(R.cancelToken&&R.cancelToken.throwIfRequested(),R.signal&&R.signal.aborted)throw new x}n.exports=function(R){return A(R),R.headers=R.headers||{},R.data=d.call(R,R.data,R.headers,R.transformRequest),R.headers=u.merge(R.headers.common||{},R.headers[R.method]||{},R.headers),u.forEach(["delete","get","head","post","put","patch","common"],function(M){delete R.headers[M]}),(R.adapter||E.adapter)(R).then(function(M){return A(R),M.data=d.call(R,M.data,M.headers,R.transformResponse),M},function(M){return y(M)||(A(R),M&&M.response&&(M.response.data=d.call(R,M.response.data,M.response.headers,R.transformResponse))),Promise.reject(M)})}},3674:(n,o,c)=>{"use strict";var u=c(3401);n.exports=function(d,y){y=y||{};var E={};function x(O,N){return u.isPlainObject(O)&&u.isPlainObject(N)?u.merge(O,N):u.isPlainObject(N)?u.merge({},N):u.isArray(N)?N.slice():N}function A(O){return u.isUndefined(y[O])?u.isUndefined(d[O])?void 0:x(void 0,d[O]):x(d[O],y[O])}function R(O){if(!u.isUndefined(y[O]))return x(void 0,y[O])}function M(O){return u.isUndefined(y[O])?u.isUndefined(d[O])?void 0:x(void 0,d[O]):x(void 0,y[O])}function I(O){return O in y?x(d[O],y[O]):O in d?x(void 0,d[O]):void 0}var D={url:R,method:R,data:R,baseURL:M,transformRequest:M,transformResponse:M,paramsSerializer:M,timeout:M,timeoutMessage:M,withCredentials:M,adapter:M,responseType:M,xsrfCookieName:M,xsrfHeaderName:M,onUploadProgress:M,onDownloadProgress:M,decompress:M,maxContentLength:M,maxBodyLength:M,beforeRedirect:M,transport:M,httpAgent:M,httpsAgent:M,cancelToken:M,socketPath:M,responseEncoding:M,validateStatus:I};return u.forEach(Object.keys(d).concat(Object.keys(y)),function(O){var N=D[O]||A,L=N(O);u.isUndefined(L)&&N!==I||(E[O]=L)}),E}},5888:(n,o,c)=>{"use strict";var u=c(4200);n.exports=function(d,y,E){var x=E.config.validateStatus;E.status&&x&&!x(E.status)?y(new u("Request failed with status code "+E.status,[u.ERR_BAD_REQUEST,u.ERR_BAD_RESPONSE][Math.floor(E.status/100)-4],E.config,E.request,E)):d(E)}},8092:(n,o,c)=>{"use strict";var u=c(3401),d=c(9050);n.exports=function(y,E,x){var A=this||d;return u.forEach(x,function(R){y=R.call(A,y,E)}),y}},9050:(n,o,c)=>{"use strict";var u=c(3401),d=c(5854),y=c(4200),E=c(8760),x=c(7427),A={"Content-Type":"application/x-www-form-urlencoded"};function R(D,O){!u.isUndefined(D)&&u.isUndefined(D["Content-Type"])&&(D["Content-Type"]=O)}var M,I={transitional:E,adapter:((typeof XMLHttpRequest<"u"||typeof C<"u"&&Object.prototype.toString.call(C)==="[object process]")&&(M=c(3198)),M),transformRequest:[function(D,O){if(d(O,"Accept"),d(O,"Content-Type"),u.isFormData(D)||u.isArrayBuffer(D)||u.isBuffer(D)||u.isStream(D)||u.isFile(D)||u.isBlob(D))return D;if(u.isArrayBufferView(D))return D.buffer;if(u.isURLSearchParams(D))return R(O,"application/x-www-form-urlencoded;charset=utf-8"),D.toString();var N,L=u.isObject(D),j=O&&O["Content-Type"];if((N=u.isFileList(D))||L&&j==="multipart/form-data"){var H=this.env&&this.env.FormData;return x(N?{"files[]":D}:D,H&&new H)}return L||j==="application/json"?(R(O,"application/json"),function(Y,W,q){if(u.isString(Y))try{return(0,JSON.parse)(Y),u.trim(Y)}catch(J){if(J.name!=="SyntaxError")throw J}return(0,JSON.stringify)(Y)}(D)):D}],transformResponse:[function(D){var O=this.transitional||I.transitional,N=O&&O.silentJSONParsing,L=O&&O.forcedJSONParsing,j=!N&&this.responseType==="json";if(j||L&&u.isString(D)&&D.length)try{return JSON.parse(D)}catch(H){if(j)throw H.name==="SyntaxError"?y.from(H,y.ERR_BAD_RESPONSE,this,null,this.response):H}return D}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:c(846)},validateStatus:function(D){return D>=200&&D<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};u.forEach(["delete","get","head"],function(D){I.headers[D]={}}),u.forEach(["post","put","patch"],function(D){I.headers[D]=u.merge(A)}),n.exports=I},8760:n=>{"use strict";n.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},8963:n=>{n.exports={version:"0.27.2"}},9366:n=>{"use strict";n.exports=function(o,c){return function(){for(var u=new Array(arguments.length),d=0;d{"use strict";var u=c(3401);function d(y){return encodeURIComponent(y).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}n.exports=function(y,E,x){if(!E)return y;var A;if(x)A=x(E);else if(u.isURLSearchParams(E))A=E.toString();else{var R=[];u.forEach(E,function(I,D){I!=null&&(u.isArray(I)?D+="[]":I=[I],u.forEach(I,function(O){u.isDate(O)?O=O.toISOString():u.isObject(O)&&(O=JSON.stringify(O)),R.push(d(D)+"="+d(O))}))}),A=R.join("&")}if(A){var M=y.indexOf("#");M!==-1&&(y=y.slice(0,M)),y+=(y.indexOf("?")===-1?"?":"&")+A}return y}},7955:n=>{"use strict";n.exports=function(o,c){return c?o.replace(/\/+$/,"")+"/"+c.replace(/^\/+/,""):o}},4963:(n,o,c)=>{"use strict";var u=c(3401);n.exports=u.isStandardBrowserEnv()?{write:function(d,y,E,x,A,R){var M=[];M.push(d+"="+encodeURIComponent(y)),u.isNumber(E)&&M.push("expires="+new Date(E).toGMTString()),u.isString(x)&&M.push("path="+x),u.isString(A)&&M.push("domain="+A),R===!0&&M.push("secure"),document.cookie=M.join("; ")},read:function(d){var y=document.cookie.match(new RegExp("(^|;\\s*)("+d+")=([^;]*)"));return y?decodeURIComponent(y[3]):null},remove:function(d){this.write(d,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},4206:n=>{"use strict";n.exports=function(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}},1720:(n,o,c)=>{"use strict";var u=c(3401);n.exports=function(d){return u.isObject(d)&&d.isAxiosError===!0}},6130:(n,o,c)=>{"use strict";var u=c(3401);n.exports=u.isStandardBrowserEnv()?function(){var d,y=/(msie|trident)/i.test(navigator.userAgent),E=document.createElement("a");function x(A){var R=A;return y&&(E.setAttribute("href",R),R=E.href),E.setAttribute("href",R),{href:E.href,protocol:E.protocol?E.protocol.replace(/:$/,""):"",host:E.host,search:E.search?E.search.replace(/^\?/,""):"",hash:E.hash?E.hash.replace(/^#/,""):"",hostname:E.hostname,port:E.port,pathname:E.pathname.charAt(0)==="/"?E.pathname:"/"+E.pathname}}return d=x(window.location.href),function(A){var R=u.isString(A)?x(A):A;return R.protocol===d.protocol&&R.host===d.host}}():function(){return!0}},5854:(n,o,c)=>{"use strict";var u=c(3401);n.exports=function(d,y){u.forEach(d,function(E,x){x!==y&&x.toUpperCase()===y.toUpperCase()&&(d[y]=E,delete d[x])})}},846:n=>{n.exports=null},8418:(n,o,c)=>{"use strict";var u=c(3401),d=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];n.exports=function(y){var E,x,A,R={};return y&&u.forEach(y.split(` -`),function(M){if(A=M.indexOf(":"),E=u.trim(M.substr(0,A)).toLowerCase(),x=u.trim(M.substr(A+1)),E){if(R[E]&&d.indexOf(E)>=0)return;R[E]=E==="set-cookie"?(R[E]?R[E]:[]).concat([x]):R[E]?R[E]+", "+x:x}}),R}},4830:n=>{"use strict";n.exports=function(o){var c=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return c&&c[1]||""}},7998:n=>{"use strict";n.exports=function(o){return function(c){return o.apply(null,c)}}},7427:(n,o,c)=>{"use strict";function u(y){return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},u(y)}var d=c(3401);n.exports=function(y,E){E=E||new FormData;var x=[];function A(R){return R===null?"":d.isDate(R)?R.toISOString():d.isArrayBuffer(R)||d.isTypedArray(R)?typeof Blob=="function"?new Blob([R]):T.from(R):R}return function R(M,I){if(d.isPlainObject(M)||d.isArray(M)){if(x.indexOf(M)!==-1)throw Error("Circular reference detected in "+I);x.push(M),d.forEach(M,function(D,O){if(!d.isUndefined(D)){var N,L=I?I+"."+O:O;if(D&&!I&&u(D)==="object"){if(d.endsWith(O,"{}"))D=JSON.stringify(D);else if(d.endsWith(O,"[]")&&(N=d.toArray(D)))return void N.forEach(function(j){!d.isUndefined(j)&&E.append(L,A(j))})}R(D,L)}}),x.pop()}else E.append(I,A(M))}(y),E}},3465:(n,o,c)=>{"use strict";function u(A){return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},u(A)}var d=c(8963).version,y=c(4200),E={};["object","boolean","number","function","string","symbol"].forEach(function(A,R){E[A]=function(M){return u(M)===A||"a"+(R<1?"n ":" ")+A}});var x={};E.transitional=function(A,R,M){function I(D,O){return"[Axios v"+d+"] Transitional option '"+D+"'"+O+(M?". "+M:"")}return function(D,O,N){if(A===!1)throw new y(I(O," has been removed"+(R?" in "+R:"")),y.ERR_DEPRECATED);return R&&!x[O]&&(x[O]=!0,console.warn(I(O," has been deprecated since v"+R+" and will be removed in the near future"))),!A||A(D,O,N)}},n.exports={assertOptions:function(A,R,M){if(u(A)!=="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);for(var I=Object.keys(A),D=I.length;D-- >0;){var O=I[D],N=R[O];if(N){var L=A[O],j=L===void 0||N(L,O,A);if(j!==!0)throw new y("option "+O+" must be "+j,y.ERR_BAD_OPTION_VALUE)}else if(M!==!0)throw new y("Unknown option "+O,y.ERR_BAD_OPTION)}},validators:E}},3401:(n,o,c)=>{"use strict";function u(s){return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},u(s)}var d,y=c(9366),E=Object.prototype.toString,x=(d=Object.create(null),function(s){var l=E.call(s);return d[l]||(d[l]=l.slice(8,-1).toLowerCase())});function A(s){return s=s.toLowerCase(),function(l){return x(l)===s}}function R(s){return Array.isArray(s)}function M(s){return s===void 0}var I=A("ArrayBuffer");function D(s){return s!==null&&u(s)==="object"}function O(s){if(x(s)!=="object")return!1;var l=Object.getPrototypeOf(s);return l===null||l===Object.prototype}var N=A("Date"),L=A("File"),j=A("Blob"),H=A("FileList");function Y(s){return E.call(s)==="[object Function]"}var W=A("URLSearchParams");function q(s,l){if(s!=null)if(u(s)!=="object"&&(s=[s]),R(s))for(var p=0,f=s.length;p"u"||navigator.product!=="ReactNative"&&navigator.product!=="NativeScript"&&navigator.product!=="NS")&&typeof window<"u"&&typeof document<"u"},forEach:q,merge:function s(){var l={};function p(b,w){O(l[w])&&O(b)?l[w]=s(l[w],b):O(b)?l[w]=s({},b):R(b)?l[w]=b.slice():l[w]=b}for(var f=0,h=arguments.length;f0;)w[b=f[h]]||(l[b]=s[b],w[b]=!0);s=Object.getPrototypeOf(s)}while(s&&(!p||p(s,l))&&s!==Object.prototype);return l},kindOf:x,kindOfTest:A,endsWith:function(s,l,p){s=String(s),(p===void 0||p>s.length)&&(p=s.length),p-=l.length;var f=s.indexOf(l,p);return f!==-1&&f===p},toArray:function(s){if(!s)return null;var l=s.length;if(M(l))return null;for(var p=new Array(l);l-- >0;)p[l]=s[l];return p},isTypedArray:_,isFileList:H}},9584:n=>{"use strict";function o(d,y,E){d instanceof RegExp&&(d=c(d,E)),y instanceof RegExp&&(y=c(y,E));var x=u(d,y,E);return x&&{start:x[0],end:x[1],pre:E.slice(0,x[0]),body:E.slice(x[0]+d.length,x[1]),post:E.slice(x[1]+y.length)}}function c(d,y){var E=y.match(d);return E?E[0]:null}function u(d,y,E){var x,A,R,M,I,D=E.indexOf(d),O=E.indexOf(y,D+1),N=D;if(D>=0&&O>0){for(x=[],R=E.length;N>=0&&!I;)N==D?(x.push(N),D=E.indexOf(d,N+1)):x.length==1?I=[x.pop(),O]:((A=x.pop())=0?D:O;x.length&&(I=[R,M])}return I}n.exports=o,o.range=u},9146:function(n,o,c){var u;function d(y){return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},d(y)}n=c.nmd(n),function(y){var E=d(o)=="object"&&o,x=d(n)=="object"&&n&&n.exports==E&&n,A=(typeof window>"u"?"undefined":d(window))=="object"&&window;A.global!==A&&A.window!==A||(y=A);var R=function(L){this.message=L};(R.prototype=new Error).name="InvalidCharacterError";var M=function(L){throw new R(L)},I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=/[\t\n\f\r ]/g,O={encode:function(L){L=String(L),/[^\0-\xFF]/.test(L)&&M("The string to be encoded contains characters outside of the Latin1 range.");for(var j,H,Y,W,q=L.length%3,J="",_=-1,s=L.length-q;++_>18&63)+I.charAt(W>>12&63)+I.charAt(W>>6&63)+I.charAt(63&W);return q==2?(j=L.charCodeAt(_)<<8,H=L.charCodeAt(++_),J+=I.charAt((W=j+H)>>10)+I.charAt(W>>4&63)+I.charAt(W<<2&63)+"="):q==1&&(W=L.charCodeAt(_),J+=I.charAt(W>>2)+I.charAt(W<<4&63)+"=="),J},decode:function(L){var j=(L=String(L).replace(D,"")).length;j%4==0&&(j=(L=L.replace(/==?$/,"")).length),(j%4==1||/[^+a-zA-Z0-9/]/.test(L))&&M("Invalid character: the string to be decoded is not correctly encoded.");for(var H,Y,W=0,q="",J=-1;++J>(-2*W&6)));return q},version:"1.0.0"};if(d(c.amdO)=="object"&&c.amdO)(u=function(){return O}.call(o,c,o,n))===void 0||(n.exports=u);else if(E&&!E.nodeType)if(x)x.exports=O;else for(var N in O)O.hasOwnProperty(N)&&(E[N]=O[N]);else y.base64=O}(this)},8918:(n,o)=>{"use strict";o.k=function(c){if(!c)return 0;for(var u=(c=c.toString()).length,d=c.length;d--;){var y=c.charCodeAt(d);56320<=y&&y<=57343&&d--,127{var o={utf8:{stringToBytes:function(c){return o.bin.stringToBytes(unescape(encodeURIComponent(c)))},bytesToString:function(c){return decodeURIComponent(escape(o.bin.bytesToString(c)))}},bin:{stringToBytes:function(c){for(var u=[],d=0;d{var o,c;o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c={rotl:function(u,d){return u<>>32-d},rotr:function(u,d){return u<<32-d|u>>>d},endian:function(u){if(u.constructor==Number)return 16711935&c.rotl(u,8)|4278255360&c.rotl(u,24);for(var d=0;d0;u--)d.push(Math.floor(256*Math.random()));return d},bytesToWords:function(u){for(var d=[],y=0,E=0;y>>5]|=u[y]<<24-E%32;return d},wordsToBytes:function(u){for(var d=[],y=0;y<32*u.length;y+=8)d.push(u[y>>>5]>>>24-y%32&255);return d},bytesToHex:function(u){for(var d=[],y=0;y>>4).toString(16)),d.push((15&u[y]).toString(16));return d.join("")},hexToBytes:function(u){for(var d=[],y=0;y>>6*(3-x)&63)):d.push("=");return d.join("")},base64ToBytes:function(u){u=u.replace(/[^A-Z0-9+\/]/gi,"");for(var d=[],y=0,E=0;y>>6-2*E);return d}},n.exports=c},5:(n,o,c)=>{"use strict";var u=c(1135),d=c(586),y=c(4039);n.exports={XMLParser:d,XMLValidator:u,XMLBuilder:y}},6410:(n,o)=>{"use strict";var c="[: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][: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\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",u=new RegExp("^"+c+"$");o.isExist=function(d){return d!==void 0},o.isEmptyObject=function(d){return Object.keys(d).length===0},o.merge=function(d,y,E){if(y)for(var x=Object.keys(y),A=x.length,R=0;R{"use strict";var u=c(6410),d={allowBooleanAttributes:!1,unpairedTags:[]};function y(j){return j===" "||j===" "||j===` -`||j==="\r"}function E(j,H){for(var Y=H;H5&&W==="xml")return D("InvalidXml","XML declaration allowed only at the start of the document.",N(j,H));if(j[H]=="?"&&j[H+1]==">"){H++;break}}return H}function x(j,H){if(j.length>H+5&&j[H+1]==="-"&&j[H+2]==="-"){for(H+=3;H"){H+=2;break}}else if(j.length>H+8&&j[H+1]==="D"&&j[H+2]==="O"&&j[H+3]==="C"&&j[H+4]==="T"&&j[H+5]==="Y"&&j[H+6]==="P"&&j[H+7]==="E"){var Y=1;for(H+=8;H"&&--Y==0)break}else if(j.length>H+9&&j[H+1]==="["&&j[H+2]==="C"&&j[H+3]==="D"&&j[H+4]==="A"&&j[H+5]==="T"&&j[H+6]==="A"&&j[H+7]==="["){for(H+=8;H"){H+=2;break}}return H}function A(j,H){for(var Y="",W="",q=!1;H"&&W===""){q=!0;break}Y+=j[H]}return W===""&&{value:Y,index:H,tagClosed:q}}o.validate=function(j,H){H=Object.assign({},d,H);var Y,W=[],q=!1,J=!1;j[0]==="\uFEFF"&&(j=j.substr(1));for(var _=0;_"&&j[_]!==" "&&j[_]!==" "&&j[_]!==` -`&&j[_]!=="\r";_++)p+=j[_];if((p=p.trim())[p.length-1]==="/"&&(p=p.substring(0,p.length-1),_--),Y=p,!u.isName(Y))return D("InvalidTag",p.trim().length===0?"Invalid space after '<'.":"Tag '"+p+"' is an invalid name.",N(j,_));var f=A(j,_);if(f===!1)return D("InvalidAttr","Attributes for '"+p+"' have open quote.",N(j,_));var h=f.value;if(_=f.index,h[h.length-1]==="/"){var b=_-h.length,w=M(h=h.substring(0,h.length-1),H);if(w!==!0)return D(w.err.code,w.err.msg,N(j,b+w.err.line));q=!0}else if(l){if(!f.tagClosed)return D("InvalidTag","Closing tag '"+p+"' doesn't have proper closing.",N(j,_));if(h.trim().length>0)return D("InvalidTag","Closing tag '"+p+"' can't have attributes or invalid starting.",N(j,s));var g=W.pop();if(p!==g.tagName){var a=N(j,g.tagStartPos);return D("InvalidTag","Expected closing tag '"+g.tagName+"' (opened in line "+a.line+", col "+a.col+") instead of closing tag '"+p+"'.",N(j,s))}W.length==0&&(J=!0)}else{var v=M(h,H);if(v!==!0)return D(v.err.code,v.err.msg,N(j,_-h.length+v.err.line));if(J===!0)return D("InvalidXml","Multiple possible root nodes found.",N(j,_));H.unpairedTags.indexOf(p)!==-1||W.push({tagName:p,tagStartPos:s}),q=!0}for(_++;_0)||D("InvalidXml","Invalid '"+JSON.stringify(W.map(function(k){return k.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):D("InvalidXml","Start tag expected.",1)};var R=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function M(j,H){for(var Y=u.getAllMatches(j,R),W={},q=0;q{"use strict";function u(M){return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(I){return typeof I}:function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},u(M)}var d=c(7354),y={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(M,I){return I},attributeValueProcessor:function(M,I){return I},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function E(M){this.options=Object.assign({},y,M),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=R),this.processTextOrObjNode=x,this.options.format?(this.indentate=A,this.tagEndChar=`> -`,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function x(M,I,D){var O=this.j2x(M,D+1);return M[this.options.textNodeName]!==void 0&&Object.keys(M).length===1?this.buildTextValNode(M[this.options.textNodeName],I,O.attrStr,D):this.buildObjectNode(O.val,I,O.attrStr,D)}function A(M){return this.options.indentBy.repeat(M)}function R(M){return!!M.startsWith(this.options.attributeNamePrefix)&&M.substr(this.attrPrefixLen)}E.prototype.build=function(M){return this.options.preserveOrder?d(M,this.options):(Array.isArray(M)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(I={},O=M,(D=this.options.arrayNodeName)in I?Object.defineProperty(I,D,{value:O,enumerable:!0,configurable:!0,writable:!0}):I[D]=O,M=I),this.j2x(M,0).val);var I,D,O},E.prototype.j2x=function(M,I){var D="",O="";for(var N in M)if(M[N]!==void 0)if(M[N]===null)N[0]==="?"?O+=this.indentate(I)+"<"+N+"?"+this.tagEndChar:O+=this.indentate(I)+"<"+N+"/"+this.tagEndChar;else if(M[N]instanceof Date)O+=this.buildTextValNode(M[N],N,"",I);else if(u(M[N])!=="object"){var L=this.isAttribute(N);if(L)D+=this.buildAttrPairStr(L,""+M[N]);else if(N===this.options.textNodeName){var j=this.options.tagValueProcessor(N,""+M[N]);O+=this.replaceEntitiesValue(j)}else O+=this.buildTextValNode(M[N],N,"",I)}else if(Array.isArray(M[N])){for(var H=M[N].length,Y="",W=0;W"+M+N:this.options.commentPropName!==!1&&I===this.options.commentPropName&&L.length===0?this.indentate(O)+"")+this.newLine:this.indentate(O)+"<"+I+D+L+this.tagEndChar+M+this.indentate(O)+N},E.prototype.closeTag=function(M){var I="";return this.options.unpairedTags.indexOf(M)!==-1?this.options.suppressUnpairedNode||(I="/"):I=this.options.suppressEmptyNode?"/":">")+this.newLine;if(this.options.commentPropName!==!1&&I===this.options.commentPropName)return this.indentate(O)+"")+this.newLine;if(I[0]==="?")return this.indentate(O)+"<"+I+D+"?"+this.tagEndChar;var N=this.options.tagValueProcessor(I,M);return(N=this.replaceEntitiesValue(N))===""?this.indentate(O)+"<"+I+D+this.closeTag(I)+this.tagEndChar:this.indentate(O)+"<"+I+D+">"+N+"0&&this.options.processEntities)for(var I=0;I{function o(E,x,A,R){for(var M="",I=!1,D=0;D":M+=Y+"/>":W&&W.length!==0||!x.suppressEmptyNode?W&&W.endsWith(">")?M+=Y+">".concat(W).concat(R,""):(M+=Y+">",W&&R!==""&&(W.includes("/>")||W.includes("")):M+=Y+"/>",I=!0}else{var q=u(N[":@"],x),J=L==="?xml"?"":R,_=N[L][0][x.textNodeName];_=_.length!==0?" "+_:"",M+=J+"<".concat(L).concat(_).concat(q,"?>"),I=!0}else M+=R+""),I=!0;else I&&(M+=R),M+=""),I=!1;else{var s=N[L];d(O,x)||(s=y(s=x.tagValueProcessor(L,s),x)),I&&(M+=R),M+=s,I=!1}}return M}function c(E){for(var x=Object.keys(E),A=0;A0&&x.processEntities)for(var A=0;A0&&(A=` -`),o(E,x,"",A)}},3895:n=>{function o(I,D){return function(O){if(Array.isArray(O))return O}(I)||function(O,N){var L=O==null?null:typeof Symbol<"u"&&O[Symbol.iterator]||O["@@iterator"];if(L!=null){var j,H,Y=[],W=!0,q=!1;try{for(L=L.call(O);!(W=(j=L.next()).done)&&(Y.push(j.value),!N||Y.length!==N);W=!0);}catch(J){q=!0,H=J}finally{try{W||L.return==null||L.return()}finally{if(q)throw H}}return Y}}(I,D)||function(O,N){if(O){if(typeof O=="string")return c(O,N);var L=Object.prototype.toString.call(O).slice(8,-1);return L==="Object"&&O.constructor&&(L=O.constructor.name),L==="Map"||L==="Set"?Array.from(O):L==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L)?c(O,N):void 0}}(I,D)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function c(I,D){(D==null||D>I.length)&&(D=I.length);for(var O=0,N=new Array(D);O"){if(j?I[D-1]==="-"&&I[D-2]==="-"&&(j=!1,N--):N--,N===0)break}else I[D]==="["?L=!0:I[D];else{if(L&&y(I,D)){var H=o(u(I,(D+=7)+1),3);entityName=H[0],val=H[1],D=H[2],val.indexOf("&")===-1&&(O[M(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val})}else if(L&&E(I,D))D+=8;else if(L&&x(I,D))D+=8;else if(L&&A(I,D))D+=9;else{if(!d)throw new Error("Invalid DOCTYPE");j=!0}N++}if(N!==0)throw new Error("Unclosed DOCTYPE");return{entities:O,i:D}}},4282:(n,o)=>{var c={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(u,d){return d},attributeValueProcessor:function(u,d){return d},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(u,d,y){return u}};o.buildOptions=function(u){return Object.assign({},c,u)},o.defaultOptions=c},4502:(n,o,c)=>{"use strict";function u(h,b,w){return b in h?Object.defineProperty(h,b,{value:w,enumerable:!0,configurable:!0,writable:!0}):h[b]=w,h}function d(h){return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},d(h)}function y(h,b){for(var w=0;w))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,x.nameRegexp),E(function h(b){(function(w,g){if(!(w instanceof g))throw new TypeError("Cannot call a class as a function")})(this,h),this.options=b,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"}},this.addExternalEntities=D,this.parseXml=H,this.parseTextData=O,this.resolveNameSpace=N,this.buildAttributesMap=j,this.isItStopNode=J,this.replaceEntitiesValue=W,this.readStopNodeData=p,this.saveTextToParentTag=q,this.addChild=Y}));function D(h){for(var b=Object.keys(h),w=0;w0)){P||(h=this.replaceEntitiesValue(h));var k=this.options.tagValueProcessor(b,h,w,a,v);return k==null?h:d(k)!==d(h)||k!==h?k:this.options.trimValues||h.trim()===h?f(h,this.options.parseTagValue,this.options.numberParseOptions):h}}function N(h){if(this.options.removeNSPrefix){var b=h.split(":"),w=h.charAt(0)==="/"?"/":"";if(b[0]==="xmlns")return"";b.length===2&&(h=w+b[1])}return h}var L=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function j(h,b,w){if(!this.options.ignoreAttributes&&typeof h=="string"){for(var g=x.getAllMatches(h,L),a=g.length,v={},P=0;P",v,"Closing Tag is not closed."),k=h.substring(v+2,P).trim();if(this.options.removeNSPrefix){var S=k.indexOf(":");S!==-1&&(k=k.substr(S+1))}this.options.transformTagName&&(k=this.options.transformTagName(k)),w&&(g=this.saveTextToParentTag(g,w,a));var B=a.substring(a.lastIndexOf(".")+1);if(k&&this.options.unpairedTags.indexOf(k)!==-1)throw new Error("Unpaired tag can not be used as closing tag: "));var $=0;B&&this.options.unpairedTags.indexOf(B)!==-1?($=a.lastIndexOf(".",a.lastIndexOf(".")-1),this.tagsNodeStack.pop()):$=a.lastIndexOf("."),a=a.substring(0,$),w=this.tagsNodeStack.pop(),g="",v=P}else if(h[v+1]==="?"){var K=l(h,v,!1,"?>");if(!K)throw new Error("Pi Tag is not closed.");if(g=this.saveTextToParentTag(g,w,a),!(this.options.ignoreDeclaration&&K.tagName==="?xml"||this.options.ignorePiTags)){var he=new A(K.tagName);he.add(this.options.textNodeName,""),K.tagName!==K.tagExp&&K.attrExpPresent&&(he[":@"]=this.buildAttributesMap(K.tagExp,a,K.tagName)),this.addChild(w,he,a)}v=K.closeIndex+1}else if(h.substr(v+1,3)==="!--"){var X=s(h,"-->",v+4,"Comment is not closed.");if(this.options.commentPropName){var Z=h.substring(v+4,X-2);g=this.saveTextToParentTag(g,w,a),w.add(this.options.commentPropName,[u({},this.options.textNodeName,Z)])}v=X}else if(h.substr(v+1,2)==="!D"){var it=R(h,v);this.docTypeEntities=it.entities,v=it.i}else if(h.substr(v+1,2)==="!["){var oe=s(h,"]]>",v,"CDATA is not closed.")-2,ce=h.substring(v+9,oe);if(g=this.saveTextToParentTag(g,w,a),this.options.cdataPropName)w.add(this.options.cdataPropName,[u({},this.options.textNodeName,ce)]);else{var Rt=this.parseTextData(ce,w.tagname,a,!0,!1,!0);Rt==null&&(Rt=""),w.add(this.options.textNodeName,Rt)}v=oe+2}else{var ue=l(h,v,this.options.removeNSPrefix),ie=ue.tagName,bt=ue.tagExp,pe=ue.attrExpPresent,ge=ue.closeIndex;this.options.transformTagName&&(ie=this.options.transformTagName(ie)),w&&g&&w.tagname!=="!xml"&&(g=this.saveTextToParentTag(g,w,a,!1));var Ct=w;if(Ct&&this.options.unpairedTags.indexOf(Ct.tagname)!==-1&&(w=this.tagsNodeStack.pop(),a=a.substring(0,a.lastIndexOf("."))),ie!==b.tagname&&(a+=a?"."+ie:ie),this.isItStopNode(this.options.stopNodes,a,ie)){var le="";if(bt.length>0&&bt.lastIndexOf("/")===bt.length-1)v=ue.closeIndex;else if(this.options.unpairedTags.indexOf(ie)!==-1)v=ue.closeIndex;else{var me=this.readStopNodeData(h,ie,ge+1);if(!me)throw new Error("Unexpected end of ".concat(ie));v=me.i,le=me.tagContent}var Ht=new A(ie);ie!==bt&&pe&&(Ht[":@"]=this.buildAttributesMap(bt,a,ie)),le&&(le=this.parseTextData(le,ie,a,!0,pe,!0,!0)),a=a.substr(0,a.lastIndexOf(".")),Ht.add(this.options.textNodeName,le),this.addChild(w,Ht,a)}else{if(bt.length>0&&bt.lastIndexOf("/")===bt.length-1){bt=ie[ie.length-1]==="/"?ie=ie.substr(0,ie.length-1):bt.substr(0,bt.length-1),this.options.transformTagName&&(ie=this.options.transformTagName(ie));var ye=new A(ie);ie!==bt&&pe&&(ye[":@"]=this.buildAttributesMap(bt,a,ie)),this.addChild(w,ye,a),a=a.substr(0,a.lastIndexOf("."))}else{var de=new A(ie);this.tagsNodeStack.push(w),ie!==bt&&pe&&(de[":@"]=this.buildAttributesMap(bt,a,ie)),this.addChild(w,de,a),w=de}g="",v=ge}}else g+=h[v];return b.child};function Y(h,b,w){var g=this.options.updateTag(b.tagname,w,b[":@"]);g===!1||(typeof g=="string"&&(b.tagname=g),h.addChild(b))}var W=function(h){if(this.options.processEntities){for(var b in this.docTypeEntities){var w=this.docTypeEntities[b];h=h.replace(w.regx,w.val)}for(var g in this.lastEntities){var a=this.lastEntities[g];h=h.replace(a.regex,a.val)}if(this.options.htmlEntities)for(var v in this.htmlEntities){var P=this.htmlEntities[v];h=h.replace(P.regex,P.val)}h=h.replace(this.ampEntity.regex,this.ampEntity.val)}return h};function q(h,b,w,g){return h&&(g===void 0&&(g=Object.keys(b.child).length===0),(h=this.parseTextData(h,b.tagname,w,!1,!!b[":@"]&&Object.keys(b[":@"]).length!==0,g))!==void 0&&h!==""&&b.add(this.options.textNodeName,h),h=""),h}function J(h,b,w){var g="*."+w;for(var a in h){var v=h[a];if(g===v||b===v)return!0}return!1}function _(h,b){for(var w,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",a="",v=b;v3&&arguments[3]!==void 0?arguments[3]:">",a=_(h,b+1,g);if(a){var v=a.data,P=a.index,k=v.search(/\s/),S=v,B=!0;if(k!==-1&&(S=v.substr(0,k).replace(/\s\s*$/,""),v=v.substr(k+1)),w){var $=S.indexOf(":");$!==-1&&(B=(S=S.substr($+1))!==a.data.substr($+1))}return{tagName:S,tagExp:v,closeIndex:P,attrExpPresent:B}}}function p(h,b,w){for(var g=w,a=1;w",w,"".concat(b," is not closed"));if(h.substring(w+2,v).trim()===b&&--a==0)return{tagContent:h.substring(g,w),i:v};w=v}else if(h[w+1]==="?")w=s(h,"?>",w+1,"StopNode is not closed.");else if(h.substr(w+1,3)==="!--")w=s(h,"-->",w+3,"StopNode is not closed.");else if(h.substr(w+1,2)==="![")w=s(h,"]]>",w,"StopNode is not closed.")-2;else{var P=l(h,w,">");P&&((P&&P.tagName)===b&&P.tagExp[P.tagExp.length-1]!=="/"&&a++,w=P.closeIndex)}}function f(h,b,w){if(b&&typeof h=="string"){var g=h.trim();return g==="true"||g!=="false"&&M(h,w)}return x.isExist(h)?h:""}n.exports=I},586:(n,o,c)=>{function u(R,M){for(var I=0;I{"use strict";function c(E,x,A){for(var R,M={},I=0;I0&&(M[x.textNodeName]=R):R!==void 0&&(M[x.textNodeName]=R),M}function u(E){for(var x=Object.keys(E),A=0;A{"use strict";function o(d,y,E){return y in d?Object.defineProperty(d,y,{value:E,enumerable:!0,configurable:!0,writable:!0}):d[y]=E,d}function c(d,y){for(var E=0;E0?this.child.push((o(A={},x.tagname,x.child),o(A,":@",x[":@"]),A)):this.child.push(o({},x.tagname,x.child))}}])&&c(y.prototype,E),Object.defineProperty(y,"prototype",{writable:!1}),d}();n.exports=u},2665:(n,o)=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.sequence=void 0,o.sequence=function(){for(var c=[],u=0;u0;){var A=c.shift();E=[A.apply(x,E)]}return E[0]}}},9361:function(n,o,c){"use strict";var u=this&&this.__createBinding||(Object.create?function(E,x,A,R){R===void 0&&(R=A);var M=Object.getOwnPropertyDescriptor(x,A);M&&!("get"in M?!x.__esModule:M.writable||M.configurable)||(M={enumerable:!0,get:function(){return x[A]}}),Object.defineProperty(E,R,M)}:function(E,x,A,R){R===void 0&&(R=A),E[R]=x[A]}),d=this&&this.__exportStar||function(E,x){for(var A in E)A==="default"||Object.prototype.hasOwnProperty.call(x,A)||u(x,E,A)};Object.defineProperty(o,"__esModule",{value:!0}),o.HotPatcher=void 0;var y=c(2957);Object.defineProperty(o,"HotPatcher",{enumerable:!0,get:function(){return y.HotPatcher}}),d(c(2696),o)},2957:function(n,o,c){"use strict";var u=this&&this.__spreadArray||function(R,M,I){if(I||arguments.length===2)for(var D,O=0,N=M.length;O{"use strict";Object.defineProperty(o,"__esModule",{value:!0})},163:n=>{function o(c){return!!c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c)}n.exports=function(c){return c!=null&&(o(c)||function(u){return typeof u.readFloatLE=="function"&&typeof u.slice=="function"&&o(u.slice(0,0))}(c)||!!c._isBuffer)}},6893:(n,o)=>{"use strict";function c(u){return d=u,Object.prototype.toString.call(d)==="[object Error]"||u instanceof Error;var d}Object.defineProperty(o,"__esModule",{value:!0}),o.isError=o.inherit=o.assertError=void 0,o.assertError=function(u){if(!c(u))throw new Error("Parameter was not an error")},o.inherit=function(u,d){u.super_=d,u.prototype=Object.create(d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}})},o.isError=c},9104:function(n,o,c){"use strict";var u=this&&this.__createBinding||(Object.create?function(E,x,A,R){R===void 0&&(R=A),Object.defineProperty(E,R,{enumerable:!0,get:function(){return x[A]}})}:function(E,x,A,R){R===void 0&&(R=A),E[R]=x[A]}),d=this&&this.__exportStar||function(E,x){for(var A in E)A==="default"||Object.prototype.hasOwnProperty.call(x,A)||u(x,E,A)};Object.defineProperty(o,"__esModule",{value:!0}),o.Layerr=void 0;var y=c(2248);Object.defineProperty(o,"Layerr",{enumerable:!0,get:function(){return y.Layerr}}),d(c(8646),o)},2248:(n,o,c)=>{"use strict";function u(x){return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},u(x)}Object.defineProperty(o,"__esModule",{value:!0}),o.Layerr=void 0;var d=c(6893),y=c(7235);function E(x,A){var R=Array.prototype.slice.call(arguments);if(this instanceof E==0)throw new Error("Cannot invoke 'Layerr' like a function: It must be called with 'new'");var M=y.parseArguments(R),I=M.options,D=M.shortMessage;this.name="Layerr",I.name&&typeof I.name=="string"&&(this.name=I.name);var O=D;if(I.cause&&(Object.defineProperty(this,"_cause",{value:I.cause}),O="".concat(O,": ").concat(I.cause.message)),this.message=O,Object.defineProperty(this,"_info",{value:{}}),I.info&&u(I.info)==="object"&&Object.assign(this._info,I.info),Error.call(this,O),Error.captureStackTrace){var N=I.constructorOpt||this.constructor;Error.captureStackTrace(this,N)}return this}o.Layerr=E,d.inherit(E,Error),E.prototype.cause=function(){return E.cause(this)||void 0},E.prototype.toString=function(){var x=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(x="".concat(x,": ").concat(this.message)),x},E.cause=function(x){return d.assertError(x),d.isError(x._cause)?x._cause:null},E.fullStack=function(x){d.assertError(x);var A=E.cause(x);return A?"".concat(x.stack,` -caused by: `).concat(E.fullStack(A)):x.stack},E.info=function(x){d.assertError(x);var A={},R=E.cause(x);return R&&Object.assign(A,E.info(R)),x._info&&Object.assign(A,x._info),A}},7235:(n,o,c)=>{"use strict";function u(y){return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},u(y)}Object.defineProperty(o,"__esModule",{value:!0}),o.parseArguments=void 0;var d=c(6893);o.parseArguments=function(y){var E,x="";if(y.length===0)E={};else if(d.isError(y[0]))E={cause:y[0]},x=y.slice(1).join(" ")||"";else if(y[0]&&u(y[0])==="object")E=Object.assign({},y[0]),x=y.slice(1).join(" ")||"";else{if(typeof y[0]!="string")throw new Error("Invalid arguments passed to Layerr");E={},x=x=y.join(" ")||""}return{options:E,shortMessage:x}}},8646:(n,o)=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0})},9243:(n,o,c)=>{var u,d,y,E,x;u=c(3718),d=c(5106).utf8,y=c(163),E=c(5106).bin,(x=function A(R,M){R.constructor==String?R=M&&M.encoding==="binary"?E.stringToBytes(R):d.stringToBytes(R):y(R)?R=Array.prototype.slice.call(R,0):Array.isArray(R)||R.constructor===Uint8Array||(R=R.toString());for(var I=u.bytesToWords(R),D=8*R.length,O=1732584193,N=-271733879,L=-1732584194,j=271733878,H=0;H>>24)|4278255360&(I[H]<<24|I[H]>>>8);I[D>>>5]|=128<>>9<<4)]=D;var Y=A._ff,W=A._gg,q=A._hh,J=A._ii;for(H=0;H>>0,N=N+s>>>0,L=L+l>>>0,j=j+p>>>0}return u.endian([O,N,L,j])})._ff=function(A,R,M,I,D,O,N){var L=A+(R&M|~R&I)+(D>>>0)+N;return(L<>>32-O)+R},x._gg=function(A,R,M,I,D,O,N){var L=A+(R&I|M&~I)+(D>>>0)+N;return(L<>>32-O)+R},x._hh=function(A,R,M,I,D,O,N){var L=A+(R^M^I)+(D>>>0)+N;return(L<>>32-O)+R},x._ii=function(A,R,M,I,D,O,N){var L=A+(M^(R|~I))+(D>>>0)+N;return(L<>>32-O)+R},x._blocksize=16,x._digestsize=16,n.exports=function(A,R){if(A==null)throw new Error("Illegal argument "+A);var M=u.wordsToBytes(x(A,R));return R&&R.asBytes?M:R&&R.asString?E.bytesToString(M):u.bytesToHex(M)}},1050:n=>{function o(u){return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},o(u)}var c=(typeof C>"u"?"undefined":o(C))==="object"&&C&&C.platform==="win32";n.exports=c?{sep:"\\"}:{sep:"/"}},3e3:(n,o,c)=>{function u(f,h){for(var b=0;b2&&arguments[2]!==void 0?arguments[2]:{};return s(h),!(!b.nocomment&&h.charAt(0)==="#")&&new p(h,b).match(f)};n.exports=M;var I=c(1050);M.sep=I.sep;var D=Symbol("globstar **");M.GLOBSTAR=D;var O=c(3637),N={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},L="[^/]",j="[^/]*?",H=function(f){return f.split("").reduce(function(h,b){return h[b]=!0,h},{})},Y=H("().*{}+?[]^$\\!"),W=H("[.("),q=/\/+/;M.filter=function(f){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(b,w,g){return M(b,f,h)}};var J=function(f){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b={};return Object.keys(f).forEach(function(w){return b[w]=f[w]}),Object.keys(h).forEach(function(w){return b[w]=h[w]}),b};M.defaults=function(f){if(!f||R(f)!=="object"||!Object.keys(f).length)return M;var h=M,b=function(w,g,a){return h(w,g,J(f,a))};return(b.Minimatch=function(w){(function(k,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(S&&S.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),Object.defineProperty(k,"prototype",{writable:!1}),S&&E(k,S)})(P,w);var g,a,v=(g=P,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var k,S=A(g);if(a){var B=A(this).constructor;k=Reflect.construct(S,arguments,B)}else k=S.apply(this,arguments);return x(this,k)});function P(k,S){return y(this,P),v.call(this,k,J(f,S))}return d(P)}(h.Minimatch)).defaults=function(w){return h.defaults(J(f,w)).Minimatch},b.filter=function(w,g){return h.filter(w,J(f,g))},b.defaults=function(w){return h.defaults(J(f,w))},b.makeRe=function(w,g){return h.makeRe(w,J(f,g))},b.braceExpand=function(w,g){return h.braceExpand(w,J(f,g))},b.match=function(w,g,a){return h.match(w,g,J(f,a))},b},M.braceExpand=function(f,h){return _(f,h)};var _=function(f){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s(f),h.nobrace||!/\{(?:(?!\{).)*\}/.test(f)?[f]:O(f)},s=function(f){if(typeof f!="string")throw new TypeError("invalid pattern");if(f.length>65536)throw new TypeError("pattern is too long")},l=Symbol("subparse");M.makeRe=function(f,h){return new p(f,h||{}).makeRe()},M.match=function(f,h){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=new p(h,b);return f=f.filter(function(g){return w.match(g)}),w.options.nonull&&!f.length&&f.push(h),f};var p=function(){function f(h,b){y(this,f),s(h),b||(b={}),this.options=b,this.set=[],this.pattern=h,this.windowsPathsNoEscape=!!b.windowsPathsNoEscape||b.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!b.partial,this.make()}return d(f,[{key:"debug",value:function(){}},{key:"make",value:function(){var h=this,b=this.pattern,w=this.options;if(w.nocomment||b.charAt(0)!=="#")if(b){this.parseNegate();var g=this.globSet=this.braceExpand();w.debug&&(this.debug=function(){var a;return(a=console).error.apply(a,arguments)}),this.debug(this.pattern,g),g=this.globParts=g.map(function(a){return a.split(q)}),this.debug(this.pattern,g),g=g.map(function(a,v,P){return a.map(h.parse,h)}),this.debug(this.pattern,g),g=g.filter(function(a){return a.indexOf(!1)===-1}),this.debug(this.pattern,g),this.set=g}else this.empty=!0;else this.comment=!0}},{key:"parseNegate",value:function(){if(!this.options.nonegate){for(var h=this.pattern,b=!1,w=0,g=0;g>> no match, partial?`,h,K,b,he),K!==P))}if(typeof B=="string"?(S=$===B,this.debug("string match",B,$,S)):(S=$.match(B),this.debug("pattern match",B,$,S)),!S)return!1}if(a===P&&v===k)return!0;if(a===P)return w;if(v===k)return a===P-1&&h[a]==="";throw new Error("wtf?")}},{key:"braceExpand",value:function(){return _(this.pattern,this.options)}},{key:"parse",value:function(h,b){var w=this;s(h);var g=this.options;if(h==="**"){if(!g.noglobstar)return D;h="*"}if(h==="")return"";for(var a,v,P,k,S,B="",$=!!g.nocase,K=!1,he=[],X=[],Z=!1,it=-1,oe=-1,ce=h.charAt(0)==="."?"":g.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",Rt=function(){if(a){switch(a){case"*":B+=j,$=!0;break;case"?":B+=L,$=!0;break;default:B+="\\"+a}w.debug("clearStateChar %j %j",a,B),a=!1}},ue=0;ue-1;ge--){for(var Ct=X[ge],le=B.slice(0,Ct.reStart),me=B.slice(Ct.reStart,Ct.reEnd-8),Ht=B.slice(Ct.reEnd),ye=B.slice(Ct.reEnd-8,Ct.reEnd)+Ht,de=le.split("(").length-1,Mr=Ht,xe=0;xe1?v[k+1]="(?:\\/|"+w+"\\/)?"+v[k+1]:v[k]=w:k===v.length-1?v[k-1]+="(?:\\/|"+w+")?":(v[k-1]+="(?:\\/|\\/"+w+"\\/)"+v[k+1],v[k+1]=D))}),v.filter(function(P){return P!==D}).join("/")}).join("|");a="^(?:"+a+")$",this.negate&&(a="^(?!"+a+").*$");try{this.regexp=new RegExp(a,g)}catch{this.regexp=!1}return this.regexp}},{key:"match",value:function(h){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",h,this.pattern),this.comment)return!1;if(this.empty)return h==="";if(h==="/"&&b)return!0;var w=this.options;I.sep!=="/"&&(h=h.split(I.sep).join("/")),h=h.split(q),this.debug(this.pattern,"split",h);var g,a=this.set;this.debug(this.pattern,"set",a);for(var v=h.length-1;v>=0&&!(g=h[v]);v--);for(var P=0;P{var u=c(9584);n.exports=function(H){return H?(H.substr(0,2)==="{}"&&(H="\\{\\}"+H.substr(2)),j(function(Y){return Y.split("\\\\").join(d).split("\\{").join(y).split("\\}").join(E).split("\\,").join(x).split("\\.").join(A)}(H),!0).map(M)):[]};var d="\0SLASH"+Math.random()+"\0",y="\0OPEN"+Math.random()+"\0",E="\0CLOSE"+Math.random()+"\0",x="\0COMMA"+Math.random()+"\0",A="\0PERIOD"+Math.random()+"\0";function R(H){return parseInt(H,10)==H?parseInt(H,10):H.charCodeAt(0)}function M(H){return H.split(d).join("\\").split(y).join("{").split(E).join("}").split(x).join(",").split(A).join(".")}function I(H){if(!H)return[""];var Y=[],W=u("{","}",H);if(!W)return H.split(",");var q=W.pre,J=W.body,_=W.post,s=q.split(",");s[s.length-1]+="{"+J+"}";var l=I(_);return _.length&&(s[s.length-1]+=l.shift(),s.push.apply(s,l)),Y.push.apply(Y,s),Y}function D(H){return"{"+H+"}"}function O(H){return/^-?0\d/.test(H)}function N(H,Y){return H<=Y}function L(H,Y){return H>=Y}function j(H,Y){var W=[],q=u("{","}",H);if(!q)return[H];var J=q.pre,_=q.post.length?j(q.post,!1):[""];if(/\$$/.test(q.pre))for(var s=0;s<_.length;s++){var l=J+"{"+q.body+"}"+_[s];W.push(l)}else{var p,f,h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(q.body),b=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(q.body),w=h||b,g=q.body.indexOf(",")>=0;if(!w&&!g)return q.post.match(/,.*\}/)?j(H=q.pre+"{"+q.body+E+q.post):[H];if(w)p=q.body.split(/\.\./);else if((p=I(q.body)).length===1&&(p=j(p[0],!1).map(D)).length===1)return _.map(function(it){return q.pre+p[0]+it});if(w){var a=R(p[0]),v=R(p[1]),P=Math.max(p[0].length,p[1].length),k=p.length==3?Math.abs(R(p[2])):1,S=N;v0){var X=new Array(he+1).join("0");K=$<0?"-"+X+K.slice(1):X+K}}f.push(K)}}else{f=[];for(var Z=0;Z{"use strict";function o(I){return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},o(I)}function c(I){var D=typeof Map=="function"?new Map:void 0;return c=function(O){if(O===null||(N=O,Function.toString.call(N).indexOf("[native code]")===-1))return O;var N;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(D!==void 0){if(D.has(O))return D.get(O);D.set(O,L)}function L(){return u(O,arguments,E(this).constructor)}return L.prototype=Object.create(O.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),y(L,O)},c(I)}function u(I,D,O){return u=d()?Reflect.construct:function(N,L,j){var H=[null];H.push.apply(H,L);var Y=new(Function.bind.apply(N,H));return j&&y(Y,j.prototype),Y},u.apply(null,arguments)}function d(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function y(I,D){return y=Object.setPrototypeOf||function(O,N){return O.__proto__=N,O},y(I,D)}function E(I){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(D){return D.__proto__||Object.getPrototypeOf(D)},E(I)}var x=".",A=function(I){function D(O){var N;return function(L,j){if(!(L instanceof j))throw new TypeError("Cannot call a class as a function")}(this,D),(N=function(L,j){return!j||o(j)!=="object"&&typeof j!="function"?function(H){if(H===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return H}(L):j}(this,E(D).call(this,O))).name="ObjectPrototypeMutationError",N}return function(O,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function");O.prototype=Object.create(N&&N.prototype,{constructor:{value:O,writable:!0,configurable:!0}}),N&&y(O,N)}(D,I),D}(c(Error));function R(I,D){for(var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},N=D.split(x),L=N.length,j=function(W){var q=N[W];if(!I)return{v:void 0};if(q==="+"){if(Array.isArray(I))return{v:I.map(function(_,s){var l=N.slice(W+1);return l.length>0?R(_,l.join(x),O):O(I,s,N,W)})};var J=N.slice(0,W).join(x);throw new Error("Object at wildcard (".concat(J,") is not an array"))}I=O(I,q,N,W)},H=0;H2&&arguments[2]!==void 0?arguments[2]:{};if(o(I)!="object"||I===null||D===void 0)return!1;if(typeof D=="number")return D in I;try{var N=!1;return R(I,D,function(L,j,H,Y){if(!M(H,Y))return L&&L[j];N=O.own?L.hasOwnProperty(j):j in L}),N}catch{return!1}},hasOwn:function(I,D,O){return this.has(I,D,O||{own:!0})},isIn:function(I,D,O){var N=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(o(I)!="object"||I===null||D===void 0)return!1;try{var L=!1,j=!1;return R(I,D,function(H,Y,W,q){return L=L||H===O||!!H&&H[Y]===O,j=M(W,q)&&o(H)==="object"&&Y in H,H&&H[Y]}),N.validPath?L&&j:L}catch{return!1}},ObjectPrototypeMutationError:A}},1441:(n,o,c)=>{"use strict";function u(M){return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(I){return typeof I}:function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},u(M)}var d=c(6930),y=function(M){return typeof M=="string"};function E(M,I){for(var D=[],O=0;O=-1&&!I;D--){var O=D>=0?arguments[D]:C.cwd();if(!y(O))throw new TypeError("Arguments to path.resolve must be strings");O&&(M=O+"/"+M,I=O.charAt(0)==="/")}return(I?"/":"")+(M=E(M.split("/"),!I).join("/"))||"."},A.normalize=function(M){var I=A.isAbsolute(M),D=M.substr(-1)==="/";return(M=E(M.split("/"),!I).join("/"))||I||(M="."),M&&D&&(M+="/"),(I?"/":"")+M},A.isAbsolute=function(M){return M.charAt(0)==="/"},A.join=function(){for(var M="",I=0;I=0&&W[J]==="";J--);return q>J?[]:W.slice(q,J+1)}M=A.resolve(M).substr(1),I=A.resolve(I).substr(1);for(var O=D(M.split("/")),N=D(I.split("/")),L=Math.min(O.length,N.length),j=L,H=0;H{"use strict";var c=Object.prototype.hasOwnProperty;function u(y){try{return decodeURIComponent(y.replace(/\+/g," "))}catch{return null}}function d(y){try{return encodeURIComponent(y)}catch{return null}}o.stringify=function(y,E){E=E||"";var x,A,R=[];for(A in typeof E!="string"&&(E="?"),y)if(c.call(y,A)){if((x=y[A])||x!=null&&!isNaN(x)||(x=""),A=d(A),x=d(x),A===null||x===null)continue;R.push(A+"="+x)}return R.length?E+R.join("&"):""},o.parse=function(y){for(var E,x=/([^=?#&]+)=?([^&]*)/g,A={};E=x.exec(y);){var R=u(E[1]),M=u(E[2]);R===null||M===null||R in A||(A[R]=M)}return A}},4095:n=>{"use strict";n.exports=function(o,c){if(c=c.split(":")[0],!(o=+o))return!1;switch(c){case"http":case"ws":return o!==80;case"https":case"wss":return o!==443;case"ftp":return o!==21;case"gopher":return o!==70;case"file":return!1}return o!==0}},5512:n=>{var o=/^[-+]?0x[a-fA-F0-9]+$/,c=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var u={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function d(y){return y&&y.indexOf(".")!==-1&&((y=y.replace(/0+$/,""))==="."?y="0":y[0]==="."?y="0"+y:y[y.length-1]==="."&&(y=y.substr(0,y.length-1))),y}n.exports=function(y){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(E=Object.assign({},u,E),!y||typeof y!="string")return y;var x=y.trim();if(E.skipLike!==void 0&&E.skipLike.test(x))return y;if(E.hex&&o.test(x))return Number.parseInt(x,16);var A=c.exec(x);if(A){var R=A[1],M=A[2],I=d(A[3]),D=A[4]||A[6];if(!E.leadingZeros&&M.length>0&&R&&x[2]!=="."||!E.leadingZeros&&M.length>0&&!R&&x[1]!==".")return y;var O=Number(x),N=""+O;return N.search(/[eE]/)!==-1||D?E.eNotation?O:y:x.indexOf(".")!==-1?N==="0"&&I===""||N===I||R&&N==="-"+I?O:y:M?I===N||R+I===N?O:y:x===N||x===R+N?O:y}return y}},5842:function(n,o,c){var u,d,y;function E(x){return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},E(x)}y=function(){function x(A){var R=[];if(A.length===0)return"";if(typeof A[0]!="string")throw new TypeError("Url must be a string. Received "+A[0]);if(A[0].match(/^[^/:]+:\/*$/)&&A.length>1){var M=A.shift();A[0]=M+A[0]}A[0].match(/^file:\/\/\//)?A[0]=A[0].replace(/^([^/:]+):\/*/,"$1:///"):A[0]=A[0].replace(/^([^/:]+):\/*/,"$1://");for(var I=0;I0&&(D=D.replace(/^[\/]+/,"")),D=I0?"?":"")+N.join("&")}return function(){return x(E(arguments[0])==="object"?arguments[0]:[].slice.call(arguments))}},n.exports?n.exports=y():(d=typeof(u=y)=="function"?u.call(o,c,o,n):u)===void 0||(n.exports=d)},1095:(n,o,c)=>{"use strict";function u(W){return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},u(W)}var d=c(4095),y=c(1361),E=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,x=/[\n\r\t]/g,A=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,R=/:\d+$/,M=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,I=/^[a-zA-Z]:/;function D(W){return(W||"").toString().replace(E,"")}var O=[["#","hash"],["?","query"],function(W,q){return j(q.protocol)?W.replace(/\\/g,"/"):W},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],N={hash:1,query:1};function L(W){var q,J=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).location||{},_={},s=u(W=W||J);if(W.protocol==="blob:")_=new Y(unescape(W.pathname),{});else if(s==="string")for(q in _=new Y(W,{}),N)delete _[q];else if(s==="object"){for(q in W)q in N||(_[q]=W[q]);_.slashes===void 0&&(_.slashes=A.test(W.href))}return _}function j(W){return W==="file:"||W==="ftp:"||W==="http:"||W==="https:"||W==="ws:"||W==="wss:"}function H(W,q){W=(W=D(W)).replace(x,""),q=q||{};var J,_=M.exec(W),s=_[1]?_[1].toLowerCase():"",l=!!_[2],p=!!_[3],f=0;return l?p?(J=_[2]+_[3]+_[4],f=_[2].length+_[3].length):(J=_[2]+_[4],f=_[2].length):p?(J=_[3]+_[4],f=_[3].length):J=_[4],s==="file:"?f>=2&&(J=J.slice(2)):j(s)?J=_[4]:s?l&&(J=J.slice(2)):f>=2&&j(q.protocol)&&(J=_[4]),{protocol:s,slashes:l||j(s),slashesCount:f,rest:J}}function Y(W,q,J){if(W=(W=D(W)).replace(x,""),!(this instanceof Y))return new Y(W,q,J);var _,s,l,p,f,h,b=O.slice(),w=u(q),g=this,a=0;for(w!=="object"&&w!=="string"&&(J=q,q=null),J&&typeof J!="function"&&(J=y.parse),_=!(s=H(W||"",q=L(q))).protocol&&!s.slashes,g.slashes=s.slashes||_&&q.slashes,g.protocol=s.protocol||q.protocol||"",W=s.rest,(s.protocol==="file:"&&(s.slashesCount!==2||I.test(W))||!s.slashes&&(s.protocol||s.slashesCount<2||!j(g.protocol)))&&(b[3]=[/(.*)/,"pathname"]);a{},9227:()=>{}},e={};function r(n){var o=e[n];if(o!==void 0)return o.exports;var c=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.amdO={},r.n=n=>{var o=n&&n.__esModule?()=>n.default:()=>n;return r.d(o,{a:o}),o},r.d=(n,o)=>{for(var c in o)r.o(o,c)&&!r.o(n,c)&&Object.defineProperty(n,c,{enumerable:!0,get:o[c]})},r.o=(n,o)=>Object.prototype.hasOwnProperty.call(n,o),r.r=n=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.nmd=n=>(n.paths=[],n.children||(n.children=[]),n);var i={};return(()=>{"use strict";r.r(i),r.d(i,{AuthType:()=>W,ErrorCode:()=>q,createClient:()=>pr,getPatcher:()=>w,parseStat:()=>xe,parseXML:()=>de});var n=r(1095),o=r.n(n),c=r(5842),u=r.n(c),d=r(1441),y=r.n(d),E="__PATH_SEPARATOR_POSIX__",x="__PATH_SEPARATOR_WINDOWS__";function A(U){var z=U.replace(/\//g,E).replace(/\\\\/g,x);return encodeURIComponent(z).split(x).join("\\\\").split(E).join("/")}function R(U){if(!U||U==="/")return[];var z=U,G=[];do G.push(z),z=(0,d.dirname)(z);while(z&&z!=="/");return G}function M(U){var z=U;return z[0]!=="/"&&(z="/"+z),/^.+\/$/.test(z)&&(z=z.substr(0,z.length-1)),z}function I(U){var z=new(o())(U).pathname;return z.length<=0&&(z="/"),M(z)}function D(){for(var U=arguments.length,z=new Array(U),G=0;GU.length)&&(z=U.length);for(var G=0,ee=new Array(z);G0;){var tt=ze.shift();ee=ee?S(ee,tt):P(tt)}return ee}function S(U,z){var G=P(U);return Object.keys(z).forEach(function(ee){G.hasOwnProperty(ee)?Array.isArray(z[ee])?G[ee]=Array.isArray(G[ee])?[].concat(g(G[ee]),g(z[ee])):g(z[ee]):v(z[ee])==="object"&&z[ee]?G[ee]=v(G[ee])==="object"&&G[ee]?S(G[ee],z[ee]):P(z[ee]):G[ee]=z[ee]:G[ee]=z[ee]}),G}function B(U){return w().patchInline("request",function(z){return f()(z)},U)}function $(U,z,G){var ee=P(U);return ee.headers=function(){for(var ze=arguments.length,tt=new Array(ze),Xe=0;Xe1&&arguments[1]!==void 0?arguments[1]:"",G=new Error("".concat(z,"Invalid response: ").concat(U.status," ").concat(U.statusText));return G.status=U.status,G.response=U,G}function it(U,z){var G=z.status;if(G===401&&U.digest)return z;if(G>=400)throw Z(z);return z}function oe(U,z){return U.filter(function(G){return X()(G.filename,z,{matchBase:!0})})}function ce(U,z){var G=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return G?{data:z,headers:U.headers||{},status:U.status,statusText:U.statusText}:z}function Rt(U,z,G){return G?z?z(U):U:(U&&U.then||(U=Promise.resolve(U)),z?U.then(z):U)}var ue,ie,bt=(ue=function(U,z,G){var ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ze=$({url:D(U.remoteURL,A(z)),method:"COPY",headers:{Destination:D(U.remoteURL,A(G))}},U,ee);return Rt(K(ze),function(tt){it(U,tt)})},function(){for(var U=[],z=0;zU.length)&&(z=U.length);for(var G=0,ee=new Array(z);G2&&arguments[2]!==void 0?arguments[2]:ie.Original,ee=Ct().get(U,z);return G==="array"&&Array.isArray(ee)===!1?[ee]:G==="object"&&Array.isArray(ee)?ee[0]:ee}function de(U){return new Promise(function(z){z(function(G){var ee=G.multistatus;if(ee==="")return{multistatus:{response:[]}};if(!ee)throw new Error("Invalid response: No root multistatus found");var ze={multistatus:Array.isArray(ee)?ee[0]:ee};return Ct().set(ze,"multistatus.response",ye(ze,"multistatus.response",ie.Array)),Ct().set(ze,"multistatus.response",Ct().get(ze,"multistatus.response").map(function(tt){return function(Xe){var nt=Object.assign({},Xe);return Ct().set(nt,"propstat",ye(nt,"propstat",ie.Object)),Ct().set(nt,"propstat.prop",ye(nt,"propstat.prop",ie.Object)),nt}(tt)})),ze}(new pe.XMLParser({removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1}}).parse(U)))})}function Mr(U,z){var G=arguments.length>2&&arguments[2]!==void 0&&arguments[2],ee=U.getlastmodified,ze=ee===void 0?null:ee,tt=U.getcontentlength,Xe=tt===void 0?"0":tt,nt=U.resourcetype,ct=nt===void 0?null:nt,ir=U.getcontenttype,$t=ir===void 0?null:ir,Dt=U.getetag,Er=Dt===void 0?null:Dt,an=ct&&Ht(ct)==="object"&&ct.collection!==void 0?"directory":"file",Si=_(z),Ho={filename:Si,basename:y().basename(Si),lastmod:ze,size:parseInt(Xe,10),type:an,etag:typeof Er=="string"?Er.replace(/"/g,""):null};return an==="file"&&(Ho.mime=$t&&typeof $t=="string"?$t.split(";")[0]:""),G&&(Ho.props=U),Ho}function xe(U,z){var G=arguments.length>2&&arguments[2]!==void 0&&arguments[2],ee=null;try{ee=U.multistatus.response[0]}catch{}if(!ee)throw new Error("Failed getting item stat: bad response");var ze=ee,tt=ze.propstat,Xe=tt.prop,nt=tt.status,ct=nt.split(" ",3),ir=le(ct,3),$t=(ir[0],ir[1]),Dt=ir[2],Er=parseInt($t,10);if(Er>=400){var an=new Error("Invalid response: ".concat(Er," ").concat(Dt));throw an.status=Er,an}var Si=M(z);return Mr(Xe,Si,G)}function Ee(U){switch(U.toString()){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(U,10)}}function Ir(U,z,G){return G?z?z(U):U:(U&&U.then||(U=Promise.resolve(U)),z?U.then(z):U)}(function(U){U.Array="array",U.Object="object",U.Original="original"})(ie||(ie={}));var _e=function(U){return function(){for(var z=[],G=0;G2&&arguments[2]!==void 0?arguments[2]:{},ee=G.details,ze=ee!==void 0&&ee,tt=$({url:D(U.remoteURL,A(z)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"},responseType:"text"},U,G);return Ir(K(tt),function(Xe){return it(U,Xe),Ir(de(Xe.data),function(nt){var ct=xe(nt,z,ze);return ce(Xe,ct,ze)})})});function we(U,z,G){return G?z?z(U):U:(U&&U.then||(U=Promise.resolve(U)),z?U.then(z):U)}function Lr(U){return function(){for(var z=[],G=0;G2&&arguments[2]!==void 0?arguments[2]:{},ze=R(M(z));ze.sort(function(Xe,nt){return Xe.length>nt.length?1:nt.length>Xe.length?-1:0});var tt=!1;return Yr(ze,function(Xe){return Ae(function(){if(tt)return Ce(Me(U,Xe,Se(Se({},ee),{},{recursive:!1})))},function(){return $r(function(){return we(_e(U,Xe),function(nt){if(nt.type!=="directory")throw new Error("Path includes a file: ".concat(z))})},function(nt){var ct=nt;return function(){if(ct.status===404)return tt=!0,Ce(Me(U,Xe,Se(Se({},ee),{},{recursive:!1})));throw nt}()})})},function(){return G})}),Me=Lr(function(U,z){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(G.recursive===!0)return Ie(U,z,G);var ee=$({url:D(U.remoteURL,Jr(A(z))),method:"MKCOL"},U,G);return we(K(ee),function(ze){it(U,ze)})});function Jr(U){return U.endsWith("/")?U:U+"/"}var Pe=r(9227),Oe=r.n(Pe);function Xr(U,z,G){return G?z?z(U):U:(U&&U.then||(U=Promise.resolve(U)),z?U.then(z):U)}function Re(U){return Re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(z){return typeof z}:function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},Re(U)}var Ne=function(U){return function(){for(var z=[],G=0;G2&&arguments[2]!==void 0?arguments[2]:{},ee={};if(Re(G.range)==="object"&&typeof G.range.start=="number"){var ze="bytes=".concat(G.range.start,"-");typeof G.range.end=="number"&&(ze="".concat(ze).concat(G.range.end)),ee.Range=ze}var tt=$({url:D(U.remoteURL,A(z)),method:"GET",headers:ee,responseType:"stream"},U,G);return Xr(K(tt),function(Xe){if(it(U,Xe),ee.Range&&Xe.status!==206){var nt=new Error("Invalid response code for partial request: ".concat(Xe.status));throw nt.status=Xe.status,nt}return G.callback&&setTimeout(function(){G.callback(Xe)},0),Xe.data})}),Zr=function(){};function Be(U,z){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=Oe().PassThrough,ze=new ee;return Ne(U,z,G).then(function(tt){tt.pipe(ze)}).catch(function(tt){ze.emit("error",tt)}),ze}function Fe(U,z){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Zr,ze=Oe().PassThrough,tt=new ze,Xe={};G.overwrite===!1&&(Xe["If-None-Match"]="*");var nt=$({url:D(U.remoteURL,A(z)),method:"PUT",headers:Xe,data:tt,maxRedirects:0},U,G);return K(nt).then(function(ct){return it(U,ct)}).then(function(ct){setTimeout(function(){ee(ct)},0)}).catch(function(ct){tt.emit("error",ct)}),tt}var Gr=function(U){return function(){for(var z=[],G=0;G2&&arguments[2]!==void 0?arguments[2]:{},ee=$({url:D(U.remoteURL,A(z)),method:"DELETE"},U,G);return Le(K(ee),function(ze){it(U,ze)})});function en(U,z,G){return G?z?z(U):U:(U&&U.then||(U=Promise.resolve(U)),z?U.then(z):U)}function Ue(U,z){try{var G=U()}catch(ee){return z(ee)}return G&&G.then?G.then(void 0,z):G}var je=function(U){return function(){for(var z=[],G=0;G2&&arguments[2]!==void 0?arguments[2]:{};return Ue(function(){return en(_e(U,z,G),function(){return!0})},function(ee){if(ee.status===404)return!1;throw ee})});function gr(U,z,G){return G?z?z(U):U:(U&&U.then||(U=Promise.resolve(U)),z?U.then(z):U)}var wt=function(U){return function(){for(var z=[],G=0;G2&&arguments[2]!==void 0?arguments[2]:{},ee=$({url:D(U.remoteURL,A(z),"/"),method:"PROPFIND",headers:{Accept:"text/plain",Depth:G.deep?"infinity":"1"},responseType:"text"},U,G);return gr(K(ee),function(ze){return it(U,ze),gr(de(ze.data),function(tt){var Xe=z.startsWith("/")?z:"/"+z,nt=xt(tt,U.remotePath,Xe,G.details);return G.glob&&(nt=oe(nt,G.glob)),ce(ze,nt,G.details)})})});function xt(U,z,G){var ee=arguments.length>3&&arguments[3]!==void 0&&arguments[3],ze=y().join(z,"/"),tt=U.multistatus.response;return tt.map(function(Xe){var nt=O(Xe.href);return Mr(Xe.propstat.prop,decodeURIComponent(M(ze==="/"?nt:y().relative(ze,nt))),ee)}).filter(function(Xe){return Xe.basename&&(Xe.type==="file"||Xe.filename!==G.replace(/\/$/,""))})}function or(U){return function(){for(var z=[],G=0;G2&&arguments[2]!==void 0?arguments[2]:{},ee=$({url:D(U.remoteURL,A(z)),method:"GET",responseType:"text",transformResponse:[_r]},U,G);return lr(K(ee),function(ze){return it(U,ze),ce(ze,ze.data,G.details)})});function lr(U,z,G){return G?z?z(U):U:(U&&U.then||(U=Promise.resolve(U)),z?U.then(z):U)}var vr=or(function(U,z){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=$({url:D(U.remoteURL,A(z)),method:"GET",responseType:"arraybuffer"},U,G);return lr(K(ee),function(ze){return it(U,ze),ce(ze,ze.data,G.details)})}),br=or(function(U,z){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=G.format,ze=ee===void 0?"binary":ee;if(ze!=="binary"&&ze!=="text")throw new N.Layerr({info:{code:q.InvalidOutputFormat}},"Invalid output format: ".concat(ze));return ze==="text"?yr(U,z,G):vr(U,z,G)}),_r=function(U){return U};function wr(U,z){var G=D(U.remoteURL,A(z)),ee=/^https:/i.test(G)?"https":"http";switch(U.authType){case W.None:break;case W.Password:var ze=s(U.headers.Authorization.replace(/^Basic /i,"").trim());G=G.replace(/^https?:\/\//,"".concat(ee,"://").concat(ze,"@"));break;default:throw new N.Layerr({info:{code:q.LinkUnsupportedAuthType}},"Unsupported auth type for file link: ".concat(U.authType))}return G}function tr(U){return tr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(z){return typeof z}:function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},tr(U)}function Wt(U,z){var G=Object.keys(U);if(Object.getOwnPropertySymbols){var ee=Object.getOwnPropertySymbols(U);z&&(ee=ee.filter(function(ze){return Object.getOwnPropertyDescriptor(U,ze).enumerable})),G.push.apply(G,ee)}return G}function fr(U,z,G){return z in U?Object.defineProperty(U,z,{value:G,enumerable:!0,configurable:!0,writable:!0}):U[z]=G,U}function Yt(U){return new pe.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(dr({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:U}}},"d"))}function dr(U,z){var G=function(ze){for(var tt=1;tt3&&arguments[3]!==void 0?arguments[3]:{},ze=$({url:D(U.remoteURL,A(z)),method:"UNLOCK",headers:{"Lock-Token":G}},U,ee);return nr(K(ze),function(tt){if(it(U,tt),tt.status!==204&&tt.status!==200)throw Z(tt)})}),Zs=hr(function(U,z){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=G.refreshToken,ze=G.timeout,tt=ze===void 0?Au:ze,Xe={Accept:"text/plain,application/xml",Timeout:tt};ee&&(Xe.If=ee);var nt=$({url:D(U.remoteURL,A(z)),method:"LOCK",headers:Xe,data:Yt(U.contactHref),responseType:"text"},U,G);return nr(K(nt),function(ct){it(U,ct);var ir=rr(ct.data),$t=Ct().get(ir,"prop.lockdiscovery.activelock.locktoken.href"),Dt=Ct().get(ir,"prop.lockdiscovery.activelock.timeout");if(!$t)throw Z(ct,"No lock token received: ");return{token:$t,serverTimeout:Dt}})}),Au="Infinite, Second-4100000000";function tc(U,z){(z==null||z>U.length)&&(z=U.length);for(var G=0,ee=new Array(z);G1&&arguments[1]!==void 0?arguments[1]:{},G=z.path||"/",ee=$({url:D(U.remoteURL,G),method:"PROPFIND",headers:{Accept:"text/plain",Depth:"0"},responseType:"text"},U,z);return te(K(ee),function(ze){return it(U,ze),te(de(ze.data),function(tt){var Xe=V(tt);return ce(ze,Xe,z.details)})})});function se(U,z,G){return G?z?z(U):U:(U&&U.then||(U=Promise.resolve(U)),z?U.then(z):U)}var ae=function(U){return function(){for(var z=[],G=0;G3&&arguments[3]!==void 0?arguments[3]:{},ze=$({url:D(U.remoteURL,A(z)),method:"MOVE",headers:{Destination:D(U.remoteURL,A(G))}},U,ee);return se(K(ze),function(tt){it(U,tt)})}),ne=r(8918),Ke=typeof ArrayBuffer=="function",Je=Object.prototype.toString;function Ze(U){if(z=U,Ke&&(z instanceof ArrayBuffer||Je.call(z)==="[object ArrayBuffer]"))return U.byteLength;if(function(G){return G!=null&&G.constructor!=null&&typeof G.constructor.isBuffer=="function"&&G.constructor.isBuffer(G)}(U))return U.length;if(typeof U=="string")return(0,ne.k)(U);var z;throw new N.Layerr({info:{code:q.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}function et(U,z,G){return G?z?z(U):U:(U&&U.then||(U=Promise.resolve(U)),z?U.then(z):U)}var rt=function(U){return function(){for(var z=[],G=0;G3&&arguments[3]!==void 0?arguments[3]:{},ze=ee.contentLength,tt=ze===void 0||ze,Xe=ee.overwrite,nt=Xe===void 0||Xe,ct={"Content-Type":"application/octet-stream"};tt===!1||(ct["Content-Length"]="".concat(typeof tt=="number"?tt:Ze(G))),nt||(ct["If-None-Match"]="*");var ir=$({url:D(U.remoteURL,A(z)),method:"PUT",headers:ct,data:G},U,ee);return et(K(ir),function($t){try{it(U,$t)}catch(Er){var Dt=Er;if(Dt.status!==412||nt)throw Dt;return!1}return!0})});function ft(U,z){var G="".concat(D(U.remoteURL,A(z)),"?Content-Type=application/octet-stream"),ee=/^https:/i.test(G)?"https":"http";switch(U.authType){case W.None:break;case W.Password:var ze=s(U.headers.Authorization.replace(/^Basic /i,"").trim());G=G.replace(/^https?:\/\//,"".concat(ee,"://").concat(ze,"@"));break;default:throw new N.Layerr({info:{code:q.LinkUnsupportedAuthType}},"Unsupported auth type for file link: ".concat(U.authType))}return G}var kt="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function pr(U){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=z.authType,ee=G===void 0?null:G,ze=z.contactHref,tt=ze===void 0?kt:ze,Xe=z.headers,nt=Xe===void 0?{}:Xe,ct=z.httpAgent,ir=z.httpsAgent,$t=z.maxBodyLength,Dt=z.maxContentLength,Er=z.password,an=z.token,Si=z.username,Ho=z.withCredentials,Tu=ee;Tu||(Tu=Si||Er?W.Password:W.None);var Sr={authType:Tu,contactHref:tt,headers:Object.assign({},nt),httpAgent:ct,httpsAgent:ir,maxBodyLength:$t,maxContentLength:Dt,remotePath:I(U),remoteURL:U,password:Er,token:an,username:Si,withCredentials:Ho};return l(Sr,Si,Er,an),{copyFile:function(Bt,Rr,ea){return bt(Sr,Bt,Rr,ea)},createDirectory:function(Bt,Rr){return Me(Sr,Bt,Rr)},createReadStream:function(Bt,Rr){return Be(Sr,Bt,Rr)},createWriteStream:function(Bt,Rr,ea){return Fe(Sr,Bt,Rr,ea)},customRequest:function(Bt,Rr){return Gr(Sr,Bt,Rr)},deleteFile:function(Bt,Rr){return qe(Sr,Bt,Rr)},exists:function(Bt,Rr){return je(Sr,Bt,Rr)},getDirectoryContents:function(Bt,Rr){return wt(Sr,Bt,Rr)},getFileContents:function(Bt,Rr){return br(Sr,Bt,Rr)},getFileDownloadLink:function(Bt){return wr(Sr,Bt)},getFileUploadLink:function(Bt){return ft(Sr,Bt)},getHeaders:function(){return Object.assign({},Sr.headers)},getQuota:function(Bt){return Q(Sr,Bt)},lock:function(Bt,Rr){return Zs(Sr,Bt,Rr)},moveFile:function(Bt,Rr,ea){return ae(Sr,Bt,Rr,ea)},putFileContents:function(Bt,Rr,ea){return rt(Sr,Bt,Rr,ea)},setHeaders:function(Bt){Sr.headers=Object.assign({},Bt)},stat:function(Bt,Rr){return _e(Sr,Bt,Rr)},unlock:function(Bt,Rr,ea){return xr(Sr,Bt,Rr,ea)}}}})(),i})())});var Kte=F((Rmt,Gte)=>{m();var aPe="__lodash_hash_undefined__";function cPe(t){return this.__data__.set(t,aPe),this}Gte.exports=cPe});var Wte=F((Dmt,Vte)=>{m();function uPe(t){return this.__data__.has(t)}Vte.exports=uPe});var Qte=F((kmt,Yte)=>{m();var lPe=Yx(),fPe=Kte(),dPe=Wte();function cx(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new lPe;++e{m();function hPe(t,e){for(var r=-1,i=t==null?0:t.length;++r{m();function pPe(t,e){return t.has(e)}Zte.exports=pPe});var UR=F((Pmt,tre)=>{m();var mPe=Qte(),gPe=Xte(),yPe=ere(),vPe=1,bPe=2;function _Pe(t,e,r,i,n,o){var c=r&vPe,u=t.length,d=e.length;if(u!=d&&!(c&&d>u))return!1;var y=o.get(t),E=o.get(e);if(y&&E)return y==e&&E==t;var x=-1,A=!0,R=r&bPe?new mPe:void 0;for(o.set(t,e),o.set(e,t);++x{m();function wPe(t){var e=-1,r=Array(t.size);return t.forEach(function(i,n){r[++e]=[n,i]}),r}rre.exports=wPe});var ore=F((Bmt,ire)=>{m();function xPe(t){var e=-1,r=Array(t.size);return t.forEach(function(i){r[++e]=i}),r}ire.exports=xPe});var lre=F((Fmt,ure)=>{m();var sre=Kf(),are=gE(),EPe=Fp(),SPe=UR(),CPe=nre(),APe=ore(),TPe=1,MPe=2,RPe="[object Boolean]",DPe="[object Date]",kPe="[object Error]",IPe="[object Map]",OPe="[object Number]",PPe="[object RegExp]",NPe="[object Set]",BPe="[object String]",FPe="[object Symbol]",LPe="[object ArrayBuffer]",qPe="[object DataView]",cre=sre?sre.prototype:void 0,jR=cre?cre.valueOf:void 0;function UPe(t,e,r,i,n,o,c){switch(r){case qPe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case LPe:return!(t.byteLength!=e.byteLength||!o(new are(t),new are(e)));case RPe:case DPe:case OPe:return EPe(+t,+e);case kPe:return t.name==e.name&&t.message==e.message;case PPe:case BPe:return t==e+"";case IPe:var u=CPe;case NPe:var d=i&TPe;if(u||(u=APe),t.size!=e.size&&!d)return!1;var y=c.get(t);if(y)return y==e;i|=MPe,c.set(t,e);var E=SPe(u(t),u(e),i,n,o,c);return c.delete(t),E;case FPe:if(jR)return jR.call(t)==jR.call(e)}return!1}ure.exports=UPe});var hre=F((Lmt,dre)=>{m();var fre=lE(),jPe=1,zPe=Object.prototype,HPe=zPe.hasOwnProperty;function $Pe(t,e,r,i,n,o){var c=r&jPe,u=fre(t),d=u.length,y=fre(e),E=y.length;if(d!=E&&!c)return!1;for(var x=d;x--;){var A=u[x];if(!(c?A in e:HPe.call(e,A)))return!1}var R=o.get(t),M=o.get(e);if(R&&M)return R==e&&M==t;var I=!0;o.set(t,e),o.set(e,t);for(var D=c;++x{m();var zR=Qx(),GPe=UR(),KPe=lre(),VPe=hre(),pre=Wp(),mre=Jf(),gre=Wg(),WPe=nE(),YPe=1,yre="[object Arguments]",vre="[object Array]",ux="[object Object]",QPe=Object.prototype,bre=QPe.hasOwnProperty;function JPe(t,e,r,i,n,o){var c=mre(t),u=mre(e),d=c?vre:pre(t),y=u?vre:pre(e);d=d==yre?ux:d,y=y==yre?ux:y;var E=d==ux,x=y==ux,A=d==y;if(A&&gre(t)){if(!gre(e))return!1;c=!0,E=!1}if(A&&!E)return o||(o=new zR),c||WPe(t)?GPe(t,e,r,i,n,o):KPe(t,e,d,r,i,n,o);if(!(r&YPe)){var R=E&&bre.call(t,"__wrapped__"),M=x&&bre.call(e,"__wrapped__");if(R||M){var I=R?t.value():t,D=M?e.value():e;return o||(o=new zR),n(I,D,r,i,o)}}return A?(o||(o=new zR),VPe(t,e,r,i,n,o)):!1}_re.exports=JPe});var Cre=F((Umt,Sre)=>{m();var XPe=wre(),xre=oc();function Ere(t,e,r,i,n){return t===e?!0:t==null||e==null||!xre(t)&&!xre(e)?t!==t&&e!==e:XPe(t,e,r,i,Ere,n)}Sre.exports=Ere});var Tre=F((jmt,Are)=>{m();var ZPe=Cre();function e5e(t,e){return ZPe(t,e)}Are.exports=e5e});var Ire=F((Gmt,GR)=>{"use strict";m();var i5e=Object.prototype.hasOwnProperty,Oi="~";function Dg(){}Object.create&&(Dg.prototype=Object.create(null),new Dg().__proto__||(Oi=!1));function o5e(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function kre(t,e,r,i,n){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new o5e(r,i||t,n),c=Oi?Oi+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],o]:t._events[c].push(o):(t._events[c]=o,t._eventsCount++),t}function lx(t,e){--t._eventsCount===0?t._events=new Dg:delete t._events[e]}function Ei(){this._events=new Dg,this._eventsCount=0}Ei.prototype.eventNames=function(){var e=[],r,i;if(this._eventsCount===0)return e;for(i in r=this._events)i5e.call(r,i)&&e.push(Oi?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};Ei.prototype.listeners=function(e){var r=Oi?Oi+e:e,i=this._events[r];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,c=new Array(o);nDx});module.exports=lne(B5e);m();var er=require("obsidian"),jg=Et(oy());m();var rd=require("obsidian"),ia="application/octet-stream",sy="remotely-secure",M4="remotely-secure-cb",ay="remotely-sync-cb-onedrive",Yp="remotely-secure-cb-dropbox",cy=1e3*60*60*24*80,uy="0.13.27",mfe="0.13.26",gfe="0.14.6",uo=!rd.Platform.isAndroidApp&&(0,rd.requireApiVersion)(mfe)||rd.Platform.isAndroidApp&&(0,rd.requireApiVersion)(gfe),Ou="_debug_remotely_save/",R4="sync_plans_hist_exported_on_",D4="log_hist_exported_on_";m();var OO=Et(IO()),PO=Et(oy());var NO=async(t,e,r)=>{let i=(0,PO.default)(t);delete i.dropbox,delete i.onedrive,delete i.vaultRandomID;let n=encodeURIComponent(JSON.stringify(i)),o=encodeURIComponent(e),c=encodeURIComponent(r),u=`obsidian://${sy}?func=settings&version=${c}&vault=${o}&data=${n}`,d=await OO.default.toDataURL(u);return{rawUri:u,imgUri:d}},BO=(t,e)=>{let r=t;if(r.func===void 0||r.func!=="settings"||r.vault===void 0||r.data===void 0)return{status:"error",message:`the uri is not for exporting/importing settings: ${JSON.stringify(t)}`};if(r.vault!==e)return{status:"error",message:`the target vault is ${r.vault} but you are currently in ${e}: ${JSON.stringify(t)}`};let i={};try{i=JSON.parse(r.data)}catch{return{status:"error",message:`errors while parsing settings: ${JSON.stringify(t)}`}}return{status:"ok",message:"ok",result:i}};m();var Uu=Et(LO());m();m();var qO=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");var dc=require("obsidian");m();var ZO=require("obsidian");m();var Lu=Et(GO(),1),A7e=Lu.default.base16,KO=Lu.default.base32,T7e=Lu.default.base32hex,M7e=Lu.default.base64,sa=Lu.default.base64url,R7e=Lu.default.codec;m();var VO=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;m();var QO=Et(YO()),fc=QO.getLogger("rs-default"),JO=fc.methodFactory,xy=function(t){fc.methodFactory=function(e,r,i){let n=JO(e,r,i);return function(...o){n.apply(void 0,o),t(...o)}},fc.setLevel(fc.getLevel())},XO=()=>{fc.methodFactory=JO,fc.setLevel(fc.getLevel())},ht=fc;var jE=(t,e=!0,r=!0)=>{if(!(e||r))throw Error("parameter error for isHiddenPath");let n=yde(t).split("/");for(let o of n)if(!(o==="."||o===".."||o==="")&&(e&&o[0]==="."||r&&o[0]==="_"))return!0;return!1},yde=t=>{if(!t)throw Error("missing path for normalizePath");t=t.replace(/\\/g,"/"),t=t.replace(/\/\/+/g,"/");let e=t.split("/"),r=[];for(let i of e)i===".."?r.pop():i!=="."&&i!==""&&r.push(i);return r.join("/")},Ey=t=>{t=t.replace(/\\/g,"/");let e=t.split("/");e.pop();let r=e.join("/");return r===""||r==="/"||r==="."?"/":r},zE=(t,e=!1)=>{let r=[];if(t===""||t==="/")return r;let i=t.split("/"),n=0;for(let o=0;o+1{let r=zE(t);for(let i of r)await e.adapter.exists(i)||await e.adapter.mkdir(i)},Bi=t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);var HE=t=>VO().test(t),e8=(t,e=!0)=>{let r={};return t.forEach((i,n)=>{e?r[n.toLowerCase()]=i:r[n]=i}),r};var qu=t=>{let e=Ey(t);return e==="."||e==="/"?"/":e.endsWith("/")?e:`${e}/`};var t8=(t,e)=>{let r=new Uint32Array(1);window.crypto.getRandomValues(r);let i=r[0]/(4294967295+1);return t=Math.ceil(t),e=Math.floor(e),Math.floor(i*(e-t+1))+t},r8=t=>{let e=window.crypto.getRandomValues(new Uint8Array(t));return Bi(e)},ld=t=>[...t].reverse().join("");var $E=t=>{(t===void 0||t===""||t==="."||t===".."||t.startsWith("/"))&&ht.debug(`do not know which level for ${t}`);let e=t;return t.endsWith("/")&&(e=t.slice(0,-1)),e.split("/").length},n8=t=>/[?/\\]/.test(t),Xi=t=>{if(!(t==null||Number.isNaN(t)))return(0,ZO.moment)(t).format()},vde=()=>{let t=new WeakSet;return(e,r)=>{if(typeof r=="object"&&r!==null){if(t.has(r))return;t.add(r)}return r}},i8=t=>{if(t==null)return`${t}`;if(typeof t=="string")return t;if(t instanceof String||t instanceof Date||typeof t=="number"||typeof t=="bigint"||typeof t=="boolean")return`${t}`;if(t instanceof Error||t&&t.stack&&t.message&&typeof t.stack=="string"&&typeof t.message=="string")return`ERROR! MESSAGE: ${t.message}, STACK: ${t.stack}`;try{let e=JSON.stringify(t,vde(),2);if(e!==void 0)return e;throw new Error("not jsonable")}catch{return`${t}`}},ws=async(t,e)=>{let r=await t.adapter.stat(e);if(r!=null)return(r.ctime===void 0||r.ctime===null||Number.isNaN(r.ctime))&&(r.ctime=void 0),(r.mtime===void 0||r.mtime===null||Number.isNaN(r.mtime))&&(r.mtime=void 0),(r.size===void 0||r.size===null||Number.isNaN(r.size))&&r.type==="folder"&&(r.size=0),r};function o8(t,e){let r=(n,o)=>t.t(n,o),i={lastSyncMsg:r("statusbar_lastsync_never"),lastSyncLabelMsg:r("statusbar_lastsync_never_label")};if(e!==void 0&&e>0){let n=Date.now()-e,o=Math.floor(n/31556952e3),c=Math.floor(n/2629746e3),u=Math.floor(n/6048e5),d=Math.floor(n/864e5),y=Math.floor(n/36e5),E=Math.floor(n/6e4),x="";o>0?x=r("statusbar_time_years",{time:o}):c>0?x=r("statusbar_time_months",{time:c}):u>0?x=r("statusbar_time_weeks",{time:u}):d>0?x=r("statusbar_time_days",{time:d}):y>0?x=r("statusbar_time_hours",{time:y}):E>0?x=r("statusbar_time_minutes",{time:E}):x=r("statusbar_time_lessminute");let A=new Date(e).toLocaleTimeString(navigator.language,{weekday:"long",year:"numeric",month:"long",day:"numeric"});i.lastSyncMsg=r("statusbar_lastsync",{time:x}),i.lastSyncLabelMsg=r("statusbar_lastsync_label",{date:A})}return i}var GE=20220326,ju="remotelysavedb",bde="schemaversion",_de="filefolderoperationhistory",wde="syncmetadatahistory",xde="syncplanshistory",Ede="vaultrandomidmapping",Sde="loggeroutput",s8=async(t,e)=>{let n=[],o=await t.fileHistoryTbl.keys();for(let d of o){if(d.startsWith(e))continue;let y=await t.fileHistoryTbl.getItem(d);if(y==null)continue;(y.vaultRandomID===void 0||y.vaultRandomID==="")&&(y.vaultRandomID=e);let E=`${e} ${d}`;n.push(t.fileHistoryTbl.setItem(E,y)),n.push(t.fileHistoryTbl.removeItem(d))}let c=await t.syncMappingTbl.keys();for(let d of c){if(d.startsWith(e))continue;let y=await t.syncMappingTbl.getItem(d);if(y==null)continue;(y.vaultRandomID===void 0||y.vaultRandomID==="")&&(y.vaultRandomID=e);let E=`${e} ${d}`;n.push(t.syncMappingTbl.setItem(E,y)),n.push(t.syncMappingTbl.removeItem(d))}let u=await t.syncPlansTbl.keys();for(let d of u){if(d.startsWith(e))continue;let y=await t.syncPlansTbl.getItem(d);if(y==null)continue;(y.vaultRandomID===void 0||y.vaultRandomID==="")&&(y.vaultRandomID=e);let E=`${e} ${d}`;n.push(t.syncPlansTbl.setItem(E,y)),n.push(t.syncPlansTbl.removeItem(d))}await Promise.all(n),await t.versionTbl.setItem("version",20220108)},a8=async(t,e)=>{await t.versionTbl.setItem("version",20220326)},Cde=async(t,e,r,i)=>{if(e!==r){if(e===20211114&&r===20220108)return await s8(t,i);if(e===20220108&&r===20220326)return await a8(t,i);if(e===20211114&&r===20220326){await s8(t,i),await a8(t,i);return}throw r{let r={versionTbl:Uu.default.createInstance({name:ju,storeName:bde}),fileHistoryTbl:Uu.default.createInstance({name:ju,storeName:_de}),syncMappingTbl:Uu.default.createInstance({name:ju,storeName:wde}),syncPlansTbl:Uu.default.createInstance({name:ju,storeName:xde}),vaultRandomIDMappingTbl:Uu.default.createInstance({name:ju,storeName:Ede}),loggerOutputTbl:Uu.default.createInstance({name:ju,storeName:Sde})},i="",n=await r.vaultRandomIDMappingTbl.getItem(`path2id ${t}`);if(n===null?(e!==""?i=e:i=qO(),await r.vaultRandomIDMappingTbl.setItem(`path2id ${t}`,i),await r.vaultRandomIDMappingTbl.setItem(`id2path ${i}`,t)):i=n,i==="")throw Error("no vaultRandomID found or generated");let o=await r.versionTbl.getItem("version");return o===null?await r.versionTbl.setItem("version",GE):o===GE||await Cde(r,o,GE,i),{db:r,vaultRandomID:i}},u8=async()=>{let t=indexedDB.deleteDatabase(ju);t.onerror=e=>{ht.error("tried to delete db but something goes wrong!"),ht.error(e)}},l8=async(t,e)=>{let r=[];return await t.fileHistoryTbl.iterate((i,n,o)=>{n.startsWith(`${e} `)&&r.push(i)}),r.sort((i,n)=>i.actionWhen-n.actionWhen),r},hc=async(t,e,r)=>{let i=`${r} ${e}`,n=await t.fileHistoryTbl.getItem(i);n!==null&&(n.actionType==="delete"||n.actionType==="rename")&&await t.fileHistoryTbl.removeItem(i)},f8=async(t,e,r)=>{let i;e instanceof dc.TFile?i={key:e.path,ctime:e.stat.ctime,mtime:e.stat.mtime,size:e.stat.size,actionWhen:Date.now(),actionType:"delete",keyType:"file",renameTo:"",vaultRandomID:r}:e instanceof dc.TFolder&&(i={key:e.path.endsWith("/")?e.path:`${e.path}/`,ctime:0,mtime:0,size:0,actionWhen:Date.now(),actionType:"delete",keyType:"folder",renameTo:"",vaultRandomID:r}),await t.fileHistoryTbl.setItem(`${r} ${i.key}`,i)},d8=async(t,e,r,i)=>{let n,o,c=Date.now();if(e instanceof dc.TFile)n={key:r,ctime:e.stat.ctime,mtime:e.stat.mtime,size:e.stat.size,actionWhen:c,actionType:"rename",keyType:"file",renameTo:e.path,vaultRandomID:i},o={key:e.path,ctime:e.stat.ctime,mtime:e.stat.mtime,size:e.stat.size,actionWhen:c,actionType:"renameDestination",keyType:"file",renameTo:"",vaultRandomID:i};else if(e instanceof dc.TFolder){let u=r.endsWith("/")?r:`${r}/`,d=e.path.endsWith("/")?e.path:`${e.path}/`,y=0,E=0;if((0,dc.requireApiVersion)(uy)){let x=await ws(e.vault,e.path);y=x.ctime,E=x.mtime}n={key:u,ctime:y,mtime:E,size:0,actionWhen:c,actionType:"rename",keyType:"folder",renameTo:d,vaultRandomID:i},o={key:d,ctime:y,mtime:E,size:0,actionWhen:c,actionType:"renameDestination",keyType:"folder",renameTo:"",vaultRandomID:i}}await Promise.all([t.fileHistoryTbl.setItem(`${i} ${n.key}`,n),t.fileHistoryTbl.setItem(`${i} ${o.key}`,o)])},KE=async(t,e,r,i,n,o,c,u,d,y)=>{let E={localKey:r,localMtime:i,localSize:n,remoteKey:o,remoteMtime:c,remoteSize:u,remoteExtraKey:d,remoteType:t,keyType:r.endsWith("/")?"folder":"file",vaultRandomID:y};await e.syncMappingTbl.setItem(`${y} ${o}`,E)},h8=async(t,e,r,i,n,o)=>{let c=await e.syncMappingTbl.getItem(`${o} ${r}`);if(c!==null&&c.remoteKey===r&&c.remoteMtime===i&&c.remoteExtraKey===n&&c.remoteType===t)return c},p8=async t=>{await t.syncMappingTbl.clear()},m8=async(t,e,r)=>{let i={ts:e.ts,tsFmt:e.tsFmt,vaultRandomID:r,remoteType:e.remoteType,syncPlan:JSON.stringify(e,null,2)};await t.syncPlansTbl.setItem(`${r} ${e.ts}`,i)},g8=async t=>{await t.syncPlansTbl.clear()},y8=async(t,e)=>{let r=[];return await t.syncPlansTbl.iterate((i,n,o)=>{n.startsWith(`${e} `)&&r.push(i)}),r.sort((i,n)=>-(i.ts-n.ts)),r===void 0?[]:r.map(i=>i.syncPlan)},VE=async t=>{let n=Date.now()-6048e5,o=(await t.syncPlansTbl.keys()).map(d=>{let y=parseInt(d.split(" ")[1]),E=y<=n;return{ts:y,key:d,expired:E}}),c=new Set(o.filter(d=>d.expired).map(d=>d.key));o.length-c.size>1e4&&(o=o.filter(d=>!d.expired),o.sort((d,y)=>-(d.ts-y.ts)),o.slice(1e4).forEach(d=>{c.add(d.key)}));let u=[];c.forEach(d=>{u.push(t.syncPlansTbl.removeItem(d))}),await Promise.all(u)},v8=async(t,e)=>{let r=[];return await t.loggerOutputTbl.iterate((i,n,o)=>{if(n.startsWith(`${e} `)){let c={ts:parseInt(n.split(" ")[1]),r:i};r.push(c)}}),r.sort((i,n)=>i.ts-n.ts),r===void 0?[]:r.map(i=>i.r)},Sy=async(t,e,...r)=>{let i=Date.now(),n=Xi(i),o=`${e} ${i}`;try{let c=[`[${n}]`,...r.map(u=>i8(u))].join(" ");t.loggerOutputTbl.setItem(o,c)}catch{}},b8=async t=>{await t.loggerOutputTbl.clear()},im=async t=>{let n=Date.now()-6048e5,o=(await t.loggerOutputTbl.keys()).map(d=>{let y=parseInt(d.split(" ")[1]),E=y<=n;return{ts:y,key:d,expired:E}}),c=new Set(o.filter(d=>d.expired).map(d=>d.key));o.length-c.size>1e4&&(o=o.filter(d=>!d.expired),o.sort((d,y)=>-(d.ts-y.ts)),o.slice(1e4).forEach(d=>{c.add(d.key)}));let u=[];c.forEach(d=>{u.push(t.loggerOutputTbl.removeItem(d))}),await Promise.all(u)};m();m();var DU=Et(E8()),c0=Et($A()),WA=require("obsidian");m();var a0=2e4,RU=async(t,e,r=a0)=>{let i=await window.crypto.subtle.importKey("raw",new TextEncoder().encode(e),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]);return await window.crypto.subtle.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:"SHA-256"},i,256)},Bs=async(t,e,r=a0)=>{let i=window.crypto.getRandomValues(new Uint8Array(16)),n=await RU(i,e,r),o=window.crypto.getRandomValues(new Uint8Array(12)),c=await window.crypto.subtle.importKey("raw",n,{name:"AES-GCM"},!1,["encrypt","decrypt"]),u=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:o},c,t),d=new Uint8Array([...i,...o,...new Uint8Array(u)]);return Bi(d)},Sa=async(t,e,r=a0)=>{let i=t.slice(0,16),n=t.slice(16,28),o=t.slice(28),c=await RU(new Uint8Array(i),e,r),u=await window.crypto.subtle.importKey("raw",c,{name:"AES-GCM"},!1,["encrypt","decrypt"]);return await window.crypto.subtle.decrypt({name:"AES-GCM",iv:n},u,o)};var GA=async(t,e,r=a0)=>{let i=await Bs(Bi(new TextEncoder().encode(t)),e,r);return sa.stringify(new Uint8Array(i),{pad:!1})},Zb=async(t,e,r=a0)=>new TextDecoder().decode(await Sa(Bi(sa.parse(t,{loose:!0})),e,r)),e_=t=>{if(t<0||Number.isNaN(t)||!Number.isInteger(t))throw Error(`getSizeFromOrigToEnc: x=${t} is not a valid size`);return t+16+16+12};var ISe=Et($A());var uh={accessToken:"",clientID:"06wqszi8qc5qd70",refreshToken:"",accessTokenExpiresInSeconds:0,accessTokenExpiresAtTime:0,accountID:"",username:"",credentialsShouldBeDeletedAtTime:0},ch=(t,e)=>{let r=t;return(t==="/"||t==="")&&(r=`/${e}`),t.startsWith("/")||(r=`/${e}/${t}`),r.endsWith("/")&&(r=r.slice(0,r.length-1)),r},CSe=(t,e)=>{if(!(t===`/${e}`||t.startsWith(`/${e}/`)))throw Error(`"${t}" doesn't starts with "/${e}/"`);return t.slice(`/${e}/`.length)},KA=(t,e)=>{let r=CSe(t.path_display,e);if(t[".tag"]==="folder"&&!r.endsWith("/")&&(r=`${r}/`),t[".tag"]==="folder")return{key:r,lastModified:void 0,size:0,remoteType:"dropbox",etag:`${t.id} `};if(t[".tag"]==="file")return{key:r,lastModified:Date.parse(t.server_modified).valueOf(),size:t.size,remoteType:"dropbox",etag:`${t.id} ${t.content_hash}`};if(t[".tag"]==="deleted")throw Error("do not support deleted tag")},ASe=t=>{if(t.length===0)return;t.sort((r,i)=>i.key.length-r.key.length);let e={};for(let r of t){r.key.endsWith("/")&&r.lastModified===void 0&&r.key in e&&(r.lastModified=e[r.key]);let i=`${Ey(r.key)}/`;r.lastModified!==void 0&&(i in e?e[i]=Math.max(e[i],r.lastModified):e[i]=r.lastModified)}for(let r=t.length-1;r>=0;--r){let i=t[r];if(!i.key.endsWith("/")||i.lastModified!==void 0)continue;let n=`${Ey(i.key)}/`;n in e?i.lastModified=e[n]:(i.lastModified=Date.now().valueOf(),e[i.key]=i.lastModified)}return t},kU=async(t,e=!1)=>{let r=new c0.DropboxAuth({clientId:t}),i=e?void 0:`obsidian://${Yp}`,n=(await r.getAuthenticationUrl(i,void 0,"code","offline",void 0,"none",!0)).toString(),o=r.getCodeVerifier();return{authUrl:n,verifier:o}},r_=async(t,e,r)=>{let i=new URLSearchParams({code:r,grant_type:"authorization_code",code_verifier:e,client_id:t,redirect_uri:`obsidian://${Yp}`}),n={url:"https://api.dropboxapi.com/oauth2/token",method:"POST",body:i.toString()};return(await(0,WA.requestUrl)(n)).json},TSe=async(t,e)=>{let r=new URLSearchParams({grant_type:"refresh_token",refresh_token:e,client_id:t}),i={url:"https://api.dropboxapi.com/oauth2/token",method:"POST",body:r.toString()};return await(await(0,WA.requestUrl)(i)).json},u0=async(t,e,r)=>{t.accessToken=e.access_token,t.accessTokenExpiresInSeconds=parseInt(e.expires_in),t.accessTokenExpiresAtTime=Date.now()+parseInt(e.expires_in)*1e3-10*1e3,t.credentialsShouldBeDeletedAtTime=Date.now()+cy,e.refresh_token!==void 0&&(t.refreshToken=e.refresh_token),e.refresh_token!==void 0&&(t.accountID=e.account_id),r!==void 0&&await r()};async function Bl(t,e=""){let r=[2,4,8,16];for(let i=0;i{if(this.dropboxConfig.accessToken===""||this.dropboxConfig.refreshToken==="")throw Error("The user has not manually auth yet.");let e=Date.now(),r={"Cache-Control":"no-cache"};if(this.dropboxConfig.accessTokenExpiresAtTime>e)this.dropbox=new c0.Dropbox({accessToken:this.dropboxConfig.accessToken,customHeaders:r});else{if(this.dropboxConfig.refreshToken==="")throw Error("We need to automatically refresh token but none is stored.");let i=await TSe(this.dropboxConfig.clientID,this.dropboxConfig.refreshToken);u0(this.dropboxConfig,i,this.saveUpdatedConfigFunc),this.dropbox=new c0.Dropbox({accessToken:this.dropboxConfig.accessToken,customHeaders:r})}if(!this.vaultFolderExists){let i=await this.dropbox.filesListFolder({path:"",recursive:!1});for(let n of i.result.entries)if(n.path_display===`/${this.remoteBaseDir}`){this.vaultFolderExists=!0;break}if(!this.vaultFolderExists){if(HE(`/${this.remoteBaseDir}`))throw new Error(`/${this.remoteBaseDir}: Error: Dropbox does not support emoji in folder names.`);await this.dropbox.filesCreateFolderV2({path:`/${this.remoteBaseDir}`}),this.vaultFolderExists=!0}}return this.dropbox}},IU=(t,e,r)=>new VA(t,e,r),t_=async(t,e)=>{if(await t.init(),e===""||e==="/"){let n=await Bl(()=>t.dropbox.filesListFolder({path:`/${t.remoteBaseDir}`,recursive:!1}));if(n.status!==200)throw Error(JSON.stringify(n));return{key:e,lastModified:void 0,size:0,remoteType:"dropbox",etag:void 0}}let r=ch(e,t.remoteBaseDir),i=await Bl(()=>t.dropbox.filesGetMetadata({path:r}));if(i.status!==200)throw Error(JSON.stringify(i));return KA(i.result,t.remoteBaseDir)};function MSe(t){return new Date(t).toISOString().slice(0,19)+"Z"}async function RSe(t,e){let r=await ws(t,e);if(r)return MSe(r.mtime)}var OU=async(t,e,r,i=!1,n="",o="",c=void 0,u=!1,d="")=>{await t.init();let y=e;if(n!==""&&(y=o),y=ch(y,t.remoteBaseDir),HE(y))throw new Error(`${y}: Error: Dropbox does not support emoji in file / folder names.`);let E=e.endsWith("/");if(E&&i)throw Error("upload function doesn't implement recursive function yet!");if(E&&!i){if(u)throw Error("you specify uploadRaw, but you also provide a folder key!");if(n===""){if(!c?.has(y))try{await Bl(()=>t.dropbox.filesCreateFolderV2({path:y}),e),c?.add(y)}catch(A){let R=A;if(R.status===void 0)throw R;if(R.status===409)c?.add(y);else throw R}return await t_(t,y)}else return await Bl(()=>t.dropbox.filesUpload({path:y,contents:""}),e),await t_(t,y)}else{let x;u?typeof d=="string"?x=new TextEncoder().encode(d).buffer:x=d:x=await r.adapter.readBinary(e);let A=x;n!==""&&(A=await Bs(x,n));let R=await RSe(r,e);if(await Bl(()=>t.dropbox.filesUpload({path:y,contents:A,mode:{".tag":"overwrite"},client_modified:R}),e),c!==void 0){let M=zE(y).map(I=>ch(I,t.remoteBaseDir));for(let I of M)c?.add(I)}return await t_(t,y)}},PU=async(t,e)=>{if(e!==void 0)throw Error("prefix not supported (yet)");await t.init();let r=await t.dropbox.filesListFolder({path:`/${t.remoteBaseDir}`,recursive:!0,include_deleted:!1,limit:1e3});if(r.status!==200)throw Error(JSON.stringify(r));let n=r.result.entries.filter(o=>o[".tag"]!=="deleted").filter(o=>o.path_display!==`/${t.remoteBaseDir}`).map(o=>KA(o,t.remoteBaseDir));for(;r.result.has_more;){if(r=await t.dropbox.filesListFolderContinue({cursor:r.result.cursor}),r.status!==200)throw Error(JSON.stringify(r));let c=r.result.entries.filter(u=>u[".tag"]!=="deleted").filter(u=>u.path_display!==`/${t.remoteBaseDir}`).map(u=>KA(u,t.remoteBaseDir));n.push(...c)}return ASe(n),{Contents:n}},DSe=async(t,e)=>{await t.init();let r=ch(e,t.remoteBaseDir),i=await Bl(()=>t.dropbox.filesDownload({path:r}),e);if(i.result.fileBlob!==void 0)return await i.result.fileBlob.arrayBuffer();if(i.result.fileBinary!==void 0){let n=i.result.fileBinary;return Bi(n)}else throw Error(`unknown rsp from dropbox download: ${i}`)},NU=async(t,e,r,i,n="",o="",c=!1)=>{await t.init();let u=e.endsWith("/");if(c||await Ji(e,r),u)return new ArrayBuffer(0);{let d=e;n!==""&&(d=o),d=ch(d,t.remoteBaseDir);let y=await DSe(t,d),E=y;return n!==""&&(E=await Sa(y,n)),c||await r.adapter.writeBinary(e,E,{mtime:i}),E}},BU=async(t,e,r="",i="")=>{if(e==="/")return;let n=e;r!==""&&(n=i),n=ch(n,t.remoteBaseDir),await t.init();try{await Bl(()=>t.dropbox.filesDeleteV2({path:n}),e)}catch(o){console.error("some error while deleting"),console.error(o)}},FU=async(t,e)=>{try{return await t_(t,"/")!==void 0}catch(r){return ht.debug(r),e!==void 0&&e(r),!1}},LU=async t=>(await t.init(),(await t.dropbox.usersGetCurrentAccount()).result.name.display_name),qU=async t=>{await t.init(),await t.dropbox.authTokenRevoke()};m();m();m();m();var Fl=class{static serializeJSONBlob(e){return JSON.stringify(e)}static serializeAccounts(e){let r={};return Object.keys(e).map(function(i){let n=e[i];r[i]={home_account_id:n.homeAccountId,environment:n.environment,realm:n.realm,local_account_id:n.localAccountId,username:n.username,authority_type:n.authorityType,name:n.name,client_info:n.clientInfo,last_modification_time:n.lastModificationTime,last_modification_app:n.lastModificationApp}}),r}static serializeIdTokens(e){let r={};return Object.keys(e).map(function(i){let n=e[i];r[i]={home_account_id:n.homeAccountId,environment:n.environment,credential_type:n.credentialType,client_id:n.clientId,secret:n.secret,realm:n.realm}}),r}static serializeAccessTokens(e){let r={};return Object.keys(e).map(function(i){let n=e[i];r[i]={home_account_id:n.homeAccountId,environment:n.environment,credential_type:n.credentialType,client_id:n.clientId,secret:n.secret,realm:n.realm,target:n.target,cached_at:n.cachedAt,expires_on:n.expiresOn,extended_expires_on:n.extendedExpiresOn,refresh_on:n.refreshOn,key_id:n.keyId,token_type:n.tokenType,requestedClaims:n.requestedClaims,requestedClaimsHash:n.requestedClaimsHash,userAssertionHash:n.userAssertionHash}}),r}static serializeRefreshTokens(e){let r={};return Object.keys(e).map(function(i){let n=e[i];r[i]={home_account_id:n.homeAccountId,environment:n.environment,credential_type:n.credentialType,client_id:n.clientId,secret:n.secret,family_id:n.familyId,target:n.target,realm:n.realm}}),r}static serializeAppMetadata(e){let r={};return Object.keys(e).map(function(i){let n=e[i];r[i]={client_id:n.clientId,environment:n.environment,family_id:n.familyId}}),r}static serializeAllCache(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}}};m();m();m();m();m();m();m();m();m();var He={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},ti={SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR_RANGE_START:400,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR_RANGE_START:500,SERVER_ERROR_RANGE_END:599},Fs=[He.OPENID_SCOPE,He.PROFILE_SCOPE,He.OFFLINE_ACCESS_SCOPE],YA=[...Fs,He.EMAIL_SCOPE],pi={CONTENT_TYPE:"Content-Type",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"};var Lc={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},_t={CLIENT_ID:"client_id",REDIRECT_URI:"redirect_uri",RESPONSE_TYPE:"response_type",RESPONSE_MODE:"response_mode",GRANT_TYPE:"grant_type",CLAIMS:"claims",SCOPE:"scope",ERROR:"error",ERROR_DESCRIPTION:"error_description",ACCESS_TOKEN:"access_token",ID_TOKEN:"id_token",REFRESH_TOKEN:"refresh_token",EXPIRES_IN:"expires_in",STATE:"state",NONCE:"nonce",PROMPT:"prompt",SESSION_STATE:"session_state",CLIENT_INFO:"client_info",CODE:"code",CODE_CHALLENGE:"code_challenge",CODE_CHALLENGE_METHOD:"code_challenge_method",CODE_VERIFIER:"code_verifier",CLIENT_REQUEST_ID:"client-request-id",X_CLIENT_SKU:"x-client-SKU",X_CLIENT_VER:"x-client-VER",X_CLIENT_OS:"x-client-OS",X_CLIENT_CPU:"x-client-CPU",X_CLIENT_CURR_TELEM:"x-client-current-telemetry",X_CLIENT_LAST_TELEM:"x-client-last-telemetry",X_MS_LIB_CAPABILITY:"x-ms-lib-capability",X_APP_NAME:"x-app-name",X_APP_VER:"x-app-ver",POST_LOGOUT_URI:"post_logout_redirect_uri",ID_TOKEN_HINT:"id_token_hint",DEVICE_CODE:"device_code",CLIENT_SECRET:"client_secret",CLIENT_ASSERTION:"client_assertion",CLIENT_ASSERTION_TYPE:"client_assertion_type",TOKEN_TYPE:"token_type",REQ_CNF:"req_cnf",OBO_ASSERTION:"assertion",REQUESTED_TOKEN_USE:"requested_token_use",ON_BEHALF_OF:"on_behalf_of",FOCI:"foci",CCS_HEADER:"X-AnchorMailbox",RETURN_SPA_CODE:"return_spa_code",NATIVE_BROKER:"nativebroker",LOGOUT_HINT:"logout_hint"},lh={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},qc={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},l0={ACCOUNT:"account",SID:"sid",LOGIN_HINT:"login_hint",ID_TOKEN:"id_token",DOMAIN_HINT:"domain_hint",ORGANIZATIONS:"organizations",CONSUMERS:"consumers",ACCOUNT_ID:"accountIdentifier",HOMEACCOUNT_ID:"homeAccountIdentifier"},fh={PLAIN:"plain",S256:"S256"},UU={QUERY:"query",FRAGMENT:"fragment"},Ll={...UU,FORM_POST:"form_post"},Ca={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},dh={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",MSAV1_ACCOUNT_TYPE:"MSA",GENERIC_ACCOUNT_TYPE:"Generic"},tn={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},Fr={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"};var f0="appmetadata",jU="client_info",Uc="1",ql={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},Ai={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},Pn={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},Cr={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},Aa={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},n_={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},i_={username:"username",password:"password"},d0={httpSuccess:200,httpBadRequest:400},Ul={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},o_={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},is={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"};var s_={};Mu(s_,{postRequestFailed:()=>p0,unexpectedError:()=>h0});m();var h0="unexpected_error",p0="post_request_failed";var a_={[h0]:"Unexpected error in authentication.",[p0]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."},OSe={unexpectedError:{code:h0,desc:a_[h0]},postRequestFailed:{code:p0,desc:a_[p0]}},kr=class extends Error{constructor(e,r,i){let n=r?`${e}: ${r}`:e;super(n),Object.setPrototypeOf(this,kr.prototype),this.errorCode=e||He.EMPTY_STRING,this.errorMessage=r||He.EMPTY_STRING,this.subError=i||He.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}};function QA(t,e){return new kr(t,e?`${a_[t]} ${e}`:a_[t])}var Da={};Mu(Da,{authTimeNotFound:()=>Ta,authorizationCodeMissingFromServerResponse:()=>tf,bindingKeyNotRemoved:()=>rf,cannotAppendScopeSet:()=>Xl,cannotRemoveEmptyScope:()=>Jl,clientInfoDecodingError:()=>jc,clientInfoEmptyError:()=>jl,deviceCodeExpired:()=>v0,deviceCodePollingCancelled:()=>y0,deviceCodeUnknownError:()=>b0,emptyInputScopeSet:()=>$c,endSessionEndpointNotSupported:()=>nf,endpointResolutionError:()=>Ti,hashNotDeserialized:()=>Gl,invalidAssertion:()=>x0,invalidCacheEnvironment:()=>Ra,invalidCacheRecord:()=>Zl,invalidClientCredential:()=>E0,invalidState:()=>os,keyIdMissing:()=>of,maxAgeTranspired:()=>Wl,methodNotImplemented:()=>Ot,missingTenantIdError:()=>T0,multipleMatchingAccounts:()=>g0,multipleMatchingAppMetadata:()=>Yl,multipleMatchingTokens:()=>m0,nestedAppAuthBridgeDisabled:()=>M0,networkError:()=>Hl,noAccountFound:()=>_0,noAccountInSilentRequest:()=>Ma,noCryptoObject:()=>Gc,noNetworkConnectivity:()=>C0,nonceMismatch:()=>Vl,nullOrEmptyToken:()=>zl,openIdConfigError:()=>$l,requestCannotBeMade:()=>Ql,stateMismatch:()=>Kl,stateNotFound:()=>Hc,tokenClaimsCnfRequiredForSignedJwt:()=>ef,tokenParsingError:()=>zc,tokenRefreshRequired:()=>Ls,unexpectedCredentialType:()=>w0,userCanceled:()=>A0,userTimeoutReached:()=>S0});m();var jc="client_info_decoding_error",jl="client_info_empty_error",zc="token_parsing_error",zl="null_or_empty_token",Ti="endpoints_resolution_error",Hl="network_error",$l="openid_config_error",Gl="hash_not_deserialized",os="invalid_state",Kl="state_mismatch",Hc="state_not_found",Vl="nonce_mismatch",Ta="auth_time_not_found",Wl="max_age_transpired",m0="multiple_matching_tokens",g0="multiple_matching_accounts",Yl="multiple_matching_appMetadata",Ql="request_cannot_be_made",Jl="cannot_remove_empty_scope",Xl="cannot_append_scopeset",$c="empty_input_scopeset",y0="device_code_polling_cancelled",v0="device_code_expired",b0="device_code_unknown_error",Ma="no_account_in_silent_request",Zl="invalid_cache_record",Ra="invalid_cache_environment",_0="no_account_found",Gc="no_crypto_object",w0="unexpected_credential_type",x0="invalid_assertion",E0="invalid_client_credential",Ls="token_refresh_required",S0="user_timeout_reached",ef="token_claims_cnf_required_for_signedjwt",tf="authorization_code_missing_from_server_response",rf="binding_key_not_removed",nf="end_session_endpoint_not_supported",of="key_id_missing",C0="no_network_connectivity",A0="user_canceled",T0="missing_tenant_id_error",Ot="method_not_implemented",M0="nested_app_auth_bridge_disabled";var St={[jc]:"The client info could not be parsed/decoded correctly",[jl]:"The client info was empty",[zc]:"Token cannot be parsed",[zl]:"The token is null or empty",[Ti]:"Endpoints cannot be resolved",[Hl]:"Network request failed",[$l]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[Gl]:"The hash parameters could not be deserialized",[os]:"State was not the expected format",[Kl]:"State mismatch error",[Hc]:"State not found",[Vl]:"Nonce mismatch error",[Ta]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[Wl]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[m0]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[g0]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[Yl]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[Ql]:"Token request cannot be made without authorization code or refresh token.",[Jl]:"Cannot remove null or empty scope from ScopeSet",[Xl]:"Cannot append ScopeSet",[$c]:"Empty input ScopeSet cannot be processed",[y0]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[v0]:"Device code is expired.",[b0]:"Device code stopped polling for unknown reasons.",[Ma]:"Please pass an account object, silent flow is not supported without account information",[Zl]:"Cache record object was null or undefined.",[Ra]:"Invalid environment when attempting to create cache entry",[_0]:"No account found in cache for given key.",[Gc]:"No crypto object detected.",[w0]:"Unexpected credential type.",[x0]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[E0]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[Ls]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[S0]:"User defined timeout for device code polling reached",[ef]:"Cannot generate a POP jwt if the token_claims are not populated",[tf]:"Server response does not contain an authorization code to proceed",[rf]:"Could not remove the credential's binding key from storage.",[nf]:"The provided authority does not support logout",[of]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[C0]:"No network connectivity. Check your internet connection.",[A0]:"User cancelled the flow.",[T0]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[Ot]:"This method has not been implemented",[M0]:"The nested app auth bridge is disabled"},PSe={clientInfoDecodingError:{code:jc,desc:St[jc]},clientInfoEmptyError:{code:jl,desc:St[jl]},tokenParsingError:{code:zc,desc:St[zc]},nullOrEmptyToken:{code:zl,desc:St[zl]},endpointResolutionError:{code:Ti,desc:St[Ti]},networkError:{code:Hl,desc:St[Hl]},unableToGetOpenidConfigError:{code:$l,desc:St[$l]},hashNotDeserialized:{code:Gl,desc:St[Gl]},invalidStateError:{code:os,desc:St[os]},stateMismatchError:{code:Kl,desc:St[Kl]},stateNotFoundError:{code:Hc,desc:St[Hc]},nonceMismatchError:{code:Vl,desc:St[Vl]},authTimeNotFoundError:{code:Ta,desc:St[Ta]},maxAgeTranspired:{code:Wl,desc:St[Wl]},multipleMatchingTokens:{code:m0,desc:St[m0]},multipleMatchingAccounts:{code:g0,desc:St[g0]},multipleMatchingAppMetadata:{code:Yl,desc:St[Yl]},tokenRequestCannotBeMade:{code:Ql,desc:St[Ql]},removeEmptyScopeError:{code:Jl,desc:St[Jl]},appendScopeSetError:{code:Xl,desc:St[Xl]},emptyInputScopeSetError:{code:$c,desc:St[$c]},DeviceCodePollingCancelled:{code:y0,desc:St[y0]},DeviceCodeExpired:{code:v0,desc:St[v0]},DeviceCodeUnknownError:{code:b0,desc:St[b0]},NoAccountInSilentRequest:{code:Ma,desc:St[Ma]},invalidCacheRecord:{code:Zl,desc:St[Zl]},invalidCacheEnvironment:{code:Ra,desc:St[Ra]},noAccountFound:{code:_0,desc:St[_0]},noCryptoObj:{code:Gc,desc:St[Gc]},unexpectedCredentialType:{code:w0,desc:St[w0]},invalidAssertion:{code:x0,desc:St[x0]},invalidClientCredential:{code:E0,desc:St[E0]},tokenRefreshRequired:{code:Ls,desc:St[Ls]},userTimeoutReached:{code:S0,desc:St[S0]},tokenClaimsRequired:{code:ef,desc:St[ef]},noAuthorizationCodeFromServer:{code:tf,desc:St[tf]},bindingKeyNotRemovedError:{code:rf,desc:St[rf]},logoutNotSupported:{code:nf,desc:St[nf]},keyIdMissing:{code:of,desc:St[of]},noNetworkConnectivity:{code:C0,desc:St[C0]},userCanceledError:{code:A0,desc:St[A0]},missingTenantIdError:{code:T0,desc:St[T0]},nestedAppAuthBridgeDisabled:{code:M0,desc:St[M0]}},Kc=class extends kr{constructor(e,r){super(e,r?`${St[e]}: ${r}`:St[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,Kc.prototype)}};function Ve(t,e){return new Kc(t,e)}var JA={createNewGuid:()=>{throw Ve(Ot)},base64Decode:()=>{throw Ve(Ot)},base64Encode:()=>{throw Ve(Ot)},async getPublicKeyThumbprint(){throw Ve(Ot)},async removeTokenBindingKey(){throw Ve(Ot)},async clearKeystore(){throw Ve(Ot)},async signJwt(){throw Ve(Ot)},async hashString(){throw Ve(Ot)}};m();var gn;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(gn||(gn={}));var ko=class{constructor(e,r,i){this.level=gn.Info;let n=()=>{},o=e||ko.createDefaultLoggerOptions();this.localCallback=o.loggerCallback||n,this.piiLoggingEnabled=o.piiLoggingEnabled||!1,this.level=typeof o.logLevel=="number"?o.logLevel:gn.Info,this.correlationId=o.correlationId||He.EMPTY_STRING,this.packageName=r||He.EMPTY_STRING,this.packageVersion=i||He.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:gn.Info}}clone(e,r,i){return new ko({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:i||this.correlationId},e,r)}logMessage(e,r){if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let o=`${`[${new Date().toUTCString()}] : [${r.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${gn[r.logLevel]} - ${e}`;this.executeCallback(r.logLevel,o,r.containsPii||!1)}executeCallback(e,r,i){this.localCallback&&this.localCallback(e,r,i)}error(e,r){this.logMessage(e,{logLevel:gn.Error,containsPii:!1,correlationId:r||He.EMPTY_STRING})}errorPii(e,r){this.logMessage(e,{logLevel:gn.Error,containsPii:!0,correlationId:r||He.EMPTY_STRING})}warning(e,r){this.logMessage(e,{logLevel:gn.Warning,containsPii:!1,correlationId:r||He.EMPTY_STRING})}warningPii(e,r){this.logMessage(e,{logLevel:gn.Warning,containsPii:!0,correlationId:r||He.EMPTY_STRING})}info(e,r){this.logMessage(e,{logLevel:gn.Info,containsPii:!1,correlationId:r||He.EMPTY_STRING})}infoPii(e,r){this.logMessage(e,{logLevel:gn.Info,containsPii:!0,correlationId:r||He.EMPTY_STRING})}verbose(e,r){this.logMessage(e,{logLevel:gn.Verbose,containsPii:!1,correlationId:r||He.EMPTY_STRING})}verbosePii(e,r){this.logMessage(e,{logLevel:gn.Verbose,containsPii:!0,correlationId:r||He.EMPTY_STRING})}trace(e,r){this.logMessage(e,{logLevel:gn.Trace,containsPii:!1,correlationId:r||He.EMPTY_STRING})}tracePii(e,r){this.logMessage(e,{logLevel:gn.Trace,containsPii:!0,correlationId:r||He.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};m();var c_="@azure/msal-common",hh="14.4.0";m();var sf={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};m();var ji={};Mu(ji,{createAccessTokenEntity:()=>ZA,createIdTokenEntity:()=>XA,createRefreshTokenEntity:()=>e3,generateCredentialKey:()=>l_,isAccessTokenEntity:()=>BSe,isCredentialEntity:()=>f_,isIdTokenEntity:()=>FSe,isRefreshTokenEntity:()=>LSe,isServerTelemetryEntity:()=>$Se});m();m();function ka(t,e){let r=NSe(t);try{let i=e(r);return JSON.parse(i)}catch{throw Ve(zc)}}function NSe(t){if(!t)throw Ve(zl);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw Ve(zc);return r[2]}function u_(t,e){if(e===0||Date.now()-3e5>t+e)throw Ve(Wl)}m();var Ar=class{static nowSeconds(){return Math.round(new Date().getTime()/1e3)}static isTokenExpired(e,r){let i=Number(e)||0;return Ar.nowSeconds()+r>i}static wasClockTurnedBack(e){return Number(e)>Ar.nowSeconds()}static delay(e,r){return new Promise(i=>setTimeout(()=>i(r),e))}};function l_(t){return[qSe(t),USe(t),jSe(t),zSe(t),HSe(t)].join(tn.CACHE_KEY_SEPARATOR).toLowerCase()}function XA(t,e,r,i,n){return{credentialType:Fr.ID_TOKEN,homeAccountId:t,environment:e,clientId:i,secret:r,realm:n}}function ZA(t,e,r,i,n,o,c,u,d,y,E,x,A,R,M){let I={homeAccountId:t,credentialType:Fr.ACCESS_TOKEN,secret:r,cachedAt:Ar.nowSeconds().toString(),expiresOn:c.toString(),extendedExpiresOn:u.toString(),environment:e,clientId:i,realm:n,target:o,tokenType:E||Cr.BEARER};if(x&&(I.userAssertionHash=x),y&&(I.refreshOn=y.toString()),R&&(I.requestedClaims=R,I.requestedClaimsHash=M),I.tokenType?.toLowerCase()!==Cr.BEARER.toLowerCase())switch(I.credentialType=Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME,I.tokenType){case Cr.POP:let D=ka(r,d);if(!D?.cnf?.kid)throw Ve(ef);I.keyId=D.cnf.kid;break;case Cr.SSH:I.keyId=A}return I}function e3(t,e,r,i,n,o){let c={credentialType:Fr.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:i,secret:r};return o&&(c.userAssertionHash=o),n&&(c.familyId=n),c}function f_(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}function BSe(t){return t?f_(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===Fr.ACCESS_TOKEN||t.credentialType===Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function FSe(t){return t?f_(t)&&t.hasOwnProperty("realm")&&t.credentialType===Fr.ID_TOKEN:!1}function LSe(t){return t?f_(t)&&t.credentialType===Fr.REFRESH_TOKEN:!1}function qSe(t){return[t.homeAccountId,t.environment].join(tn.CACHE_KEY_SEPARATOR).toLowerCase()}function USe(t){let e=t.credentialType===Fr.REFRESH_TOKEN&&t.familyId||t.clientId;return[t.credentialType,e,t.realm||""].join(tn.CACHE_KEY_SEPARATOR).toLowerCase()}function jSe(t){return(t.target||"").toLowerCase()}function zSe(t){return(t.requestedClaimsHash||"").toLowerCase()}function HSe(t){return t.tokenType&&t.tokenType.toLowerCase()!==Cr.BEARER.toLowerCase()?t.tokenType.toLowerCase():""}function $Se(t,e){let r=t.indexOf(Pn.CACHE_KEY)===0,i=!0;return e&&(i=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&i}m();m();m();var ph="redirect_uri_empty",d_="claims_request_parsing_error",mh="authority_uri_insecure",Ia="url_parse_error",Vc="empty_url_error",gh="empty_input_scopes_error",yh="invalid_prompt_value",Wc="invalid_claims",vh="token_request_empty",bh="logout_request_empty",_h="invalid_code_challenge_method",Yc="pkce_params_missing",af="invalid_cloud_discovery_metadata",wh="invalid_authority_metadata",xh="untrusted_authority",Qc="missing_ssh_jwk",h_="missing_ssh_kid",p_="missing_nonce_authentication_header",m_="invalid_authentication_header",g_="cannot_set_OIDCOptions",y_="cannot_allow_native_broker",v_="authority_mismatch";var on={[ph]:"A redirect URI is required for all calls, and none has been set.",[d_]:"Could not parse the given claims request object.",[mh]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[Ia]:"URL could not be parsed into appropriate segments.",[Vc]:"URL was empty or null.",[gh]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[yh]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[Wc]:"Given claims parameter must be a stringified JSON object.",[vh]:"Token request was empty and not found in cache.",[bh]:"The logout request was null or undefined.",[_h]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[Yc]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[af]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[wh]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[xh]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[Qc]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[h_]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[p_]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[m_]:"Invalid authentication header provided",[g_]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[y_]:"Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",[v_]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."},wUe={redirectUriNotSet:{code:ph,desc:on[ph]},claimsRequestParsingError:{code:d_,desc:on[d_]},authorityUriInsecure:{code:mh,desc:on[mh]},urlParseError:{code:Ia,desc:on[Ia]},urlEmptyError:{code:Vc,desc:on[Vc]},emptyScopesError:{code:gh,desc:on[gh]},invalidPrompt:{code:yh,desc:on[yh]},invalidClaimsRequest:{code:Wc,desc:on[Wc]},tokenRequestEmptyError:{code:vh,desc:on[vh]},logoutRequestEmptyError:{code:bh,desc:on[bh]},invalidCodeChallengeMethod:{code:_h,desc:on[_h]},invalidCodeChallengeParams:{code:Yc,desc:on[Yc]},invalidCloudDiscoveryMetadata:{code:af,desc:on[af]},invalidAuthorityMetadata:{code:wh,desc:on[wh]},untrustedAuthority:{code:xh,desc:on[xh]},missingSshJwk:{code:Qc,desc:on[Qc]},missingSshKid:{code:h_,desc:on[h_]},missingNonceAuthenticationHeader:{code:p_,desc:on[p_]},invalidAuthenticationHeader:{code:m_,desc:on[m_]},cannotSetOIDCOptions:{code:g_,desc:on[g_]},cannotAllowNativeBroker:{code:y_,desc:on[y_]},authorityMismatch:{code:v_,desc:on[v_]}},R0=class extends kr{constructor(e){super(e,on[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,R0.prototype)}};function Tr(t){return new R0(t)}m();var dn=class{static isEmptyObj(e){if(e)try{let r=JSON.parse(e);return Object.keys(r).length===0}catch{}return!0}static startsWith(e,r){return e.indexOf(r)===0}static endsWith(e,r){return e.length>=r.length&&e.lastIndexOf(r)===e.length-r.length}static queryStringToObject(e){let r={},i=e.split("&"),n=o=>decodeURIComponent(o.replace(/\+/g," "));return i.forEach(o=>{if(o.trim()){let[c,u]=o.split(/=(.+)/g,2);c&&u&&(r[n(c)]=n(u))}}),r}static trimArrayEntries(e){return e.map(r=>r.trim())}static removeEmptyStringsFromArray(e){return e.filter(r=>!!r)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,r){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(r)}};var ri=class{constructor(e){let r=e?dn.trimArrayEntries([...e]):[],i=r?dn.removeEmptyStringsFromArray(r):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(n=>this.scopes.add(n))}static fromString(e){let i=(e||He.EMPTY_STRING).split(" ");return new ri(i)}static createSearchScopes(e){let r=new ri(e);return r.containsOnlyOIDCScopes()?r.removeScope(He.OFFLINE_ACCESS_SCOPE):r.removeOIDCScopes(),r}validateInputScopes(e){if(!e||e.length<1)throw Tr(gh)}containsScope(e){let r=this.printScopesLowerCase().split(" "),i=new ri(r);return e?i.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(r=>this.containsScope(r))}containsOnlyOIDCScopes(){let e=0;return YA.forEach(r=>{this.containsScope(r)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(r=>this.appendScope(r))}catch{throw Ve(Xl)}}removeScope(e){if(!e)throw Ve(Jl);this.scopes.delete(e.trim())}removeOIDCScopes(){YA.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Ve($c);let r=new Set;return e.scopes.forEach(i=>r.add(i.toLowerCase())),this.scopes.forEach(i=>r.add(i.toLowerCase())),r}intersectingScopeSets(e){if(!e)throw Ve($c);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();let r=this.unionScopeSets(e),i=e.getScopeCount(),n=this.getScopeCount();return r.sizee.push(r)),e}printScopes(){return this.scopes?this.asArray().join(" "):He.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}};m();m();function D0(t,e){if(!t)throw Ve(jl);try{let r=e.base64Decode(t);return JSON.parse(r)}catch{throw Ve(jc)}}function Oa(t){if(!t)throw Ve(jc);let e=t.split(tn.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?He.EMPTY_STRING:e[1]}}m();var Io={Default:0,Adfs:1,Dsts:2,Ciam:3};m();var qs={AAD:"AAD",OIDC:"OIDC"};var Nn=class{generateAccountId(){return[this.homeAccountId,this.environment].join(tn.CACHE_KEY_SEPARATOR).toLowerCase()}generateAccountKey(){return Nn.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})}getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType}}static generateAccountCacheKey(e){return[e.homeAccountId,e.environment||He.EMPTY_STRING,e.tenantId||He.EMPTY_STRING].join(tn.CACHE_KEY_SEPARATOR).toLowerCase()}static createAccount(e,r){let i=new Nn;r.authorityType===Io.Adfs?i.authorityType=dh.ADFS_ACCOUNT_TYPE:r.protocolMode===qs.AAD?i.authorityType=dh.MSSTS_ACCOUNT_TYPE:i.authorityType=dh.GENERIC_ACCOUNT_TYPE,i.clientInfo=e.clientInfo,i.homeAccountId=e.homeAccountId,i.nativeAccountId=e.nativeAccountId;let n=e.environment||r&&r.getPreferredCache();if(!n)throw Ve(Ra);i.environment=n,i.realm=e.idTokenClaims.tid||He.EMPTY_STRING,i.localAccountId=e.idTokenClaims.oid||e.idTokenClaims.sub||He.EMPTY_STRING;let o=e.idTokenClaims.preferred_username||e.idTokenClaims.upn,c=e.idTokenClaims.emails?e.idTokenClaims.emails[0]:null;return i.username=o||c||He.EMPTY_STRING,i.name=e.idTokenClaims.name,i.cloudGraphHostName=e.cloudGraphHostName,i.msGraphHost=e.msGraphHost,i}static createFromAccountInfo(e,r,i){let n=new Nn;return n.authorityType=e.authorityType||dh.GENERIC_ACCOUNT_TYPE,n.homeAccountId=e.homeAccountId,n.localAccountId=e.localAccountId,n.nativeAccountId=e.nativeAccountId,n.realm=e.tenantId,n.environment=e.environment,n.username=e.username,n.name=e.name,n.cloudGraphHostName=r,n.msGraphHost=i,n}static generateHomeAccountId(e,r,i,n,o){let c=o?.sub?o.sub:He.EMPTY_STRING;if(r===Io.Adfs||r===Io.Dsts)return c;if(e)try{let u=D0(e,n);if(u.uid&&u.utid)return`${u.uid}${tn.CLIENT_INFO_SEPARATOR}${u.utid}`}catch{}return i.verbose("No client info in response"),c}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,r,i){if(!e||!r)return!1;let n=!0;if(i){let o=e.idTokenClaims||{},c=r.idTokenClaims||{};n=o.iat===c.iat&&o.nonce===c.nonce}return e.homeAccountId===r.homeAccountId&&e.localAccountId===r.localAccountId&&e.username===r.username&&e.tenantId===r.tenantId&&e.environment===r.environment&&e.nativeAccountId===r.nativeAccountId&&n}};m();m();var b_={};Mu(b_,{getDeserializedResponse:()=>t3,stripLeadingHashOrQuery:()=>zU});m();function zU(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}function t3(t){if(!t||t.indexOf("=")<0)return null;try{let e=zU(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.error||r.error_description||r.state)return r}catch{throw Ve(Gl)}return null}var ur=class{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Tr(Vc);e.includes("#")||(this._urlString=ur.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return dn.endsWith(r,"?")?r=r.slice(0,-1):dn.endsWith(r,"?/")&&(r=r.slice(0,-2)),dn.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw Tr(Ia)}if(!e.HostNameAndPort||!e.PathSegments)throw Tr(Ia);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Tr(mh)}static appendQueryString(e,r){return r?e.indexOf("?")<0?`${e}?${r}`:`${e}&${r}`:e}static removeHashFromUrl(e){return ur.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){let r=this.getUrlComponents(),i=r.PathSegments;return e&&i.length!==0&&(i[0]===Lc.COMMON||i[0]===Lc.ORGANIZATIONS)&&(i[0]=e),ur.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw Tr(Ia);let i={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5],QueryString:r[7]},n=i.AbsolutePath.split("/");return n=n.filter(o=>o&&o.length>0),i.PathSegments=n,i.QueryString&&i.QueryString.endsWith("/")&&(i.QueryString=i.QueryString.substring(0,i.QueryString.length-1)),i}static getDomainFromUrl(e){let r=RegExp("^([^:/?#]+://)?([^/?#]*)"),i=e.match(r);if(!i)throw Tr(Ia);return i[2]}static getAbsoluteUrl(e,r){if(e[0]===He.FORWARD_SLASH){let n=new ur(r).getUrlComponents();return n.Protocol+"//"+n.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new ur(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!t3(e)}};var $U={endpointMetadata:{"https://login.microsoftonline.com/common/":{token_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/common/":{token_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/common/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/common/":{token_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/consumers/":{token_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/consumers/":{token_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/consumers/":{token_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/organizations/":{token_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/organizations/":{token_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/organizations/":{token_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"}},instanceDiscoveryMetadata:{tenant_discovery_endpoint:"https://{canonicalAuthority}/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},r3=$U.endpointMetadata,n3=$U.instanceDiscoveryMetadata,i3=new Set;n3.metadata.forEach(t=>{t.aliases.forEach(e=>{i3.add(e)})});function GU(t,e){let r,i=t.canonicalAuthority;if(i){let n=new ur(i).getUrlComponents().HostNameAndPort;r=HU(n,t.cloudDiscoveryMetadata?.metadata,Ai.CONFIG,e)||HU(n,n3.metadata,Ai.HARDCODED_VALUES,e)||t.knownAuthorities}return r||[]}function HU(t,e,r,i){if(i?.trace(`getAliasesFromMetadata called with source: ${r}`),t&&e){let n=k0(e,t);if(n)return i?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${r}, returning aliases`),n.aliases;i?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${r}`)}return null}function KU(t){return k0(n3.metadata,t)}function k0(t,e){for(let r=0;r{let n=this.getAccountInfoFromEntity(i,e);n&&r.push(n)}),r}getAccountInfoFilteredBy(e){let r=this.getAllAccounts(e);return r.length>1?r.filter(i=>!!i.idTokenClaims)[0]:r.length===1?r[0]:null}getBaseAccountInfo(e){let r=this.getAccountsFilteredBy(e);return r.length>0?r[0].getAccountInfo():null}getAccountInfoFromEntity(e,r){let i=e.getAccountInfo(),n=this.getIdToken(i);if(n){let o=ka(n.secret,this.cryptoImpl.base64Decode);if(this.idTokenClaimsMatchAccountFilter(o,r))return i.idToken=n.secret,i.idTokenClaims=o,i}return i}idTokenClaimsMatchAccountFilter(e,r){return!(r&&(!!r.loginHint&&!this.matchLoginHint(e,r.loginHint)||!!r.sid&&!this.matchSid(e,r.sid)))}async saveCacheRecord(e,r){if(!e)throw Ve(Zl);e.account&&this.setAccount(e.account),!!e.idToken&&r?.idToken!==!1&&this.setIdTokenCredential(e.idToken),!!e.accessToken&&r?.accessToken!==!1&&await this.saveAccessToken(e.accessToken),!!e.refreshToken&&r?.refreshToken!==!1&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata)}async saveAccessToken(e){let r={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},i=this.getTokenKeys(),n=ri.fromString(e.target),o=[];i.accessToken.forEach(c=>{if(!this.accessTokenKeyMatchesFilter(c,r,!1))return;let u=this.getAccessTokenCredential(c);u&&this.credentialMatchesFilter(u,r)&&ri.fromString(u.target).intersectingScopeSets(n)&&o.push(this.removeAccessToken(c))}),await Promise.all(o),this.setAccessTokenCredential(e)}getAccountsFilteredBy(e){let r=this.getAccountKeys(),i=[];return r.forEach(n=>{if(!this.isAccountKey(n,e.homeAccountId,e.tenantId))return;let o=this.getAccount(n);!o||!!e.homeAccountId&&!this.matchHomeAccountId(o,e.homeAccountId)||!!e.localAccountId&&!this.matchLocalAccountId(o,e.localAccountId)||!!e.username&&!this.matchUsername(o,e.username)||!!e.environment&&!this.matchEnvironment(o,e.environment)||!!e.realm&&!this.matchRealm(o,e.realm)||!!e.tenantId&&!this.matchRealm(o,e.tenantId)||!!e.nativeAccountId&&!this.matchNativeAccountId(o,e.nativeAccountId)||!!e.authorityType&&!this.matchAuthorityType(o,e.authorityType)||!!e.name&&!this.matchName(o,e.name)||i.push(o)}),i}isAccountKey(e,r,i){return!(e.split(tn.CACHE_KEY_SEPARATOR).length<3||r&&!e.toLowerCase().includes(r.toLowerCase())||i&&!e.toLowerCase().includes(i.toLowerCase()))}isCredentialKey(e){if(e.split(tn.CACHE_KEY_SEPARATOR).length<6)return!1;let r=e.toLowerCase();if(r.indexOf(Fr.ID_TOKEN.toLowerCase())===-1&&r.indexOf(Fr.ACCESS_TOKEN.toLowerCase())===-1&&r.indexOf(Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())===-1&&r.indexOf(Fr.REFRESH_TOKEN.toLowerCase())===-1)return!1;if(r.indexOf(Fr.REFRESH_TOKEN.toLowerCase())>-1){let i=`${Fr.REFRESH_TOKEN}${tn.CACHE_KEY_SEPARATOR}${this.clientId}${tn.CACHE_KEY_SEPARATOR}`,n=`${Fr.REFRESH_TOKEN}${tn.CACHE_KEY_SEPARATOR}${Uc}${tn.CACHE_KEY_SEPARATOR}`;if(r.indexOf(i.toLowerCase())===-1&&r.indexOf(n.toLowerCase())===-1)return!1}else if(r.indexOf(this.clientId.toLowerCase())===-1)return!1;return!0}credentialMatchesFilter(e,r){return!(!!r.clientId&&!this.matchClientId(e,r.clientId)||!!r.userAssertionHash&&!this.matchUserAssertionHash(e,r.userAssertionHash)||typeof r.homeAccountId=="string"&&!this.matchHomeAccountId(e,r.homeAccountId)||!!r.environment&&!this.matchEnvironment(e,r.environment)||!!r.realm&&!this.matchRealm(e,r.realm)||!!r.credentialType&&!this.matchCredentialType(e,r.credentialType)||!!r.familyId&&!this.matchFamilyId(e,r.familyId)||!!r.target&&!this.matchTarget(e,r.target)||(r.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==r.requestedClaimsHash||e.credentialType===Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(!!r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===Cr.SSH&&r.keyId&&!this.matchKeyId(e,r.keyId)))}getAppMetadataFilteredBy(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)}getAppMetadataFilteredByInternal(e,r){let i=this.getKeys(),n={};return i.forEach(o=>{if(!this.isAppMetadata(o))return;let c=this.getAppMetadata(o);!c||!!e&&!this.matchEnvironment(c,e)||!!r&&!this.matchClientId(c,r)||(n[o]=c)}),n}getAuthorityMetadataByAlias(e){let r=this.getAuthorityMetadataKeys(),i=null;return r.forEach(n=>{if(!this.isAuthorityMetadata(n)||n.indexOf(this.clientId)===-1)return;let o=this.getAuthorityMetadata(n);!o||o.aliases.indexOf(e)!==-1&&(i=o)}),i}async removeAllAccounts(){let e=this.getAccountKeys(),r=[];e.forEach(i=>{r.push(this.removeAccount(i))}),await Promise.all(r)}async removeAccount(e){let r=this.getAccount(e);!r||(await this.removeAccountContext(r),this.removeItem(e))}async removeAccountContext(e){let r=this.getTokenKeys(),i=e.generateAccountId(),n=[];r.idToken.forEach(o=>{o.indexOf(i)===0&&this.removeIdToken(o)}),r.accessToken.forEach(o=>{o.indexOf(i)===0&&n.push(this.removeAccessToken(o))}),r.refreshToken.forEach(o=>{o.indexOf(i)===0&&this.removeRefreshToken(o)}),await Promise.all(n)}async removeAccessToken(e){let r=this.getAccessTokenCredential(e);if(!!r){if(r.credentialType.toLowerCase()===Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&r.tokenType===Cr.POP){let n=r.keyId;if(n)try{await this.cryptoImpl.removeTokenBindingKey(n)}catch{throw Ve(rf)}}return this.removeItem(e)}}removeAppMetadata(){return this.getKeys().forEach(r=>{this.isAppMetadata(r)&&this.removeItem(r)}),!0}readCacheRecord(e,r,i,n,o){let c=this.getTokenKeys(),u=this.readAccountFromCache(e),d=this.getIdToken(e,c,n,o),y=this.getAccessToken(e,r,c,n,o),E=this.getRefreshToken(e,!1,c,n,o),x=this.readAppMetadataFromCache(i);return u&&d&&(u.idTokenClaims=ka(d.secret,this.cryptoImpl.base64Decode)),{account:u,idToken:d,accessToken:y,refreshToken:E,appMetadata:x}}readAccountFromCache(e){let r=Nn.generateAccountCacheKey(e);return this.getAccount(r)}getIdToken(e,r,i,n){this.commonLogger.trace("CacheManager - getIdToken called");let o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Fr.ID_TOKEN,clientId:this.clientId,realm:e.tenantId},c=this.getIdTokensByFilter(o,r),u=c.length;return u<1?(this.commonLogger.info("CacheManager:getIdToken - No token found"),null):u>1?(this.commonLogger.info("CacheManager:getIdToken - Multiple id tokens found, clearing them"),c.forEach(d=>{this.removeIdToken(l_(d))}),i&&n&&i.addFields({multiMatchedID:c.length},n),null):(this.commonLogger.info("CacheManager:getIdToken - Returning id token"),c[0])}getIdTokensByFilter(e,r){let i=r&&r.idToken||this.getTokenKeys().idToken,n=[];return i.forEach(o=>{if(!this.idTokenKeyMatchesFilter(o,{clientId:this.clientId,...e}))return;let c=this.getIdTokenCredential(o);c&&this.credentialMatchesFilter(c,e)&&n.push(c)}),n}idTokenKeyMatchesFilter(e,r){let i=e.toLowerCase();return!(r.clientId&&i.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&i.indexOf(r.homeAccountId.toLowerCase())===-1)}removeIdToken(e){this.removeItem(e)}removeRefreshToken(e){this.removeItem(e)}getAccessToken(e,r,i,n,o){this.commonLogger.trace("CacheManager - getAccessToken called");let c=ri.createSearchScopes(r.scopes),u=r.authenticationScheme||Cr.BEARER,d=u&&u.toLowerCase()!==Cr.BEARER.toLowerCase()?Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME:Fr.ACCESS_TOKEN,y={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:d,clientId:this.clientId,realm:e.tenantId,target:c,tokenType:u,keyId:r.sshKid,requestedClaimsHash:r.requestedClaimsHash},E=i&&i.accessToken||this.getTokenKeys().accessToken,x=[];E.forEach(R=>{if(this.accessTokenKeyMatchesFilter(R,y,!0)){let M=this.getAccessTokenCredential(R);M&&this.credentialMatchesFilter(M,y)&&x.push(M)}});let A=x.length;return A<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):A>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),x.forEach(R=>{this.removeAccessToken(l_(R))}),n&&o&&n.addFields({multiMatchedAT:x.length},o),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),x[0])}accessTokenKeyMatchesFilter(e,r,i){let n=e.toLowerCase();if(r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1||r.realm&&n.indexOf(r.realm.toLowerCase())===-1||r.requestedClaimsHash&&n.indexOf(r.requestedClaimsHash.toLowerCase())===-1)return!1;if(r.target){let o=r.target.asArray();for(let c=0;c{if(!this.accessTokenKeyMatchesFilter(n,e,!0))return;let o=this.getAccessTokenCredential(n);o&&this.credentialMatchesFilter(o,e)&&i.push(o)}),i}getRefreshToken(e,r,i,n,o){this.commonLogger.trace("CacheManager - getRefreshToken called");let c=r?Uc:void 0,u={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Fr.REFRESH_TOKEN,clientId:this.clientId,familyId:c},d=i&&i.refreshToken||this.getTokenKeys().refreshToken,y=[];d.forEach(x=>{if(this.refreshTokenKeyMatchesFilter(x,u)){let A=this.getRefreshTokenCredential(x);A&&this.credentialMatchesFilter(A,u)&&y.push(A)}});let E=y.length;return E<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(E>1&&n&&o&&n.addFields({multiMatchedRT:E},o),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),y[0])}refreshTokenKeyMatchesFilter(e,r){let i=e.toLowerCase();return!(r.familyId&&i.indexOf(r.familyId.toLowerCase())===-1||!r.familyId&&r.clientId&&i.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&i.indexOf(r.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){let r={environment:e,clientId:this.clientId},i=this.getAppMetadataFilteredBy(r),n=Object.keys(i).map(c=>i[c]),o=n.length;if(o<1)return null;if(o>1)throw Ve(Yl);return n[0]}isAppMetadataFOCI(e){let r=this.readAppMetadataFromCache(e);return!!(r&&r.familyId===Uc)}matchHomeAccountId(e,r){return typeof e.homeAccountId=="string"&&r===e.homeAccountId}matchLocalAccountId(e,r){return typeof e.localAccountId=="string"&&r===e.localAccountId}matchUsername(e,r){return typeof e.username=="string"&&r.toLowerCase()===e.username.toLowerCase()}matchName(e,r){return r.toLowerCase()===e.name?.toLowerCase()}matchUserAssertionHash(e,r){return!!(e.userAssertionHash&&r===e.userAssertionHash)}matchEnvironment(e,r){if(this.staticAuthorityOptions){let n=GU(this.staticAuthorityOptions,this.commonLogger);if(n.includes(r)&&n.includes(e.environment))return!0}let i=this.getAuthorityMetadataByAlias(r);return!!(i&&i.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,r){return e.credentialType&&r.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,r){return!!(e.clientId&&r===e.clientId)}matchFamilyId(e,r){return!!(e.familyId&&r===e.familyId)}matchRealm(e,r){return!!(e.realm&&r===e.realm)}matchNativeAccountId(e,r){return!!(e.nativeAccountId&&r===e.nativeAccountId)}matchLoginHint(e,r){return e?.login_hint===r||e.preferred_username===r||e?.upn===r}matchSid(e,r){return!!(e?.sid&&e.sid===r)}matchAuthorityType(e,r){return!!(e.authorityType&&r.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,r){return e.credentialType!==Fr.ACCESS_TOKEN&&e.credentialType!==Fr.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:ri.fromString(e.target).containsScopeSet(r)}matchTokenType(e,r){return!!(e.tokenType&&e.tokenType===r)}matchKeyId(e,r){return!!(e.keyId&&e.keyId===r)}isAppMetadata(e){return e.indexOf(f0)!==-1}isAuthorityMetadata(e){return e.indexOf(ql.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${ql.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,r){for(let i in r)e[i]=r[i];return e}},I0=class extends Pa{setAccount(){throw Ve(Ot)}getAccount(){throw Ve(Ot)}setIdTokenCredential(){throw Ve(Ot)}getIdTokenCredential(){throw Ve(Ot)}setAccessTokenCredential(){throw Ve(Ot)}getAccessTokenCredential(){throw Ve(Ot)}setRefreshTokenCredential(){throw Ve(Ot)}getRefreshTokenCredential(){throw Ve(Ot)}setAppMetadata(){throw Ve(Ot)}getAppMetadata(){throw Ve(Ot)}setServerTelemetry(){throw Ve(Ot)}getServerTelemetry(){throw Ve(Ot)}setAuthorityMetadata(){throw Ve(Ot)}getAuthorityMetadata(){throw Ve(Ot)}getAuthorityMetadataKeys(){throw Ve(Ot)}setThrottlingCache(){throw Ve(Ot)}getThrottlingCache(){throw Ve(Ot)}removeItem(){throw Ve(Ot)}containsKey(){throw Ve(Ot)}getKeys(){throw Ve(Ot)}getAccountKeys(){throw Ve(Ot)}getTokenKeys(){throw Ve(Ot)}async clear(){throw Ve(Ot)}updateCredentialCacheKey(){throw Ve(Ot)}};var GSe=300,KSe={tokenRenewalOffsetSeconds:GSe,preventCorsPreflight:!1},VSe={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:gn.Info,correlationId:He.EMPTY_STRING},WSe={claimsBasedCachingEnabled:!1},YSe={async sendGetRequestAsync(){throw Ve(Ot)},async sendPostRequestAsync(){throw Ve(Ot)}},QSe={sku:He.SKU,version:hh,cpu:He.EMPTY_STRING,os:He.EMPTY_STRING},JSe={clientSecret:He.EMPTY_STRING,clientAssertion:void 0},XSe={azureCloudInstance:sf.None,tenant:`${He.DEFAULT_COMMON_TENANT}`},ZSe={application:{appName:"",appVersion:""}};function VU({authOptions:t,systemOptions:e,loggerOptions:r,cacheOptions:i,storageInterface:n,networkInterface:o,cryptoInterface:c,clientCredentials:u,libraryInfo:d,telemetry:y,serverTelemetryManager:E,persistencePlugin:x,serializableCache:A}){let R={...VSe,...r};return{authOptions:e2e(t),systemOptions:{...KSe,...e},loggerOptions:R,cacheOptions:{...WSe,...i},storageInterface:n||new I0(t.clientId,JA,new ko(R)),networkInterface:o||YSe,cryptoInterface:c||JA,clientCredentials:u||JSe,libraryInfo:{...QSe,...d},telemetry:{...ZSe,...y},serverTelemetryManager:E||null,persistencePlugin:x||null,serializableCache:A||null}}function e2e(t){return{clientCapabilities:[],azureCloudOptions:XSe,skipAuthorityMetadataCache:!1,...t}}function O0(t){return t.authOptions.authority.options.protocolMode===qs.OIDC}m();m();m();var zi=class extends kr{constructor(e,r,i){super(e,r,i),this.name="ServerError",Object.setPrototypeOf(this,zi.prototype)}};var ss=class{static generateThrottlingStorageKey(e){return`${Aa.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,r){let i=ss.generateThrottlingStorageKey(r),n=e.getThrottlingCache(i);if(n){if(n.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(pi.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){let r=e<=0?0:e,i=Date.now()/1e3;return Math.floor(Math.min(i+(r||Aa.DEFAULT_THROTTLE_TIME_SECONDS),i+Aa.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,r,i,n){let o={clientId:r,authority:i.authority,scopes:i.scopes,homeAccountIdentifier:n,claims:i.claims,authenticationScheme:i.authenticationScheme,resourceRequestMethod:i.resourceRequestMethod,resourceRequestUri:i.resourceRequestUri,shrClaims:i.shrClaims,sshKid:i.sshKid},c=this.generateThrottlingStorageKey(o);e.removeItem(c)}};var __=class{constructor(e,r){this.networkClient=e,this.cacheManager=r}async sendPostRequest(e,r,i){ss.preProcess(this.cacheManager,e);let n;try{n=await this.networkClient.sendPostRequestAsync(r,i)}catch(o){throw o instanceof kr?o:Ve(Hl)}return ss.postProcess(this.cacheManager,e,n),n}};m();var Mi={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};m();m();var as=class{static validateRedirectUri(e){if(!e)throw Tr(ph)}static validatePrompt(e){let r=[];for(let i in qc)r.push(qc[i]);if(r.indexOf(e)<0)throw Tr(yh)}static validateClaims(e){try{JSON.parse(e)}catch{throw Tr(Wc)}}static validateCodeChallengeParams(e,r){if(!e||!r)throw Tr(Yc);this.validateCodeChallengeMethod(r)}static validateCodeChallengeMethod(e){if([fh.PLAIN,fh.S256].indexOf(e)<0)throw Tr(_h)}static sanitizeEQParams(e,r){return e?(r.forEach((i,n)=>{e[n]&&delete e[n]}),Object.fromEntries(Object.entries(e).filter(i=>i[1]!==""))):{}}};var ni=class{constructor(){this.parameters=new Map}addResponseTypeCode(){this.parameters.set(_t.RESPONSE_TYPE,encodeURIComponent(He.CODE_RESPONSE_TYPE))}addResponseTypeForTokenAndIdToken(){this.parameters.set(_t.RESPONSE_TYPE,encodeURIComponent(`${He.TOKEN_RESPONSE_TYPE} ${He.ID_TOKEN_RESPONSE_TYPE}`))}addResponseMode(e){this.parameters.set(_t.RESPONSE_MODE,encodeURIComponent(e||Ll.QUERY))}addNativeBroker(){this.parameters.set(_t.NATIVE_BROKER,encodeURIComponent("1"))}addScopes(e,r=!0,i=Fs){r&&!i.includes("openid")&&!e.includes("openid")&&i.push("openid");let n=r?[...e||[],...i]:e||[],o=new ri(n);this.parameters.set(_t.SCOPE,encodeURIComponent(o.printScopes()))}addClientId(e){this.parameters.set(_t.CLIENT_ID,encodeURIComponent(e))}addRedirectUri(e){as.validateRedirectUri(e),this.parameters.set(_t.REDIRECT_URI,encodeURIComponent(e))}addPostLogoutRedirectUri(e){as.validateRedirectUri(e),this.parameters.set(_t.POST_LOGOUT_URI,encodeURIComponent(e))}addIdTokenHint(e){this.parameters.set(_t.ID_TOKEN_HINT,encodeURIComponent(e))}addDomainHint(e){this.parameters.set(l0.DOMAIN_HINT,encodeURIComponent(e))}addLoginHint(e){this.parameters.set(l0.LOGIN_HINT,encodeURIComponent(e))}addCcsUpn(e){this.parameters.set(pi.CCS_HEADER,encodeURIComponent(`UPN:${e}`))}addCcsOid(e){this.parameters.set(pi.CCS_HEADER,encodeURIComponent(`Oid:${e.uid}@${e.utid}`))}addSid(e){this.parameters.set(l0.SID,encodeURIComponent(e))}addClaims(e,r){let i=this.addClientCapabilitiesToClaims(e,r);as.validateClaims(i),this.parameters.set(_t.CLAIMS,encodeURIComponent(i))}addCorrelationId(e){this.parameters.set(_t.CLIENT_REQUEST_ID,encodeURIComponent(e))}addLibraryInfo(e){this.parameters.set(_t.X_CLIENT_SKU,e.sku),this.parameters.set(_t.X_CLIENT_VER,e.version),e.os&&this.parameters.set(_t.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(_t.X_CLIENT_CPU,e.cpu)}addApplicationTelemetry(e){e?.appName&&this.parameters.set(_t.X_APP_NAME,e.appName),e?.appVersion&&this.parameters.set(_t.X_APP_VER,e.appVersion)}addPrompt(e){as.validatePrompt(e),this.parameters.set(`${_t.PROMPT}`,encodeURIComponent(e))}addState(e){e&&this.parameters.set(_t.STATE,encodeURIComponent(e))}addNonce(e){this.parameters.set(_t.NONCE,encodeURIComponent(e))}addCodeChallengeParams(e,r){if(as.validateCodeChallengeParams(e,r),e&&r)this.parameters.set(_t.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(_t.CODE_CHALLENGE_METHOD,encodeURIComponent(r));else throw Tr(Yc)}addAuthorizationCode(e){this.parameters.set(_t.CODE,encodeURIComponent(e))}addDeviceCode(e){this.parameters.set(_t.DEVICE_CODE,encodeURIComponent(e))}addRefreshToken(e){this.parameters.set(_t.REFRESH_TOKEN,encodeURIComponent(e))}addCodeVerifier(e){this.parameters.set(_t.CODE_VERIFIER,encodeURIComponent(e))}addClientSecret(e){this.parameters.set(_t.CLIENT_SECRET,encodeURIComponent(e))}addClientAssertion(e){e&&this.parameters.set(_t.CLIENT_ASSERTION,encodeURIComponent(e))}addClientAssertionType(e){e&&this.parameters.set(_t.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))}addOboAssertion(e){this.parameters.set(_t.OBO_ASSERTION,encodeURIComponent(e))}addRequestTokenUse(e){this.parameters.set(_t.REQUESTED_TOKEN_USE,encodeURIComponent(e))}addGrantType(e){this.parameters.set(_t.GRANT_TYPE,encodeURIComponent(e))}addClientInfo(){this.parameters.set(jU,"1")}addExtraQueryParameters(e){let r=as.sanitizeEQParams(e,this.parameters);Object.keys(r).forEach(i=>{this.parameters.set(i,e[i])})}addClientCapabilitiesToClaims(e,r){let i;if(!e)i={};else try{i=JSON.parse(e)}catch{throw Tr(Wc)}return r&&r.length>0&&(i.hasOwnProperty(lh.ACCESS_TOKEN)||(i[lh.ACCESS_TOKEN]={}),i[lh.ACCESS_TOKEN][lh.XMS_CC]={values:r}),JSON.stringify(i)}addUsername(e){this.parameters.set(i_.username,encodeURIComponent(e))}addPassword(e){this.parameters.set(i_.password,encodeURIComponent(e))}addPopToken(e){e&&(this.parameters.set(_t.TOKEN_TYPE,Cr.POP),this.parameters.set(_t.REQ_CNF,encodeURIComponent(e)))}addSshJwk(e){e&&(this.parameters.set(_t.TOKEN_TYPE,Cr.SSH),this.parameters.set(_t.REQ_CNF,encodeURIComponent(e)))}addServerTelemetry(e){this.parameters.set(_t.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(_t.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())}addThrottling(){this.parameters.set(_t.X_MS_LIB_CAPABILITY,Aa.X_MS_LIB_CAPABILITY_VALUE)}addLogoutHint(e){this.parameters.set(_t.LOGOUT_HINT,encodeURIComponent(e))}createQueryString(){let e=new Array;return this.parameters.forEach((r,i)=>{e.push(`${i}=${r}`)}),e.join("&")}};m();m();m();function WU(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}m();var cf=class{constructor(){this.expiresAt=Ar.nowSeconds()+ql.REFRESH_TIME_SECONDS}updateCloudDiscoveryMetadata(e,r){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=r}updateEndpointMetadata(e,r){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=r,this.jwks_uri=e.jwks_uri}updateCanonicalAuthority(e){this.canonical_authority=e}resetExpiresAt(){this.expiresAt=Ar.nowSeconds()+ql.REFRESH_TIME_SECONDS}isExpired(){return this.expiresAt<=Ar.nowSeconds()}static isAuthorityMetadataEntity(e,r){return r?e.indexOf(ql.CACHE_KEY)===0&&r.hasOwnProperty("aliases")&&r.hasOwnProperty("preferred_cache")&&r.hasOwnProperty("preferred_network")&&r.hasOwnProperty("canonical_authority")&&r.hasOwnProperty("authorization_endpoint")&&r.hasOwnProperty("token_endpoint")&&r.hasOwnProperty("issuer")&&r.hasOwnProperty("aliasesFromNetwork")&&r.hasOwnProperty("endpointsFromNetwork")&&r.hasOwnProperty("expiresAt")&&r.hasOwnProperty("jwks_uri"):!1}};m();function YU(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}m();function QU(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}m();m();var at={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",StandardInteractionClientInitializeAuthorizationCodeRequest:"standardInteractionClientInitializeAuthorizationCodeRequest",GetAuthCodeUrl:"getAuthCodeUrl",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",AuthClientCreateQueryString:"authClientCreateQueryString",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromiseMeasurement",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues"};m();var JU=(t,e,r,i,n)=>(...o)=>{r.trace(`Executing function ${e}`);let c=i?.startMeasurement(e,n);try{let u=t(...o);return c?.end({success:!0}),r.trace(`Returning result from ${e}`),u}catch(u){r.trace(`Error occurred in ${e}`);try{r.trace(JSON.stringify(u))}catch{r.trace("Unable to print error message.")}throw c?.end({success:!1}),u}},Jt=(t,e,r,i,n)=>(...o)=>{r.trace(`Executing function ${e}`);let c=i?.startMeasurement(e,n);return i?.setPreQueueTime(e,n),t(...o).then(u=>(r.trace(`Returning result from ${e}`),c?.end({success:!0}),u)).catch(u=>{r.trace(`Error occurred in ${e}`);try{r.trace(JSON.stringify(u))}catch{r.trace("Unable to print error message.")}throw c?.end({success:!1}),u})};var uf=class{constructor(e,r,i,n){this.networkInterface=e,this.logger=r,this.performanceClient=i,this.correlationId=n}async detectRegion(e,r){this.performanceClient?.addQueueMeasurement(at.RegionDiscoveryDetectRegion,this.correlationId);let i=e;if(i)r.region_source=Ul.ENVIRONMENT_VARIABLE;else{let n=uf.IMDS_OPTIONS;try{let o=await Jt(this.getRegionFromIMDS.bind(this),at.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(He.IMDS_VERSION,n);if(o.status===d0.httpSuccess&&(i=o.body,r.region_source=Ul.IMDS),o.status===d0.httpBadRequest){let c=await Jt(this.getCurrentVersion.bind(this),at.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(n);if(!c)return r.region_source=Ul.FAILED_AUTO_DETECTION,null;let u=await Jt(this.getRegionFromIMDS.bind(this),at.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(c,n);u.status===d0.httpSuccess&&(i=u.body,r.region_source=Ul.IMDS)}}catch{return r.region_source=Ul.FAILED_AUTO_DETECTION,null}}return i||(r.region_source=Ul.FAILED_AUTO_DETECTION),i||null}async getRegionFromIMDS(e,r){return this.performanceClient?.addQueueMeasurement(at.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${He.IMDS_ENDPOINT}?api-version=${e}&format=text`,r,He.IMDS_TIMEOUT)}async getCurrentVersion(e){this.performanceClient?.addQueueMeasurement(at.RegionDiscoveryGetCurrentVersion,this.correlationId);try{let r=await this.networkInterface.sendGetRequestAsync(`${He.IMDS_ENDPOINT}?format=json`,e);return r.status===d0.httpBadRequest&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};uf.IMDS_OPTIONS={headers:{Metadata:"true"}};var Bn=class{constructor(e,r,i,n,o,c,u){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=r,this.cacheManager=i,this.authorityOptions=n,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=o,this.performanceClient=c,this.correlationId=u,this.regionDiscovery=new uf(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(He.CIAM_AUTH_URL))return Io.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case He.ADFS:return Io.Adfs;case He.DSTS:return Io.Dsts}return Io.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new ur(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw Ve(Ti)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw Ve(Ti)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw Ve(Ti)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Ve(nf);return this.replacePath(this.metadata.end_session_endpoint)}else throw Ve(Ti)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw Ve(Ti)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw Ve(Ti)}canReplaceTenant(e){return e.PathSegments.length===1&&!Bn.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Io.Default&&this.protocolMode===qs.AAD}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,n=new ur(this.metadata.canonical_authority).getUrlComponents(),o=n.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((u,d)=>{let y=o[d];if(d===0&&this.canReplaceTenant(n)){let E=new ur(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];y!==E&&(this.logger.verbose(`Replacing tenant domain name ${y} with id ${E}`),y=E)}u!==y&&(r=r.replace(`/${y}/`,`/${u}/`))}),this.replaceTenant(r)}get defaultOpenIdConfigurationEndpoint(){let e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Io.Adfs||this.protocolMode!==qs.AAD&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){this.performanceClient?.addQueueMeasurement(at.AuthorityResolveEndpointsAsync,this.correlationId);let e=this.getCurrentMetadataEntity(),r=await Jt(this.updateCloudDiscoveryMetadata.bind(this),at.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let i=await Jt(this.updateEndpointMetadata.bind(this),at.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,r,{source:i})}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e=new cf,e.updateCanonicalAuthority(this.canonicalAuthority)),e}updateCachedMetadata(e,r,i){r!==Ai.CACHE&&i?.source!==Ai.CACHE&&(e.resetExpiresAt(),e.updateCanonicalAuthority(this.canonicalAuthority));let n=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(n,e),this.metadata=e}async updateEndpointMetadata(e){this.performanceClient?.addQueueMeasurement(at.AuthorityUpdateEndpointMetadata,this.correlationId);let r=this.updateEndpointMetadataFromLocalSources(e);if(r){if(r.source===Ai.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let n=await Jt(this.updateMetadataWithRegionalInformation.bind(this),at.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(r.metadata);e.updateEndpointMetadata(n,!1)}return r.source}let i=await Jt(this.getEndpointMetadataFromNetwork.bind(this),at.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(i=await Jt(this.updateMetadataWithRegionalInformation.bind(this),at.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(i)),e.updateEndpointMetadata(i,!0),Ai.NETWORK;throw Ve($l,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");let r=this.getEndpointMetadataFromConfig();if(r)return this.logger.verbose("Found endpoint metadata in authority configuration"),e.updateEndpointMetadata(r,!1),{source:Ai.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{let n=this.getEndpointMetadataFromHardcodedValues();if(n)return e.updateEndpointMetadata(n,!1),{source:Ai.HARDCODED_VALUES,metadata:n};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}let i=e.isExpired();return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!i?(this.logger.verbose("Found endpoint metadata in the cache."),{source:Ai.CACHE}):(i&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new ur(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Tr(wh)}return null}async getEndpointMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(at.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);let e={},r=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${r}`);try{let i=await this.networkInterface.sendGetRequestAsync(r,e);return WU(i.body)?i.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(i){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${i}`),null}}getEndpointMetadataFromHardcodedValues(){return this.canonicalAuthority in r3?r3[this.canonicalAuthority]:null}async updateMetadataWithRegionalInformation(e){this.performanceClient?.addQueueMeasurement(at.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==He.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=o_.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,Bn.replaceWithRegionalInformation(e,r);let i=await Jt(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),at.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(i)return this.regionDiscoveryMetadata.region_outcome=o_.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=i,Bn.replaceWithRegionalInformation(e,i);this.regionDiscoveryMetadata.region_outcome=o_.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){this.performanceClient?.addQueueMeasurement(at.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let i=await Jt(this.getCloudDiscoveryMetadataFromNetwork.bind(this),at.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return e.updateCloudDiscoveryMetadata(i,!0),Ai.NETWORK;throw Tr(xh)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||He.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||He.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||He.NOT_APPLICABLE}`);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),e.updateCloudDiscoveryMetadata(r,!1),Ai.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{let n=KU(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),e.updateCloudDiscoveryMetadata(n,!1),Ai.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}let i=e.isExpired();return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!i?(this.logger.verbose("Found cloud discovery metadata in the cache."),Ai.CACHE):(i&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Io.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),Bn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");let e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=k0(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),Tr(af)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),Bn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(at.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);let e=`${He.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},i=null;try{let n=await this.networkInterface.sendGetRequestAsync(e,r),o,c;if(YU(n.body))o=n.body,c=o.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${o.tenant_discovery_endpoint}`);else if(QU(n.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${n.status}`),o=n.body,o.error===He.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${o.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${o.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),c=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),i=k0(c,this.hostnameAndPort)}catch(n){if(n instanceof kr)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. -Error: ${n.errorCode} -Error Description: ${n.errorMessage}`);else{let o=n;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata. -Error: ${o.name} -Error Description: ${o.message}`)}return null}return i||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),i=Bn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),i}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(r=>ur.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let i;if(r&&r.azureCloudInstance!==sf.None){let n=r.tenant?r.tenant:He.DEFAULT_COMMON_TENANT;i=`${r.azureCloudInstance}/${n}/`}return i||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw Ve(Ti)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return i3.has(e)}static isPublicCloudAuthority(e){return He.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,i){let n=new ur(e);n.validateAsUri();let o=n.getUrlComponents(),c=`${r}.${o.HostNameAndPort}`;this.isPublicCloudAuthority(o.HostNameAndPort)&&(c=`${r}.${He.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);let u=ur.constructAuthorityUriFromObject({...n.getUrlComponents(),HostNameAndPort:c}).urlString;return i?`${u}?${i}`:u}static replaceWithRegionalInformation(e,r){let i={...e};return i.authorization_endpoint=Bn.buildRegionalAuthorityString(i.authorization_endpoint,r),i.token_endpoint=Bn.buildRegionalAuthorityString(i.token_endpoint,r),i.end_session_endpoint&&(i.end_session_endpoint=Bn.buildRegionalAuthorityString(i.end_session_endpoint,r)),i}static transformCIAMAuthority(e){let r=e,n=new ur(e).getUrlComponents();if(n.PathSegments.length===0&&n.HostNameAndPort.endsWith(He.CIAM_AUTH_URL)){let o=n.HostNameAndPort.split(".")[0];r=`${r}${o}${He.AAD_TENANT_DOMAIN_SUFFIX}`}return r}};Bn.reservedTenantDomains=new Set(["{tenant}","{tenantid}",Lc.COMMON,Lc.CONSUMERS,Lc.ORGANIZATIONS]);function w_(t){return t.endsWith(He.FORWARD_SLASH)?t:`${t}${He.FORWARD_SLASH}`}function o3(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw Tr(af)}return{canonicalAuthority:t.authority?w_(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}var Na=class{static async createDiscoveredInstance(e,r,i,n,o,c,u){c?.addQueueMeasurement(at.AuthorityFactoryCreateDiscoveredInstance,u);let d=Bn.transformCIAMAuthority(w_(e)),y=Na.createInstance(d,r,i,n,o,c,u);try{return await Jt(y.resolveEndpointsAsync.bind(y),at.AuthorityResolveEndpointsAsync,o,c,u)(),y}catch{throw Ve(Ti)}}static createInstance(e,r,i,n,o,c,u){if(!e)throw Tr(Vc);return new Bn(e,r,i,n,o,c,u)}};var no=class{constructor(e,r){this.config=VU(e),this.logger=new ko(this.config.loggerOptions,c_,hh),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new __(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}createTokenRequestHeaders(e){let r={};if(r[pi.CONTENT_TYPE]=He.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Mi.HOME_ACCOUNT_ID:try{let i=Oa(e.credential);r[pi.CCS_HEADER]=`Oid:${i.uid}@${i.utid}`}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case Mi.UPN:r[pi.CCS_HEADER]=`UPN: ${e.credential}`;break}return r}async executePostToTokenEndpoint(e,r,i,n,o,c){c&&this.performanceClient?.addQueueMeasurement(c,o);let u=await this.networkManager.sendPostRequest(n,e,{body:r,headers:i});return this.performanceClient?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:u.headers?.[pi.X_MS_HTTP_VERSION]||""},o),this.config.serverTelemetryManager&&u.status<500&&u.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),u}async updateAuthority(e,r){this.performanceClient?.addQueueMeasurement(at.UpdateTokenEndpointAuthority,r);let i=`https://${e}/${this.authority.tenant}/`,n=await Na.createDiscoveredInstance(i,this.networkClient,this.cacheManager,this.authority.options,this.logger,this.performanceClient,r);this.authority=n}createTokenQueryParameters(e){let r=new ni;return e.tokenQueryParameters&&r.addExtraQueryParameters(e.tokenQueryParameters),r.createQueryString()}};m();m();m();var lf="no_tokens_found",x_="native_account_unavailable",XU="interaction_required",ZU="consent_required",ej="login_required";var tj=[XU,ZU,ej],t2e=["message_only","additional_action","basic_action","user_password_expired","consent_required"],s3={[lf]:"No refresh token found in the cache. Please sign-in.",[x_]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."},zze={noTokensFoundError:{code:lf,desc:s3[lf]},native_account_unavailable:{code:x_,desc:s3[x_]}},Us=class extends kr{constructor(e,r,i,n,o,c,u){super(e,r,i),Object.setPrototypeOf(this,Us.prototype),this.timestamp=n||He.EMPTY_STRING,this.traceId=o||He.EMPTY_STRING,this.correlationId=c||He.EMPTY_STRING,this.claims=u||He.EMPTY_STRING,this.name="InteractionRequiredAuthError"}};function a3(t,e,r){let i=!!t&&tj.indexOf(t)>-1,n=!!r&&t2e.indexOf(r)>-1,o=!!e&&tj.some(c=>e.indexOf(c)>-1);return i||o||n}function rj(t){return new Us(t,s3[t])}m();var E_=class{constructor(e,r,i,n,o){this.account=e||null,this.idToken=r||null,this.accessToken=i||null,this.refreshToken=n||null,this.appMetadata=o||null}};m();var Eh=class{static setRequestState(e,r,i){let n=Eh.generateLibraryState(e,i);return r?`${n}${He.RESOURCE_DELIM}${r}`:n}static generateLibraryState(e,r){if(!e)throw Ve(Gc);let i={id:e.createNewGuid()};r&&(i.meta=r);let n=JSON.stringify(i);return e.base64Encode(n)}static parseRequestState(e,r){if(!e)throw Ve(Gc);if(!r)throw Ve(os);try{let i=r.split(He.RESOURCE_DELIM),n=i[0],o=i.length>1?i.slice(1).join(He.RESOURCE_DELIM):He.EMPTY_STRING,c=e.base64Decode(n),u=JSON.parse(c);return{userRequestState:o||He.EMPTY_STRING,libraryState:u}}catch{throw Ve(os)}}};m();var r2e={SW:"sw",UHW:"uhw"},Ba=class{constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){this.performanceClient?.addQueueMeasurement(at.PopTokenGenerateCnf,e.correlationId);let i=await Jt(this.generateKid.bind(this),at.PopTokenGenerateCnf,r,this.performanceClient,e.correlationId)(e),n=this.cryptoUtils.base64Encode(JSON.stringify(i));return{kid:i.kid,reqCnfString:n,reqCnfHash:await this.cryptoUtils.hashString(n)}}async generateKid(e){return this.performanceClient?.addQueueMeasurement(at.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:r2e.SW}}async signPopToken(e,r,i){return this.signPayload(e,r,i)}async signPayload(e,r,i,n){let{resourceRequestMethod:o,resourceRequestUri:c,shrClaims:u,shrNonce:d,shrOptions:y}=i,x=(c?new ur(c):void 0)?.getUrlComponents();return await this.cryptoUtils.signJwt({at:e,ts:Ar.nowSeconds(),m:o?.toUpperCase(),u:x?.HostNameAndPort,nonce:d||this.cryptoUtils.createNewGuid(),p:x?.AbsolutePath,q:x?.QueryString?[[],x.QueryString]:void 0,client_claims:u||void 0,...n},r,y,i.correlationId)}};m();var io=class{generateAppMetadataKey(){return io.generateAppMetadataCacheKey(this.environment,this.clientId)}static generateAppMetadataCacheKey(e,r){return[f0,e,r].join(tn.CACHE_KEY_SEPARATOR).toLowerCase()}static createAppMetadataEntity(e,r,i){let n=new io;return n.clientId=e,n.environment=r,i&&(n.familyId=i),n}static isAppMetadataEntity(e,r){return r?e.indexOf(f0)===0&&r.hasOwnProperty("clientId")&&r.hasOwnProperty("environment"):!1}};m();var Jc=class{constructor(e,r){this.cache=e,this.hasChanged=r}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}};var ii=class{constructor(e,r,i,n,o,c,u){this.clientId=e,this.cacheStorage=r,this.cryptoObj=i,this.logger=n,this.serializableCache=o,this.persistencePlugin=c,this.performanceClient=u}validateServerAuthorizationCodeResponse(e,r){if(!e.state||!r)throw e.state?Ve(Hc,"Cached State"):Ve(Hc,"Server State");let i,n;try{i=decodeURIComponent(e.state)}catch{throw Ve(os,e.state)}try{n=decodeURIComponent(r)}catch{throw Ve(os,e.state)}if(i!==n)throw Ve(Kl);if(e.error||e.error_description||e.suberror)throw a3(e.error,e.error_description,e.suberror)?new Us(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||""):new zi(e.error||"",e.error_description,e.suberror)}validateTokenResponse(e,r){if(e.error||e.error_description||e.suberror){let i=`${e.error_codes} - [${e.timestamp}]: ${e.error_description} - Correlation ID: ${e.correlation_id} - Trace ID: ${e.trace_id}`,n=new zi(e.error,i,e.suberror);if(r&&e.status&&e.status>=ti.SERVER_ERROR_RANGE_START&&e.status<=ti.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. -${n}`);return}else if(r&&e.status&&e.status>=ti.CLIENT_ERROR_RANGE_START&&e.status<=ti.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. -${n}`);return}throw a3(e.error,e.error_description,e.suberror)?new Us(e.error,e.error_description,e.suberror,e.timestamp||He.EMPTY_STRING,e.trace_id||He.EMPTY_STRING,e.correlation_id||He.EMPTY_STRING,e.claims||He.EMPTY_STRING):n}}async handleServerTokenResponse(e,r,i,n,o,c,u,d,y){this.performanceClient?.addQueueMeasurement(at.HandleServerTokenResponse,e.correlation_id);let E;if(e.id_token){if(E=ka(e.id_token||He.EMPTY_STRING,this.cryptoObj.base64Decode),o&&o.nonce&&E.nonce!==o.nonce)throw Ve(Vl);if(n.maxAge||n.maxAge===0){let M=E.auth_time;if(!M)throw Ve(Ta);u_(M,n.maxAge)}}this.homeAccountIdentifier=Nn.generateHomeAccountId(e.client_info||He.EMPTY_STRING,r.authorityType,this.logger,this.cryptoObj,E);let x;!!o&&!!o.state&&(x=Eh.parseRequestState(this.cryptoObj,o.state)),e.key_id=e.key_id||n.sshKid||void 0;let A=this.generateCacheRecord(e,r,i,n,E,c,o),R;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),R=new Jc(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(R)),u&&!d&&A.account){let M=A.account.generateAccountKey();if(!this.cacheStorage.getAccount(M))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),ii.generateAuthenticationResult(this.cryptoObj,r,A,!1,n,E,x,void 0,y)}await this.cacheStorage.saveCacheRecord(A,n.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&R&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(R))}return ii.generateAuthenticationResult(this.cryptoObj,r,A,!1,n,E,x,e,y)}generateCacheRecord(e,r,i,n,o,c,u){let d=r.getPreferredCache();if(!d)throw Ve(Ra);let y,E;e.id_token&&!!o&&(y=XA(this.homeAccountIdentifier,d,e.id_token,this.clientId,o.tid||""),E=Nn.createAccount({homeAccountId:this.homeAccountIdentifier,idTokenClaims:o,clientInfo:e.client_info,cloudGraphHostName:u?.cloud_graph_host_name,msGraphHost:u?.msgraph_host},r));let x=null;if(e.access_token){let M=e.scope?ri.fromString(e.scope):new ri(n.scopes||[]),I=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,D=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,O=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,N=i+I,L=N+D,j=O&&O>0?i+O:void 0;x=ZA(this.homeAccountIdentifier,d,e.access_token,this.clientId,o?.tid||r.tenant,M.printScopes(),N,L,this.cryptoObj.base64Decode,j,e.token_type,c,e.key_id,n.claims,n.requestedClaimsHash)}let A=null;e.refresh_token&&(A=e3(this.homeAccountIdentifier,d,e.refresh_token,this.clientId,e.foci,c));let R=null;return e.foci&&(R=io.createAppMetadataEntity(this.clientId,d,e.foci)),new E_(E,y,x,A,R)}static async generateAuthenticationResult(e,r,i,n,o,c,u,d,y){let E=He.EMPTY_STRING,x=[],A=null,R,M,I=He.EMPTY_STRING;if(i.accessToken){if(i.accessToken.tokenType===Cr.POP){let L=new Ba(e),{secret:j,keyId:H}=i.accessToken;if(!H)throw Ve(of);E=await L.signPopToken(j,H,o)}else E=i.accessToken.secret;x=ri.fromString(i.accessToken.target).asArray(),A=new Date(Number(i.accessToken.expiresOn)*1e3),R=new Date(Number(i.accessToken.extendedExpiresOn)*1e3),i.accessToken.refreshOn&&(M=new Date(Number(i.accessToken.refreshOn)*1e3))}i.appMetadata&&(I=i.appMetadata.familyId===Uc?Uc:"");let D=c?.oid||c?.sub||"",O=c?.tid||"";d?.spa_accountid&&!!i.account&&(i.account.nativeAccountId=d?.spa_accountid);let N=i.account?{...i.account.getAccountInfo(),idTokenClaims:c}:null;return{authority:r.canonicalAuthority,uniqueId:D,tenantId:O,scopes:x,account:N,idToken:i?.idToken?.secret||"",idTokenClaims:c||{},accessToken:E,fromCache:n,expiresOn:A,extExpiresOn:R,refreshOn:M,correlationId:o.correlationId,requestId:y||He.EMPTY_STRING,familyId:I,tokenType:i.accessToken?.tokenType||He.EMPTY_STRING,state:u?u.userRequestState:He.EMPTY_STRING,cloudGraphHostName:i.account?.cloudGraphHostName||He.EMPTY_STRING,msGraphHost:i.account?.msGraphHost||He.EMPTY_STRING,code:d?.spa_code,fromNativeBroker:!1}}};var Sh=class extends no{constructor(e,r){super(e,r),this.includeRedirectUri=!0,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async getAuthCodeUrl(e){this.performanceClient?.addQueueMeasurement(at.GetAuthCodeUrl,e.correlationId);let r=await Jt(this.createAuthCodeUrlQueryString.bind(this),at.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return ur.appendQueryString(this.authority.authorizationEndpoint,r)}async acquireToken(e,r){if(this.performanceClient?.addQueueMeasurement(at.AuthClientAcquireToken,e.correlationId),!e.code)throw Ve(Ql);let i=Ar.nowSeconds(),n=await Jt(this.executeTokenRequest.bind(this),at.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),o=n.headers?.[pi.X_MS_REQUEST_ID],c=new ii(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return c.validateTokenResponse(n.body),Jt(c.handleServerTokenResponse.bind(c),at.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(n.body,this.authority,i,e,r,void 0,void 0,void 0,o)}handleFragmentResponse(e,r){if(new ii(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,r),!e.code)throw Ve(tf);return e}getLogoutUri(e){if(!e)throw Tr(bh);let r=this.createLogoutUrlQueryString(e);return ur.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r){this.performanceClient?.addQueueMeasurement(at.AuthClientExecuteTokenRequest,r.correlationId);let i=this.createTokenQueryParameters(r),n=ur.appendQueryString(e.tokenEndpoint,i),o=await Jt(this.createTokenRequestBody.bind(this),at.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,r.correlationId)(r),c;if(r.clientInfo)try{let y=D0(r.clientInfo,this.cryptoUtils);c={credential:`${y.uid}${tn.CLIENT_INFO_SEPARATOR}${y.utid}`,type:Mi.HOME_ACCOUNT_ID}}catch(y){this.logger.verbose("Could not parse client info for CCS Header: "+y)}let u=this.createTokenRequestHeaders(c||r.ccsCredential),d={clientId:r.tokenBodyParameters?.clientId||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:r.scopes,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid};return Jt(this.executePostToTokenEndpoint.bind(this),at.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,r.correlationId)(n,o,u,d,r.correlationId,at.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(at.AuthClientCreateTokenRequestBody,e.correlationId);let r=new ni;if(r.addClientId(e.tokenBodyParameters?.[_t.CLIENT_ID]||this.config.authOptions.clientId),this.includeRedirectUri?r.addRedirectUri(e.redirectUri):as.validateRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,this.oidcDefaultScopes),r.addAuthorizationCode(e.code),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!O0(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&r.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;r.addClientAssertion(o.assertion),r.addClientAssertionType(o.assertionType)}if(r.addGrantType(Ca.AUTHORIZATION_CODE_GRANT),r.addClientInfo(),e.authenticationScheme===Cr.POP){let o=new Ba(this.cryptoUtils,this.performanceClient),c=await Jt(o.generateCnf.bind(o),at.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);r.addPopToken(c.reqCnfString)}else if(e.authenticationScheme===Cr.SSH)if(e.sshJwk)r.addSshJwk(e.sshJwk);else throw Tr(Qc);let i=e.correlationId||this.config.cryptoInterface.createNewGuid();r.addCorrelationId(i),(!dn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=D0(e.clientInfo,this.cryptoUtils);n={credential:`${o.uid}${tn.CLIENT_INFO_SEPARATOR}${o.utid}`,type:Mi.HOME_ACCOUNT_ID}}catch(o){this.logger.verbose("Could not parse client info for CCS Header: "+o)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case Mi.HOME_ACCOUNT_ID:try{let o=Oa(n.credential);r.addCcsOid(o)}catch(o){this.logger.verbose("Could not parse home account ID for CCS Header: "+o)}break;case Mi.UPN:r.addCcsUpn(n.credential);break}return e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[_t.RETURN_SPA_CODE])&&r.addExtraQueryParameters({[_t.RETURN_SPA_CODE]:"1"}),r.createQueryString()}async createAuthCodeUrlQueryString(e){this.performanceClient?.addQueueMeasurement(at.AuthClientCreateQueryString,e.correlationId);let r=new ni;r.addClientId(e.extraQueryParameters?.[_t.CLIENT_ID]||this.config.authOptions.clientId);let i=[...e.scopes||[],...e.extraScopesToConsent||[]];r.addScopes(i,!0,this.oidcDefaultScopes),r.addRedirectUri(e.redirectUri);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();if(r.addCorrelationId(n),r.addResponseMode(e.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),O0(this.config)||r.addApplicationTelemetry(this.config.telemetry.application),r.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&r.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&r.addPrompt(e.prompt),e.domainHint&&r.addDomainHint(e.domainHint),e.prompt!==qc.SELECT_ACCOUNT)if(e.sid&&e.prompt===qc.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(e.sid);else if(e.account){let o=this.extractAccountSid(e.account),c=this.extractLoginHint(e.account);if(c){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),r.addLoginHint(c);try{let u=Oa(e.account.homeAccountId);r.addCcsOid(u)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(o&&e.prompt===qc.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(o);try{let u=Oa(e.account.homeAccountId);r.addCcsOid(u)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(e.account.username);try{let u=Oa(e.account.homeAccountId);r.addCcsOid(u)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&r.addNonce(e.nonce),e.state&&r.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.extraQueryParameters&&r.addExtraQueryParameters(e.extraQueryParameters),e.nativeBroker&&(r.addNativeBroker(),e.authenticationScheme===Cr.POP)){let o=new Ba(this.cryptoUtils),c=await Jt(o.generateCnf.bind(o),at.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);r.addPopToken(c.reqCnfHash)}return r.createQueryString()}createLogoutUrlQueryString(e){let r=new ni;return e.postLogoutRedirectUri&&r.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&r.addCorrelationId(e.correlationId),e.idTokenHint&&r.addIdTokenHint(e.idTokenHint),e.state&&r.addState(e.state),e.logoutHint&&r.addLogoutHint(e.logoutHint),e.extraQueryParameters&&r.addExtraQueryParameters(e.extraQueryParameters),r.createQueryString()}extractAccountSid(e){return e.idTokenClaims?.sid||null}extractLoginHint(e){return e.idTokenClaims?.login_hint||null}};m();var Xc=class extends no{constructor(e,r){super(e,r)}async acquireToken(e){this.performanceClient?.addQueueMeasurement(at.RefreshTokenClientAcquireToken,e.correlationId);let r=Ar.nowSeconds(),i=await Jt(this.executeTokenRequest.bind(this),at.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),n=i.headers?.[pi.X_MS_REQUEST_ID],o=new ii(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(i.body),Jt(o.handleServerTokenResponse.bind(o),at.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,r,e,void 0,void 0,!0,e.forceCache,n)}async acquireTokenByRefreshToken(e){if(!e)throw Tr(vh);if(this.performanceClient?.addQueueMeasurement(at.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw Ve(Ma);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return Jt(this.acquireTokenWithCachedRefreshToken.bind(this),at.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(i){let n=i instanceof Us&&i.errorCode===lf,o=i instanceof zi&&i.errorCode===n_.INVALID_GRANT_ERROR&&i.subError===n_.CLIENT_MISMATCH_ERROR;if(n||o)return Jt(this.acquireTokenWithCachedRefreshToken.bind(this),at.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw i}return Jt(this.acquireTokenWithCachedRefreshToken.bind(this),at.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,r){this.performanceClient?.addQueueMeasurement(at.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);let i=JU(this.cacheManager.getRefreshToken.bind(this.cacheManager),at.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,r,void 0,this.performanceClient,e.correlationId);if(!i)throw rj(lf);let n={...e,refreshToken:i.secret,authenticationScheme:e.authenticationScheme||Cr.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Mi.HOME_ACCOUNT_ID}};return Jt(this.acquireToken.bind(this),at.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(n)}async executeTokenRequest(e,r){this.performanceClient?.addQueueMeasurement(at.RefreshTokenClientExecuteTokenRequest,e.correlationId);let i=this.createTokenQueryParameters(e),n=ur.appendQueryString(r.tokenEndpoint,i),o=await Jt(this.createTokenRequestBody.bind(this),at.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),c=this.createTokenRequestHeaders(e.ccsCredential),u={clientId:e.tokenBodyParameters?.clientId||this.config.authOptions.clientId,authority:r.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return Jt(this.executePostToTokenEndpoint.bind(this),at.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(n,o,c,u,e.correlationId,at.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(at.RefreshTokenClientCreateTokenRequestBody,e.correlationId);let r=e.correlationId,i=new ni;if(i.addClientId(e.tokenBodyParameters?.[_t.CLIENT_ID]||this.config.authOptions.clientId),e.redirectUri&&i.addRedirectUri(e.redirectUri),i.addScopes(e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),i.addGrantType(Ca.REFRESH_TOKEN_GRANT),i.addClientInfo(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addThrottling(),this.serverTelemetryManager&&!O0(this.config)&&i.addServerTelemetry(this.serverTelemetryManager),i.addCorrelationId(r),i.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&i.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;i.addClientAssertion(n.assertion),i.addClientAssertionType(n.assertionType)}if(e.authenticationScheme===Cr.POP){let n=new Ba(this.cryptoUtils,this.performanceClient),o=await Jt(n.generateCnf.bind(n),at.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);i.addPopToken(o.reqCnfString)}else if(e.authenticationScheme===Cr.SSH)if(e.sshJwk)i.addSshJwk(e.sshJwk);else throw Tr(Qc);if((!dn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Mi.HOME_ACCOUNT_ID:try{let n=Oa(e.ccsCredential.credential);i.addCcsOid(n)}catch(n){this.logger.verbose("Could not parse home account ID for CCS Header: "+n)}break;case Mi.UPN:i.addCcsUpn(e.ccsCredential.credential);break}return e.tokenBodyParameters&&i.addExtraQueryParameters(e.tokenBodyParameters),i.createQueryString()}};m();var P0=class extends no{constructor(e,r){super(e,r)}async acquireToken(e){try{let[r,i]=await this.acquireCachedToken(e);return i===is.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new Xc(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),r}catch(r){if(r instanceof Kc&&r.errorCode===Ls)return new Xc(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw r}}async acquireCachedToken(e){this.performanceClient?.addQueueMeasurement(at.SilentFlowClientAcquireCachedToken,e.correlationId);let r=is.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!dn.isEmptyObj(e.claims))throw this.setCacheOutcome(is.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Ve(Ls);if(!e.account)throw Ve(Ma);let i=e.authority||this.authority.getPreferredCache(),n=this.cacheManager.readCacheRecord(e.account,e,i,this.performanceClient,e.correlationId);if(n.accessToken){if(Ar.wasClockTurnedBack(n.accessToken.cachedAt)||Ar.isTokenExpired(n.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(is.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Ve(Ls);n.accessToken.refreshOn&&Ar.isTokenExpired(n.accessToken.refreshOn,0)&&(r=is.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(is.NO_CACHED_ACCESS_TOKEN,e.correlationId),Ve(Ls);return this.setCacheOutcome(r,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Jt(this.generateResultFromCacheRecord.bind(this),at.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(n,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==is.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,r){this.performanceClient?.addQueueMeasurement(at.SilentFlowClientGenerateResultFromCacheRecord,r.correlationId);let i;if(e.idToken&&(i=ka(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let n=i?.auth_time;if(!n)throw Ve(Ta);u_(n,r.maxAge)}return await ii.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,i)}};m();var N0=class{static isThrottlingEntity(e,r){let i=!1;e&&(i=e.indexOf(Aa.THROTTLING_PREFIX)===0);let n=!0;return r&&(n=r.hasOwnProperty("throttleTime")),i&&n}};m();var Zc=class{constructor(e,r){this.cacheOutcome=is.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||He.EMPTY_STRING,this.wrapperVer=e.wrapperVer||He.EMPTY_STRING,this.telemetryCacheKey=Pn.CACHE_KEY+tn.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${Pn.VALUE_SEPARATOR}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer].join(Pn.VALUE_SEPARATOR),i=this.getRegionDiscoveryFields(),n=[e,i].join(Pn.VALUE_SEPARATOR);return[Pn.SCHEMA_VERSION,n,r].join(Pn.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=Zc.maxErrorsToSend(e),i=e.failedRequests.slice(0,2*r).join(Pn.VALUE_SEPARATOR),n=e.errors.slice(0,r).join(Pn.VALUE_SEPARATOR),o=e.errors.length,c=r=Pn.MAX_CACHED_ERRORS&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&!!e&&e.toString()?e instanceof kr?e.subError?r.errors.push(e.subError):e.errorCode?r.errors.push(e.errorCode):r.errors.push(e.toString()):r.errors.push(e.toString()):r.errors.push(Pn.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r)}incrementCacheHits(){let e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){let e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){let e=this.getLastRequests(),r=Zc.maxErrorsToSend(e),i=e.errors.length;if(r===i)this.cacheManager.removeItem(this.telemetryCacheKey);else{let n={failedRequests:e.failedRequests.slice(r*2),errors:e.errors.slice(r),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n)}}static maxErrorsToSend(e){let r,i=0,n=0,o=e.errors.length;for(r=0;r{let c=new URL(t),u=new URL(e),d=i?.headers||{},y={host:u.hostname,port:u.port,method:"CONNECT",path:c.hostname,headers:d};o&&(y.timeout=o),n&&Object.keys(n).length&&(y.agent=new c3.default.Agent(n));let E="";if(r===ff.POST){let A=i?.body||"";E=`Content-Type: application/x-www-form-urlencoded\r -Content-Length: ${A.length}\r -\r -${A}`}let x=`${r.toUpperCase()} ${c.href} HTTP/1.1\r -Host: ${c.host}\r -Connection: close\r -`+E+`\r -`;return new Promise((A,R)=>{let M=c3.default.request(y);y.timeout&&M.on("timeout",()=>{M.destroy(),R(new Error("Request time out"))}),M.end(),M.on("connect",(I,D)=>{let O=I?.statusCode||S_.SERVER_ERROR;(OS_.SUCCESS_RANGE_END)&&(M.destroy(),D.destroy(),R(new Error(`Error connecting to proxy. Http status code: ${I.statusCode}. Http status message: ${I?.statusMessage||"Unknown"}`))),y.timeout&&(D.setTimeout(y.timeout),D.on("timeout",()=>{M.destroy(),D.destroy(),R(new Error("Request time out"))})),D.write(x);let N=[];D.on("data",L=>{N.push(L)}),D.on("end",()=>{let j=T.concat([...N]).toString().split(`\r -`),H=parseInt(j[0].split(" ")[1]),Y=j[0].split(" ").slice(2).join(" "),W=j[j.length-1],q=j.slice(1,j.length-2),J=new Map;q.forEach(p=>{let f=p.split(new RegExp(/:\s(.*)/s)),h=f[0],b=f[1];try{let w=JSON.parse(b);w&&typeof w=="object"&&(b=w)}catch{}J.set(h,b)});let s=Object.fromEntries(J),l=Ch.getNetworkResponse(s,aj(H,Y,s,W),H);(Hti.SUCCESS_RANGE_END)&&l.body.error!==Ri.AUTHORIZATION_PENDING&&M.destroy(),A(l)}),D.on("error",L=>{M.destroy(),D.destroy(),R(new Error(L.toString()))})}),M.on("error",I=>{M.destroy(),R(new Error(I.toString()))})})},sj=(t,e,r,i,n)=>{let o=e===ff.POST,c=r?.body||"",u=new URL(t),d=r?.headers||{},y={method:e,headers:d,...Ch.urlToHttpOptions(u)};return n&&(y.timeout=n),i&&Object.keys(i).length&&(y.agent=new u3.default.Agent(i)),o&&(y.headers={...y.headers,"Content-Length":c.length}),new Promise((E,x)=>{let A=u3.default.request(y);n&&A.on("timeout",()=>{A.destroy(),x(new Error("Request time out"))}),o&&A.write(c),A.end(),A.on("response",R=>{let M=R.headers,I=R.statusCode,D=R.statusMessage,O=[];R.on("data",N=>{O.push(N)}),R.on("end",()=>{let N=T.concat([...O]).toString(),L=M,j=Ch.getNetworkResponse(L,aj(I,D,L,N),I);(Iti.SUCCESS_RANGE_END)&&j.body.error!==Ri.AUTHORIZATION_PENDING&&A.destroy(),E(j)})}),A.on("error",R=>{A.destroy(),x(new Error(R.toString()))})})},aj=(t,e,r,i)=>{let n;try{n=JSON.parse(i)}catch{let c,u;t>=ti.CLIENT_ERROR_RANGE_START&&t<=ti.CLIENT_ERROR_RANGE_END?(c="client_error",u="A client"):t>=ti.SERVER_ERROR_RANGE_START&&t<=ti.SERVER_ERROR_RANGE_END?(c="server_error",u="A server"):(c="unknown_error",u="An unknown"),n={error:c,error_description:`${u} error occured. -Http status code: ${t} -Http status message: ${e||"Unknown"} -Headers: ${JSON.stringify(r)}`}}return n};var i2e={clientId:He.EMPTY_STRING,authority:He.DEFAULT_AUTHORITY,clientSecret:He.EMPTY_STRING,clientAssertion:He.EMPTY_STRING,clientCertificate:{thumbprint:He.EMPTY_STRING,privateKey:He.EMPTY_STRING,x5c:He.EMPTY_STRING},knownAuthorities:[],cloudDiscoveryMetadata:He.EMPTY_STRING,authorityMetadata:He.EMPTY_STRING,clientCapabilities:[],protocolMode:qs.AAD,azureCloudOptions:{azureCloudInstance:sf.None,tenant:He.EMPTY_STRING},skipAuthorityMetadataCache:!1},o2e={claimsBasedCachingEnabled:!1},cj={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:gn.Info},s2e={loggerOptions:cj,networkClient:new B0,proxyUrl:He.EMPTY_STRING,customAgentOptions:{}},a2e={application:{appName:He.EMPTY_STRING,appVersion:He.EMPTY_STRING}};function l3({auth:t,broker:e,cache:r,system:i,telemetry:n}){let o={...s2e,networkClient:new B0(i?.proxyUrl,i?.customAgentOptions),loggerOptions:i?.loggerOptions||cj};return{auth:{...i2e,...t},broker:{...e},cache:{...o2e,...r},system:{...o,...i},telemetry:{...a2e,...n}}}m();m();m();m();var T_,c2e=new Uint8Array(16);function f3(){if(!T_&&(T_=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!T_))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return T_(c2e)}m();m();m();var uj=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function u2e(t){return typeof t=="string"&&uj.test(t)}var lj=u2e;var oi=[];for(M_=0;M_<256;++M_)oi.push((M_+256).toString(16).substr(1));var M_;function l2e(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(oi[t[e+0]]+oi[t[e+1]]+oi[t[e+2]]+oi[t[e+3]]+"-"+oi[t[e+4]]+oi[t[e+5]]+"-"+oi[t[e+6]]+oi[t[e+7]]+"-"+oi[t[e+8]]+oi[t[e+9]]+"-"+oi[t[e+10]]+oi[t[e+11]]+oi[t[e+12]]+oi[t[e+13]]+oi[t[e+14]]+oi[t[e+15]]).toLowerCase();if(!lj(r))throw TypeError("Stringified UUID is invalid");return r}var fj=l2e;m();function f2e(t,e,r){t=t||{};var i=t.random||(t.rng||f3)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){r=r||0;for(var n=0;n<16;++n)e[r+n]=i[n];return e}return fj(i)}var F0=f2e;var R_=class{generateGuid(){return F0()}isGuid(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}};m();var Hi=class{static base64Encode(e,r){return T.from(e,r).toString("base64")}static base64EncodeUrl(e,r){return Hi.base64Encode(e,r).replace(/=/g,He.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return T.from(e,"base64").toString("utf8")}static base64DecodeUrl(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");for(;r.length%4;)r+="=";return Hi.base64Decode(r)}};m();m();var dj=Et(Dl(),1);var Ah=class{sha256(e){return dj.default.createHash(ij.SHA256).update(e).digest()}};var hj=Et(Dl(),1);var D_=class{constructor(){this.hashUtils=new Ah}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%C_.CV_CHARSET.length;for(;e.length<=nj;){let n=hj.default.randomBytes(1)[0];if(n>=r)continue;let o=n%C_.CV_CHARSET.length;e.push(C_.CV_CHARSET[o])}let i=e.join(He.EMPTY_STRING);return Hi.base64EncodeUrl(i)}generateCodeChallengeFromVerifier(e){return Hi.base64EncodeUrl(this.hashUtils.sha256(e).toString("base64"),"base64")}};var df=class{constructor(){this.pkceGenerator=new D_,this.guidGenerator=new R_,this.hashUtils=new Ah}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return Hi.base64Encode(e)}base64Decode(e){return Hi.base64Decode(e)}generatePkceCodes(){return this.pkceGenerator.generatePkceCodes()}getPublicKeyThumbprint(){throw new Error("Method not implemented.")}removeTokenBindingKey(){throw new Error("Method not implemented.")}clearKeystore(){throw new Error("Method not implemented.")}signJwt(){throw new Error("Method not implemented.")}async hashString(e){return Hi.base64EncodeUrl(this.hashUtils.sha256(e).toString("base64"),"base64")}};m();var L0=class extends Pa{constructor(e,r,i,n){super(r,i,e,n),this.cache={},this.changeEmitters=[],this.logger=e}registerChangeEmitter(e){this.changeEmitters.push(e)}emitChange(){this.changeEmitters.forEach(e=>e.call(null))}cacheToInMemoryCache(e){let r={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(let i in e){let n=e[i];if(typeof n=="object")if(n instanceof Nn)r.accounts[i]=n;else if(ji.isIdTokenEntity(n))r.idTokens[i]=n;else if(ji.isAccessTokenEntity(n))r.accessTokens[i]=n;else if(ji.isRefreshTokenEntity(n))r.refreshTokens[i]=n;else if(n instanceof io)r.appMetadata[i]=n;else continue}return r}inMemoryCacheToCache(e){let r=this.getCache();return r={...r,...e.accounts,...e.idTokens,...e.accessTokens,...e.refreshTokens,...e.appMetadata},r}getInMemoryCache(){return this.logger.trace("Getting in-memory cache"),this.cacheToInMemoryCache(this.getCache())}setInMemoryCache(e){this.logger.trace("Setting in-memory cache");let r=this.inMemoryCacheToCache(e);this.setCache(r),this.emitChange()}getCache(){return this.logger.trace("Getting cache key-value store"),this.cache}setCache(e){this.logger.trace("Setting cache key value store"),this.cache=e,this.emitChange()}getItem(e){return this.logger.tracePii(`Item key: ${e}`),this.getCache()[e]}setItem(e,r){this.logger.tracePii(`Item key: ${e}`);let i=this.getCache();i[e]=r,this.setCache(i)}getAccountKeys(){let e=this.getInMemoryCache();return Object.keys(e.accounts)}getTokenKeys(){let e=this.getInMemoryCache();return{idToken:Object.keys(e.idTokens),accessToken:Object.keys(e.accessTokens),refreshToken:Object.keys(e.refreshTokens)}}getAccount(e){let r=this.getItem(e);return Nn.isAccountEntity(r)?r:null}setAccount(e){let r=e.generateAccountKey();this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return ji.isIdTokenEntity(r)?r:null}setIdTokenCredential(e){let r=ji.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return ji.isAccessTokenEntity(r)?r:null}setAccessTokenCredential(e){let r=ji.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return ji.isRefreshTokenEntity(r)?r:null}setRefreshTokenCredential(e){let r=ji.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return io.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=e.generateAppMetadataKey();this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&ji.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&cf.isAuthorityMetadataEntity(e,r)?r:null}getAuthorityMetadataKeys(){return this.getKeys().filter(e=>this.isAuthorityMetadata(e))}setAuthorityMetadata(e,r){this.setItem(e,r)}getThrottlingCache(e){let r=this.getItem(e);return r&&N0.isThrottlingEntity(e,r)?r:null}setThrottlingCache(e,r){this.setItem(e,r)}removeItem(e){this.logger.tracePii(`Item key: ${e}`);let r=!1,i=this.getCache();return i[e]&&(delete i[e],r=!0),r&&(this.setCache(i),this.emitChange()),r}containsKey(e){return this.getKeys().includes(e)}getKeys(){this.logger.trace("Retrieving all cache keys");let e=this.getCache();return[...Object.keys(e)]}async clear(){this.logger.trace("Clearing cache entries created by MSAL"),this.getKeys().forEach(r=>{this.removeItem(r)}),this.emitChange()}static generateInMemoryCache(e){return eu.deserializeAllCache(eu.deserializeJSONBlob(e))}static generateJsonCache(e){return Fl.serializeAllCache(e)}updateCredentialCacheKey(e,r){let i=ji.generateCredentialKey(r);if(e!==i){let n=this.getItem(e);if(n)return this.removeItem(e),this.setItem(i,n),this.logger.verbose(`Updated an outdated ${r.credentialType} cache key`),i;this.logger.error(`Attempted to update an outdated ${r.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}};m();var q0={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},U0=class{constructor(e,r,i){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),i&&(this.persistence=i),this.logger=r}hasChanged(){return this.cacheHasChanged}serialize(){this.logger.trace("Serializing in-memory cache");let e=Fl.serializeAllCache(this.storage.getInMemoryCache());return this.cacheSnapshot?(this.logger.trace("Reading cache snapshot from disk"),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)):this.logger.trace("No cache snapshot to merge"),this.cacheHasChanged=!1,JSON.stringify(e)}deserialize(e){if(this.logger.trace("Deserializing JSON to in-memory cache"),this.cacheSnapshot=e,this.cacheSnapshot){this.logger.trace("Reading cache snapshot from disk");let r=eu.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(r)}else this.logger.trace("No cache snapshot to deserialize")}getKVStore(){return this.storage.getCache()}async getAllAccounts(){this.logger.trace("getAllAccounts called");let e;try{return this.persistence&&(e=new Jc(this,!1),await this.persistence.beforeCacheAccess(e)),this.storage.getAllAccounts()}finally{this.persistence&&e&&await this.persistence.afterCacheAccess(e)}}async getAccountByHomeId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(i=>i.homeAccountId===e)[0]||null}async getAccountByLocalId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(i=>i.localAccountId===e)[0]||null}async removeAccount(e){this.logger.trace("removeAccount called");let r;try{this.persistence&&(r=new Jc(this,!0),await this.persistence.beforeCacheAccess(r)),await this.storage.removeAccount(Nn.generateAccountCacheKey(e))}finally{this.persistence&&r&&await this.persistence.afterCacheAccess(r)}}handleChangeEvent(){this.cacheHasChanged=!0}mergeState(e,r){this.logger.trace("Merging in-memory cache with cache snapshot");let i=this.mergeRemovals(e,r);return this.mergeUpdates(i,r)}mergeUpdates(e,r){return Object.keys(r).forEach(i=>{let n=r[i];if(!e.hasOwnProperty(i))n!==null&&(e[i]=n);else{let o=n!==null,c=typeof n=="object",u=!Array.isArray(n),d=typeof e[i]<"u"&&e[i]!==null;o&&c&&u&&d?this.mergeUpdates(e[i],n):e[i]=n}}),e}mergeRemovals(e,r){this.logger.trace("Remove updated entries in cache");let i=e.Account?this.mergeRemovalsDict(e.Account,r.Account):e.Account,n=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,r.AccessToken):e.AccessToken,o=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,r.RefreshToken):e.RefreshToken,c=e.IdToken?this.mergeRemovalsDict(e.IdToken,r.IdToken):e.IdToken,u=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,r.AppMetadata):e.AppMetadata;return{...e,Account:i,AccessToken:n,RefreshToken:o,IdToken:c,AppMetadata:u}}mergeRemovalsDict(e,r){let i={...e};return Object.keys(e).forEach(n=>{(!r||!r.hasOwnProperty(n))&&delete i[n]}),i}overlayDefaults(e){return this.logger.trace("Overlaying input cache with the default cache"),{Account:{...q0.Account,...e.Account},IdToken:{...q0.IdToken,...e.IdToken},AccessToken:{...q0.AccessToken,...e.AccessToken},RefreshToken:{...q0.RefreshToken,...e.RefreshToken},AppMetadata:{...q0.AppMetadata,...e.AppMetadata}}}};m();var pj="@azure/msal-node",k_="2.5.1";m();var mi={invalidLoopbackAddressType:{code:"invalid_loopback_server_address_type",desc:"Loopback server address is not type string. This is unexpected."},unableToLoadRedirectUri:{code:"unable_to_load_redirectUrl",desc:"Loopback server callback was invoked without a url. This is unexpected."},noAuthCodeInResponse:{code:"no_auth_code_in_response",desc:"No auth code found in the server response. Please check your network trace to determine what happened."},noLoopbackServerExists:{code:"no_loopback_server_exists",desc:"No loopback server exists yet."},loopbackServerAlreadyExists:{code:"loopback_server_already_exists",desc:"Loopback server already exists. Cannot create another."},loopbackServerTimeout:{code:"loopback_server_timeout",desc:"Timed out waiting for auth code listener to be registered."},stateNotFoundError:{code:"state_not_found",desc:"State not found. Please verify that the request originated from msal."}},Cn=class extends kr{constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new Cn(mi.invalidLoopbackAddressType.code,`${mi.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new Cn(mi.unableToLoadRedirectUri.code,`${mi.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new Cn(mi.noAuthCodeInResponse.code,`${mi.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new Cn(mi.noLoopbackServerExists.code,`${mi.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new Cn(mi.loopbackServerAlreadyExists.code,`${mi.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new Cn(mi.loopbackServerTimeout.code,`${mi.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new Cn(mi.stateNotFoundError.code,mi.stateNotFoundError.desc)}};m();var j0=class extends no{constructor(e){super(e)}async acquireToken(e){this.logger.info("in acquireToken call in username-password client");let r=Ar.nowSeconds(),i=await this.executeTokenRequest(this.authority,e),n=new ii(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return n.validateTokenResponse(i.body),n.handleServerTokenResponse(i.body,this.authority,r,e)}async executeTokenRequest(e,r){let i=this.createTokenQueryParameters(r),n=ur.appendQueryString(e.tokenEndpoint,i),o=this.createTokenRequestBody(r),c=this.createTokenRequestHeaders({credential:r.username,type:Mi.UPN}),u={clientId:this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:r.scopes,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid};return this.executePostToTokenEndpoint(n,o,c,u,r.correlationId)}createTokenRequestBody(e){let r=new ni;r.addClientId(this.config.authOptions.clientId),r.addUsername(e.username),r.addPassword(e.password),r.addScopes(e.scopes),r.addResponseTypeForTokenAndIdToken(),r.addGrantType(Ca.RESOURCE_OWNER_PASSWORD_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&r.addServerTelemetry(this.serverTelemetryManager);let i=e.correlationId||this.config.cryptoInterface.createNewGuid();if(r.addCorrelationId(i),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;r.addClientAssertion(n.assertion),r.addClientAssertionType(n.assertionType)}return(!dn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&r.addCcsUpn(e.username),r.createQueryString()}};var Th=class{constructor(e){this.config=l3(e),this.cryptoProvider=new df,this.logger=new ko(this.config.system.loggerOptions,pj,k_),this.storage=new L0(this.logger,this.config.auth.clientId,this.cryptoProvider,o3(this.config.auth)),this.tokenCache=new U0(this.storage,this.logger,this.config.cache.cachePlugin)}async getAuthCodeUrl(e){this.logger.info("getAuthCodeUrl called",e.correlationId);let r={...e,...await this.initializeBaseRequest(e),responseMode:e.responseMode||Ll.QUERY,authenticationScheme:Cr.BEARER},i=await this.buildOauthClientConfiguration(r.authority,r.correlationId,void 0,void 0,e.azureCloudOptions),n=new Sh(i);return this.logger.verbose("Auth code client created",r.correlationId),n.getAuthCodeUrl(r)}async acquireTokenByCode(e,r){this.logger.info("acquireTokenByCode called"),e.state&&r&&(this.logger.info("acquireTokenByCode - validating state"),this.validateState(e.state,r.state||""),r={...r,state:""});let i={...e,...await this.initializeBaseRequest(e),authenticationScheme:Cr.BEARER},n=this.initializeServerTelemetryManager(tu.acquireTokenByCode,i.correlationId);try{let o=await this.buildOauthClientConfiguration(i.authority,i.correlationId,n,void 0,e.azureCloudOptions),c=new Sh(o);return this.logger.verbose("Auth code client created",i.correlationId),c.acquireToken(i,r)}catch(o){throw o instanceof kr&&o.setCorrelationId(i.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenByRefreshToken(e){this.logger.info("acquireTokenByRefreshToken called",e.correlationId);let r={...e,...await this.initializeBaseRequest(e),authenticationScheme:Cr.BEARER},i=this.initializeServerTelemetryManager(tu.acquireTokenByRefreshToken,r.correlationId);try{let n=await this.buildOauthClientConfiguration(r.authority,r.correlationId,i,void 0,e.azureCloudOptions),o=new Xc(n);return this.logger.verbose("Refresh token client created",r.correlationId),o.acquireToken(r)}catch(n){throw n instanceof kr&&n.setCorrelationId(r.correlationId),i.cacheFailedRequest(n),n}}async acquireTokenSilent(e){let r={...e,...await this.initializeBaseRequest(e),forceRefresh:e.forceRefresh||!1},i=this.initializeServerTelemetryManager(tu.acquireTokenSilent,r.correlationId,r.forceRefresh);try{let n=await this.buildOauthClientConfiguration(r.authority,r.correlationId,i,void 0,e.azureCloudOptions),o=new P0(n);return this.logger.verbose("Silent flow client created",r.correlationId),o.acquireToken(r)}catch(n){throw n instanceof kr&&n.setCorrelationId(r.correlationId),i.cacheFailedRequest(n),n}}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId);let r={...e,...await this.initializeBaseRequest(e)},i=this.initializeServerTelemetryManager(tu.acquireTokenByUsernamePassword,r.correlationId);try{let n=await this.buildOauthClientConfiguration(r.authority,r.correlationId,i,void 0,e.azureCloudOptions),o=new j0(n);return this.logger.verbose("Username password client created",r.correlationId),o.acquireToken(r)}catch(n){throw n instanceof kr&&n.setCorrelationId(r.correlationId),i.cacheFailedRequest(n),n}}getTokenCache(){return this.logger.info("getTokenCache called"),this.tokenCache}validateState(e,r){if(!e)throw Cn.createStateNotFoundError();if(e!==r)throw Ve(Da.stateMismatch)}getLogger(){return this.logger}setLogger(e){this.logger=e}async buildOauthClientConfiguration(e,r,i,n,o){this.logger.verbose("buildOauthClientConfiguration called",r);let c=o||this.config.auth.azureCloudOptions;this.logger.verbose(`building oauth client configuration with the authority: ${e}`,r);let u=await this.createAuthority(e,n,r,c);return i?.updateRegionDiscoveryMetadata(u.regionDiscoveryMetadata),{authOptions:{clientId:this.config.auth.clientId,authority:u,clientCapabilities:this.config.auth.clientCapabilities},loggerOptions:{logLevel:this.config.system.loggerOptions.logLevel,loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,correlationId:r},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.cryptoProvider,networkInterface:this.config.system.networkClient,storageInterface:this.storage,serverTelemetryManager:i,clientCredentials:{clientSecret:this.clientSecret,clientAssertion:this.clientAssertion?this.getClientAssertion(u):void 0},libraryInfo:{sku:Ri.MSAL_SKU,version:k_,cpu:C.arch||He.EMPTY_STRING,os:C.platform||He.EMPTY_STRING},telemetry:this.config.telemetry,persistencePlugin:this.config.cache.cachePlugin,serializableCache:this.tokenCache}}getClientAssertion(e){return{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:Ri.JWT_BEARER_ASSERTION_TYPE}}async initializeBaseRequest(e){return this.logger.verbose("initializeRequestScopes called",e.correlationId),e.authenticationScheme&&e.authenticationScheme===Cr.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",e.correlationId),e.authenticationScheme=Cr.BEARER,this.config.cache.claimsBasedCachingEnabled&&e.claims&&!dn.isEmptyObj(e.claims)&&(e.requestedClaimsHash=await this.cryptoProvider.hashString(e.claims)),{...e,scopes:[...e&&e.scopes||[],...Fs],correlationId:e&&e.correlationId||this.cryptoProvider.createNewGuid(),authority:e.authority||this.config.auth.authority}}initializeServerTelemetryManager(e,r,i){let n={clientId:this.config.auth.clientId,correlationId:r,apiId:e,forceRefresh:i||!1};return new Zc(n,this.storage)}async createAuthority(e,r,i,n){this.logger.verbose("createAuthority called",i);let o=Bn.generateAuthority(e,n),c={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,azureRegionConfiguration:r,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache};return await Na.createDiscoveredInstance(o,this.config.system.networkClient,this.storage,c,this.logger)}clearCache(){this.storage.clear()}};m();var mj=Et(require("http"),1);var I_=class{async listenForAuthCode(e,r){if(this.server)throw Cn.createLoopbackServerAlreadyExistsError();return new Promise((i,n)=>{this.server=mj.default.createServer((o,c)=>{let u=o.url;if(u){if(u===He.FORWARD_SLASH){c.end(e||"Auth code was successfully acquired. You can close this window now.");return}}else{c.end(r||"Error occurred loading redirectUrl"),n(Cn.createUnableToLoadRedirectUrlError());return}let d=this.getRedirectUri(),y=new URL(u,d),E=b_.getDeserializedResponse(y.search)||{};E.code&&(c.writeHead(ti.REDIRECT,{location:d}),c.end()),i(E)}),this.server.listen(0)})}getRedirectUri(){if(!this.server||!this.server.listening)throw Cn.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),Cn.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${Ri.HTTP_PROTOCOL}${Ri.LOCALHOST}:${r}`}closeServer(){this.server&&(this.server.close(),typeof this.server.closeAllConnections=="function"&&this.server.closeAllConnections(),this.server.unref(),this.server=void 0)}};m();var z0=class extends no{constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let i=Ar.nowSeconds(),n=await this.acquireTokenWithDeviceCode(e,r),o=new ii(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(n),await o.handleServerTokenResponse(n,this.authority,i,e)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),i=ur.appendQueryString(this.authority.deviceCodeEndpoint,r),n=this.createQueryString(e),o=this.createTokenRequestHeaders(),c={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return this.executePostRequestToDeviceCodeEndpoint(i,n,o,c)}createExtraQueryParameters(e){let r=new ni;return e.extraQueryParameters&&r.addExtraQueryParameters(e.extraQueryParameters),r.createQueryString()}async executePostRequestToDeviceCodeEndpoint(e,r,i,n){let{body:{user_code:o,device_code:c,verification_uri:u,expires_in:d,interval:y,message:E}}=await this.networkManager.sendPostRequest(n,e,{body:r,headers:i});return{userCode:o,deviceCode:c,verificationUri:u,expiresIn:d,interval:y,message:E}}createQueryString(e){let r=new ni;return r.addScopes(e.scopes),r.addClientId(this.config.authOptions.clientId),e.extraQueryParameters&&r.addExtraQueryParameters(e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),r.createQueryString()}continuePolling(e,r,i){if(i)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true"),Ve(Da.deviceCodePollingCancelled);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`),Ve(Da.userTimeoutReached);if(Ar.nowSeconds()>e)throw r&&this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${r}`),this.logger.error(`Device code expired. Expiration time of device code was ${e}`),Ve(Da.deviceCodeExpired);return!0}async acquireTokenWithDeviceCode(e,r){let i=this.createTokenQueryParameters(e),n=ur.appendQueryString(this.authority.tokenEndpoint,i),o=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),u=e.timeout?Ar.nowSeconds()+e.timeout:void 0,d=Ar.nowSeconds()+r.expiresIn,y=r.interval*1e3;for(;this.continuePolling(d,u,e.cancel);){let E={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},x=await this.executePostToTokenEndpoint(n,o,c,E,e.correlationId);if(x.body&&x.body.error)if(x.body.error===He.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling."),await Ar.delay(y);else throw this.logger.info("Unexpected error in polling from the server"),QA(s_.postRequestFailed,x.body.error);else return this.logger.verbose("Authorization completed successfully. Polling stopped."),x.body}throw this.logger.error("Polling stopped for unknown reasons."),Ve(Da.deviceCodeUnknownError)}createTokenRequestBody(e,r){let i=new ni;i.addScopes(e.scopes),i.addClientId(this.config.authOptions.clientId),i.addGrantType(Ca.DEVICE_CODE_GRANT),i.addDeviceCode(r.deviceCode);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();return i.addCorrelationId(n),i.addClientInfo(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addThrottling(),this.serverTelemetryManager&&i.addServerTelemetry(this.serverTelemetryManager),(!dn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(e.claims,this.config.authOptions.clientCapabilities),i.createQueryString()}};var H0=class extends Th{constructor(e){super(e),this.config.broker.nativeBrokerPlugin&&(this.config.broker.nativeBrokerPlugin.isBrokerAvailable?(this.nativeBrokerPlugin=this.config.broker.nativeBrokerPlugin,this.nativeBrokerPlugin.setLogger(this.config.system.loggerOptions)):this.logger.warning("NativeBroker implementation was provided but the broker is unavailable."))}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId);let r=Object.assign(e,await this.initializeBaseRequest(e)),i=this.initializeServerTelemetryManager(tu.acquireTokenByDeviceCode,r.correlationId);try{let n=await this.buildOauthClientConfiguration(r.authority,r.correlationId,i,void 0,e.azureCloudOptions),o=new z0(n);return this.logger.verbose("Device code client created",r.correlationId),o.acquireToken(r)}catch(n){throw n instanceof kr&&n.setCorrelationId(r.correlationId),i.cacheFailedRequest(n),n}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r);let{openBrowser:i,successTemplate:n,errorTemplate:o,windowHandle:c,loopbackClient:u,...d}=e;if(this.nativeBrokerPlugin){let M={...d,clientId:this.config.auth.clientId,scopes:e.scopes||Fs,redirectUri:`${Ri.HTTP_PROTOCOL}${Ri.LOCALHOST}`,authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...d.extraQueryParameters,...d.tokenQueryParameters},accountId:d.account?.nativeAccountId};return this.nativeBrokerPlugin.acquireTokenInteractive(M,c)}let{verifier:y,challenge:E}=await this.cryptoProvider.generatePkceCodes(),x=u||new I_,A={},R=null;try{let M=x.listenForAuthCode(n,o).then(j=>{A=j}).catch(j=>{R=j}),I=await this.waitForRedirectUri(x),D={...d,correlationId:r,scopes:e.scopes||Fs,redirectUri:I,responseMode:Ll.QUERY,codeChallenge:E,codeChallengeMethod:fh.S256},O=await this.getAuthCodeUrl(D);if(await i(O),await M,R)throw R;if(A.error)throw new zi(A.error,A.error_description,A.suberror);if(!A.code)throw Cn.createNoAuthCodeInResponseError();let N=A.client_info,L={code:A.code,codeVerifier:y,clientInfo:N||He.EMPTY_STRING,...D};return await this.acquireTokenByCode(L)}finally{x.closeServer()}}async acquireTokenSilent(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();if(this.logger.trace("acquireTokenSilent called",r),this.nativeBrokerPlugin){let i={...e,clientId:this.config.auth.clientId,scopes:e.scopes||Fs,redirectUri:`${Ri.HTTP_PROTOCOL}${Ri.LOCALHOST}`,authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:e.tokenQueryParameters,accountId:e.account.nativeAccountId,forceRefresh:e.forceRefresh||!1};return this.nativeBrokerPlugin.acquireTokenSilent(i)}return super.acquireTokenSilent(e)}async signOut(e){if(this.nativeBrokerPlugin&&e.account.nativeAccountId){let r={clientId:this.config.auth.clientId,accountId:e.account.nativeAccountId,correlationId:e.correlationId||this.cryptoProvider.createNewGuid()};await this.nativeBrokerPlugin.signOut(r)}await this.getTokenCache().removeAccount(e.account)}async getAllAccounts(){if(this.nativeBrokerPlugin){let e=this.cryptoProvider.createNewGuid();return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId,e)}return this.getTokenCache().getAllAccounts()}async waitForRedirectUri(e){return new Promise((r,i)=>{let n=0,o=setInterval(()=>{if(A_.TIMEOUT_MS/A_.INTERVAL_MS{let n=await(0,zs.requestUrl)({url:`${e}/oauth2/v2.0/token`,method:"POST",contentType:"application/x-www-form-urlencoded",body:new URLSearchParams({tenant:"consumers",client_id:t,scope:eT.join(" "),code:r,redirect_uri:tG,grant_type:"authorization_code",code_verifier:i}).toString()}).json;return n.error!==void 0,n},xRe=async(t,e,r)=>{let i=new URLSearchParams({tenant:"consumers",client_id:t,scope:eT.join(" "),refresh_token:r,grant_type:"refresh_token"}).toString(),n={url:`${e}/oauth2/v2.0/token`,method:"POST",contentType:"application/x-www-form-urlencoded",body:i},o=await(0,zs.requestUrl)(n).json;return o.error!==void 0,o},iG=async(t,e,r)=>{t.accessToken=e.access_token,t.accessTokenExpiresAtTime=Date.now()+e.expires_in-5*60*1e3,t.accessTokenExpiresInSeconds=e.expires_in,t.refreshToken=e.refresh_token,t.credentialsShouldBeDeletedAtTime=Date.now()+cy,r!==void 0&&await r()},ig=(t,e)=>{let r=`/drive/special/approot:/${e}`;if(t.startsWith(r))return t;let i=t;return t==="/"||t===""?r:(i.endsWith("/")&&(i=i.slice(0,i.length-1)),i=`${r}/${i}`,i)};var Z$=t=>`parentPath="${t.parentReference.path}", selfName="${t.name}"`,oG=(t,e)=>{let r="",i=/^\/drive\/root:\/[^\/]+\/Remotely Sync\//g,n=/^\/Livefolders\/[^\/]+\/Remotely Sync\//g,o="/drive/items/",c=/^\/drive\/root:\/[^\/]+\/Remotely Secure\//g,u=`${t.parentReference.path}/${t.name}`,d=u.match(i),y=u.match(n),E=u.match(c);if(d!==null&&u.startsWith(`${d[0]}${e}`)){let A=`${d[0]}${e}`;r=u.substring(A.length+1)}else if(y!==null&&u.startsWith(`${y[0]}${e}`)){let A=`${y[0]}${e}`;r=u.substring(A.length+1)}else if(t.parentReference.path.startsWith(o)){let A=decodeURIComponent(t.parentReference.path);if(r=A.substring(A.indexOf(":")+1),r.startsWith(`/${e}/`))r=r.substring(`/${e}/`.length),r=`${r}/${t.name}`;else if(r===`/${e}`)r=t.name;else throw Error(`we meet file/folder and do not know how to deal with it: -${Z$(t)}`)}else if(E!==null&&u.startsWith(`${E[0]}${e}`)){let A=`${E[0]}${e}`;r=u.substring(A.length+1)}else throw Error(`we meet file/folder and do not know how to deal with it: -${Z$(t)}`);let x="folder"in t;return x&&(r=`${r}/`),{key:r,lastModified:Date.parse(t.fileSystemInfo.lastModifiedDateTime),size:x?0:t.size,remoteType:"onedrive",etag:t.cTag||""}},X3=class{onedriveConfig;saveUpdatedConfigFunc;constructor(e,r){this.onedriveConfig=e,this.saveUpdatedConfigFunc=r}getAccessToken=async()=>{if(this.onedriveConfig.accessToken===""||this.onedriveConfig.refreshToken==="")throw Error("The user has not manually auth yet.");let e=Date.now();if(this.onedriveConfig.accessTokenExpiresAtTime>e)return this.onedriveConfig.accessToken;{let r=await xRe(this.onedriveConfig.clientID,this.onedriveConfig.authority,this.onedriveConfig.refreshToken);if(r.error!==void 0){let n=r;throw Error(`Error while refreshing accessToken: ${n.error}, ${n.error_codes}: ${n.error_description}`)}let i=r;return this.onedriveConfig.accessToken=i.access_token,this.onedriveConfig.refreshToken=i.refresh_token,this.onedriveConfig.accessTokenExpiresInSeconds=i.expires_in,this.onedriveConfig.accessTokenExpiresAtTime=e+i.expires_in*1e3-60*2*1e3,await this.saveUpdatedConfigFunc(),this.onedriveConfig.accessToken}}},Z3=class{onedriveConfig;remoteBaseDir;vaultFolderExists;authGetter;saveUpdatedConfigFunc;constructor(e,r,i){this.onedriveConfig=e,this.remoteBaseDir=r,this.vaultFolderExists=!1,this.saveUpdatedConfigFunc=i,this.authGetter=new X3(e,i)}init=async()=>{if(this.onedriveConfig.accessToken===""||this.onedriveConfig.refreshToken==="")throw Error("The user has not manually auth yet.");if(!this.vaultFolderExists){let e=await this.getJson("/drive/special/approot/children");this.vaultFolderExists=e.value.filter(r=>r.name===this.remoteBaseDir).length>0,this.vaultFolderExists||(await this.postJson("/drive/special/approot/children",{name:`${this.remoteBaseDir}`,folder:{},"@microsoft.graph.conflictBehavior":"replace"}),this.vaultFolderExists=!0)}};buildUrl=e=>{let r="https://graph.microsoft.com/v1.0",i="";if(e.startsWith("http://")||e.startsWith("https://"))i=e;else{let n=encodeURI(e);i=`${r}${n}`}return i};getJson=async e=>{let r=this.buildUrl(e);ht.debug(`getJson, theUrl=${r}`);let n={Authorization:`Bearer ${await this.authGetter.getAccessToken()}`,"Cache-Control":"no-cache"};return await(0,zs.requestUrl)({url:r,method:"GET",contentType:"application/json",headers:n}).json};postJson=async(e,r)=>{let i=this.buildUrl(e);ht.debug(`postJson, theUrl=${i}`);let o={Authorization:`Bearer ${await this.authGetter.getAccessToken()}`},c={url:i,method:"POST",contentType:"application/json",body:JSON.stringify(r),headers:o};return await(0,zs.requestUrl)(c).json};patchJson=async(e,r)=>{let i=this.buildUrl(e),o={Authorization:`Bearer ${await this.authGetter.getAccessToken()}`},c={url:i,method:"PATCH",contentType:"application/json",body:JSON.stringify(r),headers:o};await(0,zs.requestUrl)(c).json};deleteJson=async e=>{let r=this.buildUrl(e);ht.debug(`deleteJson, theUrl=${r}`),await(0,zs.requestUrl)({url:r,method:"DELETE",headers:{Authorization:`Bearer ${await this.authGetter.getAccessToken()}`}})};putArrayBuffer=async(e,r)=>{let i=this.buildUrl(e);ht.debug(`putArrayBuffer, theUrl=${i}`),await(0,zs.requestUrl)({url:i,method:"PUT",body:r,contentType:ia,headers:{"Content-Type":ia,Authorization:`Bearer ${await this.authGetter.getAccessToken()}`}})};putUint8ArrayByRange=async(e,r,i,n,o)=>{let c=this.buildUrl(e);return ht.debug(`putUint8ArrayByRange, theUrl=${c}, range=${i}-${n-1}, len=${n-i}, size=${o}`),(await(0,zs.requestUrl)({url:c,method:"PUT",body:Bi(r.subarray(i,n)),contentType:ia,headers:{"Content-Range":`bytes ${i}-${n-1}/${o}`}})).json}},sG=(t,e,r)=>new Z3(t,e,r),aG=async(t,e)=>{if(e!==void 0)throw Error("prefix not supported (yet)");await t.init();let r="@odata.nextLink",i="@odata.deltaLink",n=await t.getJson(`/drive/special/approot:/${t.remoteBaseDir}:/delta`),o=n.value;for(;r in n;)n=await t.getJson(n[r]),o.push(...(0,eG.default)(n.value));return i in n&&(t.onedriveConfig.deltaLink=n[i],await t.saveUpdatedConfigFunc()),{Contents:o.map(u=>oG(u,t.remoteBaseDir)).filter(u=>u.key!=="/")}},J3=async(t,e)=>{await t.init();let r=ig(e,t.remoteBaseDir),n=await t.getJson(`${r}?$select=cTag,eTag,fileSystemInfo,folder,file,name,parentReference,size`);return oG(n,t.remoteBaseDir)},cG=async(t,e,r,i=!1,n="",o="",c=void 0,u=!1,d="")=>{await t.init();let y=e;n!==""&&(y=o),y=ig(y,t.remoteBaseDir),ht.debug(`uploadFile=${y}`);let E=e.endsWith("/");if(E&&i)throw Error("upload function doesn't implement recursive function yet!");if(E&&!i){if(u)throw Error("you specify uploadRaw, but you also provide a folder key!");if(n==="")return c?.has(y)||await t.patchJson(y,{folder:{},"@microsoft.graph.conflictBehavior":"replace"}),await J3(t,y);{let x=t8(1,65536),A=await Bs(r8(x),n);return await t.putArrayBuffer(`${y}:/content?${new URLSearchParams({"@microsoft.graph.conflictBehavior":"replace"})}`,A),await J3(t,y)}}else{let x;u?typeof d=="string"?x=new TextEncoder().encode(d).buffer:x=d:x=await r.adapter.readBinary(e);let A=x;n!==""&&(A=await Bs(x,n));let M=327680*20,I=1e3*1e3*4;if(A.byteLength{await t.init();let r=ig(e,t.remoteBaseDir),n=(await t.getJson(`${r}?$select=@microsoft.graph.downloadUrl`))["@microsoft.graph.downloadUrl"];return(await(0,zs.requestUrl)({url:n,headers:{"Cache-Control":"no-cache"}})).arrayBuffer},uG=async(t,e,r,i,n="",o="",c=!1)=>{await t.init();let u=e.endsWith("/");if(c||await Ji(e,r),u)return new ArrayBuffer(0);{let d=e;n!==""&&(d=o),d=ig(d,t.remoteBaseDir);let y=await ERe(t,d),E=y;return n!==""&&(E=await Sa(y,n)),c||await r.adapter.writeBinary(e,E,{mtime:i}),E}},lG=async(t,e,r="",i="")=>{if(e==="/")return;let n=e;r!==""&&(n=i),n=ig(n,t.remoteBaseDir),await t.init(),await t.deleteJson(n)},fG=async(t,e)=>{try{return await tT(t)!==""}catch(r){return ht.debug(r),e!==void 0&&e(r),!1}},tT=async t=>(await t.init(),(await t.getJson("/me?$select=displayName")).displayName||"");m();m();m();m();m();m();var dG=t=>{let e=t.httpHandler;return{setHttpHandler(r){e=r},httpHandler(){return e},updateHttpClientConfig(r,i){e.updateHttpClientConfig(r,i)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},hG=t=>({httpHandler:t.httpHandler()});m();m();m();m();var rT;(function(t){t.HEADER="header",t.QUERY="query"})(rT||(rT={}));m();m();m();m();m();m();m();m();m();m();m();var bf;(function(t){t.HTTP="http",t.HTTPS="https"})(bf||(bf={}));m();m();m();m();m();m();m();m();m();m();var qh;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(qh||(qh={}));m();m();var nT;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(nT||(nT={}));m();m();m();m();m();var yn="__smithy_context";m();m();var pG;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(pG||(pG={}));m();m();m();m();m();m();m();m();m();m();var iT;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(iT||(iT={}));m();m();m();m();m();m();m();m();var zt=class{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){let e=new zt({...this,headers:{...this.headers}});return e.query&&(e.query=CRe(e.query)),e}};function CRe(t){return Object.keys(t).reduce((e,r)=>{let i=t[r];return{...e,[r]:Array.isArray(i)?[...i]:i}},{})}m();var No=class{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;let r=e;return typeof r.statusCode=="number"&&typeof r.headers=="object"}};m();m();function ARe(t){return e=>async r=>{let{request:i}=r;return zt.isInstance(i)&&i.body&&t.runtime==="node"&&(i.headers={...i.headers,Expect:"100-continue"}),e({...r,request:i})}}var TRe={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},mG=t=>({applyToStack:e=>{e.add(ARe(t),TRe)}});m();var MRe=t=>e=>async r=>{if(!zt.isInstance(r.request))return e(r);let{request:i}=r,{handlerProtocol:n=""}=t.requestHandler.metadata||{};if(n.indexOf("h2")>=0&&!i.headers[":authority"])delete i.headers.host,i.headers[":authority"]="";else if(!i.headers.host){let o=i.hostname;i.port!=null&&(o+=`:${i.port}`),i.headers.host=o}return e(r)},RRe={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},gG=t=>({applyToStack:e=>{e.add(MRe(t),RRe)}});m();m();var DRe=()=>(t,e)=>async r=>{try{let i=await t(r),{clientName:n,commandName:o,logger:c,dynamoDbDocumentClientOptions:u={}}=e,{overrideInputFilterSensitiveLog:d,overrideOutputFilterSensitiveLog:y}=u,E=d??e.inputFilterSensitiveLog,x=y??e.outputFilterSensitiveLog,{$metadata:A,...R}=i.output;return c?.info?.({clientName:n,commandName:o,input:E(r.input),output:x(R),metadata:A}),i}catch(i){let{clientName:n,commandName:o,logger:c,dynamoDbDocumentClientOptions:u={}}=e,{overrideInputFilterSensitiveLog:d}=u,y=d??e.inputFilterSensitiveLog;throw c?.error?.({clientName:n,commandName:o,input:y(r.input),error:i,metadata:i.$metadata}),i}},kRe={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},yG=t=>({applyToStack:e=>{e.add(DRe(),kRe)}});m();var vG="X-Amzn-Trace-Id",IRe="AWS_LAMBDA_FUNCTION_NAME",ORe="_X_AMZN_TRACE_ID",PRe=t=>e=>async r=>{let{request:i}=r;if(!zt.isInstance(i)||t.runtime!=="node"||i.headers.hasOwnProperty(vG))return e(r);let n=C.env[IRe],o=C.env[ORe],c=u=>typeof u=="string"&&u.length>0;return c(n)&&c(o)&&(i.headers[vG]=o),e({...r,request:i})},NRe={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},bG=t=>({applyToStack:e=>{e.add(PRe(t),NRe)}});m();m();m();m();var Uh=class{trace(){}debug(){}info(){}warn(){}error(){}};m();m();m();var _f=(t,e)=>{let r=[];if(t&&r.push(t),e)for(let i of e)r.push(i);return r},iu=(t,e)=>`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,jh=()=>{let t=[],e=[],r=!1,i=new Set,n=x=>x.sort((A,R)=>_G[R.step]-_G[A.step]||wG[R.priority||"normal"]-wG[A.priority||"normal"]),o=x=>{let A=!1,R=M=>{let I=_f(M.name,M.aliases);if(I.includes(x)){A=!0;for(let D of I)i.delete(D);return!1}return!0};return t=t.filter(R),e=e.filter(R),A},c=x=>{let A=!1,R=M=>{if(M.middleware===x){A=!0;for(let I of _f(M.name,M.aliases))i.delete(I);return!1}return!0};return t=t.filter(R),e=e.filter(R),A},u=x=>(t.forEach(A=>{x.add(A.middleware,{...A})}),e.forEach(A=>{x.addRelativeTo(A.middleware,{...A})}),x.identifyOnResolve?.(E.identifyOnResolve()),x),d=x=>{let A=[];return x.before.forEach(R=>{R.before.length===0&&R.after.length===0?A.push(R):A.push(...d(R))}),A.push(x),x.after.reverse().forEach(R=>{R.before.length===0&&R.after.length===0?A.push(R):A.push(...d(R))}),A},y=(x=!1)=>{let A=[],R=[],M={};return t.forEach(D=>{let O={...D,before:[],after:[]};for(let N of _f(O.name,O.aliases))M[N]=O;A.push(O)}),e.forEach(D=>{let O={...D,before:[],after:[]};for(let N of _f(O.name,O.aliases))M[N]=O;R.push(O)}),R.forEach(D=>{if(D.toMiddleware){let O=M[D.toMiddleware];if(O===void 0){if(x)return;throw new Error(`${D.toMiddleware} is not found when adding ${iu(D.name,D.aliases)} middleware ${D.relation} ${D.toMiddleware}`)}D.relation==="after"&&O.after.push(D),D.relation==="before"&&O.before.push(D)}}),n(A).map(d).reduce((D,O)=>(D.push(...O),D),[])},E={add:(x,A={})=>{let{name:R,override:M,aliases:I}=A,D={step:"initialize",priority:"normal",middleware:x,...A},O=_f(R,I);if(O.length>0){if(O.some(N=>i.has(N))){if(!M)throw new Error(`Duplicate middleware name '${iu(R,I)}'`);for(let N of O){let L=t.findIndex(H=>H.name===N||H.aliases?.some(Y=>Y===N));if(L===-1)continue;let j=t[L];if(j.step!==D.step||D.priority!==j.priority)throw new Error(`"${iu(j.name,j.aliases)}" middleware with ${j.priority} priority in ${j.step} step cannot be overridden by "${iu(R,I)}" middleware with ${D.priority} priority in ${D.step} step.`);t.splice(L,1)}}for(let N of O)i.add(N)}t.push(D)},addRelativeTo:(x,A)=>{let{name:R,override:M,aliases:I}=A,D={middleware:x,...A},O=_f(R,I);if(O.length>0){if(O.some(N=>i.has(N))){if(!M)throw new Error(`Duplicate middleware name '${iu(R,I)}'`);for(let N of O){let L=e.findIndex(H=>H.name===N||H.aliases?.some(Y=>Y===N));if(L===-1)continue;let j=e[L];if(j.toMiddleware!==D.toMiddleware||j.relation!==D.relation)throw new Error(`"${iu(j.name,j.aliases)}" middleware ${j.relation} "${j.toMiddleware}" middleware cannot be overridden by "${iu(R,I)}" middleware ${D.relation} "${D.toMiddleware}" middleware.`);e.splice(L,1)}}for(let N of O)i.add(N)}e.push(D)},clone:()=>u(jh()),use:x=>{x.applyToStack(E)},remove:x=>typeof x=="string"?o(x):c(x),removeByTag:x=>{let A=!1,R=M=>{let{tags:I,name:D,aliases:O}=M;if(I&&I.includes(x)){let N=_f(D,O);for(let L of N)i.delete(L);return A=!0,!1}return!0};return t=t.filter(R),e=e.filter(R),A},concat:x=>{let A=u(jh());return A.use(x),A.identifyOnResolve(r||A.identifyOnResolve()||(x.identifyOnResolve?.()??!1)),A},applyToStack:u,identify:()=>y(!0).map(x=>{let A=x.step??x.relation+" "+x.toMiddleware;return iu(x.name,x.aliases)+" - "+A}),identifyOnResolve(x){return typeof x=="boolean"&&(r=x),r},resolve:(x,A)=>{for(let R of y().map(M=>M.middleware).reverse())x=R(x,A);return r&&console.log(E.identify()),x}};return E},_G={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},wG={high:3,normal:2,low:1};var a1=class{constructor(e){this.middlewareStack=jh(),this.config=e}send(e,r,i){let n=typeof r!="function"?r:void 0,o=typeof r=="function"?r:i,c=e.resolveMiddleware(this.middlewareStack,this.config,n);if(o)c(e).then(u=>o(null,u.output),u=>o(u)).catch(()=>{});else return c(e).then(u=>u.output)}destroy(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()}};m();m();m();m();m();m();m();var Ua={},wf=new Array(64);for(let t=0,e="A".charCodeAt(0),r="Z".charCodeAt(0);t+e<=r;t++){let i=String.fromCharCode(t+e);Ua[i]=t,wf[t]=i}for(let t=0,e="a".charCodeAt(0),r="z".charCodeAt(0);t+e<=r;t++){let i=String.fromCharCode(t+e),n=t+26;Ua[i]=n,wf[n]=i}for(let t=0;t<10;t++){Ua[t.toString(10)]=t+52;let e=t.toString(10),r=t+52;Ua[e]=r,wf[r]=e}Ua["+"]=62;wf[62]="+";Ua["/"]=63;wf[63]="/";var ou=6,xf=8,xG=63;var zh=t=>{let e=t.length/4*3;t.slice(-2)==="=="?e-=2:t.slice(-1)==="="&&e--;let r=new ArrayBuffer(e),i=new DataView(r);for(let n=0;n>=ou;let u=n/4*3;o>>=c%xf;let d=Math.floor(c/xf);for(let y=0;y>E)}}return new Uint8Array(r)};m();function Hh(t){let e="";for(let r=0;r>u]}e+="==".slice(0,4-o)}return e}m();m();var Hs=t=>new TextEncoder().encode(t);m();var $s=t=>typeof t=="string"?Hs(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t);m();var su=t=>new TextDecoder("utf-8").decode(t);function EG(t,e="utf-8"){return e==="base64"?Hh(t):su(t)}function SG(t,e){return e==="base64"?ls.mutate(zh(t)):ls.mutate(Hs(t))}var ls=class extends Uint8Array{static fromString(e,r="utf-8"){switch(typeof e){case"string":return SG(e,r);default:throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}}static mutate(e){return Object.setPrototypeOf(e,ls.prototype),e}transformToString(e="utf-8"){return EG(this,e)}};m();var CG=(t,e)=>{let{base64Encoder:r,bodyLengthChecker:i,checksumAlgorithmFn:n,checksumLocationName:o,streamHasher:c}=e,u=r!==void 0&&i!==void 0&&n!==void 0&&o!==void 0&&c!==void 0,d=u?c(n,t):void 0,y=t.getReader();return new ReadableStream({async pull(E){let{value:x,done:A}=await y.read();if(A){if(E.enqueue(`0\r -`),u){let R=r(await d);E.enqueue(`${o}:${R}\r -`),E.enqueue(`\r -`)}E.close()}else E.enqueue(`${(i(x)||0).toString(16)}\r -${x}\r -`)}})};m();m();m();m();m();m();var Gs=t=>encodeURIComponent(t).replace(/[!'()*]/g,BRe),BRe=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;m();function AG(t){let e=[];for(let r of Object.keys(t).sort()){let i=t[r];if(r=Gs(r),Array.isArray(i))for(let n=0,o=i.length;n{t&&setTimeout(()=>{let i=new Error(`Request did not complete within ${t} ms`);i.name="TimeoutError",r(i)},t)})}var FRe={supported:Boolean(typeof Request<"u"&&"keepalive"in new Request("https://[::1]"))},c1=class{constructor(e){typeof e=="function"?this.configProvider=e().then(r=>r||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config))}destroy(){}async handle(e,{abortSignal:r}={}){this.config||(this.config=await this.configProvider);let i=this.config.requestTimeout,n=this.config.keepAlive===!0;if(r?.aborted){let I=new Error("Request aborted");return I.name="AbortError",Promise.reject(I)}let o=e.path,c=AG(e.query||{});c&&(o+=`?${c}`),e.fragment&&(o+=`#${e.fragment}`);let u="";if(e.username!=null||e.password!=null){let I=e.username??"",D=e.password??"";u=`${I}:${D}@`}let{port:d,method:y}=e,E=`${e.protocol}//${u}${e.hostname}${d?`:${d}`:""}${o}`,A={body:y==="GET"||y==="HEAD"?void 0:e.body,headers:new Headers(e.headers),method:y};typeof AbortController<"u"&&(A.signal=r),FRe.supported&&(A.keepalive=n);let R=new Request(E,A),M=[fetch(R).then(I=>{let D=I.headers,O={};for(let L of D.entries())O[L[0]]=L[1];return I.body!=null?{response:new No({headers:O,reason:I.statusText,statusCode:I.status,body:I.body})}:I.blob().then(L=>({response:new No({headers:O,reason:I.statusText,statusCode:I.status,body:L})}))}),TG(i)];return r&&M.push(new Promise((I,D)=>{r.onabort=()=>{let O=new Error("Request aborted");O.name="AbortError",D(O)}})),Promise.race(M)}updateHttpClientConfig(e,r){this.config=void 0,this.configProvider=this.configProvider.then(i=>(i[e]=r,i))}httpHandlerConfigs(){return this.config??{}}};m();var u1=t=>typeof Blob=="function"&&t instanceof Blob?LRe(t):qRe(t);async function LRe(t){let e=await URe(t),r=zh(e);return new Uint8Array(r)}async function qRe(t){let e=new Uint8Array(0),r=t.getReader(),i=!1;for(;!i;){let{done:n,value:o}=await r.read();if(o){let c=e;e=new Uint8Array(c.length+o.length),e.set(c),e.set(o,c.length)}i=n}return e}function URe(t){return new Promise((e,r)=>{let i=new FileReader;i.onloadend=()=>{if(i.readyState!==2)return r(new Error("Reader aborted too early"));let n=i.result??"",o=n.indexOf(","),c=o>-1?o+1:n.length;e(n.substring(c))},i.onabort=()=>r(new Error("Read aborted")),i.onerror=()=>r(i.error),i.readAsDataURL(t)})}m();var MG={},oT={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),MG[t]=e,oT[e]=t}function RG(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let e=new Uint8Array(t.length/2);for(let r=0;r{if(!kG(t)&&!IG(t)){let n=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${n}`)}let e=!1,r=async()=>{if(e)throw new Error(DG);return e=!0,await u1(t)},i=n=>{if(typeof n.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled. -If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return n.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async n=>{let o=await r();if(n==="base64")return Hh(o);if(n==="hex")return Fn(o);if(n===void 0||n==="utf8"||n==="utf-8")return su(o);if(typeof TextDecoder=="function")return new TextDecoder(n).decode(o);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(e)throw new Error(DG);if(e=!0,kG(t))return i(t);if(IG(t))return t;throw new Error(`Cannot transform payload to web stream, got ${t}`)}})},kG=t=>typeof Blob=="function"&&t instanceof Blob,IG=t=>typeof ReadableStream=="function"&&t instanceof ReadableStream;var au=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return ls.mutate(t);if(!t)return ls.mutate(new Uint8Array);let r=e.streamCollector(t);return ls.mutate(await r)};m();var hn=class{constructor(){this.middlewareStack=jh()}};m();var An="***SensitiveInformation***";m();m();m();var Bo=t=>{switch(t){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${t}"`)}};var jRe=t=>{if(t!=null){if(typeof t=="string"){let e=parseFloat(t);if(!Number.isNaN(e))return String(e)!==String(t)&&jG.warn(UG(`Expected number but observed string: ${t}`)),e}if(typeof t=="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)}},zRe=Math.ceil(34028234663852886e22),PG=t=>{let e=jRe(t);if(e!==void 0&&!Number.isNaN(e)&&e!==1/0&&e!==-1/0&&Math.abs(e)>zRe)throw new TypeError(`Expected 32-bit float, got ${t}`);return e},sT=t=>{if(t!=null){if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)}};var NG=t=>aT(t,32),BG=t=>aT(t,16),FG=t=>aT(t,8),aT=(t,e)=>{let r=sT(t);if(r!==void 0&&HRe(r,e)!==r)throw new TypeError(`Expected ${e}-bit integer, got ${t}`);return r},HRe=(t,e)=>{switch(e){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},yi=(t,e)=>{if(t==null)throw e?new TypeError(`Expected a non-null value for ${e}`):new TypeError("Expected a non-null value");return t},l1=t=>{if(t==null)return;if(typeof t=="object"&&!Array.isArray(t))return t;let e=Array.isArray(t)?"array":typeof t;throw new TypeError(`Expected object, got ${e}: ${t}`)},Nr=t=>{if(t!=null){if(typeof t=="string")return t;if(["boolean","number","bigint"].includes(typeof t))return jG.warn(UG(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)}};var LG=t=>PG(typeof t=="string"?og(t):t),$Re=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,og=t=>{let e=t.match($Re);if(e===null||e[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)};var f1=t=>sT(typeof t=="string"?og(t):t);var cu=t=>NG(typeof t=="string"?og(t):t),sg=t=>BG(typeof t=="string"?og(t):t),qG=t=>FG(typeof t=="string"?og(t):t),UG=t=>String(new TypeError(t).stack||t).split(` -`).slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join(` -`),jG={warn:console.warn};var GRe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],uT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function lu(t){let e=t.getUTCFullYear(),r=t.getUTCMonth(),i=t.getUTCDay(),n=t.getUTCDate(),o=t.getUTCHours(),c=t.getUTCMinutes(),u=t.getUTCSeconds(),d=n<10?`0${n}`:`${n}`,y=o<10?`0${o}`:`${o}`,E=c<10?`0${c}`:`${c}`,x=u<10?`0${u}`:`${u}`;return`${GRe[i]}, ${d} ${uT[r]} ${e} ${y}:${E}:${x} GMT`}var EJe=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);var KRe=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),cg=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let e=KRe.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");let[r,i,n,o,c,u,d,y,E]=e,x=sg(ag(i)),A=uu(n,"month",1,12),R=uu(o,"day",1,31),M=d1(x,A,R,{hours:c,minutes:u,seconds:d,fractionalMilliseconds:y});return E.toUpperCase()!="Z"&&M.setTime(M.getTime()-n6e(E)),M},VRe=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),WRe=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),YRe=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),$h=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=VRe.exec(t);if(e){let[r,i,n,o,c,u,d,y]=e;return d1(sg(ag(o)),cT(n),uu(i,"day",1,31),{hours:c,minutes:u,seconds:d,fractionalMilliseconds:y})}if(e=WRe.exec(t),e){let[r,i,n,o,c,u,d,y]=e;return XRe(d1(QRe(o),cT(n),uu(i,"day",1,31),{hours:c,minutes:u,seconds:d,fractionalMilliseconds:y}))}if(e=YRe.exec(t),e){let[r,i,n,o,c,u,d,y]=e;return d1(sg(ag(y)),cT(i),uu(n.trimLeft(),"day",1,31),{hours:o,minutes:c,seconds:u,fractionalMilliseconds:d})}throw new TypeError("Invalid RFC-7231 date-time value")};var d1=(t,e,r,i)=>{let n=e-1;return e6e(t,n,r),new Date(Date.UTC(t,n,r,uu(i.hours,"hour",0,23),uu(i.minutes,"minute",0,59),uu(i.seconds,"seconds",0,60),r6e(i.fractionalMilliseconds)))},QRe=t=>{let e=new Date().getUTCFullYear(),r=Math.floor(e/100)*100+sg(ag(t));return rt.getTime()-new Date().getTime()>JRe?new Date(Date.UTC(t.getUTCFullYear()-100,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())):t,cT=t=>{let e=uT.indexOf(t);if(e<0)throw new TypeError(`Invalid month: ${t}`);return e+1},ZRe=[31,28,31,30,31,30,31,31,30,31,30,31],e6e=(t,e,r)=>{let i=ZRe[e];if(e===1&&t6e(t)&&(i=29),r>i)throw new TypeError(`Invalid day for ${uT[e]} in ${t}: ${r}`)},t6e=t=>t%4===0&&(t%100!==0||t%400===0),uu=(t,e,r,i)=>{let n=qG(ag(t));if(ni)throw new TypeError(`${e} must be between ${r} and ${i}, inclusive`);return n},r6e=t=>t==null?0:LG("0."+t)*1e3,n6e=t=>{let e=t[0],r=1;if(e=="+")r=1;else if(e=="-")r=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);let i=Number(t.substring(1,3)),n=Number(t.substring(4,6));return r*(i*60+n)*60*1e3},ag=t=>{let e=0;for(;e{Object.entries(e).filter(([,i])=>i!==void 0).forEach(([i,n])=>{(t[i]==null||t[i]==="")&&(t[i]=n)});let r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t};var i6e=({output:t,parsedBody:e,exceptionCtor:r,errorCode:i})=>{let n=o6e(t),o=n.httpStatusCode?n.httpStatusCode+"":void 0,c=new r({name:e?.code||e?.Code||i||o||"UnknownError",$fault:"client",$metadata:n});throw Ef(c,e)},zG=t=>({output:e,parsedBody:r,errorCode:i})=>{i6e({output:e,parsedBody:r,exceptionCtor:t,errorCode:i})},o6e=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]});m();var HG=t=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}};m();m();m();m();var $G=t=>{let e=[];for(let r in qh){let i=qh[r];t[i]!==void 0&&e.push({algorithmId:()=>i,checksumConstructor:()=>t[i]})}return{_checksumAlgorithms:e,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},GG=t=>{let e={};return t.checksumAlgorithms().forEach(r=>{e[r.algorithmId()]=r.checksumConstructor()}),e};m();var KG=t=>{let e=t.retryStrategy;return{setRetryStrategy(r){e=r},retryStrategy(){return e}}},VG=t=>{let e={};return e.retryStrategy=t.retryStrategy(),e};var WG=t=>({...$G(t),...KG(t)});var YG=t=>({...GG(t),...VG(t)});m();function Kh(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}m();var h1=t=>Array.isArray(t)?t:[t];m();var lT=t=>{let e="#text";for(let r in t)t.hasOwnProperty(r)&&t[r][e]!==void 0?t[r]=t[r][e]:typeof t[r]=="object"&&t[r]!==null&&(t[r]=lT(t[r]));return t};m();var fT=function(){let t=Object.getPrototypeOf(this).constructor,e=Function.bind.apply(String,[null,...arguments]),r=new e;return Object.setPrototypeOf(r,t.prototype),r};fT.prototype=Object.create(String.prototype,{constructor:{value:fT,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(fT,String);m();function Zt(t,e,r){let i,n,o;if(typeof e>"u"&&typeof r>"u")i={},o=t;else{if(i=t,typeof e=="function")return n=e,o=r,s6e(i,n,o);o=e}for(let c of Object.keys(o)){if(!Array.isArray(o[c])){i[c]=o[c];continue}a6e(i,null,o,c)}return i}var s6e=(t,e,r)=>Zt(t,Object.entries(r).reduce((i,[n,o])=>(Array.isArray(o)?i[n]=o:typeof o=="function"?i[n]=[e,o()]:i[n]=[e,o],i),{})),a6e=(t,e,r,i)=>{if(e!==null){let c=r[i];typeof c=="function"&&(c=[,c]);let[u=c6e,d=u6e,y=i]=c;(typeof u=="function"&&u(e[y])||typeof u!="function"&&!!u)&&(t[i]=d(e[y]));return}let[n,o]=r[i];if(typeof o=="function"){let c,u=n===void 0&&(c=o())!=null,d=typeof n=="function"&&!!n(void 0)||typeof n!="function"&&!!n;u?t[i]=c:d&&(t[i]=o())}else{let c=n===void 0&&o!=null,u=typeof n=="function"&&!!n(o)||typeof n!="function"&&!!n;(c||u)&&(t[i]=o)}},c6e=t=>t!=null,u6e=t=>t;m();var Ln=(t,e,r,i,n,o)=>{if(e!=null&&e[r]!==void 0){let c=i();if(c.length<=0)throw new Error("Empty value provided for input HTTP label: "+r+".");t=t.replace(n,o?c.split("/").map(u=>Kh(u)).join("/"):Kh(c))}else throw new Error("No value provided for input HTTP label: "+r+".");return t};m();m();m();var l6e="content-length";function f6e(){return(t,e)=>async r=>{let{request:i}=r;if(zt.isInstance(i)&&!i.headers[l6e]){let n="Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.";typeof e?.logger?.warn=="function"&&!(e.logger instanceof Uh)?e.logger.warn(n):console.warn(n)}return t({...r})}}var d6e={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},QG=t=>({applyToStack:e=>{e.add(f6e(),d6e)}});m();var JG=t=>(e,r)=>async i=>{let n=await t.region(),o=t.region;r.__s3RegionRedirect&&(t.region=async()=>(t.region=o,r.__s3RegionRedirect));let c=await e(i);if(r.__s3RegionRedirect){let u=await t.region();if(n!==u)throw new Error("Region was not restored following S3 region redirect.")}return c},XG={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};m();function h6e(t){return(e,r)=>async i=>{try{return await e(i)}catch(n){if(t.followRegionRedirects&&n.name==="PermanentRedirect"&&n.$metadata.httpStatusCode===301){try{let o=n.$response.headers["x-amz-bucket-region"];r.logger?.debug(`Redirecting from ${await t.region()} to ${o}`),r.__s3RegionRedirect=o}catch(o){throw new Error("Region redirect failed: "+o)}return e(i)}else throw n}}}var p6e={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},ZG=t=>({applyToStack:e=>{e.add(h6e(t),p6e),e.addRelativeTo(JG(t),XG)}});m();var eK=t=>({...t,forcePathStyle:t.forcePathStyle??!1,useAccelerateEndpoint:t.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:t.disableMultiregionAccessPoints??!1,followRegionRedirects:t.followRegionRedirects??!1});m();var m6e=t=>e=>async r=>{let i=await e(r),{response:n}=i;if(!No.isInstance(n))return i;let{statusCode:o,body:c}=n;if(o<200||o>=300)return i;let u=await tK(c,t),d=await g6e(u,t);if(u.length===0){let y=new Error("S3 aborted request");throw y.name="InternalError",y}return d&&d.match("")&&(n.statusCode=400),n.body=u,i},tK=(t=new Uint8Array,e)=>t instanceof Uint8Array?Promise.resolve(t):e.streamCollector(t)||Promise.resolve(new Uint8Array),g6e=(t,e)=>tK(t,e).then(r=>e.utf8Encoder(r)),y6e={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},rK=t=>({applyToStack:e=>{e.addRelativeTo(m6e(t),y6e)}});m();m();var nK=t=>typeof t=="string"&&t.indexOf("arn:")===0&&t.split(":").length>=6;function v6e(){return t=>async e=>{let{input:{Bucket:r}}=e;if(typeof r=="string"&&!nK(r)&&r.indexOf("/")>=0){let i=new Error(`Bucket name shouldn't contain '/', received '${r}'`);throw i.name="InvalidBucketName",i}return t({...e})}}var b6e={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},iK=t=>({applyToStack:e=>{e.add(v6e(),b6e)}});m();m();m();m();m();m();m();m();m();var p1=(t,e,r)=>{let i,n,o,c=!1,u=async()=>{n||(n=t());try{i=await n,o=!0,c=!1}finally{n=void 0}return i};return e===void 0?async d=>((!o||d?.forceRefresh)&&(i=await u()),i):async d=>((!o||d?.forceRefresh)&&(i=await u()),c?i:r&&!r(i)?(c=!0,i):(e(i)&&await u(),i))};m();m();m();m();var $K=Et(lg());m();m();var du=class{constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);let r=new Uint8Array(8);for(let i=7,n=Math.abs(Math.round(e));i>-1&&n>0;i--,n/=256)r[i]=n;return e<0&&LK(r),new du(r)}valueOf(){let e=this.bytes.slice(0),r=e[0]&128;return r&&LK(e),parseInt(Fn(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}};function LK(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}var Jh=class{constructor(e,r){this.toUtf8=e,this.fromUtf8=r}format(e){let r=[];for(let o of Object.keys(e)){let c=this.fromUtf8(o);r.push(Uint8Array.from([c.byteLength]),c,this.formatHeaderValue(e[o]))}let i=new Uint8Array(r.reduce((o,c)=>o+c.byteLength,0)),n=0;for(let o of r)i.set(o,n),n+=o.byteLength;return i}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":let r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":let i=new DataView(new ArrayBuffer(5));return i.setUint8(0,4),i.setInt32(1,e.value,!1),new Uint8Array(i.buffer);case"long":let n=new Uint8Array(9);return n[0]=5,n.set(e.value.bytes,1),n;case"binary":let o=new DataView(new ArrayBuffer(3+e.value.byteLength));o.setUint8(0,6),o.setUint16(1,e.value.byteLength,!1);let c=new Uint8Array(o.buffer);return c.set(e.value,3),c;case"string":let u=this.fromUtf8(e.value),d=new DataView(new ArrayBuffer(3+u.byteLength));d.setUint8(0,7),d.setUint16(1,u.byteLength,!1);let y=new Uint8Array(d.buffer);return y.set(u,3),y;case"timestamp":let E=new Uint8Array(9);return E[0]=8,E.set(du.fromNumber(e.value.valueOf()).bytes,1),E;case"uuid":if(!J6e.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);let x=new Uint8Array(17);return x[0]=9,x.set(RG(e.value.replace(/\-/g,"")),1),x}}parse(e){let r={},i=0;for(;i{if(typeof t=="function")return t;let e=Promise.resolve(t);return()=>e};m();var GK="X-Amz-Algorithm",KK="X-Amz-Credential",mT="X-Amz-Date",VK="X-Amz-SignedHeaders",WK="X-Amz-Expires",gT="X-Amz-Signature",yT="X-Amz-Security-Token";var vT="authorization",bT=mT.toLowerCase(),Z6e="date",YK=[vT,bT,Z6e],QK=gT.toLowerCase(),fg="x-amz-content-sha256",JK=yT.toLowerCase();var XK={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},ZK=/^proxy-/,eV=/^sec-/;var T1="AWS4-HMAC-SHA256";var tV="AWS4-HMAC-SHA256-PAYLOAD",rV="UNSIGNED-PAYLOAD",nV=50,_T="aws4_request",iV=60*60*24*7;m();var M1={},wT=[],R1=(t,e,r)=>`${t}/${e}/${r}/${_T}`,sV=async(t,e,r,i,n)=>{let o=await oV(t,e.secretAccessKey,e.accessKeyId),c=`${r}:${i}:${n}:${Fn(o)}:${e.sessionToken}`;if(c in M1)return M1[c];for(wT.push(c);wT.length>nV;)delete M1[wT.shift()];let u=`AWS4${e.secretAccessKey}`;for(let d of[r,i,n,_T])u=await oV(t,u,d);return M1[c]=u};var oV=(t,e,r)=>{let i=new t(e);return i.update($s(r)),i.digest()};m();var D1=({headers:t},e,r)=>{let i={};for(let n of Object.keys(t).sort()){if(t[n]==null)continue;let o=n.toLowerCase();(o in XK||e?.has(o)||ZK.test(o)||eV.test(o))&&(!r||r&&!r.has(o))||(i[o]=t[n].trim().replace(/\s+/g," "))}return i};m();var xT=({query:t={}})=>{let e=[],r={};for(let i of Object.keys(t).sort()){if(i.toLowerCase()===QK)continue;e.push(i);let n=t[i];typeof n=="string"?r[i]=`${Gs(i)}=${Gs(n)}`:Array.isArray(n)&&(r[i]=n.slice(0).reduce((o,c)=>o.concat([`${Gs(i)}=${Gs(c)}`]),[]).sort().join("&"))}return e.map(i=>r[i]).filter(i=>i).join("&")};m();m();var k1=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]";var dg=async({headers:t,body:e},r)=>{for(let i of Object.keys(t))if(i.toLowerCase()===fg)return t[i];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||k1(e)){let i=new r;return i.update($s(e)),Fn(await i.digest())}return rV};m();var aV=(t,e)=>{t=t.toLowerCase();for(let r of Object.keys(e))if(t===r.toLowerCase())return!0;return!1};m();m();var I1=({headers:t,query:e,...r})=>({...r,headers:{...t},query:e?eDe(e):void 0}),eDe=t=>Object.keys(t).reduce((e,r)=>{let i=t[r];return{...e,[r]:Array.isArray(i)?[...i]:i}},{});var ET=(t,e={})=>{let{headers:r,query:i={}}=typeof t.clone=="function"?t.clone():I1(t);for(let n of Object.keys(r)){let o=n.toLowerCase();o.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(o)&&(i[n]=r[n],delete r[n])}return{...t,headers:r,query:i}};m();var O1=t=>{t=typeof t.clone=="function"?t.clone():I1(t);for(let e of Object.keys(t.headers))YK.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t};m();var cV=t=>tDe(t).toISOString().replace(/\.\d{3}Z$/,"Z"),tDe=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t;var Cf=class{constructor({applyChecksum:e,credentials:r,region:i,service:n,sha256:o,uriEscapePath:c=!0}){this.headerMarshaller=new Jh(su,Hs),this.service=n,this.sha256=o,this.uriEscapePath=c,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=si(i),this.credentialProvider=si(r)}async presign(e,r={}){let{signingDate:i=new Date,expiresIn:n=3600,unsignableHeaders:o,unhoistableHeaders:c,signableHeaders:u,signingRegion:d,signingService:y}=r,E=await this.credentialProvider();this.validateResolvedCredentials(E);let x=d??await this.regionProvider(),{longDate:A,shortDate:R}=P1(i);if(n>iV)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let M=R1(R,x,y??this.service),I=ET(O1(e),{unhoistableHeaders:c});E.sessionToken&&(I.query[yT]=E.sessionToken),I.query[GK]=T1,I.query[KK]=`${E.accessKeyId}/${M}`,I.query[mT]=A,I.query[WK]=n.toString(10);let D=D1(I,o,u);return I.query[VK]=uV(D),I.query[gT]=await this.getSignature(A,M,this.getSigningKey(E,x,R,y),this.createCanonicalRequest(I,D,await dg(e,this.sha256))),I}async sign(e,r){return typeof e=="string"?this.signString(e,r):e.headers&&e.payload?this.signEvent(e,r):e.message?this.signMessage(e,r):this.signRequest(e,r)}async signEvent({headers:e,payload:r},{signingDate:i=new Date,priorSignature:n,signingRegion:o,signingService:c}){let u=o??await this.regionProvider(),{shortDate:d,longDate:y}=P1(i),E=R1(d,u,c??this.service),x=await dg({headers:{},body:r},this.sha256),A=new this.sha256;A.update(e);let R=Fn(await A.digest()),M=[tV,y,E,n,R,x].join(` -`);return this.signString(M,{signingDate:i,signingRegion:u,signingService:c})}async signMessage(e,{signingDate:r=new Date,signingRegion:i,signingService:n}){return this.signEvent({headers:this.headerMarshaller.format(e.message.headers),payload:e.message.body},{signingDate:r,signingRegion:i,signingService:n,priorSignature:e.priorSignature}).then(c=>({message:e.message,signature:c}))}async signString(e,{signingDate:r=new Date,signingRegion:i,signingService:n}={}){let o=await this.credentialProvider();this.validateResolvedCredentials(o);let c=i??await this.regionProvider(),{shortDate:u}=P1(r),d=new this.sha256(await this.getSigningKey(o,c,u,n));return d.update($s(e)),Fn(await d.digest())}async signRequest(e,{signingDate:r=new Date,signableHeaders:i,unsignableHeaders:n,signingRegion:o,signingService:c}={}){let u=await this.credentialProvider();this.validateResolvedCredentials(u);let d=o??await this.regionProvider(),y=O1(e),{longDate:E,shortDate:x}=P1(r),A=R1(x,d,c??this.service);y.headers[bT]=E,u.sessionToken&&(y.headers[JK]=u.sessionToken);let R=await dg(y,this.sha256);!aV(fg,y.headers)&&this.applyChecksum&&(y.headers[fg]=R);let M=D1(y,n,i),I=await this.getSignature(E,A,this.getSigningKey(u,d,x,c),this.createCanonicalRequest(y,M,R));return y.headers[vT]=`${T1} Credential=${u.accessKeyId}/${A}, SignedHeaders=${uV(M)}, Signature=${I}`,y}createCanonicalRequest(e,r,i){let n=Object.keys(r).sort();return`${e.method} -${this.getCanonicalPath(e)} -${xT(e)} -${n.map(o=>`${o}:${r[o]}`).join(` -`)} - -${n.join(";")} -${i}`}async createStringToSign(e,r,i){let n=new this.sha256;n.update($s(i));let o=await n.digest();return`${T1} -${e} -${r} -${Fn(o)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let r=[];for(let o of e.split("/"))o?.length!==0&&o!=="."&&(o===".."?r.pop():r.push(o));let i=`${e?.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&e?.endsWith("/")?"/":""}`;return encodeURIComponent(i).replace(/%2F/g,"/")}return e}async getSignature(e,r,i,n){let o=await this.createStringToSign(e,r,n),c=new this.sha256(await i);return c.update($s(o)),Fn(await c.digest())}getSigningKey(e,r,i,n){return sV(this.sha256,e,i,r,n||this.service)}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}},P1=t=>{let e=cV(t).replace(/[\-:]/g,"");return{longDate:e,shortDate:e.slice(0,8)}},uV=t=>Object.keys(t).sort().join(";");var rDe=3e5,lV=t=>{let e=t.credentials?nDe(t.credentials):t.credentialDefaultProvider(t),{signingEscapePath:r=!0,systemClockOffset:i=t.systemClockOffset||0,sha256:n}=t,o;return t.signer?o=si(t.signer):t.regionInfoProvider?o=()=>si(t.region)().then(async c=>[await t.regionInfoProvider(c,{useFipsEndpoint:await t.useFipsEndpoint(),useDualstackEndpoint:await t.useDualstackEndpoint()})||{},c]).then(([c,u])=>{let{signingRegion:d,signingService:y}=c;t.signingRegion=t.signingRegion||d||u,t.signingName=t.signingName||y||t.serviceId;let E={...t,credentials:e,region:t.signingRegion,service:t.signingName,sha256:n,uriEscapePath:r},x=t.signerConstructor||Cf;return new x(E)}):o=async c=>{c=Object.assign({},{name:"sigv4",signingName:t.signingName||t.defaultSigningName,signingRegion:await si(t.region)(),properties:{}},c);let u=c.signingRegion,d=c.signingName;t.signingRegion=t.signingRegion||u,t.signingName=t.signingName||d||t.serviceId;let y={...t,credentials:e,region:t.signingRegion,service:t.signingName,sha256:n,uriEscapePath:r},E=t.signerConstructor||Cf;return new E(y)},{...t,systemClockOffset:i,signingEscapePath:r,credentials:e,signer:o}};var nDe=t=>typeof t=="function"?p1(t,e=>e.expiration!==void 0&&e.expiration.getTime()-Date.now()e.expiration!==void 0):si(t);m();m();var N1=t=>new Date(Date.now()+t);m();m();var fV=(t,e)=>Math.abs(N1(e).getTime()-t)>=3e5;var ST=(t,e)=>{let r=Date.parse(t);return fV(r,e)?r-Date.now():e};var iDe=t=>(e,r)=>async function(i){if(!zt.isInstance(i.request))return e(i);let n=r.endpointV2?.properties?.authSchemes?.[0],o=n?.name==="sigv4a"?n?.signingRegionSet?.join(","):void 0,c=await t.signer(n),u=await e({...i,request:await c.sign(i.request,{signingDate:N1(t.systemClockOffset),signingRegion:o||r.signing_region,signingService:r.signing_service})}).catch(y=>{let E=y.ServerTime??dV(y.$response);throw E&&(t.systemClockOffset=ST(E,t.systemClockOffset)),y}),d=dV(u.response);return d&&(t.systemClockOffset=ST(d,t.systemClockOffset)),u},dV=t=>No.isInstance(t)?t.headers?.date??t.headers?.Date:void 0,oDe={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},hV=t=>({applyToStack:e=>{e.addRelativeTo(iDe(t),oDe)}});m();m();function pV(t){return{...t,customUserAgent:typeof t.customUserAgent=="string"?[[t.customUserAgent]]:t.customUserAgent}}m();m();m();var CT={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"aws-global":{description:"AWS Standard global region"},"ca-central-1":{description:"Canada (Central)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"AWS China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"AWS GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{}}],version:"1.1"};var mV=CT,gV="",aDe=t=>{let{partitions:e}=mV;for(let i of e){let{regions:n,outputs:o}=i;for(let[c,u]of Object.entries(n))if(c===t)return{...o,...u}}for(let i of e){let{regionRegex:n,outputs:o}=i;if(new RegExp(n).test(t))return{...o}}let r=e.find(i=>i.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},yV=(t,e="")=>{mV=t,gV=e},cDe=()=>{yV(CT,"")},AT=()=>gV;m();var uDe=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),B1=t=>uDe.test(t)||t.startsWith("[")&&t.endsWith("]");m();m();m();var za="endpoints";m();function Fo(t){return typeof t!="object"||t==null?t:"ref"in t?`$${Fo(t.ref)}`:"fn"in t?`${t.fn}(${(t.argv||[]).map(Fo).join(", ")})`:JSON.stringify(t,null,2)}m();m();var Wr=class extends Error{constructor(e){super(e),this.name="EndpointError"}};m();m();m();m();m();m();m();m();m();m();m();var DT={};Mu(DT,{aws:()=>TT,booleanEquals:()=>dDe,getAttr:()=>MT,isSet:()=>hDe,isValidHostLabel:()=>F1,not:()=>pDe,parseURL:()=>mDe,stringEquals:()=>gDe,substring:()=>yDe,uriEncode:()=>vDe});m();var TT={};Mu(TT,{getUserAgentPrefix:()=>AT,isVirtualHostableS3Bucket:()=>vV,parseArn:()=>fDe,partition:()=>aDe,setPartitionInfo:()=>yV,useDefaultPartitionInfo:()=>cDe});m();m();m();var lDe=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),F1=(t,e=!1)=>{if(!e)return lDe.test(t);let r=t.split(".");for(let i of r)if(!F1(i))return!1;return!0};var vV=(t,e=!1)=>{if(e){for(let r of t.split("."))if(!vV(r))return!1;return!0}return!(!F1(t)||t.length<3||t.length>63||t!==t.toLowerCase()||B1(t))};m();var fDe=t=>{let e=t.split(":");if(e.length<6)return null;let[r,i,n,o,c,...u]=e;return r!=="arn"||i===""||n===""||u[0]===""?null:{partition:i,service:n,region:o,accountId:c,resourceId:u[0].includes("/")?u[0].split("/"):u}};m();var dDe=(t,e)=>t===e;m();m();var bV=t=>{let e=t.split("."),r=[];for(let i of e){let n=i.indexOf("[");if(n!==-1){if(i.indexOf("]")!==i.length-1)throw new Wr(`Path: '${t}' does not end with ']'`);let o=i.slice(n+1,-1);if(Number.isNaN(parseInt(o)))throw new Wr(`Invalid array index: '${o}' in path: '${t}'`);n!==0&&r.push(i.slice(0,n)),r.push(o)}else r.push(i)}return r};var MT=(t,e)=>bV(e).reduce((r,i)=>{if(typeof r!="object")throw new Wr(`Index '${i}' in '${e}' not found in '${JSON.stringify(t)}'`);return Array.isArray(r)?r[parseInt(i)]:r[i]},t);m();var hDe=t=>t!=null;m();var pDe=t=>!t;m();m();m();m();m();m();m();m();m();m();m();m();var _V;(function(t){t.AAAA="AAAA",t.A="A"})(_V||(_V={}));m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();var RT={[bf.HTTP]:80,[bf.HTTPS]:443},mDe=t=>{let e=(()=>{try{if(t instanceof URL)return t;if(typeof t=="object"&&"hostname"in t){let{hostname:A,port:R,protocol:M="",path:I="",query:D={}}=t,O=new URL(`${M}//${A}${R?`:${R}`:""}${I}`);return O.search=Object.entries(D).map(([N,L])=>`${N}=${L}`).join("&"),O}return new URL(t)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;let r=e.href,{host:i,hostname:n,pathname:o,protocol:c,search:u}=e;if(u)return null;let d=c.slice(0,-1);if(!Object.values(bf).includes(d))return null;let y=B1(n),E=r.includes(`${i}:${RT[d]}`)||typeof t=="string"&&t.includes(`${i}:${RT[d]}`),x=`${i}${E?`:${RT[d]}`:""}`;return{scheme:d,authority:x,path:o,normalizedPath:o.endsWith("/")?o:`${o}/`,isIp:y}};m();var gDe=(t,e)=>t===e;m();var yDe=(t,e,r,i)=>e>=r||t.lengthencodeURIComponent(t).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`);m();m();var L1=(t,e)=>{let r=[],i={...e.endpointParams,...e.referenceRecord},n=0;for(;n({...e.endpointParams,...e.referenceRecord})[t];var pu=(t,e,r)=>{if(typeof t=="string")return L1(t,r);if(t.fn)return q1(t,r);if(t.ref)return wV(t,r);throw new Wr(`'${e}': ${String(t)} is not a string, function or reference.`)};var q1=({fn:t,argv:e},r)=>{let i=e.map(n=>["boolean","number"].includes(typeof n)?n:pu(n,"arg",r));return t.split(".").reduce((n,o)=>n[o],DT)(...i)};var xV=({assign:t,...e},r)=>{if(t&&t in r.referenceRecord)throw new Wr(`'${t}' is already defined in Reference Record.`);let i=q1(e,r);return r.logger?.debug?.(za,`evaluateCondition: ${Fo(e)} = ${Fo(i)}`),{result:i===""?!0:!!i,...t!=null&&{toAssign:{name:t,value:i}}}};var Xh=(t=[],e)=>{let r={};for(let i of t){let{result:n,toAssign:o}=xV(i,{...e,referenceRecord:{...e.referenceRecord,...r}});if(!n)return{result:n};o&&(r[o.name]=o.value,e.logger?.debug?.(za,`assign: ${o.name} := ${Fo(o.value)}`))}return{result:!0,referenceRecord:r}};m();var EV=(t,e)=>Object.entries(t).reduce((r,[i,n])=>({...r,[i]:n.map(o=>{let c=pu(o,"Header value entry",e);if(typeof c!="string")throw new Wr(`Header '${i}' value '${c}' is not a string`);return c})}),{});m();m();var kT=(t,e)=>{if(Array.isArray(t))return t.map(r=>kT(r,e));switch(typeof t){case"string":return L1(t,e);case"object":if(t===null)throw new Wr(`Unexpected endpoint property: ${t}`);return U1(t,e);case"boolean":return t;default:throw new Wr(`Unexpected endpoint property type: ${typeof t}`)}};var U1=(t,e)=>Object.entries(t).reduce((r,[i,n])=>({...r,[i]:kT(n,e)}),{});m();var SV=(t,e)=>{let r=pu(t,"Endpoint URL",e);if(typeof r=="string")try{return new URL(r)}catch(i){throw console.error(`Failed to construct URL with ${r}`,i),i}throw new Wr(`Endpoint URL must be a string, got ${typeof r}`)};var CV=(t,e)=>{let{conditions:r,endpoint:i}=t,{result:n,referenceRecord:o}=Xh(r,e);if(!n)return;let c={...e,referenceRecord:{...e.referenceRecord,...o}},{url:u,properties:d,headers:y}=i;return e.logger?.debug?.(za,`Resolving endpoint from template: ${Fo(i)}`),{...y!=null&&{headers:EV(y,c)},...d!=null&&{properties:U1(d,c)},url:SV(u,c)}};m();var AV=(t,e)=>{let{conditions:r,error:i}=t,{result:n,referenceRecord:o}=Xh(r,e);if(!!n)throw new Wr(pu(i,"Error",{...e,referenceRecord:{...e.referenceRecord,...o}}))};m();var TV=(t,e)=>{let{conditions:r,rules:i}=t,{result:n,referenceRecord:o}=Xh(r,e);if(!!n)return j1(i,{...e,referenceRecord:{...e.referenceRecord,...o}})};var j1=(t,e)=>{for(let r of t)if(r.type==="endpoint"){let i=CV(r,e);if(i)return i}else if(r.type==="error")AV(r,e);else if(r.type==="tree"){let i=TV(r,e);if(i)return i}else throw new Wr(`Unknown endpoint rule: ${r}`);throw new Wr("Rules evaluation failed")};var MV=(t,e)=>{let{endpointParams:r,logger:i}=e,{parameters:n,rules:o}=t;e.logger?.debug?.(`${za} Initial EndpointParams: ${Fo(r)}`);let c=Object.entries(n).filter(([,y])=>y.default!=null).map(([y,E])=>[y,E.default]);if(c.length>0)for(let[y,E]of c)r[y]=r[y]??E;let u=Object.entries(n).filter(([,y])=>y.required).map(([y])=>y);for(let y of u)if(r[y]==null)throw new Wr(`Missing required parameter: '${y}'`);let d=j1(o,{endpointParams:r,logger:i,referenceRecord:{}});if(e.endpointParams?.Endpoint)try{let y=new URL(e.endpointParams.Endpoint),{protocol:E,port:x}=y;d.url.protocol=E,d.url.port=x}catch{}return e.logger?.debug?.(`${za} Resolved endpoint: ${Fo(d)}`),d};m();var IT="user-agent",z1="x-amz-user-agent",OT=" ",H1="/",RV=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,DV=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,PT="-";var bDe=t=>(e,r)=>async i=>{let{request:n}=i;if(!zt.isInstance(n))return e(i);let{headers:o}=n,c=r?.userAgent?.map(NT)||[],u=(await t.defaultUserAgentProvider()).map(NT),d=t?.customUserAgent?.map(NT)||[],y=AT(),E=(y?[y]:[]).concat([...u,...c,...d]).join(OT),x=[...u.filter(A=>A.startsWith("aws-sdk-")),...d].join(OT);return t.runtime!=="browser"?(x&&(o[z1]=o[z1]?`${o[IT]} ${x}`:x),o[IT]=E):o[z1]=E,e({...i,request:n})},NT=t=>{let e=t[0].split(H1).map(c=>c.replace(RV,PT)).join(H1),r=t[1]?.replace(DV,PT),i=e.indexOf(H1),n=e.substring(0,i),o=e.substring(i+1);return n==="api"&&(o=o.toLowerCase()),[n,o,r].filter(c=>c&&c.length>0).reduce((c,u,d)=>{switch(d){case 0:return u;case 1:return`${c}/${u}`;default:return`${c}#${u}`}},"")},_De={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},kV=t=>({applyToStack:e=>{e.add(bDe(t),_De)}});m();m();m();m();m();var $1;(function(t){t.ENV="env",t.CONFIG="shared config entry"})($1||($1={}));var IV=!1;m();var OV=!1;m();m();m();m();m();m();m();m();var G1=t=>typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips"));var BT=t=>G1(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t;var PV=t=>{let{region:e,useFipsEndpoint:r}=t;if(!e)throw new Error("Region is missing");return{...t,region:async()=>{if(typeof e=="string")return BT(e);let i=await e();return BT(i)},useFipsEndpoint:async()=>{let i=typeof e=="string"?e:await e();return G1(i)?!0:typeof r!="function"?Promise.resolve(!!r):r()}}};m();m();m();m();m();m();m();m();m();m();var NV=t=>({...t,eventStreamMarshaller:t.eventStreamSerdeProvider(t)});m();var BV="content-length";function xDe(t){return e=>async r=>{let i=r.request;if(zt.isInstance(i)){let{body:n,headers:o}=i;if(n&&Object.keys(o).map(c=>c.toLowerCase()).indexOf(BV)===-1)try{let c=t(n);i.headers={...i.headers,[BV]:String(c)}}catch{}}return e({...r,request:i})}}var EDe={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},FV=t=>({applyToStack:e=>{e.add(xDe(t.bodyLengthChecker),EDe)}});m();m();m();m();m();var LV=async t=>{let e=t?.Bucket||"";if(typeof t.Bucket=="string"&&(t.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),MDe(e)){if(t.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!TDe(e)||e.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(t.ForcePathStyle=!0);return t.DisableMultiRegionAccessPoints&&(t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0),t},SDe=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,CDe=/(\d+\.){3}\d+/,ADe=/\.\./;var TDe=t=>SDe.test(t)&&!CDe.test(t)&&!ADe.test(t),MDe=t=>{let[e,r,i,n,o,c]=t.split(":"),u=e==="arn"&&t.split(":").length>=6,d=[e,r,i,o,c].filter(Boolean).length===5;if(u&&!d)throw new Error(`Invalid ARN: ${t} was an invalid ARN.`);return e==="arn"&&!!r&&!!i&&!!o&&!!c};m();var qV=(t,e,r)=>{let i=async()=>{let n=r[t]??r[e];return typeof n=="function"?n():n};return t==="endpoint"||e==="endpoint"?async()=>{let n=await i();if(n&&typeof n=="object"){if("url"in n)return n.url.href;if("hostname"in n){let{protocol:o,hostname:c,port:u,path:d}=n;return`${o}//${c}${u?":"+u:""}${d}`}}return n}:i};m();var UV=async t=>{};m();m();m();function jV(t){let e={};if(t=t.replace(/^\?/,""),t)for(let r of t.split("&")){let[i,n=null]=r.split("=");i=decodeURIComponent(i),n&&(n=decodeURIComponent(n)),i in e?Array.isArray(e[i])?e[i].push(n):e[i]=[e[i],n]:e[i]=n}return e}var Zh=t=>{if(typeof t=="string")return Zh(new URL(t));let{hostname:e,pathname:r,port:i,protocol:n,search:o}=t,c;return o&&(c=jV(o)),{hostname:e,port:i?parseInt(i):void 0,protocol:n,path:r,query:c}};var ep=t=>typeof t=="object"?"url"in t?Zh(t.url):t:Zh(t);var K1=async(t,e,r,i)=>{if(!r.endpoint){let c=await UV(r.serviceId||"");c&&(r.endpoint=()=>Promise.resolve(ep(c)))}let n=await RDe(t,e,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(n,i)},RDe=async(t,e,r)=>{let i={},n=e?.getEndpointParameterInstructions?.()||{};for(let[o,c]of Object.entries(n))switch(c.type){case"staticContextParams":i[o]=c.value;break;case"contextParams":i[o]=t[c.name];break;case"clientContextParams":case"builtInParams":i[o]=await qV(c.name,o,r)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(c))}return Object.keys(n).length===0&&Object.assign(i,r),String(r.serviceId).toLowerCase()==="s3"&&await LV(i),i};m();var zV=({config:t,instructions:e})=>(r,i)=>async n=>{let o=await K1(n.input,{getEndpointParameterInstructions(){return e}},{...t},i);i.endpointV2=o,i.authSchemes=o.properties?.authSchemes;let c=i.authSchemes?.[0];return c&&(i.signing_region=c.signingRegion,i.signing_service=c.signingName),r({...n})};m();m();m();var HV=(t,e)=>(r,i)=>async n=>{let{response:o}=await r(n);try{let c=await e(o,t);return{response:o,output:c}}catch(c){if(Object.defineProperty(c,"$response",{value:o}),!("$metadata"in c)){let u="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";c.message+=` - `+u}throw c}};m();m();var $V=(t,e)=>(r,i)=>async n=>{let o=i.endpointV2?.url&&t.urlParser?async()=>t.urlParser(i.endpointV2.url):t.endpoint;if(!o)throw new Error("No valid endpoint provider available.");let c=await e(n.input,{...t,endpoint:o});return r({...n,request:c})};var DDe={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},FT={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Tn(t,e,r){return{applyToStack:i=>{i.add(HV(t,r),DDe),i.add($V(t,e),FT)}}}var kDe={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:FT.name},Mn=(t,e)=>({applyToStack:r=>{r.addRelativeTo(zV({config:t,instructions:e}),kDe)}});m();var GV=t=>{let e=t.tls??!0,{endpoint:r}=t,i=r!=null?async()=>ep(await si(r)()):void 0;return{...t,endpoint:i,tls:e,isCustomEndpoint:!!r,useDualstackEndpoint:si(t.useDualstackEndpoint??!1),useFipsEndpoint:si(t.useFipsEndpoint??!1)}};m();m();m();m();m();m();var fs;(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(fs||(fs={}));var mu=3,LT=fs.STANDARD;m();m();m();var KV=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],VV=["TimeoutError","RequestTimeout","RequestTimeoutException"],WV=[500,502,503,504],YV=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"];var tp=t=>t.$metadata?.httpStatusCode===429||KV.includes(t.name)||t.$retryable?.throttling==!0,V1=t=>VV.includes(t.name)||YV.includes(t?.code||"")||WV.includes(t.$metadata?.httpStatusCode||0),QV=t=>{if(t.$metadata?.httpStatusCode!==void 0){let e=t.$metadata.httpStatusCode;return 500<=e&&e<=599&&!V1(t)}return!1};var hg=class{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;let r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(!!this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){let r=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise(i=>setTimeout(i,r))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){let e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}let r=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=e}updateClientSendingRate(e){let r;if(this.updateMeasuredRate(),tp(e)){let n=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=n,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(n),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());let i=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(i)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){let e=this.getCurrentTimeInSeconds(),r=Math.floor(e*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){let i=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(i*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(e){return parseFloat(e.toFixed(8))}};m();m();var W1="amz-sdk-invocation-id",Y1="amz-sdk-request";m();var JV=()=>{let t=100;return{computeNextBackoffDelay:i=>Math.floor(Math.min(2e4,Math.random()*2**i*t)),setDelayBase:i=>{t=i}}};m();var qT=({retryDelay:t,retryCount:e,retryCost:r})=>({getRetryCount:()=>e,getRetryDelay:()=>Math.min(2e4,t),getRetryCost:()=>r});var Af=class{constructor(e){this.maxAttempts=e,this.mode=fs.STANDARD,this.capacity=500,this.retryBackoffStrategy=JV(),this.maxAttemptsProvider=typeof e=="function"?e:async()=>e}async acquireInitialRetryToken(e){return qT({retryDelay:100,retryCount:0})}async refreshRetryTokenForRetry(e,r){let i=await this.getMaxAttempts();if(this.shouldRetry(e,r,i)){let n=r.errorType;this.retryBackoffStrategy.setDelayBase(n==="THROTTLING"?500:100);let o=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),c=r.retryAfterHint?Math.max(r.retryAfterHint.getTime()-Date.now()||0,o):o,u=this.getCapacityCost(n);return this.capacity-=u,qT({retryDelay:c,retryCount:e.getRetryCount()+1,retryCost:u})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${mu}`),mu}}shouldRetry(e,r,i){return e.getRetryCount()+1=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(e){return e==="TRANSIENT"?10:5}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}};var J1=class{constructor(e,r){this.maxAttemptsProvider=e,this.mode=fs.ADAPTIVE;let{rateLimiter:i}=r??{};this.rateLimiter=i??new hg,this.standardRetryStrategy=new Af(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(e,r)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}};m();m();m();m();m();m();m();var jT=t=>t instanceof Error?t:t instanceof Object?Object.assign(new Error,t):typeof t=="string"?new Error(t):new Error(`AWS SDK error wrapper for ${t}`);m();var rW=t=>{let{retryStrategy:e}=t,r=si(t.maxAttempts??mu);return{...t,maxAttempts:r,retryStrategy:async()=>e||(await si(t.retryMode)()===fs.ADAPTIVE?new J1(r):new Af(r))}};m();m();var IDe=t=>(e,r)=>async i=>{let n=await t.retryStrategy(),o=await t.maxAttempts();if(ODe(n)){n=n;let c=await n.acquireInitialRetryToken(r.partition_id),u=new Error,d=0,y=0,{request:E}=i;for(zt.isInstance(E)&&(E.headers[W1]=F0());;)try{zt.isInstance(E)&&(E.headers[Y1]=`attempt=${d+1}; max=${o}`);let{response:x,output:A}=await e(i);return n.recordSuccess(c),A.$metadata.attempts=d+1,A.$metadata.totalRetryDelay=y,{response:x,output:A}}catch(x){let A=PDe(x);u=jT(x);try{c=await n.refreshRetryTokenForRetry(c,A)}catch{throw u.$metadata||(u.$metadata={}),u.$metadata.attempts=d+1,u.$metadata.totalRetryDelay=y,u}d=c.getRetryCount();let R=c.getRetryDelay();y+=R,await new Promise(M=>setTimeout(M,R))}}else return n=n,n?.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",n.mode]]),n.retry(e,i)},ODe=t=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",PDe=t=>{let e={errorType:NDe(t)},r=FDe(t.$response);return r&&(e.retryAfterHint=r),e},NDe=t=>tp(t)?"THROTTLING":V1(t)?"TRANSIENT":QV(t)?"SERVER_ERROR":"CLIENT_ERROR",BDe={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},nW=t=>({applyToStack:e=>{e.add(IDe(t),BDe)}}),FDe=t=>{if(!No.isInstance(t))return;let e=Object.keys(t.headers).find(o=>o.toLowerCase()==="retry-after");if(!e)return;let r=t.headers[e],i=Number(r);return Number.isNaN(i)?new Date(r):new Date(i*1e3)};m();var iW=t=>({...t,useFipsEndpoint:t.useFipsEndpoint??!1,useDualstackEndpoint:t.useDualstackEndpoint??!1,forcePathStyle:t.forcePathStyle??!1,useAccelerateEndpoint:t.useAccelerateEndpoint??!1,useGlobalEndpoint:t.useGlobalEndpoint??!1,disableMultiregionAccessPoints:t.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"});m();var oW={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.427.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"tsc -p tsconfig.cjs.json","build:docs":"typedoc","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn test:unit","test:e2e":"ts-mocha test/**/*.ispec.ts && karma start karma.conf.js","test:unit":"ts-mocha test/**/*.spec.ts"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"3.0.0","@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sts":"3.427.0","@aws-sdk/credential-provider-node":"3.427.0","@aws-sdk/middleware-bucket-endpoint":"3.425.0","@aws-sdk/middleware-expect-continue":"3.425.0","@aws-sdk/middleware-flexible-checksums":"3.425.0","@aws-sdk/middleware-host-header":"3.425.0","@aws-sdk/middleware-location-constraint":"3.425.0","@aws-sdk/middleware-logger":"3.425.0","@aws-sdk/middleware-recursion-detection":"3.425.0","@aws-sdk/middleware-sdk-s3":"3.427.0","@aws-sdk/middleware-signing":"3.425.0","@aws-sdk/middleware-ssec":"3.425.0","@aws-sdk/middleware-user-agent":"3.427.0","@aws-sdk/region-config-resolver":"3.425.0","@aws-sdk/signature-v4-multi-region":"3.425.0","@aws-sdk/types":"3.425.0","@aws-sdk/util-endpoints":"3.427.0","@aws-sdk/util-user-agent-browser":"3.425.0","@aws-sdk/util-user-agent-node":"3.425.0","@aws-sdk/xml-builder":"3.310.0","@smithy/config-resolver":"^2.0.11","@smithy/eventstream-serde-browser":"^2.0.10","@smithy/eventstream-serde-config-resolver":"^2.0.10","@smithy/eventstream-serde-node":"^2.0.10","@smithy/fetch-http-handler":"^2.2.1","@smithy/hash-blob-browser":"^2.0.10","@smithy/hash-node":"^2.0.10","@smithy/hash-stream-node":"^2.0.10","@smithy/invalid-dependency":"^2.0.10","@smithy/md5-js":"^2.0.10","@smithy/middleware-content-length":"^2.0.12","@smithy/middleware-endpoint":"^2.0.10","@smithy/middleware-retry":"^2.0.13","@smithy/middleware-serde":"^2.0.10","@smithy/middleware-stack":"^2.0.4","@smithy/node-config-provider":"^2.0.13","@smithy/node-http-handler":"^2.1.6","@smithy/protocol-http":"^3.0.6","@smithy/smithy-client":"^2.1.9","@smithy/types":"^2.3.4","@smithy/url-parser":"^2.0.10","@smithy/util-base64":"^2.0.0","@smithy/util-body-length-browser":"^2.0.0","@smithy/util-body-length-node":"^2.1.0","@smithy/util-defaults-mode-browser":"^2.0.13","@smithy/util-defaults-mode-node":"^2.0.15","@smithy/util-retry":"^2.0.3","@smithy/util-stream":"^2.0.14","@smithy/util-utf8":"^2.0.0","@smithy/util-waiter":"^2.0.10","fast-xml-parser":"4.2.5",tslib:"^2.5.0"},devDependencies:{"@smithy/service-client-documentation-generator":"^2.0.0","@tsconfig/node14":"1.0.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^14.14.31",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typedoc:"0.23.23",typescript:"~4.9.5"},engines:{node:">=14.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var iX=Et(IY()),oX=Et(RQ());m();var DQ=Et(pM()),kQ=({serviceId:t,clientVersion:e})=>async()=>{let r=typeof window<"u"&&window?.navigator?.userAgent?DQ.default.parse(window.navigator.userAgent):void 0,i=[["aws-sdk-js",e],["ua","2.0"],[`os/${r?.os?.name||"other"}`,r?.os?.version],["lang/js"],["md/browser",`${r?.browser?.name??"unknown"}_${r?.browser?.version??"unknown"}`]];return t&&i.push([`api/${t}`,e]),i};m();m();m();m();m();function IQ(t){let e=0,r=0,i=null,n=null,o=u=>{if(typeof u!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+u);e=u,r=4,i=new Uint8Array(u),new DataView(i.buffer).setUint32(0,u,!1)},c=async function*(){let u=t[Symbol.asyncIterator]();for(;;){let{value:d,done:y}=await u.next();if(y){if(e)if(e===r)yield i;else throw new Error("Truncated event message received.");else return;return}let E=d.length,x=0;for(;x({[Symbol.asyncIterator]:async function*(){let e=t.getReader();try{for(;;){let{done:r,value:i}=await e.read();if(r)return;yield i}}finally{e.releaseLock()}}}),NQ=t=>{let e=t[Symbol.asyncIterator]();return new ReadableStream({async pull(r){let{done:i,value:n}=await e.next();if(i)return r.close();r.enqueue(n)}})};var Cw=class{constructor({utf8Encoder:e,utf8Decoder:r}){this.universalMarshaller=new gg({utf8Decoder:r,utf8Encoder:e})}deserialize(e,r){let i=Dke(e)?PQ(e):e;return this.universalMarshaller.deserialize(i,r)}serialize(e,r){let i=this.universalMarshaller.serialize(e,r);return typeof ReadableStream=="function"?NQ(i):i}},Dke=t=>typeof ReadableStream=="function"&&t instanceof ReadableStream;m();var BQ=t=>new Cw(t);m();m();function FQ(t,e,r=1024*1024){return new Promise((i,n)=>{let o=new FileReader;o.addEventListener("error",n),o.addEventListener("abort",n);let c=t.size,u=0;function d(){if(u>=c){i();return}o.readAsArrayBuffer(t.slice(u,Math.min(c,u+r)))}o.addEventListener("load",y=>{let E=y.target.result;e(new Uint8Array(E)),u+=E.byteLength,d()}),d()})}var LQ=async function(e,r){let i=new e;return await FQ(r,n=>{i.update(n)}),i.digest()};m();m();m();var qQ=t=>()=>Promise.reject(t);m();m();var UQ=[1732584193,4023233417,2562383102,271733878];var Aw=class{constructor(){this.reset()}update(e){if(Ike(e))return;if(this.finished)throw new Error("Attempted to update an already finished hash.");let r=Oke(e),i=0,{byteLength:n}=r;for(this.bytesHashed+=n;n>0;)this.buffer.setUint8(this.bufferLength++,r[i++]),n--,this.bufferLength===64&&(this.hashBuffer(),this.bufferLength=0)}async digest(){if(!this.finished){let{buffer:r,bufferLength:i,bytesHashed:n}=this,o=n*8;if(r.setUint8(this.bufferLength++,128),i%64>=64-8){for(let c=this.bufferLength;c<64;c++)r.setUint8(c,0);this.hashBuffer(),this.bufferLength=0}for(let c=this.bufferLength;c<64-8;c++)r.setUint8(c,0);r.setUint32(64-8,o>>>0,!0),r.setUint32(64-4,Math.floor(o/4294967296),!0),this.hashBuffer(),this.finished=!0}let e=new DataView(new ArrayBuffer(16));for(let r=0;r<4;r++)e.setUint32(r*4,this.state[r],!0);return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}hashBuffer(){let{buffer:e,state:r}=this,i=r[0],n=r[1],o=r[2],c=r[3];i=vi(i,n,o,c,e.getUint32(0,!0),7,3614090360),c=vi(c,i,n,o,e.getUint32(4,!0),12,3905402710),o=vi(o,c,i,n,e.getUint32(8,!0),17,606105819),n=vi(n,o,c,i,e.getUint32(12,!0),22,3250441966),i=vi(i,n,o,c,e.getUint32(16,!0),7,4118548399),c=vi(c,i,n,o,e.getUint32(20,!0),12,1200080426),o=vi(o,c,i,n,e.getUint32(24,!0),17,2821735955),n=vi(n,o,c,i,e.getUint32(28,!0),22,4249261313),i=vi(i,n,o,c,e.getUint32(32,!0),7,1770035416),c=vi(c,i,n,o,e.getUint32(36,!0),12,2336552879),o=vi(o,c,i,n,e.getUint32(40,!0),17,4294925233),n=vi(n,o,c,i,e.getUint32(44,!0),22,2304563134),i=vi(i,n,o,c,e.getUint32(48,!0),7,1804603682),c=vi(c,i,n,o,e.getUint32(52,!0),12,4254626195),o=vi(o,c,i,n,e.getUint32(56,!0),17,2792965006),n=vi(n,o,c,i,e.getUint32(60,!0),22,1236535329),i=bi(i,n,o,c,e.getUint32(4,!0),5,4129170786),c=bi(c,i,n,o,e.getUint32(24,!0),9,3225465664),o=bi(o,c,i,n,e.getUint32(44,!0),14,643717713),n=bi(n,o,c,i,e.getUint32(0,!0),20,3921069994),i=bi(i,n,o,c,e.getUint32(20,!0),5,3593408605),c=bi(c,i,n,o,e.getUint32(40,!0),9,38016083),o=bi(o,c,i,n,e.getUint32(60,!0),14,3634488961),n=bi(n,o,c,i,e.getUint32(16,!0),20,3889429448),i=bi(i,n,o,c,e.getUint32(36,!0),5,568446438),c=bi(c,i,n,o,e.getUint32(56,!0),9,3275163606),o=bi(o,c,i,n,e.getUint32(12,!0),14,4107603335),n=bi(n,o,c,i,e.getUint32(32,!0),20,1163531501),i=bi(i,n,o,c,e.getUint32(52,!0),5,2850285829),c=bi(c,i,n,o,e.getUint32(8,!0),9,4243563512),o=bi(o,c,i,n,e.getUint32(28,!0),14,1735328473),n=bi(n,o,c,i,e.getUint32(48,!0),20,2368359562),i=_i(i,n,o,c,e.getUint32(20,!0),4,4294588738),c=_i(c,i,n,o,e.getUint32(32,!0),11,2272392833),o=_i(o,c,i,n,e.getUint32(44,!0),16,1839030562),n=_i(n,o,c,i,e.getUint32(56,!0),23,4259657740),i=_i(i,n,o,c,e.getUint32(4,!0),4,2763975236),c=_i(c,i,n,o,e.getUint32(16,!0),11,1272893353),o=_i(o,c,i,n,e.getUint32(28,!0),16,4139469664),n=_i(n,o,c,i,e.getUint32(40,!0),23,3200236656),i=_i(i,n,o,c,e.getUint32(52,!0),4,681279174),c=_i(c,i,n,o,e.getUint32(0,!0),11,3936430074),o=_i(o,c,i,n,e.getUint32(12,!0),16,3572445317),n=_i(n,o,c,i,e.getUint32(24,!0),23,76029189),i=_i(i,n,o,c,e.getUint32(36,!0),4,3654602809),c=_i(c,i,n,o,e.getUint32(48,!0),11,3873151461),o=_i(o,c,i,n,e.getUint32(60,!0),16,530742520),n=_i(n,o,c,i,e.getUint32(8,!0),23,3299628645),i=wi(i,n,o,c,e.getUint32(0,!0),6,4096336452),c=wi(c,i,n,o,e.getUint32(28,!0),10,1126891415),o=wi(o,c,i,n,e.getUint32(56,!0),15,2878612391),n=wi(n,o,c,i,e.getUint32(20,!0),21,4237533241),i=wi(i,n,o,c,e.getUint32(48,!0),6,1700485571),c=wi(c,i,n,o,e.getUint32(12,!0),10,2399980690),o=wi(o,c,i,n,e.getUint32(40,!0),15,4293915773),n=wi(n,o,c,i,e.getUint32(4,!0),21,2240044497),i=wi(i,n,o,c,e.getUint32(32,!0),6,1873313359),c=wi(c,i,n,o,e.getUint32(60,!0),10,4264355552),o=wi(o,c,i,n,e.getUint32(24,!0),15,2734768916),n=wi(n,o,c,i,e.getUint32(52,!0),21,1309151649),i=wi(i,n,o,c,e.getUint32(16,!0),6,4149444226),c=wi(c,i,n,o,e.getUint32(44,!0),10,3174756917),o=wi(o,c,i,n,e.getUint32(8,!0),15,718787259),n=wi(n,o,c,i,e.getUint32(36,!0),21,3951481745),r[0]=i+r[0]&4294967295,r[1]=n+r[1]&4294967295,r[2]=o+r[2]&4294967295,r[3]=c+r[3]&4294967295}reset(){this.state=Uint32Array.from(UQ),this.buffer=new DataView(new ArrayBuffer(64)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}};function Tw(t,e,r,i,n,o){return e=(e+t&4294967295)+(i+o&4294967295)&4294967295,(e<>>32-n)+r&4294967295}function vi(t,e,r,i,n,o,c){return Tw(e&r|~e&i,t,e,n,o,c)}function bi(t,e,r,i,n,o,c){return Tw(e&i|r&~i,t,e,n,o,c)}function _i(t,e,r,i,n,o,c){return Tw(e^r^i,t,e,n,o,c)}function wi(t,e,r,i,n,o,c){return Tw(r^(e|~i),t,e,n,o,c)}function Ike(t){return typeof t=="string"?t.length===0:t.byteLength===0}function Oke(t){return typeof t=="string"?Hs(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}m();m();var jQ=t=>{if(typeof t=="string"){let e=t.length;for(let r=e-1;r>=0;r--){let i=t.charCodeAt(r);i>127&&i<=2047?e++:i>2047&&i<=65535&&(e+=2),i>=56320&&i<=57343&&r--}return e}else{if(typeof t.byteLength=="number")return t.byteLength;if(typeof t.size=="number")return t.size}throw new Error(`Body Length computation failed for ${t}`)};m();m();m();m();m();var zQ={CrtSignerV4:null};var Mw=class{constructor(e){this.sigv4Signer=new Cf(e),this.signerOptions=e}async sign(e,r={}){if(r.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(e,r)}return this.sigv4Signer.sign(e,r)}async presign(e,r={}){if(r.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(e,r)}return this.sigv4Signer.presign(e,r)}getSigv4aSigner(){if(!this.sigv4aSigner){let e=null;try{if(e=zQ.CrtSignerV4,typeof e!="function")throw new Error}catch(r){throw r.message=`${r.message} -Please check if you have installed "@aws-sdk/signature-v4-crt" package explicitly. -For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`,r}this.sigv4aSigner=new e({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}};m();m();var jM="required",re="type",fe="conditions",Ye="fn",Qe="argv",Mt="ref",ai="assign",mt="url",gt="properties",Ka="authSchemes",Va="disableDoubleEncoding",Wa="signingName",bu="signingRegion",yt="headers";var Ws="isSet",ot="tree",xi="booleanEquals",pt="error",Iw="aws.partition",pn="stringEquals",bn="getAttr",Uo="name",yg="substring",NJ="hardwareType",BJ="regionPrefix",HQ="bucketAliasSuffix",LM="outpostId",kf="isValidHostLabel",hs="not",FJ="parseURL",zM="s3-outposts",st="endpoint",$Q="aws.isVirtualHostableS3Bucket",up="s3",LJ="{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",qJ="{url#scheme}://{Bucket}.{url#authority}{url#path}",UJ="https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",GQ="https://{Bucket}.s3.{partitionResult#dnsSuffix}",jJ="aws.parseArn",zJ="bucketArn",HJ="arnType",Ow="",HM="s3-object-lambda",$J="accesspoint",$M="accessPointName",KQ="{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",VQ="mrapPartition",WQ="outpostType",YQ="arnPrefix",GJ="{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",QQ="https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",qM="{url#scheme}://{url#authority}{url#path}",JQ="https://s3.{partitionResult#dnsSuffix}",mM={[jM]:!1,[re]:"String"},cp={[jM]:!0,default:!1,[re]:"Boolean"},gM={[jM]:!1,[re]:"Boolean"},ds={[Ye]:xi,[Qe]:[{[Mt]:"Accelerate"},!0]},rn={[Ye]:xi,[Qe]:[{[Mt]:"UseFIPS"},!0]},Hr={[Ye]:xi,[Qe]:[{[Mt]:"UseDualStack"},!0]},vn={[Ye]:Ws,[Qe]:[{[Mt]:"Endpoint"}]},KJ={[Ye]:Iw,[Qe]:[{[Mt]:"Region"}],[ai]:"partitionResult"},XQ={[Ye]:pn,[Qe]:[{[Ye]:bn,[Qe]:[{[Mt]:"partitionResult"},Uo]},"aws-cn"]},VJ={[Ye]:Ws,[Qe]:[{[Mt]:"Bucket"}]},Ga={[Mt]:"Bucket"},ZQ={[Mt]:NJ},eJ={[fe]:[{[Ye]:hs,[Qe]:[vn]}],[pt]:"Expected a endpoint to be specified but no endpoint was found",[re]:pt},Tt={[Ye]:hs,[Qe]:[vn]},Ii={[Ye]:FJ,[Qe]:[{[Mt]:"Endpoint"}],[ai]:"url"},Rw={[Ka]:[{[Va]:!0,[Uo]:"sigv4",[Wa]:zM,[bu]:"{Region}"}]},Ft={},yM={[Ye]:xi,[Qe]:[{[Mt]:"ForcePathStyle"},!1]},Pke={[Mt]:"ForcePathStyle"},Rn={[Ye]:xi,[Qe]:[{[Mt]:"Accelerate"},!1]},qn={[Ye]:pn,[Qe]:[{[Mt]:"Region"},"aws-global"]},Vn={[Ka]:[{[Va]:!0,[Uo]:"sigv4",[Wa]:up,[bu]:"us-east-1"}]},Xt={[Ye]:hs,[Qe]:[qn]},Wn={[Ye]:xi,[Qe]:[{[Mt]:"UseGlobalEndpoint"},!0]},tJ={[mt]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[gt]:{[Ka]:[{[Va]:!0,[Uo]:"sigv4",[Wa]:up,[bu]:"{Region}"}]},[yt]:{}},Dn={[Ka]:[{[Va]:!0,[Uo]:"sigv4",[Wa]:up,[bu]:"{Region}"}]},Yn={[Ye]:xi,[Qe]:[{[Mt]:"UseGlobalEndpoint"},!1]},Vt={[Ye]:xi,[Qe]:[{[Mt]:"UseDualStack"},!1]},rJ={[mt]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",[gt]:Dn,[yt]:{}},Nt={[Ye]:xi,[Qe]:[{[Mt]:"UseFIPS"},!1]},nJ={[mt]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",[gt]:Dn,[yt]:{}},iJ={[mt]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[gt]:Dn,[yt]:{}},vM={[Ye]:xi,[Qe]:[{[Ye]:bn,[Qe]:[{[Mt]:"url"},"isIp"]},!0]},WJ={[Mt]:"url"},bM={[Ye]:xi,[Qe]:[{[Ye]:bn,[Qe]:[WJ,"isIp"]},!1]},_M={[mt]:LJ,[gt]:Dn,[yt]:{}},UM={[mt]:qJ,[gt]:Dn,[yt]:{}},oJ={[st]:UM,[re]:st},wM={[mt]:UJ,[gt]:Dn,[yt]:{}},sJ={[mt]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",[gt]:Dn,[yt]:{}},Dw={[pt]:"Invalid region: region was not a valid DNS name.",[re]:pt},Gi={[Mt]:zJ},YJ={[Mt]:HJ},xM={[Ye]:bn,[Qe]:[Gi,"service"]},GM={[Mt]:$M},aJ={[fe]:[Hr],[pt]:"S3 Object Lambda does not support Dual-stack",[re]:pt},cJ={[fe]:[ds],[pt]:"S3 Object Lambda does not support S3 Accelerate",[re]:pt},uJ={[fe]:[{[Ye]:Ws,[Qe]:[{[Mt]:"DisableAccessPoints"}]},{[Ye]:xi,[Qe]:[{[Mt]:"DisableAccessPoints"},!0]}],[pt]:"Access points are not supported for this operation",[re]:pt},EM={[fe]:[{[Ye]:Ws,[Qe]:[{[Mt]:"UseArnRegion"}]},{[Ye]:xi,[Qe]:[{[Mt]:"UseArnRegion"},!1]},{[Ye]:hs,[Qe]:[{[Ye]:pn,[Qe]:[{[Ye]:bn,[Qe]:[Gi,"region"]},"{Region}"]}]}],[pt]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",[re]:pt},QJ={[Ye]:bn,[Qe]:[{[Mt]:"bucketPartition"},Uo]},JJ={[Ye]:bn,[Qe]:[Gi,"accountId"]},SM={[Ka]:[{[Va]:!0,[Uo]:"sigv4",[Wa]:HM,[bu]:"{bucketArn#region}"}]},lJ={[pt]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",[re]:pt},CM={[pt]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",[re]:pt},AM={[pt]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",[re]:pt},TM={[pt]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",[re]:pt},fJ={[pt]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",[re]:pt},dJ={[pt]:"Invalid ARN: Expected a resource of the format `accesspoint:` but no name was provided",[re]:pt},vg={[Ka]:[{[Va]:!0,[Uo]:"sigv4",[Wa]:up,[bu]:"{bucketArn#region}"}]},hJ={[Ka]:[{[Va]:!0,[Uo]:"sigv4",[Wa]:zM,[bu]:"{bucketArn#region}"}]},pJ={[Ye]:jJ,[Qe]:[Ga]},mJ={[mt]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[gt]:Dn,[yt]:{}},gJ={[mt]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[gt]:Dn,[yt]:{}},yJ={[mt]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[gt]:Dn,[yt]:{}},MM={[mt]:GJ,[gt]:Dn,[yt]:{}},vJ={[mt]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[gt]:Dn,[yt]:{}},bJ={[Mt]:"UseObjectLambdaEndpoint"},RM={[Ka]:[{[Va]:!0,[Uo]:"sigv4",[Wa]:HM,[bu]:"{Region}"}]},_J={[mt]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[gt]:Dn,[yt]:{}},wJ={[mt]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",[gt]:Dn,[yt]:{}},xJ={[mt]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[gt]:Dn,[yt]:{}},DM={[mt]:qM,[gt]:Dn,[yt]:{}},EJ={[mt]:"https://s3.{Region}.{partitionResult#dnsSuffix}",[gt]:Dn,[yt]:{}},kM=[{[Mt]:"Region"}],Nke=[{[Mt]:"Endpoint"}],SJ=[Ga],CJ=[{[Ye]:kf,[Qe]:[{[Mt]:LM},!1]}],AJ=[{[Ye]:pn,[Qe]:[{[Mt]:BJ},"beta"]}],bg=[vn,Ii],TJ=[VJ],yu=[KJ],MJ=[{[Ye]:kf,[Qe]:[{[Mt]:"Region"},!1]}],vu=[{[Ye]:pn,[Qe]:[{[Mt]:"Region"},"us-east-1"]}],IM=[{[Ye]:pn,[Qe]:[YJ,$J]}],RJ=[{[Ye]:bn,[Qe]:[Gi,"resourceId[1]"],[ai]:$M},{[Ye]:hs,[Qe]:[{[Ye]:pn,[Qe]:[GM,Ow]}]}],Bke=[Gi,"resourceId[1]"],DJ=[Hr],OM=[ds],PM=[{[Ye]:hs,[Qe]:[{[Ye]:pn,[Qe]:[{[Ye]:bn,[Qe]:[Gi,"region"]},Ow]}]}],kJ=[{[Ye]:hs,[Qe]:[{[Ye]:Ws,[Qe]:[{[Ye]:bn,[Qe]:[Gi,"resourceId[2]"]}]}]}],Fke=[Gi,"resourceId[2]"],NM=[{[Ye]:Iw,[Qe]:[{[Ye]:bn,[Qe]:[Gi,"region"]}],[ai]:"bucketPartition"}],IJ=[{[Ye]:pn,[Qe]:[QJ,{[Ye]:bn,[Qe]:[{[Mt]:"partitionResult"},Uo]}]}],BM=[{[Ye]:kf,[Qe]:[{[Ye]:bn,[Qe]:[Gi,"region"]},!0]}],FM=[{[Ye]:kf,[Qe]:[JJ,!1]}],OJ=[{[Ye]:kf,[Qe]:[GM,!1]}],kw=[rn],PJ=[{[Ye]:kf,[Qe]:[{[Mt]:"Region"},!0]}],Lke={version:"1.0",parameters:{Bucket:mM,Region:mM,UseFIPS:cp,UseDualStack:cp,Endpoint:mM,ForcePathStyle:cp,Accelerate:cp,UseGlobalEndpoint:cp,UseObjectLambdaEndpoint:gM,DisableAccessPoints:gM,DisableMultiRegionAccessPoints:cp,UseArnRegion:gM},rules:[{[fe]:[{[Ye]:Ws,[Qe]:kM}],[re]:ot,rules:[{[fe]:[ds,rn],error:"Accelerate cannot be used with FIPS",[re]:pt},{[fe]:[Hr,vn],error:"Cannot set dual-stack in combination with a custom endpoint.",[re]:pt},{[fe]:[vn,rn],error:"A custom endpoint cannot be combined with FIPS",[re]:pt},{[fe]:[vn,ds],error:"A custom endpoint cannot be combined with S3 Accelerate",[re]:pt},{[fe]:[rn,KJ,XQ],error:"Partition does not support FIPS",[re]:pt},{[fe]:[VJ,{[Ye]:yg,[Qe]:[Ga,49,50,!0],[ai]:NJ},{[Ye]:yg,[Qe]:[Ga,8,12,!0],[ai]:BJ},{[Ye]:yg,[Qe]:[Ga,0,7,!0],[ai]:HQ},{[Ye]:yg,[Qe]:[Ga,32,49,!0],[ai]:LM},{[Ye]:Iw,[Qe]:kM,[ai]:"regionPartition"},{[Ye]:pn,[Qe]:[{[Mt]:HQ},"--op-s3"]}],[re]:ot,rules:[{[fe]:CJ,[re]:ot,rules:[{[fe]:[{[Ye]:pn,[Qe]:[ZQ,"e"]}],[re]:ot,rules:[{[fe]:AJ,[re]:ot,rules:[eJ,{[fe]:bg,endpoint:{[mt]:"https://{Bucket}.ec2.{url#authority}",[gt]:Rw,[yt]:Ft},[re]:st}]},{endpoint:{[mt]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[gt]:Rw,[yt]:Ft},[re]:st}]},{[fe]:[{[Ye]:pn,[Qe]:[ZQ,"o"]}],[re]:ot,rules:[{[fe]:AJ,[re]:ot,rules:[eJ,{[fe]:bg,endpoint:{[mt]:"https://{Bucket}.op-{outpostId}.{url#authority}",[gt]:Rw,[yt]:Ft},[re]:st}]},{endpoint:{[mt]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[gt]:Rw,[yt]:Ft},[re]:st}]},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',[re]:pt}]},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",[re]:pt}]},{[fe]:TJ,[re]:ot,rules:[{[fe]:[vn,{[Ye]:hs,[Qe]:[{[Ye]:Ws,[Qe]:[{[Ye]:FJ,[Qe]:Nke}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",[re]:pt},{[fe]:[yM,{[Ye]:$Q,[Qe]:[Ga,!1]}],[re]:ot,rules:[{[fe]:yu,[re]:ot,rules:[{[fe]:MJ,[re]:ot,rules:[{[fe]:[ds,XQ],error:"S3 Accelerate cannot be used in this region",[re]:pt},{[fe]:[Hr,rn,Rn,Tt,qn],endpoint:{[mt]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Hr,rn,Rn,Tt,Xt,Wn],[re]:ot,rules:[{endpoint:tJ,[re]:st}]},{[fe]:[Hr,rn,Rn,Tt,Xt,Yn],endpoint:tJ,[re]:st},{[fe]:[Vt,rn,Rn,Tt,qn],endpoint:{[mt]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Vt,rn,Rn,Tt,Xt,Wn],[re]:ot,rules:[{endpoint:rJ,[re]:st}]},{[fe]:[Vt,rn,Rn,Tt,Xt,Yn],endpoint:rJ,[re]:st},{[fe]:[Hr,Nt,ds,Tt,qn],endpoint:{[mt]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Hr,Nt,ds,Tt,Xt,Wn],[re]:ot,rules:[{endpoint:nJ,[re]:st}]},{[fe]:[Hr,Nt,ds,Tt,Xt,Yn],endpoint:nJ,[re]:st},{[fe]:[Hr,Nt,Rn,Tt,qn],endpoint:{[mt]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Hr,Nt,Rn,Tt,Xt,Wn],[re]:ot,rules:[{endpoint:iJ,[re]:st}]},{[fe]:[Hr,Nt,Rn,Tt,Xt,Yn],endpoint:iJ,[re]:st},{[fe]:[Vt,Nt,Rn,vn,Ii,vM,qn],endpoint:{[mt]:LJ,[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Vt,Nt,Rn,vn,Ii,bM,qn],endpoint:{[mt]:qJ,[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Vt,Nt,Rn,vn,Ii,vM,Xt,Wn],[re]:ot,rules:[{[fe]:vu,endpoint:_M,[re]:st},{endpoint:_M,[re]:st}]},{[fe]:[Vt,Nt,Rn,vn,Ii,bM,Xt,Wn],[re]:ot,rules:[{[fe]:vu,endpoint:UM,[re]:st},oJ]},{[fe]:[Vt,Nt,Rn,vn,Ii,vM,Xt,Yn],endpoint:_M,[re]:st},{[fe]:[Vt,Nt,Rn,vn,Ii,bM,Xt,Yn],endpoint:UM,[re]:st},{[fe]:[Vt,Nt,ds,Tt,qn],endpoint:{[mt]:UJ,[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Vt,Nt,ds,Tt,Xt,Wn],[re]:ot,rules:[{[fe]:vu,endpoint:wM,[re]:st},{endpoint:wM,[re]:st}]},{[fe]:[Vt,Nt,ds,Tt,Xt,Yn],endpoint:wM,[re]:st},{[fe]:[Vt,Nt,Rn,Tt,qn],endpoint:{[mt]:GQ,[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Vt,Nt,Rn,Tt,Xt,Wn],[re]:ot,rules:[{[fe]:vu,endpoint:{[mt]:GQ,[gt]:Dn,[yt]:Ft},[re]:st},{endpoint:sJ,[re]:st}]},{[fe]:[Vt,Nt,Rn,Tt,Xt,Yn],endpoint:sJ,[re]:st}]},Dw]}]},{[fe]:[vn,Ii,{[Ye]:pn,[Qe]:[{[Ye]:bn,[Qe]:[WJ,"scheme"]},"http"]},{[Ye]:$Q,[Qe]:[Ga,!0]},yM,Nt,Vt,Rn],[re]:ot,rules:[{[fe]:yu,[re]:ot,rules:[{[fe]:MJ,[re]:ot,rules:[oJ]},Dw]}]},{[fe]:[yM,{[Ye]:jJ,[Qe]:SJ,[ai]:zJ}],[re]:ot,rules:[{[fe]:[{[Ye]:bn,[Qe]:[Gi,"resourceId[0]"],[ai]:HJ},{[Ye]:hs,[Qe]:[{[Ye]:pn,[Qe]:[YJ,Ow]}]}],[re]:ot,rules:[{[fe]:[{[Ye]:pn,[Qe]:[xM,HM]}],[re]:ot,rules:[{[fe]:IM,[re]:ot,rules:[{[fe]:RJ,[re]:ot,rules:[aJ,cJ,{[fe]:PM,[re]:ot,rules:[uJ,{[fe]:kJ,[re]:ot,rules:[EM,{[fe]:NM,[re]:ot,rules:[{[fe]:yu,[re]:ot,rules:[{[fe]:IJ,[re]:ot,rules:[{[fe]:BM,[re]:ot,rules:[{[fe]:[{[Ye]:pn,[Qe]:[JJ,Ow]}],error:"Invalid ARN: Missing account id",[re]:pt},{[fe]:FM,[re]:ot,rules:[{[fe]:OJ,[re]:ot,rules:[{[fe]:bg,endpoint:{[mt]:KQ,[gt]:SM,[yt]:Ft},[re]:st},{[fe]:kw,endpoint:{[mt]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[gt]:SM,[yt]:Ft},[re]:st},{endpoint:{[mt]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",[gt]:SM,[yt]:Ft},[re]:st}]},lJ]},CM]},AM]},TM]}]}]},fJ]},{error:"Invalid ARN: bucket ARN is missing a region",[re]:pt}]},dJ]},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",[re]:pt}]},{[fe]:IM,[re]:ot,rules:[{[fe]:RJ,[re]:ot,rules:[{[fe]:PM,[re]:ot,rules:[{[fe]:IM,[re]:ot,rules:[{[fe]:PM,[re]:ot,rules:[uJ,{[fe]:kJ,[re]:ot,rules:[EM,{[fe]:NM,[re]:ot,rules:[{[fe]:yu,[re]:ot,rules:[{[fe]:[{[Ye]:pn,[Qe]:[QJ,"{partitionResult#name}"]}],[re]:ot,rules:[{[fe]:BM,[re]:ot,rules:[{[fe]:[{[Ye]:pn,[Qe]:[xM,up]}],[re]:ot,rules:[{[fe]:FM,[re]:ot,rules:[{[fe]:OJ,[re]:ot,rules:[{[fe]:OM,error:"Access Points do not support S3 Accelerate",[re]:pt},{[fe]:[rn,Hr],endpoint:{[mt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[gt]:vg,[yt]:Ft},[re]:st},{[fe]:[rn,Vt],endpoint:{[mt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[gt]:vg,[yt]:Ft},[re]:st},{[fe]:[Nt,Hr],endpoint:{[mt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[gt]:vg,[yt]:Ft},[re]:st},{[fe]:[Nt,Vt,vn,Ii],endpoint:{[mt]:KQ,[gt]:vg,[yt]:Ft},[re]:st},{[fe]:[Nt,Vt],endpoint:{[mt]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",[gt]:vg,[yt]:Ft},[re]:st}]},lJ]},CM]},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",[re]:pt}]},AM]},TM]}]}]},fJ]}]}]},{[fe]:[{[Ye]:kf,[Qe]:[GM,!0]}],[re]:ot,rules:[{[fe]:DJ,error:"S3 MRAP does not support dual-stack",[re]:pt},{[fe]:kw,error:"S3 MRAP does not support FIPS",[re]:pt},{[fe]:OM,error:"S3 MRAP does not support S3 Accelerate",[re]:pt},{[fe]:[{[Ye]:xi,[Qe]:[{[Mt]:"DisableMultiRegionAccessPoints"},!0]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",[re]:pt},{[fe]:[{[Ye]:Iw,[Qe]:kM,[ai]:VQ}],[re]:ot,rules:[{[fe]:[{[Ye]:pn,[Qe]:[{[Ye]:bn,[Qe]:[{[Mt]:VQ},Uo]},{[Ye]:bn,[Qe]:[Gi,"partition"]}]}],[re]:ot,rules:[{endpoint:{[mt]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",[gt]:{[Ka]:[{[Va]:!0,name:"sigv4a",[Wa]:up,signingRegionSet:["*"]}]},[yt]:Ft},[re]:st}]},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",[re]:pt}]}]},{error:"Invalid Access Point Name",[re]:pt}]},dJ]},{[fe]:[{[Ye]:pn,[Qe]:[xM,zM]}],[re]:ot,rules:[{[fe]:DJ,error:"S3 Outposts does not support Dual-stack",[re]:pt},{[fe]:kw,error:"S3 Outposts does not support FIPS",[re]:pt},{[fe]:OM,error:"S3 Outposts does not support S3 Accelerate",[re]:pt},{[fe]:[{[Ye]:Ws,[Qe]:[{[Ye]:bn,[Qe]:[Gi,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",[re]:pt},{[fe]:[{[Ye]:bn,[Qe]:Bke,[ai]:LM}],[re]:ot,rules:[{[fe]:CJ,[re]:ot,rules:[EM,{[fe]:NM,[re]:ot,rules:[{[fe]:yu,[re]:ot,rules:[{[fe]:IJ,[re]:ot,rules:[{[fe]:BM,[re]:ot,rules:[{[fe]:FM,[re]:ot,rules:[{[fe]:[{[Ye]:bn,[Qe]:Fke,[ai]:WQ}],[re]:ot,rules:[{[fe]:[{[Ye]:bn,[Qe]:[Gi,"resourceId[3]"],[ai]:$M}],[re]:ot,rules:[{[fe]:[{[Ye]:pn,[Qe]:[{[Mt]:WQ},$J]}],[re]:ot,rules:[{[fe]:bg,endpoint:{[mt]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",[gt]:hJ,[yt]:Ft},[re]:st},{endpoint:{[mt]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",[gt]:hJ,[yt]:Ft},[re]:st}]},{error:"Expected an outpost type `accesspoint`, found {outpostType}",[re]:pt}]},{error:"Invalid ARN: expected an access point name",[re]:pt}]},{error:"Invalid ARN: Expected a 4-component resource",[re]:pt}]},CM]},AM]},TM]}]}]},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",[re]:pt}]},{error:"Invalid ARN: The Outpost Id was not set",[re]:pt}]},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",[re]:pt}]},{error:"Invalid ARN: No ARN type specified",[re]:pt}]},{[fe]:[{[Ye]:yg,[Qe]:[Ga,0,4,!1],[ai]:YQ},{[Ye]:pn,[Qe]:[{[Mt]:YQ},"arn:"]},{[Ye]:hs,[Qe]:[{[Ye]:Ws,[Qe]:[pJ]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",[re]:pt},{[fe]:[{[Ye]:xi,[Qe]:[Pke,!0]},pJ],error:"Path-style addressing cannot be used with ARN buckets",[re]:pt},{[fe]:[{[Ye]:"uriEncode",[Qe]:SJ,[ai]:"uri_encoded_bucket"}],[re]:ot,rules:[{[fe]:yu,[re]:ot,rules:[{[fe]:[Rn],[re]:ot,rules:[{[fe]:[Hr,Tt,rn,qn],endpoint:{[mt]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Hr,Tt,rn,Xt,Wn],[re]:ot,rules:[{endpoint:mJ,[re]:st}]},{[fe]:[Hr,Tt,rn,Xt,Yn],endpoint:mJ,[re]:st},{[fe]:[Vt,Tt,rn,qn],endpoint:{[mt]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Vt,Tt,rn,Xt,Wn],[re]:ot,rules:[{endpoint:gJ,[re]:st}]},{[fe]:[Vt,Tt,rn,Xt,Yn],endpoint:gJ,[re]:st},{[fe]:[Hr,Tt,Nt,qn],endpoint:{[mt]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Hr,Tt,Nt,Xt,Wn],[re]:ot,rules:[{endpoint:yJ,[re]:st}]},{[fe]:[Hr,Tt,Nt,Xt,Yn],endpoint:yJ,[re]:st},{[fe]:[Vt,vn,Ii,Nt,qn],endpoint:{[mt]:GJ,[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Vt,vn,Ii,Nt,Xt,Wn],[re]:ot,rules:[{[fe]:vu,endpoint:MM,[re]:st},{endpoint:MM,[re]:st}]},{[fe]:[Vt,vn,Ii,Nt,Xt,Yn],endpoint:MM,[re]:st},{[fe]:[Vt,Tt,Nt,qn],endpoint:{[mt]:QQ,[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Vt,Tt,Nt,Xt,Wn],[re]:ot,rules:[{[fe]:vu,endpoint:{[mt]:QQ,[gt]:Dn,[yt]:Ft},[re]:st},{endpoint:vJ,[re]:st}]},{[fe]:[Vt,Tt,Nt,Xt,Yn],endpoint:vJ,[re]:st}]},{error:"Path-style addressing cannot be used with S3 Accelerate",[re]:pt}]}]}]},{[fe]:[{[Ye]:Ws,[Qe]:[bJ]},{[Ye]:xi,[Qe]:[bJ,!0]}],[re]:ot,rules:[{[fe]:yu,[re]:ot,rules:[{[fe]:PJ,[re]:ot,rules:[aJ,cJ,{[fe]:bg,endpoint:{[mt]:qM,[gt]:RM,[yt]:Ft},[re]:st},{[fe]:kw,endpoint:{[mt]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",[gt]:RM,[yt]:Ft},[re]:st},{endpoint:{[mt]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",[gt]:RM,[yt]:Ft},[re]:st}]},Dw]}]},{[fe]:[{[Ye]:hs,[Qe]:TJ}],[re]:ot,rules:[{[fe]:yu,[re]:ot,rules:[{[fe]:PJ,[re]:ot,rules:[{[fe]:[rn,Hr,Tt,qn],endpoint:{[mt]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[rn,Hr,Tt,Xt,Wn],[re]:ot,rules:[{endpoint:_J,[re]:st}]},{[fe]:[rn,Hr,Tt,Xt,Yn],endpoint:_J,[re]:st},{[fe]:[rn,Vt,Tt,qn],endpoint:{[mt]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[rn,Vt,Tt,Xt,Wn],[re]:ot,rules:[{endpoint:wJ,[re]:st}]},{[fe]:[rn,Vt,Tt,Xt,Yn],endpoint:wJ,[re]:st},{[fe]:[Nt,Hr,Tt,qn],endpoint:{[mt]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Nt,Hr,Tt,Xt,Wn],[re]:ot,rules:[{endpoint:xJ,[re]:st}]},{[fe]:[Nt,Hr,Tt,Xt,Yn],endpoint:xJ,[re]:st},{[fe]:[Nt,Vt,vn,Ii,qn],endpoint:{[mt]:qM,[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Nt,Vt,vn,Ii,Xt,Wn],[re]:ot,rules:[{[fe]:vu,endpoint:DM,[re]:st},{endpoint:DM,[re]:st}]},{[fe]:[Nt,Vt,vn,Ii,Xt,Yn],endpoint:DM,[re]:st},{[fe]:[Nt,Vt,Tt,qn],endpoint:{[mt]:JQ,[gt]:Vn,[yt]:Ft},[re]:st},{[fe]:[Nt,Vt,Tt,Xt,Wn],[re]:ot,rules:[{[fe]:vu,endpoint:{[mt]:JQ,[gt]:Dn,[yt]:Ft},[re]:st},{endpoint:EJ,[re]:st}]},{[fe]:[Nt,Vt,Tt,Xt,Yn],endpoint:EJ,[re]:st}]},Dw]}]}]},{error:"A region must be set when sending requests to S3.",[re]:pt}]},XJ=Lke;var ZJ=(t,e={})=>MV(XJ,{endpointParams:t,logger:e.logger});var eX=t=>({apiVersion:"2006-03-01",base64Decoder:t?.base64Decoder??zh,base64Encoder:t?.base64Encoder??Hh,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??ZJ,extensions:t?.extensions??[],getAwsChunkedEncodingStream:t?.getAwsChunkedEncodingStream??CG,logger:t?.logger??new Uh,sdkStreamMixin:t?.sdkStreamMixin??OG,serviceId:t?.serviceId??"S3",signerConstructor:t?.signerConstructor??Mw,signingEscapePath:t?.signingEscapePath??!1,urlParser:t?.urlParser??Zh,useArnRegion:t?.useArnRegion??!1,utf8Decoder:t?.utf8Decoder??Hs,utf8Encoder:t?.utf8Encoder??su});m();m();var rX=Et(pM());m();var tX=["in-region","cross-region","mobile","standard","legacy"];var nX=({defaultsMode:t}={})=>p1(async()=>{let e=typeof t=="function"?await t():t;switch(e?.toLowerCase()){case"auto":return Promise.resolve(qke()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${tX.join(", ")}, got ${e}`)}}),qke=()=>{let e=(typeof window<"u"&&window?.navigator?.userAgent?rX.default.parse(window.navigator.userAgent):void 0)?.platform?.type;return e==="tablet"||e==="mobile"};var sX=t=>{let e=nX(t),r=()=>e().then(HG),i=eX(t);return{...i,...t,runtime:"browser",defaultsMode:e,bodyLengthChecker:t?.bodyLengthChecker??jQ,credentialDefaultProvider:t?.credentialDefaultProvider??(n=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:t?.defaultUserAgentProvider??kQ({serviceId:i.serviceId,clientVersion:oW.version}),eventStreamSerdeProvider:t?.eventStreamSerdeProvider??BQ,maxAttempts:t?.maxAttempts??mu,md5:t?.md5??Aw,region:t?.region??qQ("Region is missing"),requestHandler:t?.requestHandler??new c1(r),retryMode:t?.retryMode??(async()=>(await r()).retryMode||LT),sha1:t?.sha1??iX.Sha1,sha256:t?.sha256??oX.Sha256,streamCollector:t?.streamCollector??u1,streamHasher:t?.streamHasher??LQ,useDualstackEndpoint:t?.useDualstackEndpoint??(()=>Promise.resolve(IV)),useFipsEndpoint:t?.useFipsEndpoint??(()=>Promise.resolve(OV))}};m();m();m();var aX=t=>{let e=async()=>{if(t.region===void 0)throw new Error("Region is missing from runtimeConfig");let r=t.region;return typeof r=="string"?r:r()};return{setRegion(r){e=r},region(){return e}}},cX=t=>({region:t.region()});m();m();m();m();m();var KM=t=>t,uX=(t,e)=>{let r={...KM(aX(t)),...KM(WG(t)),...KM(dG(t))};return e.forEach(i=>i.configure(r)),{...t,...cX(r),...YG(r),...hG(r)}};var Pw=class extends a1{constructor(...[e]){let r=sX(e||{}),i=iW(r),n=PV(i),o=GV(n),c=rW(o),u=c,d=lV(u),y=eK(d),E=pV(y),x=NV(E),A=uX(x,e?.extensions||[]);super(A),this.config=A,this.middlewareStack.use(nW(this.config)),this.middlewareStack.use(FV(this.config)),this.middlewareStack.use(gG(this.config)),this.middlewareStack.use(yG(this.config)),this.middlewareStack.use(bG(this.config)),this.middlewareStack.use(hV(this.config)),this.middlewareStack.use(iK(this.config)),this.middlewareStack.use(mG(this.config)),this.middlewareStack.use(ZG(this.config)),this.middlewareStack.use(kV(this.config))}destroy(){super.destroy()}};m();m();m();m();function lX(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}m();m();function fX(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\r/g," ").replace(/\n/g," ").replace(/\u0085/g,"…").replace(/\u2028/,"
")}var _g=class{constructor(e){this.value=e}toString(){return fX(""+this.value)}};var Qn=class{static of(e,r,i){let n=new Qn(e);return r!==void 0&&n.addChildNode(new _g(r)),i!==void 0&&n.withName(i),n}constructor(e,r=[]){this.name=e,this.children=r,this.attributes={}}withName(e){return this.name=e,this}addAttribute(e,r){return this.attributes[e]=r,this}addChildNode(e){return this.children.push(e),this}removeAttribute(e){return delete this.attributes[e],this}toString(){let e=Boolean(this.children.length),r=`<${this.name}`,i=this.attributes;for(let n of Object.keys(i)){let o=i[n];typeof o<"u"&&o!==null&&(r+=` ${n}="${lX(""+o)}"`)}return r+=e?`>${this.children.map(n=>n.toString()).join("")}`:"/>"}};var iZ=Et(zX());m();m();var ps=class extends Gh{constructor(e){super(e),Object.setPrototypeOf(this,ps.prototype)}};var rR;(function(t){t.visit=(e,r)=>e.Prefix!==void 0?r.Prefix(e.Prefix):e.Tag!==void 0?r.Tag(e.Tag):e.And!==void 0?r.And(e.And):r._(e.$unknown[0],e.$unknown[1])})(rR||(rR={}));var nR;(function(t){t.visit=(e,r)=>e.Prefix!==void 0?r.Prefix(e.Prefix):e.Tag!==void 0?r.Tag(e.Tag):e.ObjectSizeGreaterThan!==void 0?r.ObjectSizeGreaterThan(e.ObjectSizeGreaterThan):e.ObjectSizeLessThan!==void 0?r.ObjectSizeLessThan(e.ObjectSizeLessThan):e.And!==void 0?r.And(e.And):r._(e.$unknown[0],e.$unknown[1])})(nR||(nR={}));var iR;(function(t){t.visit=(e,r)=>e.Prefix!==void 0?r.Prefix(e.Prefix):e.Tag!==void 0?r.Tag(e.Tag):e.AccessPointArn!==void 0?r.AccessPointArn(e.AccessPointArn):e.And!==void 0?r.And(e.And):r._(e.$unknown[0],e.$unknown[1])})(iR||(iR={}));var oR;(function(t){t.visit=(e,r)=>e.Prefix!==void 0?r.Prefix(e.Prefix):e.Tag!==void 0?r.Tag(e.Tag):e.And!==void 0?r.And(e.And):r._(e.$unknown[0],e.$unknown[1])})(oR||(oR={}));var lp=class extends ps{constructor(e){super({name:"InvalidObjectState",$fault:"client",...e}),this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,lp.prototype),this.StorageClass=e.StorageClass,this.AccessTier=e.AccessTier}},fp=class extends ps{constructor(e){super({name:"NoSuchKey",$fault:"client",...e}),this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,fp.prototype)}};var dp=class extends ps{constructor(e){super({name:"NotFound",$fault:"client",...e}),this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,dp.prototype)}};var hp=class extends ps{constructor(e){super({name:"NoSuchBucket",$fault:"client",...e}),this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,hp.prototype)}};var HX=t=>({...t,...t.SSEKMSKeyId&&{SSEKMSKeyId:An}}),$X=t=>({...t,...t.SSECustomerKey&&{SSECustomerKey:An}});var GX=t=>({...t,...t.SSEKMSKeyId&&{SSEKMSKeyId:An},...t.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:An}}),KX=t=>({...t,...t.SSECustomerKey&&{SSECustomerKey:An},...t.SSEKMSKeyId&&{SSEKMSKeyId:An},...t.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:An}});var VX=t=>({...t,...t.SSEKMSKeyId&&{SSEKMSKeyId:An}}),WX=t=>({...t,...t.SSECustomerKey&&{SSECustomerKey:An}});var YX=t=>({...t,...t.SSEKMSKeyId&&{SSEKMSKeyId:An}}),QX=t=>({...t,...t.SSECustomerKey&&{SSECustomerKey:An}});var JX=t=>({...t,...t.SSEKMSKeyId&&{SSEKMSKeyId:An},...t.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:An}}),XX=t=>({...t,...t.SSECustomerKey&&{SSECustomerKey:An},...t.SSEKMSKeyId&&{SSEKMSKeyId:An},...t.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:An}});m();var ZX;(function(t){t.visit=(e,r)=>e.Records!==void 0?r.Records(e.Records):e.Stats!==void 0?r.Stats(e.Stats):e.Progress!==void 0?r.Progress(e.Progress):e.Cont!==void 0?r.Cont(e.Cont):e.End!==void 0?r.End(e.End):r._(e.$unknown[0],e.$unknown[1])})(ZX||(ZX={}));var eZ=t=>({...t,...t.SSEKMSKeyId&&{SSEKMSKeyId:An}}),tZ=t=>({...t,...t.SSECustomerKey&&{SSECustomerKey:An}});var oZ=async(t,e)=>{let{hostname:r,protocol:i="https",port:n,path:o}=await e.endpoint(),c=Zt({},nn,{"content-type":"application/xml","x-amz-checksum-crc32":t.ChecksumCRC32,"x-amz-checksum-crc32c":t.ChecksumCRC32C,"x-amz-checksum-sha1":t.ChecksumSHA1,"x-amz-checksum-sha256":t.ChecksumSHA256,"x-amz-request-payer":t.RequestPayer,"x-amz-expected-bucket-owner":t.ExpectedBucketOwner,"x-amz-server-side-encryption-customer-algorithm":t.SSECustomerAlgorithm,"x-amz-server-side-encryption-customer-key":t.SSECustomerKey,"x-amz-server-side-encryption-customer-key-md5":t.SSECustomerKeyMD5}),u=`${o?.endsWith("/")?o.slice(0,-1):o||""}/{Key+}`;u=Ln(u,t,"Bucket",()=>t.Bucket,"{Bucket}",!1),u=Ln(u,t,"Key",()=>t.Key,"{Key+}",!0);let d=Zt({"x-id":[,"CompleteMultipartUpload"],uploadId:[,yi(t.UploadId,"UploadId")]}),y;t.MultipartUpload!==void 0&&(y=rZ(t.MultipartUpload,e));let E;return t.MultipartUpload!==void 0&&(E=rZ(t.MultipartUpload,e),E=E.withName("CompleteMultipartUpload"),y='',E.addAttribute("xmlns","http://s3.amazonaws.com/doc/2006-03-01/"),y+=E.toString()),new zt({protocol:i,hostname:r,port:n,method:"POST",headers:c,path:u,query:d,body:y})};var sZ=async(t,e)=>{let{hostname:r,protocol:i="https",port:n,path:o}=await e.endpoint(),c=Zt({},nn,{"x-amz-acl":t.ACL,"cache-control":t.CacheControl,"content-disposition":t.ContentDisposition,"content-encoding":t.ContentEncoding,"content-language":t.ContentLanguage,"content-type":t.ContentType,expires:[()=>nn(t.Expires),()=>lu(t.Expires).toString()],"x-amz-grant-full-control":t.GrantFullControl,"x-amz-grant-read":t.GrantRead,"x-amz-grant-read-acp":t.GrantReadACP,"x-amz-grant-write-acp":t.GrantWriteACP,"x-amz-server-side-encryption":t.ServerSideEncryption,"x-amz-storage-class":t.StorageClass,"x-amz-website-redirect-location":t.WebsiteRedirectLocation,"x-amz-server-side-encryption-customer-algorithm":t.SSECustomerAlgorithm,"x-amz-server-side-encryption-customer-key":t.SSECustomerKey,"x-amz-server-side-encryption-customer-key-md5":t.SSECustomerKeyMD5,"x-amz-server-side-encryption-aws-kms-key-id":t.SSEKMSKeyId,"x-amz-server-side-encryption-context":t.SSEKMSEncryptionContext,"x-amz-server-side-encryption-bucket-key-enabled":[()=>nn(t.BucketKeyEnabled),()=>t.BucketKeyEnabled.toString()],"x-amz-request-payer":t.RequestPayer,"x-amz-tagging":t.Tagging,"x-amz-object-lock-mode":t.ObjectLockMode,"x-amz-object-lock-retain-until-date":[()=>nn(t.ObjectLockRetainUntilDate),()=>(t.ObjectLockRetainUntilDate.toISOString().split(".")[0]+"Z").toString()],"x-amz-object-lock-legal-hold":t.ObjectLockLegalHoldStatus,"x-amz-expected-bucket-owner":t.ExpectedBucketOwner,"x-amz-checksum-algorithm":t.ChecksumAlgorithm,...t.Metadata!==void 0&&Object.keys(t.Metadata).reduce((E,x)=>(E[`x-amz-meta-${x.toLowerCase()}`]=t.Metadata[x],E),{})}),u=`${o?.endsWith("/")?o.slice(0,-1):o||""}/{Key+}`;u=Ln(u,t,"Bucket",()=>t.Bucket,"{Bucket}",!1),u=Ln(u,t,"Key",()=>t.Key,"{Key+}",!0);let d=Zt({uploads:[,""],"x-id":[,"CreateMultipartUpload"]}),y;return new zt({protocol:i,hostname:r,port:n,method:"POST",headers:c,path:u,query:d,body:y})};var aZ=async(t,e)=>{let{hostname:r,protocol:i="https",port:n,path:o}=await e.endpoint(),c=Zt({},nn,{"x-amz-mfa":t.MFA,"x-amz-request-payer":t.RequestPayer,"x-amz-bypass-governance-retention":[()=>nn(t.BypassGovernanceRetention),()=>t.BypassGovernanceRetention.toString()],"x-amz-expected-bucket-owner":t.ExpectedBucketOwner}),u=`${o?.endsWith("/")?o.slice(0,-1):o||""}/{Key+}`;u=Ln(u,t,"Bucket",()=>t.Bucket,"{Bucket}",!1),u=Ln(u,t,"Key",()=>t.Key,"{Key+}",!0);let d=Zt({"x-id":[,"DeleteObject"],versionId:[,t.VersionId]}),y;return new zt({protocol:i,hostname:r,port:n,method:"DELETE",headers:c,path:u,query:d,body:y})};var cZ=async(t,e)=>{let{hostname:r,protocol:i="https",port:n,path:o}=await e.endpoint(),c=Zt({},nn,{"if-match":t.IfMatch,"if-modified-since":[()=>nn(t.IfModifiedSince),()=>lu(t.IfModifiedSince).toString()],"if-none-match":t.IfNoneMatch,"if-unmodified-since":[()=>nn(t.IfUnmodifiedSince),()=>lu(t.IfUnmodifiedSince).toString()],range:t.Range,"x-amz-server-side-encryption-customer-algorithm":t.SSECustomerAlgorithm,"x-amz-server-side-encryption-customer-key":t.SSECustomerKey,"x-amz-server-side-encryption-customer-key-md5":t.SSECustomerKeyMD5,"x-amz-request-payer":t.RequestPayer,"x-amz-expected-bucket-owner":t.ExpectedBucketOwner,"x-amz-checksum-mode":t.ChecksumMode}),u=`${o?.endsWith("/")?o.slice(0,-1):o||""}/{Key+}`;u=Ln(u,t,"Bucket",()=>t.Bucket,"{Bucket}",!1),u=Ln(u,t,"Key",()=>t.Key,"{Key+}",!0);let d=Zt({"x-id":[,"GetObject"],"response-cache-control":[,t.ResponseCacheControl],"response-content-disposition":[,t.ResponseContentDisposition],"response-content-encoding":[,t.ResponseContentEncoding],"response-content-language":[,t.ResponseContentLanguage],"response-content-type":[,t.ResponseContentType],"response-expires":[()=>t.ResponseExpires!==void 0,()=>lu(t.ResponseExpires).toString()],versionId:[,t.VersionId],partNumber:[()=>t.PartNumber!==void 0,()=>t.PartNumber.toString()]}),y;return new zt({protocol:i,hostname:r,port:n,method:"GET",headers:c,path:u,query:d,body:y})};var uZ=async(t,e)=>{let{hostname:r,protocol:i="https",port:n,path:o}=await e.endpoint(),c=Zt({},nn,{"x-amz-expected-bucket-owner":t.ExpectedBucketOwner}),u=`${o?.endsWith("/")?o.slice(0,-1):o||""}/`;u=Ln(u,t,"Bucket",()=>t.Bucket,"{Bucket}",!1);let d;return new zt({protocol:i,hostname:r,port:n,method:"HEAD",headers:c,path:u,body:d})},lZ=async(t,e)=>{let{hostname:r,protocol:i="https",port:n,path:o}=await e.endpoint(),c=Zt({},nn,{"if-match":t.IfMatch,"if-modified-since":[()=>nn(t.IfModifiedSince),()=>lu(t.IfModifiedSince).toString()],"if-none-match":t.IfNoneMatch,"if-unmodified-since":[()=>nn(t.IfUnmodifiedSince),()=>lu(t.IfUnmodifiedSince).toString()],range:t.Range,"x-amz-server-side-encryption-customer-algorithm":t.SSECustomerAlgorithm,"x-amz-server-side-encryption-customer-key":t.SSECustomerKey,"x-amz-server-side-encryption-customer-key-md5":t.SSECustomerKeyMD5,"x-amz-request-payer":t.RequestPayer,"x-amz-expected-bucket-owner":t.ExpectedBucketOwner,"x-amz-checksum-mode":t.ChecksumMode}),u=`${o?.endsWith("/")?o.slice(0,-1):o||""}/{Key+}`;u=Ln(u,t,"Bucket",()=>t.Bucket,"{Bucket}",!1),u=Ln(u,t,"Key",()=>t.Key,"{Key+}",!0);let d=Zt({versionId:[,t.VersionId],partNumber:[()=>t.PartNumber!==void 0,()=>t.PartNumber.toString()]}),y;return new zt({protocol:i,hostname:r,port:n,method:"HEAD",headers:c,path:u,query:d,body:y})};var fZ=async(t,e)=>{let{hostname:r,protocol:i="https",port:n,path:o}=await e.endpoint(),c=Zt({},nn,{"x-amz-request-payer":t.RequestPayer,"x-amz-expected-bucket-owner":t.ExpectedBucketOwner,"x-amz-optional-object-attributes":[()=>nn(t.OptionalObjectAttributes),()=>(t.OptionalObjectAttributes||[]).map(E=>E).join(", ")]}),u=`${o?.endsWith("/")?o.slice(0,-1):o||""}/`;u=Ln(u,t,"Bucket",()=>t.Bucket,"{Bucket}",!1);let d=Zt({"list-type":[,"2"],delimiter:[,t.Delimiter],"encoding-type":[,t.EncodingType],"max-keys":[()=>t.MaxKeys!==void 0,()=>t.MaxKeys.toString()],prefix:[,t.Prefix],"continuation-token":[,t.ContinuationToken],"fetch-owner":[()=>t.FetchOwner!==void 0,()=>t.FetchOwner.toString()],"start-after":[,t.StartAfter]}),y;return new zt({protocol:i,hostname:r,port:n,method:"GET",headers:c,path:u,query:d,body:y})};var dZ=async(t,e)=>{let{hostname:r,protocol:i="https",port:n,path:o}=await e.endpoint(),c=Zt({},nn,{"content-type":t.ContentType||"application/octet-stream","x-amz-acl":t.ACL,"cache-control":t.CacheControl,"content-disposition":t.ContentDisposition,"content-encoding":t.ContentEncoding,"content-language":t.ContentLanguage,"content-length":[()=>nn(t.ContentLength),()=>t.ContentLength.toString()],"content-md5":t.ContentMD5,"x-amz-sdk-checksum-algorithm":t.ChecksumAlgorithm,"x-amz-checksum-crc32":t.ChecksumCRC32,"x-amz-checksum-crc32c":t.ChecksumCRC32C,"x-amz-checksum-sha1":t.ChecksumSHA1,"x-amz-checksum-sha256":t.ChecksumSHA256,expires:[()=>nn(t.Expires),()=>lu(t.Expires).toString()],"x-amz-grant-full-control":t.GrantFullControl,"x-amz-grant-read":t.GrantRead,"x-amz-grant-read-acp":t.GrantReadACP,"x-amz-grant-write-acp":t.GrantWriteACP,"x-amz-server-side-encryption":t.ServerSideEncryption,"x-amz-storage-class":t.StorageClass,"x-amz-website-redirect-location":t.WebsiteRedirectLocation,"x-amz-server-side-encryption-customer-algorithm":t.SSECustomerAlgorithm,"x-amz-server-side-encryption-customer-key":t.SSECustomerKey,"x-amz-server-side-encryption-customer-key-md5":t.SSECustomerKeyMD5,"x-amz-server-side-encryption-aws-kms-key-id":t.SSEKMSKeyId,"x-amz-server-side-encryption-context":t.SSEKMSEncryptionContext,"x-amz-server-side-encryption-bucket-key-enabled":[()=>nn(t.BucketKeyEnabled),()=>t.BucketKeyEnabled.toString()],"x-amz-request-payer":t.RequestPayer,"x-amz-tagging":t.Tagging,"x-amz-object-lock-mode":t.ObjectLockMode,"x-amz-object-lock-retain-until-date":[()=>nn(t.ObjectLockRetainUntilDate),()=>(t.ObjectLockRetainUntilDate.toISOString().split(".")[0]+"Z").toString()],"x-amz-object-lock-legal-hold":t.ObjectLockLegalHoldStatus,"x-amz-expected-bucket-owner":t.ExpectedBucketOwner,...t.Metadata!==void 0&&Object.keys(t.Metadata).reduce((x,A)=>(x[`x-amz-meta-${A.toLowerCase()}`]=t.Metadata[A],x),{})}),u=`${o?.endsWith("/")?o.slice(0,-1):o||""}/{Key+}`;u=Ln(u,t,"Bucket",()=>t.Bucket,"{Bucket}",!1),u=Ln(u,t,"Key",()=>t.Key,"{Key+}",!0);let d=Zt({"x-id":[,"PutObject"]}),y;t.Body!==void 0&&(y=t.Body);let E;return t.Body!==void 0&&(E=t.Body,y=E),new zt({protocol:i,hostname:r,port:n,method:"PUT",headers:c,path:u,query:d,body:y})};var hZ=async(t,e)=>{let{hostname:r,protocol:i="https",port:n,path:o}=await e.endpoint(),c=Zt({},nn,{"content-type":"application/xml","content-md5":t.ContentMD5,"x-amz-sdk-checksum-algorithm":t.ChecksumAlgorithm,"x-amz-expected-bucket-owner":t.ExpectedBucketOwner,"x-amz-request-payer":t.RequestPayer}),u=`${o?.endsWith("/")?o.slice(0,-1):o||""}/{Key+}`;u=Ln(u,t,"Bucket",()=>t.Bucket,"{Bucket}",!1),u=Ln(u,t,"Key",()=>t.Key,"{Key+}",!0);let d=Zt({tagging:[,""],versionId:[,t.VersionId]}),y;t.Tagging!==void 0&&(y=nZ(t.Tagging,e));let E;return t.Tagging!==void 0&&(E=nZ(t.Tagging,e),y='',E.addAttribute("xmlns","http://s3.amazonaws.com/doc/2006-03-01/"),y+=E.toString()),new zt({protocol:i,hostname:r,port:n,method:"PUT",headers:c,path:u,query:d,body:y})};var pZ=async(t,e)=>{let{hostname:r,protocol:i="https",port:n,path:o}=await e.endpoint(),c=Zt({},nn,{"content-type":"application/octet-stream","content-length":[()=>nn(t.ContentLength),()=>t.ContentLength.toString()],"content-md5":t.ContentMD5,"x-amz-sdk-checksum-algorithm":t.ChecksumAlgorithm,"x-amz-checksum-crc32":t.ChecksumCRC32,"x-amz-checksum-crc32c":t.ChecksumCRC32C,"x-amz-checksum-sha1":t.ChecksumSHA1,"x-amz-checksum-sha256":t.ChecksumSHA256,"x-amz-server-side-encryption-customer-algorithm":t.SSECustomerAlgorithm,"x-amz-server-side-encryption-customer-key":t.SSECustomerKey,"x-amz-server-side-encryption-customer-key-md5":t.SSECustomerKeyMD5,"x-amz-request-payer":t.RequestPayer,"x-amz-expected-bucket-owner":t.ExpectedBucketOwner}),u=`${o?.endsWith("/")?o.slice(0,-1):o||""}/{Key+}`;u=Ln(u,t,"Bucket",()=>t.Bucket,"{Bucket}",!1),u=Ln(u,t,"Key",()=>t.Key,"{Key+}",!0);let d=Zt({"x-id":[,"UploadPart"],partNumber:[yi(t.PartNumber,"PartNumber")!=null,()=>t.PartNumber.toString()],uploadId:[,yi(t.UploadId,"UploadId")]}),y;t.Body!==void 0&&(y=t.Body);let E;return t.Body!==void 0&&(E=t.Body,y=E),new zt({protocol:i,hostname:r,port:n,method:"PUT",headers:c,path:u,query:d,body:y})};var mZ=async(t,e)=>{if(t.statusCode!==200&&t.statusCode>=300)return YIe(t,e);let r=Zt({$metadata:Vi(t),Expiration:[,t.headers["x-amz-expiration"]],ServerSideEncryption:[,t.headers["x-amz-server-side-encryption"]],VersionId:[,t.headers["x-amz-version-id"]],SSEKMSKeyId:[,t.headers["x-amz-server-side-encryption-aws-kms-key-id"]],BucketKeyEnabled:[()=>t.headers["x-amz-server-side-encryption-bucket-key-enabled"]!==void 0,()=>Bo(t.headers["x-amz-server-side-encryption-bucket-key-enabled"])],RequestCharged:[,t.headers["x-amz-request-charged"]]}),i=yi(l1(await Bw(t.body,e)),"body");return i.Bucket!==void 0&&(r.Bucket=Nr(i.Bucket)),i.ChecksumCRC32!==void 0&&(r.ChecksumCRC32=Nr(i.ChecksumCRC32)),i.ChecksumCRC32C!==void 0&&(r.ChecksumCRC32C=Nr(i.ChecksumCRC32C)),i.ChecksumSHA1!==void 0&&(r.ChecksumSHA1=Nr(i.ChecksumSHA1)),i.ChecksumSHA256!==void 0&&(r.ChecksumSHA256=Nr(i.ChecksumSHA256)),i.ETag!==void 0&&(r.ETag=Nr(i.ETag)),i.Key!==void 0&&(r.Key=Nr(i.Key)),i.Location!==void 0&&(r.Location=Nr(i.Location)),r},YIe=async(t,e)=>{let r={...t,body:await Qs(t.body,e)},i=Js(t,r.body),n=r.body;return Ys({output:t,parsedBody:n,errorCode:i})};var gZ=async(t,e)=>{if(t.statusCode!==200&&t.statusCode>=300)return QIe(t,e);let r=Zt({$metadata:Vi(t),AbortDate:[()=>t.headers["x-amz-abort-date"]!==void 0,()=>yi($h(t.headers["x-amz-abort-date"]))],AbortRuleId:[,t.headers["x-amz-abort-rule-id"]],ServerSideEncryption:[,t.headers["x-amz-server-side-encryption"]],SSECustomerAlgorithm:[,t.headers["x-amz-server-side-encryption-customer-algorithm"]],SSECustomerKeyMD5:[,t.headers["x-amz-server-side-encryption-customer-key-md5"]],SSEKMSKeyId:[,t.headers["x-amz-server-side-encryption-aws-kms-key-id"]],SSEKMSEncryptionContext:[,t.headers["x-amz-server-side-encryption-context"]],BucketKeyEnabled:[()=>t.headers["x-amz-server-side-encryption-bucket-key-enabled"]!==void 0,()=>Bo(t.headers["x-amz-server-side-encryption-bucket-key-enabled"])],RequestCharged:[,t.headers["x-amz-request-charged"]],ChecksumAlgorithm:[,t.headers["x-amz-checksum-algorithm"]]}),i=yi(l1(await Bw(t.body,e)),"body");return i.Bucket!==void 0&&(r.Bucket=Nr(i.Bucket)),i.Key!==void 0&&(r.Key=Nr(i.Key)),i.UploadId!==void 0&&(r.UploadId=Nr(i.UploadId)),r},QIe=async(t,e)=>{let r={...t,body:await Qs(t.body,e)},i=Js(t,r.body),n=r.body;return Ys({output:t,parsedBody:n,errorCode:i})};var yZ=async(t,e)=>{if(t.statusCode!==204&&t.statusCode>=300)return JIe(t,e);let r=Zt({$metadata:Vi(t),DeleteMarker:[()=>t.headers["x-amz-delete-marker"]!==void 0,()=>Bo(t.headers["x-amz-delete-marker"])],VersionId:[,t.headers["x-amz-version-id"]],RequestCharged:[,t.headers["x-amz-request-charged"]]});return await au(t.body,e),r},JIe=async(t,e)=>{let r={...t,body:await Qs(t.body,e)},i=Js(t,r.body),n=r.body;return Ys({output:t,parsedBody:n,errorCode:i})};var vZ=async(t,e)=>{if(t.statusCode!==200&&t.statusCode>=300)return XIe(t,e);let r=Zt({$metadata:Vi(t),DeleteMarker:[()=>t.headers["x-amz-delete-marker"]!==void 0,()=>Bo(t.headers["x-amz-delete-marker"])],AcceptRanges:[,t.headers["accept-ranges"]],Expiration:[,t.headers["x-amz-expiration"]],Restore:[,t.headers["x-amz-restore"]],LastModified:[()=>t.headers["last-modified"]!==void 0,()=>yi($h(t.headers["last-modified"]))],ContentLength:[()=>t.headers["content-length"]!==void 0,()=>f1(t.headers["content-length"])],ETag:[,t.headers.etag],ChecksumCRC32:[,t.headers["x-amz-checksum-crc32"]],ChecksumCRC32C:[,t.headers["x-amz-checksum-crc32c"]],ChecksumSHA1:[,t.headers["x-amz-checksum-sha1"]],ChecksumSHA256:[,t.headers["x-amz-checksum-sha256"]],MissingMeta:[()=>t.headers["x-amz-missing-meta"]!==void 0,()=>cu(t.headers["x-amz-missing-meta"])],VersionId:[,t.headers["x-amz-version-id"]],CacheControl:[,t.headers["cache-control"]],ContentDisposition:[,t.headers["content-disposition"]],ContentEncoding:[,t.headers["content-encoding"]],ContentLanguage:[,t.headers["content-language"]],ContentRange:[,t.headers["content-range"]],ContentType:[,t.headers["content-type"]],Expires:[()=>t.headers.expires!==void 0,()=>yi($h(t.headers.expires))],WebsiteRedirectLocation:[,t.headers["x-amz-website-redirect-location"]],ServerSideEncryption:[,t.headers["x-amz-server-side-encryption"]],SSECustomerAlgorithm:[,t.headers["x-amz-server-side-encryption-customer-algorithm"]],SSECustomerKeyMD5:[,t.headers["x-amz-server-side-encryption-customer-key-md5"]],SSEKMSKeyId:[,t.headers["x-amz-server-side-encryption-aws-kms-key-id"]],BucketKeyEnabled:[()=>t.headers["x-amz-server-side-encryption-bucket-key-enabled"]!==void 0,()=>Bo(t.headers["x-amz-server-side-encryption-bucket-key-enabled"])],StorageClass:[,t.headers["x-amz-storage-class"]],RequestCharged:[,t.headers["x-amz-request-charged"]],ReplicationStatus:[,t.headers["x-amz-replication-status"]],PartsCount:[()=>t.headers["x-amz-mp-parts-count"]!==void 0,()=>cu(t.headers["x-amz-mp-parts-count"])],TagCount:[()=>t.headers["x-amz-tagging-count"]!==void 0,()=>cu(t.headers["x-amz-tagging-count"])],ObjectLockMode:[,t.headers["x-amz-object-lock-mode"]],ObjectLockRetainUntilDate:[()=>t.headers["x-amz-object-lock-retain-until-date"]!==void 0,()=>yi(cg(t.headers["x-amz-object-lock-retain-until-date"]))],ObjectLockLegalHoldStatus:[,t.headers["x-amz-object-lock-legal-hold"]],Metadata:[,Object.keys(t.headers).filter(n=>n.startsWith("x-amz-meta-")).reduce((n,o)=>(n[o.substring(11)]=t.headers[o],n),{})]}),i=t.body;return e.sdkStreamMixin(i),r.Body=i,r},XIe=async(t,e)=>{let r={...t,body:await Qs(t.body,e)},i=Js(t,r.body);switch(i){case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await o4e(r,e);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await a4e(r,e);default:let n=r.body;return Ys({output:t,parsedBody:n,errorCode:i})}};var bZ=async(t,e)=>{if(t.statusCode!==200&&t.statusCode>=300)return ZIe(t,e);let r=Zt({$metadata:Vi(t)});return await au(t.body,e),r},ZIe=async(t,e)=>{let r={...t,body:await Qs(t.body,e)},i=Js(t,r.body);switch(i){case"NotFound":case"com.amazonaws.s3#NotFound":throw await CZ(r,e);default:let n=r.body;return Ys({output:t,parsedBody:n,errorCode:i})}},_Z=async(t,e)=>{if(t.statusCode!==200&&t.statusCode>=300)return e4e(t,e);let r=Zt({$metadata:Vi(t),DeleteMarker:[()=>t.headers["x-amz-delete-marker"]!==void 0,()=>Bo(t.headers["x-amz-delete-marker"])],AcceptRanges:[,t.headers["accept-ranges"]],Expiration:[,t.headers["x-amz-expiration"]],Restore:[,t.headers["x-amz-restore"]],ArchiveStatus:[,t.headers["x-amz-archive-status"]],LastModified:[()=>t.headers["last-modified"]!==void 0,()=>yi($h(t.headers["last-modified"]))],ContentLength:[()=>t.headers["content-length"]!==void 0,()=>f1(t.headers["content-length"])],ChecksumCRC32:[,t.headers["x-amz-checksum-crc32"]],ChecksumCRC32C:[,t.headers["x-amz-checksum-crc32c"]],ChecksumSHA1:[,t.headers["x-amz-checksum-sha1"]],ChecksumSHA256:[,t.headers["x-amz-checksum-sha256"]],ETag:[,t.headers.etag],MissingMeta:[()=>t.headers["x-amz-missing-meta"]!==void 0,()=>cu(t.headers["x-amz-missing-meta"])],VersionId:[,t.headers["x-amz-version-id"]],CacheControl:[,t.headers["cache-control"]],ContentDisposition:[,t.headers["content-disposition"]],ContentEncoding:[,t.headers["content-encoding"]],ContentLanguage:[,t.headers["content-language"]],ContentType:[,t.headers["content-type"]],Expires:[()=>t.headers.expires!==void 0,()=>yi($h(t.headers.expires))],WebsiteRedirectLocation:[,t.headers["x-amz-website-redirect-location"]],ServerSideEncryption:[,t.headers["x-amz-server-side-encryption"]],SSECustomerAlgorithm:[,t.headers["x-amz-server-side-encryption-customer-algorithm"]],SSECustomerKeyMD5:[,t.headers["x-amz-server-side-encryption-customer-key-md5"]],SSEKMSKeyId:[,t.headers["x-amz-server-side-encryption-aws-kms-key-id"]],BucketKeyEnabled:[()=>t.headers["x-amz-server-side-encryption-bucket-key-enabled"]!==void 0,()=>Bo(t.headers["x-amz-server-side-encryption-bucket-key-enabled"])],StorageClass:[,t.headers["x-amz-storage-class"]],RequestCharged:[,t.headers["x-amz-request-charged"]],ReplicationStatus:[,t.headers["x-amz-replication-status"]],PartsCount:[()=>t.headers["x-amz-mp-parts-count"]!==void 0,()=>cu(t.headers["x-amz-mp-parts-count"])],ObjectLockMode:[,t.headers["x-amz-object-lock-mode"]],ObjectLockRetainUntilDate:[()=>t.headers["x-amz-object-lock-retain-until-date"]!==void 0,()=>yi(cg(t.headers["x-amz-object-lock-retain-until-date"]))],ObjectLockLegalHoldStatus:[,t.headers["x-amz-object-lock-legal-hold"]],Metadata:[,Object.keys(t.headers).filter(i=>i.startsWith("x-amz-meta-")).reduce((i,n)=>(i[n.substring(11)]=t.headers[n],i),{})]});return await au(t.body,e),r},e4e=async(t,e)=>{let r={...t,body:await Qs(t.body,e)},i=Js(t,r.body);switch(i){case"NotFound":case"com.amazonaws.s3#NotFound":throw await CZ(r,e);default:let n=r.body;return Ys({output:t,parsedBody:n,errorCode:i})}};var wZ=async(t,e)=>{if(t.statusCode!==200&&t.statusCode>=300)return t4e(t,e);let r=Zt({$metadata:Vi(t),RequestCharged:[,t.headers["x-amz-request-charged"]]}),i=yi(l1(await Bw(t.body,e)),"body");return i.CommonPrefixes===""?r.CommonPrefixes=[]:i.CommonPrefixes!==void 0&&(r.CommonPrefixes=p4e(h1(i.CommonPrefixes),e)),i.Contents===""?r.Contents=[]:i.Contents!==void 0&&(r.Contents=g4e(h1(i.Contents),e)),i.ContinuationToken!==void 0&&(r.ContinuationToken=Nr(i.ContinuationToken)),i.Delimiter!==void 0&&(r.Delimiter=Nr(i.Delimiter)),i.EncodingType!==void 0&&(r.EncodingType=Nr(i.EncodingType)),i.IsTruncated!==void 0&&(r.IsTruncated=Bo(i.IsTruncated)),i.KeyCount!==void 0&&(r.KeyCount=cu(i.KeyCount)),i.MaxKeys!==void 0&&(r.MaxKeys=cu(i.MaxKeys)),i.Name!==void 0&&(r.Name=Nr(i.Name)),i.NextContinuationToken!==void 0&&(r.NextContinuationToken=Nr(i.NextContinuationToken)),i.Prefix!==void 0&&(r.Prefix=Nr(i.Prefix)),i.StartAfter!==void 0&&(r.StartAfter=Nr(i.StartAfter)),r},t4e=async(t,e)=>{let r={...t,body:await Qs(t.body,e)},i=Js(t,r.body);switch(i){case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await s4e(r,e);default:let n=r.body;return Ys({output:t,parsedBody:n,errorCode:i})}};var xZ=async(t,e)=>{if(t.statusCode!==200&&t.statusCode>=300)return r4e(t,e);let r=Zt({$metadata:Vi(t),Expiration:[,t.headers["x-amz-expiration"]],ETag:[,t.headers.etag],ChecksumCRC32:[,t.headers["x-amz-checksum-crc32"]],ChecksumCRC32C:[,t.headers["x-amz-checksum-crc32c"]],ChecksumSHA1:[,t.headers["x-amz-checksum-sha1"]],ChecksumSHA256:[,t.headers["x-amz-checksum-sha256"]],ServerSideEncryption:[,t.headers["x-amz-server-side-encryption"]],VersionId:[,t.headers["x-amz-version-id"]],SSECustomerAlgorithm:[,t.headers["x-amz-server-side-encryption-customer-algorithm"]],SSECustomerKeyMD5:[,t.headers["x-amz-server-side-encryption-customer-key-md5"]],SSEKMSKeyId:[,t.headers["x-amz-server-side-encryption-aws-kms-key-id"]],SSEKMSEncryptionContext:[,t.headers["x-amz-server-side-encryption-context"]],BucketKeyEnabled:[()=>t.headers["x-amz-server-side-encryption-bucket-key-enabled"]!==void 0,()=>Bo(t.headers["x-amz-server-side-encryption-bucket-key-enabled"])],RequestCharged:[,t.headers["x-amz-request-charged"]]});return await au(t.body,e),r},r4e=async(t,e)=>{let r={...t,body:await Qs(t.body,e)},i=Js(t,r.body),n=r.body;return Ys({output:t,parsedBody:n,errorCode:i})};var EZ=async(t,e)=>{if(t.statusCode!==200&&t.statusCode>=300)return n4e(t,e);let r=Zt({$metadata:Vi(t),VersionId:[,t.headers["x-amz-version-id"]]});return await au(t.body,e),r},n4e=async(t,e)=>{let r={...t,body:await Qs(t.body,e)},i=Js(t,r.body),n=r.body;return Ys({output:t,parsedBody:n,errorCode:i})};var SZ=async(t,e)=>{if(t.statusCode!==200&&t.statusCode>=300)return i4e(t,e);let r=Zt({$metadata:Vi(t),ServerSideEncryption:[,t.headers["x-amz-server-side-encryption"]],ETag:[,t.headers.etag],ChecksumCRC32:[,t.headers["x-amz-checksum-crc32"]],ChecksumCRC32C:[,t.headers["x-amz-checksum-crc32c"]],ChecksumSHA1:[,t.headers["x-amz-checksum-sha1"]],ChecksumSHA256:[,t.headers["x-amz-checksum-sha256"]],SSECustomerAlgorithm:[,t.headers["x-amz-server-side-encryption-customer-algorithm"]],SSECustomerKeyMD5:[,t.headers["x-amz-server-side-encryption-customer-key-md5"]],SSEKMSKeyId:[,t.headers["x-amz-server-side-encryption-aws-kms-key-id"]],BucketKeyEnabled:[()=>t.headers["x-amz-server-side-encryption-bucket-key-enabled"]!==void 0,()=>Bo(t.headers["x-amz-server-side-encryption-bucket-key-enabled"])],RequestCharged:[,t.headers["x-amz-request-charged"]]});return await au(t.body,e),r},i4e=async(t,e)=>{let r={...t,body:await Qs(t.body,e)},i=Js(t,r.body),n=r.body;return Ys({output:t,parsedBody:n,errorCode:i})};var Ys=zG(ps);var o4e=async(t,e)=>{let r=Zt({}),i=t.body;i.AccessTier!==void 0&&(r.AccessTier=Nr(i.AccessTier)),i.StorageClass!==void 0&&(r.StorageClass=Nr(i.StorageClass));let n=new lp({$metadata:Vi(t),...r});return Ef(n,t.body)},s4e=async(t,e)=>{let r=Zt({}),i=t.body,n=new hp({$metadata:Vi(t),...r});return Ef(n,t.body)},a4e=async(t,e)=>{let r=Zt({}),i=t.body,n=new fp({$metadata:Vi(t),...r});return Ef(n,t.body)};var CZ=async(t,e)=>{let r=Zt({}),i=t.body,n=new dp({$metadata:Vi(t),...r});return Ef(n,t.body)};var rZ=(t,e)=>{let r=new Qn("CompletedMultipartUpload");return t.Parts!=null&&u4e(t.Parts,e).map(n=>{n=n.withName("Part"),r.addChildNode(n)}),r},c4e=(t,e)=>{let r=new Qn("CompletedPart");if(t.ETag!=null){let i=Qn.of("ETag",t.ETag).withName("ETag");r.addChildNode(i)}if(t.ChecksumCRC32!=null){let i=Qn.of("ChecksumCRC32",t.ChecksumCRC32).withName("ChecksumCRC32");r.addChildNode(i)}if(t.ChecksumCRC32C!=null){let i=Qn.of("ChecksumCRC32C",t.ChecksumCRC32C).withName("ChecksumCRC32C");r.addChildNode(i)}if(t.ChecksumSHA1!=null){let i=Qn.of("ChecksumSHA1",t.ChecksumSHA1).withName("ChecksumSHA1");r.addChildNode(i)}if(t.ChecksumSHA256!=null){let i=Qn.of("ChecksumSHA256",t.ChecksumSHA256).withName("ChecksumSHA256");r.addChildNode(i)}if(t.PartNumber!=null){let i=Qn.of("PartNumber",String(t.PartNumber)).withName("PartNumber");r.addChildNode(i)}return r},u4e=(t,e)=>t.filter(r=>r!=null).map(r=>c4e(r,e).withName("member"));var l4e=(t,e)=>{let r=new Qn("Tag");if(t.Key!=null){let i=Qn.of("ObjectKey",t.Key).withName("Key");r.addChildNode(i)}if(t.Value!=null){let i=Qn.of("Value",t.Value).withName("Value");r.addChildNode(i)}return r},nZ=(t,e)=>{let r=new Qn("Tagging");if(t.TagSet!=null){let i=f4e(t.TagSet,e),n=new Qn("TagSet");i.map(o=>{n.addChildNode(o)}),r.addChildNode(n)}return r},f4e=(t,e)=>t.filter(r=>r!=null).map(r=>l4e(r,e).withName("Tag"));var d4e=(t,e)=>(t||[]).filter(r=>r!=null).map(r=>Nr(r)),h4e=(t,e)=>{let r={};return t.Prefix!==void 0&&(r.Prefix=Nr(t.Prefix)),r},p4e=(t,e)=>(t||[]).filter(r=>r!=null).map(r=>h4e(r,e));var m4e=(t,e)=>{let r={};return t.Key!==void 0&&(r.Key=Nr(t.Key)),t.LastModified!==void 0&&(r.LastModified=yi(cg(t.LastModified))),t.ETag!==void 0&&(r.ETag=Nr(t.ETag)),t.ChecksumAlgorithm===""?r.ChecksumAlgorithm=[]:t.ChecksumAlgorithm!==void 0&&(r.ChecksumAlgorithm=d4e(h1(t.ChecksumAlgorithm),e)),t.Size!==void 0&&(r.Size=f1(t.Size)),t.StorageClass!==void 0&&(r.StorageClass=Nr(t.StorageClass)),t.Owner!==void 0&&(r.Owner=y4e(t.Owner,e)),t.RestoreStatus!==void 0&&(r.RestoreStatus=v4e(t.RestoreStatus,e)),r},g4e=(t,e)=>(t||[]).filter(r=>r!=null).map(r=>m4e(r,e));var y4e=(t,e)=>{let r={};return t.DisplayName!==void 0&&(r.DisplayName=Nr(t.DisplayName)),t.ID!==void 0&&(r.ID=Nr(t.ID)),r};var v4e=(t,e)=>{let r={};return t.IsRestoreInProgress!==void 0&&(r.IsRestoreInProgress=Bo(t.IsRestoreInProgress)),t.RestoreExpiryDate!==void 0&&(r.RestoreExpiryDate=yi(cg(t.RestoreExpiryDate))),r};var Vi=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}),b4e=(t,e)=>au(t,e).then(r=>e.utf8Encoder(r)),nn=t=>t!=null&&t!==""&&(!Object.getOwnPropertyNames(t).includes("length")||t.length!=0)&&(!Object.getOwnPropertyNames(t).includes("size")||t.size!=0),Bw=(t,e)=>b4e(t,e).then(r=>{if(r.length){let i=new iZ.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(d,y)=>y.trim()===""&&y.includes(` -`)?"":void 0});i.addEntity("#xD","\r"),i.addEntity("#10",` -`);let n=i.parse(r),o="#text",c=Object.keys(n)[0],u=n[c];return u[o]&&(u[c]=u[o],delete u[o]),lT(u)}return{}}),Qs=async(t,e)=>{let r=await Bw(t,e);return r.Error&&(r.Error.message=r.Error.message??r.Error.Message),r},Js=(t,e)=>{if(e?.Code!==void 0)return e.Code;if(t.statusCode==404)return"NotFound"};m();m();function _4e(t){return e=>async r=>{let i={...r.input},n=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let o of n){let c=i[o.target];if(c){let u=ArrayBuffer.isView(c)?new Uint8Array(c.buffer,c.byteOffset,c.byteLength):typeof c=="string"?t.utf8Decoder(c):new Uint8Array(c),d=t.base64Encoder(u),y=new t.md5;y.update(u),i={...i,[o.target]:d,[o.hash]:t.base64Encoder(await y.digest())}}}return e({...r,input:i})}}var w4e={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},jo=t=>({applyToStack:e=>{e.add(_4e(t),w4e)}});var pp=class extends hn{static getEndpointParameterInstructions(){return{Bucket:{type:"contextParams",name:"Bucket"},ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,r,i){this.middlewareStack.use(Tn(r,this.serialize,this.deserialize)),this.middlewareStack.use(Mn(r,pp.getEndpointParameterInstructions())),this.middlewareStack.use(rK(r)),this.middlewareStack.use(jo(r));let n=e.concat(this.middlewareStack),{logger:o}=r,d={logger:o,clientName:"S3Client",commandName:"CompleteMultipartUploadCommand",inputFilterSensitiveLog:$X,outputFilterSensitiveLog:HX,[yn]:{service:"AmazonS3",operation:"CompleteMultipartUpload"}},{requestHandler:y}=r;return n.resolve(E=>y.handle(E.request,i||{}),d)}serialize(e,r){return oZ(e,r)}deserialize(e,r){return mZ(e,r)}};m();var mp=class extends hn{static getEndpointParameterInstructions(){return{Bucket:{type:"contextParams",name:"Bucket"},ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,r,i){this.middlewareStack.use(Tn(r,this.serialize,this.deserialize)),this.middlewareStack.use(Mn(r,mp.getEndpointParameterInstructions())),this.middlewareStack.use(jo(r));let n=e.concat(this.middlewareStack),{logger:o}=r,d={logger:o,clientName:"S3Client",commandName:"CreateMultipartUploadCommand",inputFilterSensitiveLog:KX,outputFilterSensitiveLog:GX,[yn]:{service:"AmazonS3",operation:"CreateMultipartUpload"}},{requestHandler:y}=r;return n.resolve(E=>y.handle(E.request,i||{}),d)}serialize(e,r){return sZ(e,r)}deserialize(e,r){return gZ(e,r)}};m();var Of=class extends hn{static getEndpointParameterInstructions(){return{Bucket:{type:"contextParams",name:"Bucket"},ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,r,i){this.middlewareStack.use(Tn(r,this.serialize,this.deserialize)),this.middlewareStack.use(Mn(r,Of.getEndpointParameterInstructions()));let n=e.concat(this.middlewareStack),{logger:o}=r,d={logger:o,clientName:"S3Client",commandName:"DeleteObjectCommand",inputFilterSensitiveLog:E=>E,outputFilterSensitiveLog:E=>E,[yn]:{service:"AmazonS3",operation:"DeleteObject"}},{requestHandler:y}=r;return n.resolve(E=>y.handle(E.request,i||{}),d)}serialize(e,r){return aZ(e,r)}deserialize(e,r){return yZ(e,r)}};m();m();var _n;(function(t){t.MD5="MD5",t.CRC32="CRC32",t.CRC32C="CRC32C",t.SHA1="SHA1",t.SHA256="SHA256"})(_n||(_n={}));var AZ;(function(t){t.HEADER="header",t.TRAILER="trailer"})(AZ||(AZ={}));m();m();m();var Eg=[_n.CRC32,_n.CRC32C,_n.SHA1,_n.SHA256],TZ=[_n.CRC32,_n.CRC32C,_n.SHA1,_n.SHA256];var MZ=(t,{requestChecksumRequired:e,requestAlgorithmMember:r})=>{if(!r||!t[r])return e?_n.MD5:void 0;let i=t[r];if(!Eg.includes(i))throw new Error(`The checksum algorithm "${i}" is not supported by the client. Select one of ${Eg}.`);return i};m();var Fw=t=>t===_n.MD5?"content-md5":`x-amz-checksum-${t.toLowerCase()}`;m();var RZ=(t,e)=>{let r=t.toLowerCase();for(let i of Object.keys(e))if(r===i.toLowerCase())return!0;return!1};m();var gp=t=>t!==void 0&&typeof t!="string"&&!ArrayBuffer.isView(t)&&!k1(t);m();var eee=Et(lg()),tee=Et(uR());var jw=(t,e)=>({[_n.MD5]:e.md5,[_n.CRC32]:eee.AwsCrc32,[_n.CRC32C]:tee.AwsCrc32c,[_n.SHA1]:e.sha1,[_n.SHA256]:e.sha256})[t];m();var zw=(t,e)=>{let r=new t;return r.update($s(e||"")),r.digest()};var ree=(t,e)=>r=>async i=>{if(!zt.isInstance(i.request))return r(i);let{request:n}=i,{body:o,headers:c}=n,{base64Encoder:u,streamHasher:d}=t,{input:y,requestChecksumRequired:E,requestAlgorithmMember:x}=e,A=MZ(y,{requestChecksumRequired:E,requestAlgorithmMember:x}),R=o,M=c;if(A){let D=Fw(A),O=jw(A,t);if(gp(o)){let{getAwsChunkedEncodingStream:N,bodyLengthChecker:L}=t;R=N(o,{base64Encoder:u,bodyLengthChecker:L,checksumLocationName:D,checksumAlgorithmFn:O,streamHasher:d}),M={...c,"content-encoding":c["content-encoding"]?`${c["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":c["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":D},delete M["content-length"]}else if(!RZ(D,c)){let N=await zw(O,o);M={...c,[D]:u(N)}}}return await r({...i,request:{...n,headers:M,body:R}})};m();m();m();function lR(t){return new Blob([t]).stream()}m();m();var nee=async(t,{streamHasher:e,checksumAlgorithmFn:r,base64Encoder:i})=>{let n=gp(t)?e(r,t):zw(r,t);return i(await n)};m();var iee=(t=[])=>{let e=[];for(let r of TZ)!t.includes(r)||!Eg.includes(r)||e.push(r);return e};var oee=async(t,{config:e,responseAlgorithms:r})=>{let i=iee(r),{body:n,headers:o}=t;for(let c of i){let u=Fw(c),d=o[u];if(d){let y=jw(c,e),{streamHasher:E,base64Encoder:x}=e,A=await nee(n,{streamHasher:E,checksumAlgorithmFn:y,base64Encoder:x});if(A===d)break;throw new Error(`Checksum mismatch: expected "${A}" but received "${d}" in response header "${u}".`)}}};var see={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},aee=(t,e)=>r=>async i=>{if(!zt.isInstance(i.request))return r(i);let n=i.input,o=await r(i),c=o.response,u,{requestValidationModeMember:d,responseAlgorithms:y}=e;if(d&&n[d]==="ENABLED"){let E=gp(c.body);E&&(u=await t.streamCollector(c.body),c.body=lR(u)),await oee(o.response,{config:t,responseAlgorithms:y}),E&&u&&(c.body=lR(u))}return o};var R4e={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},xu=(t,e)=>({applyToStack:r=>{r.add(ree(t,e),R4e),r.addRelativeTo(aee(t,e),see)}});m();var vp=class extends hn{static getEndpointParameterInstructions(){return{Bucket:{type:"contextParams",name:"Bucket"},ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,r,i){this.middlewareStack.use(Tn(r,this.serialize,this.deserialize)),this.middlewareStack.use(Mn(r,vp.getEndpointParameterInstructions())),this.middlewareStack.use(jo(r)),this.middlewareStack.use(xu(r,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}));let n=e.concat(this.middlewareStack),{logger:o}=r,d={logger:o,clientName:"S3Client",commandName:"GetObjectCommand",inputFilterSensitiveLog:WX,outputFilterSensitiveLog:VX,[yn]:{service:"AmazonS3",operation:"GetObject"}},{requestHandler:y}=r;return n.resolve(E=>y.handle(E.request,i||{}),d)}serialize(e,r){return cZ(e,r)}deserialize(e,r){return vZ(e,r)}};m();var bp=class extends hn{static getEndpointParameterInstructions(){return{Bucket:{type:"contextParams",name:"Bucket"},ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,r,i){this.middlewareStack.use(Tn(r,this.serialize,this.deserialize)),this.middlewareStack.use(Mn(r,bp.getEndpointParameterInstructions()));let n=e.concat(this.middlewareStack),{logger:o}=r,d={logger:o,clientName:"S3Client",commandName:"HeadBucketCommand",inputFilterSensitiveLog:E=>E,outputFilterSensitiveLog:E=>E,[yn]:{service:"AmazonS3",operation:"HeadBucket"}},{requestHandler:y}=r;return n.resolve(E=>y.handle(E.request,i||{}),d)}serialize(e,r){return uZ(e,r)}deserialize(e,r){return bZ(e,r)}};m();var _p=class extends hn{static getEndpointParameterInstructions(){return{Bucket:{type:"contextParams",name:"Bucket"},ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,r,i){this.middlewareStack.use(Tn(r,this.serialize,this.deserialize)),this.middlewareStack.use(Mn(r,_p.getEndpointParameterInstructions())),this.middlewareStack.use(jo(r));let n=e.concat(this.middlewareStack),{logger:o}=r,d={logger:o,clientName:"S3Client",commandName:"HeadObjectCommand",inputFilterSensitiveLog:QX,outputFilterSensitiveLog:YX,[yn]:{service:"AmazonS3",operation:"HeadObject"}},{requestHandler:y}=r;return n.resolve(E=>y.handle(E.request,i||{}),d)}serialize(e,r){return lZ(e,r)}deserialize(e,r){return _Z(e,r)}};m();var wp=class extends hn{static getEndpointParameterInstructions(){return{Bucket:{type:"contextParams",name:"Bucket"},ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,r,i){this.middlewareStack.use(Tn(r,this.serialize,this.deserialize)),this.middlewareStack.use(Mn(r,wp.getEndpointParameterInstructions()));let n=e.concat(this.middlewareStack),{logger:o}=r,d={logger:o,clientName:"S3Client",commandName:"ListObjectsV2Command",inputFilterSensitiveLog:E=>E,outputFilterSensitiveLog:E=>E,[yn]:{service:"AmazonS3",operation:"ListObjectsV2"}},{requestHandler:y}=r;return n.resolve(E=>y.handle(E.request,i||{}),d)}serialize(e,r){return fZ(e,r)}deserialize(e,r){return wZ(e,r)}};m();var Qa=class extends hn{static getEndpointParameterInstructions(){return{Bucket:{type:"contextParams",name:"Bucket"},ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,r,i){this.middlewareStack.use(Tn(r,this.serialize,this.deserialize)),this.middlewareStack.use(Mn(r,Qa.getEndpointParameterInstructions())),this.middlewareStack.use(QG(r)),this.middlewareStack.use(jo(r)),this.middlewareStack.use(xu(r,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}));let n=e.concat(this.middlewareStack),{logger:o}=r,d={logger:o,clientName:"S3Client",commandName:"PutObjectCommand",inputFilterSensitiveLog:XX,outputFilterSensitiveLog:JX,[yn]:{service:"AmazonS3",operation:"PutObject"}},{requestHandler:y}=r;return n.resolve(E=>y.handle(E.request,i||{}),d)}serialize(e,r){return dZ(e,r)}deserialize(e,r){return xZ(e,r)}};m();var xp=class extends hn{static getEndpointParameterInstructions(){return{Bucket:{type:"contextParams",name:"Bucket"},ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,r,i){this.middlewareStack.use(Tn(r,this.serialize,this.deserialize)),this.middlewareStack.use(Mn(r,xp.getEndpointParameterInstructions())),this.middlewareStack.use(xu(r,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!0}));let n=e.concat(this.middlewareStack),{logger:o}=r,d={logger:o,clientName:"S3Client",commandName:"PutObjectTaggingCommand",inputFilterSensitiveLog:E=>E,outputFilterSensitiveLog:E=>E,[yn]:{service:"AmazonS3",operation:"PutObjectTagging"}},{requestHandler:y}=r;return n.resolve(E=>y.handle(E.request,i||{}),d)}serialize(e,r){return hZ(e,r)}deserialize(e,r){return EZ(e,r)}};m();var Ep=class extends hn{static getEndpointParameterInstructions(){return{Bucket:{type:"contextParams",name:"Bucket"},ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,r,i){this.middlewareStack.use(Tn(r,this.serialize,this.deserialize)),this.middlewareStack.use(Mn(r,Ep.getEndpointParameterInstructions())),this.middlewareStack.use(jo(r)),this.middlewareStack.use(xu(r,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}));let n=e.concat(this.middlewareStack),{logger:o}=r,d={logger:o,clientName:"S3Client",commandName:"UploadPartCommand",inputFilterSensitiveLog:tZ,outputFilterSensitiveLog:eZ,[yn]:{service:"AmazonS3",operation:"UploadPart"}},{requestHandler:y}=r;return n.resolve(E=>y.handle(E.request,i||{}),d)}serialize(e,r){return pZ(e,r)}deserialize(e,r){return SZ(e,r)}};m();m();m();m();m();var Hw=class{constructor(){this.onabort=null,this._aborted=!1,Object.defineProperty(this,"_aborted",{value:!1,writable:!0})}get aborted(){return this._aborted}abort(){this._aborted=!0,this.onabort&&(this.onabort(this),this.onabort=null)}};var $w=class{constructor(){this.signal=new Hw}abort(){this.signal.abort()}};var Yw=Et(aa());m();m();m();var cee={lstatSync:()=>{}};var uee={...cee,runtime:"browser"};var Gw=t=>{if(t==null)return 0;if(typeof t=="string"&&(t=T.from(t)),typeof t.byteLength=="number")return t.byteLength;if(typeof t.length=="number")return t.length;if(typeof t.size=="number")return t.size;if(typeof t.path=="string")try{return uee.lstatSync(t.path).size}catch{return}};m();var _R=Et(Sg()),Tee=Et(il());m();async function*yR(t,e){let r=1,i=0,n=e;for(;n=e;){let c=n.chunks.length>1?vR.Buffer.concat(n.chunks):n.chunks[0];yield{partNumber:i,data:c.slice(0,e)},n.chunks=[c.slice(e)],n.length=n.chunks[0].length,i+=1}yield{partNumber:i,data:vR.Buffer.concat(n.chunks),lastPart:!0}}m();var See=Et(Sg());async function*Cee(t){for await(let e of t)yield See.Buffer.from(e)}m();var Aee=Et(Sg());async function*bR(t){let e=t.getReader();try{for(;;){let{done:r,value:i}=await e.read();if(r)return;yield Aee.Buffer.from(i)}}catch(r){throw r}finally{e.releaseLock()}}var Mee=(t,e)=>{if(t instanceof _R.Buffer)return yR(t,e);if(t instanceof Tee.Readable)return Ww(t,e,Cee);if(t instanceof String||typeof t=="string"||t instanceof Uint8Array)return yR(_R.Buffer.from(t),e);if(typeof t.stream=="function")return Ww(t.stream(),e,bR);if(t instanceof ReadableStream)return Ww(t,e,bR);throw new Error("Body Data is unsupported format, expected data to be one of: string | Uint8Array | Buffer | Readable | ReadableStream | Blob;.")};var wR=1024*1024*5,Qw=class extends Yw.EventEmitter{constructor(e){super(),this.MAX_PARTS=1e4,this.queueSize=4,this.partSize=wR,this.leavePartsOnError=!1,this.tags=[],this.concurrentUploaders=[],this.uploadedParts=[],this.isMultiPart=!0,this.queueSize=e.queueSize||this.queueSize,this.partSize=e.partSize||this.partSize,this.leavePartsOnError=e.leavePartsOnError||this.leavePartsOnError,this.tags=e.tags||this.tags,this.client=e.client,this.params=e.params,this.__validateInput(),this.totalBytes=Gw(this.params.Body),this.bytesUploadedSoFar=0,this.abortController=e.abortController??new $w}async abort(){this.abortController.abort()}async done(){return await Promise.race([this.__doMultipartUpload(),this.__abortTimeout(this.abortController.signal)])}on(e,r){return this.uploadEvent=e,super.on(e,r)}async __uploadUsingPut(e){this.isMultiPart=!1;let r={...this.params,Body:e.data},i=this.client.config,n=i.requestHandler,o=n instanceof Yw.EventEmitter?n:null,c=M=>{this.bytesUploadedSoFar=M.loaded,this.totalBytes=M.total,this.__notifyProgress({loaded:this.bytesUploadedSoFar,total:this.totalBytes,part:e.partNumber,Key:this.params.Key,Bucket:this.params.Bucket})};o!==null&&o.on("xhr.upload.progress",c);let u=await Promise.all([this.client.send(new Qa(r)),i?.endpoint?.()]),d=u[0],y=u[1];if(y||(y=ep(await K1(r,Qa,{...i}))),!y)throw new Error('Could not resolve endpoint from S3 "client.config.endpoint()" nor EndpointsV2.');o!==null&&o.off("xhr.upload.progress",c);let E=this.params.Key.split("/").map(M=>Kh(M)).join("/"),x=Kh(this.params.Bucket),A=(()=>{let M=y.hostname.startsWith(`${x}.`);return this.client.config.forcePathStyle?`${y.protocol}//${y.hostname}/${x}/${E}`:M?`${y.protocol}//${y.hostname}/${E}`:`${y.protocol}//${x}.${y.hostname}/${E}`})();this.singleUploadResult={...d,Bucket:this.params.Bucket,Key:this.params.Key,Location:A};let R=Gw(e.data);this.__notifyProgress({loaded:R,total:R,part:1,Key:this.params.Key,Bucket:this.params.Bucket})}async __createMultipartUpload(){if(!this.createMultiPartPromise){let e={...this.params,Body:void 0};this.createMultiPartPromise=this.client.send(new mp(e))}return this.createMultiPartPromise}async __doConcurrentUpload(e){for await(let r of e){if(this.uploadedParts.length>this.MAX_PARTS)throw new Error(`Exceeded ${this.MAX_PARTS} as part of the upload to ${this.params.Key} and ${this.params.Bucket}.`);try{if(this.abortController.signal.aborted)return;if(r.partNumber===1&&r.lastPart)return await this.__uploadUsingPut(r);if(!this.uploadId){let{UploadId:y}=await this.__createMultipartUpload();if(this.uploadId=y,this.abortController.signal.aborted)return}let i=Gw(r.data)||0,n=this.client.config.requestHandler,o=n instanceof Yw.EventEmitter?n:null,c=0,u=(y,E)=>{(Number(E.query.partNumber)||-1)===r.partNumber&&(y.total&&i&&(this.bytesUploadedSoFar+=y.loaded-c,c=y.loaded),this.__notifyProgress({loaded:this.bytesUploadedSoFar,total:this.totalBytes,part:r.partNumber,Key:this.params.Key,Bucket:this.params.Bucket}))};o!==null&&o.on("xhr.upload.progress",u);let d=await this.client.send(new Ep({...this.params,UploadId:this.uploadId,Body:r.data,PartNumber:r.partNumber}));if(o!==null&&o.off("xhr.upload.progress",u),this.abortController.signal.aborted)return;if(!d.ETag)throw new Error(`Part ${r.partNumber} is missing ETag in UploadPart response. Missing Bucket CORS configuration for ETag header?`);this.uploadedParts.push({PartNumber:r.partNumber,ETag:d.ETag,...d.ChecksumCRC32&&{ChecksumCRC32:d.ChecksumCRC32},...d.ChecksumCRC32C&&{ChecksumCRC32C:d.ChecksumCRC32C},...d.ChecksumSHA1&&{ChecksumSHA1:d.ChecksumSHA1},...d.ChecksumSHA256&&{ChecksumSHA256:d.ChecksumSHA256}}),o===null&&(this.bytesUploadedSoFar+=i),this.__notifyProgress({loaded:this.bytesUploadedSoFar,total:this.totalBytes,part:r.partNumber,Key:this.params.Key,Bucket:this.params.Bucket})}catch(i){if(!this.uploadId||this.leavePartsOnError)throw i}}}async __doMultipartUpload(){let e=Mee(this.params.Body,this.partSize);for(let i=0;in.PartNumber-o.PartNumber);let i={...this.params,Body:void 0,UploadId:this.uploadId,MultipartUpload:{Parts:this.uploadedParts}};r=await this.client.send(new pp(i))}else r=this.singleUploadResult;return this.tags.length&&await this.client.send(new xp({...this.params,Tagging:{TagSet:this.tags}})),r}__notifyProgress(e){this.uploadEvent&&this.emit(this.uploadEvent,e)}async __abortTimeout(e){return new Promise((r,i)=>{e.onabort=()=>{let n=new Error("Upload aborted.");n.name="AbortError",i(n)}})}__validateInput(){if(!this.params)throw new Error("InputError: Upload requires params to be passed to upload.");if(!this.client)throw new Error("InputError: Upload requires a AWS client to do uploads with.");if(this.partSize0&&o[o.length-1])&&(y[0]===6||y[0]===2)){r=0;continue}if(y[0]===3&&(!o||y[1]>o[0]&&y[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ree(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,o=[],c;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(u){c={error:u}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(c)throw c.error}}return o}function Dee(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,o;i"u"?"":AR.default.homedir().replace(/\\/g,"/");function TR(t,{pretty:e=!1,basePath:r}={}){let i=r&&new RegExp(`(at | \\()${CR(r.replace(/\\/g,"/"))}`,"g");if(typeof t=="string")return t.replace(/\\/g,"/").split(` -`).filter(n=>{let o=n.match(zee);if(o===null||!o[1])return!0;let c=o[1];return c.includes(".app/Contents/Resources/electron.asar")||c.includes(".app/Contents/Resources/default_app.asar")||c.includes("node_modules/electron/dist/resources/electron.asar")||c.includes("node_modules/electron/dist/resources/default_app.asar")?!1:!cOe.test(c)}).filter(n=>n.trim()!=="").map(n=>(i&&(n=n.replace(i,"$1")),e&&(n=n.replace(zee,(o,c)=>o.replace(c,c.replace(uOe,"~")))),n)).join(` -`)}var lOe=t=>t.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),Za=class extends Error{#e;name="AggregateError";constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);e=e.map(i=>i instanceof Error?i:i!==null&&typeof i=="object"?Object.assign(new Error(i.message),i):new Error(i));let r=e.map(i=>typeof i.stack=="string"&&i.stack.length>0?lOe(TR(i.stack)):String(i)).join(` -`);r=` -`+SR(r,4),super(r),this.#e=e}get errors(){return this.#e.slice()}};var MR=class extends kee{requestTimeoutInMs;constructor(e){super(e),this.requestTimeoutInMs=e===void 0?void 0:e.requestTimeout}async handle(e,{abortSignal:r}={}){if(r?.aborted){let R=new Error("Request aborted");return R.name="AbortError",Promise.reject(R)}let i=e.path;if(e.query){let R=Xw(e.query);R&&(i+=`?${R}`)}let{port:n,method:o}=e,c=`${e.protocol}//${e.hostname}${n?`:${n}`:""}${i}`,u=o==="GET"||o==="HEAD"?void 0:e.body,d={};for(let R of Object.keys(e.headers)){let M=R.toLowerCase();M==="host"||M==="content-length"||(d[M]=e.headers[R])}let y;d["content-type"]!==void 0&&(y=d["content-type"]);let E=u;ArrayBuffer.isView(u)&&(E=Bi(u));let A=[(0,Gee.requestUrl)({body:E,headers:d,method:o,url:c,contentType:y}).then(R=>{let M=R.headers,I={};for(let O of Object.keys(M))I[O.toLowerCase()]=M[O];let D=new ReadableStream({start(O){O.enqueue(new Uint8Array(R.arrayBuffer)),O.close()}});return{response:new Cg({headers:I,statusCode:R.status,body:D})}}),Zw(this.requestTimeoutInMs)];return r&&A.push(new Promise((R,M)=>{r.onabort=()=>{let I=new Error("Request aborted");I.name="AbortError",M(I)}})),Promise.race(A)}updateHttpClientConfig(e,r){}httpHandlerConfigs(){return{}}},Vee={s3Endpoint:"",s3Region:"",s3AccessKeyID:"",s3SecretAccessKey:"",s3BucketName:"",bypassCorsLocally:!0,partsConcurrency:20,forcePathStyle:!1,disableS3MetadataSync:!1},fOe=t=>({key:t.Key,lastModified:t.LastModified.valueOf(),size:t.Size,remoteType:"s3",etag:t.ETag}),dOe=(t,e)=>{let r=e.LastModified.valueOf();return e.Metadata.modification_time!=null&&(r=parseInt(e.Metadata.modification_time)),{key:t,lastModified:r,size:e.ContentLength,remoteType:"s3",etag:e.ETag}},Mp=t=>{let e=t.s3Endpoint;e.startsWith("http://")||e.startsWith("https://")||(e=`https://${e}`);let r,i={region:t.s3Region,endpoint:e,forcePathStyle:t.forcePathStyle,credentials:{accessKeyId:t.s3AccessKeyID,secretAccessKey:t.s3SecretAccessKey}};return uo&&t.bypassCorsLocally&&(i.requestHandler=new MR),r=new Pw(i),r.middlewareStack.add((n,o)=>c=>(c.request.headers["cache-control"]="no-cache",n(c)),{step:"build"}),r},Hee=async(t,e,r)=>{let i=await t.send(new _p({Bucket:e.s3BucketName,Key:r}));return dOe(r,i)},Wee=async(t,e,r,i,n=!1,o="",c="",u=!1,d="")=>{let y=r;o!==""&&(y=c);let E=r.endsWith("/");if(E&&n)throw Error("upload function doesn't implement recursive function yet!");if(E&&!n){if(u)throw Error("you specify uploadRaw, but you also provide a folder key!");let x=ia;return await t.send(new Qa({Bucket:e.s3BucketName,Key:y,Body:"",ContentType:x})),await Hee(t,e,y)}else{let x=ia;o===""&&(x=tx.contentType(tx.lookup(r)||ia)||ia);let A;u?typeof d=="string"?A=new TextEncoder().encode(d).buffer:A=d:A=await i.adapter.readBinary(r);let R=A;o!==""&&(R=await Bs(A,o));let M=5242880,I=new Uint8Array(R),D=await ws(i,r),O=D?.mtime.toString(),N={Bucket:e.s3BucketName,Key:y,Body:I,ContentType:x};return e.disableS3MetadataSync||(N.Metadata={modification_time:O}),await new Qw({client:t,queueSize:e.partsConcurrency,partSize:M,leavePartsOnError:!1,params:N}).done(),await Hee(t,e,y)}},RR=async(t,e,r)=>{let i={Bucket:e.s3BucketName};r!==void 0&&(i.Prefix=r);let n=[],o=!0;do{let c=await t.send(new wp(i));if(c.$metadata.httpStatusCode!==200)throw Error("some thing bad while listing remote!");if(c.Contents===void 0)break;if(n.push(...c.Contents),o=c.IsTruncated,i.ContinuationToken=c.NextContinuationToken,o&&(i.ContinuationToken===void 0||i.ContinuationToken===""))throw Error("isTruncated is true but no continuationToken provided")}while(o);return{Contents:n.map(c=>fOe(c))}},hOe=async t=>{if(t instanceof Kee.Readable)return await new Promise((e,r)=>{let i=[];t.on("data",n=>i.push(n)),t.on("error",r),t.on("end",()=>e(Bi($ee.Buffer.concat(i))))});if(t instanceof ReadableStream)return await new Response(t,{}).arrayBuffer();if(t instanceof Blob)return await t.arrayBuffer();throw TypeError(`The type of ${t} is not one of the supported types`)},pOe=async(t,e,r)=>{let i=await t.send(new vp({Bucket:e.s3BucketName,Key:r}));return await hOe(i.Body)},Yee=async(t,e,r,i,n,o="",c="",u=!1)=>{let d=r.endsWith("/");if(u||await Ji(r,i),d)return new ArrayBuffer(0);{let y=r;o!==""&&(y=c);let E=await pOe(t,e,y),x=E;return o!==""&&(x=await Sa(E,o)),u||await i.adapter.writeBinary(r,x,{mtime:n}),x}},Qee=async(t,e,r,i="",n="")=>{if(r==="/")return;let o=r;i!==""&&(o=n),await t.send(new Of({Bucket:e.s3BucketName,Key:o})),r.endsWith("/")&&i===""?(await RR(t,e,r)).Contents.forEach(async u=>{await t.send(new Of({Bucket:e.s3BucketName,Key:u.key}))}):r.endsWith("/")},Jee=async(t,e,r)=>{try{let i=await t.send(new bp({Bucket:e.s3BucketName}));if(i===void 0||i.$metadata===void 0||i.$metadata.httpStatusCode===void 0){let n="results or $metadata or httStatusCode is undefined";return ht.debug(n),r!==void 0&&r(n),!1}return i.$metadata.httpStatusCode===200}catch(i){if(ht.debug(i),r!==void 0)if(e.s3Endpoint.contains(e.s3BucketName)){let n=new Za([i,new Error("Maybe you've included the bucket name inside the endpoint setting. Please remove the bucket name and try again.")]);r(n)}else r(i);return!1}};m();var Rte=Et(xn()),Dte=require("obsidian"),kte=Et(IR()),Ite=Et(OR()),Ote=Et(PR());m();m();var r8e=202,n8e=502,i8e=400,o8e=409,s8e=100,a8e=201,c8e=417;var u8e=403,l8e=504,f8e=410,d8e=505,h8e=418,p8e=419,m8e=507,g8e=500,y8e=411,v8e=423,b8e=420,_8e=405,w8e=301,x8e=302,E8e=207,S8e=300,C8e=511,A8e=204,T8e=203,M8e=406,R8e=404,D8e=501,k8e=304,I8e=200,O8e=206,P8e=402,N8e=308,B8e=412,F8e=428,L8e=102,q8e=407,U8e=431,j8e=408,z8e=413,H8e=414,$8e=416,G8e=205,K8e=303,V8e=503,W8e=101,Y8e=307,Q8e=429,J8e=401,X8e=422,Z8e=415,ePe=305,Ate={ACCEPTED:r8e,BAD_GATEWAY:n8e,BAD_REQUEST:i8e,CONFLICT:o8e,CONTINUE:s8e,CREATED:a8e,EXPECTATION_FAILED:c8e,FORBIDDEN:u8e,GATEWAY_TIMEOUT:l8e,GONE:f8e,HTTP_VERSION_NOT_SUPPORTED:d8e,IM_A_TEAPOT:h8e,INSUFFICIENT_SPACE_ON_RESOURCE:p8e,INSUFFICIENT_STORAGE:m8e,INTERNAL_SERVER_ERROR:g8e,LENGTH_REQUIRED:y8e,LOCKED:v8e,METHOD_FAILURE:b8e,METHOD_NOT_ALLOWED:_8e,MOVED_PERMANENTLY:w8e,MOVED_TEMPORARILY:x8e,MULTI_STATUS:E8e,MULTIPLE_CHOICES:S8e,NETWORK_AUTHENTICATION_REQUIRED:C8e,NO_CONTENT:A8e,NON_AUTHORITATIVE_INFORMATION:T8e,NOT_ACCEPTABLE:M8e,NOT_FOUND:R8e,NOT_IMPLEMENTED:D8e,NOT_MODIFIED:k8e,OK:I8e,PARTIAL_CONTENT:O8e,PAYMENT_REQUIRED:P8e,PERMANENT_REDIRECT:N8e,PRECONDITION_FAILED:B8e,PRECONDITION_REQUIRED:F8e,PROCESSING:L8e,PROXY_AUTHENTICATION_REQUIRED:q8e,REQUEST_HEADER_FIELDS_TOO_LARGE:U8e,REQUEST_TIMEOUT:j8e,REQUEST_TOO_LONG:z8e,REQUEST_URI_TOO_LONG:H8e,REQUESTED_RANGE_NOT_SATISFIABLE:$8e,RESET_CONTENT:G8e,SEE_OTHER:K8e,SERVICE_UNAVAILABLE:V8e,SWITCHING_PROTOCOLS:W8e,TEMPORARY_REDIRECT:Y8e,TOO_MANY_REQUESTS:Q8e,UNAUTHORIZED:J8e,UNPROCESSABLE_ENTITY:X8e,UNSUPPORTED_MEDIA_TYPE:Z8e,USE_PROXY:ePe};m();m();var Tte={202:"Accepted",502:"Bad Gateway",400:"Bad Request",409:"Conflict",100:"Continue",201:"Created",417:"Expectation Failed",424:"Failed Dependency",403:"Forbidden",504:"Gateway Timeout",410:"Gone",505:"HTTP Version Not Supported",418:"I'm a teapot",419:"Insufficient Space on Resource",507:"Insufficient Storage",500:"Internal Server Error",411:"Length Required",423:"Locked",420:"Method Failure",405:"Method Not Allowed",301:"Moved Permanently",302:"Moved Temporarily",207:"Multi-Status",300:"Multiple Choices",511:"Network Authentication Required",204:"No Content",203:"Non Authoritative Information",406:"Not Acceptable",404:"Not Found",501:"Not Implemented",304:"Not Modified",200:"OK",206:"Partial Content",402:"Payment Required",308:"Permanent Redirect",412:"Precondition Failed",428:"Precondition Required",102:"Processing",103:"Early Hints",426:"Upgrade Required",407:"Proxy Authentication Required",431:"Request Header Fields Too Large",408:"Request Timeout",413:"Request Entity Too Large",414:"Request-URI Too Long",416:"Requested Range Not Satisfiable",205:"Reset Content",303:"See Other",503:"Service Unavailable",101:"Switching Protocols",307:"Temporary Redirect",429:"Too Many Requests",401:"Unauthorized",451:"Unavailable For Legal Reasons",422:"Unprocessable Entity",415:"Unsupported Media Type",305:"Use Proxy",421:"Misdirected Request"},Mte={Accepted:202,"Bad Gateway":502,"Bad Request":400,Conflict:409,Continue:100,Created:201,"Expectation Failed":417,"Failed Dependency":424,Forbidden:403,"Gateway Timeout":504,Gone:410,"HTTP Version Not Supported":505,"I'm a teapot":418,"Insufficient Space on Resource":419,"Insufficient Storage":507,"Internal Server Error":500,"Length Required":411,Locked:423,"Method Failure":420,"Method Not Allowed":405,"Moved Permanently":301,"Moved Temporarily":302,"Multi-Status":207,"Multiple Choices":300,"Network Authentication Required":511,"No Content":204,"Non Authoritative Information":203,"Not Acceptable":406,"Not Found":404,"Not Implemented":501,"Not Modified":304,OK:200,"Partial Content":206,"Payment Required":402,"Permanent Redirect":308,"Precondition Failed":412,"Precondition Required":428,Processing:102,"Early Hints":103,"Upgrade Required":426,"Proxy Authentication Required":407,"Request Header Fields Too Large":431,"Request Timeout":408,"Request Entity Too Large":413,"Request-URI Too Long":414,"Requested Range Not Satisfiable":416,"Reset Content":205,"See Other":303,"Service Unavailable":503,"Switching Protocols":101,"Temporary Redirect":307,"Too Many Requests":429,Unauthorized:401,"Unavailable For Legal Reasons":451,"Unprocessable Entity":422,"Unsupported Media Type":415,"Use Proxy":305,"Misdirected Request":421};function Ff(t){var e=Tte[t.toString()];if(!e)throw new Error("Status code does not exist: "+t);return e}function NR(t){var e=Mte[t];if(!e)throw new Error("Reason phrase does not exist: "+t);return e}var BR=Ff;var rx=function(){return rx=Object.assign||function(t){for(var e,r=1,i=arguments.length;r{let e={...t.headers};delete e.host,delete e.Host,delete e["content-length"],delete e["Content-Length"];let r=await(0,Dte.requestUrl)({url:t.url,method:t.method,body:t.data,headers:e}),i;if(t.responseType===void 0)i={data:void 0,status:r.status,statusText:Ff(r.status),headers:r.headers};else if(t.responseType==="json")i={data:r.json,status:r.status,statusText:Ff(r.status),headers:r.headers};else if(t.responseType==="text")i={data:r.text,status:r.status,statusText:Ff(r.status),headers:r.headers};else if(t.responseType==="arraybuffer")i={data:r.arrayBuffer,status:r.status,statusText:Ff(r.status),headers:r.headers};else throw Error(`do not know how to deal with responseType = ${t.responseType}`);return i});var Nte={address:"",username:"",password:"",authType:"basic",manualRecursive:!1,depth:"auto_unknown",remoteBaseDir:""},Rg=(t,e)=>{let r=t;return(t==="/"||t==="")&&(r=`/${e}/`),t.startsWith("/")||(r=`/${e}/${t}`),r},tPe=(t,e)=>{if(!(t===`/${e}`||t.startsWith(`/${e}/`)))throw Error(`"${t}" doesn't starts with "/${e}/"`);return t.slice(`/${e}/`.length)},Bte=(t,e)=>{let r=tPe(t.filename,e);return t.type==="directory"&&!r.endsWith("/")&&(r=`${r}/`),{key:r,lastModified:Date.parse(t.lastmod).valueOf(),size:t.size,remoteType:"webdav",etag:t.etag||void 0}},qR=class{webdavConfig;remoteBaseDir;client;vaultFolderExists;saveUpdatedConfigFunc;constructor(e,r,i){this.webdavConfig=e,this.remoteBaseDir=r,this.vaultFolderExists=!1,this.saveUpdatedConfigFunc=i}init=async()=>{let e={"Cache-Control":"no-cache"};if(this.client===void 0&&(this.webdavConfig.username!==""&&this.webdavConfig.password!==""?this.client=(0,Dp.createClient)(this.webdavConfig.address,{username:this.webdavConfig.username,password:this.webdavConfig.password,headers:e,authType:this.webdavConfig.authType==="digest"?Dp.AuthType.Digest:Dp.AuthType.Password}):this.client=(0,Dp.createClient)(this.webdavConfig.address,{headers:e})),this.vaultFolderExists||(await this.client.exists(`/${this.remoteBaseDir}/`)?this.vaultFolderExists=!0:(await this.client.createDirectory(`/${this.remoteBaseDir}/`),this.vaultFolderExists=!0)),this.webdavConfig.depth==="auto_unknown"){let r=!1;try{if((await this.client.customRequest(`/${this.remoteBaseDir}/`,{method:"PROPFIND",headers:{Depth:"infinity"},responseType:"text"})).status===403)throw Error("not support Infinity, get 403");r=!0,this.webdavConfig.depth="auto_infinity",this.webdavConfig.manualRecursive=!1}catch{r=!1}if(!r)try{let i=await this.client.customRequest(`/${this.remoteBaseDir}/`,{method:"PROPFIND",headers:{Depth:"1"},responseType:"text"});r=!0,this.webdavConfig.depth="auto_1",this.webdavConfig.manualRecursive=!0}catch{r=!1}r&&this.saveUpdatedConfigFunc!==void 0&&await this.saveUpdatedConfigFunc()}}},Fte=(t,e,r)=>new qR(t,e,r),ix=async(t,e)=>{await t.init();let r=Rg(e,t.remoteBaseDir),i=await t.client.stat(r,{details:!1});return Bte(i,t.remoteBaseDir)},Lte=async(t,e,r,i=!1,n="",o="",c=!1,u="")=>{await t.init();let d=e;n!==""&&(d=o),d=Rg(d,t.remoteBaseDir);let y=e.endsWith("/");if(y&&i)throw Error("upload function doesn't implement recursive function yet!");if(y&&!i){if(c)throw Error("you specify uploadRaw, but you also provide a folder key!");return n===""?(await t.client.createDirectory(d,{recursive:!1}),await ix(t,d)):(await t.client.putFileContents(d,"",{overwrite:!0}),await ix(t,d))}else{let E;c?typeof u=="string"?E=new TextEncoder().encode(u).buffer:E=u:E=await r.adapter.readBinary(e);let x=E;return n!==""&&(x=await Bs(E,n)),await t.client.putFileContents(d,x,{overwrite:!0}),await ix(t,d)}},qte=async(t,e)=>{if(e!==void 0)throw Error("prefix not supported");await t.init();let r=[];if(t.webdavConfig.depth==="auto_1"||t.webdavConfig.depth==="manual_1"){let i=new kte.Queue([`/${t.remoteBaseDir}`]),n=10;for(;i.length>0;){let o=[];for(;i.length>0;)o.push(i.pop());let c=(0,Ite.default)(o,n),u=[];for(let d of c){let y=d.map(x=>t.client.getDirectoryContents(x,{deep:!1,details:!1})),E=(0,Ote.default)(await Promise.all(y));u.push(...E)}for(let d=0;dBte(i,t.remoteBaseDir))}},rPe=async(t,e)=>{await t.init();let r=await t.client.getFileContents(Rg(e,t.remoteBaseDir));if(r instanceof ArrayBuffer)return r;if(r instanceof Rte.Buffer)return Bi(r);throw Error(`unexpected file content result with type ${typeof r}`)},Ute=async(t,e,r,i,n="",o="",c=!1)=>{await t.init();let u=e.endsWith("/");if(c||await Ji(e,r),u)return new ArrayBuffer(0);{let d=e;n!==""&&(d=o),d=Rg(d,t.remoteBaseDir);let y=await rPe(t,d),E=y;return n!==""&&(E=await Sa(y,n)),c||await r.adapter.writeBinary(e,E,{mtime:i}),E}},jte=async(t,e,r="",i="")=>{if(e==="/")return;let n=e;r!==""&&(n=i),n=Rg(n,t.remoteBaseDir),await t.init();try{await t.client.deleteFile(n)}catch{console.error("some error while deleting")}},zte=async(t,e)=>{if(!(t.webdavConfig.address.startsWith("http://")||t.webdavConfig.address.startsWith("https://"))){let r="Error: the url should start with http(s):// but it does not!";return ht.debug(r),e!==void 0&&e(r),!1}try{if(await t.init(),await ix(t,"/")===void 0){let i="results is undefined";return ht.debug(i),e!==void 0&&e(i),!1}return!0}catch(r){return ht.debug(r),e!==void 0&&e(r),!1}};var Qi=class{serviceType;s3Config;webdavClient;webdavConfig;dropboxClient;dropboxConfig;onedriveClient;onedriveConfig;constructor(e,r,i,n,o,c,u){if(this.serviceType=e,e==="s3")this.s3Config=r;else if(e==="webdav"){if(c===void 0||u===void 0)throw Error("remember to provide vault name and callback while init webdav client");let d=i.remoteBaseDir||c;this.webdavConfig=i,this.webdavClient=Fte(this.webdavConfig,d,u)}else if(e==="dropbox"){if(c===void 0||u===void 0)throw Error("remember to provide vault name and callback while init dropbox client");let d=n.remoteBaseDir||c;this.dropboxConfig=n,this.dropboxClient=IU(this.dropboxConfig,d,u)}else if(e==="onedrive"){if(c===void 0||u===void 0)throw Error("remember to provide vault name and callback while init onedrive client");let d=o.remoteBaseDir||c;this.onedriveConfig=o,this.onedriveClient=sG(this.onedriveConfig,d,u)}else throw Error(`not supported service type ${this.serviceType}`)}uploadToRemote=async(e,r,i=!1,n="",o="",c=void 0,u=!1,d="")=>{if(this.serviceType==="s3")return await Wee(Mp(this.s3Config),this.s3Config,e,r,i,n,o,u,d);if(this.serviceType==="webdav")return await Lte(this.webdavClient,e,r,i,n,o,u,d);if(this.serviceType==="dropbox")return await OU(this.dropboxClient,e,r,i,n,o,c,u,d);if(this.serviceType==="onedrive")return await cG(this.onedriveClient,e,r,i,n,o,c,u,d);throw Error(`not supported service type ${this.serviceType}`)};listFromRemote=async e=>{if(this.serviceType==="s3")return await RR(Mp(this.s3Config),this.s3Config,e);if(this.serviceType==="webdav")return await qte(this.webdavClient,e);if(this.serviceType==="dropbox")return await PU(this.dropboxClient,e);if(this.serviceType==="onedrive")return await aG(this.onedriveClient,e);throw Error(`not supported service type ${this.serviceType}`)};downloadFromRemote=async(e,r,i,n="",o="",c=!1)=>{if(this.serviceType==="s3")return await Yee(Mp(this.s3Config),this.s3Config,e,r,i,n,o,c);if(this.serviceType==="webdav")return await Ute(this.webdavClient,e,r,i,n,o,c);if(this.serviceType==="dropbox")return await NU(this.dropboxClient,e,r,i,n,o,c);if(this.serviceType==="onedrive")return await uG(this.onedriveClient,e,r,i,n,o,c);throw Error(`not supported service type ${this.serviceType}`)};deleteFromRemote=async(e,r="",i="")=>{if(this.serviceType==="s3")return await Qee(Mp(this.s3Config),this.s3Config,e,r,i);if(this.serviceType==="webdav")return await jte(this.webdavClient,e,r,i);if(this.serviceType==="dropbox")return await BU(this.dropboxClient,e,r,i);if(this.serviceType==="onedrive")return await lG(this.onedriveClient,e,r,i);throw Error(`not supported service type ${this.serviceType}`)};checkConnectivity=async e=>{if(this.serviceType==="s3")return await Jee(Mp(this.s3Config),this.s3Config,e);if(this.serviceType==="webdav")return await zte(this.webdavClient,e);if(this.serviceType==="dropbox")return await FU(this.dropboxClient,e);if(this.serviceType==="onedrive")return await fG(this.onedriveClient,e);throw Error(`not supported service type ${this.serviceType}`)};getUser=async()=>{if(this.serviceType==="dropbox")return await LU(this.dropboxClient);if(this.serviceType==="onedrive")return await tT(this.onedriveClient);throw Error(`not supported service type ${this.serviceType}`)};revokeAuth=async()=>{if(this.serviceType==="dropbox")return await qU(this.dropboxClient);throw Error(`not supported service type ${this.serviceType}`)}};m();var Ge=require("obsidian");m();var iPe=t=>{let e=JSON.parse(t),{ts:r,tsFmt:i,remoteType:n,mixedStates:o}=e,c=["key","remoteEncryptedKey","existLocal","sizeLocal","sizeLocalEnc","mtimeLocal","deltimeLocal","changeLocalMtimeUsingMapping","existRemote","sizeRemote","sizeRemoteEnc","mtimeRemote","deltimeRemote","changeRemoteMtimeUsingMapping","decision","decisionBranch"],u=[`ts: ${r}${i!==void 0?" / "+i:""}`,`remoteType: ${n}`,`| ${c.join(" | ")} |`,`| ${c.map(d=>"---").join(" | ")} |`];for(let[d,y]of Object.entries(e.mixedStates)){let E=d,x=y,A=[];for(let R of c){let M=x[R];if(M===void 0){A.push("");continue}if(R==="mtimeLocal"||R==="deltimeLocal"||R==="mtimeRemote"||R==="deltimeRemote"){let I=x[R+"Fmt"],D=`${M}${I!==void 0?" / "+I:""}`;A.push(D)}else A.push(M)}u.push(`| ${A.join(" | ")} |`)}return u.join(` -`)},kp=async(t,e,r,i="json")=>{await Ji(Ou,e);let n=await y8(t,r),o="";if(n.length===0)o="No sync plans history found";else if(i==="json")o=`Sync plans found: - -`+n.map(d=>"```json\n"+d+"\n```\n").join(` -`);else if(i==="table")o=`Sync plans found: - -`+n.map(iPe).join(` - -`);else{let d=i}let c=Date.now(),u=`${Ou}${R4}${c}.md`;await e.create(u,o,{mtime:c})},ox=async(t,e,r)=>{await Ji(Ou,e);let i=await v8(t,r),n="";i.length===0?n="No logger history found.":n="Logger history found:\n\n```text\n"+i.join(` -`)+"\n```\n";let o=Date.now(),c=`${Ou}${D4}${o}.md`;await e.create(c,n,{mtime:o})};m();var oPe="The file contains sensitive info, so DO NOT take screenshot of, copy, or share it to anyone! It's also generated automatically, so do not edit it manually.",sx=t=>t==null?t:"readme"in t&&"d"in t?JSON.parse(sa.parse(ld(t.d),{out:T.allocUnsafe,loose:!0}).toString("utf-8")):t,Hte=t=>t==null?t:{readme:oPe,d:ld(sa.stringify(T.from(JSON.stringify(t),"utf-8"),{pad:!1}))};m();var sPe={webdav:{depth:[{url:"^https://(.+).teracloud.jp/.+",depth:"auto_1",manualRecursive:!0},{url:"^https://dav.jianguoyun.com/dav/",depth:"auto_1",manualRecursive:!0}]}},ax=t=>{if(t===void 0)return{changed:!1,webdav:t};for(let{url:e,depth:r,manualRecursive:i}of sPe.webdav.depth)if(t.address!==void 0&&new RegExp(e).test(t.address)&&t.depth!==void 0&&t.depth.startsWith("auto_")&&t.depth!==r)return t.depth=r,t.manualRecursive=i,{changed:!0,webdav:t};return{changed:!1,webdav:t}},$te=t=>t===void 0?{changed:!1,settings:t}:{changed:ax(t.webdav).changed,settings:t};m();var t5e=Et(Tre());var r5e="Do NOT edit or delete the file manually. This file is for the plugin remotely-sync to store some necessary meta data on the remote services. Its content is slightly obfuscated.",n5e="20220220",Lf="_remotely-secure-metadata-on-remote.json",Mre="_remotely-secure-metadata-on-remote.bin",Rre="data.json",HR="/bookmarks.json";var Dre=t=>{let e=t;e.version===void 0&&e.version,e.generatedWhen===void 0&&(e.generatedWhen=Date.now()),e.deletions===void 0&&(e.deletions=[]);let r={readme:r5e,d:ld(sa.stringify(T.from(JSON.stringify(t),"utf-8"),{pad:!1}))};return JSON.stringify(r,null,2)},$R=t=>{let e="";typeof t=="string"?e=t:e=new TextDecoder().decode(t);let r;try{r=JSON.parse(e)}catch{throw new Error(`invalid remote meta data file with first few chars: ${e.slice(0,5)}`)}if(!("readme"in r&&"d"in r))throw new Error('invalid remote meta data file (no "readme" or "d" fields)!');let i;try{i=sa.parse(ld(r.d),{out:T.allocUnsafe,loose:!0}).toString("utf-8")}catch{throw new Error('invalid remote meta data file (invalid "d" field)!')}let n;try{n=JSON.parse(i)}catch{throw new Error(`invalid remote meta data file with "d" field with first few chars: ${i.slice(0,5)}`)}return n};m();var Ip=require("obsidian");m();m();var KR=Et(Ire(),1);m();var kg=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},VR=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Ore=t=>globalThis.DOMException===void 0?new VR(t):new DOMException(t),Pre=t=>{let e=t.reason===void 0?Ore("This operation was aborted."):t.reason;return e instanceof Error?e:Ore(e)};function WR(t,e,r,i){let n,o=new Promise((c,u)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){c(t);return}if(i={customTimers:{setTimeout,clearTimeout},...i},i.signal){let{signal:d}=i;d.aborted&&u(Pre(d)),d.addEventListener("abort",()=>{u(Pre(d))})}n=i.customTimers.setTimeout.call(void 0,()=>{if(typeof r=="function"){try{c(r())}catch(E){u(E)}return}let d=typeof r=="string"?r:`Promise timed out after ${e} milliseconds`,y=r instanceof Error?r:new kg(d);typeof t.cancel=="function"&&t.cancel(),u(y)},e),(async()=>{try{c(await t)}catch(d){u(d)}finally{i.customTimers.clearTimeout.call(void 0,n)}})()});return o.clear=()=>{clearTimeout(n),n=void 0},o}m();m();function YR(t,e,r){let i=0,n=t.length;for(;n>0;){let o=Math.trunc(n/2),c=i+o;r(t[c],e)<=0?(i=++c,n-=o+1):n=o}return i}var qf=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},ec,QR=class{constructor(){ec.set(this,[])}enqueue(e,r){r={priority:0,...r};let i={priority:r.priority,run:e};if(this.size&&qf(this,ec,"f")[this.size-1].priority>=r.priority){qf(this,ec,"f").push(i);return}let n=YR(qf(this,ec,"f"),i,(o,c)=>c.priority-o.priority);qf(this,ec,"f").splice(n,0,i)}dequeue(){let e=qf(this,ec,"f").shift();return e?.run}filter(e){return qf(this,ec,"f").filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return qf(this,ec,"f").length}};ec=new WeakMap;var Nre=QR;var sn=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},dt=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},wn,Og,Pg,Cu,gx,Ng,fx,gs,Ig,so,dx,ao,Bg,Su,hx,Bre,Fre,Ure,Lre,qre,px,JR,XR,yx,jre,mx,vx=class extends Error{},ZR=class extends KR.default{constructor(e){var r,i,n,o;if(super(),wn.add(this),Og.set(this,void 0),Pg.set(this,void 0),Cu.set(this,0),gx.set(this,void 0),Ng.set(this,void 0),fx.set(this,0),gs.set(this,void 0),Ig.set(this,void 0),so.set(this,void 0),dx.set(this,void 0),ao.set(this,0),Bg.set(this,void 0),Su.set(this,void 0),hx.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Nre,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(i=(r=e.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&i!==void 0?i:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(o=(n=e.interval)===null||n===void 0?void 0:n.toString())!==null&&o!==void 0?o:""}\` (${typeof e.interval})`);sn(this,Og,e.carryoverConcurrencyCount,"f"),sn(this,Pg,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),sn(this,gx,e.intervalCap,"f"),sn(this,Ng,e.interval,"f"),sn(this,so,new e.queueClass,"f"),sn(this,dx,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,sn(this,hx,e.throwOnTimeout===!0,"f"),sn(this,Su,e.autoStart===!1,"f")}get concurrency(){return dt(this,Bg,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);sn(this,Bg,e,"f"),dt(this,wn,"m",yx).call(this)}async add(e,r={}){return r={timeout:this.timeout,throwOnTimeout:dt(this,hx,"f"),...r},new Promise((i,n)=>{dt(this,so,"f").enqueue(async()=>{var o,c,u;sn(this,ao,(c=dt(this,ao,"f"),c++,c),"f"),sn(this,Cu,(u=dt(this,Cu,"f"),u++,u),"f");try{if(!((o=r.signal)===null||o===void 0)&&o.aborted)throw new vx("The task was aborted.");let d=e({signal:r.signal});r.timeout&&(d=WR(Promise.resolve(d),r.timeout)),r.signal&&(d=Promise.race([d,dt(this,wn,"m",jre).call(this,r.signal)]));let y=await d;i(y),this.emit("completed",y)}catch(d){if(d instanceof kg&&!r.throwOnTimeout){i();return}n(d),this.emit("error",d)}finally{dt(this,wn,"m",Ure).call(this)}},r),this.emit("add"),dt(this,wn,"m",px).call(this)})}async addAll(e,r){return Promise.all(e.map(async i=>this.add(i,r)))}start(){return dt(this,Su,"f")?(sn(this,Su,!1,"f"),dt(this,wn,"m",yx).call(this),this):this}pause(){sn(this,Su,!0,"f")}clear(){sn(this,so,new(dt(this,dx,"f")),"f")}async onEmpty(){dt(this,so,"f").size!==0&&await dt(this,wn,"m",mx).call(this,"empty")}async onSizeLessThan(e){dt(this,so,"f").sizedt(this,so,"f").size{dt(this,wn,"m",Lre).call(this)},r),"f"),!0}return!1},px=function(){if(dt(this,so,"f").size===0)return dt(this,gs,"f")&&clearInterval(dt(this,gs,"f")),sn(this,gs,void 0,"f"),this.emit("empty"),dt(this,ao,"f")===0&&this.emit("idle"),!1;if(!dt(this,Su,"f")){let e=!dt(this,wn,"a",qre);if(dt(this,wn,"a",Bre)&&dt(this,wn,"a",Fre)){let r=dt(this,so,"f").dequeue();return r?(this.emit("active"),r(),e&&dt(this,wn,"m",JR).call(this),!0):!1}}return!1},JR=function(){dt(this,Pg,"f")||dt(this,gs,"f")!==void 0||(sn(this,gs,setInterval(()=>{dt(this,wn,"m",XR).call(this)},dt(this,Ng,"f")),"f"),sn(this,fx,Date.now()+dt(this,Ng,"f"),"f"))},XR=function(){dt(this,Cu,"f")===0&&dt(this,ao,"f")===0&&dt(this,gs,"f")&&(clearInterval(dt(this,gs,"f")),sn(this,gs,void 0,"f")),sn(this,Cu,dt(this,Og,"f")?dt(this,ao,"f"):0,"f"),dt(this,wn,"m",yx).call(this)},yx=function(){for(;dt(this,wn,"m",px).call(this););},jre=async function(e){return new Promise((r,i)=>{e.addEventListener("abort",()=>{i(new vx("The task was aborted."))},{once:!0})})},mx=async function(e,r){return new Promise(i=>{let n=()=>{r&&!r()||(this.off(e,n),i())};this.on(e,n)})};var zre=ZR;m();var Gre=Et(IR()),Kre=Et(OR()),Vre=Et(PR());var Hre=t=>{let e=[".git",".github",".gitlab",".svn","node_modules",".DS_Store"];for(let r of e)if(t===r||t===`${r}/`||t.endsWith(`/${r}`)||t.endsWith(`/${r}/`))return!0;return!1},s5e=(t,e)=>t==="remotely-secure"||t==="remotely-secure/"||t.endsWith("/remotely-secure")||t.endsWith("/remotely-secure/"),$re=t=>{let e=["data.json","main.js","manifest.json",".gitignore","styles.css"];for(let r of e)if(t===r||t.endsWith(`/${r}`))return!0;return!1},Wre=(t,e)=>{if(!e.startsWith("."))throw Error(`configDir should starts with . but we get ${e}`);return t===e||t.startsWith(`${e}/`)},Yre=t=>t.startsWith(".trash"),bx=async(t,e,r)=>{let i=[t.configDir];r&&await t.adapter.stat(".trash")!=null&&i.push(".trash");let n=new Gre.Queue(i),o=10,c=[];for(;n.length>0;){let u=[];for(;n.length>0;)u.push(n.pop());let d=(0,Kre.default)(u,o);for(let y of d){let E=y.map(async A=>{let R=await ws(t,A),M=R.type==="folder",I;return M&&(I=await t.adapter.list(A)),{itself:{key:M?`${A}/`:A,...R},children:I}}),x=(0,Vre.default)(await Promise.all(E));for(let A of x){c.push(A.itself);let R=s5e(A.itself.key,e);if(A.children!==void 0){for(let M of A.children.folders)Hre(M)||R&&!$re(M)||n.push(M);for(let M of A.children.files)Hre(M)||R&&!$re(M)||n.push(M)}}}}return c};var e6=async(t,e="")=>{if(t===void 0||t.length===0)return{ok:!0,reason:"empty_remote"};let r=t[0].key;if(ht.debug("password is blank? ",e==""," remote has metadata? ",t.some(i=>i.key=="_remotely-secure-metadata-on-remote.json")),e==""&&t.some(i=>i.key=="_remotely-secure-metadata-on-remote.json"))return{ok:!0,reason:"no_password_both_sides"};try{let i=await Zb(r,e);return{ok:!0,reason:"password_matched"}}catch{return{ok:!1,reason:"password_not_matched"}}},Op=async(t,e,r="")=>{if(t===void 0)return;let i=[];for(let n of t){let o=n.key,c=o;r!==""&&(c=await Zb(o,r)),c==Lf&&i.push({key:c,existRemote:!0,mtimeRemote:n.lastModified,mtimeRemoteFmt:Xi(n.lastModified),sizeRemote:r===""?n.size:void 0,sizeRemoteEnc:r===""?void 0:n.size,remoteEncryptedKey:o,changeRemoteMtimeUsingMapping:!1})}return i.length>1&&(i=i.sort((n,o)=>o.mtimeRemote-n.mtimeRemote),i.forEach(async(n,o)=>{o!==0&&await e.deleteFromRemote(Lf,r,n.remoteEncryptedKey)})),i[0]},t6=async(t,e,r,i,n="")=>{let o=[];if(t===void 0)return o;for(let c of t){let u=c.key,d=u;n!==""&&(d=await Zb(u,n));let y=await h8(i,e,d,c.lastModified,c.etag,r),E={};if(y!==void 0){d=y.localKey;let x=y.localMtime||c.lastModified;E={key:d,existRemote:!0,mtimeRemote:x,mtimeRemoteFmt:Xi(x),sizeRemote:y.localSize,sizeRemoteEnc:n===""?void 0:c.size,remoteEncryptedKey:u,changeRemoteMtimeUsingMapping:!0}}else E={key:d,existRemote:!0,mtimeRemote:c.lastModified,mtimeRemoteFmt:Xi(c.lastModified),sizeRemote:n===""?c.size:void 0,sizeRemoteEnc:n===""?void 0:c.size,remoteEncryptedKey:u,changeRemoteMtimeUsingMapping:!1};o.push(E)}return o};var _x=(t,e,r,i,n,o)=>{if(e&&Wre(t,o))return t==o+"/plugins/remotely-secure/"+Rre;if(i&&Yre(t))return!0;let c=jE(t,!0,!1)||!r&&jE(t,!1,!0)||t===Lf||t===Mre;return t===o+HR?!1:c},a5e=async(t,e,r,i,n,o,c,u,d,y,E)=>{let x={};for(let A of t){let R=A.key;_x(R,o,y,c,u,d)||(x[R]=A,x[R].existLocal=!1)}for(let A of e){let R={},M=A.path;if(A.path!=="/"){if(A instanceof Ip.TFile){let I=Math.max(A.stat.mtime??0,A.stat.ctime??0);R={key:A.path,existLocal:!0,mtimeLocal:I,mtimeLocalFmt:Xi(I),sizeLocal:A.stat.size,sizeLocalEnc:E===""?void 0:e_(A.stat.size)}}else if(A instanceof Ip.TFolder)M=`${A.path}/`,R={key:M,existLocal:!0,mtimeLocal:void 0,mtimeLocalFmt:void 0,sizeLocal:0,sizeLocalEnc:E===""?void 0:e_(0)};else throw Error(`unexpected ${A}`);_x(M,o,y,c,u,d)||(x.hasOwnProperty(M)?(x[M].key=R.key,x[M].existLocal=R.existLocal,x[M].mtimeLocal=R.mtimeLocal,x[M].mtimeLocalFmt=R.mtimeLocalFmt,x[M].sizeLocal=R.sizeLocal,x[M].sizeLocalEnc=R.sizeLocalEnc):(x[M]=R,x[M].existRemote=!1))}}if(r!==void 0)for(let A of r){let R=A.key;if(!o&&R!=d+HR)continue;let M=Math.max(A.mtime??0,A.ctime??0);(Number.isNaN(M)||M===0)&&(M=void 0);let I={key:R,existLocal:!0,mtimeLocal:M,mtimeLocalFmt:Xi(M),sizeLocal:A.size,sizeLocalEnc:E===""?void 0:e_(A.size)};x.hasOwnProperty(R)?(x[R].key=I.key,x[R].existLocal=I.existLocal,x[R].mtimeLocal=I.mtimeLocal,x[R].mtimeLocalFmt=I.mtimeLocalFmt,x[R].sizeLocal=I.sizeLocal,x[R].sizeLocalEnc=I.sizeLocalEnc):(x[R]=I,x[R].existRemote=!1)}for(let A of i){let R=A.key,M={key:R,deltimeRemote:A.actionWhen,deltimeRemoteFmt:Xi(A.actionWhen)};_x(R,o,y,c,u,d)||(x.hasOwnProperty(R)?(x[R].key=M.key,x[R].deltimeRemote=M.deltimeRemote,x[R].deltimeRemoteFmt=M.deltimeRemoteFmt):(x[R]=M,x[R].existLocal=!1,x[R].existRemote=!1))}for(let A of n){let R=A.key;if(A.keyType==="folder")A.key.endsWith("/")||(R=`${A.key}/`);else if(A.keyType!=="file")throw Error(`unexpected ${A}`);if(!_x(R,o,y,c,u,d))if(A.actionType==="delete"||A.actionType==="rename"){let M={key:R,deltimeLocal:A.actionWhen,deltimeLocalFmt:Xi(A.actionWhen)};x.hasOwnProperty(R)?(x[R].deltimeLocal=M.deltimeLocal,x[R].deltimeLocalFmt=M.deltimeLocalFmt):(x[R]=M,x[R].existLocal=!1,x[R].existRemote=!1)}else if(A.actionType==="renameDestination"){let M={key:R,mtimeLocal:A.actionWhen,mtimeLocalFmt:Xi(A.actionWhen),changeLocalMtimeUsingMapping:!0};if(x.hasOwnProperty(R)){let I=Math.max(M.mtimeLocal??0,x[R].mtimeLocal??0);(Number.isNaN(I)||I===0)&&(I=void 0),x[R].mtimeLocal=I,x[R].mtimeLocalFmt=Xi(I),x[R].changeLocalMtimeUsingMapping=M.changeLocalMtimeUsingMapping}}else throw Error(`do not know how to deal with local file history ${A.key} with ${A.actionType}`)}return x},c5e=(t,e,r,i="")=>{let n=t;if(n.key.endsWith("/"))return n;if(n.existLocal&&(n.mtimeLocal===void 0||n.mtimeLocal<=0))throw Error(`Error: Abnormal last modified time locally: ${JSON.stringify(n,null,2)}`);if(n.existRemote&&(n.mtimeRemote===void 0||n.mtimeRemote<=0))throw Error(`Error: Abnormal last modified time remotely: ${JSON.stringify(n,null,2)}`);if(n.deltimeLocal!==void 0&&n.deltimeLocal<=0)throw Error(`Error: Abnormal deletion time locally: ${JSON.stringify(n,null,2)}`);if(n.deltimeRemote!==void 0&&n.deltimeRemote<=0)throw Error(`Error: Abnormal deletion time remotely: ${JSON.stringify(n,null,2)}`);if(n.existLocal&&i!==""&&n.sizeLocalEnc===void 0||n.existRemote&&i!==""&&n.sizeRemoteEnc===void 0)throw new Error(`Error: No encryption sizes: ${JSON.stringify(n,null,2)}`);let o=i===""?n.sizeLocal:n.sizeLocalEnc,c=i===""?n.sizeRemote:n.sizeRemoteEnc;if(n.existLocal){let u=n.existRemote?n.mtimeRemote:-1,d=n.deltimeRemote!==void 0?n.deltimeRemote:-1,y=n.deltimeLocal!==void 0?n.deltimeLocal:-1;if(n.mtimeLocal>=u&&n.mtimeLocal>=y&&n.mtimeLocal>=d){if(o===void 0)throw new Error(`Error: no local size but has local mtime: ${JSON.stringify(n,null,2)}`);return n.mtimeLocal===n.mtimeRemote?o===c?(n.decision="skipUploading",n.decisionBranch=1):r<=0?(n.decision="uploadLocalToRemote",n.decisionBranch=2):o<=r?c<=r?(n.decision="uploadLocalToRemote",n.decisionBranch=18):(n.decision="errorRemoteTooLargeConflictLocal",n.decisionBranch=19):c<=r?(n.decision="errorLocalTooLargeConflictRemote",n.decisionBranch=20):(n.decision="skipUploadingTooLarge",n.decisionBranch=21):r<=0?(n.decision="uploadLocalToRemote",n.decisionBranch=4):o<=r?c===void 0?(n.decision="uploadLocalToRemote",n.decisionBranch=22):c<=r?(n.decision="uploadLocalToRemote",n.decisionBranch=23):(n.decision="errorRemoteTooLargeConflictLocal",n.decisionBranch=24):c===void 0?(n.decision="skipUploadingTooLarge",n.decisionBranch=25):c<=r?(n.decision="errorLocalTooLargeConflictRemote",n.decisionBranch=26):(n.decision="skipUploadingTooLarge",n.decisionBranch=27),e.add(qu(n.key)),n}}if(n.existRemote){let u=n.existLocal?n.mtimeLocal:-1,d=n.deltimeRemote!==void 0?n.deltimeRemote:-1,y=n.deltimeLocal!==void 0?n.deltimeLocal:-1;if(n.mtimeRemote>u&&n.mtimeRemote>=y&&n.mtimeRemote>=d){if(c===void 0)throw new Error(`Error: no remote size but has remote mtime: ${JSON.stringify(n,null,2)}`);return r<=0?(n.decision="downloadRemoteToLocal",n.decisionBranch=5):c<=r?o===void 0?(n.decision="downloadRemoteToLocal",n.decisionBranch=28):o<=r?(n.decision="downloadRemoteToLocal",n.decisionBranch=29):(n.decision="errorLocalTooLargeConflictRemote",n.decisionBranch=30):o===void 0?(n.decision="skipDownloadingTooLarge",n.decisionBranch=31):o<=r?(n.decision="errorRemoteTooLargeConflictLocal",n.decisionBranch=32):(n.decision="skipDownloadingTooLarge",n.decisionBranch=33),e.add(qu(n.key)),n}}if(n.deltimeLocal!==void 0&&n.deltimeLocal!==0){let u=n.existLocal?n.mtimeLocal:-1,d=n.existRemote?n.mtimeRemote:-1,y=n.deltimeRemote!==void 0?n.deltimeRemote:-1;if(n.deltimeLocal>=u&&n.deltimeLocal>=d&&n.deltimeLocal>=y){if(r<=0)n.decision="uploadLocalDelHistToRemote",n.decisionBranch=6,n.existLocal||n.existRemote;else{let E=n.existLocal&&o>r,x=n.existRemote&&c>r;E?x?(n.decision="skipUsingLocalDelTooLarge",n.decisionBranch=34):n.existRemote?(n.decision="errorLocalTooLargeConflictRemote",n.decisionBranch=35):(n.decision="skipUsingLocalDelTooLarge",n.decisionBranch=36):x?n.existLocal?(n.decision="errorLocalTooLargeConflictRemote",n.decisionBranch=37):(n.decision="skipUsingLocalDelTooLarge",n.decisionBranch=38):(n.decision="uploadLocalDelHistToRemote",n.decisionBranch=39)}return n}}if(n.deltimeRemote!==void 0&&n.deltimeRemote!==0){let u=n.existLocal?n.mtimeLocal:-1,d=n.existRemote?n.mtimeRemote:-1,y=n.deltimeLocal!==void 0?n.deltimeLocal:-1;if(n.deltimeRemote>=u&&n.deltimeRemote>=d&&n.deltimeRemote>=y){if(r<=0)n.decision="keepRemoteDelHist",n.decisionBranch=7,n.existLocal||n.existRemote;else{let E=n.existLocal&&o>r,x=n.existRemote&&c>r;E?x?(n.decision="skipUsingRemoteDelTooLarge",n.decisionBranch=40):n.existRemote?(n.decision="errorLocalTooLargeConflictRemote",n.decisionBranch=41):(n.decision="skipUsingRemoteDelTooLarge",n.decisionBranch=42):x?n.existLocal?(n.decision="errorLocalTooLargeConflictRemote",n.decisionBranch=43):(n.decision="skipUsingRemoteDelTooLarge",n.decisionBranch=44):(n.decision="keepRemoteDelHist",n.decisionBranch=45)}return n}}throw Error(`no decision for ${JSON.stringify(n)}`)},u5e=async(t,e,r,i="")=>{let n=t;if(!n.key.endsWith("/"))return n;if(e.has(n.key))if(e.add(qu(n.key)),n.existLocal&&n.existRemote)n.decision="skipFolder",n.decisionBranch=12;else if(n.existLocal||n.existRemote)n.decision="createFolder",n.decisionBranch=13;else throw Error(`Error: Folder ${n.key} doesn't exist locally and remotely but is marked must be kept. Abort.`);else if(n.deltimeLocal!==void 0||n.deltimeRemote!==void 0){let o=n.deltimeLocal!==void 0?n.deltimeLocal:-1,c=n.deltimeRemote!==void 0?n.deltimeRemote:-1;if((0,Ip.requireApiVersion)(uy)&&n.existLocal){let{ctime:u,mtime:d}=await ws(r,n.key),y=Math.max(u??0,d??0);if(!Number.isNaN(y)&&y>0&&y>=o&&y>=c)if(e.add(qu(n.key)),n.existLocal&&n.existRemote)n.decision="skipFolder",n.decisionBranch=14;else if(n.existLocal||n.existRemote)n.decision="createFolder",n.decisionBranch=15;else throw Error(`Error: Folder ${n.key} doesn't exist locally and remotely but is marked must be kept. Abort.`)}if(n.existLocal&&n.changeLocalMtimeUsingMapping&&n.mtimeLocal>0&&n.mtimeLocal>o&&n.mtimeLocal>c)if(e.add(qu(n.key)),n.existLocal&&n.existRemote)n.decision="skipFolder",n.decisionBranch=16;else if(n.existLocal||n.existRemote)n.decision="createFolder",n.decisionBranch=17;else throw Error(`Error: Folder ${n.key} doesn't exist locally and remotely but is marked must be kept. Abort.`);n.decision===void 0&&(o>0&&o>c?(n.decision="uploadLocalDelHistToRemoteFolder",n.decisionBranch=8):(n.decision="keepRemoteDelHistFolder",n.decisionBranch=9))}else if(e.add(qu(n.key)),n.existLocal&&n.existRemote)n.decision="skipFolder",n.decisionBranch=10;else if(n.existLocal||n.existRemote)n.decision="createFolder",n.decisionBranch=11;else throw Error(`Error: Folder ${n.key} doesn't exist locally and remotely but is marked must be kept. Abort.`);return e.delete(n.key),n},l5e=new Set(["uploadLocalDelHistToRemote","keepRemoteDelHist","uploadLocalDelHistToRemoteFolder","keepRemoteDelHistFolder"]),f5e=new Set(["errorLocalTooLargeConflictRemote","errorRemoteTooLargeConflictLocal"]),Qre=async(t,e,r,i,n,o,c,u,d,y,E,x,A,R,M="")=>{let I=await a5e(t,e,r,i,n,d,y,E,x,A,M),D=Object.keys(I).sort((W,q)=>q.length-W.length),O=[],N=[],L=new Set;for(let W=0;W{let c=Lf,u=c;o!==""&&(r===void 0?u=void 0:u=r.remoteEncryptedKey,(u===void 0||u==="")&&(u=await GA(c,o)));let y=Dre({deletions:n});await t.uploadToRemote(c,e,!1,o,u,void 0,!0,y)},d5e=async(t,e,r,i,n,o,c,u="")=>{let d=t;if(u!==""&&(d=r.remoteEncryptedKey,(d===void 0||d==="")&&(d=await GA(t,u))),r.decision===void 0)throw Error(`unknown decision in ${JSON.stringify(r)}`);if(r.decision!=="skipUploading"){if(r.decision==="uploadLocalDelHistToRemote")r.existLocal&&await c(r.key),r.existRemote&&await i.deleteFromRemote(r.key,u,d),await hc(n,r.key,e);else if(r.decision==="keepRemoteDelHist")r.existLocal&&await c(r.key),r.existRemote&&await i.deleteFromRemote(r.key,u,d),await hc(n,r.key,e);else if(r.decision==="uploadLocalToRemote"){if(!(i.serviceType==="onedrive"&&r.sizeLocal===0&&u==="")){let y=await i.uploadToRemote(r.key,o,!1,u,d);await KE(i.serviceType,n,r.key,r.mtimeLocal,r.sizeLocal,r.key,y.lastModified,y.size,y.etag,e)}await hc(n,r.key,e)}else if(r.decision==="downloadRemoteToLocal")await i.downloadFromRemote(r.key,o,r.mtimeRemote,u,d),await hc(n,r.key,e);else if(r.decision==="createFolder"){if(r.existLocal||await Ji(r.key,o),!r.existRemote){let y=await i.uploadToRemote(r.key,o,!1,u,d);await KE(i.serviceType,n,r.key,r.mtimeLocal,r.sizeLocal,r.key,y.lastModified,y.size,y.etag,e)}await hc(n,r.key,e)}else if(r.decision==="uploadLocalDelHistToRemoteFolder")r.existLocal&&await c(r.key),r.existRemote&&await i.deleteFromRemote(r.key,u,d),await hc(n,r.key,e);else if(r.decision==="keepRemoteDelHistFolder")r.existLocal&&await c(r.key),r.existRemote&&await i.deleteFromRemote(r.key,u,d),await hc(n,r.key,e);else if(r.decision!=="skipFolder"){if(r.decision!=="skipUploadingTooLarge"){if(r.decision!=="skipDownloadingTooLarge"){if(r.decision!=="skipUsingLocalDelTooLarge"){if(r.decision!=="skipUsingRemoteDelTooLarge")throw Error(`unknown decision in ${JSON.stringify(r)}`)}}}}}},h5e=(t,e)=>{let r=t.mixedStates,i=e.length||0,n=[],o=[],c=[],u=0;for(let d=0;d{if(d.length>0){ht.debug("some sizes are larger than the threshold, abort and show hints"),M(d);return}ht.debug(`concurrency === ${R}`);let{folderCreationOps:D,deletionOps:O,uploadDownloads:N,realTotalCount:L}=h5e(n,o),j=[D,O,N];ht.debug("folderCreationOps: ",D.length," deletionOps: ",O.length," uploadDownloads: ",N.length);let H=new zre({concurrency:R,autoStart:!0}),Y=0,W=0;H.on("completed",async J=>{J!==!0&&(W++,await I(W,Y))}),ht.debug("Checking if lastSynced is set: ",A,"== -1?: ",A==-1);let q=[];for(let J of j)for(let _ of J)if(_!=null)for(let s of _){let l=s.key,p=J===O;if(p===!1&&Y++,A==-1){let h=[".obsidian/app.json",".obsidian/appearance.json",".obsidian/core-plugins-migration.json",".obsidian/core-plugins.json",".obsidian/graph.json",".obsidian/workspace.json"];s.existRemote&&h.includes(l)&&(ht.debug("downloading from remote for first sync: ",l),s.decision="downloadRemoteToLocal")}H.add(async()=>await p5e(l,p,s,r,t,e,i,E,x)).catch(h=>{let b=`${l}: ${h.message}`;q.push(new Error(b)),q.length>=3&&(q.push(new Error("too many errors, stop the remaining tasks")),H.pause(),H.clear())})}if(await H.onIdle(),q.length>0)throw new Za(q);ht.debug("start syncing extra data lastly"),await r6(t,i,c,u,y,x),ht.debug("finish syncing extra data lastly")};var n6=class extends Ge.Modal{plugin;newPassword;constructor(e,r,i){super(e),this.plugin=r,this.newPassword=i}onOpen(){let{contentEl:e}=this,r=(i,n)=>this.plugin.i18n.t(i,n);e.createEl("h2",{text:r("modal_password_title")}),r("modal_password_shortdesc").split(` -`).forEach((i,n)=>{e.createEl("p",{text:i})}),[r("modal_password_attn1"),r("modal_password_attn2"),r("modal_password_attn3"),r("modal_password_attn4"),r("modal_password_attn5")].forEach((i,n)=>{n<3?e.createEl("p",{text:i,cls:"password-disclaimer"}):e.createEl("p",{text:i})}),new Ge.Setting(e).addButton(i=>{i.setButtonText(r("modal_password_secondconfirm")),i.onClick(async()=>{this.plugin.settings.password=this.newPassword,await this.plugin.saveSettings(),new Ge.Notice(r("modal_password_notice")),this.close()}),i.setClass("password-second-confirm")}).addButton(i=>{i.setButtonText(r("goback")),i.onClick(()=>{this.close()})})}onClose(){let{contentEl:e}=this;e.empty()}},Lg=class extends Ge.Modal{plugin;newRemoteBaseDir;service;constructor(e,r,i,n){super(e),this.plugin=r,this.newRemoteBaseDir=i,this.service=n}onOpen(){let{contentEl:e}=this,r=(i,n)=>this.plugin.i18n.t(i,n);e.createEl("h2",{text:r("modal_remotebasedir_title")}),r("modal_remotebasedir_shortdesc").split(` -`).forEach((i,n)=>{e.createEl("p",{text:i})}),this.newRemoteBaseDir===""||this.newRemoteBaseDir===this.app.vault.getName()?new Ge.Setting(e).addButton(i=>{i.setButtonText(r("modal_remotebasedir_secondconfirm_vaultname")),i.onClick(async()=>{this.plugin.settings[this.service].remoteBaseDir="",await this.plugin.saveSettings(),new Ge.Notice(r("modal_remotebasedir_notice")),this.close()}),i.setClass("remotebasedir-second-confirm")}).addButton(i=>{i.setButtonText(r("goback")),i.onClick(()=>{this.close()})}):n8(this.newRemoteBaseDir)?(e.createEl("p",{text:r("modal_remotebasedir_invaliddirhint")}),new Ge.Setting(e).addButton(i=>{i.setButtonText(r("goback")),i.onClick(()=>{this.close()})})):new Ge.Setting(e).addButton(i=>{i.setButtonText(r("modal_remotebasedir_secondconfirm_change")),i.onClick(async()=>{this.plugin.settings[this.service].remoteBaseDir=this.newRemoteBaseDir,this.plugin.settings.lastSynced=-1,await this.plugin.saveSettings(),new Ge.Notice(r("modal_remotebasedir_notice")),this.close()}),i.setClass("remotebasedir-second-confirm")}).addButton(i=>{i.setButtonText(r("goback")),i.onClick(()=>{this.close()})})}onClose(){let{contentEl:e}=this;e.empty()}},i6=class extends Ge.Modal{plugin;authDiv;revokeAuthDiv;revokeAuthSetting;constructor(e,r,i,n,o){super(e),this.plugin=r,this.authDiv=i,this.revokeAuthDiv=n,this.revokeAuthSetting=o}async onOpen(){let{contentEl:e}=this,r=(d,y)=>this.plugin.i18n.t(d,y),i=!1,n=window.navigator.userAgent.toLocaleLowerCase()||"";Ge.Platform.isDesktopApp&&!Ge.Platform.isMacOS&&(/linux/.test(n)||/ubuntu/.test(n)||/debian/.test(n)||/fedora/.test(n)||/centos/.test(n))&&(i=!0);let{authUrl:o,verifier:c}=await kU(this.plugin.settings.dropbox.clientID,i);if(i?r("modal_dropboxauth_manualsteps").split(` -`).forEach(d=>{e.createEl("p",{text:d})}):(this.plugin.oauth2Info.verifier=c,r("modal_dropboxauth_autosteps").split(` -`).forEach(d=>{e.createEl("p",{text:d})})),e.createDiv().createEl("button",{text:r("modal_dropboxauth_copybutton")},d=>{d.onclick=async()=>{await navigator.clipboard.writeText(o),new Ge.Notice(r("modal_dropboxauth_copynotice"))}}),e.createEl("p").createEl("a",{href:o,text:o}),i){let d="";new Ge.Setting(e).setName(r("modal_dropboxauth_maualinput")).setDesc(r("modal_dropboxauth_maualinput_desc")).addText(y=>y.setPlaceholder("").setValue("").onChange(E=>{d=E.trim()})).addButton(async y=>{y.setButtonText(r("submit")),y.onClick(async()=>{new Ge.Notice(r("modal_dropboxauth_maualinput_notice"));try{let E=await r_(this.plugin.settings.dropbox.clientID,c,d),x=this;u0(this.plugin.settings.dropbox,E,()=>x.plugin.saveSettings());let R=await new Qi("dropbox",void 0,void 0,this.plugin.settings.dropbox,void 0,this.app.vault.getName(),()=>x.plugin.saveSettings()).getUser();this.plugin.settings.dropbox.username=R,await this.plugin.saveSettings(),new Ge.Notice(r("modal_dropboxauth_maualinput_conn_succ",{username:R})),this.authDiv.toggleClass("dropbox-auth-button-hide",this.plugin.settings.dropbox.username!==""),this.revokeAuthDiv.toggleClass("dropbox-revoke-auth-button-hide",this.plugin.settings.dropbox.username===""),this.revokeAuthSetting.setDesc(r("modal_dropboxauth_maualinput_conn_succ_revoke",{username:this.plugin.settings.dropbox.username})),this.close()}catch(E){console.error(E),new Ge.Notice(r("modal_dropboxauth_maualinput_conn_fail"))}})})}}onClose(){let{contentEl:e}=this;e.empty()}},o6=class extends Ge.Modal{plugin;authDiv;revokeAuthDiv;revokeAuthSetting;constructor(e,r,i,n,o){super(e),this.plugin=r,this.authDiv=i,this.revokeAuthDiv=n,this.revokeAuthSetting=o}async onOpen(){let{contentEl:e}=this,{authUrl:r,verifier:i}=await rG(this.plugin.settings.onedrive.clientID,this.plugin.settings.onedrive.authority);this.plugin.oauth2Info.verifier=i;let n=(c,u)=>this.plugin.i18n.t(c,u);n("modal_onedriveauth_shortdesc").split(` -`).forEach(c=>{e.createEl("p",{text:c})}),e.createDiv().createEl("button",{text:n("modal_onedriveauth_copybutton")},c=>{c.onclick=async()=>{await navigator.clipboard.writeText(r),new Ge.Notice(n("modal_onedriveauth_copynotice"))}}),e.createEl("p").createEl("a",{href:r,text:r})}onClose(){let{contentEl:e}=this;e.empty()}},s6=class extends Ge.Modal{plugin;authDiv;revokeAuthDiv;constructor(e,r,i,n){super(e),this.plugin=r,this.authDiv=i,this.revokeAuthDiv=n}async onOpen(){let{contentEl:e}=this,r=(n,o)=>this.plugin.i18n.t(n,o);e.createEl("p",{text:r("modal_onedriverevokeauth_step1")});let i="https://microsoft.com/consent";e.createEl("p").createEl("a",{href:i,text:i}),e.createEl("p",{text:r("modal_onedriverevokeauth_step2")}),new Ge.Setting(e).setName(r("modal_onedriverevokeauth_clean")).setDesc(r("modal_onedriverevokeauth_clean_desc")).addButton(async n=>{n.setButtonText(r("modal_onedriverevokeauth_clean_button")),n.onClick(async()=>{try{this.plugin.settings.onedrive=JSON.parse(JSON.stringify(ng)),await this.plugin.saveSettings(),this.authDiv.toggleClass("onedrive-auth-button-hide",this.plugin.settings.onedrive.username!==""),this.revokeAuthDiv.toggleClass("onedrive-revoke-auth-button-hide",this.plugin.settings.onedrive.username===""),new Ge.Notice(r("modal_onedriverevokeauth_clean_notice")),this.close()}catch(o){console.error(o),new Ge.Notice(r("modal_onedriverevokeauth_clean_fail"))}})})}onClose(){let{contentEl:e}=this;e.empty()}},a6=class extends Ge.Modal{plugin;saveDropdownFunc;constructor(e,r,i){super(e),this.plugin=r,this.saveDropdownFunc=i}async onOpen(){let{contentEl:e}=this,r=(i,n)=>this.plugin.i18n.t(i,n);r("modal_syncconfig_attn").split(` -`).forEach(i=>{e.createEl("p",{text:i})}),new Ge.Setting(e).addButton(i=>{i.setButtonText(r("modal_syncconfig_secondconfirm")),i.onClick(async()=>{this.plugin.settings.syncConfigDir=!0,await this.plugin.saveSettings(),this.saveDropdownFunc(),new Ge.Notice(r("modal_syncconfig_notice")),this.close()})}).addButton(i=>{i.setButtonText(r("goback")),i.onClick(()=>{this.close()})})}onClose(){let{contentEl:e}=this;e.empty()}},c6=class extends Ge.Modal{plugin;constructor(e,r){super(e),this.plugin=r}async onOpen(){let{contentEl:e}=this,r=(d,y)=>this.plugin.i18n.t(d,y),{rawUri:i,imgUri:n}=await NO(this.plugin.settings,this.app.vault.getName(),this.plugin.manifest.version),o=e.createDiv();r("modal_qr_shortdesc").split(` -`).forEach(d=>{o.createEl("p",{text:d})}),e.createDiv().createEl("button",{text:r("modal_qr_button")},d=>{d.onclick=async()=>{await navigator.clipboard.writeText(i),new Ge.Notice(r("modal_qr_button_notice"))}}),e.createDiv().createEl("img",{cls:"qrcode-img"},async d=>{d.src=n})}onClose(){let{contentEl:e}=this;e.empty()}},Fg=t=>{let e=createSpan("Hi!"),r=t.inputEl.insertAdjacentElement("afterend",e);return(0,Ge.setIcon)(r,"eye-off"),r.addEventListener("click",i=>{let n=t.inputEl.getAttribute("type")==="text";(0,Ge.setIcon)(r,n?"eye-off":"eye"),t.inputEl.setAttribute("type",n?"password":"text"),t.inputEl.focus()}),t.inputEl.setAttribute("type","password"),t},wx=class extends Ge.PluginSettingTab{plugin;deletingRemoteMeta;constructor(e,r){super(e,r),this.plugin=r,this.deletingRemoteMeta=!1}display(){let{containerEl:e}=this;e.empty();let r=(f,h)=>this.plugin.i18n.t(f,h),i=e.createDiv();i.createEl("h2",{text:r("settings_chooseservice")});let n=e.createEl("div",{cls:"s3-hide"});n.toggleClass("s3-hide",this.plugin.settings.serviceType!=="s3"),n.createEl("h2",{text:r("settings_s3")});let o=n.createEl("div",{cls:"settings-long-desc"});for(let f of[r("settings_s3_disclaimer1"),r("settings_s3_disclaimer2")])o.createEl("p",{text:f,cls:"s3-disclaimer"});uo||o.createEl("p",{text:r("settings_s3_cors")}),o.createEl("p",{text:r("settings_s3_prod")});let c=o.createEl("ul");c.createEl("li").createEl("a",{href:"https://docs.aws.amazon.com/general/latest/gr/s3.html",text:r("settings_s3_prod1")}),c.createEl("li").createEl("a",{href:"https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/getting-your-credentials.html",text:r("settings_s3_prod2")}),uo||c.createEl("li").createEl("a",{href:"https://docs.aws.amazon.com/AmazonS3/latest/userguide/enabling-cors-examples.html",text:r("settings_s3_prod3")}),new Ge.Setting(n).setName(r("settings_s3_endpoint")).setDesc(r("settings_s3_endpoint")).addText(f=>f.setPlaceholder("").setValue(this.plugin.settings.s3.s3Endpoint).onChange(async h=>{this.plugin.settings.s3.s3Endpoint=h.trim(),await this.plugin.saveSettings()})),new Ge.Setting(n).setName(r("settings_s3_region")).setDesc(r("settings_s3_region_desc")).addText(f=>f.setPlaceholder("").setValue(`${this.plugin.settings.s3.s3Region}`).onChange(async h=>{this.plugin.settings.s3.s3Region=h.trim(),await this.plugin.saveSettings()})),new Ge.Setting(n).setName(r("settings_s3_accesskeyid")).setDesc(r("settings_s3_accesskeyid_desc")).addText(f=>{Fg(f),f.setPlaceholder("").setValue(`${this.plugin.settings.s3.s3AccessKeyID}`).onChange(async h=>{this.plugin.settings.s3.s3AccessKeyID=h.trim(),await this.plugin.saveSettings()})}),new Ge.Setting(n).setName(r("settings_s3_secretaccesskey")).setDesc(r("settings_s3_secretaccesskey_desc")).addText(f=>{Fg(f),f.setPlaceholder("").setValue(`${this.plugin.settings.s3.s3SecretAccessKey}`).onChange(async h=>{this.plugin.settings.s3.s3SecretAccessKey=h.trim(),await this.plugin.saveSettings()})}),new Ge.Setting(n).setName(r("settings_s3_bucketname")).setDesc(r("settings_s3_bucketname")).addText(f=>f.setPlaceholder("").setValue(`${this.plugin.settings.s3.s3BucketName}`).onChange(async h=>{this.plugin.settings.s3.s3BucketName=h.trim(),await this.plugin.saveSettings()})),new Ge.Setting(n).setName(r("settings_s3_urlstyle")).setDesc(r("settings_s3_urlstyle_desc")).addDropdown(f=>{f.addOption("virtualHostedStyle","Virtual Hosted-Style (default)"),f.addOption("pathStyle","Path-Style"),f.setValue(this.plugin.settings.s3.forcePathStyle?"pathStyle":"virtualHostedStyle").onChange(async h=>{this.plugin.settings.s3.forcePathStyle=h==="pathStyle",await this.plugin.saveSettings()})}),uo&&new Ge.Setting(n).setName(r("settings_s3_bypasscorslocally")).setDesc(r("settings_s3_bypasscorslocally_desc")).addDropdown(f=>{f.addOption("disable",r("disable")).addOption("enable",r("enable")),f.setValue(`${this.plugin.settings.s3.bypassCorsLocally?"enable":"disable"}`).onChange(async h=>{h==="enable"?this.plugin.settings.s3.bypassCorsLocally=!0:this.plugin.settings.s3.bypassCorsLocally=!1,await this.plugin.saveSettings()})}),new Ge.Setting(n).setName(r("settings_s3_parts")).setDesc(r("settings_s3_parts_desc")).addDropdown(f=>{f.addOption("1","1"),f.addOption("2","2"),f.addOption("3","3"),f.addOption("5","5"),f.addOption("10","10"),f.addOption("15","15"),f.addOption("20","20 (default)"),f.setValue(`${this.plugin.settings.s3.partsConcurrency}`).onChange(async h=>{let b=parseInt(h);this.plugin.settings.s3.partsConcurrency=b,await this.plugin.saveSettings()})}),new Ge.Setting(n).setName(r("settings_checkonnectivity")).setDesc(r("settings_checkonnectivity_desc")).addButton(async f=>{f.setButtonText(r("settings_checkonnectivity_button")),f.onClick(async()=>{new Ge.Notice(r("settings_checkonnectivity_checking"));let h=new Qi("s3",this.plugin.settings.s3),b={msg:""};await h.checkConnectivity(g=>{b.msg=g})?new Ge.Notice(r("settings_s3_connect_succ")):(new Ge.Notice(r("settings_s3_connect_fail")),new Ge.Notice(b.msg))})});let u=e.createEl("div",{cls:"dropbox-hide"});u.toggleClass("dropbox-hide",this.plugin.settings.serviceType!=="dropbox"),u.createEl("h2",{text:r("settings_dropbox")});let d=u.createEl("div",{cls:"settings-long-desc"});for(let f of[r("settings_dropbox_disclaimer1"),r("settings_dropbox_disclaimer2")])d.createEl("p",{text:f,cls:"dropbox-disclaimer"});d.createEl("p",{text:r("settings_dropbox_folder",{pluginID:this.plugin.manifest.id,remoteBaseDir:this.plugin.settings.dropbox.remoteBaseDir||this.app.vault.getName()})});let y=u.createDiv(),E=y.createDiv({cls:"dropbox-auth-button-hide settings-auth-related"}),x=y.createDiv({cls:"dropbox-revoke-auth-button-hide settings-auth-related"}),A=new Ge.Setting(x).setName(r("settings_dropbox_revoke")).setDesc(r("settings_dropbox_revoke_desc",{username:this.plugin.settings.dropbox.username})).addButton(async f=>{f.setButtonText(r("settings_dropbox_revoke_button")),f.onClick(async()=>{try{let h=this;await new Qi("dropbox",void 0,void 0,this.plugin.settings.dropbox,void 0,this.app.vault.getName(),()=>h.plugin.saveSettings()).revokeAuth(),this.plugin.settings.dropbox=JSON.parse(JSON.stringify(uh)),await this.plugin.saveSettings(),E.toggleClass("dropbox-auth-button-hide",this.plugin.settings.dropbox.username!==""),x.toggleClass("dropbox-revoke-auth-button-hide",this.plugin.settings.dropbox.username===""),new Ge.Notice(r("settings_dropbox_revoke_notice"))}catch(h){console.error(h),new Ge.Notice(r("settings_dropbox_revoke_noticeerr"))}})});new Ge.Setting(x).setName(r("settings_dropbox_clearlocal")).setDesc(r("settings_dropbox_clearlocal_desc")).addButton(async f=>{f.setButtonText(r("settings_dropbox_clearlocal_button")),f.onClick(async()=>{this.plugin.settings.dropbox=JSON.parse(JSON.stringify(uh)),await this.plugin.saveSettings(),E.toggleClass("dropbox-auth-button-hide",this.plugin.settings.dropbox.username!==""),x.toggleClass("dropbox-revoke-auth-button-hide",this.plugin.settings.dropbox.username===""),new Ge.Notice(r("settings_dropbox_clearlocal_notice"))})}),new Ge.Setting(E).setName(r("settings_dropbox_auth")).setDesc(r("settings_dropbox_auth_desc")).addButton(async f=>{f.setButtonText(r("settings_dropbox_auth_button")),f.onClick(async()=>{let h=new i6(this.app,this.plugin,E,x,A);this.plugin.oauth2Info.helperModal=h,this.plugin.oauth2Info.authDiv=E,this.plugin.oauth2Info.revokeDiv=x,this.plugin.oauth2Info.revokeAuthSetting=A,h.open()})}),E.toggleClass("dropbox-auth-button-hide",this.plugin.settings.dropbox.username!==""),x.toggleClass("dropbox-revoke-auth-button-hide",this.plugin.settings.dropbox.username==="");let R=this.plugin.settings.dropbox.remoteBaseDir||"";new Ge.Setting(u).setName(r("settings_remotebasedir")).setDesc(r("settings_remotebasedir_desc")).addText(f=>f.setPlaceholder(this.app.vault.getName()).setValue(R).onChange(h=>{R=h.trim()})).addButton(f=>{f.setButtonText(r("confirm")),f.onClick(()=>{new Lg(this.app,this.plugin,R,"dropbox").open()})}),new Ge.Setting(u).setName(r("settings_checkonnectivity")).setDesc(r("settings_checkonnectivity_desc")).addButton(async f=>{f.setButtonText(r("settings_checkonnectivity_button")),f.onClick(async()=>{new Ge.Notice(r("settings_checkonnectivity_checking"));let h=this,b=new Qi("dropbox",void 0,void 0,this.plugin.settings.dropbox,void 0,this.app.vault.getName(),()=>h.plugin.saveSettings()),w={msg:""};await b.checkConnectivity(a=>{w.msg=`${a}`})?new Ge.Notice(r("settings_dropbox_connect_succ")):(new Ge.Notice(r("settings_dropbox_connect_fail")),new Ge.Notice(w.msg))})});let M=e.createEl("div",{cls:"onedrive-hide"});M.toggleClass("onedrive-hide",this.plugin.settings.serviceType!=="onedrive"),M.createEl("h2",{text:r("settings_onedrive")});let I=M.createEl("div",{cls:"settings-long-desc"});for(let f of[r("settings_onedrive_disclaimer1"),r("settings_onedrive_disclaimer2")])I.createEl("p",{text:f,cls:"onedrive-disclaimer"});I.createEl("p",{text:r("settings_onedrive_folder",{pluginID:this.plugin.manifest.id,remoteBaseDir:this.plugin.settings.onedrive.remoteBaseDir||this.app.vault.getName()})}),I.createEl("p",{text:r("settings_onedrive_nobiz")});let D=M.createDiv(),O=D.createDiv({cls:"onedrive-auth-button-hide settings-auth-related"}),N=D.createDiv({cls:"onedrive-revoke-auth-button-hide settings-auth-related"}),L=new Ge.Setting(N).setName(r("settings_onedrive_revoke")).setDesc(r("settings_onedrive_revoke_desc",{username:this.plugin.settings.onedrive.username})).addButton(async f=>{f.setButtonText(r("settings_onedrive_revoke_button")),f.onClick(async()=>{new s6(this.app,this.plugin,O,N).open()})});new Ge.Setting(O).setName(r("settings_onedrive_auth")).setDesc(r("settings_onedrive_auth_desc")).addButton(async f=>{f.setButtonText(r("settings_onedrive_auth_button")),f.onClick(async()=>{let h=new o6(this.app,this.plugin,O,N,L);this.plugin.oauth2Info.helperModal=h,this.plugin.oauth2Info.authDiv=O,this.plugin.oauth2Info.revokeDiv=N,this.plugin.oauth2Info.revokeAuthSetting=L,h.open()})}),O.toggleClass("onedrive-auth-button-hide",this.plugin.settings.onedrive.username!==""),N.toggleClass("onedrive-revoke-auth-button-hide",this.plugin.settings.onedrive.username==="");let j=this.plugin.settings.onedrive.remoteBaseDir||"";new Ge.Setting(M).setName(r("settings_remotebasedir")).setDesc(r("settings_remotebasedir_desc")).addText(f=>f.setPlaceholder(this.app.vault.getName()).setValue(j).onChange(h=>{j=h.trim()})).addButton(f=>{f.setButtonText(r("confirm")),f.onClick(()=>{new Lg(this.app,this.plugin,j,"onedrive").open()})}),new Ge.Setting(M).setName(r("settings_checkonnectivity")).setDesc(r("settings_checkonnectivity_desc")).addButton(async f=>{f.setButtonText(r("settings_checkonnectivity_button")),f.onClick(async()=>{new Ge.Notice(r("settings_checkonnectivity_checking"));let h=this,b=new Qi("onedrive",void 0,void 0,void 0,this.plugin.settings.onedrive,this.app.vault.getName(),()=>h.plugin.saveSettings()),w={msg:""};await b.checkConnectivity(a=>{w.msg=`${a}`})?new Ge.Notice(r("settings_onedrive_connect_succ")):(new Ge.Notice(r("settings_onedrive_connect_fail")),new Ge.Notice(w.msg))})});let H=e.createEl("div",{cls:"webdav-hide"});H.toggleClass("webdav-hide",this.plugin.settings.serviceType!=="webdav"),H.createEl("h2",{text:r("settings_webdav")});let Y=H.createEl("div",{cls:"settings-long-desc"});Y.createEl("p",{text:r("settings_webdav_disclaimer1"),cls:"webdav-disclaimer"}),uo||(Y.createEl("p",{text:r("settings_webdav_cors_os")}),Y.createEl("p",{text:r("settings_webdav_cors")})),Y.createEl("p",{text:r("settings_webdav_folder",{remoteBaseDir:this.plugin.settings.webdav.remoteBaseDir||this.app.vault.getName()})}),new Ge.Setting(H).setName(r("settings_webdav_addr")).setDesc(r("settings_webdav_addr_desc")).addText(f=>f.setPlaceholder("").setValue(this.plugin.settings.webdav.address).onChange(async h=>{this.plugin.settings.webdav.address=h.trim(),(this.plugin.settings.webdav.depth==="auto_1"||this.plugin.settings.webdav.depth==="auto_infinity")&&(this.plugin.settings.webdav.depth="auto_unknown"),ax(this.plugin.settings.webdav),await this.plugin.saveSettings()})),new Ge.Setting(H).setName(r("settings_webdav_user")).setDesc(r("settings_webdav_user_desc")).addText(f=>{Fg(f),f.setPlaceholder("").setValue(this.plugin.settings.webdav.username).onChange(async h=>{this.plugin.settings.webdav.username=h.trim(),(this.plugin.settings.webdav.depth==="auto_1"||this.plugin.settings.webdav.depth==="auto_infinity")&&(this.plugin.settings.webdav.depth="auto_unknown"),await this.plugin.saveSettings()})}),new Ge.Setting(H).setName(r("settings_webdav_password")).setDesc(r("settings_webdav_password_desc")).addText(f=>{Fg(f),f.setPlaceholder("").setValue(this.plugin.settings.webdav.password).onChange(async h=>{this.plugin.settings.webdav.password=h.trim(),(this.plugin.settings.webdav.depth==="auto_1"||this.plugin.settings.webdav.depth==="auto_infinity")&&(this.plugin.settings.webdav.depth="auto_unknown"),await this.plugin.saveSettings()})}),new Ge.Setting(H).setName(r("settings_webdav_auth")).setDesc(r("settings_webdav_auth_desc")).addDropdown(async f=>{f.addOption("basic","basic"),uo&&f.addOption("digest","digest"),!uo&&this.plugin.settings.webdav.authType!=="basic"&&(this.plugin.settings.webdav.authType="basic",await this.plugin.saveSettings()),f.setValue(this.plugin.settings.webdav.authType).onChange(async h=>{this.plugin.settings.webdav.authType=h,await this.plugin.saveSettings()})}),new Ge.Setting(H).setName(r("settings_webdav_depth")).setDesc(r("settings_webdav_depth_desc")).addDropdown(f=>{f.addOption("auto",r("settings_webdav_depth_auto")),f.addOption("manual_1",r("settings_webdav_depth_1")),f.addOption("manual_infinity",r("settings_webdav_depth_inf"));let h="auto";new Set(["auto_unknown","auto_1","auto_infinity"]).has(this.plugin.settings.webdav.depth)?h="auto":h=this.plugin.settings.webdav.depth||"auto",f.setValue(h).onChange(async w=>{w==="auto"?(this.plugin.settings.webdav.depth="auto_unknown",this.plugin.settings.webdav.manualRecursive=!1):w==="manual_1"?(this.plugin.settings.webdav.depth="manual_1",this.plugin.settings.webdav.manualRecursive=!0):w==="manual_infinity"&&(this.plugin.settings.webdav.depth="manual_infinity",this.plugin.settings.webdav.manualRecursive=!1),ax(this.plugin.settings.webdav),await this.plugin.saveSettings()})});let W=this.plugin.settings.webdav.remoteBaseDir||"";new Ge.Setting(H).setName(r("settings_remotebasedir")).setDesc(r("settings_remotebasedir_desc")).addText(f=>f.setPlaceholder(this.app.vault.getName()).setValue(W).onChange(h=>{W=h.trim()})).addButton(f=>{f.setButtonText(r("confirm")),f.onClick(()=>{new Lg(this.app,this.plugin,W,"webdav").open()})}),new Ge.Setting(H).setName(r("settings_checkonnectivity")).setDesc(r("settings_checkonnectivity_desc")).addButton(async f=>{f.setButtonText(r("settings_checkonnectivity_button")),f.onClick(async()=>{new Ge.Notice(r("settings_checkonnectivity_checking"));let h=this,b=new Qi("webdav",void 0,this.plugin.settings.webdav,void 0,void 0,this.app.vault.getName(),()=>h.plugin.saveSettings()),w={msg:""};await b.checkConnectivity(a=>{w.msg=`${a}`})?new Ge.Notice(r("settings_webdav_connect_succ")):(uo?new Ge.Notice(r("settings_webdav_connect_fail")):new Ge.Notice(r("settings_webdav_connect_fail_withcors")),new Ge.Notice(w.msg))})}),new Ge.Setting(i).setName(r("settings_chooseservice")).setDesc(r("settings_chooseservice_desc")).addDropdown(async f=>{f.addOption("s3",r("settings_chooseservice_s3")),f.addOption("dropbox",r("settings_chooseservice_dropbox")),f.addOption("webdav",r("settings_chooseservice_webdav")),f.addOption("onedrive",r("settings_chooseservice_onedrive")),f.setValue(this.plugin.settings.serviceType).onChange(async h=>{this.plugin.settings.serviceType=h,n.toggleClass("s3-hide",this.plugin.settings.serviceType!=="s3"),u.toggleClass("dropbox-hide",this.plugin.settings.serviceType!=="dropbox"),M.toggleClass("onedrive-hide",this.plugin.settings.serviceType!=="onedrive"),H.toggleClass("webdav-hide",this.plugin.settings.serviceType!=="webdav"),await this.plugin.saveSettings()})});let q=e.createEl("div");q.createEl("h2",{text:r("settings_basic")});let J=`${this.plugin.settings.password}`;new Ge.Setting(q).setName(r("settings_password")).setDesc(r("settings_password_desc")).addText(f=>{Fg(f),f.setPlaceholder("").setValue(`${this.plugin.settings.password}`).onChange(async h=>{J=h.trim()})}).addButton(async f=>{f.setButtonText(r("confirm")),f.onClick(async()=>{new n6(this.app,this.plugin,J).open()})}),new Ge.Setting(q).setName(r("settings_saverun")).setDesc(r("settings_saverun_desc")).addDropdown(f=>{f.addOption("-1",r("settings_saverun_notset")),f.addOption("0",r("settings_saverun_instant")),f.addOption(`${1e3*5}`,r("settings_saverun_5sec")),f.addOption(`${1e3*10}`,r("settings_saverun_10sec")),f.addOption(`${1e3*30}`,r("settings_saverun_30sec")),f.addOption(`${1e3*60}`,r("settings_saverun_1min"));let h=!1;f.setValue(`${this.plugin.settings.syncOnSaveAfterMilliseconds}`).onChange(async b=>{let w=parseInt(b);this.plugin.settings.syncOnSaveAfterMilliseconds=w,await this.plugin.saveSettings(),w<0?this.plugin.toggleSyncOnSave(!1):this.plugin.toggleSyncOnSave(!0)})}),new Ge.Setting(q).setName(r("settings_remoterun")).setDesc(r("settings_remoterun_desc")).addDropdown(f=>{f.addOption("-1",r("settings_remoterun_notset")),f.addOption(`${1e3*1}`,r("settings_remoterun_1sec")),f.addOption(`${1e3*5}`,r("settings_remoterun_5sec")),f.addOption(`${1e3*10}`,r("settings_remoterun_10sec")),f.addOption(`${1e3*60}`,r("settings_remoterun_1min")),f.setValue(`${this.plugin.settings.syncOnRemoteChangesAfterMilliseconds}`).onChange(async h=>{let b=parseInt(h);this.plugin.settings.syncOnRemoteChangesAfterMilliseconds=b,await this.plugin.saveSettings(),b<=0?this.plugin.toggleSyncOnRemote(!1):this.plugin.toggleSyncOnRemote(!0)})}),new Ge.Setting(q).setName(r("settings_autorun")).setDesc(r("settings_autorun_desc")).addDropdown(f=>{f.addOption("-1",r("settings_autorun_notset")),f.addOption(`${1e3*5}`,r("settings_autorun_second",{time:5})),f.addOption(`${1e3*15}`,r("settings_autorun_second",{time:15})),f.addOption(`${1e3*30}`,r("settings_autorun_second",{time:30})),f.addOption(`${1e3*60}`,r("settings_autorun_1min")),f.addOption(`${1e3*60*5}`,r("settings_autorun_5min")),f.addOption(`${1e3*60*10}`,r("settings_autorun_10min")),f.addOption(`${1e3*60*30}`,r("settings_autorun_30min")),f.setValue(`${this.plugin.settings.autoRunEveryMilliseconds}`).onChange(async h=>{let b=parseInt(h);if(this.plugin.settings.autoRunEveryMilliseconds=b,await this.plugin.saveSettings(),(b==null||b<=0)&&this.plugin.autoRunIntervalID!==void 0)window.clearInterval(this.plugin.autoRunIntervalID),this.plugin.autoRunIntervalID=void 0;else if(b!=null&&b>0){let w=window.setInterval(()=>{this.plugin.syncRun("auto")},b);this.plugin.autoRunIntervalID=w,this.plugin.registerInterval(w)}})}),new Ge.Setting(q).setName(r("settings_runoncestartup")).setDesc(r("settings_runoncestartup_desc")).addDropdown(f=>{f.addOption("-1",r("settings_runoncestartup_notset")),f.addOption(`${1e3*1*1}`,r("settings_runoncestartup_1sec")),f.addOption(`${1e3*10*1}`,r("settings_runoncestartup_10sec")),f.addOption(`${1e3*30*1}`,r("settings_runoncestartup_30sec")),f.setValue(`${this.plugin.settings.initRunAfterMilliseconds}`).onChange(async h=>{let b=parseInt(h);this.plugin.settings.initRunAfterMilliseconds=b,await this.plugin.saveSettings()})}),new Ge.Setting(q).setName(r("settings_skiplargefiles")).setDesc(r("settings_skiplargefiles_desc")).addDropdown(f=>{f.addOption("-1",r("settings_skiplargefiles_notset"));let h=[1,5,10,50,100,500,1e3];for(let b of h)f.addOption(`${b*1e3*1e3}`,`${b} MB`);f.setValue(`${this.plugin.settings.skipSizeLargerThan}`).onChange(async b=>{this.plugin.settings.skipSizeLargerThan=parseInt(b),await this.plugin.saveSettings()})}),new Ge.Setting(q).setName(r("settings_enablestatusbar_info")).setDesc(r("settings_enablestatusbar_info_desc")).addToggle(f=>{f.setValue(this.plugin.settings.enableStatusBarInfo).onChange(async h=>{this.plugin.settings.enableStatusBarInfo=h,await this.plugin.saveSettings(),this.plugin.toggleStatusBar(h),_.toggleClass("remotely-sync-hidden",this.plugin.settings.enableStatusBarInfo!==!0)})});let _=q.createDiv({cls:"remotely-sync-hidden"});_.toggleClass("remotely-sync-hidden",this.plugin.settings.enableStatusBarInfo!==!0),new Ge.Setting(_).setName(r("settings_showlastsyncedonly")).setDesc(r("settings_showlastsyncedonly_desc")).addToggle(f=>{f.setValue(this.plugin.settings.showLastSyncedOnly).onChange(async h=>{this.plugin.settings.showLastSyncedOnly=h,await this.plugin.saveSettings(),this.plugin.toggleStatusBar(!0),this.plugin.toggleStatusBarObserver(h)})}),new Ge.Setting(q).setName(r("settings_trash_locally")).setDesc(r("settings_trash_locally_desc")).addToggle(f=>{f.setValue(this.plugin.settings.trashLocal).onChange(async h=>{this.plugin.settings.trashLocal=h,await this.plugin.saveSettings()})}),new Ge.Setting(q).setName(r("settings_sync_trash")).setDesc(r("settings_sync_trash_desc")).addToggle(f=>{f.setValue(this.plugin.settings.syncTrash).onChange(async h=>{this.plugin.settings.syncTrash=h,await this.plugin.saveSettings()})}),new Ge.Setting(q).setName(r("settings_sync_bookmarks")).setDesc(r("settings_sync_bookmarks_desc")).addToggle(f=>{f.setValue(this.plugin.settings.syncBookmarks).onChange(async h=>{this.plugin.settings.syncBookmarks=h,await this.plugin.saveSettings()})});let s=e.createEl("div");s.createEl("h2",{text:r("settings_adv")}),new Ge.Setting(s).setName(r("settings_concurrency")).setDesc(r("settings_concurrency_desc")).addDropdown(f=>{f.addOption("1","1"),f.addOption("2","2"),f.addOption("3","3"),f.addOption("5","5 (default)"),f.addOption("10","10"),f.addOption("15","15"),f.addOption("20","20"),f.setValue(`${this.plugin.settings.concurrency}`).onChange(async h=>{let b=parseInt(h);this.plugin.settings.concurrency=b,await this.plugin.saveSettings()})}),new Ge.Setting(s).setName(r("settings_syncunderscore")).setDesc(r("settings_syncunderscore_desc")).addDropdown(f=>{f.addOption("disable",r("disable")),f.addOption("enable",r("enable")),f.setValue(`${this.plugin.settings.syncUnderscoreItems?"enable":"disable"}`).onChange(async h=>{this.plugin.settings.syncUnderscoreItems=h==="enable",await this.plugin.saveSettings()})}),new Ge.Setting(s).setName(r("settings_configdir")).setDesc(r("settings_configdir_desc",{configDir:this.app.vault.configDir})).addDropdown(f=>{f.addOption("disable",r("disable")),f.addOption("enable",r("enable"));let h={secondConfirm:!1};f.setValue(`${this.plugin.settings.syncConfigDir?"enable":"disable"}`).onChange(async b=>{b==="enable"&&!h.secondConfirm?(f.setValue("disable"),new a6(this.app,this.plugin,()=>{h.secondConfirm=!0,f.setValue("enable")}).open()):(h.secondConfirm=!1,this.plugin.settings.syncConfigDir=!1,await this.plugin.saveSettings())})});let l=e.createEl("div");l.createEl("h2",{text:r("settings_importexport")}),new Ge.Setting(l).setName(r("settings_export")).setDesc(r("settings_export_desc")).addButton(async f=>{f.setButtonText(r("settings_export_desc_button")),f.onClick(async()=>{new c6(this.app,this.plugin).open()})}),new Ge.Setting(l).setName(r("settings_import")).setDesc(r("settings_import_desc"));let p=e.createEl("div");p.createEl("h2",{text:r("settings_debug")}),new Ge.Setting(p).setName(r("settings_debug_enabled")).setDesc(r("settings_debug_enabled_desc")).addDropdown(async f=>{f.addOption("disable",r("disable")),f.addOption("enable",r("enable")),f.setValue(this.plugin.settings.debugEnabled?"enable":"disable").onChange(async h=>{let b=h==="enable";this.plugin.settings.debugEnabled=b,b?ht.setLevel("debug"):ht.setLevel("info"),await this.plugin.saveSettings()})}),new Ge.Setting(p).setName(r("settings_outputsettingsconsole")).setDesc(r("settings_outputsettingsconsole_desc")).addButton(async f=>{f.setButtonText(r("settings_outputsettingsconsole_button")),f.onClick(async()=>{let h=sx(await this.plugin.loadData());new Ge.Notice(r("settings_outputsettingsconsole_notice")),console.log(h)})}),new Ge.Setting(p).setName(r("settings_syncplans")).setDesc(r("settings_syncplans_desc")).addButton(async f=>{f.setButtonText(r("settings_syncplans_button_json")),f.onClick(async()=>{await kp(this.plugin.db,this.app.vault,this.plugin.vaultRandomID,"json"),new Ge.Notice(r("settings_syncplans_notice"))})}).addButton(async f=>{f.setButtonText(r("settings_syncplans_button_table")),f.onClick(async()=>{await kp(this.plugin.db,this.app.vault,this.plugin.vaultRandomID,"table"),new Ge.Notice(r("settings_syncplans_notice"))})}),new Ge.Setting(p).setName(r("settings_delsyncplans")).setDesc(r("settings_delsyncplans_desc")).addButton(async f=>{f.setButtonText(r("settings_delsyncplans_button")),f.onClick(async()=>{await g8(this.plugin.db),new Ge.Notice(r("settings_delsyncplans_notice"))})}),new Ge.Setting(p).setName(r("settings_logtodb")).setDesc(r("settings_logtodb_desc")).addDropdown(async f=>{f.addOption("enable",r("enable")),f.addOption("disable",r("disable")),f.setValue(this.plugin.settings.logToDB?"enable":"disable").onChange(async h=>{let b=h==="enable";b?xy((...w)=>{Sy(this.plugin.db,this.plugin.vaultRandomID,...w)}):XO(),im(this.plugin.db),this.plugin.settings.logToDB=b,await this.plugin.saveSettings()})}),new Ge.Setting(p).setName(r("settings_logtodbexport")).setDesc(r("settings_logtodbexport_desc",{debugFolder:Ou})).addButton(async f=>{f.setButtonText(r("settings_logtodbexport_button")),f.onClick(async()=>{await ox(this.plugin.db,this.app.vault,this.plugin.vaultRandomID),new Ge.Notice(r("settings_logtodbexport_notice"))})}),new Ge.Setting(p).setName(r("settings_logtodbclear")).setDesc(r("settings_logtodbclear_desc")).addButton(async f=>{f.setButtonText(r("settings_logtodbclear_button")),f.onClick(async()=>{await b8(this.plugin.db),new Ge.Notice(r("settings_logtodbclear_notice"))})}),new Ge.Setting(p).setName(r("settings_delsyncmap")).setDesc(r("settings_delsyncmap_desc")).addButton(async f=>{f.setButtonText(r("settings_delsyncmap_button")),f.onClick(async()=>{await p8(this.plugin.db),new Ge.Notice(r("settings_delsyncmap_notice"))})}),new Ge.Setting(p).setName(r("settings_outputbasepathvaultid")).setDesc(r("settings_outputbasepathvaultid_desc")).addButton(async f=>{f.setButtonText(r("settings_outputbasepathvaultid_button")),f.onClick(async()=>{new Ge.Notice(this.plugin.getVaultBasePath()),new Ge.Notice(this.plugin.vaultRandomID)})}),new Ge.Setting(p).setName(r("settings_resetcache")).setDesc(r("settings_resetcache_desc")).addButton(async f=>{f.setButtonText(r("settings_reset_button")),f.onClick(async()=>{await u8(),new Ge.Notice(r("settings_resetcache_notice"))})}),new Ge.Setting(p).setName(r("settings_disable_s3_metadata_sync")).setDesc(r("settings_disable_s3_metadata_sync_desc")).addToggle(f=>{f.setValue(this.plugin.settings.s3.disableS3MetadataSync).onChange(async h=>{this.plugin.settings.s3.disableS3MetadataSync=h,await this.plugin.saveSettings(),new Ge.Notice(r("settings_enablestatusbar_reloadrequired_notice"))})}),new Ge.Setting(p).setName(r("settings_reset_sync_metadata")).setDesc(r("settings_reset_sync_metadata_desc")).addButton(async f=>{f.setButtonText(r("settings_reset_button")),f.onClick(async()=>{if(this.deletingRemoteMeta){new Ge.Notice(r("settings_reset_sync_metadata_notice_error"));return}new Ge.Notice(r("settings_reset_sync_metadata_notice_start")),ht.debug("Deleting remote metadata file. (1/2)"),this.deletingRemoteMeta=!0,await this.deleteRemoteMetadata(),await r6(this.getClient(),this.app.vault,void 0,void 0,[],this.plugin.settings.password),this.deletingRemoteMeta=!1,new Ge.Notice(r("settings_reset_sync_metadata_notice_end")),ht.debug("Remote metadata file deleted. (2/2)")})})}async deleteRemoteMetadata(){let e=this.getClient(),r=await e.listFromRemote(),i=await Op(r.Contents,e,this.plugin.settings.password);await e.deleteFromRemote(Lf,this.plugin.settings.password,i.remoteEncryptedKey)}getClient(){return new Qi(this.plugin.settings.serviceType,this.plugin.settings.s3,this.plugin.settings.webdav,this.plugin.settings.dropbox,this.plugin.settings.onedrive,this.app.vault.getName(),()=>this.plugin.saveSettings())}hide(){let{containerEl:e}=this;e.empty(),super.hide()}};m();m();var m5e=Object.prototype.toString,Np=Array.isArray||function(e){return m5e.call(e)==="[object Array]"};function l6(t){return typeof t=="function"}function g5e(t){return Np(t)?"array":typeof t}function u6(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Xre(t,e){return t!=null&&typeof t=="object"&&e in t}function y5e(t,e){return t!=null&&typeof t!="object"&&t.hasOwnProperty&&t.hasOwnProperty(e)}var v5e=RegExp.prototype.test;function b5e(t,e){return v5e.call(t,e)}var _5e=/\S/;function w5e(t){return!b5e(_5e,t)}var x5e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function E5e(t){return String(t).replace(/[&<>"'`=\/]/g,function(r){return x5e[r]})}var S5e=/\s*/,C5e=/\s+/,Zre=/\s*=/,A5e=/\s*\}/,T5e=/#|\^|\/|>|\{|&|=|!/;function M5e(t,e){if(!t)return[];var r=!1,i=[],n=[],o=[],c=!1,u=!1,d="",y=0;function E(){if(c&&!u)for(;o.length;)delete n[o.pop()];else o=[];c=!1,u=!1}var x,A,R;function M(q){if(typeof q=="string"&&(q=q.split(C5e,2)),!Np(q)||q.length!==2)throw new Error("Invalid tags: "+q);x=new RegExp(u6(q[0])+"\\s*"),A=new RegExp("\\s*"+u6(q[1])),R=new RegExp("\\s*"+u6("}"+q[1]))}M(e||zo.tags);for(var I=new Ug(t),D,O,N,L,j,H;!I.eos();){if(D=I.pos,N=I.scanUntil(x),N)for(var Y=0,W=N.length;Y"?j=[O,N,D,I.pos,d,y,r]:j=[O,N,D,I.pos],y++,n.push(j),O==="#"||O==="^")i.push(j);else if(O==="/"){if(H=i.pop(),!H)throw new Error('Unopened section "'+N+'" at '+D);if(H[1]!==N)throw new Error('Unclosed section "'+H[1]+'" at '+D)}else O==="name"||O==="{"||O==="&"?u=!0:O==="="&&M(N)}if(E(),H=i.pop(),H)throw new Error('Unclosed section "'+H[1]+'" at '+I.pos);return D5e(R5e(n))}function R5e(t){for(var e=[],r,i,n=0,o=t.length;n0?i[i.length-1][4]:e;break;default:r.push(n)}return e}function Ug(t){this.string=t,this.tail=t,this.pos=0}Ug.prototype.eos=function(){return this.tail===""};Ug.prototype.scan=function(e){var r=this.tail.match(e);if(!r||r.index!==0)return"";var i=r[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i};Ug.prototype.scanUntil=function(e){var r=this.tail.search(e),i;switch(r){case-1:i=this.tail,this.tail="";break;case 0:i="";break;default:i=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=i.length,i};function Pp(t,e){this.view=t,this.cache={".":this.view},this.parent=e}Pp.prototype.push=function(e){return new Pp(e,this)};Pp.prototype.lookup=function(e){var r=this.cache,i;if(r.hasOwnProperty(e))i=r[e];else{for(var n=this,o,c,u,d=!1;n;){if(e.indexOf(".")>0)for(o=n.view,c=e.split("."),u=0;o!=null&&u"?y=this.renderPartial(u,r,i,o):d==="&"?y=this.unescapedValue(u,r):d==="name"?y=this.escapedValue(u,r,o):d==="text"&&(y=this.rawValue(u)),y!==void 0&&(c+=y);return c};Pi.prototype.renderSection=function(e,r,i,n,o){var c=this,u="",d=r.lookup(e[1]);function y(A){return c.render(A,r,i,o)}if(!!d){if(Np(d))for(var E=0,x=d.length;E0||!i)&&(o[c]=n+o[c]);return o.join(` -`)};Pi.prototype.renderPartial=function(e,r,i,n){if(!!i){var o=this.getConfigTags(n),c=l6(i)?i(e[1]):i[e[1]];if(c!=null){var u=e[6],d=e[5],y=e[4],E=c;d==0&&y&&(E=this.indentPartial(c,y,u));var x=this.parse(E,o);return this.renderTokens(x,r,i,E,n)}}};Pi.prototype.unescapedValue=function(e,r){var i=r.lookup(e[1]);if(i!=null)return i};Pi.prototype.escapedValue=function(e,r,i){var n=this.getConfigEscape(i)||zo.escape,o=r.lookup(e[1]);if(o!=null)return typeof o=="number"&&n===zo.escape?String(o):n(o)};Pi.prototype.rawValue=function(e){return e[1]};Pi.prototype.getConfigTags=function(e){return Np(e)?e:e&&typeof e=="object"?e.tags:void 0};Pi.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Np(e))return e.escape};var zo={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){qg.templateCache=t},get templateCache(){return qg.templateCache}},qg=new Pi;zo.clearCache=function(){return qg.clearCache()};zo.parse=function(e,r){return qg.parse(e,r)};zo.render=function(e,r,i,n){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+g5e(e)+'" was given as the first argument for mustache#render(template, view, partials)');return qg.render(e,r,i,n)};zo.escape=E5e;zo.Scanner=Ug;zo.Context=Pp;zo.Writer=Pi;var ene=zo;var f6=require("obsidian");m();var tne={confirm:"Confirm",disable:"Disable",enable:"Enable",goback:"Go back",submit:"Submit",sometext:"Here are some texts.",syncrun_status_preparing:"Preparing...",syncrun_status_syncing:"Syncing",syncrun_status_progress:"Syncing ({{current}}/{{total}})",syncrun_alreadyrunning:"{{maxSteps}} Remotely Sync already running!",syncrun_debug_alreadyrunning:"Remotely Sync already running in stage: {{stage}}",syncrun_syncingribbon:"{{pluginName}}: syncing from {{triggerSource}}",syncrun_step0:"{{maxSteps}} Sync running in dry mode, no actual file changes will happen.",syncrun_step1:"{{maxSteps}} Starting sync! ({{serviceType}})",syncrun_step2:"{{maxSteps}} Fetching files on remote.",syncrun_step3:"{{maxSteps}} Checking the encryption password is correct.",syncrun_passworderr:"Something went wrong while checking the password.",syncrun_step4:"{{maxSteps}} Fetching remote metadata.",syncrun_step5:"{{maxSteps}} Fetching local metadata.",syncrun_step6:"{{maxSteps}} Generating sync plan.",syncrun_step7:"{{maxSteps}} Data exchanging!",syncrun_step7skip:"{{maxSteps}} Real sync is skipped in dry run mode.",syncrun_step8:"{{maxSteps}} Finished sync!",syncrun_abort:"{{manifestID}}-{{theDate}}: abort sync, triggerSource={{triggerSource}}, error while {{syncStatus}}",remote_changes_found:"Syncing remote changes...",remote_changes_synced:"Vault synced and up-to-date.",protocol_saveqr:"New not-oauth2 settings for {{manifestName}} saved. Reopen the plugin settings to the effect.",protocol_callbacknotsupported:"Your uri call a callback that's not supported yet: {{params}}",protocol_dropbox_connecting:`Connecting to Dropbox... -Please DO NOT close this modal.`,protocol_dropbox_connect_succ:"Good! We've connected to Dropbox as user {{username}}!",protocol_dropbox_connect_succ_revoke:"You've connected as user {{username}}. If you want to disconnect, click this button.",protocol_dropbox_connect_fail:"Something went wrong with the response from Dropbox. Maybe you rejected the auth?",protocol_dropbox_connect_unknown:"Do not know how to deal with the callback: {{params}}",protocol_onedrive_connecting:`Connecting to OneDrive... -Please DO NOT close this modal.`,protocol_onedrive_connect_succ_revoke:"You've connected as user {{username}}. If you want to disconnect, click this button.",protocol_onedrive_connect_fail:"Something went wrong with the response from OneDrive. Maybe you rejected the auth?",protocol_onedrive_connect_unknown:"Do not know how to deal with the callback: {{params}}",command_startsync:"Start sync",command_drynrun:"Start sync (dry run only)",command_exportsyncplans_json:"Export sync plans in json format",command_exportsyncplans_table:"Export sync plans in table format",command_exportlogsindb:"Export logs saved in db",command_syncstatus:"Get sync status",modal_password_title:"Hold on and PLEASE READ ON...",modal_password_shortdesc:`If the field is not empty, files would be encrypted locally before being uploaded. -If the field is empty, then files would be uploaded without encryption.`,modal_password_attn1:"Attention 1/5: The vault name is NOT encrypted. The plugin creates a folder with the vault name on some remote services.",modal_password_attn2:"Attention 2/5: The password itself is stored in PLAIN TEXT LOCALLY.",modal_password_attn3:"Attention 3/5: Some metadata are not encrypted or can be easily guessed. (File sizes are closed to their unencrypted ones, and directory path may be stored as 0-byte-size object.)",modal_password_attn4:"Attention 4/5: You should make sure the remote store IS EMPTY, or REMOTE FILES WERE ENCRYPTED BY THAT NEW PASSWORD, to avoid conflictions.",modal_password_attn5:"Attention 5/5: The longer the password, the better.",modal_password_secondconfirm:"The second confirm to change password.",modal_password_notice:"New password saved!",modal_remotebasedir_title:"You are changing the remote base directory config",modal_remotebasedir_shortdesc:`1. The plugin would NOT automatically move the content from the old directory to the new one directly on the remote. Everything syncs from the beginning again. -2. If you set the string to the empty, the config would be reset to use the vault folder name (the default config). -3. The remote directory name itself would not be encrypted even you've set an E2E password. -4. Some special char like '?', '/', '\\' are not allowed. Spaces in the beginning or in the end are also trimmed.`,modal_remotebasedir_invaliddirhint:"Your input contains special characters like '?', '/', '\\' which are not allowed.",modal_remotebasedir_secondconfirm_vaultname:"Reset to the default vault folder name",modal_remotebasedir_secondconfirm_change:"Confirm to change",modal_remotebasedir_notice:"New remote base directory config saved!",modal_dropboxauth_manualsteps:`Step 1: Visit the address in a browser, and follow the steps. -Step 2: In the end of the web flow, you obtain a long code. Paste it here then click "Submit".`,modal_dropboxauth_autosteps:`Visit the address in a browser, and follow the steps. -Finally you should be redirected to Obsidian.`,modal_dropboxauth_copybutton:"Click to copy the auth url",modal_dropboxauth_copynotice:"The auth url is copied to the clipboard!",modal_dropboxauth_maualinput:"Auth code from web page",modal_dropboxauth_maualinput_desc:'You need to click "Confirm".',modal_dropboxauth_maualinput_notice:"Trying to connect to Dropbox",modal_dropboxauth_maualinput_conn_succ:"Good! We've connected to Dropbox as user {{username}}!",modal_dropboxauth_maualinput_conn_succ_revoke:"You've connected as user {{username}}. If you want to disconnect, click this button.",modal_dropboxauth_maualinput_conn_fail:"Something went wrong while connecting to Dropbox.",modal_onedriveauth_shortdesc:`Visit the address in a browser, and follow the steps. -Finally you should be redirected to Obsidian.`,modal_onedriveauth_copybutton:"Click to copy the auth url",modal_onedriveauth_copynotice:"The auth url is copied to the clipboard!",modal_onedriverevokeauth_step1:'Step 1: Go to the following address, click the "Edit" button for the plugin, then click the "Remove these permissions" button on the page.',modal_onedriverevokeauth_step2:"Step 2: Click the button below to clean the locally-saved login credentials.",modal_onedriverevokeauth_clean:"Clean locally-saved login credentials",modal_onedriverevokeauth_clean_desc:"You need to click the button.",modal_onedriverevokeauth_clean_button:"Clean",modal_onedriverevokeauth_clean_notice:"Cleaned!",modal_onedriverevokeauth_clean_fail:"Something went wrong while revoking.",modal_syncconfig_attn:`Attention 1/3: This only syncs (copies) the whole Obsidian config dir, not other startting-with-dot folders or files. Except for ignoreing folders .git and node_modules, it also doesn't understand the meaning of sub-files and sub-folders inside the config dir. -Attention 2/3: After the config dir is synced, plugins settings might be corrupted, and Obsidian might need to be restarted to load the new settings. -Attention 3/3: The deletion (uninstallation) operations of or inside Obsidian config dir cannot be tracked. So if you want to uninstall a plugin, you need to manually uninstall it on all device, before next sync. -If you are agreed to take your own risk, please click the following second confirm button.`,modal_syncconfig_secondconfirm:"The second confirm to enable.",modal_syncconfig_notice:"You've enabled syncing config folder!",modal_qr_shortdesc:`This exports not-oauth2 settings. (It means that Dropbox, OneDrive info are NOT exported.) -You can use another device to scan this qrcode. -Or, you can click the button to copy the special url.`,modal_qr_button:"Click to copy the special URI",modal_qr_button_notice:"The special uri is copied to the clipboard!",modal_sizesconflict_title:"Remotely Sync: Some conflict were found while skipping large files",modal_sizesconflict_desc:`You've set skipping files larger than {{thresholdMB}} MB ({{thresholdBytes}} bytes). -But the following files have sizes larger than the threshold on one side, and sizes smaller than the threshold on the other side. -To avoid unexpected overwriting or deleting, the plugin stops, and you have to manually deal with at least one side of the files.`,modal_sizesconflict_copybutton:"Click to copy all the below sizes conflicts info",modal_sizesconflict_copynotice:"All the sizes conflicts info have been copied to the clipboard!",settings_basic:"Basic",settings_password:"Encryption password",settings_password_desc:'Password for E2E encryption. Empty for no password. You need to click "Confirm". Attention: the password and other info are saved locally.',settings_autorun:"Schedule for auto run",settings_autorun_desc:'The plugin trys to schedule the running after every interval. Battery may be impacted. May not work well with the "Sync on remote changes" setting.',settings_autorun_notset:"(Not set)",settings_autorun_second:"Every {{time}} seconds",settings_autorun_1min:"Every 1 minute",settings_autorun_5min:"Every 5 minutes",settings_autorun_10min:"Every 10 minutes",settings_autorun_30min:"Every 30 minutes",settings_saverun:"Sync on save",settings_saverun_desc:"The plugin will sync on file saves after the specified time. Battery may be impacted.",settings_saverun_notset:"(Not set)",settings_saverun_instant:"Instantly",settings_saverun_5sec:"After 5 seconds",settings_saverun_10sec:"After 10 seconds",settings_saverun_30sec:"After 30 seconds",settings_saverun_1min:"After 1 minute",settings_remoterun:"Sync on remote changes",settings_remoterun_desc:"Checks for syncs from other devices and runs a sync if found. Battery may be impacted.",settings_remoterun_notset:"(Not set)",settings_remoterun_1sec:"Every 1 second",settings_remoterun_5sec:"Every 5 seconds",settings_remoterun_10sec:"Every 10 seconds",settings_remoterun_1min:"Every 1 minute",settings_runoncestartup:"Run once on start up automatically",settings_runoncestartup_desc:'Will run a sync ONCE on start up automatically after the specified time. This will take effect on NEXT start up after changing. This setting, is different from "schedule for auto run" which starts syncing after EVERY interval.',settings_runoncestartup_notset:"(Not set)",settings_runoncestartup_1sec:"After 1 second",settings_runoncestartup_10sec:"After 10 seconds",settings_runoncestartup_30sec:"After 30 seconds",settings_skiplargefiles:"Skip large files (experimental)",settings_skiplargefiles_desc:"Skip files with sizes larger than the threshold. Here 1 MB = 10^6 bytes.",settings_skiplargefiles_notset:"(Not set)",settings_checkonnectivity:"Check connectivity",settings_checkonnectivity_desc:"Check connectivity.",settings_checkonnectivity_button:"Check",settings_checkonnectivity_checking:"Checking...",settings_remotebasedir:"Change the remote base directory (experimental)",settings_remotebasedir_desc:'By default the content is synced to a remote directory with the same name as the vault name. You can change the remote folder name here, or keep the input field empty to reset to the default. You need to click "Confirm".',settings_s3:"Remote for S3 or compatible",settings_s3_disclaimer1:"Disclaimer: This plugin is NOT an official Amazon product.",settings_s3_disclaimer2:"Disclaimer: The information is stored locally. Other malicious/harmful/faulty plugins could read the info. If you see any unintentional access to your bucket, please immediately delete the access key on your AWS (or other S3-service provider) settings.",settings_s3_cors:"You need to configure CORS to allow requests from origin app://obsidian.md and capacitor://localhost and http://localhost, and add ETag into exposed headers.",settings_s3_prod:"Some Amazon S3 official docs for references:",settings_s3_prod1:"Endpoint and region info",settings_s3_prod2:"Access key ID and secret access key info",settings_s3_prod3:"Configuring CORS",settings_s3_endpoint:"Endpoint",settings_s3_region:"Region",settings_s3_region_desc:"If you are not sure what to enter, you could try the value: us-east-1",settings_s3_accesskeyid:"Access key ID",settings_s3_accesskeyid_desc:"Access key ID. Attention: Access key ID and other info are saved locally.",settings_s3_secretaccesskey:"Secret access key",settings_s3_secretaccesskey_desc:"Secret access key. Attention: Secret access key and other info are saved locally.",settings_s3_bucketname:"Bucket name",settings_s3_bypasscorslocally:"Bypass CORS issue locally",settings_s3_bypasscorslocally_desc:"The plugin allows skipping server CORS config in new version of Obsidian ( desktop>=0.13.25 or iOS>=1.1.1 or Android>=1.2.1). If you encounter any issues, please disable this setting and config CORS on servers (allowing requests from app://obsidian.md and capacitor://localhost and http://localhost and add ETag into exposed headers).",settings_s3_parts:"Parts concurrency",settings_s3_parts_desc:"Large files are split into small parts to upload in S3. How many parts do you want to upload in parallel at most?",settings_s3_urlstyle:"S3 URL style",settings_s3_urlstyle_desc:"Whether to force path-style URLs for S3 objects (e.g., https://s3.amazonaws.com/*/ instead of https://*.s3.amazonaws.com/).",settings_s3_connect_succ:"Great! The bucket can be accessed.",settings_s3_connect_fail:"The S3 bucket cannot be reached.",settings_dropbox:"Remote for dropbox",settings_dropbox_disclaimer1:"Disclaimer: This app is NOT an official Dropbox product.",settings_dropbox_disclaimer2:"Disclaimer: The information is stored locally. Other malicious/harmful/faulty plugins could read the info. If you see any unintentional access to your Dropbox, please immediately disconnect this app on https://www.dropbox.com/account/connected_apps .",settings_dropbox_folder:"We will create and sync inside the folder /Apps/{{pluginID}}/{{remoteBaseDir}} on your Dropbox.",settings_dropbox_revoke:"Revoke auth",settings_dropbox_revoke_desc:"You've connected as user {{username}}. If you want to disconnect, click this button.",settings_dropbox_revoke_button:"Revoke auth",settings_dropbox_revoke_notice:"Revoked!",settings_dropbox_revoke_noticeerr:"Something goes wrong while revoking.",settings_dropbox_clearlocal:"Clear locally saved credentials",settings_dropbox_clearlocal_desc:"You can forcefully clear the locally saved Dropbox login credentials, but not send revoke auth request to the server.",settings_dropbox_clearlocal_button:"Clear",settings_dropbox_clearlocal_notice:"Cleared!",settings_dropbox_auth:"Auth",settings_dropbox_auth_desc:"Auth.",settings_dropbox_auth_button:"Auth",settings_dropbox_connect_succ:"Great! We can connect to Dropbox!",settings_dropbox_connect_fail:"We cannot connect to Dropbox.",settings_onedrive:"Remote for OneDrive (for personal)",settings_onedrive_disclaimer1:"Disclaimer: This app is NOT an official Microsoft / Onedrive product.",settings_onedrive_disclaimer2:"Disclaimer: The information is stored locally. Other malicious/harmful/faulty plugins could read the info. If you see any unintentional access to your Onedrive, please immediately disconnect this app on https://microsoft.com/consent .",settings_onedrive_folder:"We will create and sync inside the folder /Apps/{{pluginID}}/{{remoteBaseDir}} on your OneDrive.",settings_onedrive_nobiz:"Currently only OneDrive for personal is supported. OneDrive for Business is NOT supported (yet).",settings_onedrive_revoke:"Revoke auth",settings_onedrive_revoke_desc:"You've connected as user {{username}}. If you want to disconnect, click this button.",settings_onedrive_revoke_button:"Revoke auth",settings_onedrive_auth:"Auth",settings_onedrive_auth_desc:"Auth.",settings_onedrive_auth_button:"Auth",settings_onedrive_connect_succ:"Great! We can connect to OneDrive!",settings_onedrive_connect_fail:"We cannot connect to OneDrive.",settings_webdav:"Remote for WebDAV",settings_webdav_disclaimer1:"Disclaimer: The information is stored locally. Other malicious/harmful/faulty plugins may read the info. If you see any unintentional access to your webdav server, please immediately change the username and password.",settings_webdav_cors_os:"Obsidian desktop>=0.13.25 or iOS>=1.1.1 or Android>=1.2.1 supports bypassing CORS locally. But you are using an old version, and you're suggested to upgrade Obsidian.",settings_webdav_cors:"You need to configure CORS to allow requests from origin app://obsidian.md and capacitor://localhost and http://localhost",settings_webdav_folder:"We will create and sync inside the folder /{{remoteBaseDir}} on your server.",settings_webdav_addr:"Server address",settings_webdav_addr_desc:"Server address.",settings_webdav_user:"Username",settings_webdav_user_desc:"Username. Attention: The username and other info are saved locally.",settings_webdav_password:"Password",settings_webdav_password_desc:"Password. Attention: The password and other info are saved locally.",settings_webdav_auth:"Auth type",settings_webdav_auth_desc:"If no password, this option would be ignored.",settings_webdav_depth:"Depth header sent to servers",settings_webdav_depth_desc:`Webdav servers should be configured to allow requests with header Depth being '1' or 'Infinity'. The plugin needs to know this info. If you are not sure what's this, choose "auto".`,settings_webdav_depth_auto:"Auto detect",settings_webdav_depth_1:"Only supports depth='1'",settings_webdav_depth_inf:"Supports depth='infinity'",settings_webdav_connect_succ:"Great! The WebDAV server can be accessed.",settings_webdav_connect_fail:"The WebDAV server cannot be reached (possible to be any of address/username/password/authtype errors).",settings_webdav_connect_fail_withcors:"The WebDAV server cannot be reached (possible to be any of address/username/password/authtype/CORS errors).",settings_chooseservice:"Choose a remote service",settings_chooseservice_desc:"Start here. What service are you connecting to? S3, Dropbox, WebDAV, or OneDrive for personal?",settings_chooseservice_s3:"S3 or compatible",settings_chooseservice_dropbox:"Dropbox",settings_chooseservice_webdav:"WebDAV",settings_chooseservice_onedrive:"OneDrive for personal",settings_adv:"Advanced",settings_concurrency:"Concurrency",settings_concurrency_desc:"How many files do you want to download or upload in parallel at most? By default it's set to 5. If you meet any problems such as rate limit, you can reduce the concurrency to a lower value.",settings_syncunderscore:"Sync _ files or folders",settings_syncunderscore_desc:'Sync files or folders starting with _ ("underscore") or not',settings_sync_hash_files:"Use file hashing to track renamed files.",settings_sync_hash_files_desc:"Enables better tracking of renamed files outside of Obsidian.",settings_configdir:"Sync config dir (experimental)",settings_configdir_desc:"Sync config dir {{configDir}} or not (inner folder .git and node_modules would be ignored). Please be aware that this may impact all your plugins' or Obsidian's settings, and may require you restart Obsidian after sync. Enable this at your own risk.",settings_importexport:"Import and export partial settings",settings_export:"Export",settings_export_desc:"Export not-oauth2 settings by generating a qrcode.",settings_export_desc_button:"Get QR code",settings_import:"Import",settings_import_desc:"You should open a camera or scan-qrcode app, to manually scan the QR code.",settings_debug:"Debug",settings_debug_enabled:"Enable debug info",settings_debug_enabled_desc:'By default the debug information is not enabled ("false"). You can change to "true" to get verbose infomation in console and in sync messages.',settings_outputsettingsconsole:"Output current settings from disk to console",settings_outputsettingsconsole_desc:"The settings save on disk in encoded. Click this to see the decoded settings in console.",settings_outputsettingsconsole_button:"Output",settings_outputsettingsconsole_notice:"Finished outputing in console.",settings_syncplans:"Export sync plans",settings_syncplans_desc:"Sync plans are created every time after you trigger sync and before the actual sync. Useful to know what would actually happen in those sync. Click the button to export sync plans. You can choose to export to json or table format inside Markdown, which are equivalent.",settings_syncplans_button_json:"Export (json)",settings_syncplans_button_table:"Export (table)",settings_syncplans_notice:"Sync plans history exported.",settings_delsyncplans:"Delete sync plans history in DB",settings_delsyncplans_desc:"Delete sync plans history in DB.",settings_delsyncplans_button:"Delete sync plans history",settings_delsyncplans_notice:"Sync plans history (in DB) deleted.",settings_disable_s3_metadata_sync:"Disable S3 metadata sync",settings_disable_s3_metadata_sync_desc:"Prevents syncing modification time with S3 provider (compat. Alibaba Cloud)",settings_logtodb:"Save console logs into DB",settings_logtodb_desc:"Enable this to save all console logs into DB, so that we can export and read them later. Especially useful for mobile debugging. Has performance cost and may impact battery. The history is saved for at most 10000 records and 7 days old.",settings_logtodbexport:"Export console logs from DB",settings_logtodbexport_desc:"Export the saved console logs of this vault from DB into a new file in the folder {{&debugFolder}} .",settings_logtodbexport_button:"Export",settings_logtodbexport_notice:"Console logs of this vault from DB are exported!",settings_logtodbclear:"Delete all console logs in DB",settings_logtodbclear_desc:"Delete all the console logs saved inside DB. This setting applies to all saved logs for all vaults in this device.",settings_logtodbclear_button:"Delete",settings_logtodbclear_notice:"All console logs saved in DB are deleted!",settings_delsyncmap:"Delete sync mappings history in DB",settings_delsyncmap_desc:"Sync mappings history stores the actual LOCAL last modified time of the REMOTE objects. Clearing it may cause unnecessary data exchanges in next-time sync. Click the button to delete sync mappings history in DB.",settings_delsyncmap_button:"Delete sync mappings",settings_delsyncmap_notice:"Sync mappings history (in local DB) deleted",settings_outputbasepathvaultid:"Output vault base path and randomly assigned ID",settings_outputbasepathvaultid_desc:"For debugging purposes.",settings_outputbasepathvaultid_button:"Output",settings_reset_sync_metadata:"Reset sync metadata",settings_reset_sync_metadata_desc:"Lets you delete the metadata file stored remotely; will forget deleted files, so be sure to sync on all devices first.",settings_reset_sync_metadata_notice_start:"Deleting, please wait... (1/2)",settings_reset_sync_metadata_notice_end:"Remote metadata file deleted. (2/2)",settings_reset_sync_metadata_notice_error:"Already deleting, please wait.",settings_resetcache:"Reset local internal cache/databases",settings_resetcache_desc:"Reset local internal caches/databases (for debugging purposes). You would want to reload the plugin after resetting this. This option will not empty the {s3, password...} settings.",settings_reset_button:"Reset",settings_resetcache_notice:"Local internal cache/databases deleted. Please manually reload the plugin.",settings_enablestatusbar_info:"Show last successful sync in status bar",settings_enablestatusbar_info_desc:"Show the time of the last successful sync in the status bar.",settings_enablestatusbar_reloadrequired_notice:"Reload the plugin for the changes to take effect.",settings_trash_locally:"Move deleted files to Obsidian .trash folder",settings_trash_locally_desc:"If disabled will try to first move files to system trash. Only affects files deleted when syncing.",settings_sync_bookmarks:"Sync Obsidian bookmarks",settings_sync_bookmarks_desc:"Syncs your bookmarks between devices.",settings_sync_trash:"Sync .trash folder",settings_sync_trash_desc:"Helps if you use local trash instead of system trash when deleting files in your vault.",statusbar_time_years:"{{time}} years",statusbar_time_months:"{{time}} months",statusbar_time_weeks:"{{time}} weeks",statusbar_time_days:"{{time}} days",statusbar_time_hours:"{{time}} hours",statusbar_time_minutes:"{{time}} minutes",statusbar_time_lessminute:"less than a minute",statusbar_lastsync:"Synced {{time}} ago",statusbar_lastsync_label:"Last successful Sync on {{date}}",statusbar_lastsync_never:"Never Synced",statusbar_lastsync_never_label:"Never Synced before",syncalgov2_title:"Remotely Sync Agreement",syncalgov2_texts:`PLEASE BACKUP YOUR VAULT! -Welcome to Remotely Sync, a fork of Remotely Save with security upgrades! Before getting started, please note that this plugin is likely less stable than Remotely Save due to the new features that have not had as thorough testing. -Remotely Sync requires uploading extra metadata files to your configured cloud storage to allow additional devices to know what has been deleted. - If you do not agree with this, you can download version 0.2.14 or earlier of Remotely Save from GitHub. This version uses an old algorithm that does not upload any extra files. -By clicking the "Do Not Agree" button, the plugin will unload and you will need to disable it in the Obsidian settings. -Please click the "Agree" button to continue.`,settings_showlastsyncedonly:"Show only last synced in status bar",settings_showlastsyncedonly_desc:"Only shows the last synced and hides every other status bar element. This is best suited for mobile devices.",syncalgov2_button_agree:"Agree",syncalgov2_button_disagree:"Do not agree"};var rne={confirm:"\u786E\u8BA4",disable:"\u5173\u95ED",enable:"\u5F00\u542F",goback:"\u8FD4\u56DE",submit:"\u63D0\u4EA4",sometext:"\u8FD9\u91CC\u6709\u4E00\u6BB5\u6587\u5B57\u3002",syncrun_status_preparing:"\u51C6\u5907\u4E2D\u2026\u2026",syncrun_status_syncing:"\u540C\u6B65\u4E2D",syncrun_status_progress:"\u540C\u6B65\u4E2D ({{current}}/{{total}})",syncrun_alreadyrunning:"{{maxSteps}} Remotely Sync \u6B63\u5728\u8FD0\u884C\uFF01",syncrun_debug_alreadyrunning:"Remotely Sync \u6B63\u5904\u4E8E\u6B64\u9636\u6BB5\uFF1A{{stage}}",syncrun_syncingribbon:"{{pluginName}}\uFF1A\u6B63\u5728\u7531 {{triggerSource}} \u89E6\u53D1\u8FD0\u884C",syncrun_step0:"{{maxSteps}} Remotely Sync \u5728\u7A7A\u8DD1\uFF08dry run\uFF09\u6A21\u5F0F\uFF0C\u4E0D\u4F1A\u53D1\u751F\u5B9E\u9645\u7684\u6587\u4EF6\u4EA4\u6362\u3002",syncrun_step1:"{{maxSteps}} Remotely Sync \u51C6\u5907\u540C\u6B65\uFF08{{serviceType}}\uFF09",syncrun_step2:"{{maxSteps}} \u6B63\u5728\u83B7\u53D6\u8FDC\u7AEF\u7684\u5143\u6570\u636E\u3002",syncrun_step3:"{{maxSteps}} \u6B63\u5728\u68C0\u67E5\u5BC6\u7801\u6B63\u786E\u4E0E\u5426\u3002",syncrun_passworderr:"\u68C0\u67E5\u5BC6\u7801\u65F6\u5019\u51FA\u9519\u3002",syncrun_step4:"{{maxSteps}} \u6B63\u5728\u83B7\u53D6\u8FDC\u7AEF\u7684\u989D\u5916\u7684\u5143\u6570\u636E\u3002",syncrun_step5:"{{maxSteps}} \u6B63\u5728\u83B7\u53D6\u672C\u5730\u7684\u5143\u6570\u636E\u3002",syncrun_step6:"{{maxSteps}} \u6B63\u5728\u751F\u6210\u540C\u6B65\u8BA1\u5212\u3002",syncrun_step7:"{{maxSteps}} Remotely Sync \u5F00\u59CB\u53D1\u751F\u6570\u636E\u4EA4\u6362\uFF01",syncrun_step7skip:"{{maxSteps}} Remotely Sync \u5728\u7A7A\u8DD1\u6A21\u5F0F\uFF0C\u8DF3\u8FC7\u5B9E\u9645\u6570\u636E\u4EA4\u6362\u6B65\u9AA4\u3002",syncrun_step8:"{{maxSteps}} Remotely Sync \u5DF2\u5B8C\u6210\u540C\u6B65\uFF01",syncrun_abort:"{{manifestID}}-{{theDate}}\uFF1A\u4E2D\u65AD\u540C\u6B65\uFF0C\u540C\u6B65\u6765\u6E90={{triggerSource}}\uFF0C\u51FA\u9519\u9636\u6BB5={{syncStatus}}",remote_changes_found:"\u6B63\u5728\u540C\u6B65\u8FDC\u7A0B\u66F4\u6539\u2026\u2026",remote_changes_synced:"\u5E93\u5DF2\u540C\u6B65\u4E14\u5904\u4E8E\u6700\u65B0\u72B6\u6001\u3002",protocol_saveqr:" {{manifestName}} \u65B0\u7684\u975E oauth2 \u8BBE\u7F6E\u4FDD\u5B58\u5B8C\u6210\u3002\u8BF7\u91CD\u542F\u63D2\u4EF6\u8BBE\u7F6E\u9875\u4F7F\u4E4B\u751F\u6548\u3002",protocol_callbacknotsupported:"\u60A8\u7684 uri callback \u6682\u4E0D\u652F\u6301\uFF1A {{params}}",protocol_dropbox_connecting:`\u6B63\u5728\u8FDE\u63A5 Dropbox\u2026\u2026 -\u8BF7\u4E0D\u8981\u5173\u95ED\u6B64\u5F39\u7A97\u3002`,protocol_dropbox_connect_succ:"\u597D\uFF01\u6211\u4EEC\u4F5C\u4E3A\u7528\u6237 {{username}} \u8FDE\u63A5\u4E0A\u4E86 Dropbox\uFF01",protocol_dropbox_connect_succ_revoke:"\u60A8\u5DF2\u4F5C\u4E3A\u7528\u6237 {{username}} \u8FDE\u63A5\u4E0A\u4E86\u3002\u5982\u679C\u60A8\u60F3\u53D6\u6D88\u8FDE\u63A5\uFF0C\u8BF7\u70B9\u51FB\u6B64\u6309\u94AE\u3002",protocol_dropbox_connect_fail:"Dropbox \u7684\u56DE\u8C03\u8BF7\u6C42\u6709\u70B9\u5F02\u5E38\u3002\u60A8\u662F\u5426\u62D2\u7EDD\u4E86\u9274\u6743\uFF1F",protocol_dropbox_connect_unknown:"\u4E0D\u77E5\u9053\u5982\u4F55\u5904\u7406\u6B64 callback\uFF1A{{params}}",protocol_onedrive_connecting:`\u6B63\u5728\u8FDE\u63A5 OneDrive\u2026\u2026 -\u8BF7\u4E0D\u8981\u5173\u95ED\u6B64\u5F39\u7A97\u3002`,protocol_onedrive_connect_succ_revoke:"\u60A8\u5DF2\u4F5C\u4E3A\u7528\u6237 {{username}} \u8FDE\u63A5\u4E0A\u4E86\u3002\u5982\u679C\u60A8\u60F3\u53D6\u6D88\u8FDE\u63A5\uFF0C\u8BF7\u70B9\u51FB\u6B64\u6309\u94AE\u3002",protocol_onedrive_connect_fail:"OneDrive \u7684\u56DE\u8C03\u8BF7\u6C42\u6709\u70B9\u5F02\u5E38\u3002\u60A8\u662F\u5426\u62D2\u7EDD\u4E86\u9274\u6743\uFF1F",protocol_onedrive_connect_unknown:"\u4E0D\u77E5\u9053\u5982\u4F55\u5904\u7406\u6B64 callback\uFF1A{{params}}",command_startsync:"\u5F00\u59CB\u540C\u6B65\uFF08start sync\uFF09",command_drynrun:"\u5F00\u59CB\u540C\u6B65\uFF08\u7A7A\u8DD1\u6A21\u5F0F\uFF09\uFF08start sync (dry run only)\uFF09",command_exportsyncplans_json:"\u5BFC\u51FA\u540C\u6B65\u8BA1\u5212\u4E3A json \u683C\u5F0F\uFF08export sync plans in json format\uFF09",command_exportsyncplans_table:"\u5BFC\u51FA\u540C\u6B65\u8BA1\u5212\u4E3A\u8868\u683C\u683C\u5F0F\uFF08export sync plans in table format\uFF09",command_exportlogsindb:"\u4ECE\u6570\u636E\u5E93\u5BFC\u51FA\u7EC8\u7AEF\u65E5\u5FD7\uFF08export logs saved in db\uFF09",command_syncstatus:"\u83B7\u53D6\u540C\u6B65\u72B6\u6001",modal_password_title:"\u7A0D\u7B49\u4E00\u4E0B\uFF0C\u8BF7\u9605\u8BFB\u4E0B\u6587\uFF1A",modal_password_shortdesc:`\u5982\u679C\u5BC6\u7801\u4E0D\u662F\u7A7A\u7684\uFF0C\u90A3\u4E48\u6587\u4EF6\u4F1A\u5728\u4E0A\u4F20\u4E4B\u524D\uFF0C\u5728\u672C\u5730\u5148\u7528\u6B64\u5BC6\u7801\u52A0\u5BC6\u3002 -\u5982\u679C\u5BC6\u7801\u662F\u7A7A\u7684\uFF0C\u90A3\u4E48\u6587\u4EF6\u4F1A\u88AB\u975E\u52A0\u5BC6\u5730\u4E0A\u4F20\u3002`,modal_password_attn1:"\u6CE8\u610F 1/5\uFF1A\u5E93\uFF08Vault\uFF09\u540D\u5B57\u662F\u4E0D\u4F1A\u52A0\u5BC6\u7684\uFF01\u672C\u63D2\u4EF6\u4F1A\u5728\u4E00\u4E9B\u8FDC\u7A0B\u5B58\u50A8\u91CC\u521B\u5EFA\u4E00\u4E2A\u548C\u5E93\u540D\u5B57\u6709\u7740\u540C\u540D\u7684\u6587\u4EF6\u5939\u3002",modal_password_attn2:"\u6CE8\u610F 2/5\uFF1A\u5BC6\u7801\u5728\u672C\u5730\u4E0D\u52A0\u5BC6\u5730\u4FDD\u5B58\uFF01",modal_password_attn3:"\u6CE8\u610F 3/5\uFF1A\u4E00\u4E9B\u5143\u4FE1\u606F\u662F\u6CA1\u6709\u88AB\u52A0\u5BC6\u7684\uFF0C\u6216\u8005\u53EF\u4EE5\u88AB\u8F83\u5BB9\u6613\u5730\u731C\u6D4B\u51FA\u6765\u3002\uFF08\u6587\u4EF6\u5927\u5C0F\u5F88\u63A5\u8FD1\u4E8E\u6CA1\u52A0\u5BC6\u7684\u65F6\u5019\uFF0C\u4E14\u6587\u4EF6\u5939\u53EF\u80FD\u4F1A\u88AB\u5B58\u50A8\u4E3A\u5927\u5C0F\u4E3A 0 byte \u7684\u5BF9\u8C61\u3002\uFF09",modal_password_attn4:"\u6CE8\u610F 4/5\uFF1A\u60A8\u9700\u8981\u786E\u4FDD\u8FDC\u7A0B\u5B58\u50A8\u662F\u201C\u7A7A\u201D\u7684\uFF0C\u6216\u8005\u5DF2\u6709\u6587\u4EF6\u4E5F\u662F\u88AB\u540C\u4E00\u4E2A\u65B0\u5BC6\u7801\u52A0\u5BC6\u7684\uFF1B\u4ECE\u800C\u907F\u514D\u51B2\u7A81\u3002",modal_password_attn5:"\u6CE8\u610F 5/5\uFF1A\u5BC6\u7801\u8D8A\u957F\u8D8A\u597D\u3002",modal_password_secondconfirm:"\u518D\u6B21\u786E\u8BA4\u4FDD\u5B58\u65B0\u5BC6\u7801",modal_password_notice:"\u65B0\u5BC6\u7801\u5DF2\u4FDD\u5B58\uFF01",modal_remotebasedir_title:"\u60A8\u6B63\u5728\u4FEE\u6539\u8FDC\u7AEF\u57FA\u6587\u4EF6\u5939\u8BBE\u7F6E",modal_remotebasedir_shortdesc:`1. \u672C\u63D2\u4EF6\u5E76\u4E0D\u4F1A\u81EA\u52A8\u5728\u8FDC\u7AEF\u628A\u5185\u5BB9\u4ECE\u65E7\u6587\u4EF6\u5939\u79FB\u52A8\u5230\u65B0\u6587\u4EF6\u5939\u3002\u6240\u6709\u5185\u5BB9\u90FD\u4F1A\u91CD\u65B0\u540C\u6B65\u3002 -2. \u5982\u679C\u4F60\u4F7F\u5F97\u6587\u672C\u8F93\u5165\u6846\u4E3A\u7A7A\uFF0C\u90A3\u4E48\u672C\u8BBE\u7F6E\u4F1A\u88AB\u91CD\u8BBE\u56DE\u5E93\u7684\u6587\u4EF6\u5939\u540D\uFF08\u9ED8\u8BA4\u8BBE\u7F6E\uFF09\u3002 -3. \u5373\u4F7F\u60A8\u8BBE\u7F6E\u4E86\u7AEF\u5BF9\u7AEF\u52A0\u5BC6\u7684\u5BC6\u7801\uFF0C\u8FDC\u7AEF\u6587\u4EF6\u5939\u540D\u79F0\u672C\u8EAB\u4E5F\u4E0D\u4F1A\u88AB\u52A0\u5BC6\u3002 -4. \u67D0\u4E9B\u7279\u6B8A\u5B57\u7B26\uFF0C\u5982\u201C?\u201D\u3001\u201C/\u201D\u3001\u201C\\\u201D\u662F\u4E0D\u5141\u8BB8\u7684\u3002\u6587\u672C\u524D\u540E\u7684\u7A7A\u683C\u4E5F\u4F1A\u88AB\u81EA\u52A8\u5220\u53BB\u3002`,modal_remotebasedir_invaliddirhint:"\u60A8\u6240\u8F93\u5165\u7684\u5185\u5BB9\u542B\u6709\u67D0\u4E9B\u7279\u6B8A\u5B57\u7B26\uFF0C\u5982\u201C?\u201D\u3001\u201C/\u201D\u3001\u201C\\\u201D\uFF0C\u5B83\u4EEC\u662F\u4E0D\u5141\u8BB8\u7684\u3002",modal_remotebasedir_secondconfirm_vaultname:"\u91CD\u8BBE\u56DE\u9ED8\u8BA4\u7684\u5E93\u6587\u4EF6\u5939\u540D",modal_remotebasedir_secondconfirm_change:"\u786E\u8BA4\u4FEE\u6539",modal_remotebasedir_notice:"\u65B0\u7684\u8FDC\u7AEF\u57FA\u6587\u4EF6\u5939\u8BBE\u7F6E\u5DF2\u4FDD\u5B58\uFF01",modal_dropboxauth_manualsteps:`\u7B2C 1 \u6B65\uFF1A\u5728\u6D4F\u89C8\u5668\u4E2D\u8BBF\u95EE\u4EE5\u4E0B\u5730\u5740\uFF0C\u7136\u540E\u6309\u7167\u7F51\u9875\u63D0\u793A\u64CD\u4F5C\u3002 -\u5230\u4E86\u6700\u540E\uFF0C\u60A8\u5E94\u8BE5\u4F1A\u83B7\u5F97\u4E00\u4E32\u5F88\u957F\u7684\u4EE3\u7801\u6587\u672C\uFF0C\u8BF7\u590D\u5236\u7C98\u8D34\u5230\u4E0B\u65B9\uFF0C\u5E76\u70B9\u51FB\u201C\u63D0\u4EA4\u201D`,modal_dropboxauth_autosteps:`\u5728\u6D4F\u89C8\u5668\u4E2D\u8BBF\u95EE\u4EE5\u4E0B\u5730\u5740\uFF0C\u7136\u540E\u6309\u7167\u7F51\u9875\u63D0\u793A\u64CD\u4F5C\u3002 -\u5230\u4E86\u6700\u540E\uFF0C\u60A8\u5E94\u8BE5\u4F1A\u88AB\u81EA\u52A8\u91CD\u5B9A\u5411\u56DE\u6765 Obsidian\u3002`,modal_dropboxauth_copybutton:"\u70B9\u51FB\u6B64\u6309\u94AE\u4ECE\u800C\u590D\u5236\u9274\u6743 url",modal_dropboxauth_copynotice:"\u9274\u6743 url \u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F\uFF01",modal_dropboxauth_maualinput:"\u6765\u81EA\u7F51\u9875\u7684\u6388\u6743\u7801",modal_dropboxauth_maualinput_desc:"\u60A8\u9700\u8981\u70B9\u51FB\u201C\u786E\u8BA4\u201D",modal_dropboxauth_maualinput_notice:"\u6B63\u5728\u5C1D\u8BD5\u8FDE\u63A5 Dropbox",modal_dropboxauth_maualinput_conn_succ:"\u5F88\u597D\uFF01\u6211\u4EEC\u4F5C\u4E3A\u7528\u6237 {{username}} \u8FDE\u63A5\u5230 Dropbox \u4E86\uFF01",modal_dropboxauth_maualinput_conn_succ_revoke:"\u60A8\u5DF2\u4F5C\u4E3A\u7528\u6237 {{username}} \u8FDE\u63A5\u5230 Dropbox\u3002\u5982\u679C\u60A8\u60F3\u65AD\u5F00\u8FDE\u63A5\uFF0C\u70B9\u51FB\u6B64\u6309\u94AE\u3002",modal_dropboxauth_maualinput_conn_fail:"\u8FDE\u63A5 Dropbox \u9014\u4E2D\u51FA\u9519\u4E86\u3002",modal_onedriveauth_shortdesc:`\u5728\u6D4F\u89C8\u5668\u4E2D\u8BBF\u95EE\u4EE5\u4E0B\u5730\u5740\uFF0C\u7136\u540E\u6309\u7167\u7F51\u9875\u63D0\u793A\u64CD\u4F5C\u3002 -\u5230\u4E86\u6700\u540E\uFF0C\u60A8\u5E94\u8BE5\u4F1A\u88AB\u81EA\u52A8\u91CD\u5B9A\u5411\u56DE\u6765 Obsidian\u3002`,modal_onedriveauth_copybutton:"\u70B9\u51FB\u6B64\u6309\u94AE\u4ECE\u800C\u590D\u5236\u9274\u6743 url",modal_onedriveauth_copynotice:"\u9274\u6743 url \u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F\uFF01",modal_onedriverevokeauth_step1:"\u7B2C 1 \u6B65\uFF1A\u7528\u6D4F\u89C8\u5668\u6253\u5F00\u4EE5\u4E0B\u5730\u5740\uFF0C\u70B9\u51FB\u672C\u63D2\u4EF6\u5BF9\u5E94\u7684\u201CEdit\u201D\u6309\u94AE\uFF0C\u70B9\u51FB\u201CRemove these permissions\u201D\u6309\u94AE\u3002",modal_onedriverevokeauth_step2:"\u7B2C 2 \u6B65\uFF1A\u70B9\u51FB\u4EE5\u4E0B\u6309\u94AE\uFF0C\u6E05\u7406\u672C\u5730\u4FDD\u5B58\u7684\u767B\u5F55\u4FE1\u606F\u3002",modal_onedriverevokeauth_clean:"\u6E05\u7406\u672C\u5730\u4FDD\u5B58\u7684\u767B\u5F55\u4FE1\u606F",modal_onedriverevokeauth_clean_desc:"\u60A8\u9700\u8981\u70B9\u51FB\u201C\u6E05\u7406\u201D\u6309\u94AE\u3002",modal_onedriverevokeauth_clean_button:"\u6E05\u7406",modal_onedriverevokeauth_clean_notice:"\u5DF2\u6E05\u7406\uFF01",modal_onedriverevokeauth_clean_fail:"\u9274\u6743\u9014\u4E2D\u51FA\u9519\u4E86\u3002",modal_syncconfig_attn:`\u6CE8\u610F 1/3\uFF1A\u6B64\u8BBE\u7F6E\u53EA\u540C\u6B65\uFF08\u590D\u5236\uFF09\u6574\u4E2A Obsidian \u7684\u914D\u7F6E\u6587\u4EF6\u5939\uFF0C\u4F46\u662F\u4E0D\u4F1A\u540C\u6B65\u5176\u5B83 . \u5F00\u5934\u7684\u6587\u4EF6\u5939\u6216\u6587\u4EF6\u3002\u9664\u4E86\u4F1A\u5FFD\u7565 .git \u548C node_modules \u6587\u4EF6\u5939\u4E4B\u5916\uFF0C\u5B83\u4E5F\u5E76\u4E0D\u7406\u89E3\u914D\u7F6E\u6587\u4EF6\u5939\u7684\u91CC\u5404\u4E2A\u5B50\u6587\u4EF6\u6216\u5B50\u6587\u4EF6\u5939\u7684\u542B\u4E49\u3002 -\u6CE8\u610F 2/3\uFF1A\u914D\u7F6E\u6587\u4EF6\u5939\u88AB\u540C\u6B65\u4E4B\u540E\uFF0C\u5404\u63D2\u4EF6\u7684\u8BBE\u7F6E\u6216\u8BB8\u4F1A\u51FA\u9519\uFF0C\u4E14 Obsidian \u6216\u8BB8\u9700\u8981\u91CD\u542F\u6765\u91CD\u8F7D\u5404\u63D2\u4EF6\u7684\u65B0\u914D\u7F6E\u3002 -\u6CE8\u610F 3/3\uFF1A\u914D\u7F6E\u6587\u4EF6\u5939\u5185\u7684\u5220\u9664\uFF08\u5378\u8F7D\uFF09\u64CD\u4F5C\u65E0\u6CD5\u88AB\u8BC6\u522B\uFF0C\u56E0\u6B64\uFF0C\u5982\u679C\u60A8\u60F3\u5378\u8F7D\u4E00\u4E2A\u63D2\u4EF6\uFF0C\u5728\u4E0B\u4E00\u6B21\u540C\u6B65\u4E4B\u524D\uFF0C\u60A8\u9700\u8981\u624B\u52A8\u5728\u6240\u6709\u8BBE\u5907\u4E0A\u5148\u624B\u52A8\u5378\u8F7D\u90A3\u4E2A\u63D2\u4EF6\u3002 -\u5982\u679C\u60A8\u540C\u610F\u81EA\u884C\u627F\u53D7\u4EE5\u4E0A\u98CE\u9669\uFF0C\u60A8\u53EF\u4EE5\u70B9\u51FB\u4EE5\u4E0B\u518D\u6B21\u786E\u8BA4\u6309\u94AE\u3002`,modal_syncconfig_secondconfirm:"\u518D\u6B21\u786E\u8BA4\u5F00\u542F",modal_syncconfig_notice:"\u60A8\u5DF2\u5F00\u542F\u914D\u7F6E\u6587\u4EF6\u5939\u7684\u540C\u6B65\uFF01",modal_qr_shortdesc:`\u8FD9\u91CC\u53EF\u5BFC\u51FA\u975E oauth2 \u8BBE\u7F6E\u3002\uFF08\u610F\u5473\u7740\uFF1ADropbox \u548C OneDrive \u4FE1\u606F\u4E0D\u4F1A\u88AB\u5BFC\u51FA\u3002\uFF09 -\u60A8\u53EF\u4EE5\u4F7F\u7528\u53E6\u4E00\u4E2A\u8BBE\u5907\u6765\u626B\u63CF\u6B64 QR \u7801\u3002 -\u53C8\u6216\u8005\uFF0C\u60A8\u53EF\u4EE5\u70B9\u51FB\u4EE5\u4E0B\u6309\u94AE\u590D\u5236\u6B64\u7279\u6B8A URI\u3002`,modal_qr_button:"\u70B9\u51FB\u6B64\u6309\u94AE\u590D\u5236\u7279\u6B8A URI",modal_qr_button_notice:"\u7279\u6B8A URI \u5DF2\u88AB\u590D\u5236\u5230\u526A\u8D34\u677F\uFF01",modal_sizesconflict_title:"Remotely Sync\uFF1A\u8DF3\u8FC7\u5927\u6587\u4EF6\u7684\u65F6\u5019\u51FA\u73B0\u4E86\u4E00\u4E9B\u51B2\u7A81",modal_sizesconflict_desc:`\u60A8\u8BBE\u7F6E\u4E86\u8DF3\u8FC7\u540C\u6B65\u5927\u4E8E {{thresholdMB}} MB\uFF08{{thresholdBytes}} bytes\uFF09\u7684\u6587\u4EF6\u3002 -\u4F46\u662F\u4EE5\u4E0B\u6587\u4EF6\u7684\u5927\u5C0F\uFF0C\u5728\u4E00\u7AEF\u5927\u4E8E\u9608\u503C\uFF0C\u5728\u53E6\u4E00\u7AEF\u5219\u5C0F\u4E8E\u9608\u503C\u3002 -\u4E3A\u4E86\u907F\u514D\u610F\u5916\u7684\u8986\u76D6\u6216\u5220\u9664\uFF0C\u63D2\u4EF6\u505C\u6B62\u4E86\u8FD0\u4F5C\uFF0C\u60A8\u9700\u8981\u624B\u52A8\u5904\u7406\u81F3\u5C11\u4E00\u7AEF\u7684\u6587\u4EF6\u3002`,modal_sizesconflict_copybutton:"\u70B9\u51FB\u4EE5\u590D\u5236\u4EE5\u4E0B\u6240\u6709\u6587\u4EF6\u5927\u5C0F\u51B2\u7A81\u4FE1\u606F",modal_sizesconflict_copynotice:"\u6240\u6709\u7684\u6587\u4EF6\u5927\u5C0F\u51B2\u7A81\u4FE1\u606F\uFF0C\u5DF2\u88AB\u590D\u5236\u5230\u526A\u8D34\u677F\uFF01",settings_basic:"\u57FA\u672C\u8BBE\u7F6E",settings_password:"\u5BC6\u7801",settings_password_desc:"\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u5BC6\u7801\u3002\u4E0D\u586B\u5199\u5219\u4EE3\u8868\u6CA1\u5BC6\u7801\u3002\u60A8\u9700\u8981\u70B9\u51FB\u201C\u786E\u8BA4\u201D\u6765\u4FEE\u6539\u3002\u6CE8\u610F\uFF1A\u5BC6\u7801\u548C\u5176\u5B83\u4FE1\u606F\u90FD\u4F1A\u5728\u672C\u5730\u4FDD\u5B58\u3002",settings_autorun:"\u81EA\u52A8\u8FD0\u884C",settings_autorun_desc:"\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4\uFF0C\u6B64\u63D2\u4EF6\u5C1D\u8BD5\u81EA\u52A8\u540C\u6B65\u3002\u4F1A\u5F71\u54CD\u5230\u7535\u6C60\u7528\u91CF\u3002\uFF08\u53EF\u80FD\u65E0\u6CD5\u4E0E\u201C\u8FDC\u7A0B\u66F4\u6539\u65F6\u540C\u6B65\u201D\u914D\u5408\u4F7F\u7528\uFF09",settings_autorun_notset:"\uFF08\u4E0D\u8BBE\u7F6E\uFF09",settings_autorun_second:"\u6BCF {{time}} \u79D2",settings_autorun_1min:"\u6BCF 1 \u5206\u949F",settings_autorun_5min:"\u6BCF 5 \u5206\u949F",settings_autorun_10min:"\u6BCF 10 \u5206\u949F",settings_autorun_30min:"\u6BCF 30 \u5206\u949F",settings_saverun:"\u4FDD\u5B58\u65F6\u540C\u6B65",settings_saverun_desc:"\u6587\u4EF6\u4FDD\u5B58\u540E\uFF0C\u63D2\u4EF6\u5C06\u5728\u6307\u5B9A\u65F6\u95F4\u540E\u540C\u6B65\u3002\u4F1A\u5F71\u54CD\u5230\u7535\u6C60\u7528\u91CF\u3002",settings_saverun_notset:"\uFF08\u4E0D\u8BBE\u7F6E\uFF09",settings_saverun_instant:"\u7ACB\u5373",settings_saverun_5sec:"5\u79D2\u540E",settings_saverun_10sec:"10\u79D2\u540E",settings_saverun_30sec:"30\u79D2\u540E",settings_saverun_1min:"1\u5206\u949F\u540E",settings_remoterun:"\u8FDC\u7A0B\u66F4\u6539\u65F6\u540C\u6B65",settings_remoterun_desc:"\u63D2\u4EF6\u4F1A\u5728\u6BCF\u4E2A\u6587\u4EF6\u4FDD\u5B58\u540E\u5C1D\u8BD5\u540C\u6B65\u3002\u4F1A\u5F71\u54CD\u5230\u7535\u6C60\u7528\u91CF\u3002\uFF08\u66F4\u6539\u540E\u53EF\u80FD\u9700\u8981\u91CD\u542F\uFF09",settings_remoterun_notset:"\uFF08\u4E0D\u8BBE\u7F6E\uFF09",settings_remoterun_1sec:"\u6BCF1\u79D2",settings_remoterun_5sec:"\u6BCF5\u79D2",settings_remoterun_10sec:"\u6BCF10\u79D2",settings_remoterun_1min:"\u6BCF1\u5206\u949F",settings_runoncestartup:"\u542F\u52A8\u540E\u81EA\u52A8\u8FD0\u884C\u4E00\u6B21",settings_runoncestartup_desc:"\u672C\u8BBE\u7F6E\u4F7F\u5F97\u63D2\u4EF6\u5728\u7A0B\u5E8F\u542F\u52A8\u540E\u81EA\u52A8\u89E6\u53D1\u4E00\u6B21\u540C\u6B65\u3002\u4FEE\u6539\u540E\uFF0C\u4F1A\u5728\u4E0B\u4E00\u6B21\u542F\u52A8\u751F\u6548\u3002\u672C\u8BBE\u7F6E\u548C\u201C\u81EA\u52A8\u8FD0\u884C\u201D\u662F\u4E0D\u540C\u7684\uFF0C\u90A3\u4E2A\u8BBE\u7F6E\u662F\u6307\u201C\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4\u201D\u90FD\u81EA\u52A8\u540C\u6B65\u4E00\u6B21\u3002",settings_runoncestartup_notset:"\uFF08\u4E0D\u8BBE\u7F6E\uFF09",settings_runoncestartup_1sec:"\u542F\u52A8\u540E\u7B2C 1 \u79D2\u8FD0\u884C\u4E00\u6B21",settings_runoncestartup_10sec:"\u542F\u52A8\u540E\u7B2C 10 \u79D2\u8FD0\u884C\u4E00\u6B21",settings_runoncestartup_30sec:"\u542F\u52A8\u540E\u7B2C 30 \u79D2\u8FD0\u884C\u4E00\u6B21",settings_skiplargefiles:"\u8DF3\u8FC7\u5927\u6587\u4EF6\uFF08\u5B9E\u9A8C\u6027\u8D28\uFF09",settings_skiplargefiles_desc:"\u8DF3\u8FC7\u5927\u4E8E\u67D0\u4E00\u4E2A\u9608\u503C\u7684\u6587\u4EF6\u3002\u8FD9\u91CC 1 MB = 10^6 bytes\u3002",settings_skiplargefiles_notset:"\uFF08\u4E0D\u8BBE\u7F6E\uFF09",settings_checkonnectivity:"\u68C0\u67E5\u53EF\u5426\u8FDE\u63A5",settings_checkonnectivity_desc:"\u68C0\u67E5\u53EF\u5426\u8FDE\u63A5\u3002",settings_checkonnectivity_button:"\u68C0\u67E5",settings_checkonnectivity_checking:"\u6B63\u5728\u68C0\u67E5\u2026\u2026",settings_remotebasedir:"\u4FEE\u6539\u8FDC\u7AEF\u57FA\u6587\u4EF6\u5939\uFF08\u5B9E\u9A8C\u6027\u8D28\uFF09",settings_remotebasedir_desc:"\u9ED8\u8BA4\u8BBE\u5B9A\uFF0C\u5185\u5BB9\u4F1A\u88AB\u540C\u6B65\u5230\u8FDC\u7AEF\u7684\u548C\u8D44\u6599\u5E93\u540C\u540D\u7684\u6587\u4EF6\u5939\u4E0B\u3002\u60A8\u53EF\u4EE5\u5728\u6B64\u4FEE\u6539\u8FDC\u7AEF\u6587\u4EF6\u5939\u540D\uFF0C\u6216\u5220\u9664\u8F93\u5165\u6846\u6587\u672C\u4ECE\u800C\u91CD\u8BBE\u5230\u9ED8\u8BA4\u503C\u3002\u60A8\u9700\u8981\u70B9\u51FB\u201C\u786E\u8BA4\u201D\u3002",settings_s3:"S3 \u6216\u517C\u5BB9 S3 \u7684\u670D\u52A1\u7684\u8BBE\u7F6E",settings_s3_disclaimer1:"\u58F0\u660E\uFF1A\u672C\u63D2\u4EF6\u4E0D\u662F Amazon \u7684\u5B98\u65B9\u4EA7\u54C1\u3002",settings_s3_disclaimer2:"\u58F0\u660E\uFF1A\u60A8\u6240\u8F93\u5165\u7684\u4FE1\u606F\u5B58\u50A8\u4E8E\u672C\u5730\u3002\u5176\u5B83\u6709\u5BB3\u7684\u6216\u8005\u51FA\u9519\u7684\u63D2\u4EF6\uFF0C\u662F\u6709\u53EF\u80FD\u8BFB\u53D6\u5230\u8FD9\u4E9B\u4FE1\u606F\u7684\u3002\u5982\u679C\u60A8\u53D1\u73B0\u4E86\u5B58\u50A8\u6876\u6709\u4E0D\u7B26\u5408\u9884\u671F\u7684\u8BBF\u95EE\uFF0C\u8BF7\u7ACB\u523B\u4ECE AWS\uFF08\u6216\u5176\u5B83 S3 \u670D\u52A1\u5546\uFF09\u5220\u9664\u8BB0\u5F55\u4E8E\u6B64\u7684 access key\u3002",settings_s3_cors:"\u60A8\u9700\u8981\u8BBE\u7F6E CORS\uFF0C\u4ECE\u800C\u5141\u8BB8\u8FD9\u4E9B\u6E90\u7684\u8BF7\u6C42\u8BBF\u95EE\uFF1Aapp://obsidian.md \u548C capacitor://localhost \u548C http://localhost \u4E14\u589E\u52A0 ETag \u5230\u66B4\u9732 headers \u91CC\u3002",settings_s3_prod:"\u4E00\u4E9B\u53EF\u53C2\u8003\u7684 Amazon S3 \u5B98\u65B9\u6587\u6863\uFF1A",settings_s3_prod1:"\u670D\u52A1\u5730\u5740\uFF08Endpoint\uFF09\u548C\u533A\u57DF\uFF08Region\uFF09\u4FE1\u606F",settings_s3_prod2:"Access Key ID \u548C Secret Access Key \u4FE1\u606F",settings_s3_prod3:"\u8BBE\u7F6E CORS",settings_s3_endpoint:"\u670D\u52A1\u5730\u5740\uFF08Endpoint\uFF09",settings_s3_region:"\u533A\u57DF\uFF08Region\uFF09",settings_s3_region_desc:"\u5982\u679C\u60A8\u4E0D\u77E5\u9053\u8FD9\u4E2A\u503C\u586B\u4EC0\u4E48\uFF0C\u53EF\u4EE5\u5C1D\u8BD5\u586B\u5199\u6B64\u9ED8\u8BA4\u503C\uFF1Aus-east-1",settings_s3_accesskeyid:"Access Key ID",settings_s3_accesskeyid_desc:"Access key ID\u3002\u6CE8\u610F\uFF1Aaccess key ID \u548C\u5176\u5B83\u4FE1\u606F\u90FD\u4F1A\u5728\u672C\u5730\u4FDD\u5B58\u3002",settings_s3_secretaccesskey:"Secret Access Key",settings_s3_secretaccesskey_desc:"Secret access key\u3002\u6CE8\u610F\uFF1Asecret access key \u548C\u5176\u5B83\u4FE1\u606F\u90FD\u4F1A\u5728\u672C\u5730\u4FDD\u5B58\u3002",settings_s3_bucketname:"\u5B58\u50A8\u6876\uFF08Bucket\uFF09\u7684\u540D\u5B57",settings_s3_bypasscorslocally:"\u672C\u5730\u7ED5\u8FC7 CORS \u95EE\u9898",settings_s3_bypasscorslocally_desc:"\u5BF9\u4E8E Obsidian \u65B0\u7248\u672C\uFF08\u684C\u9762\u7248>=0.13.25 \u6216 iOS>=1.1.1 \u6216 Android>=1.2.1\uFF09\uFF0C\u672C\u63D2\u4EF6\u53EF\u4EE5\u8DF3\u8FC7\u670D\u52A1\u5668\u8BBE\u7F6E CORS \u7684\u6B65\u9AA4\u3002\u5982\u679C\u60A8\u9047\u5230\u4EFB\u610F\u95EE\u9898\uFF0C\u53EF\u4EE5\u5173\u95ED\u6B64\u8BBE\u5B9A\uFF0C\u5E76\u5728\u670D\u52A1\u7AEF\u8BBE\u7F6E CORS\uFF08\u5141\u8BB8\u6765\u81EA app://obsidian.md \u548C capacitor://localhost \u548C http://localhost \u7684\u8BF7\u6C42\u4E14\u589E\u52A0 ETag \u5230\u66B4\u9732 headers \u91CC\uFF09\u3002",settings_s3_parts:"\u5206\u5757\u5E76\u884C\u5EA6",settings_s3_parts_desc:"\u5728 S3 \u91CC\uFF0C\u5927\u6587\u4EF6\u4F1A\u88AB\u5206\u5757\u4E0A\u4F20\u3002\u60A8\u5E0C\u671B\u540C\u4E00\u65F6\u95F4\u6700\u591A\u6709\u591A\u5C11\u4E2A\u5206\u5757\u88AB\u4E0A\u4F20\uFF1F",settings_s3_urlstyle:"S3 URL style",settings_s3_urlstyle_desc:"\u662F\u5426\u5BF9 S3 \u5BF9\u8C61\u5F3A\u5236\u4F7F\u7528 path style URL\uFF08\u4F8B\u5982\u4F7F\u7528 https://s3.amazonaws.com/*/ \u800C\u4E0D\u662F https://*.s3.amazonaws.com/\uFF09\u3002",settings_s3_connect_succ:"\u5F88\u597D\uFF01\u53EF\u4EE5\u8BBF\u95EE\u5230\u5BF9\u5E94\u5B58\u50A8\u6876\u3002",settings_s3_connect_fail:"\u65E0\u6CD5\u8BBF\u95EE\u5230\u5BF9\u5E94\u5B58\u50A8\u6876\u3002",settings_dropbox:"Dropbox \u8BBE\u7F6E",settings_dropbox_disclaimer1:"\u58F0\u660E\uFF1A\u6B64\u63D2\u4EF6\u4E0D\u662F Dropbox \u5B98\u65B9\u4EA7\u54C1\u3002",settings_dropbox_disclaimer2:"\u58F0\u660E\uFF1A\u60A8\u6240\u8F93\u5165\u7684\u4FE1\u606F\u5B58\u50A8\u4E8E\u672C\u5730\u3002\u5176\u5B83\u6709\u5BB3\u7684\u6216\u8005\u51FA\u9519\u7684\u63D2\u4EF6\uFF0C\u662F\u6709\u53EF\u80FD\u8BFB\u53D6\u5230\u8FD9\u4E9B\u4FE1\u606F\u7684\u3002\u5982\u679C\u60A8\u53D1\u73B0\u4E86 Dropbox \u6709\u4E0D\u7B26\u5408\u9884\u671F\u7684\u8BBF\u95EE\uFF0C\u8BF7\u7ACB\u523B\u4ECE https://www.dropbox.com/account/connected_apps \u5220\u9664\u8BB0\u5F55\u4E8E\u6B64\u63D2\u4EF6\u7684\u8FDE\u63A5\u9274\u6743\u3002",settings_dropbox_folder:"\u6211\u4EEC\u4F1A\u5728\u60A8\u7684 Dropbox \u4E0A\u521B\u5EFA\u6B64\u6587\u4EF6\u5939\u5E76\u5728\u91CC\u9762\u540C\u6B65\uFF1A/Apps/{{pluginID}}/{{remoteBaseDir}}\u3002",settings_dropbox_revoke:"\u64A4\u56DE\u9274\u6743",settings_dropbox_revoke_desc:"\u60A8\u73B0\u5728\u4F7F\u7528\u4E86\u7528\u6237\u540D {{username}} \u6765\u8FDE\u63A5\u3002\u5982\u679C\u60F3\u53D6\u6D88\u8FDE\u63A5\uFF0C\u8BF7\u70B9\u51FB\u6B64\u6309\u94AE\u3002",settings_dropbox_revoke_button:"\u64A4\u56DE\u9274\u6743",settings_dropbox_revoke_notice:"\u9274\u6743\u5DF2\u88AB\u64A4\u56DE\uFF01",settings_dropbox_revoke_noticeerr:"\u64A4\u56DE\u9274\u6743\u51FA\u9519\u3002",settings_dropbox_clearlocal:"\u6E05\u9664\u672C\u5730\u4FDD\u5B58\u7684\u9274\u6743\u4FE1\u606F",settings_dropbox_clearlocal_desc:"\u60A8\u53EF\u4EE5\u5F3A\u5236\u6E05\u9664\u672C\u5730\u5DF2\u4FDD\u5B58\u7684 Dropbox \u7684\u767B\u5F55\u9274\u6743\u4FE1\u606F\uFF0C\u4F46\u4E0D\u5411\u670D\u52A1\u5668\u53D1\u9001\u64A4\u56DE\u9274\u6743\u7684\u8BF7\u6C42\u3002",settings_dropbox_clearlocal_button:"\u6E05\u9664",settings_dropbox_clearlocal_notice:"\u5DF2\u6E05\u9664\uFF01",settings_dropbox_auth:"\u9274\u6743",settings_dropbox_auth_desc:"\u9274\u6743\u3002",settings_dropbox_auth_button:"\u9274\u6743",settings_dropbox_connect_succ:"\u5F88\u597D\uFF01\u6211\u4EEC\u53EF\u8FDE\u63A5\u4E0A Dropbox\uFF01",settings_dropbox_connect_fail:"\u6211\u4EEC\u672A\u80FD\u8FDE\u63A5\u4E0A Dropbox\u3002",settings_onedrive:"Onedrive\uFF08\u4E2A\u4EBA\u7248\uFF09\u8BBE\u7F6E",settings_onedrive_disclaimer1:"\u58F0\u660E\uFF1A\u6B64\u63D2\u4EF6\u4E0D\u662F\u5FAE\u8F6F\u6216 OneDrive \u7684\u5B98\u65B9\u4EA7\u54C1\u3002",settings_onedrive_disclaimer2:"\u58F0\u660E\uFF1A\u60A8\u6240\u8F93\u5165\u7684\u4FE1\u606F\u5B58\u50A8\u4E8E\u672C\u5730\u3002\u5176\u5B83\u6709\u5BB3\u7684\u6216\u8005\u51FA\u9519\u7684\u63D2\u4EF6\uFF0C\u662F\u6709\u53EF\u80FD\u8BFB\u53D6\u5230\u8FD9\u4E9B\u4FE1\u606F\u7684\u3002\u5982\u679C\u60A8\u53D1\u73B0\u4E86 OneDrive \u6709\u4E0D\u7B26\u5408\u9884\u671F\u7684\u8BBF\u95EE\uFF0C\u8BF7\u7ACB\u523B\u4ECE https://microsoft.com/consent \u5220\u9664\u8BB0\u5F55\u4E8E\u6B64\u63D2\u4EF6\u7684\u8FDE\u63A5\u9274\u6743\u3002",settings_onedrive_folder:"\u6211\u4EEC\u4F1A\u5728\u60A8\u7684 OneDrive \u4E0A\u521B\u5EFA\u6B64\u6587\u4EF6\u5939\u5E76\u5728\u91CC\u9762\u540C\u6B65\uFF1A/Apps/{{pluginID}}/{{remoteBaseDir}}\u3002",settings_onedrive_nobiz:"\u73B0\u5728\u53EA\u652F\u6301\u4E2A\u4EBA\u7248 OneDrive\u3002\uFF08\u6682\u65F6\uFF09\u5E76\u4E0D\u652F\u6301\u4F01\u4E1A\u7248 OneDrive\u3002",settings_onedrive_revoke:"\u64A4\u56DE\u9274\u6743",settings_onedrive_revoke_desc:"\u60A8\u73B0\u5728\u4F7F\u7528\u4E86\u7528\u6237\u540D {{username}} \u6765\u8FDE\u63A5\u3002\u5982\u679C\u60F3\u53D6\u6D88\u8FDE\u63A5\uFF0C\u8BF7\u70B9\u51FB\u6B64\u6309\u94AE\u3002",settings_onedrive_revoke_button:"\u64A4\u56DE\u9274\u6743",settings_onedrive_auth:"\u9274\u6743",settings_onedrive_auth_desc:"\u9274\u6743\u3002",settings_onedrive_auth_button:"\u9274\u6743",settings_onedrive_connect_succ:"\u5F88\u597D\uFF01\u6211\u4EEC\u53EF\u8FDE\u63A5\u4E0A OneDrive\uFF01",settings_onedrive_connect_fail:"\u6211\u4EEC\u672A\u80FD\u8FDE\u63A5\u4E0A OneDrive\u3002",settings_webdav:"Webdav \u8BBE\u7F6E",settings_webdav_disclaimer1:"\u58F0\u660E\uFF1A\u60A8\u6240\u8F93\u5165\u7684\u4FE1\u606F\u5B58\u50A8\u4E8E\u672C\u5730\u3002\u5176\u5B83\u6709\u5BB3\u7684\u6216\u8005\u51FA\u9519\u7684\u63D2\u4EF6\uFF0C\u662F\u6709\u53EF\u80FD\u8BFB\u53D6\u5230\u8FD9\u4E9B\u4FE1\u606F\u7684\u3002\u5982\u679C\u60A8\u53D1\u73B0\u4E86 Webdav \u670D\u52A1\u5668\u6709\u4E0D\u7B26\u5408\u9884\u671F\u7684\u8BBF\u95EE\uFF0C\u8BF7\u7ACB\u523B\u4FEE\u6539\u7528\u6237\u540D\u548C\u5BC6\u7801\u3002",settings_webdav_cors_os:"Obsidian \u684C\u9762\u7248>=0.13.25 \u6216 iOS>=1.1.1 \u6216 Android>=1.2.1 \u652F\u6301\u8DF3\u8FC7 CORS \u8BBE\u7F6E\u3002\u4F46\u60A8\u6B63\u5728\u4F7F\u7528\u65E7\u7248\uFF0C\u5EFA\u8BAE\u5347\u7EA7\u3002",settings_webdav_cors:"\u60A8\u9700\u8981\u8BBE\u7F6E CORS\uFF0C\u5141\u8BB8\u6765\u81EA\u8FD9\u4E9B\u6E90\u7684\u8BF7\u6C42\uFF1Aapp://obsidian.md \u548C capacitor://localhost \u548C http://localhost\u3002",settings_webdav_folder:"\u6211\u4EEC\u4F1A\u5728\u60A8\u7684\u670D\u52A1\u5668\u4E0A\u521B\u5EFA\u6B64\u6587\u4EF6\u5939\u5E76\u5728\u91CC\u9762\u540C\u6B65\uFF1A/{{remoteBaseDir}}",settings_webdav_addr:"\u670D\u52A1\u5668\u5730\u5740",settings_webdav_addr_desc:"\u670D\u52A1\u5668\u5730\u5740\u3002",settings_webdav_user:"\u7528\u6237\u540D",settings_webdav_user_desc:"\u7528\u6237\u540D\u3002\u6CE8\u610F\uFF1A\u7528\u6237\u540D\u548C\u5176\u5B83\u4FE1\u606F\u90FD\u4F1A\u4FDD\u5B58\u5728\u672C\u5730\u3002",settings_webdav_password:"\u5BC6\u7801",settings_webdav_password_desc:"\u5BC6\u7801\u3002\u6CE8\u610F\uFF1A\u5BC6\u7801\u548C\u5176\u5B83\u4FE1\u606F\u90FD\u4F1A\u4FDD\u5B58\u5728\u672C\u5730\u3002",settings_webdav_auth:"\u9274\u6743\u7C7B\u578B",settings_webdav_auth_desc:"\u5982\u679C\u4E0D\u586B\u5199\u5BC6\u7801\uFF0C\u672C\u8BBE\u7F6E\u4F1A\u88AB\u5FFD\u7565\u3002",settings_webdav_depth:"\u53D1\u9001\u5230\u670D\u52A1\u5668\u7684 Depth header",settings_webdav_depth_desc:"Webdav \u670D\u52A1\u5668\u4F1A\u88AB\u8BBE\u4E3A\u63A5\u6536 Depth header \u4E3A\u201C1\u201D\u6216\u201CInfinity\u201D\u8BF7\u6C42\u3002\u672C\u63D2\u4EF6\u9700\u8981\u5F97\u77E5\u6B64\u4FE1\u606F\u3002\u5982\u679C\u60A8\u4E0D\u6E05\u695A\u5982\u4F55\u8BBE\u7F6E\uFF0C\u53EF\u4EE5\u9009\u62E9\u201C\u81EA\u52A8\u68C0\u6D4B\u201D",settings_webdav_depth_auto:"\u81EA\u52A8\u68C0\u6D4B",settings_webdav_depth_1:"\u53EA\u652F\u6301 depth='1'",settings_webdav_depth_inf:"\u652F\u6301 depth='infinity'",settings_webdav_connect_succ:"\u5F88\u597D\uFF01\u53EF\u4EE5\u8FDE\u63A5\u4E0A Webdav \u670D\u52A1\u5668\u3002",settings_webdav_connect_fail:"\u65E0\u6CD5\u8FDE\u63A5\u4E0A Webdav \u670D\u52A1\u5668\u3002\uFF08\u53EF\u80FD\u662F\u5730\u5740/\u8D26\u53F7/\u5BC6\u7801/\u9274\u6743\u7C7B\u578B\u7B49\u9519\u8BEF\u3002\uFF09",settings_webdav_connect_fail_withcors:"\u65E0\u6CD5\u8FDE\u63A5\u4E0A Webdav \u670D\u52A1\u5668\u3002\uFF08\u53EF\u80FD\u662F\u5730\u5740/\u8D26\u53F7/\u5BC6\u7801/\u9274\u6743\u7C7B\u578B/CORS \u7B49\u9519\u8BEF\u3002\uFF09",settings_chooseservice:"\u9009\u62E9\u8FDC\u7A0B\u670D\u52A1",settings_chooseservice_desc:"\u4ECE\u8FD9\u91CC\u5F00\u59CB\u8BBE\u7F6E\u3002\u60A8\u60F3\u8FDE\u63A5\u5230\u54EA\u4E00\u4E2A\u670D\u52A1\uFF1FS3\u3001Dropbox\u3001Webdav\u3001OneDrive\uFF08\u4E2A\u4EBA\u7248\uFF09\uFF1F",settings_chooseservice_s3:"S3 \u6216\u517C\u5BB9 S3 \u7684\u670D\u52A1",settings_chooseservice_dropbox:"Dropbox",settings_chooseservice_webdav:"Webdav",settings_chooseservice_onedrive:"OneDrive\uFF08\u4E2A\u4EBA\u7248\uFF09",settings_adv:"\u8FDB\u9636\u8BBE\u7F6E",settings_concurrency:"\u5E76\u884C\u5EA6",settings_concurrency_desc:"\u60A8\u5E0C\u671B\u540C\u65F6\u6700\u591A\u6709\u591A\u5C11\u4E2A\u6587\u4EF6\u88AB\u4E0A\u4F20\u548C\u4E0B\u8F7D\uFF1F\u9ED8\u8BA4\u503C\u662F 5\u3002\u5982\u679C\u60A8\u9047\u5230\u4E86\u4E00\u4E9B\u95EE\u9898\uFF08\u5982\u8BBF\u95EE\u9891\u7387\u9650\u5236\uFF09\uFF0C\u60A8\u53EF\u4EE5\u51CF\u5C11\u5E76\u884C\u5EA6\u3002",settings_syncunderscore:"\u540C\u6B65 _ \u6587\u4EF6\u6216\u6587\u4EF6\u5939",settings_syncunderscore_desc:"\u662F\u5426\u540C\u6B65\u201C_\u201D\uFF08\u4E0B\u5212\u7EBF\uFF09\u5F00\u59CB\u7684\u6587\u4EF6\u6216\u6587\u4EF6\u5939\u3002",settings_sync_hash_files:"\u4F7F\u7528\u6587\u4EF6\u54C8\u5E0C\u6765\u8DDF\u8E2A\u91CD\u547D\u540D\u7684\u6587\u4EF6",settings_sync_hash_files_desc:"\u80FD\u591F\u66F4\u597D\u5730\u8DDF\u8E2A Obsidian \u4E4B\u5916\u7684\u91CD\u547D\u540D\u6587\u4EF6\u3002",settings_configdir:"\u540C\u6B65\u914D\u7F6E\u6587\u4EF6\u5939\uFF08\u5B9E\u9A8C\u6027\u8D28\uFF09",settings_configdir_desc:"\u662F\u5426\u540C\u6B65 Obsidian \u7684\u914D\u7F6E\u6587\u4EF6\u5939 {{configDir}}\uFF08\u5176\u4E2D\u7684 .git \u548C node_modules \u4F9D\u7136\u4F1A\u88AB\u5FFD\u7565\uFF09\u3002\u8BF7\u6CE8\u610F\uFF0C\u6B64\u8BBE\u7F6E\u53EF\u80FD\u4F1A\u5F71\u54CD\u5230\u60A8 Obsidian \u6216\u8005\u6240\u6709\u7684\u63D2\u4EF6\u8BBE\u7F6E\uFF0C\u4E5F\u53EF\u80FD\u9700\u8981\u60A8\u540C\u6B65\u5B8C\u6BD5\u540E\u91CD\u542F Obsidian\u3002\u5982\u679C\u60A8\u540C\u610F\u81EA\u884C\u627F\u53D7\u5176\u98CE\u9669\uFF0C\u5219\u53EF\u4EE5\u5F00\u542F\u672C\u8BBE\u7F6E\u3002",settings_importexport:"\u5BFC\u5165\u5BFC\u51FA\u90E8\u5206\u8BBE\u7F6E",settings_export:"\u5BFC\u51FA",settings_export_desc:"\u7528 QR \u7801\u5BFC\u51FA\u975E oauth2 \u7684\u8BBE\u7F6E\u4FE1\u606F\u3002",settings_export_desc_button:"\u751F\u6210 QR \u7801",settings_import:"\u5BFC\u5165",settings_import_desc:"\u60A8\u9700\u8981\u4F7F\u7528\u7CFB\u7EDF\u62CD\u6444 app \u6216\u8005\u626B\u63CF QR \u7801\u7684app\uFF0C\u6765\u626B\u63CF\u5BF9\u5E94\u7684 QR \u7801\u3002",settings_debug:"\u8C03\u8BD5",settings_debug_enabled:"\u4FEE\u6539\u7EC8\u7AEF\u8F93\u51FA\u7684 enabled",settings_debug_enabled_desc:"\u9ED8\u8BA4\u503C\u4E3A\u201C\u5173\u95ED\u201D\u3002\u60A8\u53EF\u4EE5\u6539\u4E3A\u201C\u5F00\u542F\u201D\uFF0C\u4ECE\u800C\u5728\u7EC8\u7AEF\u91CC\u83B7\u53D6\u66F4\u591A\u4FE1\u606F\u3002",settings_outputsettingsconsole:"\u8BFB\u53D6\u786C\u76D8\u4E0A\u7684\u8BBE\u7F6E\u6587\u4EF6\u8F93\u51FA\u5230\u7EC8\u7AEF",settings_outputsettingsconsole_desc:"\u786C\u76D8\u4E0A\u7684\u8BBE\u7F6E\u6587\u4EF6\u662F\u7F16\u7801\u8FC7\u7684\uFF0C\u70B9\u51FB\u8FD9\u91CC\u4ECE\u800C\u89E3\u7801\u5E76\u8F93\u51FA\u5230\u7EC8\u7AEF\u3002",settings_outputsettingsconsole_button:"\u8F93\u51FA",settings_outputsettingsconsole_notice:"\u5DF2\u8F93\u51FA\u5230\u7EC8\u7AEF",settings_syncplans:"\u5BFC\u51FA\u540C\u6B65\u8BA1\u5212",settings_syncplans_desc:"\u6BCF\u6B21\u60A8\u542F\u52A8\u540C\u6B65\uFF0C\u5E76\u5728\u5B9E\u9645\u4E0A\u4F20\u4E0B\u8F7D\u524D\uFF0C\u63D2\u4EF6\u4F1A\u751F\u6210\u540C\u6B65\u8BA1\u5212\u3002\u5B83\u53EF\u4EE5\u4F7F\u60A8\u77E5\u9053\u6BCF\u6B21\u540C\u6B65\u53D1\u751F\u4E86\u4EC0\u4E48\u3002\u70B9\u51FB\u6309\u94AE\u53EF\u4EE5\u5BFC\u51FA\u540C\u6B65\u8BA1\u5212\u3002\u5E76\u4E14\uFF0C\u60A8\u53EF\u4EE5\u9009\u62E9\u5BFC\u51FA\u4E3A\u5185\u5D4C\u5728 Markdown \u91CC\u7684 json \u683C\u5F0F\u6216\u8868\u683C\u683C\u5F0F\uFF0C\u5B83\u4EEC\u662F\u7B49\u4EF7\u7684\u3002",settings_syncplans_button_json:"\u5BFC\u51FA\uFF08json\uFF09",settings_syncplans_button_table:"\u5BFC\u51FA\uFF08\u8868\u683C\uFF09",settings_syncplans_notice:"\u540C\u6B65\u8BA1\u5212\u5DF2\u5BFC\u51FA",settings_delsyncplans:"\u5220\u9664\u6570\u636E\u5E93\u91CC\u7684\u540C\u6B65\u8BA1\u5212\u5386\u53F2",settings_delsyncplans_desc:"\u5220\u9664\u6570\u636E\u5E93\u91CC\u7684\u540C\u6B65\u8BA1\u5212\u5386\u53F2\u3002",settings_delsyncplans_button:"\u5220\u9664\u540C\u6B65\u8BA1\u5212\u5386\u53F2",settings_delsyncplans_notice:"\uFF08\u6570\u636E\u5E93\u91CC\u7684\uFF09\u540C\u6B65\u8BA1\u5212\u5DF2\u88AB\u5220\u9664\u3002",settings_disable_s3_metadata_sync:"\u7981\u7528 S3 \u5143\u6570\u636E\u540C\u6B65",settings_disable_s3_metadata_sync_desc:"\u9632\u6B62\u4E0E S3 \u670D\u52A1\u5546\u540C\u6B65\u4FEE\u6539\u65F6\u95F4\uFF08\u517C\u5BB9\u963F\u91CC\u4E91\uFF09\u3002",settings_logtodb:"\u4FDD\u5B58\u7EC8\u7AEF\u65E5\u5FD7\u5230\u6570\u636E\u5E93",settings_logtodb_desc:"\u5982\u679C\u5F00\u542F\u6B64\u8BBE\u7F6E\uFF0C\u6240\u6709\u7EC8\u7AEF\u65E5\u5FD7\u90FD\u4F1A\u4FDD\u5B58\u5230\u6570\u636E\uFF0C\u4ECE\u800C\u6211\u4EEC\u53EF\u4EE5\u5728\u4E4B\u540E\u5BFC\u51FA\u548C\u9605\u8BFB\u5B83\u4EEC\u3002\u5BF9\u4E8E\u79FB\u52A8\u8BBE\u5907\u7684\u8C03\u8BD5\u8F83\u4E3A\u6709\u7528\u3002\u6709\u6027\u80FD\u6210\u672C\uFF0C\u53EF\u80FD\u4F1A\u5F71\u54CD\u7535\u6C60\u7528\u91CF\u3002\u5386\u53F2\u4F1A\u4FDD\u5B58\u6700\u591A 10000 \u6761\u548C 7 \u5929\u65F6\u95F4\u3002",settings_logtodbexport:"\u4ECE\u6570\u636E\u5E93\u5BFC\u51FA\u7EC8\u7AEF\u65E5\u5FD7",settings_logtodbexport_desc:"\u4ECE\u6570\u636E\u5E93\u5BFC\u51FA\u672C\u8D44\u6599\u5E93\u7684\u5DF2\u4FDD\u5B58\u7684\u7EC8\u7AEF\u65E5\u5FD7\uFF0C\u8F93\u51FA\u5230\u6587\u4EF6\u5939 {{&debugFolder}} \u4E0B\u7684\u4E00\u4E2A\u65B0\u6587\u4EF6\u5185\u3002",settings_logtodbexport_button:"\u5BFC\u51FA",settings_logtodbexport_notice:"\u6570\u636E\u5E93\u5185\u7684\u672C\u8D44\u6599\u5E93\u7684\u7EC8\u7AEF\u65E5\u5FD7\u5DF2\u5BFC\u51FA\uFF01",settings_logtodbclear:"\u5220\u9664\u6570\u636E\u5E93\u7684\u6240\u6709\u7EC8\u7AEF\u65E5\u5FD7",settings_logtodbclear_desc:"\u5220\u9664\u6570\u636E\u5E93\u5185\u7684\u6240\u6709\u5DF2\u4FDD\u5B58\u7684\u7EC8\u7AEF\u65E5\u5FD7\u3002\u672C\u8BBE\u7F6E\u4F1A\u5F71\u54CD\u672C\u8BBE\u5907\u4E0B\u6240\u6709\u8D44\u6599\u5E93\u7684\u6240\u6709\u5DF2\u4FDD\u5B58\u65E5\u5FD7\u3002",settings_logtodbclear_button:"\u5220\u9664",settings_logtodbclear_notice:"\u6570\u636E\u5E93\u5185\u7684\u6240\u6709\u7EC8\u7AEF\u65E5\u5FD7\u5DF2\u5220\u9664\uFF01",settings_delsyncmap:"\u5220\u9664\u6570\u636E\u5E93\u91CC\u7684\u540C\u6B65\u6620\u5C04\u5386\u53F2",settings_delsyncmap_desc:"\u540C\u6B65\u6620\u5C04\u5386\u53F2\u5B58\u50A8\u4E86\u672C\u5730\u771F\u6B63\u7684\u6700\u540E\u4FEE\u6539\u65F6\u95F4\u548C\u8FDC\u7A0B\u6587\u4EF6\u65F6\u95F4\u7684\u6620\u5C04\u3002\u5220\u9664\u4E4B\u53EF\u80FD\u4F1A\u5BFC\u81F4\u4E0B\u4E00\u6B21\u540C\u6B65\u65F6\u53D1\u751F\u4E0D\u5FC5\u8981\u7684\u6570\u636E\u4EA4\u6362\u3002\u70B9\u51FB\u6309\u94AE\u5220\u9664\u6570\u636E\u5E93\u91CC\u7684\u540C\u6B65\u6620\u5C04\u5386\u53F2\u3002",settings_delsyncmap_button:"\u5220\u9664\u540C\u6B65\u6620\u5C04\u5386\u53F2",settings_delsyncmap_notice:"\uFF08\u672C\u5730\u6570\u636E\u5E93\u91CC\u7684\uFF09\u540C\u6B65\u6620\u5C04\u5386\u53F2\u5DF2\u88AB\u5220\u9664\u3002",settings_outputbasepathvaultid:"\u8F93\u51FA\u8D44\u6599\u5E93\u5BF9\u5E94\u7684\u4F4D\u7F6E\u548C\u968F\u673A\u5206\u914D\u7684 ID",settings_outputbasepathvaultid_desc:"\u7528\u4E8E\u8C03\u8BD5\u3002",settings_outputbasepathvaultid_button:"\u8F93\u51FA",settings_reset_sync_metadata:"\u91CD\u7F6E\u540C\u6B65\u5143\u6570\u636E",settings_reset_sync_metadata_desc:"\u7528\u4E8E\u5220\u9664\u8FDC\u7A0B\u5B58\u50A8\u7684\u5143\u6570\u636E\u6587\u4EF6\u3002\u5C06\u5FFD\u7565\u5DF2\u5220\u9664\u7684\u6587\u4EF6\uFF0C\u56E0\u6B64\u8BF7\u786E\u4FDD\u9996\u5148\u5728\u6240\u6709\u8BBE\u5907\u4E0A\u540C\u6B65\u3002",settings_reset_sync_metadata_notice_start:"\u5220\u9664\u4E2D\uFF0C\u8BF7\u7B49\u5F85... (1/2)",settings_reset_sync_metadata_notice_end:"\u8FDC\u7A0B\u5143\u6570\u636E\u6587\u4EF6\u5DF2\u5220\u9664\u3002(2/2)",settings_reset_sync_metadata_notice_error:"\u5DF2\u5F00\u59CB\u5220\u9664\u8FDC\u7A0B\u5143\u6570\u636E\u6587\u4EF6\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85\u3002",settings_resetcache:"\u91CD\u8BBE\u672C\u5730\u7F13\u5B58\u548C\u6570\u636E\u5E93",settings_resetcache_desc:"\uFF08\u51FA\u4E8E\u8C03\u8BD5\u539F\u56E0\uFF09\u91CD\u8BBE\u672C\u5730\u7F13\u5B58\u548C\u6570\u636E\u5E93\u3002\u60A8\u9700\u8981\u5728\u91CD\u8BBE\u4E4B\u540E\u91CD\u65B0\u8F7D\u5165\u6B64\u63D2\u4EF6\u3002\u672C\u91CD\u8BBE\u4E0D\u4F1A\u5220\u9664 s3\uFF0C\u5BC6\u7801\u2026\u2026\u7B49\u8BBE\u5B9A\u3002",settings_reset_button:"\u91CD\u8BBE",settings_resetcache_notice:"\u672C\u5730\u540C\u6B65\u7F13\u5B58\u548C\u6570\u636E\u5E93\u5DF2\u88AB\u5220\u9664\u3002\u8BF7\u624B\u52A8\u91CD\u65B0\u8F7D\u5165\u6B64\u63D2\u4EF6\u3002",settings_enablestatusbar_info:"\u5728\u72B6\u6001\u680F\u663E\u793A\u6700\u540E\u4E00\u6B21\u6210\u529F\u540C\u6B65",settings_enablestatusbar_info_desc:"\u5728\u72B6\u6001\u680F\u663E\u793A\u6700\u540E\u4E00\u6B21\u6210\u529F\u540C\u6B65\u7684\u65F6\u95F4\u3002",settings_enablestatusbar_reloadrequired_notice:"\u91CD\u65B0\u52A0\u8F7D\u63D2\u4EF6\u4EE5\u4F7F\u66F4\u6539\u751F\u6548\u3002",settings_sync_bookmarks:"\u540C\u6B65 Obsidian \u4E66\u7B7E",settings_sync_bookmarks_desc:"\u5728\u8BBE\u5907\u4E4B\u95F4\u540C\u6B65\u60A8\u7684\u4E66\u7B7E\u3002",settings_trash_locally:"\u5C06\u5DF2\u5220\u9664\u7684\u6587\u4EF6\u79FB\u52A8\u5230 Obsidian \u7684 .trash \u6587\u4EF6\u5939\u4E2D",settings_trash_locally_desc:"\u5982\u679C\u7981\u7528\uFF0C\u5C06\u9996\u5148\u5C1D\u8BD5\u628A\u6587\u4EF6\u79FB\u52A8\u5230\u7CFB\u7EDF\u56DE\u6536\u7AD9\u4E2D\u3002\u4EC5\u5F71\u54CD\u540C\u6B65\u65F6\u5220\u9664\u7684\u6587\u4EF6\u3002",settings_sync_trash:"\u540C\u6B65 .trash \u6587\u4EF6\u5939",settings_sync_trash_desc:"\u5982\u679C\u60A8\u5728\u5220\u9664\u5E93\u4E2D\u7684\u6587\u4EF6\u65F6\u4F7F\u7528 .trash \u6587\u4EF6\u5939\u800C\u4E0D\u662F\u7CFB\u7EDF\u56DE\u6536\u7AD9\uFF0C\u90A3\u4E48\u8BE5\u9879\u8BBE\u7F6E\u53EF\u80FD\u6709\u7528\u3002",statusbar_time_years:"{{time}} \u5E74",statusbar_time_months:"{{time}} \u4E2A\u6708",statusbar_time_weeks:"{{time}} \u5468",statusbar_time_days:"{{time}} \u5929",statusbar_time_hours:"{{time}} \u5C0F\u65F6",statusbar_time_minutes:"{{time}} \u5206\u949F",statusbar_time_lessminute:"\u4E0D\u5230\u4E00\u5206\u949F",statusbar_lastsync:"{{time}} \u524D\u540C\u6B65",statusbar_lastsync_label:"\u6700\u540E\u6210\u529F\u540C\u6B65\u4E8E {{date}}",statusbar_lastsync_never:"\u4ECE\u672A\u540C\u6B65",statusbar_lastsync_never_label:"\u4EE5\u524D\u4ECE\u672A\u540C\u6B65\u8FC7",settings_showlastsyncedonly:"\u72B6\u6001\u680F\u4E2D\u4EC5\u663E\u793A\u6700\u540E\u4E00\u6B21\u540C\u6B65\u65F6\u95F4",settings_showlastsyncedonly_desc:"\u4EC5\u663E\u793A\u6700\u540E\u4E00\u6B21\u540C\u6B65\u65F6\u95F4\uFF0C\u5E76\u9690\u85CF\u5176\u5B83\u72B6\u6001\u680F\u5143\u7D20\u3002\u8FD9\u6700\u9002\u5408\u79FB\u52A8\u8BBE\u5907\u3002",syncalgov2_title:"Remotely Sync \u534F\u8BAE",syncalgov2_texts:`\u8BF7\u5907\u4EFD\u597D\u60A8\u7684\u5E93\uFF08Vault\uFF09\uFF01 -\u6B22\u8FCE\u4F7F\u7528 Remotely Sync\uFF0C\u8FD9\u662F\u5177\u6709\u5B89\u5168\u5347\u7EA7\u529F\u80FD\u7684 Remotely Save \u5206\u652F\uFF01\u5728\u5F00\u59CB\u4F7F\u7528\u4E4B\u524D\uFF0C\u8BF7\u6CE8\u610F\uFF0C\u7531\u4E8E\u65B0\u529F\u80FD\u5C1A\u672A\u7ECF\u8FC7\u5168\u9762\u6D4B\u8BD5\uFF0C\u6B64\u63D2\u4EF6\u53EF\u80FD\u4E0D\u5982 Remotely Save \u7A33\u5B9A\u3002 -Remotely Sync \u9700\u8981\u5C06\u989D\u5916\u7684\u5143\u6570\u636E\u6587\u4EF6\u4E0A\u4F20\u5230\u60A8\u914D\u7F6E\u7684\u4E91\u5B58\u50A8\u4E2D\uFF0C\u4EE5\u5141\u8BB8\u5176\u5B83\u8BBE\u5907\u77E5\u9053\u54EA\u4E9B\u5185\u5BB9\u88AB\u5220\u9664\u4E86\u3002 -\u5982\u679C\u60A8\u4E0D\u540C\u610F\u6B64\u7B56\u7565\uFF0C\u60A8\u53EF\u4EE5\u4ECE GitHub \u4E0B\u8F7D 0.2.14 \u6216\u66F4\u65E9\u7248\u672C\u7684 Remotely Save\uFF0C\u5B83\u4EEC\u4F7F\u7528\u65E7\u7684\u540C\u6B65\u7B97\u6CD5\uFF0C\u4E0D\u4F1A\u4E0A\u4F20\u4EFB\u4F55\u989D\u5916\u6587\u4EF6\u3002 -\u70B9\u51FB\u201C\u4E0D\u540C\u610F\u201D\u6309\u94AE\u4E4B\u540E\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u505C\u6B62\u8FD0\u884C\uFF0C\u7136\u540E\u60A8\u9700\u8981\u5728 Obsidian \u8BBE\u7F6E\u91CC\u624B\u52A8\u505C\u7528\u6B64\u63D2\u4EF6\u3002 -\u5982\u679C\u60A8\u540C\u610F\u6B64\u7B56\u7565\uFF0C\u8BF7\u70B9\u51FB\u201C\u540C\u610F\u201D\u6309\u94AE\uFF0C\u7136\u540E\u5F00\u59CB\u4EAB\u7528\u6B64\u63D2\u4EF6\uFF01`,syncalgov2_button_agree:"\u540C\u610F",syncalgov2_button_disagree:"\u4E0D\u540C\u610F"};var nne={confirm:"\u78BA\u8A8D",disable:"\u95DC\u9589",enable:"\u958B\u555F",goback:"\u8FD4\u56DE",submit:"\u63D0\u4EA4",sometext:"\u9019\u88E1\u6709\u4E00\u6BB5\u6587\u5B57\u3002",syncrun_status_preparing:"\u6E96\u5099\u4E2D\u2026\u2026",syncrun_status_syncing:"\u540C\u6B65\u4E2D",syncrun_status_progress:"\u540C\u6B65\u4E2D ({{current}}/{{total}})",syncrun_alreadyrunning:"{{maxSteps}} Remotely Sync \u6B63\u5728\u904B\u884C\uFF01",syncrun_debug_alreadyrunning:"Remotely Sync \u6B63\u8655\u65BC\u6B64\u968E\u6BB5\uFF1A{{stage}}",syncrun_syncingribbon:"{{pluginName}}\uFF1A\u6B63\u5728\u7531 {{triggerSource}} \u89F8\u767C\u57F7\u884C",syncrun_step0:"{{maxSteps}} Remotely Sync \u5728\u7A7A\u8DD1\uFF08dry run\uFF09\u6A21\u5F0F\uFF0C\u4E0D\u6703\u767C\u751F\u5BE6\u969B\u7684\u6A94\u6848\u4EA4\u63DB\u3002",syncrun_step1:"{{maxSteps}} Remotely Sync \u6E96\u5099\u540C\u6B65\uFF08{{serviceType}}\uFF09",syncrun_step2:"{{maxSteps}} \u6B63\u5728\u7372\u53D6\u9060\u7AEF\u7684\u5143\u8CC7\u6599\u3002",syncrun_step3:"{{maxSteps}} \u6B63\u5728\u6AA2\u67E5\u5BC6\u78BC\u6B63\u78BA\u8207\u5426\u3002",syncrun_passworderr:"\u6AA2\u67E5\u5BC6\u78BC\u6642\u5019\u51FA\u932F\u3002",syncrun_step4:"{{maxSteps}} \u6B63\u5728\u7372\u53D6\u9060\u7AEF\u7684\u984D\u5916\u7684\u5143\u8CC7\u6599\u3002",syncrun_step5:"{{maxSteps}} \u6B63\u5728\u7372\u53D6\u672C\u5730\u7684\u5143\u8CC7\u6599\u3002",syncrun_step6:"{{maxSteps}} \u6B63\u5728\u751F\u6210\u540C\u6B65\u8A08\u5283\u3002",syncrun_step7:"{{maxSteps}} Remotely Sync \u958B\u59CB\u767C\u751F\u8CC7\u6599\u4EA4\u63DB\uFF01",syncrun_step7skip:"{{maxSteps}} Remotely Sync \u5728\u7A7A\u8DD1\u6A21\u5F0F\uFF0C\u8DF3\u904E\u5BE6\u969B\u8CC7\u6599\u4EA4\u63DB\u6B65\u9A5F\u3002",syncrun_step8:"{{maxSteps}} Remotely Sync \u5DF2\u5B8C\u6210\u540C\u6B65\uFF01",syncrun_abort:"{{manifestID}}-{{theDate}}\uFF1A\u4E2D\u65B7\u540C\u6B65\uFF0C\u540C\u6B65\u4F86\u6E90={{triggerSource}}\uFF0C\u51FA\u932F\u968E\u6BB5={{syncStatus}}",remote_changes_found:"\u6B63\u5728\u540C\u6B65\u9060\u7AEF\u66F4\u6539\u2026\u2026",remote_changes_synced:"\u5EAB\u5DF2\u540C\u6B65\u4E14\u8655\u65BC\u6700\u65B0\u72C0\u614B\u3002",protocol_saveqr:" {{manifestName}} \u65B0\u7684\u975E oauth2 \u8A2D\u5B9A\u5132\u5B58\u5B8C\u6210\u3002\u8ACB\u91CD\u555F\u5916\u639B\u8A2D\u5B9A\u9801\u4F7F\u4E4B\u751F\u6548\u3002",protocol_callbacknotsupported:"\u60A8\u7684 uri callback \u66AB\u4E0D\u652F\u63F4\uFF1A {{params}}",protocol_dropbox_connecting:`\u6B63\u5728\u9023\u7DDA Dropbox\u2026\u2026 -\u8ACB\u4E0D\u8981\u95DC\u9589\u6B64\u5F48\u7A97\u3002`,protocol_dropbox_connect_succ:"\u597D\uFF01\u6211\u5011\u4F5C\u70BA\u4F7F\u7528\u8005 {{username}} \u9023\u7DDA\u4E0A\u4E86 Dropbox\uFF01",protocol_dropbox_connect_succ_revoke:"\u60A8\u5DF2\u4F5C\u70BA\u4F7F\u7528\u8005 {{username}} \u9023\u7DDA\u4E0A\u4E86\u3002\u5982\u679C\u60A8\u60F3\u53D6\u6D88\u9023\u7DDA\uFF0C\u8ACB\u9EDE\u9078\u6B64\u6309\u9215\u3002",protocol_dropbox_connect_fail:"Dropbox \u7684\u56DE\u64A5\u8ACB\u6C42\u6709\u9EDE\u7570\u5E38\u3002\u60A8\u662F\u5426\u62D2\u7D55\u4E86\u9451\u6B0A\uFF1F",protocol_dropbox_connect_unknown:"\u4E0D\u77E5\u9053\u5982\u4F55\u8655\u7406\u6B64 callback\uFF1A{{params}}",protocol_onedrive_connecting:`\u6B63\u5728\u9023\u7DDA OneDrive\u2026\u2026 -\u8ACB\u4E0D\u8981\u95DC\u9589\u6B64\u5F48\u7A97\u3002`,protocol_onedrive_connect_succ_revoke:"\u60A8\u5DF2\u4F5C\u70BA\u4F7F\u7528\u8005 {{username}} \u9023\u7DDA\u4E0A\u4E86\u3002\u5982\u679C\u60A8\u60F3\u53D6\u6D88\u9023\u7DDA\uFF0C\u8ACB\u9EDE\u9078\u6B64\u6309\u9215\u3002",protocol_onedrive_connect_fail:"OneDrive \u7684\u56DE\u64A5\u8ACB\u6C42\u6709\u9EDE\u7570\u5E38\u3002\u60A8\u662F\u5426\u62D2\u7D55\u4E86\u9451\u6B0A\uFF1F",protocol_onedrive_connect_unknown:"\u4E0D\u77E5\u9053\u5982\u4F55\u8655\u7406\u6B64 callback\uFF1A{{params}}",command_startsync:"\u958B\u59CB\u540C\u6B65\uFF08start sync\uFF09",command_drynrun:"\u958B\u59CB\u540C\u6B65\uFF08\u7A7A\u8DD1\u6A21\u5F0F\uFF09\uFF08start sync (dry run only)\uFF09",command_exportsyncplans_json:"\u532F\u51FA\u540C\u6B65\u8A08\u5283\u70BA json \u683C\u5F0F\uFF08export sync plans in json format\uFF09",command_exportsyncplans_table:"\u532F\u51FA\u540C\u6B65\u8A08\u5283\u70BA\u8868\u683C\u683C\u5F0F\uFF08export sync plans in table format\uFF09",command_exportlogsindb:"\u5F9E\u8CC7\u6599\u5EAB\u532F\u51FA\u7D42\u7AEF\u65E5\u8A8C\uFF08export logs saved in db\uFF09",command_syncstatus:"\u53D6\u5F97\u540C\u6B65\u72C0\u614B",modal_password_title:"\u7A0D\u7B49\u4E00\u4E0B\uFF0C\u8ACB\u95B1\u8B80\u4E0B\u6587\uFF1A",modal_password_shortdesc:`\u5982\u679C\u5BC6\u78BC\u4E0D\u662F\u7A7A\u7684\uFF0C\u90A3\u9EBC\u6A94\u6848\u6703\u5728\u4E0A\u50B3\u4E4B\u524D\uFF0C\u5728\u672C\u5730\u5148\u7528\u6B64\u5BC6\u78BC\u52A0\u5BC6\u3002 -\u5982\u679C\u5BC6\u78BC\u662F\u7A7A\u7684\uFF0C\u90A3\u9EBC\u6A94\u6848\u6703\u88AB\u975E\u52A0\u5BC6\u5730\u4E0A\u50B3\u3002`,modal_password_attn1:"\u6CE8\u610F 1/5\uFF1A\u5132\u5B58\u5EAB\uFF08Vault\uFF09\u540D\u5B57\u662F\u4E0D\u6703\u52A0\u5BC6\u7684\uFF01\u672C\u5916\u639B\u6703\u5728\u4E00\u4E9B\u9060\u7AEF\u5132\u5B58\u88E1\u5EFA\u7ACB\u4E00\u500B\u548C\u5EAB\u540D\u5B57\u6709\u8457\u540C\u540D\u7684\u8CC7\u6599\u593E\u3002",modal_password_attn2:"\u6CE8\u610F 2/5\uFF1A\u5BC6\u78BC\u5728\u672C\u5730\u4E0D\u52A0\u5BC6\u5730\u5132\u5B58\uFF01",modal_password_attn3:"\u6CE8\u610F 3/5\uFF1A\u4E00\u4E9B\u5143\u8CC7\u8A0A\u662F\u6C92\u6709\u88AB\u52A0\u5BC6\u7684\uFF0C\u6216\u8005\u53EF\u4EE5\u88AB\u8F03\u5BB9\u6613\u5730\u731C\u6E2C\u51FA\u4F86\u3002\uFF08\u6A94\u6848\u5927\u5C0F\u5F88\u63A5\u8FD1\u65BC\u6C92\u52A0\u5BC6\u7684\u6642\u5019\uFF0C\u4E14\u8CC7\u6599\u593E\u53EF\u80FD\u6703\u88AB\u5132\u5B58\u70BA\u5927\u5C0F\u70BA 0 byte \u7684\u7269\u4EF6\u3002\uFF09",modal_password_attn4:"\u6CE8\u610F 4/5\uFF1A\u60A8\u9700\u8981\u78BA\u4FDD\u9060\u7AEF\u5132\u5B58\u662F\u201C\u7A7A\u201D\u7684\uFF0C\u6216\u8005\u5DF2\u6709\u6A94\u6848\u4E5F\u662F\u88AB\u540C\u4E00\u500B\u65B0\u5BC6\u78BC\u52A0\u5BC6\u7684\uFF1B\u5F9E\u800C\u907F\u514D\u885D\u7A81\u3002",modal_password_attn5:"\u6CE8\u610F 5/5\uFF1A\u5BC6\u78BC\u8D8A\u9577\u8D8A\u597D\u3002",modal_password_secondconfirm:"\u518D\u6B21\u78BA\u8A8D\u5132\u5B58\u65B0\u5BC6\u78BC",modal_password_notice:"\u65B0\u5BC6\u78BC\u5DF2\u5132\u5B58\uFF01",modal_remotebasedir_title:"\u60A8\u6B63\u5728\u4FEE\u6539\u9060\u7AEF\u57FA\u8CC7\u6599\u593E\u8A2D\u5B9A",modal_remotebasedir_shortdesc:`1. \u672C\u5916\u639B\u4E26\u4E0D\u6703\u81EA\u52D5\u5728\u9060\u7AEF\u628A\u5167\u5BB9\u5F9E\u820A\u8CC7\u6599\u593E\u79FB\u52D5\u5230\u65B0\u8CC7\u6599\u593E\u3002\u6240\u6709\u5167\u5BB9\u90FD\u6703\u91CD\u65B0\u540C\u6B65\u3002 -2. \u5982\u679C\u4F60\u4F7F\u5F97\u6587\u5B57\u8F38\u5165\u6846\u70BA\u7A7A\uFF0C\u90A3\u9EBC\u672C\u8A2D\u5B9A\u6703\u88AB\u91CD\u8A2D\u56DE\u5EAB\u7684\u8CC7\u6599\u593E\u540D\uFF08\u9810\u8A2D\u8A2D\u5B9A\uFF09\u3002 -3. \u5373\u4F7F\u60A8\u8A2D\u5B9A\u4E86\u7AEF\u5C0D\u7AEF\u52A0\u5BC6\u7684\u5BC6\u78BC\uFF0C\u9060\u7AEF\u8CC7\u6599\u593E\u540D\u7A31\u672C\u8EAB\u4E5F\u4E0D\u6703\u88AB\u52A0\u5BC6\u3002 -4. \u67D0\u4E9B\u7279\u6B8A\u5B57\u5143\uFF0C\u5982\u201C?\u201D\u3001\u201C/\u201D\u3001\u201C\\\u201D\u662F\u4E0D\u5141\u8A31\u7684\u3002\u6587\u5B57\u524D\u5F8C\u7684\u7A7A\u683C\u4E5F\u6703\u88AB\u81EA\u52D5\u522A\u53BB\u3002`,modal_remotebasedir_invaliddirhint:"\u60A8\u6240\u8F38\u5165\u7684\u5167\u5BB9\u542B\u6709\u67D0\u4E9B\u7279\u6B8A\u5B57\u5143\uFF0C\u5982\u201C?\u201D\u3001\u201C/\u201D\u3001\u201C\\\u201D\uFF0C\u5B83\u5011\u662F\u4E0D\u5141\u8A31\u7684\u3002",modal_remotebasedir_secondconfirm_vaultname:"\u91CD\u8A2D\u56DE\u9810\u8A2D\u7684\u5EAB\u8CC7\u6599\u593E\u540D",modal_remotebasedir_secondconfirm_change:"\u78BA\u8A8D\u4FEE\u6539",modal_remotebasedir_notice:"\u65B0\u7684\u9060\u7AEF\u57FA\u8CC7\u6599\u593E\u8A2D\u5B9A\u5DF2\u5132\u5B58\uFF01",modal_dropboxauth_manualsteps:`\u7B2C 1 \u6B65\uFF1A\u5728\u700F\u89BD\u5668\u4E2D\u8A2A\u554F\u4EE5\u4E0B\u5730\u5740\uFF0C\u7136\u5F8C\u6309\u7167\u7DB2\u9801\u63D0\u793A\u64CD\u4F5C\u3002 -\u5230\u4E86\u6700\u5F8C\uFF0C\u60A8\u61C9\u8A72\u6703\u7372\u5F97\u4E00\u4E32\u5F88\u9577\u7684\u7A0B\u5F0F\u78BC\u6587\u5B57\uFF0C\u8ACB\u8907\u88FD\u8CBC\u4E0A\u5230\u4E0B\u65B9\uFF0C\u4E26\u9EDE\u9078\u201C\u63D0\u4EA4\u201D`,modal_dropboxauth_autosteps:`\u5728\u700F\u89BD\u5668\u4E2D\u8A2A\u554F\u4EE5\u4E0B\u5730\u5740\uFF0C\u7136\u5F8C\u6309\u7167\u7DB2\u9801\u63D0\u793A\u64CD\u4F5C\u3002 -\u5230\u4E86\u6700\u5F8C\uFF0C\u60A8\u61C9\u8A72\u6703\u88AB\u81EA\u52D5\u91CD\u5B9A\u5411\u56DE\u4F86 Obsidian\u3002`,modal_dropboxauth_copybutton:"\u9EDE\u9078\u6B64\u6309\u9215\u5F9E\u800C\u8907\u88FD\u9451\u6B0A url",modal_dropboxauth_copynotice:"\u9451\u6B0A url \u5DF2\u8907\u88FD\u5230\u526A\u8CBC\u7C3F\uFF01",modal_dropboxauth_maualinput:"\u4F86\u81EA\u7DB2\u9801\u7684\u6388\u6B0A\u78BC",modal_dropboxauth_maualinput_desc:"\u60A8\u9700\u8981\u9EDE\u9078\u201C\u78BA\u8A8D\u201D",modal_dropboxauth_maualinput_notice:"\u6B63\u5728\u5617\u8A66\u9023\u7DDA Dropbox",modal_dropboxauth_maualinput_conn_succ:"\u5F88\u597D\uFF01\u6211\u5011\u4F5C\u70BA\u4F7F\u7528\u8005 {{username}} \u9023\u7DDA\u5230 Dropbox \u4E86\uFF01",modal_dropboxauth_maualinput_conn_succ_revoke:"\u60A8\u5DF2\u4F5C\u70BA\u4F7F\u7528\u8005 {{username}} \u9023\u7DDA\u5230 Dropbox\u3002\u5982\u679C\u60A8\u60F3\u65B7\u958B\u9023\u7DDA\uFF0C\u9EDE\u9078\u6B64\u6309\u9215\u3002",modal_dropboxauth_maualinput_conn_fail:"\u9023\u7DDA Dropbox \u9014\u4E2D\u51FA\u932F\u4E86\u3002",modal_onedriveauth_shortdesc:`\u5728\u700F\u89BD\u5668\u4E2D\u8A2A\u554F\u4EE5\u4E0B\u5730\u5740\uFF0C\u7136\u5F8C\u6309\u7167\u7DB2\u9801\u63D0\u793A\u64CD\u4F5C\u3002 -\u5230\u4E86\u6700\u5F8C\uFF0C\u60A8\u61C9\u8A72\u6703\u88AB\u81EA\u52D5\u91CD\u5B9A\u5411\u56DE\u4F86 Obsidian\u3002`,modal_onedriveauth_copybutton:"\u9EDE\u9078\u6B64\u6309\u9215\u5F9E\u800C\u8907\u88FD\u9451\u6B0A url",modal_onedriveauth_copynotice:"\u9451\u6B0A url \u5DF2\u8907\u88FD\u5230\u526A\u8CBC\u7C3F\uFF01",modal_onedriverevokeauth_step1:"\u7B2C 1 \u6B65\uFF1A\u7528\u700F\u89BD\u5668\u958B\u555F\u4EE5\u4E0B\u5730\u5740\uFF0C\u9EDE\u9078\u672C\u5916\u639B\u5C0D\u61C9\u7684\u201CEdit\u201D\u6309\u9215\uFF0C\u9EDE\u9078\u201CRemove these permissions\u201D\u6309\u9215\u3002",modal_onedriverevokeauth_step2:"\u7B2C 2 \u6B65\uFF1A\u9EDE\u9078\u4EE5\u4E0B\u6309\u9215\uFF0C\u6E05\u7406\u672C\u5730\u5132\u5B58\u7684\u767B\u5165\u8CC7\u8A0A\u3002",modal_onedriverevokeauth_clean:"\u6E05\u7406\u672C\u5730\u5132\u5B58\u7684\u767B\u5165\u8CC7\u8A0A",modal_onedriverevokeauth_clean_desc:"\u60A8\u9700\u8981\u9EDE\u9078\u201C\u6E05\u7406\u201D\u6309\u9215\u3002",modal_onedriverevokeauth_clean_button:"\u6E05\u7406",modal_onedriverevokeauth_clean_notice:"\u5DF2\u6E05\u7406\uFF01",modal_onedriverevokeauth_clean_fail:"\u9451\u6B0A\u9014\u4E2D\u51FA\u932F\u4E86\u3002",modal_syncconfig_attn:`\u6CE8\u610F 1/3\uFF1A\u6B64\u8A2D\u5B9A\u53EA\u540C\u6B65\uFF08\u8907\u88FD\uFF09\u6574\u500B Obsidian \u7684\u914D\u7F6E\u8CC7\u6599\u593E\uFF0C\u4F46\u662F\u4E0D\u6703\u540C\u6B65\u5176\u5B83 . \u958B\u982D\u7684\u8CC7\u6599\u593E\u6216\u6A94\u6848\u3002\u9664\u4E86\u6703\u5FFD\u7565 .git \u548C node_modules \u8CC7\u6599\u593E\u4E4B\u5916\uFF0C\u5B83\u4E5F\u4E26\u4E0D\u7406\u89E3\u914D\u7F6E\u8CC7\u6599\u593E\u7684\u88E1\u5404\u500B\u5B50\u6A94\u6848\u6216\u5B50\u8CC7\u6599\u593E\u7684\u542B\u7FA9\u3002 -\u6CE8\u610F 2/3\uFF1A\u914D\u7F6E\u8CC7\u6599\u593E\u88AB\u540C\u6B65\u4E4B\u5F8C\uFF0C\u5404\u5916\u639B\u7684\u8A2D\u5B9A\u6216\u8A31\u6703\u51FA\u932F\uFF0C\u4E14 Obsidian \u6216\u8A31\u9700\u8981\u91CD\u555F\u4F86\u904E\u8F09\u5404\u5916\u639B\u7684\u65B0\u914D\u7F6E\u3002 -\u6CE8\u610F 3/3\uFF1A\u914D\u7F6E\u8CC7\u6599\u593E\u5167\u7684\u522A\u9664\uFF08\u89E3\u9664\u5B89\u88DD\uFF09\u64CD\u4F5C\u7121\u6CD5\u88AB\u8B58\u5225\uFF0C\u56E0\u6B64\uFF0C\u5982\u679C\u60A8\u60F3\u89E3\u9664\u5B89\u88DD\u4E00\u500B\u5916\u639B\uFF0C\u5728\u4E0B\u4E00\u6B21\u540C\u6B65\u4E4B\u524D\uFF0C\u60A8\u9700\u8981\u624B\u52D5\u5728\u6240\u6709\u88DD\u7F6E\u4E0A\u5148\u624B\u52D5\u89E3\u9664\u5B89\u88DD\u90A3\u500B\u5916\u639B\u3002 -\u5982\u679C\u60A8\u540C\u610F\u81EA\u884C\u627F\u53D7\u4EE5\u4E0A\u98A8\u96AA\uFF0C\u60A8\u53EF\u4EE5\u9EDE\u9078\u4EE5\u4E0B\u518D\u6B21\u78BA\u8A8D\u6309\u9215\u3002`,modal_syncconfig_secondconfirm:"\u518D\u6B21\u78BA\u8A8D\u958B\u555F",modal_syncconfig_notice:"\u60A8\u5DF2\u958B\u555F\u914D\u7F6E\u8CC7\u6599\u593E\u7684\u540C\u6B65\uFF01",modal_qr_shortdesc:`\u9019\u88E1\u53EF\u532F\u51FA\u975E oauth2 \u8A2D\u5B9A\u3002\uFF08\u610F\u5473\u8457\uFF1ADropbox \u548C OneDrive \u8CC7\u8A0A\u4E0D\u6703\u88AB\u532F\u51FA\u3002\uFF09 -\u60A8\u53EF\u4EE5\u4F7F\u7528\u53E6\u4E00\u500B\u88DD\u7F6E\u4F86\u6383\u63CF\u6B64 QR \u78BC\u3002 -\u53C8\u6216\u8005\uFF0C\u60A8\u53EF\u4EE5\u9EDE\u9078\u4EE5\u4E0B\u6309\u9215\u8907\u88FD\u6B64\u7279\u6B8A URI\u3002`,modal_qr_button:"\u9EDE\u9078\u6B64\u6309\u9215\u8907\u88FD\u7279\u6B8A URI",modal_qr_button_notice:"\u7279\u6B8A URI \u5DF2\u88AB\u8907\u5236\u5230\u526A\u8CBC\u7C3F\uFF01",modal_sizesconflict_title:"Remotely Sync\uFF1A\u8DF3\u904E\u5927\u6A94\u6848\u7684\u6642\u5019\u51FA\u73FE\u4E86\u4E00\u4E9B\u885D\u7A81",modal_sizesconflict_desc:`\u60A8\u8A2D\u5B9A\u4E86\u8DF3\u904E\u540C\u6B65\u5927\u65BC {{thresholdMB}} MB\uFF08{{thresholdBytes}} bytes\uFF09\u7684\u6A94\u6848\u3002 -\u4F46\u662F\u4EE5\u4E0B\u6A94\u6848\u7684\u5927\u5C0F\uFF0C\u5728\u4E00\u7AEF\u5927\u65BC\u95BE\u503C\uFF0C\u5728\u53E6\u4E00\u7AEF\u5247\u5C0F\u65BC\u95BE\u503C\u3002 -\u70BA\u4E86\u907F\u514D\u610F\u5916\u7684\u8986\u84CB\u6216\u522A\u9664\uFF0C\u5916\u639B\u505C\u6B62\u4E86\u904B\u4F5C\uFF0C\u60A8\u9700\u8981\u624B\u52D5\u8655\u7406\u81F3\u5C11\u4E00\u7AEF\u7684\u6A94\u6848\u3002`,modal_sizesconflict_copybutton:"\u9EDE\u9078\u4EE5\u8907\u88FD\u4EE5\u4E0B\u6240\u6709\u6A94\u6848\u5927\u5C0F\u885D\u7A81\u8CC7\u8A0A",modal_sizesconflict_copynotice:"\u6240\u6709\u7684\u6A94\u6848\u5927\u5C0F\u885D\u7A81\u8CC7\u8A0A\uFF0C\u5DF2\u88AB\u8907\u5236\u5230\u526A\u8CBC\u7C3F\uFF01",settings_basic:"\u57FA\u672C\u8A2D\u5B9A",settings_password:"\u5BC6\u78BC",settings_password_desc:"\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u5BC6\u78BC\u3002\u4E0D\u586B\u5BEB\u5247\u4EE3\u8868\u6C92\u5BC6\u78BC\u3002\u60A8\u9700\u8981\u9EDE\u9078\u201C\u78BA\u8A8D\u201D\u4F86\u4FEE\u6539\u3002\u6CE8\u610F\uFF1A\u5BC6\u78BC\u548C\u5176\u5B83\u8CC7\u8A0A\u90FD\u6703\u5728\u672C\u5730\u5132\u5B58\u3002",settings_autorun:"\u81EA\u52D5\u57F7\u884C",settings_autorun_desc:"\u6BCF\u9694\u4E00\u6BB5\u6642\u9593\uFF0C\u6B64\u5916\u639B\u5617\u8A66\u81EA\u52D5\u540C\u6B65\u3002\u6703\u5F71\u97FF\u5230\u96FB\u6C60\u7528\u91CF\u3002\uFF08\u53EF\u80FD\u7121\u6CD5\u8207\u201C\u9060\u7AEF\u66F4\u6539\u6642\u540C\u6B65\u201D\u914D\u5408\u4F7F\u7528\uFF09",settings_autorun_notset:"\uFF08\u4E0D\u8A2D\u5B9A\uFF09",settings_autorun_second:"\u6BCF {{time}} \u79D2",settings_autorun_1min:"\u6BCF 1 \u5206\u9418",settings_autorun_5min:"\u6BCF 5 \u5206\u9418",settings_autorun_10min:"\u6BCF 10 \u5206\u9418",settings_autorun_30min:"\u6BCF 30 \u5206\u9418",settings_saverun:"\u4FDD\u5B58\u6642\u540C\u6B65",settings_saverun_desc:"\u6587\u4EF6\u4FDD\u5B58\u5F8C\uFF0C\u63D2\u4EF6\u5C07\u5728\u6307\u5B9A\u6642\u9593\u5F8C\u540C\u6B65\u3002\u6703\u5F71\u97FF\u5230\u96FB\u6C60\u7528\u91CF\u3002",settings_saverun_notset:"\uFF08\u4E0D\u8A2D\u5B9A\uFF09",settings_saverun_instant:"\u5373\u523B",settings_saverun_5sec:"5\u79D2\u5F8C",settings_saverun_10sec:"10\u79D2\u5F8C",settings_saverun_30sec:"30\u79D2\u5F8C",settings_saverun_1min:"1\u5206\u9418\u5F8C",settings_remoterun:"\u9060\u7AEF\u66F4\u6539\u6642\u540C\u6B65",settings_remoterun_desc:"\u63D2\u4EF6\u6703\u5728\u6BCF\u500B\u6587\u4EF6\u4FDD\u5B58\u5F8C\u5617\u8A66\u540C\u6B65\u3002\u6703\u5F71\u97FF\u5230\u96FB\u6C60\u7528\u91CF\u3002\uFF08\u66F4\u6539\u5F8C\u53EF\u80FD\u9700\u8981\u91CD\u65B0\u555F\u52D5\uFF09",settings_remoterun_notset:"\uFF08\u4E0D\u8A2D\u5B9A\uFF09",settings_remoterun_1sec:"\u6BCF1\u79D2",settings_remoterun_5sec:"\u6BCF5\u79D2",settings_remoterun_10sec:"\u6BCF10\u79D2",settings_remoterun_1min:"\u6BCF1\u5206\u9418",settings_runoncestartup:"\u555F\u52D5\u5F8C\u81EA\u52D5\u57F7\u884C\u4E00\u6B21",settings_runoncestartup_desc:"\u672C\u8A2D\u5B9A\u4F7F\u5F97\u5916\u639B\u5728\u7A0B\u5F0F\u555F\u52D5\u5F8C\u81EA\u52D5\u89F8\u767C\u4E00\u6B21\u540C\u6B65\u3002\u4FEE\u6539\u5F8C\uFF0C\u6703\u5728\u4E0B\u4E00\u6B21\u555F\u52D5\u751F\u6548\u3002\u672C\u8A2D\u5B9A\u548C\u201C\u81EA\u52D5\u57F7\u884C\u201D\u662F\u4E0D\u540C\u7684\uFF0C\u90A3\u500B\u8A2D\u5B9A\u662F\u6307\u201C\u6BCF\u9694\u4E00\u6BB5\u6642\u9593\u201D\u90FD\u81EA\u52D5\u540C\u6B65\u4E00\u6B21\u3002",settings_runoncestartup_notset:"\uFF08\u4E0D\u8A2D\u5B9A\uFF09",settings_runoncestartup_1sec:"\u555F\u52D5\u5F8C\u7B2C 1 \u79D2\u57F7\u884C\u4E00\u6B21",settings_runoncestartup_10sec:"\u555F\u52D5\u5F8C\u7B2C 10 \u79D2\u57F7\u884C\u4E00\u6B21",settings_runoncestartup_30sec:"\u555F\u52D5\u5F8C\u7B2C 30 \u79D2\u57F7\u884C\u4E00\u6B21",settings_skiplargefiles:"\u8DF3\u904E\u5927\u6A94\u6848\uFF08\u5BE6\u9A57\u6027\u8CEA\uFF09",settings_skiplargefiles_desc:"\u8DF3\u904E\u5927\u65BC\u67D0\u4E00\u500B\u95BE\u503C\u7684\u6A94\u6848\u3002\u9019\u88E1 1 MB = 10^6 bytes\u3002",settings_skiplargefiles_notset:"\uFF08\u4E0D\u8A2D\u5B9A\uFF09",settings_checkonnectivity:"\u6AA2\u67E5\u53EF\u5426\u9023\u7DDA",settings_checkonnectivity_desc:"\u6AA2\u67E5\u53EF\u5426\u9023\u7DDA\u3002",settings_checkonnectivity_button:"\u6AA2\u67E5",settings_checkonnectivity_checking:"\u6B63\u5728\u6AA2\u67E5\u2026\u2026",settings_remotebasedir:"\u4FEE\u6539\u9060\u7AEF\u57FA\u8CC7\u6599\u593E\uFF08\u5BE6\u9A57\u6027\u8CEA\uFF09",settings_remotebasedir_desc:"\u9810\u8A2D\u8A2D\u5B9A\uFF0C\u5167\u5BB9\u6703\u88AB\u540C\u6B65\u5230\u9060\u7AEF\u7684\u548C\u8CC7\u6599\u5EAB\u540C\u540D\u7684\u8CC7\u6599\u593E\u4E0B\u3002\u60A8\u53EF\u4EE5\u5728\u6B64\u4FEE\u6539\u9060\u7AEF\u8CC7\u6599\u593E\u540D\uFF0C\u6216\u522A\u9664\u8F38\u5165\u6846\u6587\u5B57\u5F9E\u800C\u91CD\u8A2D\u5230\u9810\u8A2D\u503C\u3002\u60A8\u9700\u8981\u9EDE\u9078\u201C\u78BA\u8A8D\u201D\u3002",settings_s3:"S3 \u6216\u76F8\u5BB9 S3 \u7684\u670D\u52D9\u7684\u8A2D\u5B9A",settings_s3_disclaimer1:"\u5BA3\u544A\uFF1A\u672C\u5916\u639B\u4E0D\u662F Amazon \u7684\u5B98\u65B9\u7522\u54C1\u3002",settings_s3_disclaimer2:"\u5BA3\u544A\uFF1A\u60A8\u6240\u8F38\u5165\u7684\u8CC7\u8A0A\u5132\u5B58\u65BC\u672C\u5730\u3002\u5176\u5B83\u6709\u5BB3\u7684\u6216\u8005\u51FA\u932F\u7684\u5916\u639B\uFF0C\u662F\u6709\u53EF\u80FD\u8B80\u53D6\u5230\u9019\u4E9B\u8CC7\u8A0A\u7684\u3002\u5982\u679C\u60A8\u767C\u73FE\u4E86\u5132\u5B58\u6876\u6709\u4E0D\u7B26\u5408\u9810\u671F\u7684\u8A2A\u554F\uFF0C\u8ACB\u7ACB\u523B\u5F9E AWS\uFF08\u6216\u5176\u5B83 S3 \u670D\u52D9\u5546\uFF09\u522A\u9664\u8A18\u9304\u65BC\u6B64\u7684 access key\u3002",settings_s3_cors:"\u60A8\u9700\u8981\u8A2D\u5B9A CORS\uFF0C\u5F9E\u800C\u5141\u8A31\u9019\u4E9B\u6E90\u7684\u8ACB\u6C42\u8A2A\u554F\uFF1Aapp://obsidian.md \u548C capacitor://localhost \u548C http://localhost \u4E14\u589E\u52A0 ETag \u5230\u66B4\u9732 headers \u88E1\u3002",settings_s3_prod:"\u4E00\u4E9B\u53EF\u53C3\u8003\u7684 Amazon S3 \u5B98\u65B9\u6587\u4EF6\uFF1A",settings_s3_prod1:"\u670D\u52D9\u5730\u5740\uFF08Endpoint\uFF09\u548C\u5340\u57DF\uFF08Region\uFF09\u8CC7\u8A0A",settings_s3_prod2:"Access Key ID \u548C Secret Access Key \u8CC7\u8A0A",settings_s3_prod3:"\u8A2D\u5B9A CORS",settings_s3_endpoint:"\u670D\u52D9\u5730\u5740\uFF08Endpoint\uFF09",settings_s3_region:"\u5340\u57DF\uFF08Region\uFF09",settings_s3_region_desc:"\u5982\u679C\u60A8\u4E0D\u77E5\u9053\u9019\u500B\u503C\u586B\u4EC0\u9EBC\uFF0C\u53EF\u4EE5\u5617\u8A66\u586B\u5BEB\u6B64\u9810\u8A2D\u503C\uFF1Aus-east-1",settings_s3_accesskeyid:"Access Key ID",settings_s3_accesskeyid_desc:"Access key ID\u3002\u6CE8\u610F\uFF1Aaccess key ID \u548C\u5176\u5B83\u8CC7\u8A0A\u90FD\u6703\u5728\u672C\u5730\u5132\u5B58\u3002",settings_s3_secretaccesskey:"Secret Access Key",settings_s3_secretaccesskey_desc:"Secret access key\u3002\u6CE8\u610F\uFF1Asecret access key \u548C\u5176\u5B83\u8CC7\u8A0A\u90FD\u6703\u5728\u672C\u5730\u5132\u5B58\u3002",settings_s3_bucketname:"\u5132\u5B58\u6876\uFF08Bucket\uFF09\u7684\u540D\u5B57",settings_s3_bypasscorslocally:"\u672C\u5730\u7E5E\u904E CORS \u554F\u984C",settings_s3_bypasscorslocally_desc:"\u5C0D\u65BC Obsidian \u65B0\u7248\u672C\uFF08\u684C\u9762\u7248>=0.13.25 \u6216 iOS>=1.1.1 \u6216 Android>=1.2.1\uFF09\uFF0C\u672C\u5916\u639B\u53EF\u4EE5\u8DF3\u904E\u4F3A\u670D\u5668\u8A2D\u5B9A CORS \u7684\u6B65\u9A5F\u3002\u5982\u679C\u60A8\u9047\u5230\u4EFB\u610F\u554F\u984C\uFF0C\u53EF\u4EE5\u95DC\u9589\u6B64\u8A2D\u5B9A\uFF0C\u4E26\u5728\u670D\u52D9\u7AEF\u8A2D\u5B9A CORS\uFF08\u5141\u8A31\u4F86\u81EA app://obsidian.md \u548C capacitor://localhost \u548C http://localhost \u7684\u8ACB\u6C42\u4E14\u589E\u52A0 ETag \u5230\u66B4\u9732 headers \u88E1\uFF09\u3002",settings_s3_parts:"\u5206\u584A\u4E26\u884C\u5EA6",settings_s3_parts_desc:"\u5728 S3 \u88E1\uFF0C\u5927\u6A94\u6848\u6703\u88AB\u5206\u584A\u4E0A\u50B3\u3002\u60A8\u5E0C\u671B\u540C\u4E00\u6642\u9593\u6700\u591A\u6709\u591A\u5C11\u500B\u5206\u584A\u88AB\u4E0A\u50B3\uFF1F",settings_s3_urlstyle:"S3 URL style",settings_s3_urlstyle_desc:"\u662F\u5426\u5C0D S3 \u7269\u4EF6\u5F37\u5236\u4F7F\u7528 path style URL\uFF08\u4F8B\u5982\u4F7F\u7528 https://s3.amazonaws.com/*/ \u800C\u4E0D\u662F https://*.s3.amazonaws.com/\uFF09\u3002",settings_s3_connect_succ:"\u5F88\u597D\uFF01\u53EF\u4EE5\u8A2A\u554F\u5230\u5C0D\u61C9\u5132\u5B58\u6876\u3002",settings_s3_connect_fail:"\u7121\u6CD5\u8A2A\u554F\u5230\u5C0D\u61C9\u5132\u5B58\u6876\u3002",settings_dropbox:"Dropbox \u8A2D\u5B9A",settings_dropbox_disclaimer1:"\u5BA3\u544A\uFF1A\u6B64\u5916\u639B\u4E0D\u662F Dropbox \u5B98\u65B9\u7522\u54C1\u3002",settings_dropbox_disclaimer2:"\u5BA3\u544A\uFF1A\u60A8\u6240\u8F38\u5165\u7684\u8CC7\u8A0A\u5132\u5B58\u65BC\u672C\u5730\u3002\u5176\u5B83\u6709\u5BB3\u7684\u6216\u8005\u51FA\u932F\u7684\u5916\u639B\uFF0C\u662F\u6709\u53EF\u80FD\u8B80\u53D6\u5230\u9019\u4E9B\u8CC7\u8A0A\u7684\u3002\u5982\u679C\u60A8\u767C\u73FE\u4E86 Dropbox \u6709\u4E0D\u7B26\u5408\u9810\u671F\u7684\u8A2A\u554F\uFF0C\u8ACB\u7ACB\u523B\u5F9E https://www.dropbox.com/account/connected_apps \u522A\u9664\u8A18\u9304\u65BC\u6B64\u5916\u639B\u7684\u9023\u7DDA\u9451\u6B0A\u3002",settings_dropbox_folder:"\u6211\u5011\u6703\u5728\u60A8\u7684 Dropbox \u4E0A\u5EFA\u7ACB\u6B64\u8CC7\u6599\u593E\u4E26\u5728\u88E1\u9762\u540C\u6B65\uFF1A/Apps/{{pluginID}}/{{remoteBaseDir}}\u3002",settings_dropbox_revoke:"\u64A4\u56DE\u9451\u6B0A",settings_dropbox_revoke_desc:"\u60A8\u73FE\u5728\u4F7F\u7528\u4E86\u4F7F\u7528\u8005\u540D\u7A31 {{username}} \u4F86\u9023\u7DDA\u3002\u5982\u679C\u60F3\u53D6\u6D88\u9023\u7DDA\uFF0C\u8ACB\u9EDE\u9078\u6B64\u6309\u9215\u3002",settings_dropbox_revoke_button:"\u64A4\u56DE\u9451\u6B0A",settings_dropbox_revoke_notice:"\u9451\u6B0A\u5DF2\u88AB\u64A4\u56DE\uFF01",settings_dropbox_revoke_noticeerr:"\u64A4\u56DE\u9451\u6B0A\u51FA\u932F\u3002",settings_dropbox_clearlocal:"\u6E05\u9664\u672C\u5730\u5132\u5B58\u7684\u9451\u6B0A\u8CC7\u8A0A",settings_dropbox_clearlocal_desc:"\u60A8\u53EF\u4EE5\u5F37\u5236\u6E05\u9664\u672C\u5730\u5DF2\u5132\u5B58\u7684 Dropbox \u7684\u767B\u5165\u9451\u6B0A\u8CC7\u8A0A\uFF0C\u4F46\u4E0D\u5411\u4F3A\u670D\u5668\u50B3\u9001\u64A4\u56DE\u9451\u6B0A\u7684\u8ACB\u6C42\u3002",settings_dropbox_clearlocal_button:"\u6E05\u9664",settings_dropbox_clearlocal_notice:"\u5DF2\u6E05\u9664\uFF01",settings_dropbox_auth:"\u9451\u6B0A",settings_dropbox_auth_desc:"\u9451\u6B0A\u3002",settings_dropbox_auth_button:"\u9451\u6B0A",settings_dropbox_connect_succ:"\u5F88\u597D\uFF01\u6211\u5011\u53EF\u9023\u7DDA\u4E0A Dropbox\uFF01",settings_dropbox_connect_fail:"\u6211\u5011\u672A\u80FD\u9023\u7DDA\u4E0A Dropbox\u3002",settings_onedrive:"Onedrive\uFF08\u500B\u4EBA\u7248\uFF09\u8A2D\u5B9A",settings_onedrive_disclaimer1:"\u5BA3\u544A\uFF1A\u6B64\u5916\u639B\u4E0D\u662F\u5FAE\u8EDF\u6216 OneDrive \u7684\u5B98\u65B9\u7522\u54C1\u3002",settings_onedrive_disclaimer2:"\u5BA3\u544A\uFF1A\u60A8\u6240\u8F38\u5165\u7684\u8CC7\u8A0A\u5132\u5B58\u65BC\u672C\u5730\u3002\u5176\u5B83\u6709\u5BB3\u7684\u6216\u8005\u51FA\u932F\u7684\u5916\u639B\uFF0C\u662F\u6709\u53EF\u80FD\u8B80\u53D6\u5230\u9019\u4E9B\u8CC7\u8A0A\u7684\u3002\u5982\u679C\u60A8\u767C\u73FE\u4E86 OneDrive \u6709\u4E0D\u7B26\u5408\u9810\u671F\u7684\u8A2A\u554F\uFF0C\u8ACB\u7ACB\u523B\u5F9E https://microsoft.com/consent \u522A\u9664\u8A18\u9304\u65BC\u6B64\u5916\u639B\u7684\u9023\u7DDA\u9451\u6B0A\u3002",settings_onedrive_folder:"\u6211\u5011\u6703\u5728\u60A8\u7684 OneDrive \u4E0A\u5EFA\u7ACB\u6B64\u8CC7\u6599\u593E\u4E26\u5728\u88E1\u9762\u540C\u6B65\uFF1A/Apps/{{pluginID}}/{{remoteBaseDir}}\u3002",settings_onedrive_nobiz:"\u73FE\u5728\u53EA\u652F\u63F4\u500B\u4EBA\u7248 OneDrive\u3002\uFF08\u66AB\u6642\uFF09\u4E26\u4E0D\u652F\u63F4\u4F01\u696D\u7248 OneDrive\u3002",settings_onedrive_revoke:"\u64A4\u56DE\u9451\u6B0A",settings_onedrive_revoke_desc:"\u60A8\u73FE\u5728\u4F7F\u7528\u4E86\u4F7F\u7528\u8005\u540D\u7A31 {{username}} \u4F86\u9023\u7DDA\u3002\u5982\u679C\u60F3\u53D6\u6D88\u9023\u7DDA\uFF0C\u8ACB\u9EDE\u9078\u6B64\u6309\u9215\u3002",settings_onedrive_revoke_button:"\u64A4\u56DE\u9451\u6B0A",settings_onedrive_auth:"\u9451\u6B0A",settings_onedrive_auth_desc:"\u9451\u6B0A\u3002",settings_onedrive_auth_button:"\u9451\u6B0A",settings_onedrive_connect_succ:"\u5F88\u597D\uFF01\u6211\u5011\u53EF\u9023\u7DDA\u4E0A OneDrive\uFF01",settings_onedrive_connect_fail:"\u6211\u5011\u672A\u80FD\u9023\u7DDA\u4E0A OneDrive\u3002",settings_webdav:"Webdav \u8A2D\u5B9A",settings_webdav_disclaimer1:"\u5BA3\u544A\uFF1A\u60A8\u6240\u8F38\u5165\u7684\u8CC7\u8A0A\u5132\u5B58\u65BC\u672C\u5730\u3002\u5176\u5B83\u6709\u5BB3\u7684\u6216\u8005\u51FA\u932F\u7684\u5916\u639B\uFF0C\u662F\u6709\u53EF\u80FD\u8B80\u53D6\u5230\u9019\u4E9B\u8CC7\u8A0A\u7684\u3002\u5982\u679C\u60A8\u767C\u73FE\u4E86 Webdav \u4F3A\u670D\u5668\u6709\u4E0D\u7B26\u5408\u9810\u671F\u7684\u8A2A\u554F\uFF0C\u8ACB\u7ACB\u523B\u4FEE\u6539\u4F7F\u7528\u8005\u540D\u7A31\u548C\u5BC6\u78BC\u3002",settings_webdav_cors_os:"Obsidian \u684C\u9762\u7248>=0.13.25 \u6216 iOS>=1.1.1 \u6216 Android>=1.1.1 \u652F\u63F4\u8DF3\u904E CORS \u8A2D\u5B9A\u3002\u4F46\u60A8\u6B63\u5728\u4F7F\u7528\u820A\u7248\uFF0C\u5EFA\u8B70\u5347\u7D1A\u3002",settings_webdav_cors:"\u60A8\u9700\u8981\u8A2D\u5B9A CORS\uFF0C\u5141\u8A31\u4F86\u81EA\u9019\u4E9B\u6E90\u7684\u8ACB\u6C42\uFF1Aapp://obsidian.md \u548C capacitor://localhost \u548C http://localhost\u3002",settings_webdav_folder:"\u6211\u5011\u6703\u5728\u60A8\u7684\u4F3A\u670D\u5668\u4E0A\u5EFA\u7ACB\u6B64\u8CC7\u6599\u593E\u4E26\u5728\u88E1\u9762\u540C\u6B65\uFF1A/{{remoteBaseDir}}",settings_webdav_addr:"\u4F3A\u670D\u5668\u5730\u5740",settings_webdav_addr_desc:"\u4F3A\u670D\u5668\u5730\u5740\u3002",settings_webdav_user:"\u4F7F\u7528\u8005\u540D\u7A31",settings_webdav_user_desc:"\u4F7F\u7528\u8005\u540D\u7A31\u3002\u6CE8\u610F\uFF1A\u4F7F\u7528\u8005\u540D\u7A31\u548C\u5176\u5B83\u8CC7\u8A0A\u90FD\u6703\u5132\u5B58\u5728\u672C\u5730\u3002",settings_webdav_password:"\u5BC6\u78BC",settings_webdav_password_desc:"\u5BC6\u78BC\u3002\u6CE8\u610F\uFF1A\u5BC6\u78BC\u548C\u5176\u5B83\u8CC7\u8A0A\u90FD\u6703\u5132\u5B58\u5728\u672C\u5730\u3002",settings_webdav_auth:"\u9451\u6B0A\u578B\u5225",settings_webdav_auth_desc:"\u5982\u679C\u4E0D\u586B\u5BEB\u5BC6\u78BC\uFF0C\u672C\u8A2D\u5B9A\u6703\u88AB\u5FFD\u7565\u3002",settings_webdav_depth:"\u50B3\u9001\u5230\u4F3A\u670D\u5668\u7684 Depth header",settings_webdav_depth_desc:"Webdav \u4F3A\u670D\u5668\u6703\u88AB\u8A2D\u70BA\u63A5\u6536 Depth header \u70BA\u201C1\u201D\u6216\u201CInfinity\u201D\u8ACB\u6C42\u3002\u672C\u5916\u639B\u9700\u8981\u5F97\u77E5\u6B64\u8CC7\u8A0A\u3002\u5982\u679C\u60A8\u4E0D\u6E05\u695A\u5982\u4F55\u8A2D\u5B9A\uFF0C\u53EF\u4EE5\u9078\u64C7\u201C\u81EA\u52D5\u6AA2\u6E2C\u201D",settings_webdav_depth_auto:"\u81EA\u52D5\u6AA2\u6E2C",settings_webdav_depth_1:"\u53EA\u652F\u63F4 depth='1'",settings_webdav_depth_inf:"\u652F\u63F4 depth='infinity'",settings_webdav_connect_succ:"\u5F88\u597D\uFF01\u53EF\u4EE5\u9023\u7DDA\u4E0A Webdav \u4F3A\u670D\u5668\u3002",settings_webdav_connect_fail:"\u7121\u6CD5\u9023\u7DDA\u4E0A Webdav \u4F3A\u670D\u5668\u3002\uFF08\u53EF\u80FD\u662F\u5730\u5740/\u8CEC\u865F/\u5BC6\u78BC/\u9451\u6B0A\u578B\u5225\u7B49\u932F\u8AA4\u3002\uFF09",settings_webdav_connect_fail_withcors:"\u7121\u6CD5\u9023\u7DDA\u4E0A Webdav \u4F3A\u670D\u5668\u3002\uFF08\u53EF\u80FD\u662F\u5730\u5740/\u8CEC\u865F/\u5BC6\u78BC/\u9451\u6B0A\u578B\u5225/CORS \u7B49\u932F\u8AA4\u3002\uFF09",settings_chooseservice:"\u9078\u64C7\u9060\u7AEF\u670D\u52D9",settings_chooseservice_desc:"\u5F9E\u9019\u88E1\u958B\u59CB\u8A2D\u5B9A\u3002\u60A8\u60F3\u9023\u7DDA\u5230\u54EA\u4E00\u500B\u670D\u52D9\uFF1FS3\u3001Dropbox\u3001Webdav\u3001OneDrive\uFF08\u500B\u4EBA\u7248\uFF09\uFF1F",settings_chooseservice_s3:"S3 \u6216\u76F8\u5BB9 S3 \u7684\u670D\u52D9",settings_chooseservice_dropbox:"Dropbox",settings_chooseservice_webdav:"Webdav",settings_chooseservice_onedrive:"OneDrive\uFF08\u500B\u4EBA\u7248\uFF09",settings_adv:"\u9032\u968E\u8A2D\u5B9A",settings_concurrency:"\u4E26\u884C\u5EA6",settings_concurrency_desc:"\u60A8\u5E0C\u671B\u540C\u6642\u6700\u591A\u6709\u591A\u5C11\u500B\u6A94\u6848\u88AB\u4E0A\u50B3\u548C\u4E0B\u8F09\uFF1F\u9810\u8A2D\u503C\u662F 5\u3002\u5982\u679C\u60A8\u9047\u5230\u4E86\u4E00\u4E9B\u554F\u984C\uFF08\u5982\u8A2A\u554F\u983B\u7387\u9650\u5236\uFF09\uFF0C\u60A8\u53EF\u4EE5\u6E1B\u5C11\u4E26\u884C\u5EA6\u3002",settings_syncunderscore:"\u540C\u6B65 _ \u6A94\u6848\u6216\u8CC7\u6599\u593E",settings_syncunderscore_desc:"\u662F\u5426\u540C\u6B65\u201C_\u201D\uFF08\u4E0B\u5283\u7DDA\uFF09\u958B\u59CB\u7684\u6A94\u6848\u6216\u8CC7\u6599\u593E\u3002",settings_sync_hash_files:"\u4F7F\u7528\u6587\u4EF6\u54C8\u5E0C\u4F86\u8DDF\u8E2A\u91CD\u547D\u540D\u7684\u6587\u4EF6",settings_sync_hash_files_desc:"\u80FD\u5920\u66F4\u597D\u5730\u8DDF\u8E2A Obsidian \u4E4B\u5916\u7684\u91CD\u547D\u540D\u6587\u4EF6\u3002",settings_configdir:"\u540C\u6B65\u914D\u7F6E\u8CC7\u6599\u593E\uFF08\u5BE6\u9A57\u6027\u8CEA\uFF09",settings_configdir_desc:"\u662F\u5426\u540C\u6B65 Obsidian \u7684\u914D\u7F6E\u8CC7\u6599\u593E {{configDir}}\uFF08\u5176\u4E2D\u7684 .git \u548C node_modules \u4F9D\u7136\u6703\u88AB\u5FFD\u7565\uFF09\u3002\u8ACB\u6CE8\u610F\uFF0C\u6B64\u8A2D\u5B9A\u53EF\u80FD\u6703\u5F71\u97FF\u5230\u60A8 Obsidian \u6216\u8005\u6240\u6709\u7684\u5916\u639B\u8A2D\u5B9A\uFF0C\u4E5F\u53EF\u80FD\u9700\u8981\u60A8\u540C\u6B65\u5B8C\u7562\u5F8C\u91CD\u555F Obsidian\u3002\u5982\u679C\u60A8\u540C\u610F\u81EA\u884C\u627F\u53D7\u5176\u98A8\u96AA\uFF0C\u5247\u53EF\u4EE5\u958B\u555F\u672C\u8A2D\u5B9A\u3002",settings_importexport:"\u532F\u5165\u532F\u51FA\u90E8\u5206\u8A2D\u5B9A",settings_export:"\u532F\u51FA",settings_export_desc:"\u7528 QR \u78BC\u532F\u51FA\u975E oauth2 \u7684\u8A2D\u5B9A\u8CC7\u8A0A\u3002",settings_export_desc_button:"\u751F\u6210 QR \u78BC",settings_import:"\u532F\u5165",settings_import_desc:"\u60A8\u9700\u8981\u4F7F\u7528\u7CFB\u7D71\u62CD\u651D app \u6216\u8005\u6383\u63CF QR \u78BC\u7684app\uFF0C\u4F86\u6383\u63CF\u5C0D\u61C9\u7684 QR \u78BC\u3002",settings_debug:"\u9664\u932F",settings_debug_enabled:"\u4FEE\u6539\u7D42\u7AEF\u8F38\u51FA\u7684 debug",settings_debug_enabled_desc:"\u9810\u8A2D\u503C\u70BA\u201C\u95DC\u9589\u201D\u3002\u60A8\u53EF\u4EE5\u6539\u70BA\u201C\u958B\u555F\u201D\uFF0C\u5F9E\u800C\u5728\u7D42\u7AEF\u88E1\u7372\u53D6\u66F4\u591A\u8CC7\u8A0A\u3002",settings_outputsettingsconsole:"\u8B80\u53D6\u786C\u789F\u4E0A\u7684\u8A2D\u5B9A\u6A94\u6848\u8F38\u51FA\u5230\u7D42\u7AEF",settings_outputsettingsconsole_desc:"\u786C\u789F\u4E0A\u7684\u8A2D\u5B9A\u6A94\u6848\u662F\u7DE8\u78BC\u904E\u7684\uFF0C\u9EDE\u9078\u9019\u88E1\u5F9E\u800C\u89E3\u78BC\u4E26\u8F38\u51FA\u5230\u7D42\u7AEF\u3002",settings_outputsettingsconsole_button:"\u8F38\u51FA",settings_outputsettingsconsole_notice:"\u5DF2\u8F38\u51FA\u5230\u7D42\u7AEF",settings_syncplans:"\u532F\u51FA\u540C\u6B65\u8A08\u5283",settings_syncplans_desc:"\u6BCF\u6B21\u60A8\u555F\u52D5\u540C\u6B65\uFF0C\u4E26\u5728\u5BE6\u969B\u4E0A\u50B3\u4E0B\u8F09\u524D\uFF0C\u5916\u639B\u6703\u751F\u6210\u540C\u6B65\u8A08\u5283\u3002\u5B83\u53EF\u4EE5\u4F7F\u60A8\u77E5\u9053\u6BCF\u6B21\u540C\u6B65\u767C\u751F\u4E86\u4EC0\u9EBC\u3002\u9EDE\u9078\u6309\u9215\u53EF\u4EE5\u532F\u51FA\u540C\u6B65\u8A08\u5283\u3002\u4E26\u4E14\uFF0C\u60A8\u53EF\u4EE5\u9078\u64C7\u532F\u51FA\u70BA\u5167\u5D4C\u5728 Markdown \u88E1\u7684 json \u683C\u5F0F\u6216\u8868\u683C\u683C\u5F0F\uFF0C\u5B83\u5011\u662F\u7B49\u50F9\u7684\u3002",settings_syncplans_button_json:"\u532F\u51FA\uFF08json\uFF09",settings_syncplans_button_table:"\u532F\u51FA\uFF08\u8868\u683C\uFF09",settings_syncplans_notice:"\u540C\u6B65\u8A08\u5283\u5DF2\u532F\u51FA",settings_delsyncplans:"\u522A\u9664\u8CC7\u6599\u5EAB\u88E1\u7684\u540C\u6B65\u8A08\u5283\u6B77\u53F2",settings_delsyncplans_desc:"\u522A\u9664\u8CC7\u6599\u5EAB\u88E1\u7684\u540C\u6B65\u8A08\u5283\u6B77\u53F2\u3002",settings_delsyncplans_button:"\u522A\u9664\u540C\u6B65\u8A08\u5283\u6B77\u53F2",settings_delsyncplans_notice:"\uFF08\u8CC7\u6599\u5EAB\u88E1\u7684\uFF09\u540C\u6B65\u8A08\u5283\u5DF2\u88AB\u522A\u9664\u3002",settings_disable_s3_metadata_sync:"\u505C\u7528 S3 \u5143\u8CC7\u6599\u540C\u6B65",settings_disable_s3_metadata_sync_desc:"\u9632\u6B62\u8207 S3 \u4F9B\u61C9\u5546\u540C\u6B65\u4FEE\u6539\u6642\u9593\uFF08\u76F8\u5BB9\u963F\u91CC\u96F2\uFF09\u3002",settings_logtodb:"\u5132\u5B58\u7D42\u7AEF\u65E5\u8A8C\u5230\u8CC7\u6599\u5EAB",settings_logtodb_desc:"\u5982\u679C\u958B\u555F\u6B64\u8A2D\u5B9A\uFF0C\u6240\u6709\u7D42\u7AEF\u65E5\u8A8C\u90FD\u6703\u5132\u5B58\u5230\u8CC7\u6599\uFF0C\u5F9E\u800C\u6211\u5011\u53EF\u4EE5\u5728\u4E4B\u5F8C\u532F\u51FA\u548C\u95B1\u8B80\u5B83\u5011\u3002\u5C0D\u65BC\u79FB\u52D5\u88DD\u7F6E\u7684\u9664\u932F\u8F03\u70BA\u6709\u7528\u3002\u6709\u6548\u80FD\u6210\u672C\uFF0C\u53EF\u80FD\u6703\u5F71\u97FF\u96FB\u6C60\u7528\u91CF\u3002\u6B77\u53F2\u6703\u5132\u5B58\u6700\u591A 10000 \u689D\u548C 7 \u5929\u6642\u9593\u3002",settings_logtodbexport:"\u5F9E\u8CC7\u6599\u5EAB\u532F\u51FA\u7D42\u7AEF\u65E5\u8A8C",settings_logtodbexport_desc:"\u5F9E\u8CC7\u6599\u5EAB\u532F\u51FA\u672C\u8CC7\u6599\u5EAB\u7684\u5DF2\u5132\u5B58\u7684\u7D42\u7AEF\u65E5\u8A8C\uFF0C\u8F38\u51FA\u5230\u8CC7\u6599\u593E {{&debugFolder}} \u4E0B\u7684\u4E00\u500B\u65B0\u6A94\u6848\u5167\u3002",settings_logtodbexport_button:"\u532F\u51FA",settings_logtodbexport_notice:"\u8CC7\u6599\u5EAB\u5167\u7684\u672C\u8CC7\u6599\u5EAB\u7684\u7D42\u7AEF\u65E5\u8A8C\u5DF2\u532F\u51FA\uFF01",settings_logtodbclear:"\u522A\u9664\u8CC7\u6599\u5EAB\u7684\u6240\u6709\u7D42\u7AEF\u65E5\u8A8C",settings_logtodbclear_desc:"\u522A\u9664\u8CC7\u6599\u5EAB\u5167\u7684\u6240\u6709\u5DF2\u5132\u5B58\u7684\u7D42\u7AEF\u65E5\u8A8C\u3002\u672C\u8A2D\u5B9A\u6703\u5F71\u97FF\u672C\u88DD\u7F6E\u4E0B\u6240\u6709\u8CC7\u6599\u5EAB\u7684\u6240\u6709\u5DF2\u5132\u5B58\u65E5\u8A8C\u3002",settings_logtodbclear_button:"\u522A\u9664",settings_logtodbclear_notice:"\u8CC7\u6599\u5EAB\u5167\u7684\u6240\u6709\u7D42\u7AEF\u65E5\u8A8C\u5DF2\u522A\u9664\uFF01",settings_delsyncmap:"\u522A\u9664\u8CC7\u6599\u5EAB\u88E1\u7684\u540C\u6B65\u5C0D\u6620\u6B77\u53F2",settings_delsyncmap_desc:"\u540C\u6B65\u5C0D\u6620\u6B77\u53F2\u5132\u5B58\u4E86\u672C\u5730\u771F\u6B63\u7684\u6700\u5F8C\u4FEE\u6539\u6642\u9593\u548C\u9060\u7AEF\u6A94\u6848\u6642\u9593\u7684\u5C0D\u6620\u3002\u522A\u9664\u4E4B\u53EF\u80FD\u6703\u5C0E\u81F4\u4E0B\u4E00\u6B21\u540C\u6B65\u6642\u767C\u751F\u4E0D\u5FC5\u8981\u7684\u8CC7\u6599\u4EA4\u63DB\u3002\u9EDE\u9078\u6309\u9215\u522A\u9664\u8CC7\u6599\u5EAB\u88E1\u7684\u540C\u6B65\u5C0D\u6620\u6B77\u53F2\u3002",settings_delsyncmap_button:"\u522A\u9664\u540C\u6B65\u5C0D\u6620\u6B77\u53F2",settings_delsyncmap_notice:"\uFF08\u672C\u5730\u8CC7\u6599\u5EAB\u88E1\u7684\uFF09\u540C\u6B65\u5C0D\u6620\u6B77\u53F2\u5DF2\u88AB\u522A\u9664\u3002",settings_outputbasepathvaultid:"\u8F38\u51FA\u8CC7\u6599\u5EAB\u5C0D\u61C9\u7684\u4F4D\u7F6E\u548C\u96A8\u6A5F\u5206\u914D\u7684 ID",settings_outputbasepathvaultid_desc:"\u7528\u65BC\u9664\u932F\u3002",settings_outputbasepathvaultid_button:"\u8F38\u51FA",settings_reset_sync_metadata:"\u91CD\u7F6E\u540C\u6B65\u4E2D\u7E7C\u8CC7\u6599",settings_reset_sync_metadata_desc:"\u7528\u65BC\u5220\u9664\u9060\u7AEF\u5132\u5B58\u7684\u4E2D\u7E7C\u8CC7\u6599\u6A94\u6848\u3002\u5C07\u5FFD\u7565\u5DF2\u5220\u9664\u7684\u6A94\u6848\uFF0C\u56D9\u6B64\u8ACB\u78BA\u4FDD\u9996\u5148\u5728\u6240\u6709\u8A2D\u5099\u4E0A\u540C\u6B65\u3002",settings_reset_sync_metadata_notice_start:"\u522A\u9664\u4E2D\uFF0C\u8ACB\u7B49\u5F85... (1/2)",settings_reset_sync_metadata_notice_end:"\u9060\u7AEF\u4E2D\u7E7C\u8CC7\u6599\u6A94\u6848\u5DF2\u522A\u9664\u3002(2/2)",settings_reset_sync_metadata_notice_error:"\u5DF2\u958B\u59CB\u522A\u9664\u9060\u7A0B\u5143\u6578\u64DA\u6587\u4EF6\uFF0C\u8ACB\u8010\u5FC3\u7B49\u5F85\u3002",settings_resetcache:"\u91CD\u8A2D\u672C\u5730\u5FEB\u53D6\u548C\u8CC7\u6599\u5EAB",settings_resetcache_desc:"\uFF08\u51FA\u65BC\u9664\u932F\u539F\u56E0\uFF09\u91CD\u8A2D\u672C\u5730\u5FEB\u53D6\u548C\u8CC7\u6599\u5EAB\u3002\u60A8\u9700\u8981\u5728\u91CD\u8A2D\u4E4B\u5F8C\u91CD\u65B0\u8F09\u5165\u6B64\u5916\u639B\u3002\u672C\u91CD\u8A2D\u4E0D\u6703\u522A\u9664 s3\uFF0C\u5BC6\u78BC\u2026\u2026\u7B49\u8A2D\u5B9A\u3002",settings_reset_button:"\u91CD\u8A2D",settings_resetcache_notice:"\u672C\u5730\u540C\u6B65\u5FEB\u53D6\u548C\u8CC7\u6599\u5EAB\u5DF2\u88AB\u522A\u9664\u3002\u8ACB\u624B\u52D5\u91CD\u65B0\u8F09\u5165\u6B64\u5916\u639B\u3002",settings_enablestatusbar_info:"\u5728\u72C0\u614B\u6B04\u986F\u793A\u6700\u5F8C\u4E00\u6B21\u6210\u529F\u540C\u6B65",settings_enablestatusbar_info_desc:"\u5728\u72C0\u614B\u6B04\u986F\u793A\u6700\u5F8C\u4E00\u6B21\u6210\u529F\u540C\u6B65\u7684\u6642\u9593\u3002",settings_enablestatusbar_reloadrequired_notice:"\u91CD\u65B0\u52A0\u8F09\u63D2\u4EF6\u4EE5\u4F7F\u66F4\u6539\u751F\u6548\u3002",settings_sync_bookmarks:"\u540C\u6B65 Obsidian \u66F8\u7C64",settings_sync_bookmarks_desc:"\u5728\u8A2D\u5099\u4E4B\u9593\u540C\u6B65\u60A8\u7684\u66F8\u7C64\u3002",settings_trash_locally:"\u5C07\u5DF2\u522A\u9664\u7684\u6A94\u6848\u79FB\u5230 Obsidian \u7684 .trash \u8CC7\u6599\u593E\u4E2D",settings_trash_locally_desc:"\u5982\u679C\u505C\u7528\uFF0C\u5C07\u9996\u5148\u5617\u8A66\u628A\u6A94\u6848\u79FB\u5230\u8CC7\u6E90\u56DE\u6536\u7B52\u4E2D\u3002\u50C5\u5F71\u97FF\u540C\u6B65\u6642\u522A\u9664\u7684\u6A94\u6848\u3002",settings_sync_trash:"\u540C\u6B65 .trash \u8CC7\u6599\u593E",settings_sync_trash_desc:"\u5982\u679C\u60A8\u5728\u522A\u9664\u5EAB\u4E2D\u7684\u6A94\u6848\u6642\u4F7F\u7528 .trash \u8CC7\u6599\u593E\u800C\u4E0D\u662F\u8CC7\u6E90\u56DE\u6536\u7B52\uFF0C\u90A3\u4E48\u8BE5\u9879\u8BBE\u7F6E\u53EF\u80FD\u6709\u7528\u3002",statusbar_time_years:"{{time}} \u5E74",statusbar_time_months:"{{time}} \u500B\u6708",statusbar_time_weeks:"{{time}} \u9031",statusbar_time_days:"{{time}} \u5929",statusbar_time_hours:"{{time}} \u5C0F\u6642",statusbar_time_minutes:"{{time}} \u5206\u9418",statusbar_time_lessminute:"\u5C11\u65BC\u4E00\u5206\u9418",statusbar_lastsync:"{{time}} \u524D\u540C\u6B65",statusbar_lastsync_label:"\u6700\u5F8C\u6210\u529F\u540C\u6B65\u65BC {{date}}",statusbar_lastsync_never:"\u5F9E\u672A\u540C\u6B65",statusbar_lastsync_never_label:"\u4EE5\u524D\u5F9E\u672A\u540C\u6B65\u904E",settings_showlastsyncedonly:"\u72C0\u614B\u5217\u4E2D\u50C5\u986F\u793A\u6700\u5F8C\u4E00\u6B21\u540C\u6B65\u6642\u9593",settings_showlastsyncedonly_desc:"\u50C5\u986F\u793A\u6700\u5F8C\u4E00\u6B21\u540C\u6B65\u6642\u9593\uFF0C\u4E26\u96B1\u85CF\u5176\u5B83\u72C0\u614B\u5217\u5143\u7D20\u3002\u9019\u6700\u9069\u5408\u884C\u52D5\u88DD\u7F6E\u3002",syncalgov2_title:"Remotely Sync \u5354\u8B70",syncalgov2_texts:`\u8ACB\u5099\u4EFD\u597D\u60A8\u7684\u5EAB\uFF08Vault\uFF09\uFF01 -\u6B61\u8FCE\u4F7F\u7528 Remotely Sync\uFF0C\u9019\u662F\u5177\u6709\u5B89\u5168\u5347\u7D1A\u529F\u80FD\u7684 Remotely Save \u5206\u652F\uFF01\u5728\u958B\u59CB\u4F7F\u7528\u4E4B\u524D\uFF0C\u8ACB\u6CE8\u610F\uFF0C\u7531\u65BC\u65B0\u529F\u80FD\u5C1A\u672A\u7D93\u904E\u5168\u9762\u6E2C\u8A66\uFF0C\u6B64\u5916\u639B\u7A0B\u5F0F\u53EF\u80FD\u4E0D\u5982 Remotely Save \u7A69\u5B9A\u3002 -Remotely Sync \u9700\u8981\u5C07\u984D\u5916\u7684\u5143\u8CC7\u6599\u6A94\u6848\u4E0A\u50B3\u5230\u60A8\u914D\u7F6E\u7684\u96F2\u7AEF\u5132\u5B58\u4E2D\uFF0C\u4EE5\u5141\u8A31\u5176\u5B83\u88DD\u7F6E\u77E5\u9053\u54EA\u4E9B\u5167\u5BB9\u88AB\u522A\u9664\u4E86\u3002 -\u5982\u679C\u60A8\u4E0D\u540C\u610F\u6B64\u7B56\u7565\uFF0C\u60A8\u53EF\u4EE5\u5F9E GitHub \u4E0B\u8F09 0.2.14 \u6216\u66F4\u65E9\u7248\u672C\u7684 Remotely Save\uFF0C\u5B83\u5011\u4F7F\u7528\u820A\u7684\u540C\u6B65\u6F14\u7B97\u6CD5\uFF0C\u4E0D\u6703\u4E0A\u50B3\u4EFB\u4F55\u984D\u5916\u6A94\u6848\u3002 -\u9EDE\u64CA\u201C\u4E0D\u540C\u610F\u201D\u6309\u9215\u4E4B\u5F8C\uFF0C\u5916\u639B\u7A0B\u5F0F\u6703\u81EA\u52D5\u505C\u6B62\u904B\u884C\uFF0C\u7136\u5F8C\u60A8\u9700\u8981\u5728 Obsidian \u8A2D\u5B9A\u91CC\u624B\u52D5\u505C\u7528\u6B64\u5916\u639B\u7A0B\u5F0F\u3002 -\u5982\u679C\u60A8\u540C\u610F\u6B64\u7B56\u7565\uFF0C\u8ACB\u9EDE\u64CA\u201C\u540C\u610F\u201D\u6309\u9215\uFF0C\u7136\u5F8C\u958B\u59CB\u4EAB\u7528\u6B64\u5916\u639B\u7A0B\u5F0F\uFF01`,syncalgov2_button_agree:"\u540C\u610F",syncalgov2_button_disagree:"\u4E0D\u540C\u610F"};var xx={en:tne,zh_cn:rne,zh_tw:nne};var Ex=class{lang;saveSettingFunc;constructor(e,r){this.lang=e,this.saveSettingFunc=r}async changeTo(e){this.lang=e,await this.saveSettingFunc(e)}_get(e){let r=this.lang;return this.lang==="auto"&&f6.moment.locale().replace("-","_")in xx?r=f6.moment.locale().replace("-","_"):r="en",xx[r][e]||xx.en[e]||e}t(e,r){return r===void 0?this._get(e):ene.render(this._get(e),r)}};m();var Cx=require("obsidian"),Sx=class extends Cx.Modal{result;onSubmit;i18n;constructor(e,r,i){super(e),this.i18n=r,this.result=!1,this.onSubmit=i}onOpen(){let{contentEl:e}=this;e.createEl("h2",{text:this.i18n.t("syncalgov2_title")}),this.i18n.t("syncalgov2_texts").split(` -`).forEach(r=>{e.createEl("p",{text:r})}),new Cx.Setting(e).addButton(r=>{r.setButtonText(this.i18n.t("syncalgov2_button_agree")),r.onClick(async()=>{this.result=!0,this.close()})}).addButton(r=>{r.setButtonText(this.i18n.t("syncalgov2_button_disagree")),r.onClick(()=>{this.close()})})}onClose(){let{contentEl:e}=this;e.empty(),this.onSubmit(this.result)}};m();var Tx=require("obsidian"),Ax=class extends Tx.Modal{plugin;skipSizeLargerThan;sizesGoWrong;hasPassword;constructor(e,r,i,n,o){super(e),this.plugin=r,this.skipSizeLargerThan=i,this.sizesGoWrong=n,this.hasPassword=o}onOpen(){let{contentEl:e}=this,r=(n,o)=>this.plugin.i18n.t(n,o);e.createEl("h2",{text:r("modal_sizesconflict_title")}),r("modal_sizesconflict_desc",{thresholdMB:`${this.skipSizeLargerThan/1e3/1e3}`,thresholdBytes:`${this.skipSizeLargerThan}`}).split(` -`).forEach(n=>{e.createEl("p",{text:n})});let i=this.serialize();e.createDiv().createEl("button",{text:r("modal_sizesconflict_copybutton")},n=>{n.onclick=async()=>{await navigator.clipboard.writeText(i),new Tx.Notice(r("modal_sizesconflict_copynotice"))}}),e.createEl("pre",{text:i})}serialize(){return this.sizesGoWrong.map(e=>[e.key,this.hasPassword?`encrypted name: ${e.remoteEncryptedKey}`:void 0,`local ${this.hasPassword?"encrypted ":""}bytes: ${this.hasPassword?e.sizeLocalEnc:e.sizeLocal}`,`remote ${this.hasPassword?"encrypted ":""}bytes: ${this.hasPassword?e.sizeRemoteEnc:e.sizeRemote}`].filter(r=>r!==void 0).join(` -`)).join(` - -`)}onClose(){let{contentEl:e}=this;e.empty()}};var Mx={s3:Vee,webdav:Nte,dropbox:uh,onedrive:ng,password:"",serviceType:"s3",debugEnabled:!1,autoRunEveryMilliseconds:-1,initRunAfterMilliseconds:-1,syncOnSaveAfterMilliseconds:-1,syncOnRemoteChangesAfterMilliseconds:-1,agreeToUploadExtraMetadata:!1,concurrency:5,syncConfigDir:!1,syncUnderscoreItems:!1,lang:"auto",logToDB:!1,skipSizeLargerThan:-1,enableStatusBarInfo:void 0,showLastSyncedOnly:void 0,lastSynced:-1,trashLocal:!1,syncTrash:!1,syncBookmarks:!0},Rx="rotate-ccw",P5e="refresh-ccw",N5e="refresh-ccw-dot",d6="file-text",Dx=class extends er.Plugin{settings;db;syncStatus;syncStatusText;statusBarElement;oauth2Info;currSyncMsg;syncRibbon;autoRunIntervalID;i18n;vaultRandomID;isManual;isAlreadyRunning;syncOnSaveEvent;vaultScannerIntervalId;syncOnRemoteIntervalID;statusBarIntervalID;statusBarObserver;async syncRun(e="manual"){this.isManual=e==="manual",this.isAlreadyRunning=!1;let r=this.settings.debugEnabled?8:2;await this.createTrashIfDoesNotExist();let i=(o,c)=>this.i18n.t(o,c),n=(o,c,u)=>{if(this.isManual||e==="manual"||e==="dry"){if(!this.settings.debugEnabled){(this.isAlreadyRunning||er.Platform.isMobile||!this.settings.enableStatusBarInfo)&&(c===1?new er.Notice("1/"+this.i18n.t("syncrun_step1",{maxSteps:"2",serviceType:this.settings.serviceType}),u):c===8&&new er.Notice("2/"+this.i18n.t("syncrun_step8",{maxSteps:"2"}),u));return}let d=c>-1?c+"/":"";new er.Notice(d+o,u)}};if(this.syncStatus!=="idle"){e=="manual"&&(this.settings.debugEnabled?new er.Notice(i("syncrun_debug_alreadyrunning",{stage:this.syncStatus})):(new er.Notice("1/"+i("syncrun_alreadyrunning",{maxSteps:r})),this.isAlreadyRunning=!0),ht.debug(this.manifest.name," already running in stage: ",this.syncStatus),this.currSyncMsg!==void 0&&this.currSyncMsg!==""&&ht.debug(this.currSyncMsg));return}try{this.setSyncIcon(!0,e),e==="dry"&&n(i("syncrun_step0",{maxSteps:`${r}`}),0),n(i("syncrun_step1",{maxSteps:`${r}`,serviceType:this.settings.serviceType}),1),this.updateSyncStatus("preparing"),n(i("syncrun_step2",{maxSteps:`${r}`}),2),this.updateSyncStatus("getting_remote_files_list");let o=this,c=this.getRemoteClient(o),u=await c.listFromRemote();n(i("syncrun_step3",{maxSteps:`${r}`}),3),this.updateSyncStatus("checking_password");let d=await e6(u.Contents,this.settings.password);if(!d.ok)throw n(i("syncrun_passworderr"),-1,10*1e3),Error(d.reason);n(i("syncrun_step4",{maxSteps:`${r}`}),4),this.updateSyncStatus("getting_remote_extra_meta");let y=await Op(u.Contents,c,this.settings.password),E=await t6(u.Contents,this.db,this.vaultRandomID,c.serviceType,this.settings.password),x=await this.fetchMetadataFromRemote(y,c);n(i("syncrun_step5",{maxSteps:`${r}`}),5),this.updateSyncStatus("getting_local_meta");let A=this.app.vault.getAllLoadedFiles(),R=await this.getLocalHistory(),M=await bx(this.app.vault,this.manifest.name,this.settings.syncTrash);n(i("syncrun_step6",{maxSteps:`${r}`}),6),this.updateSyncStatus("generating_plan");let{plan:I,sortedKeys:D,deletions:O,sizesGoWrong:N}=await this.getSyncPlan(E,A,M,x,R,c,e);await m8(this.db,I,this.vaultRandomID),e!=="dry"?(n(i("syncrun_step7",{maxSteps:`${r}`}),7),this.updateSyncStatus("syncing"),await this.doActualSync(c,I,D,y,x,N,O,o)):(this.updateSyncStatus("syncing"),n(i("syncrun_step7skip",{maxSteps:`${r}`}),7)),n(i("syncrun_step8",{maxSteps:`${r}`}),8),this.updateSyncStatus("finish"),ht.debug("start getting last synced from remote"),this.settings.lastSynced=await this.getMetadataMtime(),this.saveSettings(),ht.debug("finish getting last synced from remote"),this.updateSyncStatus("idle"),this.setSyncIcon(!1)}catch(o){let c=i("syncrun_abort",{manifestID:this.manifest.id,theDate:`${Date.now()}`,triggerSource:e,syncStatus:this.syncStatus});if(ht.error(c),ht.error(o),n(c,-1,10*1e3),o instanceof Za)for(let u of o.errors)n(u.message,-1,10*1e3);else n(o.message,-1,10*1e3);this.updateSyncStatus("idle"),this.setSyncIcon(!1)}}async createTrashIfDoesNotExist(){this.settings.syncTrash&&await this.createTrashFolderIfDoesNotExist(this.app.vault)}shouldSyncBasedOnSyncPlan=async e=>{for(let r in e.mixedStates){let i=e.mixedStates[r];if(i.existLocal&&i.existRemote&&i.mtimeLocal>i.mtimeRemote)return!0}return!1};async doActualSync(e,r,i,n,o,c,u,d){await Jre(e,this.db,this.vaultRandomID,this.app.vault,r,i,n,o,c,u,y=>d.trash(y),this.settings.password,this.settings.lastSynced,this.settings.concurrency,y=>{new Ax(d.app,d,this.settings.skipSizeLargerThan,y,this.settings.password!=="").open()},(y,E)=>d.updateStatusBar({i:y,total:E}))}async getSyncPlan(e,r,i,n,o,c,u){return await Qre(e,r,i,n.deletions,o,c.serviceType,u,this.app.vault,this.settings.syncConfigDir,this.settings.syncTrash,this.settings.syncBookmarks,this.app.vault.configDir,this.settings.syncUnderscoreItems,this.settings.skipSizeLargerThan,this.settings.password)}async getLocalHistory(){return await l8(this.db,this.vaultRandomID)}async fetchMetadataFromRemote(e,r){if(e===void 0)return ht.debug("no metadata file, so no fetch"),{deletions:[]};let i=await r.downloadFromRemote(e.key,this.app.vault,e.mtimeRemote,this.settings.password,e.remoteEncryptedKey,!0);return $R(i)}getRemoteClient(e){return new Qi(this.settings.serviceType,this.settings.s3,this.settings.webdav,this.settings.dropbox,this.settings.onedrive,this.app.vault.getName(),()=>e.saveSettings())}updateSyncStatus(e){this.syncStatus=e,this.updateStatusBar()}setSyncIcon(e,r){this.syncRibbon!==void 0&&(e?((0,er.setIcon)(this.syncRibbon,P5e),this.syncRibbon.setAttribute("aria-label",this.i18n.t("syncrun_syncingribbon",{pluginName:this.manifest.name,triggerSource:r}))):((0,er.setIcon)(this.syncRibbon,Rx),this.syncRibbon.setAttribute("aria-label",this.manifest.name)))}updateStatusBar(e){let r=this.statusBarElement!==void 0&&this.settings.enableStatusBarInfo===!0;if(this.syncStatus==="idle"){let i=o8(this.i18n,this.settings.lastSynced);this.syncStatusText=i.lastSyncMsg,r&&this.statusBarElement.setAttribute("aria-label",i.lastSyncLabelMsg)}this.syncStatus==="preparing"&&(this.syncStatusText=this.i18n.t("syncrun_status_preparing")),this.syncStatus==="syncing"&&(e!==void 0?this.syncStatusText=this.i18n.t("syncrun_status_progress",{current:e.i.toString(),total:e.total.toString()}):this.syncStatusText=this.i18n.t("syncrun_status_syncing")),r&&this.statusBarElement.setText(this.syncStatusText)}async promptAgreement(){return new Promise(e=>{new Sx(this.app,this.i18n,r=>e(r)).open()})}async onload(){this.oauth2Info={verifier:"",helperModal:void 0,authDiv:void 0,revokeDiv:void 0,revokeAuthSetting:void 0},this.currSyncMsg="",await this.loadSettings(),await this.checkIfPresetRulesFollowed(),this.i18n=new Ex(this.settings.lang,async n=>{this.settings.lang=n,await this.saveSettings()});let e=(n,o)=>this.i18n.t(n,o);if(!this.settings.agreeToUploadExtraMetadata)if(await this.promptAgreement())this.settings.agreeToUploadExtraMetadata=!0,await this.saveSettings();else{this.unload();return}this.settings.debugEnabled&&ht.setLevel("debug"),await this.checkIfOauthExpires();let r=await this.getVaultRandomIDFromOldConfigFile();this.tryToAddIgnoreFile();let i=this.getVaultBasePath();try{await this.prepareDBAndVaultRandomID(i,r)}catch(n){throw new er.Notice(n.message,10*1e3),n}this.addOutputToDBIfSet(),this.enableAutoClearOutputToDBHistIfSet(),this.enableAutoClearSyncPlanHist(),this.registerEvent(this.app.vault.on("delete",async n=>{await f8(this.db,n,this.vaultRandomID)})),this.registerEvent(this.app.vault.on("rename",async(n,o)=>{await d8(this.db,n,o,this.vaultRandomID)})),this.registerObsidianProtocolHandler(sy,async n=>{let o=BO(n,this.app.vault.getName());if(o.status==="error")new er.Notice(o.message);else{let c=(0,jg.default)(o.result);this.settings=Object.assign({},this.settings,c),this.saveSettings(),new er.Notice(e("protocol_saveqr",{manifestName:this.manifest.name}))}}),this.registerObsidianProtocolHandler(M4,async n=>{new er.Notice(e("protocol_callbacknotsupported",{params:JSON.stringify(n)}))}),this.registerObsidianProtocolHandler(Yp,async n=>{if(n.code!==void 0){this.oauth2Info.helperModal!==void 0&&(this.oauth2Info.helperModal.contentEl.empty(),e("protocol_dropbox_connecting").split(` -`).forEach(y=>{this.oauth2Info.helperModal.contentEl.createEl("p",{text:y})}));let o=await r_(this.settings.dropbox.clientID,this.oauth2Info.verifier,n.code),c=this;u0(this.settings.dropbox,o,()=>c.saveSettings());let d=await new Qi("dropbox",void 0,void 0,this.settings.dropbox,void 0,this.app.vault.getName(),()=>c.saveSettings()).getUser();this.settings.dropbox.username=d,await this.saveSettings(),new er.Notice(e("protocol_dropbox_connect_succ",{username:d})),this.oauth2Info.verifier="",this.oauth2Info.helperModal?.close(),this.oauth2Info.helperModal=void 0,this.oauth2Info.authDiv?.toggleClass("dropbox-auth-button-hide",this.settings.dropbox.username!==""),this.oauth2Info.authDiv=void 0,this.oauth2Info.revokeAuthSetting?.setDesc(e("protocol_dropbox_connect_succ_revoke",{username:this.settings.dropbox.username})),this.oauth2Info.revokeAuthSetting=void 0,this.oauth2Info.revokeDiv?.toggleClass("dropbox-revoke-auth-button-hide",this.settings.dropbox.username===""),this.oauth2Info.revokeDiv=void 0}else throw new er.Notice(e("protocol_dropbox_connect_fail")),Error(e("protocol_dropbox_connect_unknown",{params:JSON.stringify(n)}))}),this.registerObsidianProtocolHandler(ay,async n=>{if(n.code!==void 0){this.oauth2Info.helperModal!==void 0&&(this.oauth2Info.helperModal.contentEl.empty(),e("protocol_onedrive_connecting").split(` -`).forEach(d=>{this.oauth2Info.helperModal.contentEl.createEl("p",{text:d})}));let o=await nG(this.settings.onedrive.clientID,this.settings.onedrive.authority,n.code,this.oauth2Info.verifier);if(o.error!==void 0)throw Error(`${JSON.stringify(o)}`);let c=this;iG(this.settings.onedrive,o,()=>c.saveSettings());let u=new Qi("onedrive",void 0,void 0,void 0,this.settings.onedrive,this.app.vault.getName(),()=>c.saveSettings());this.settings.onedrive.username=await u.getUser(),await this.saveSettings(),this.oauth2Info.verifier="",this.oauth2Info.helperModal?.close(),this.oauth2Info.helperModal=void 0,this.oauth2Info.authDiv?.toggleClass("onedrive-auth-button-hide",this.settings.onedrive.username!==""),this.oauth2Info.authDiv=void 0,this.oauth2Info.revokeAuthSetting?.setDesc(e("protocol_onedrive_connect_succ_revoke",{username:this.settings.onedrive.username})),this.oauth2Info.revokeAuthSetting=void 0,this.oauth2Info.revokeDiv?.toggleClass("onedrive-revoke-auth-button-hide",this.settings.onedrive.username===""),this.oauth2Info.revokeDiv=void 0}else throw new er.Notice(e("protocol_onedrive_connect_fail")),Error(e("protocol_onedrive_connect_unknown",{params:JSON.stringify(n)}))}),this.syncRibbon=this.addRibbonIcon(Rx,`${this.manifest.name}`,async()=>this.syncRun("manual")),this.addCommand({id:"start-sync",name:e("command_startsync"),icon:Rx,callback:async()=>{this.syncRun("manual")}}),this.addCommand({id:"start-sync-dry-run",name:e("command_drynrun"),icon:Rx,callback:async()=>{this.syncRun("dry")}}),this.addCommand({id:"export-sync-plans-json",name:e("command_exportsyncplans_json"),icon:d6,callback:async()=>{await kp(this.db,this.app.vault,this.vaultRandomID,"json"),new er.Notice(e("settings_syncplans_notice"))}}),this.addCommand({id:"export-sync-plans-table",name:e("command_exportsyncplans_table"),icon:d6,callback:async()=>{await kp(this.db,this.app.vault,this.vaultRandomID,"table"),new er.Notice(e("settings_syncplans_notice"))}}),this.addCommand({id:"export-logs-in-db",name:e("command_exportlogsindb"),icon:d6,callback:async()=>{await ox(this.db,this.app.vault,this.vaultRandomID),new er.Notice(e("settings_logtodbexport_notice"))}}),this.addCommand({id:"get-sync-status",name:e("command_syncstatus"),icon:N5e,callback:()=>new er.Notice(this.syncStatusText)}),this.addSettingTab(new wx(this.app,this)),this.settings.enableStatusBarInfo===void 0&&(this.settings.enableStatusBarInfo=!er.Platform.isMobile),this.settings.showLastSyncedOnly===void 0&&(this.settings.showLastSyncedOnly=!!er.Platform.isMobile),this.saveSettings(),this.enableAutoSyncIfSet(),this.enableInitSyncIfSet(),this.toggleSyncOnRemote(!0),this.toggleSyncOnSave(!0),this.toggleStatusBar(!0),this.toggleStatusText(!0),this.toggleStatusBarObserver(!0),this.updateSyncStatus("idle")}async onunload(){this.syncRibbon=void 0,this.oauth2Info!==void 0&&(this.oauth2Info.helperModal=void 0,this.oauth2Info=void 0),this.toggleSyncOnSave(!1),this.toggleSyncOnRemote(!1),this.toggleStatusText(!1),this.toggleStatusBar(!1),this.toggleStatusBarObserver(!1)}async loadSettings(){this.settings=Object.assign({},(0,jg.default)(Mx),sx(await this.loadData())),this.settings.dropbox.clientID===""&&(this.settings.dropbox.clientID=Mx.dropbox.clientID),this.settings.dropbox.remoteBaseDir===void 0&&(this.settings.dropbox.remoteBaseDir=""),this.settings.onedrive.clientID===""&&(this.settings.onedrive.clientID=Mx.onedrive.clientID),this.settings.onedrive.authority===""&&(this.settings.onedrive.authority=Mx.onedrive.authority),this.settings.onedrive.remoteBaseDir===void 0&&(this.settings.onedrive.remoteBaseDir=""),this.settings.webdav.manualRecursive===void 0&&(this.settings.webdav.manualRecursive=!1),this.settings.webdav.depth===void 0&&(this.settings.webdav.depth="auto_unknown"),this.settings.webdav.remoteBaseDir===void 0&&(this.settings.webdav.remoteBaseDir=""),this.settings.s3.partsConcurrency===void 0&&(this.settings.s3.partsConcurrency=20),this.settings.s3.forcePathStyle===void 0&&(this.settings.s3.forcePathStyle=!1),this.settings.s3.disableS3MetadataSync==null&&(this.settings.s3.disableS3MetadataSync=!1)}async checkIfPresetRulesFollowed(){$te(this.settings).changed&&await this.saveSettings()}async saveSettings(){await this.saveData(Hte(this.settings))}async checkIfOauthExpires(){let e=!1,r=Date.now();this.settings.dropbox.refreshToken!==""&&this.settings.dropbox.credentialsShouldBeDeletedAtTime===void 0&&(this.settings.dropbox.credentialsShouldBeDeletedAtTime=r+1e3*60*60*24*30,e=!0),this.settings.onedrive.refreshToken!==""&&this.settings.onedrive.credentialsShouldBeDeletedAtTime===void 0&&(this.settings.onedrive.credentialsShouldBeDeletedAtTime=r+1e3*60*60*24*30,e=!0);let i=!1;this.settings.dropbox.refreshToken!==""&&r>=this.settings.dropbox.credentialsShouldBeDeletedAtTime&&(i=!0,this.settings.dropbox=(0,jg.default)(uh),e=!0);let n=!1;this.settings.onedrive.refreshToken!==""&&r>=this.settings.onedrive.credentialsShouldBeDeletedAtTime&&(n=!0,this.settings.onedrive=(0,jg.default)(ng),e=!0),e&&await this.saveSettings(),i&&n?new er.Notice(`${this.manifest.name}: You haven't manually auth Dropbox and OneDrive for a while, you need to re-auth them again.`,6e3):i?new er.Notice(`${this.manifest.name}: You haven't manually auth Dropbox for a while, you need to re-auth it again.`,6e3):n&&new er.Notice(`${this.manifest.name}: You haven't manually auth OneDrive for a while, you need to re-auth it again.`,6e3)}async getVaultRandomIDFromOldConfigFile(){let e="";return this.settings.vaultRandomID!==void 0&&(this.settings.vaultRandomID!==""&&(e=this.settings.vaultRandomID),delete this.settings.vaultRandomID,await this.saveSettings()),e}async trash(e){if(this.settings.trashLocal){await this.app.vault.adapter.trashLocal(e);return}else await this.app.vault.adapter.trashSystem(e)||await this.app.vault.adapter.trashLocal(e)}getVaultBasePath(){return this.app.vault.adapter instanceof er.FileSystemAdapter?this.app.vault.adapter.getBasePath().split("?")[0]:this.app.vault.adapter.getResourcePath("").split("?")[0]}async prepareDBAndVaultRandomID(e,r){let{db:i,vaultRandomID:n}=await c8(e,r);this.db=i,this.vaultRandomID=n}toggleStatusText(e){this.statusBarIntervalID!==void 0&&(window.clearInterval(this.statusBarIntervalID),this.statusBarIntervalID=void 0),e&&(this.statusBarIntervalID=window.setInterval(async()=>{this.syncStatus!=="syncing"&&this.updateStatusBar()},3e4),this.updateStatusBar())}toggleStatusBar(e){this.statusBarElement?.remove();let r=document.getElementsByClassName("status-bar")[0];if(r.removeClass("remotely-sync-show-status-bar"),r.style.marginBottom="0px",Array.from(r.children).forEach(i=>{i.removeClass("remotely-sync-hidden")}),e&&this.settings.enableStatusBarInfo){if(er.Platform.isMobile&&(r.addClass("remotely-sync-show-status-bar"),er.Platform.isPhone)){let i=document.getElementsByClassName("mobile-navbar")[0],n=window.getComputedStyle(i).getPropertyValue("height");r.style.marginBottom=n}this.settings.showLastSyncedOnly&&Array.from(r.children).forEach(i=>{i.addClass("remotely-sync-hidden")}),this.statusBarElement=this.addStatusBarItem(),this.statusBarElement.createEl("span"),this.statusBarElement.setAttribute("data-tooltip-position","top"),this.updateStatusBar()}}async toggleSyncOnRemote(e){if(this.syncOnRemoteIntervalID!==void 0&&(window.clearInterval(this.syncOnRemoteIntervalID),this.syncOnRemoteIntervalID=void 0),e===!1||this.settings.syncOnRemoteChangesAfterMilliseconds===-1)return;let r=!1,i=async()=>{if(this.syncStatus!=="idle"||r)return;r=!0;let n=await this.getMetadataMtime();if(r=!1,n===void 0)return!1;if(n!==this.settings.lastSynced)return ht.debug("Sync on Remote ran | Remote Metadata:",n+", Last Synced:",this.settings.lastSynced),this.syncRun("auto"),!0};if(er.Platform.isMobileApp){let n=await i();new er.Notice(n===!0?this.i18n.t("remote_changes_found"):this.i18n.t("remote_changes_synced"))}this.syncOnRemoteIntervalID=window.setInterval(i,this.settings.syncOnRemoteChangesAfterMilliseconds)}async toggleSyncOnSave(e){let r=!1;if(this.syncOnSaveEvent!==void 0&&(this.app.vault.offref(this.syncOnSaveEvent),this.syncOnSaveEvent=void 0),this.vaultScannerIntervalId!==void 0&&(window.clearInterval(this.vaultScannerIntervalId),this.vaultScannerIntervalId=void 0),e===!1||this.settings.syncOnSaveAfterMilliseconds===-1)return;this.syncOnSaveEvent=this.app.vault.on("modify",()=>{this.syncStatus!=="idle"||r||(r=!0,ht.debug(`Scheduled a sync run for ${this.settings.syncOnSaveAfterMilliseconds} milliseconds later`),setTimeout(async()=>{ht.debug("Sync on save ran"),await this.syncRun("auto"),r=!1},this.settings.syncOnSaveAfterMilliseconds))});let i=async()=>{if(this.syncStatus!=="idle"||r||!this.settings.syncConfigDir)return;ht.debug("Scanning config directory for changes");let n=await bx(this.app.vault,this.manifest.id,this.settings.syncTrash);for(let o=0;othis.settings.lastSynced){ht.debug("Unsynced config file found: ",c.key),r=!0,ht.debug(`Scheduled a sync run for ${this.settings.syncOnSaveAfterMilliseconds} milliseconds later`),setTimeout(async()=>{ht.debug("Sync on save ran"),await this.syncRun("auto"),r=!1},this.settings.syncOnSaveAfterMilliseconds);break}}};this.vaultScannerIntervalId=window.setInterval(i,3e4)}toggleStatusBarObserver(e){if(this.statusBarObserver?.disconnect(),this.statusBarObserver=void 0,e&&this.settings.showLastSyncedOnly){this.statusBarObserver=new MutationObserver((i,n)=>{let o=!1,c=!1;for(let u of i)u.type==="childList"&&u.addedNodes.length>0&&(o=!0),u.addedNodes.forEach(d=>{d.className==="status-bar-item plugin-remotely-secure"&&(c=!0)});o&&!c&&(ht.debug("Status bar item added, refreshing status bar."),this.toggleStatusBar(!0))});let r=document.getElementsByClassName("status-bar")[0];this.statusBarObserver.observe(r,{childList:!0})}}async getMetadataMtime(){let e=this.getRemoteClient(this),r=await e.listFromRemote(),n=(await Op(r.Contents,e,this.settings.password)).mtimeRemote;return n===void 0&&this.settings.lastSynced!==void 0?this.settings.lastSynced:n}async getSyncPlan2(){await this.createTrashIfDoesNotExist();let e=this.getRemoteClient(this),r=await e.listFromRemote(),i=await e6(r.Contents,this.settings.password),n=await Op(r.Contents,e,this.settings.password),o=await t6(r.Contents,this.db,this.vaultRandomID,e.serviceType,this.settings.password),c=this.app.vault.getAllLoadedFiles(),u=await this.getLocalHistory(),d=await bx(this.app.vault,this.manifest.id,this.settings.syncTrash),y=await this.fetchMetadataFromRemote(n,e),{plan:E}=await this.getSyncPlan(o,c,d,y,u,e,"auto");return E}enableAutoSyncIfSet(){this.settings.autoRunEveryMilliseconds!==void 0&&this.settings.autoRunEveryMilliseconds!==null&&this.settings.autoRunEveryMilliseconds>0&&this.app.workspace.onLayoutReady(()=>{let e=window.setInterval(()=>{this.syncRun("auto")},this.settings.autoRunEveryMilliseconds);this.autoRunIntervalID=e,this.registerInterval(e)})}enableInitSyncIfSet(){this.settings.initRunAfterMilliseconds!==void 0&&this.settings.initRunAfterMilliseconds!==null&&this.settings.initRunAfterMilliseconds>0&&this.app.workspace.onLayoutReady(()=>{window.setTimeout(()=>{this.syncRun("autoOnceInit")},this.settings.initRunAfterMilliseconds)})}async tryToAddIgnoreFile(){let e=this.manifest.dir;if(!await this.app.vault.adapter.exists(e))return;let i=`${e}/.gitignore`,n=await this.app.vault.adapter.exists(i),o=`data.json -`;try{n||this.app.vault.adapter.write(i,o)}catch{}}addOutputToDBIfSet(){this.settings.logToDB&&xy((...e)=>{Sy(this.db,this.vaultRandomID,...e)})}enableAutoClearOutputToDBHistIfSet(){this.app.workspace.onLayoutReady(()=>{window.setTimeout(()=>{this.settings.logToDB&&im(this.db)},45e3);let i=window.setInterval(()=>{this.settings.logToDB&&im(this.db)},3e5);this.registerInterval(i)})}enableAutoClearSyncPlanHist(){this.app.workspace.onLayoutReady(()=>{window.setTimeout(()=>{VE(this.db)},45e3);let i=window.setInterval(()=>{VE(this.db)},3e5);this.registerInterval(i)})}async createTrashFolderIfDoesNotExist(e){await e.adapter.stat(".trash")==null&&await e.adapter.mkdir(".trash")}}; -/*! - localForage -- Offline Storage, Improved - Version 1.10.0 - https://localforage.github.io/localForage - (c) 2013-2017 Mozilla, Apache License 2.0 -*/ -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -/*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2022 Douglas Christopher Wilson - * MIT Licensed - */ -/*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ -/*! - * mustache.js - Logic-less {{mustache}} templates with JavaScript - * http://github.com/janl/mustache.js - */ -/*! ***************************************************************************** -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. -***************************************************************************** */ -/*! @azure/msal-common v14.4.0 2023-11-07 */ -/*! @azure/msal-node v2.5.1 2023-11-07 */ -/*! For license information please see webdav.js.LICENSE.txt */ -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ - -/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/remotely-secure/manifest.json b/.obsidian/plugins/remotely-secure/manifest.json deleted file mode 100644 index 375bcbb..0000000 --- a/.obsidian/plugins/remotely-secure/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "remotely-secure", - "name": "Remotely Sync", - "version": "0.4.49", - "minAppVersion": "1.4.11", - "description": "Security and feature updates for the remotely-save unofficial plugin allowing users to synchronize notes between local device and the cloud service. Not backwards compatible.", - "author": "sboesen", - "authorUrl": "https://github.com/sboesen", - "isDesktopOnly": false -} diff --git a/.obsidian/plugins/remotely-secure/styles.css b/.obsidian/plugins/remotely-secure/styles.css deleted file mode 100644 index ef20a66..0000000 --- a/.obsidian/plugins/remotely-secure/styles.css +++ /dev/null @@ -1,72 +0,0 @@ -/* set the styles */ - -.password-second-confirm { - font-weight: bold; -} - -.password-disclaimer { - font-weight: bold; -} - -.settings-auth-related { - border-top: 1px solid var(--background-modifier-border); - padding-top: 18px; -} - -.s3-disclaimer { - font-weight: bold; -} -.s3-hide { - display: none; -} - -.dropbox-disclaimer { - font-weight: bold; -} -.dropbox-hide { - display: none; -} - -.dropbox-auth-button-hide { - display: none; -} - -.dropbox-revoke-auth-button-hide { - display: none; -} - -.onedrive-disclaimer { - font-weight: bold; -} -.onedrive-hide { - display: none; -} - -.onedrive-auth-button-hide { - display: none; -} - -.onedrive-revoke-auth-button-hide { - display: none; -} - -.webdav-disclaimer { - font-weight: bold; -} -.webdav-hide { - display: none; -} - -.qrcode-img { - width: 350px; - height: 350px; -} - -/* !important isn't great practice but it needs to overwrite other css classes */ -.remotely-sync-hidden { - display: none !important; -} - -.remotely-sync-show-status-bar { - display: flex !important; -} \ No newline at end of file diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 9e1f62f..0b8ec79 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -28,29 +28,28 @@ "direction": "vertical" }, "left": { - "id": "de5cc35e02f95fe7", + "id": "05636c41c23405f7", "type": "split", "children": [ { - "id": "b420879b7a56f464", + "id": "e47a5f841946ee99", "type": "tabs", - "dimension": 52.602436323366554, "children": [ { - "id": "b1cf03bb19fff71c", + "id": "fa6bce4b177ee38f", "type": "leaf", "state": { "type": "file-explorer", "state": { "sortOrder": "alphabetical", - "autoReveal": true + "autoReveal": false }, "icon": "lucide-folder-closed", "title": "文件列表" } }, { - "id": "dace5c7dcbe1070a", + "id": "a00d4ceb9fb0f36b", "type": "leaf", "state": { "type": "search", @@ -67,7 +66,7 @@ } }, { - "id": "dc5f3ba5f76a37c0", + "id": "aec8824d72931057", "type": "leaf", "state": { "type": "bookmarks", @@ -77,39 +76,67 @@ } } ] - }, + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "6990f110022dd527", + "type": "split", + "children": [ { - "id": "383cdf8445d918d1", + "id": "6e31f7592a8084ad", "type": "tabs", - "dimension": 47.39756367663344, "children": [ { - "id": "d1e1fbb98edd7d1b", + "id": "b3226c3971177c8f", "type": "leaf", "state": { - "type": "outline", + "type": "backlink", "state": { - "file": "YueQian/相关网站.md", - "followCursor": true, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-coming-in", + "title": "反向链接" + } + }, + { + "id": "6d10d7941f672a21", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "linksCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-going-out", + "title": "出链" + } + }, + { + "id": "a4a91549008c9332", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true, "showSearch": false, "searchQuery": "" }, - "icon": "lucide-list", - "title": "相关网站 的大纲" + "icon": "lucide-tags", + "title": "标签" } }, { - "id": "5e9d6a2802bea202", - "type": "leaf", - "state": { - "type": "graph", - "state": {}, - "icon": "lucide-git-fork", - "title": "关系图谱" - } - }, - { - "id": "b701810dff40f03d", + "id": "d98c8d4ec529e3a1", "type": "leaf", "state": { "type": "all-properties", @@ -123,120 +150,43 @@ } }, { - "id": "ffdb392eea0ad1e2", + "id": "7d4199487d60b3d7", "type": "leaf", "state": { - "type": "tag", + "type": "outline", "state": { - "sortOrder": "frequency", - "useHierarchy": true, + "followCursor": false, "showSearch": false, "searchQuery": "" }, - "icon": "lucide-tags", - "title": "标签" - } - } - ] - } - ], - "direction": "horizontal", - "width": 251.5 - }, - "right": { - "id": "226d7e2fa4214659", - "type": "split", - "children": [ - { - "id": "5f3133c4b756d282", - "type": "tabs", - "dimension": 42.9637526652452, - "children": [ - { - "id": "95f542e77279c08b", - "type": "leaf", - "state": { - "type": "backlink", - "state": { - "file": "README.md", - "collapseAll": false, - "extraContext": false, - "sortOrder": "alphabetical", - "showSearch": false, - "searchQuery": "", - "backlinkCollapsed": false, - "unlinkedCollapsed": true - }, - "icon": "links-coming-in", - "title": "README 的反向链接列表" + "icon": "lucide-list", + "title": "大纲" } }, { - "id": "8deac5bcdaa32e82", + "id": "41d3b7dc137839dd", "type": "leaf", - "state": { - "type": "outgoing-link", - "state": { - "linksCollapsed": false, - "unlinkedCollapsed": true - }, - "icon": "links-going-out", - "title": "出链" - } - }, - { - "id": "841e99623ecdb9f4", - "type": "leaf", - "pinned": true, "state": { "type": "chinese-calendar-view", "state": {}, - "pinned": true, "icon": "calendar-with-checkmark", "title": "日历" } - }, - { - "id": "5e96455aab22a229", - "type": "leaf", - "state": { - "type": "git-view", - "state": {}, - "icon": "git-pull-request", - "title": "Source Control" - } - } - ], - "currentTab": 3 - }, - { - "id": "bf1e7d1a52b4651c", - "type": "tabs", - "dimension": 57.0362473347548, - "children": [ - { - "id": "07d3867b48c266c6", - "type": "leaf", - "state": { - "type": "custom-frames-滴答", - "state": {}, - "icon": "lucide-clipboard-list", - "title": "滴答" - } } ] } ], "direction": "horizontal", - "width": 336.5 + "width": 300, + "collapsed": true }, "left-ribbon": { "hiddenItems": { - "graph:查看关系图谱": false, "switcher:打开快速切换": false, + "graph:查看关系图谱": false, + "canvas:新建白板": false, "command-palette:打开命令面板": false, "workspaces:管理工作区布局": false, - "canvas:新建白板": false, "bases:新建数据库": false, "pdf-plus:PDF++: 切换自动复制": false, "pdf-plus:PDF++: 切换自动对焦": false, @@ -245,56 +195,14 @@ "obsidian-git:Open Git source control": false, "homepage:Open homepage": false, "templater-obsidian:Templater": false, - "remotely-save:Remotely Save": false + "obsidian-livesync:P2P Replicator": false, + "obsidian-livesync:Replicate": false, + "obsidian-livesync:Show Log": false } }, "active": "e7a7b303c61786dc", "lastOpenFiles": [ - "YueQian/相关网站.md", - "Collection/连~都忘记了的小知识.md", - "BlogWebsite/Article/Obsidian使用飞牛WebDAV实现多端同步.md", - "BlogWebsite/Article/docker的容器和镜像的删除操作.md", - "BlogWebsite/Article/Debian从零开始使用pnpm部署项目.md", - "obsidian-pkmer.zip", - "obsidian-i18n-master.zip", - "Obsidian-1.11.4.exe", - "obsidian-i18n-master/translation/mark/zh-cn.json", - "obsidian-i18n-master/translation/mark", - "obsidian-i18n-master/translation/directory/zh-cn.json", - "obsidian-i18n-master/translation/directory", - "obsidian-i18n-master/translation/dict/zotlit/zh-cn/1.1.9.json", - "obsidian-i18n-master/translation/dict/zotlit/zh-cn", - "obsidian-i18n-master/translation/dict/zotlit", - "obsidian-i18n-master/images/编辑按钮.png", - "obsidian-i18n-master/images/内置编辑器.png", - "obsidian-i18n-master/images/云端文件模式.png", - "obsidian-i18n-master/images/下载按钮.png", - "obsidian-i18n-master/images/logo.png", - "obsidian-i18n-master/images/i18n的工作原理简图.png", - "obsidian-i18n-master/images/i18n按钮.png", - "obsidian-i18n-master/README.md", - "obsidian-i18n-master/README.en.md", - "obsidian-i18n-master/Obsidian.png", - "Collection/YoudaoyunNotes/02C语言/images/WEBRESOURCEf305530c183d4d1682bc4b1fe628e14fstickPicture.png", - "Collection/YoudaoyunNotes/02C语言/images/WEBRESOURCEf043bb345ce02a43791f1afe7466e30dimage.png", - "Collection/YoudaoyunNotes/02C语言/14-预处理与文件组织.md", - "Collection/YoudaoyunNotes/02C语言/11-内存管理.md", - "Collection/YoudaoyunNotes/02C语言/10-函数进阶.md", - "Collection/YoudaoyunNotes/02C语言/09-数组与指针进阶.md", - "Collection/YoudaoyunNotes/02C语言/08-指针.md", - "Collection/YoudaoyunNotes/02C语言/07-数组.md", - "Collection/YoudaoyunNotes/02C语言/06-函数基础.md", - "Collection/YoudaoyunNotes/02C语言/05-控制与分支.md", - "Collection/YoudaoyunNotes/02C语言/03-数据类型及IO流.md", - "Collection/YoudaoyunNotes/02C语言/01-C语言概述.md", - "Collection/YoudaoyunNotes/01Linux基础/06_常用Shell命令.md", - "Collection/YoudaoyunNotes/01Linux基础/05_网络配置.md", - "Collection/YoudaoyunNotes/01Linux基础/04_命令行编辑与编译.md", - "Collection/YoudaoyunNotes/01Linux基础/03_文件互通.md", - "Collection/YoudaoyunNotes/01Linux基础/02_Linux概述.md", - "Collection/YoudaoyunNotes/01Linux基础/01-开发环境安装.md", - "Collection/YoudaoyunNotes/01Linux基础/00-简介.md", - "Template/Diary.md", - "Template/AutoAdd.md" + "README.md", + "YueQian/相关网站.md" ] } \ No newline at end of file