Skip to content

Instantly share code, notes, and snippets.

@cuongld2
Created June 9, 2023 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuongld2/9fdb84e130ba8bf19dee44b4b665caaa to your computer and use it in GitHub Desktop.
Save cuongld2/9fdb84e130ba8bf19dee44b4b665caaa to your computer and use it in GitHub Desktop.
Sample extension.js file for configuring fauxpilot
/*! For license information please see extension.js.LICENSE.txt */
(()=>{var e={8348:e=>{const t="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,n="function"==typeof AbortController?AbortController:class{constructor(){this.signal=new i}abort(){this.signal.dispatchEvent("abort")}},r="function"==typeof AbortSignal,o="function"==typeof n.AbortSignal,i=r?AbortSignal:o?n.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(e){if("abort"===e){this.aborted=!0;const t={type:e,target:this};this.onabort(t),this._listeners.forEach((e=>e(t)),this)}}onabort(){}addEventListener(e,t){"abort"===e&&this._listeners.push(t)}removeEventListener(e,t){"abort"===e&&(this._listeners=this._listeners.filter((e=>e!==t)))}},s=new Set,a=(e,t)=>{const n=`LRU_CACHE_OPTION_${e}`;u(n)&&d(n,`${e} option`,`options.${t}`,g)},c=(e,t)=>{const n=`LRU_CACHE_METHOD_${e}`;if(u(n)){const{prototype:r}=g,{get:o}=Object.getOwnPropertyDescriptor(r,e);d(n,`${e} method`,`cache.${t}()`,o)}},l=(...e)=>{"object"==typeof process&&process&&"function"==typeof process.emitWarning?process.emitWarning(...e):console.error(...e)},u=e=>!s.has(e),d=(e,t,n,r)=>{s.add(e),l(`The ${t} is deprecated. Please use ${n} instead.`,"DeprecationWarning",e,r)},p=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),h=e=>p(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?f:null:null;class f extends Array{constructor(e){super(e),this.fill(0)}}class m{constructor(e){if(0===e)return[];const t=h(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class g{constructor(e={}){const{max:t=0,ttl:n,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:i,updateAgeOnHas:c,allowStale:d,dispose:f,disposeAfter:_,noDisposeOnSet:y,noUpdateTTL:v,maxSize:b=0,sizeCalculation:w,fetchMethod:x,fetchContext:E,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:S}=e,{length:T,maxAge:k,stale:I}=e instanceof g?{}:e;if(0!==t&&!p(t))throw new TypeError("max option must be a nonnegative integer");const P=t?h(t):Array;if(!P)throw new Error("invalid max value: "+t);if(this.max=t,this.maxSize=b,this.sizeCalculation=w||T,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=x||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=E,!this.fetchMethod&&void 0!==E)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(t).fill(null),this.valList=new Array(t).fill(null),this.next=new P(t),this.prev=new P(t),this.head=0,this.tail=0,this.free=new m(t),this.initialFill=1,this.size=0,"function"==typeof f&&(this.dispose=f),"function"==typeof _?(this.disposeAfter=_,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!C,0!==this.maxSize){if(!p(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!d||!!I,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!i,this.updateAgeOnHas=!!c,this.ttlResolution=p(r)||0===r?r:1,this.ttlAutopurge=!!o,this.ttl=n||k||0,this.ttl){if(!p(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const e="LRU_CACHE_UNBOUNDED";u(e)&&(s.add(e),l("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,g))}I&&a("stale","allowStale"),k&&a("maxAge","ttl"),T&&a("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new f(this.max),this.starts=new f(this.max),this.setItemTTL=(e,n,r=t.now())=>{if(this.starts[e]=0!==n?r:0,this.ttls[e]=n,0!==n&&this.ttlAutopurge){const t=setTimeout((()=>{this.isStale(e)&&this.delete(this.keyList[e])}),n+1);t.unref&&t.unref()}},this.updateItemAge=e=>{this.starts[e]=0!==this.ttls[e]?t.now():0};let e=0;const n=()=>{const n=t.now();if(this.ttlResolution>0){e=n;const t=setTimeout((()=>e=0),this.ttlResolution);t.unref&&t.unref()}return n};this.getRemainingTTL=t=>{const r=this.keyMap.get(t);return void 0===r?0:0===this.ttls[r]||0===this.starts[r]?1/0:this.starts[r]+this.ttls[r]-(e||n())},this.isStale=t=>0!==this.ttls[t]&&0!==this.starts[t]&&(e||n())-this.starts[t]>this.ttls[t]}updateItemAge(e){}setItemTTL(e,t,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new f(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,n,r)=>{if(!p(n)){if(!r)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof r)throw new TypeError("sizeCalculation must be a function");if(n=r(t,e),!p(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.addItemSize=(e,t)=>{this.sizes[e]=t;const n=this.maxSize-this.sizes[e];for(;this.calculatedSize>n;)this.evict(!0);this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,n,r){if(n||r)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;this.isValidIndex(t)&&(!e&&this.isStale(t)||(yield t),t!==this.head);)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;this.isValidIndex(t)&&(!e&&this.isStale(t)||(yield t),t!==this.tail);)t=this.next[t]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(const e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(const e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(const e of this.indexes())yield this.keyList[e]}*rkeys(){for(const e of this.rindexes())yield this.keyList[e]}*values(){for(const e of this.indexes())yield this.valList[e]}*rvalues(){for(const e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,t={}){for(const n of this.indexes())if(e(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],t)}forEach(e,t=this){for(const n of this.indexes())e.call(t,this.valList[n],this.keyList[n],this)}rforEach(e,t=this){for(const n of this.rindexes())e.call(t,this.valList[n],this.keyList[n],this)}get prune(){return c("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(const t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){const e=[];for(const n of this.indexes({allowStale:!0})){const r=this.keyList[n],o=this.valList[n],i={value:this.isBackgroundFetch(o)?o.__staleWhileFetching:o};if(this.ttls){i.ttl=this.ttls[n];const e=t.now()-this.starts[n];i.start=Math.floor(Date.now()-e)}this.sizes&&(i.size=this.sizes[n]),e.unshift([r,i])}return e}load(e){this.clear();for(const[n,r]of e){if(r.start){const e=Date.now()-r.start;r.start=t.now()-e}this.set(n,r.value,r)}}dispose(e,t,n){}set(e,t,{ttl:n=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,size:i=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){if(i=this.requireSize(e,t,i,s),this.maxSize&&i>this.maxSize)return this;let c=0===this.size?void 0:this.keyMap.get(e);if(void 0===c)c=this.newIndex(),this.keyList[c]=e,this.valList[c]=t,this.keyMap.set(e,c),this.next[this.tail]=c,this.prev[c]=this.tail,this.tail=c,this.size++,this.addItemSize(c,i),a=!1;else{const n=this.valList[c];t!==n&&(this.isBackgroundFetch(n)?n.__abortController.abort():o||(this.dispose(n,e,"set"),this.disposeAfter&&this.disposed.push([n,e,"set"])),this.removeItemSize(c),this.valList[c]=t,this.addItemSize(c,i)),this.moveToTail(c)}if(0===n||0!==this.ttl||this.ttls||this.initializeTTLTracking(),a||this.setItemTTL(c,n,r),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const e=this.valList[this.head];return this.evict(!0),e}}evict(e){const t=this.head,n=this.keyList[t],r=this.valList[t];return this.isBackgroundFetch(r)?r.__abortController.abort():(this.dispose(r,n,"evict"),this.disposeAfter&&this.disposed.push([r,n,"evict"])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(n),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas}={}){const n=this.keyMap.get(e);return void 0!==n&&!this.isStale(n)&&(t&&this.updateItemAge(n),!0)}peek(e,{allowStale:t=this.allowStale}={}){const n=this.keyMap.get(e);if(void 0!==n&&(t||!this.isStale(n))){const e=this.valList[n];return this.isBackgroundFetch(e)?e.__staleWhileFetching:e}}backgroundFetch(e,t,r,o){const i=void 0===t?void 0:this.valList[t];if(this.isBackgroundFetch(i))return i;const s=new n,a={signal:s.signal,options:r,context:o},c=new Promise((t=>t(this.fetchMethod(e,i,a)))).then((t=>(s.signal.aborted||this.set(e,t,a.options),t)),(n=>{if(this.valList[t]===c&&(r.noDeleteOnFetchRejection&&void 0!==c.__staleWhileFetching?this.valList[t]=c.__staleWhileFetching:this.delete(e)),c.__returned===c)throw n}));return c.__abortController=s,c.__staleWhileFetching=i,c.__returned=null,void 0===t?(this.set(e,c,a.options),t=this.keyMap.get(e)):this.valList[t]=c,c}isBackgroundFetch(e){return e&&"object"==typeof e&&"function"==typeof e.then&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||null===e.__returned)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:i=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,fetchContext:u=this.fetchContext,forceRefresh:d=!1}={}){if(!this.fetchMethod)return this.get(e,{allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r});const p={allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:i,size:s,sizeCalculation:a,noUpdateTTL:c,noDeleteOnFetchRejection:l};let h=this.keyMap.get(e);if(void 0===h){const t=this.backgroundFetch(e,h,p,u);return t.__returned=t}{const r=this.valList[h];if(this.isBackgroundFetch(r))return t&&void 0!==r.__staleWhileFetching?r.__staleWhileFetching:r.__returned=r;if(!d&&!this.isStale(h))return this.moveToTail(h),n&&this.updateItemAge(h),r;const o=this.backgroundFetch(e,h,p,u);return t&&void 0!==o.__staleWhileFetching?o.__staleWhileFetching:o.__returned=o}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet}={}){const o=this.keyMap.get(e);if(void 0!==o){const i=this.valList[o],s=this.isBackgroundFetch(i);if(this.isStale(o))return s?t?i.__staleWhileFetching:void 0:(r||this.delete(e),t?i:void 0);if(s)return;return this.moveToTail(o),n&&this.updateItemAge(o),i}}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return c("del","delete"),this.delete}delete(e){let t=!1;if(0!==this.size){const n=this.keyMap.get(e);if(void 0!==n)if(t=!0,1===this.size)this.clear();else{this.removeItemSize(n);const t=this.valList[n];this.isBackgroundFetch(t)?t.__abortController.abort():(this.dispose(t,e,"delete"),this.disposeAfter&&this.disposed.push([t,e,"delete"])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(const e of this.rindexes({allowStale:!0})){const t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort();else{const n=this.keyList[e];this.dispose(t,n,"delete"),this.disposeAfter&&this.disposed.push([t,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return c("reset","clear"),this.clear}get length(){return((e,t)=>{const n="LRU_CACHE_PROPERTY_length";if(u(n)){const{prototype:t}=g,{get:r}=Object.getOwnPropertyDescriptor(t,e);d(n,"length property","cache.size",r)}})("length"),this.size}static get AbortController(){return n}static get AbortSignal(){return i}}e.exports=g},9407:(e,t,n)=>{"use strict";const{randomBytes:r}=n(6113),{Readable:o}=n(2781),i=e=>"object"==typeof e&&0===["arrayBuffer","stream","text","slice","constructor"].map((t=>typeof e[t])).filter((e=>"function"!==e)).length&&"string"==typeof e.type&&"number"==typeof e.size&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),s=e=>`--${e}--\r\n\r\n`,a=(e,t,n)=>{let r="";return r+=`--${e}\r\n`,r+=`Content-Disposition: form-data; name="${t}"`,i(n)&&(r+=`; filename="${n.name}"\r\n`,r+=`Content-Type: ${n.type||"application/octet-stream"}`),`${r}\r\n\r\n`};e.exports={isFormData:e=>null!=e&&"object"==typeof e&&0===["append","delete","get","getAll","has","set","keys","values","entries","constructor"].map((t=>typeof e[t])).filter((e=>"function"!==e)).length&&"FormData"===e[Symbol.toStringTag],FormDataSerializer:class{constructor(e){this.fd=e,this.boundary=r(8).toString("hex")}length(){return void 0===this._length&&(this._length=((e,t)=>{let n=0;for(const[r,o]of e)n+=Buffer.byteLength(a(t,r,o)),n+=i(o)?o.size:Buffer.byteLength(String(o)),n+=Buffer.byteLength("\r\n");return n+=Buffer.byteLength(s(t)),n})(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return o.from(async function*(e,t){for(const[n,r]of e)yield a(t,n,r),i(r)?yield*r.stream():yield r,yield"\r\n";yield s(t)}(this.fd,this.boundary))}}}},4544:(e,t,n)=>{"use strict";const{constants:{MAX_LENGTH:r}}=n(4300),{pipeline:o,PassThrough:i}=n(2781),{promisify:s}=n(3837),{createGunzip:a,createInflate:c,createBrotliDecompress:l,constants:{Z_SYNC_FLUSH:u}}=n(9796),d=n(8104)("helix-fetch:utils"),p=s(o),h=(e,t)=>{if(Buffer.isBuffer(e))return e.length;switch(typeof e){case"string":return 2*e.length;case"boolean":return 4;case"number":return 8;case"symbol":return Symbol.keyFor(e)?2*Symbol.keyFor(e).length:2*(e.toString().length-8);case"object":return Array.isArray(e)?f(e,t):m(e,t);default:return 0}},f=(e,t)=>(t.add(e),e.map((e=>t.has(e)?0:h(e,t))).reduce(((e,t)=>e+t),0)),m=(e,t)=>{if(null==e)return 0;t.add(e);let n=0;const r=[];for(const t in e)r.push(t);return r.push(...Object.getOwnPropertySymbols(e)),r.forEach((r=>{if(n+=h(r,t),"object"==typeof e[r]&&null!==e[r]){if(t.has(e[r]))return;t.add(e[r])}n+=h(e[r],t)})),n};e.exports={decodeStream:(e,t,n,r)=>{if(!((e,t)=>204!==e&&304!==e&&0!=+t["content-length"]&&/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(t["content-encoding"]))(e,t))return n;const i=e=>{e&&(d(`encountered error while decoding stream: ${e}`),r(e))};switch(t["content-encoding"].trim()){case"gzip":case"x-gzip":return o(n,a({flush:u,finishFlush:u}),i);case"deflate":case"x-deflate":return o(n,c(),i);case"br":return o(n,l(),i);default:return n}},isPlainObject:e=>{if(!e||"object"!=typeof e)return!1;if("[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},sizeof:e=>h(e,new WeakSet),streamToBuffer:async e=>{const t=new i;let n=0;const o=[];return t.on("data",(e=>{if(n+e.length>r)throw new Error("Buffer.constants.MAX_SIZE exceeded");o.push(e),n+=e.length})),await p(e,t),Buffer.concat(o,n)}}},1787:e=>{"use strict";class t extends Error{get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}e.exports={RequestAbortedError:t}},9803:(e,t,n)=>{"use strict";const r=n(3685),o=n(5687),{Readable:i}=n(2781),s=n(8104)("helix-fetch:h1"),{RequestAbortedError:a}=n(1787),{decodeStream:c}=n(4544);e.exports={request:async(e,t,n)=>{const{request:l}="https:"===t.protocol?o:r,u=((e,t)=>{const{h1:n,options:{h1:i,rejectUnauthorized:s}}=e;return"https:"===t?n.httpsAgent?n.httpsAgent:i||"boolean"==typeof s?(n.httpsAgent=new o.Agent("boolean"==typeof s?{...i||{},rejectUnauthorized:s}:i),n.httpsAgent):void 0:n.httpAgent?n.httpAgent:i?(n.httpAgent=new r.Agent(i),n.httpAgent):void 0})(e,t.protocol),d={...n,agent:u},{socket:p,body:h}=d;return p&&(delete d.socket,p.assigned||(p.assigned=!0,u?d.agent=new Proxy(u,{get:(e,t)=>"createConnection"!==t||p.inUse?e[t]:(e,t)=>{s(`agent reusing socket #${p.id} (${p.servername})`),p.inUse=!0,t(null,p)}}):d.createConnection=(e,t)=>{s(`reusing socket #${p.id} (${p.servername})`),p.inUse=!0,t(null,p)})),new Promise(((e,n)=>{let r;s(`${d.method} ${t.href}`);const{signal:o}=d,u=()=>{o.removeEventListener("abort",u),p&&!p.inUse&&(s(`discarding redundant socket used for ALPN: #${p.id} ${p.servername}`),p.destroy()),n(new a),r&&r.abort()};if(o){if(o.aborted)return void n(new a);o.addEventListener("abort",u)}r=l(t,d),r.once("response",(t=>{o&&o.removeEventListener("abort",u),p&&!p.inUse&&(s(`discarding redundant socket used for ALPN: #${p.id} ${p.servername}`),p.destroy()),e(((e,t,n)=>{const{statusCode:r,statusMessage:o,httpVersion:i,httpVersionMajor:s,httpVersionMinor:a,headers:l}=e,u=t?c(r,l,e,n):e;return{statusCode:r,statusText:o,httpVersion:i,httpVersionMajor:s,httpVersionMinor:a,headers:l,readable:u,decoded:!(!t||u===e)}})(t,d.decode,n))})),r.once("error",(e=>{o&&o.removeEventListener("abort",u),p&&!p.inUse&&(s(`discarding redundant socket used for ALPN: #${p.id} ${p.servername}`),p.destroy()),r.aborted||(s(`${d.method} ${t.href} failed with: ${e.message}`),r.abort(),n(e))})),h instanceof i?h.pipe(r):(h&&r.write(h),r.end())}))},setupContext:e=>{e.h1={}},resetContext:async({h1:e})=>{e.httpAgent&&(s("resetContext: destroying httpAgent"),e.httpAgent.destroy(),delete e.httpAgent),e.httpsAgent&&(s("resetContext: destroying httpsAgent"),e.httpsAgent.destroy(),delete e.httpsAgent)}}},7262:(e,t,n)=>{"use strict";const{connect:r,constants:o}=n(1995),{Readable:i}=n(2781),s=n(8104)("helix-fetch:h2"),{RequestAbortedError:a}=n(1787),{decodeStream:c}=n(4544),{NGHTTP2_CANCEL:l}=o,u=3e5,d=5e3,p=(e,t,n,r=(()=>{}))=>{const o={...e},i=o[":status"];delete o[":status"];const s=n?c(i,e,t,r):t;return{statusCode:i,statusText:"",httpVersion:"2.0",httpVersionMajor:2,httpVersionMinor:0,headers:o,readable:s,decoded:!(!n||s===t)}};e.exports={request:async(e,t,n)=>{const{origin:o,pathname:c,search:h,hash:f}=t,m=`${c}${h}${f}`,{options:{h2:g={}},h2:{sessionCache:_}}=e,{idleSessionTimeout:y=u,pushPromiseHandler:v,pushHandler:b}=g,w={...n},{method:x,headers:E,socket:C,body:S,decode:T}=w;return C&&delete w.socket,E.host&&(E[":authority"]=E.host,delete E.host),new Promise(((n,c)=>{let u,h=_[o];if(!h||h.closed||h.destroyed){const t=!(!1===e.options.rejectUnauthorized||!1===g.rejectUnauthorized),n={...g,rejectUnauthorized:t};C&&!C.inUse&&(n.createConnection=()=>(s(`reusing socket #${C.id} (${C.servername})`),C.inUse=!0,C));const i=!(!v&&!b);h=r(o,{...n,settings:{enablePush:i}}),h.setMaxListeners(1e3),h.setTimeout(y,(()=>{s(`closing session ${o} after ${y} ms of inactivity`),h.close()})),h.once("connect",(()=>{s(`session ${o} established`),s(`caching session ${o}`),_[o]=h})),h.on("localSettings",(e=>{s(`session ${o} localSettings: ${JSON.stringify(e)}`)})),h.on("remoteSettings",(e=>{s(`session ${o} remoteSettings: ${JSON.stringify(e)}`)})),h.once("close",(()=>{s(`session ${o} closed`),_[o]===h&&(s(`discarding cached session ${o}`),delete _[o])})),h.once("error",(e=>{s(`session ${o} encountered error: ${e}`),_[o]===h&&(s(`discarding cached session ${o}`),delete _[o])})),h.on("frameError",((e,t,n)=>{s(`session ${o} encountered frameError: type: ${e}, code: ${t}, id: ${n}`)})),h.once("goaway",((e,t,n)=>{s(`session ${o} received GOAWAY frame: errorCode: ${e}, lastStreamID: ${t}, opaqueData: ${n?n.toString():void 0}`)})),h.on("stream",((t,n,r)=>{((e,t,n,r,o,i)=>{const{options:{h2:{pushPromiseHandler:a,pushHandler:c,pushedStreamIdleTimeout:u=d}}}=e,h=o[":path"],f=`${t}${h}`;s(`received PUSH_PROMISE: ${f}, stream #${r.id}, headers: ${JSON.stringify(o)}, flags: ${i}`),a&&a(f,o,(()=>{r.close(l)})),r.on("push",((e,i)=>{s(`received push headers for ${t}${h}, stream #${r.id}, headers: ${JSON.stringify(e)}, flags: ${i}`),r.setTimeout(u,(()=>{s(`closing pushed stream #${r.id} after ${u} ms of inactivity`),r.close(l)})),c&&c(f,o,p(e,r,n))})),r.on("aborted",(()=>{s(`pushed stream #${r.id} aborted`)})),r.on("error",(e=>{s(`pushed stream #${r.id} encountered error: ${e}`)})),r.on("frameError",((e,t,n)=>{s(`pushed stream #${r.id} encountered frameError: type: ${e}, code: ${t}, id: ${n}`)}))})(e,o,T,t,n,r)}))}else C&&C.id!==h.socket.id&&!C.inUse&&(s(`discarding redundant socket used for ALPN: #${C.id} ${C.servername}`),C.destroy());s(`${x} ${t.host}${m}`);const{signal:f}=w,k=()=>{f.removeEventListener("abort",k),c(new a),u&&u.close(l)};if(f){if(f.aborted)return void c(new a);f.addEventListener("abort",k)}const I=e=>{s(`session ${o} encountered error during ${w.method} ${t.href}: ${e}`),c(e)};h.once("error",I),u=h.request({":method":x,":path":m,...E}),u.once("response",(e=>{h.off("error",I),f&&f.removeEventListener("abort",k),n(p(e,u,w.decode,c))})),u.once("error",(e=>{h.off("error",I),f&&f.removeEventListener("abort",k),u.rstCode!==l&&(s(`${w.method} ${t.href} failed with: ${e.message}`),u.close(l),c(e))})),u.once("frameError",((e,n,r)=>{h.off("error",I),s(`encountered frameError during ${w.method} ${t.href}: type: ${e}, code: ${n}, id: ${r}`)})),u.on("push",((e,t)=>{s(`received 'push' event: headers: ${JSON.stringify(e)}, flags: ${t}`)})),S instanceof i?S.pipe(u):(S&&u.write(S),u.end())}))},setupContext:e=>{e.h2={sessionCache:{}}},resetContext:async({h2:e})=>Promise.all(Object.values(e.sessionCache).map((e=>new Promise((t=>{e.on("close",t),s(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()})))))}},3100:(e,t,n)=>{"use strict";const r=n(8104)("helix-fetch:core"),{request:o,setupContext:i,resetContext:s,RequestAbortedError:a,ALPN_HTTP2:c,ALPN_HTTP2C:l,ALPN_HTTP1_1:u,ALPN_HTTP1_0:d}=n(9575);class p{constructor(e){this.options={...e||{}},i(this)}api(){return{request:async(e,t)=>this.request(e,t),context:(e={})=>new p(e).api(),reset:async()=>this.reset(),RequestAbortedError:a,ALPN_HTTP2:c,ALPN_HTTP2C:l,ALPN_HTTP1_1:u,ALPN_HTTP1_0:d}}async request(e,t){return o(this,e,t)}async reset(){return r("resetting context"),s(this)}}e.exports=(new p).api()},3769:(e,t,n)=>{"use strict";const{EventEmitter:r}=n(2361);e.exports=()=>{const e={},t=new r;return t.setMaxListeners(0),{acquire:n=>new Promise((r=>{if(!e[n])return e[n]=!0,void r();const o=i=>{e[n]||(e[n]=!0,t.removeListener(n,o),r(i))};t.on(n,o)})),release:(n,r)=>{Reflect.deleteProperty(e,n),setImmediate((()=>t.emit(n,r)))}}}},9575:(e,t,n)=>{"use strict";const{Readable:r}=n(2781),o=n(4404),{types:{isAnyArrayBuffer:i}}=n(3837),s=n(8348),a=n(8104)("helix-fetch:core"),{RequestAbortedError:c}=n(1787),l=n(9803),u=n(7262),d=n(3769),{isPlainObject:p}=n(4544),{isFormData:h,FormDataSerializer:f}=n(9407),{version:m}=n(5258),g="h2",_="h2c",y="http/1.0",v="http/1.1",b=100,w=36e5,x=[g,v,y],E=`helix-fetch/${m}`,C={method:"GET",compress:!0,decode:!0};let S=0;const T=d(),k=(e,t)=>new Promise(((n,r)=>{const{signal:i}=t;let s;const l=()=>{i.removeEventListener("abort",l);const e=new c;r(e),s&&s.destroy(e)};if(i){if(i.aborted)return void r(new c);i.addEventListener("abort",l)}const u=+e.port||443,d=t=>{i&&i.removeEventListener("abort",l),t instanceof c||(a(`connecting to ${e.hostname}:${u} failed with: ${t.message}`),r(t))};s=o.connect(u,e.hostname,t),s.once("secureConnect",(()=>{i&&i.removeEventListener("abort",l),s.off("error",d),S+=1,s.id=S,s.secureConnecting=!1,a(`established TLS connection: #${s.id} (${s.servername})`),n(s)})),s.once("error",d)}));e.exports={request:async(e,t,n)=>{const o=new URL(t),s={...C,...n||{}};let c;if("string"==typeof s.method&&(s.method=s.method.toUpperCase()),s.headers=(e=>{const t={};return Object.keys(e).forEach((n=>{t[n.toLowerCase()]=e[n]})),t})(s.headers||{}),void 0===s.headers.host&&(s.headers.host=o.host),e.userAgent&&void 0===s.headers["user-agent"]&&(s.headers["user-agent"]=e.userAgent),s.body instanceof URLSearchParams)c="application/x-www-form-urlencoded; charset=utf-8",s.body=s.body.toString();else if(h(s.body)){const e=new f(s.body);c=e.contentType(),s.body=e.stream(),void 0===s.headers["transfer-encoding"]&&void 0===s.headers["content-length"]&&(s.headers["content-length"]=String(e.length()))}else"string"==typeof s.body||s.body instanceof String?c="text/plain; charset=utf-8":p(s.body)?(s.body=JSON.stringify(s.body),c="application/json"):i(s.body)&&(s.body=Buffer.from(s.body));void 0===s.headers["content-type"]&&void 0!==c&&(s.headers["content-type"]=c),null!=s.body&&(s.body instanceof r||("string"==typeof s.body||s.body instanceof String||Buffer.isBuffer(s.body)||(s.body=String(s.body)),void 0===s.headers["transfer-encoding"]&&void 0===s.headers["content-length"]&&(s.headers["content-length"]=String(Buffer.isBuffer(s.body)?s.body.length:Buffer.byteLength(s.body,"utf-8"))))),void 0===s.headers.accept&&(s.headers.accept="*/*"),null==s.body&&["POST","PUT"].includes(s.method)&&(s.headers["content-length"]="0"),s.compress&&void 0===s.headers["accept-encoding"]&&(s.headers["accept-encoding"]="gzip,deflate,br");const{signal:d}=s,{protocol:m,socket:b=null}=e.socketFactory?await(async(e,t,n,r)=>{const o="https:"===t.protocol;let i;i=t.port?t.port:o?443:80;const s={...n,host:t.host,port:i},a=await e(s);if(o){const e={...s,ALPNProtocols:r};e.socket=a;const n=await k(t,e);return{protocol:n.alpnProtocol||v,socket:n}}return{protocol:a.alpnProtocol||v,socket:a}})(e.socketFactory,o,s,e.alpnProtocols):await(async(e,t,n)=>{const r=`${t.protocol}//${t.host}`;let o=e.alpnCache.get(r);if(o)return{protocol:o};switch(t.protocol){case"http:":return o=v,e.alpnCache.set(r,o),{protocol:o};case"http2:":return o=_,e.alpnCache.set(r,o),{protocol:o};case"https:":break;default:throw new TypeError(`unsupported protocol: ${t.protocol}`)}const{options:{rejectUnauthorized:i,h1:s={},h2:a={}}}=e,c=!(!1===i||!1===s.rejectUnauthorized||!1===a.rejectUnauthorized),l={servername:t.hostname,ALPNProtocols:e.alpnProtocols,signal:n,rejectUnauthorized:c},u=await(async(e,t)=>{let n=await T.acquire(e.origin);try{return n||(n=await k(e,t)),n}finally{T.release(e.origin,n)}})(t,l);return o=u.alpnProtocol,o||(o=v),e.alpnCache.set(r,o),{protocol:o,socket:u}})(e,o,d);switch(a(`${o.host} -> ${m}`),m){case g:try{return await u.request(e,o,b?{...s,socket:b}:s)}catch(t){const{code:n,message:r}=t;throw"ERR_HTTP2_ERROR"===n&&"Protocol error"===r&&e.alpnCache.delete(`${o.protocol}//${o.host}`),t}case _:return u.request(e,new URL(`http://${o.host}${o.pathname}${o.hash}${o.search}`),b?{...s,socket:b}:s);case y:case v:return l.request(e,o,b?{...s,socket:b}:s);default:throw new TypeError(`unsupported protocol: ${m}`)}},setupContext:e=>{const{options:{alpnProtocols:t=x,alpnCacheTTL:n=w,alpnCacheSize:r=b,userAgent:o=E,socketFactory:i}}=e;e.alpnProtocols=t,e.alpnCache=new s({max:r,ttl:n}),e.userAgent=o,e.socketFactory=i,l.setupContext(e),u.setupContext(e)},resetContext:async e=>(e.alpnCache.clear(),Promise.all([l.resetContext(e),u.resetContext(e)])),RequestAbortedError:c,ALPN_HTTP2:g,ALPN_HTTP2C:_,ALPN_HTTP1_1:v,ALPN_HTTP1_0:y}},6829:(e,t,n)=>{"use strict";const{EventEmitter:r}=n(2361),o=Symbol("AbortSignal internals");class i{constructor(){this[o]={eventEmitter:new r,onabort:null,aborted:!1}}get aborted(){return this[o].aborted}get onabort(){return this[o].onabort}set onabort(e){this[o].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,t){this[o].eventEmitter.removeListener(e,t)}addEventListener(e,t){this[o].eventEmitter.on(e,t)}dispatchEvent(e){const t={type:e,target:this},n=`on${e}`;"function"==typeof this[o][n]&&this[n](t),this[o].eventEmitter.emit(e,t)}fire(){this[o].aborted=!0,this.dispatchEvent("abort")}}Object.defineProperties(i.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});class s extends i{constructor(e){if(!Number.isInteger(e))throw new TypeError("Expected an integer, got "+typeof e);super(),this[o].timerId=setTimeout((()=>{this.fire()}),e)}clear(){clearTimeout(this[o].timerId)}}Object.defineProperties(s.prototype,{clear:{enumerable:!0}});const a=Symbol("AbortController internals");class c{constructor(){this[a]={signal:new i}}get signal(){return this[a].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[a].signal.aborted||this[a].signal.fire()}}Object.defineProperties(c.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),e.exports={AbortController:c,AbortSignal:i,TimeoutSignal:s}},5600:(e,t,n)=>{"use strict";const{PassThrough:r,Readable:o}=n(2781),{types:{isAnyArrayBuffer:i}}=n(3837),{FetchError:s,FetchBaseError:a}=n(3683),{streamToBuffer:c}=n(4544),l=Buffer.alloc(0),u=Symbol("Body internals"),d=async e=>{if(e[u].disturbed)throw new TypeError("Already read");if(e[u].error)throw new TypeError(`Stream had error: ${e[u].error.message}`);e[u].disturbed=!0;const{stream:t}=e[u];return null===t?l:c(t)};class p{constructor(e){let t;t=null==e?null:e instanceof URLSearchParams?o.from(e.toString()):e instanceof o?e:Buffer.isBuffer(e)?o.from(e):i(e)?o.from(Buffer.from(e)):"string"==typeof e||e instanceof String?o.from(e):o.from(String(e)),this[u]={stream:t,disturbed:!1,error:null},e instanceof o&&t.on("error",(e=>{const t=e instanceof a?e:new s(`Invalid response body while trying to fetch ${this.url}: ${e.message}`,"system",e);this[u].error=t}))}get body(){return this[u].stream}get bodyUsed(){return this[u].disturbed}async buffer(){return d(this)}async arrayBuffer(){return(e=await this.buffer()).buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);var e}async text(){return(await d(this)).toString()}async json(){return JSON.parse(await this.text())}}Object.defineProperties(p.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),e.exports={Body:p,cloneStream:e=>{if(e[u].disturbed)throw new TypeError("Cannot clone: already read");const{stream:t}=e[u];let n=t;if(t instanceof o){n=new r;const o=new r;t.pipe(n),t.pipe(o),e[u].stream=o}return n},guessContentType:e=>null===e?null:"string"==typeof e?"text/plain; charset=utf-8":e instanceof URLSearchParams?"application/x-www-form-urlencoded; charset=utf-8":Buffer.isBuffer(e)||i(e)||e instanceof o?null:"text/plain; charset=utf-8"}},2500:(e,t,n)=>{"use strict";const{Readable:r}=n(2781),{Headers:o}=n(9872),{Response:i}=n(2981),s=Symbol("CacheableResponse internals");class a extends i{constructor(e,t){super(e,t);const n=new o(t.headers);this[s]={headers:n,bufferedBody:e}}get headers(){return this[s].headers}set headers(e){if(!(e instanceof o))throw new TypeError("instance of Headers expected");this[s].headers=e}get body(){return r.from(this[s].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[s].bufferedBody}async arrayBuffer(){return(e=this[s].bufferedBody).buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);var e}async text(){return this[s].bufferedBody.toString()}async json(){return JSON.parse(await this.text())}clone(){const{url:e,status:t,statusText:n,headers:r,httpVersion:o,decoded:i,counter:c}=this;return new a(this[s].bufferedBody,{url:e,status:t,statusText:n,headers:r,httpVersion:o,decoded:i,counter:c})}get[Symbol.toStringTag](){return this.constructor.name}}e.exports={cacheableResponse:async e=>{const t=await e.buffer(),{url:n,status:r,statusText:o,headers:i,httpVersion:s,decoded:c,counter:l}=e;return new a(t,{url:n,status:r,statusText:o,headers:i,httpVersion:s,decoded:c,counter:l})}}},3683:e=>{"use strict";class t extends Error{constructor(e,t){super(e),this.type=t}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}e.exports={FetchBaseError:t,FetchError:class extends t{constructor(e,t,n){super(e,t),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}},AbortError:class extends t{constructor(e,t="aborted"){super(e,t)}}}},9872:(e,t,n)=>{"use strict";const{validateHeaderName:r,validateHeaderValue:o}=n(3685),{isPlainObject:i}=n(4544),s=Symbol("Headers internals"),a=e=>{const t="string"!=typeof e?String(e):e;if("function"==typeof r)r(t);else if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){const e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}return t.toLowerCase()},c=(e,t)=>{const n="string"!=typeof e?String(e):e;if("function"==typeof o)o(t,n);else if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(n)){const e=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_CHAR"}),e}return n};class l{constructor(e={}){if(this[s]={map:new Map},e instanceof l)e.forEach(((e,t)=>{this.append(t,e)}));else if(Array.isArray(e))e.forEach((([e,t])=>{this.append(e,t)}));else if(i(e))for(const[t,n]of Object.entries(e))this.append(t,n)}set(e,t){this[s].map.set(a(e),c(t,e))}has(e){return this[s].map.has(a(e))}get(e){const t=this[s].map.get(a(e));return void 0===t?null:t}append(e,t){const n=a(e),r=c(t,e),o=this[s].map.get(n);this[s].map.set(n,o?`${o}, ${r}`:r)}delete(e){this[s].map.delete(a(e))}forEach(e,t){for(const n of this.keys())e.call(t,this.get(n),n)}keys(){return Array.from(this[s].map.keys()).sort()}*values(){for(const e of this.keys())yield this.get(e)}*entries(){for(const e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return this.constructor.name}plain(){return Object.fromEntries(this[s].map)}}Object.defineProperties(l.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce(((e,t)=>(e[t]={enumerable:!0},e)),{})),e.exports={Headers:l}},6143:(e,t,n)=>{"use strict";const{EventEmitter:r}=n(2361),{Readable:o}=n(2781),i=n(8104)("helix-fetch"),s=n(8348),{Body:a}=n(5600),{Headers:c}=n(9872),{Request:l}=n(8359),{Response:u}=n(2981),{FetchBaseError:d,FetchError:p,AbortError:h}=n(3683),{AbortController:f,AbortSignal:m,TimeoutSignal:g}=n(6829),_=n(4193),{cacheableResponse:y}=n(2500),{sizeof:v}=n(4544),{isFormData:b}=n(9407),{context:w,RequestAbortedError:x}=n(3100),E=["GET","HEAD"],C="push",S=async(e,t,n)=>{const{request:r}=e.context,i=t instanceof l&&void 0===n?t:new l(t,n),{method:s,body:a,signal:d,compress:f,decode:m,follow:g,redirect:_,init:{body:y}}=i;let v;if(d&&d.aborted){const e=new h("The operation was aborted.");throw i.init.body instanceof o&&i.init.body.destroy(e),e}try{v=await r(i.url,{...n,method:s,headers:i.headers.plain(),body:!y||y instanceof o||b(y)?a:y,compress:f,decode:m,follow:g,redirect:_,signal:d})}catch(e){if(y instanceof o&&y.destroy(e),e instanceof TypeError)throw e;if(e instanceof x)throw new h("The operation was aborted.");throw new p(e.message,"system",e)}const w=()=>{d.removeEventListener("abort",w);const e=new h("The operation was aborted.");i.init.body instanceof o&&i.init.body.destroy(e),v.readable.emit("error",e)};d&&d.addEventListener("abort",w);const{statusCode:E,statusText:C,httpVersion:T,headers:k,readable:I,decoded:P}=v;if([301,302,303,307,308].includes(E)){const{location:t}=k,n=null==t?null:new URL(t,i.url);switch(i.redirect){case"manual":break;case"error":throw d&&d.removeEventListener("abort",w),new p(`uri requested responds with a redirect, redirect mode is set to 'error': ${i.url}`,"no-redirect");case"follow":{if(null===n)break;if(i.counter>=i.follow)throw d&&d.removeEventListener("abort",w),new p(`maximum redirect reached at: ${i.url}`,"max-redirect");const t={headers:new c(i.headers),follow:i.follow,compress:i.compress,decode:i.decode,counter:i.counter+1,method:i.method,body:i.body,signal:i.signal};if(303!==E&&i.body&&i.init.body instanceof o)throw d&&d.removeEventListener("abort",w),new p("Cannot follow redirect with body being a readable stream","unsupported-redirect");return 303!==E&&(301!==E&&302!==E||"POST"!==i.method)||(t.method="GET",t.body=void 0,t.headers.delete("content-length")),d&&d.removeEventListener("abort",w),S(e,new l(n,t))}}}return d&&(I.once("end",(()=>{d.removeEventListener("abort",w)})),I.once("error",(()=>{d.removeEventListener("abort",w)}))),new u(I,{url:i.url,status:E,statusText:C,headers:k,httpVersion:T,decoded:P,counter:i.counter})},T=async(e,t,n)=>{if(0===e.options.maxCacheSize)return n;if(!E.includes(t.method))return n;const r=new _(t,n,{shared:!1});if(r.storable()){const o=await y(n);return e.cache.set(t.url,{policy:r,response:o},r.timeToLive()),o}return n},k=(e,t={})=>{const n=new URL(e);if("object"!=typeof t||Array.isArray(t))throw new TypeError("qs: object expected");return Object.entries(t).forEach((([e,t])=>{Array.isArray(t)?t.forEach((t=>n.searchParams.append(e,t))):n.searchParams.append(e,t)})),n.href},I=e=>new g(e);class P{constructor(e){this.options={...e};const{maxCacheSize:t}=this.options;let n="number"==typeof t&&t>=0?t:104857600,o=500;0===n&&(n=1,o=1),this.cache=new s({max:o,maxSize:n,sizeCalculation:({response:e},t)=>v(e)}),this.eventEmitter=new r,this.options.h2=this.options.h2||{},void 0===this.options.h2.enablePush&&(this.options.h2.enablePush=!0);const{enablePush:i}=this.options.h2;i&&(this.options.h2.pushPromiseHandler=(e,t,n)=>{const r={...t};Object.keys(r).filter((e=>e.startsWith(":"))).forEach((e=>delete r[e])),this.pushPromiseHandler(e,r,n)},this.options.h2.pushHandler=(e,t,n)=>{const r={...t};Object.keys(r).filter((e=>e.startsWith(":"))).forEach((e=>delete r[e]));const{statusCode:o,statusText:i,httpVersion:s,headers:a,readable:c,decoded:l}=n;this.pushHandler(e,r,new u(c,{url:e,status:o,statusText:i,headers:a,httpVersion:s,decoded:l}))}),this.context=w(this.options)}api(){return{fetch:async(e,t)=>this.fetch(e,t),Body:a,Headers:c,Request:l,Response:u,AbortController:f,AbortSignal:m,FetchBaseError:d,FetchError:p,AbortError:h,context:(e={})=>new P(e).api(),noCache:(e={})=>new P({...e,maxCacheSize:0}).api(),h1:(e={})=>new P({...e,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),keepAlive:(e={})=>new P({...e,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),h1NoCache:(e={})=>new P({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),keepAliveNoCache:(e={})=>new P({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),reset:async()=>this.context.reset(),onPush:e=>this.onPush(e),offPush:e=>this.offPush(e),createUrl:k,timeoutSignal:I,clearCache:()=>this.clearCache(),cacheStats:()=>this.cacheStats(),ALPN_HTTP2:this.context.ALPN_HTTP2,ALPN_HTTP2C:this.context.ALPN_HTTP2C,ALPN_HTTP1_1:this.context.ALPN_HTTP1_1,ALPN_HTTP1_0:this.context.ALPN_HTTP1_0}}async fetch(e,t){return(async(e,t,n)=>{const r=new l(t,n);if(0!==e.options.maxCacheSize&&E.includes(r.method)&&!["no-store","reload"].includes(r.cache)){const{policy:t,response:n}=e.cache.get(r.url)||{};if(t&&t.satisfiesWithoutRevalidation(r)){n.headers=new c(t.responseHeaders(n));const e=n.clone();return e.fromCache=!0,e}}const o=await S(e,r);return"no-store"!==r.cache?T(e,r,o):o})(this,e,t)}onPush(e){return this.eventEmitter.on(C,e)}offPush(e){return this.eventEmitter.off(C,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,t,n){i(`received server push promise: ${e}, headers: ${JSON.stringify(t)}`);const r=new l(e,{headers:t}),{policy:o}=this.cache.get(e)||{};o&&o.satisfiesWithoutRevalidation(r)&&(i(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(t)}`),n())}async pushHandler(e,t,n){i(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(t)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);const r=await T(this,new l(e,{headers:t}),n);this.eventEmitter.emit(C,e,r)}}e.exports=(new P).api()},4193:(e,t,n)=>{"use strict";const r=n(6214),{Headers:o}=n(9872),i=e=>({url:e.url,method:e.method,headers:e.headers.plain()}),s=e=>({status:e.status,headers:e.headers.plain()});e.exports=class{constructor(e,t,n){this.policy=new r(i(e),s(t),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(i(e))}responseHeaders(e){return new o(this.policy.responseHeaders(s(e)))}timeToLive(){return this.policy.timeToLive()}}},8359:(e,t,n)=>{"use strict";const{AbortSignal:r}=n(6829),{Body:o,cloneStream:i,guessContentType:s}=n(5600),{Headers:a}=n(9872),{isPlainObject:c}=n(4544),{isFormData:l,FormDataSerializer:u}=n(9407),d=Symbol("Request internals");class p extends o{constructor(e,t={}){const n=e instanceof p?e:null,o=n?new URL(n.url):new URL(e);let h=t.method||n&&n.method||"GET";if(h=h.toUpperCase(),(null!=t.body||n&&null!==n.body)&&["GET","HEAD"].includes(h))throw new TypeError("Request with GET/HEAD method cannot have body");let f=t.body||(n&&n.body?i(n):null);const m=new a(t.headers||n&&n.headers||{});if(l(f)&&!m.has("content-type")){const e=new u(f);f=e.stream(),m.set("content-type",e.contentType()),m.has("transfer-encoding")||m.has("content-length")||m.set("content-length",e.length())}if(!m.has("content-type"))if(c(f))f=JSON.stringify(f),m.set("content-type","application/json");else{const e=s(f);e&&m.set("content-type",e)}super(f);let g=n?n.signal:null;if("signal"in t&&(g=t.signal),g&&!(g instanceof r))throw new TypeError("signal needs to be an instance of AbortSignal");const _=t.redirect||n&&n.redirect||"follow";if(!["follow","error","manual"].includes(_))throw new TypeError(`'${_}' is not a valid redirect option`);const y=t.cache||n&&n.cache||"default";if(!["default","no-store","reload","no-cache","force-cache","only-if-cached"].includes(y))throw new TypeError(`'${y}' is not a valid cache option`);this[d]={init:{...t},method:h,redirect:_,cache:y,headers:m,parsedURL:o,signal:g},void 0===t.follow?n&&void 0!==n.follow?this.follow=n.follow:this.follow=20:this.follow=t.follow,this.counter=t.counter||n&&n.counter||0,void 0===t.compress?n&&void 0!==n.compress?this.compress=n.compress:this.compress=!0:this.compress=t.compress,void 0===t.decode?n&&void 0!==n.decode?this.decode=n.decode:this.decode=!0:this.decode=t.decode}get method(){return this[d].method}get url(){return this[d].parsedURL.toString()}get headers(){return this[d].headers}get redirect(){return this[d].redirect}get cache(){return this[d].cache}get signal(){return this[d].signal}clone(){return new p(this)}get init(){return this[d].init}get[Symbol.toStringTag](){return this.constructor.name}}Object.defineProperties(p.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),e.exports={Request:p}},2981:(e,t,n)=>{"use strict";const{Body:r,cloneStream:o,guessContentType:i}=n(5600),{Headers:s}=n(9872),{isPlainObject:a}=n(4544),{isFormData:c,FormDataSerializer:l}=n(9407),u=Symbol("Response internals");class d extends r{constructor(e=null,t={}){const n=new s(t.headers);let r=e;if(c(r)&&!n.has("content-type")){const e=new l(r);r=e.stream(),n.set("content-type",e.contentType()),n.has("transfer-encoding")||n.has("content-length")||n.set("content-length",e.length())}if(null!==r&&!n.has("content-type"))if(a(r))r=JSON.stringify(r),n.set("content-type","application/json");else{const e=i(r);e&&n.set("content-type",e)}super(r),this[u]={url:t.url,status:t.status||200,statusText:t.statusText||"",headers:n,httpVersion:t.httpVersion,decoded:t.decoded,counter:t.counter}}get url(){return this[u].url||""}get status(){return this[u].status}get statusText(){return this[u].statusText}get ok(){return this[u].status>=200&&this[u].status<300}get redirected(){return this[u].counter>0}get headers(){return this[u].headers}get httpVersion(){return this[u].httpVersion}get decoded(){return this[u].decoded}static redirect(e,t=302){if(![301,302,303,307,308].includes(t))throw new RangeError("Invalid status code");return new d(null,{headers:{location:new URL(e).toString()},status:t})}clone(){if(this.bodyUsed)throw new TypeError("Cannot clone: already read");return new d(o(this),{...this[u]})}get[Symbol.toStringTag](){return this.constructor.name}}Object.defineProperties(d.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),e.exports={Response:d}},9825:(e,t,n)=>{"use strict";e.exports=n(6143)},1581:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=n(7159),o=n(3924),i=n(1240),s=n(98),a=["/properties"],c="http://json-schema.org/draft-07/schema";class l extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=n(4815);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=n(3487);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}})},7023:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class o extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const n=[e[0]];let r=0;for(;r<t.length;)c(n,t[r]),n.push(e[++r]);return new o(n)}t._Code=o,t.nil=new o(""),t._=i;const s=new o("+");function a(e,...t){const n=[u(e[0])];let r=0;for(;r<t.length;)n.push(s),c(n,t[r]),n.push(s,u(e[++r]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===s){const n=l(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new o(n)}function c(e,t){var n;t instanceof o?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:u(Array.isArray(n)?n.join(","):n))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new o(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):i`[${e}]`},t.regexpCode=function(e){return new o(e.toString())}},3487:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const r=n(7023),o=n(8490);var i=n(7023);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var s=n(8490);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?o.varKinds.var:this.varKind,r=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=O(this.rhs,e,t)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class l extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof r.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=O(this.rhs,e,t),this}get names(){return A(this.lhs instanceof r.Name?{}:{...this.lhs.names},this.rhs)}}class u extends l{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class p extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class h extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=O(this.code,e,t),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const o=n[r];o.optimizeNames(e,t)||(N(e,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>P(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class _ extends m{}class y extends g{}y.kind="else";class v extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof v?t:t.nodes:this.nodes.length?this:new v(R(e),t instanceof v?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=O(this.condition,e,t),this}get names(){const e=super.names;return A(e,this.condition),this.else&&P(e,this.else.names),e}}v.kind="if";class b extends g{}b.kind="for";class w extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=O(this.iteration,e,t),this}get names(){return P(super.names,this.iteration.names)}}class x extends b{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:n,from:r,to:i}=this;return`for(${t} ${n}=${r}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){const e=A(super.names,this.from);return A(e,this.to)}}class E extends b{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=O(this.iterable,e,t),this}get names(){return P(super.names,this.iterable.names)}}class C extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}C.kind="func";class S extends m{render(e){return"return "+super.render(e)}}S.kind="return";class T extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&P(e,this.catch.names),this.finally&&P(e,this.finally.names),e}}class k extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}k.kind="catch";class I extends g{render(e){return"finally"+super.render(e)}}function P(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function A(e,t){return t instanceof r._CodeOrName?P(e,t.names):e}function O(e,t,n){return e instanceof r.Name?i(e):(o=e)instanceof r._Code&&o._items.some((e=>e instanceof r.Name&&1===t[e.str]&&void 0!==n[e.str]))?new r._Code(e._items.reduce(((e,t)=>(t instanceof r.Name&&(t=i(t)),t instanceof r._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function i(e){const r=n[e.str];return void 0===r||1!==t[e.str]?e:(delete t[e.str],r)}}function N(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:r._`!${D(e)}`}I.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new _]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const o=this._scope.toName(t);return void 0!==n&&r&&(this._constants[o.str]=n),this._leafNode(new c(e,o,n)),o}const(e,t,n){return this._def(o.varKinds.const,e,t,n)}let(e,t,n){return this._def(o.varKinds.let,e,t,n)}var(e,t,n){return this._def(o.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new l(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==r.nil&&this._leafNode(new f(e)),this}object(...e){const t=["{"];for(const[n,o]of e)t.length>1&&t.push(","),t.push(n),(n!==o||this.opts.es5)&&(t.push(":"),(0,r.addCodeArg)(t,o));return t.push("}"),new r._Code(t)}if(e,t,n){if(this._blockNode(new v(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new v(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(v,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,n,r,i=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const s=this._scope.toName(e);return this._for(new x(i,s,t,n),(()=>r(s)))}forOf(e,t,n,i=o.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof r.Name?t:this.var("_arr",t);return this.forRange("_i",0,r._`${e}.length`,(t=>{this.var(s,r._`${e}[${t}]`),n(s)}))}return this._for(new E("of",i,s,t),(()=>n(s)))}forIn(e,t,n,i=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,r._`Object.keys(${t})`,n);const s=this._scope.toName(e);return this._for(new E("in",i,s,t),(()=>n(s)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new p(e))}return(e){const t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new T;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new k(e),t(e)}return n&&(this._currNode=r.finally=new I,this.code(n)),this._endBlockNode(k,I)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=r.nil,n,o){return this._blockNode(new C(e,t,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(C)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof v))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=R;const M=$(t.operators.AND);t.and=function(...e){return e.reduce(M)};const L=$(t.operators.OR);function $(e){return(t,n)=>t===r.nil?n:n===r.nil?t:r._`${D(t)} ${e} ${D(n)}`}function D(e){return e instanceof r.Name?e:r._`(${e})`}t.or=function(...e){return e.reduce(L)}},8490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const r=n(7023);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var i;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(i=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof r.Name?e:this.name(e)}name(e){return new r.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends r.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=r._`.${new r.Name(t)}[${n}]`}}t.ValueScopeName=a;const c=r._`\n`;t.ValueScope=class extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:r.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:o}=r,i=null!==(n=t.key)&&void 0!==n?n:t.ref;let s=this._values[o];if(s){const e=s.get(i);if(e)return e}else s=this._values[o]=new Map;s.set(i,r);const a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:o,itemIndex:c}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return r._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,s={},a){let c=r.nil;for(const l in e){const u=e[l];if(!u)continue;const d=s[l]=s[l]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,i.Started);let s=n(e);if(s){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;c=r._`${c}${n} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new o(e);c=r._`${c}${s}${this.opts._n}`}d.set(e,i.Completed)}))}return c}}},4181:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const r=n(3487),o=n(6776),i=n(2141);function s(e,t){const n=e.const("err",t);e.if(r._`${i.default.vErrors} === null`,(()=>e.assign(i.default.vErrors,r._`[${n}]`)),r._`${i.default.vErrors}.push(${n})`),e.code(r._`${i.default.errors}++`)}function a(e,t){const{gen:n,validateName:o,schemaEnv:i}=e;i.$async?n.throw(r._`new ${e.ValidationError}(${t})`):(n.assign(r._`${o}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>r.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?r.str`"${e}" keyword must be ${t} ($data)`:r.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,o,i){const{it:c}=e,{gen:u,compositeRule:d,allErrors:p}=c,h=l(e,n,o);(null!=i?i:d||p)?s(u,h):a(c,r._`[${h}]`)},t.reportExtraError=function(e,n=t.keywordError,r){const{it:o}=e,{gen:c,compositeRule:u,allErrors:d}=o;s(c,l(e,n,r)),u||d||a(o,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(r._`${i.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(r._`${i.default.vErrors}.length`,t)),(()=>e.assign(i.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:o,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,i.default.errors,(s=>{e.const(c,r._`${i.default.vErrors}[${s}]`),e.if(r._`${c}.instancePath === undefined`,(()=>e.assign(r._`${c}.instancePath`,(0,r.strConcat)(i.default.instancePath,a.errorPath)))),e.assign(r._`${c}.schemaPath`,r.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(r._`${c}.schema`,n),e.assign(r._`${c}.data`,o))}))};const c={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function l(e,t,n){const{createErrors:o}=e.it;return!1===o?r._`{}`:function(e,t,n={}){const{gen:o,it:s}=e,a=[u(s,n),d(e,n)];return function(e,{params:t,message:n},o){const{keyword:s,data:a,schemaValue:l,it:u}=e,{opts:d,propertyName:p,topSchemaRef:h,schemaPath:f}=u;o.push([c.keyword,s],[c.params,"function"==typeof t?t(e):t||r._`{}`]),d.messages&&o.push([c.message,"function"==typeof n?n(e):n]),d.verbose&&o.push([c.schema,l],[c.parentSchema,r._`${h}${f}`],[i.default.data,a]),p&&o.push([c.propertyName,p])}(e,t,a),o.object(...a)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?r.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[i.default.instancePath,(0,r.strConcat)(i.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:i}){let s=i?t:r.str`${t}/${e}`;return n&&(s=r.str`${s}${(0,o.getErrorPath)(n,o.Type.Str)}`),[c.schemaPath,s]}},5173:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const r=n(3487),o=n(7426),i=n(2141),s=n(2531),a=n(6776),c=n(4815),l=n(540);class u{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function d(e){const t=h.call(this,e);if(t)return t;const n=(0,s.getFullPath)(e.root.baseId),{es5:a,lines:l}=this.opts.code,{ownProperties:u}=this.opts,d=new r.CodeGen(this.scope,{es5:a,lines:l,ownProperties:u});let p;e.$async&&(p=d.scopeValue("Error",{ref:o.default,code:r._`require("ajv/dist/runtime/validation_error").default`}));const f=d.scopeName("validate");e.validateName=f;const m={gen:d,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,r.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:r.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:r._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,c.validateFunctionCode)(m),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${i.default.self}`,`${i.default.scope}`,g)(this,this.scope.get());if(this.scope.value(f,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:f,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=m;n.evaluated={props:e instanceof r.Name?void 0:e,items:t instanceof r.Name?void 0:t,dynamicProps:e instanceof r.Name,dynamicItems:t instanceof r.Name},n.source&&(n.source.evaluated=(0,r.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function p(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:d.call(this,e)}function h(e){for(const r of this._compilations)if(n=e,(t=r).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return r;var t,n}function f(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){const n=l.parse(t),r=(0,s._getFullPath)(n);let o=(0,s.getFullPath)(e.baseId);if(Object.keys(e.schema).length>0&&r===o)return _.call(this,n,e);const i=(0,s.normalizeId)(r),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return _.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||d.call(this,a),i===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,r=t[n];return r&&(o=(0,s.resolveUrl)(o,r)),new u({schema:t,schemaId:n,root:e,baseId:o})}return _.call(this,n,a)}}t.SchemaEnv=u,t.compileSchema=d,t.resolveRef=function(e,t,n){var r;n=(0,s.resolveUrl)(t,n);const o=e.refs[n];if(o)return o;let i=f.call(this,e,n);if(void 0===i){const o=null===(r=e.localRefs)||void 0===r?void 0:r[n],{schemaId:s}=this.opts;o&&(i=new u({schema:o,schemaId:s,root:e,baseId:t}))}return void 0!==i?e.refs[n]=p.call(this,i):void 0},t.getCompilingSchema=h,t.resolveSchema=m;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _(e,{baseId:t,schema:n,root:r}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const r of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(r)];if(void 0===e)return;const o="object"==typeof(n=e)&&n[this.opts.schemaId];!g.has(r)&&o&&(t=(0,s.resolveUrl)(t,o))}let i;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,s.resolveUrl)(t,n.$ref);i=m.call(this,r,e)}const{schemaId:c}=this.opts;return i=i||new u({schema:n,schemaId:c,root:r,baseId:t}),i.schema!==i.root.schema?i:void 0}},2141:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")};t.default=o},6646:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2531);class o extends Error{constructor(e,t,n){super(n||`can't resolve reference ${t} from id ${e}`),this.missingRef=(0,r.resolveUrl)(e,t),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(this.missingRef))}}t.default=o},2531:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const r=n(6776),o=n(4063),i=n(9461),s=n(540),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&u(e)<=t)};const c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(c.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(l))return!0;if("object"==typeof n&&l(n))return!0}return!1}function u(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!a.has(n)&&("object"==typeof e[n]&&(0,r.eachItem)(e[n],(e=>t+=u(e))),t===1/0))return 1/0}return t}function d(e="",t){return!1!==t&&(e=f(e)),p(s.parse(e))}function p(e){return s.serialize(e).split("#")[0]+"#"}t.getFullPath=d,t._getFullPath=p;const h=/#\/?$/;function f(e){return e?e.replace(h,""):""}t.normalizeId=f,t.resolveUrl=function(e,t){return t=f(t),s.resolve(e,t)};const m=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n}=this.opts,r=f(e[n]||t),a={"":r},c=d(r,!1),l={},u=new Set;return i(e,{allKeys:!0},((e,t,r,o)=>{if(void 0===o)return;const i=c+t;let d=a[o];function g(t){if(t=f(d?s.resolve(d,t):t),u.has(t))throw h(t);u.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?p(e,n.schema,t):t!==f(i)&&("#"===t[0]?(p(e,l[t],t),l[t]=e):this.refs[t]=i),t}function _(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);g.call(this,`#${e}`)}}"string"==typeof e[n]&&(d=g.call(this,e[n])),_.call(this,e.$anchor),_.call(this,e.$dynamicAnchor),a[t]=d})),l;function p(e,t,n){if(void 0!==t&&!o(e,t))throw h(n)}function h(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},3141:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},6776:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const r=n(3487),o=n(7023);function i(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=r.RULES.keywords;for(const n in t)o[n]||f(e,`unknown keyword: "${n}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(i,s,a,c)=>{const l=void 0===a?s:a instanceof r.Name?(s instanceof r.Name?e(i,s,a):t(i,s,a),a):s instanceof r.Name?(t(i,a,s),s):n(s,a);return c!==r.Name||l instanceof r.Name?l:o(i,l)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",r._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(r._`${t}${(0,r.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,o,i){if(!i){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return r._`${n}`}return r._`${e}${t}${(0,r.getProperty)(o)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>{e.if(r._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,r._`${n} || {}`).code(r._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,r._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,r._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>e.assign(n,!0===t||r._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const p={};var h;function f(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:p[t.code]||(p[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(h=t.Type||(t.Type={})),t.getErrorPath=function(e,t,n){if(e instanceof r.Name){const o=t===h.Num;return n?o?r._`"[" + ${e} + "]"`:r._`"['" + ${e} + "']"`:o?r._`"/" + ${e}`:r._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,r.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=f},8876:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>r(e,t)))}function r(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},r){const o=t.RULES.types[r];return o&&!0!==o&&n(e,o)},t.shouldUseGroup=n,t.shouldUseRule=r},5667:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const r=n(4181),o=n(3487),i=n(2141),s={message:"boolean schema is false"};function a(e,t){const{gen:n,data:o}=e,i={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,r.reportError)(i,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:r}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(i.default.data):(t.assign(o._`${r}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),a(e)):n.var(t,!0)}},453:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const r=n(3141),o=n(8876),i=n(4181),s=n(3487),a=n(6776);var c;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(r.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:r,opts:i}=e,a=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,i.coerceTypes),l=t.length>0&&!(0===a.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(l){const o=p(t,r,i.strictNumbers,c.Wrong);n.if(o,(()=>{a.length?function(e,t,n){const{gen:r,data:o,opts:i}=e,a=r.let("dataType",s._`typeof ${o}`),c=r.let("coerced",s._`undefined`);"array"===i.coerceTypes&&r.if(s._`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>r.assign(o,s._`${o}[0]`).assign(a,s._`typeof ${o}`).if(p(t,o,i.strictNumbers),(()=>r.assign(c,o))))),r.if(s._`${c} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===i.coerceTypes)&&l(e);function l(e){switch(e){case"string":return void r.elseIf(s._`${a} == "number" || ${a} == "boolean"`).assign(c,s._`"" + ${o}`).elseIf(s._`${o} === null`).assign(c,s._`""`);case"number":return void r.elseIf(s._`${a} == "boolean" || ${o} === null
|| (${a} == "string" && ${o} && ${o} == +${o})`).assign(c,s._`+${o}`);case"integer":return void r.elseIf(s._`${a} === "boolean" || ${o} === null
|| (${a} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(c,s._`+${o}`);case"boolean":return void r.elseIf(s._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(c,!1).elseIf(s._`${o} === "true" || ${o} === 1`).assign(c,!0);case"null":return r.elseIf(s._`${o} === "" || ${o} === 0 || ${o} === false`),void r.assign(c,null);case"array":r.elseIf(s._`${a} === "string" || ${a} === "number"
|| ${a} === "boolean" || ${o} === null`).assign(c,s._`[${o}]`)}}r.else(),f(e),r.endIf(),r.if(s._`${c} !== undefined`,(()=>{r.assign(o,c),function({gen:e,parentData:t,parentDataProperty:n},r){e.if(s._`${t} !== undefined`,(()=>e.assign(s._`${t}[${n}]`,r)))}(e,c)}))}(e,t,a):f(e)}))}return l};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,r=c.Correct){const o=r===c.Correct?s.operators.EQ:s.operators.NEQ;let i;switch(e){case"null":return s._`${t} ${o} null`;case"array":i=s._`Array.isArray(${t})`;break;case"object":i=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return s._`typeof ${t} ${o} ${e}`}return r===c.Correct?i:(0,s.not)(i);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,n?s._`isFinite(${t})`:s.nil)}}function p(e,t,n,r){if(1===e.length)return d(e[0],t,n,r);let o;const i=(0,a.toHash)(e);if(i.array&&i.object){const e=s._`typeof ${t} != "object"`;o=i.null?e:s._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else o=s.nil;i.number&&delete i.integer;for(const e in i)o=(0,s.and)(o,d(e,t,n,r));return o}t.checkDataType=d,t.checkDataTypes=p;const h={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function f(e){const t=function(e){const{gen:t,data:n,schema:r}=e,o=(0,a.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}(e);(0,i.reportError)(t,h)}t.reportTypeError=f},313:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(3487),o=n(6776);function i(e,t,n){const{gen:i,compositeRule:s,data:a,opts:c}=e;if(void 0===n)return;const l=r._`${a}${(0,r.getProperty)(t)}`;if(s)return void(0,o.checkStrictMode)(e,`default is ignored for: ${l}`);let u=r._`${l} === undefined`;"empty"===c.useDefaults&&(u=r._`${u} || ${l} === null || ${l} === ""`),i.if(u,r._`${l} = ${(0,r.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const t in n)i(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>i(e,n,t.default)))}},4815:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=n(5667),o=n(453),i=n(8876),s=n(453),a=n(313),c=n(5005),l=n(3099),u=n(3487),d=n(2141),p=n(2531),h=n(6776),f=n(4181);function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:o},i){o.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,r.$async,(()=>{e.code(u._`"use strict"; ${g(n,o)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,u._`""`),e.var(d.default.parentData,u._`undefined`),e.var(d.default.parentDataProperty,u._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`{}`)}))}(e,o),e.code(i)})):e.func(t,u._`${d.default.data}, ${function(e){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}(o)}`,r.$async,(()=>e.code(g(n,o)).code(i)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?u._`/*# sourceURL=${n} */`:u.nil}function _({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function v(e){(0,h.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:r,self:o}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function b(e,t){if(e.opts.jtd)return x(e,[],!1,t);const n=(0,o.getSchemaTypes)(e.schema);x(e,n,!(0,o.coerceAndCheckDataType)(e,n),t)}function w({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){const i=n.$comment;if(!0===o.$comment)e.code(u._`${d.default.self}.logger.log(${i})`);else if("function"==typeof o.$comment){const n=u.str`${r}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(u._`${d.default.self}.opts.$comment(${i}, ${n}, ${o}.schema)`)}}function x(e,t,n,r){const{gen:o,schema:a,data:c,allErrors:l,opts:p,self:f}=e,{RULES:m}=f;function g(h){(0,i.shouldUseGroup)(a,h)&&(h.type?(o.if((0,s.checkDataType)(h.type,c,p.strictNumbers)),E(e,h),1===t.length&&t[0]===h.type&&n&&(o.else(),(0,s.reportTypeError)(e)),o.endIf()):E(e,h),l||o.if(u._`${d.default.errors} === ${r||0}`))}!a.$ref||!p.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(a,m)?(p.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{C(e.dataTypes,t)||S(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),e.dataTypes=e.dataTypes.filter((e=>C(t,e)))):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&S(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const n=e.self.RULES.all;for(const r in n){const o=n[r];if("object"==typeof o&&(0,i.shouldUseRule)(e.schema,o)){const{type:n}=o.definition;n.length&&!n.some((e=>{return r=e,(n=t).includes(r)||"number"===r&&n.includes("integer");var n,r}))&&S(e,`missing type "${n.join(",")}" for keyword "${r}"`)}}}(e,e.dataTypes))}(e,t),o.block((()=>{for(const e of m.rules)g(e);g(m.post)}))):o.block((()=>k(e,"$ref",m.all.$ref.definition)))}function E(e,t){const{gen:n,schema:r,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,i.shouldUseRule)(r,n)&&k(e,n.keyword,n.definition,t.type)}))}function C(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function S(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,h.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){y(e)&&(v(e),_(e))?function(e){const{schema:t,opts:n,gen:r}=e;m(e,(()=>{n.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,h.checkStrictMode)(e,"default is ignored in the schema root")}(e),r.let(d.default.vErrors,null),r.let(d.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",u._`${n}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,(()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`))),t.if(u._`${e.evaluated}.dynamicItems`,(()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`)))}(e),b(e),function(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:o,opts:i}=e;n.$async?t.if(u._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(u._`new ${o}(${d.default.vErrors})`))):(t.assign(u._`${r}.errors`,d.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:n,items:r}){n instanceof u.Name&&e.assign(u._`${t}.props`,n),r instanceof u.Name&&e.assign(u._`${t}.items`,r)}(e),t.return(u._`${d.default.errors} === 0`))}(e)}))}(e):m(e,(()=>(0,r.topBoolOrEmptySchema)(e)))};class T{constructor(e,t,n){if((0,c.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",A(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,n){this.failResult((0,u.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=u.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:n,schemaCode:r,schemaType:o,def:i}=this;n.if((0,u.or)(u._`${r} === undefined`,t)),e!==u.nil&&n.assign(e,!0),(o.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:r,it:o}=this;return(0,u.or)(function(){if(n.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return u._`${(0,s.checkDataTypes)(e,t,o.opts.strictNumbers,s.DataType.Wrong)}`}return u.nil}(),function(){if(r.validateSchema){const n=e.scopeValue("validate$data",{ref:r.validateSchema});return u._`!${n}(${t})`}return u.nil}())}subschema(e,t){const n=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(n,this.it,e),(0,l.extendSubschemaMode)(n,e);const o={...this.it,...n,items:void 0,props:void 0};return function(e,t){y(e)&&(v(e),_(e))?function(e,t){const{schema:n,gen:r,opts:o}=e;o.$comment&&n.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,p.resolveUrl)(e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const i=r.const("_errs",d.default.errors);b(e,i),r.var(t,u._`${i} === ${d.default.errors}`)}(e,t):(0,r.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){const{it:n,gen:r}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=h.mergeEvaluated.props(r,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=h.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:r}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return r.if(t,(()=>this.mergeEvaluated(e,u.Name))),!0}}function k(e,t,n,r){const o=new T(e,n,t);"code"in n?n.code(o,r):o.$data&&n.validate?(0,c.funcKeywordCode)(o,n):"macro"in n?(0,c.macroKeywordCode)(o,n):(n.compile||n.validate)&&(0,c.funcKeywordCode)(o,n)}t.KeywordCxt=T;const I=/^\/(?:[^~]|~0|~1)*$/,P=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function A(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,i;if(""===e)return d.default.rootData;if("/"===e[0]){if(!I.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=d.default.rootData}else{const s=P.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(o=s[2],"#"===o){if(a>=t)throw new Error(c("property/index",a));return r[t-a]}if(a>t)throw new Error(c("data",a));if(i=n[t-a],!o)return i}let s=i;const a=o.split("/");for(const e of a)e&&(i=u._`${i}${(0,u.getProperty)((0,h.unescapeJsonPointer)(e))}`,s=u._`${s} && ${i}`);return s;function c(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=A},5005:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const r=n(3487),o=n(2141),i=n(412),s=n(4181);function a(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,(()=>t.assign(n,r._`${o.parentData}[${o.parentDataProperty}]`)))}function c(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,r.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:o,schema:i,parentSchema:s,it:a}=e,l=t.macro.call(a.self,i,s,a),u=c(n,o,l);!1!==a.opts.validateSchema&&a.self.validateSchema(l,!0);const d=n.name("valid");e.subschema({schema:l,schemaPath:r.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:l,keyword:u,schema:d,parentSchema:p,$data:h,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(f,t);const m=!h&&t.compile?t.compile.call(f.self,d,p,f):t.validate,g=c(l,u,m),_=l.let("valid");function y(n=(t.async?r._`await `:r.nil)){const s=f.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!h||!1===t.schema);l.assign(_,r._`${n}${(0,i.callValidateCode)(e,g,s,a)}`,t.modifying)}function v(e){var n;l.if((0,r.not)(null!==(n=t.valid)&&void 0!==n?n:_),e)}e.block$data(_,(function(){if(!1===t.errors)y(),t.modifying&&a(e),v((()=>e.error()));else{const n=t.async?function(){const e=l.let("ruleErrs",null);return l.try((()=>y(r._`await `)),(t=>l.assign(_,!1).if(r._`${t} instanceof ${f.ValidationError}`,(()=>l.assign(e,r._`${t}.errors`)),(()=>l.throw(t))))),e}():function(){const e=r._`${g}.errors`;return l.assign(e,null),y(r.nil),e}();t.modifying&&a(e),v((()=>function(e,t){const{gen:n}=e;n.if(r._`Array.isArray(${t})`,(()=>{n.assign(o.default.vErrors,r._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,r._`${o.default.vErrors}.length`),(0,s.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:_)},t.validSchemaType=function(e,t,n=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:r},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(null==s?void 0:s.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${r}": `+n.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}},3099:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const r=n(3487),o=n(6776);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:i,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const i=e.schema[t];return void 0===n?{schema:i,schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[n],schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}${(0,r.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(n)}`}}if(void 0!==i){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:i,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(void 0!==n){const{errorPath:s,dataPathArr:a,opts:c}=t;u(l.let("data",r._`${t.data}${(0,r.getProperty)(n)}`,!0)),e.errorPath=r.str`${s}${(0,o.getErrorPath)(n,i,c.jsPropertySyntax)}`,e.parentDataProperty=r._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}function u(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}void 0!==s&&(u(s instanceof r.Name?s:l.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:o,allErrors:i}){void 0!==r&&(e.compositeRule=r),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=n}},7159:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var r=n(4815);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var o=n(3487);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const i=n(7426),s=n(6646),a=n(3141),c=n(5173),l=n(3487),u=n(2531),d=n(453),p=n(6776),h=n(4775),f=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function y(e){var t,n,r,o,i,s,a,c,l,u,d,p,h,f,m,g,_,y,v,b,w,x;const E=e.strict,C=null===(t=e.code)||void 0===t?void 0:t.optimize,S=!0===C||void 0===C?1:C||0;return{strictSchema:null===(r=null!==(n=e.strictSchema)&&void 0!==n?n:E)||void 0===r||r,strictNumbers:null===(i=null!==(o=e.strictNumbers)&&void 0!==o?o:E)||void 0===i||i,strictTypes:null!==(a=null!==(s=e.strictTypes)&&void 0!==s?s:E)&&void 0!==a?a:"log",strictTuples:null!==(l=null!==(c=e.strictTuples)&&void 0!==c?c:E)&&void 0!==l?l:"log",strictRequired:null!==(d=null!==(u=e.strictRequired)&&void 0!==u?u:E)&&void 0!==d&&d,code:e.code?{...e.code,optimize:S}:{optimize:S},loopRequired:null!==(p=e.loopRequired)&&void 0!==p?p:200,loopEnum:null!==(h=e.loopEnum)&&void 0!==h?h:200,meta:null===(f=e.meta)||void 0===f||f,messages:null===(m=e.messages)||void 0===m||m,inlineRefs:null===(g=e.inlineRefs)||void 0===g||g,schemaId:null!==(_=e.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(y=e.addUsedSchema)||void 0===y||y,validateSchema:null===(v=e.validateSchema)||void 0===v||v,validateFormats:null===(b=e.validateFormats)||void 0===b||b,unicodeRegExp:null===(w=e.unicodeRegExp)||void 0===w||w,int32range:null===(x=e.int32range)||void 0===x||x}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...y(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:m,es5:t,lines:n}),this.logger=function(e){if(!1===e)return T;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,g,e,"NOT SUPPORTED"),b.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=S.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&C.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),x.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let r=h;"id"===n&&(r={...h},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const r=n(t);return"$async"in n||(this.errors=n.errors),r}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await o.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||i.call(this,n)}async function o(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const n=await l.call(this,e);this.refs[e]||await o.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,r);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(n,e);if(!r&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return r}getSchema(e){let t;for(;"string"==typeof(t=w.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,r=new c.SchemaEnv({schema:{},schemaId:n});if(t=c.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=w.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,u.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(I.call(this,n,t),!t)return(0,p.eachItem)(n,(e=>P.call(this,e))),this;O.call(this,t);const r={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,p.eachItem)(n,0===r.type.length?e=>P.call(this,e,r):e=>r.type.forEach((t=>P.call(this,e,r,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const r of t){const t=r.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:r}=t.definition,i=o[e];r&&i&&(o[e]=R(i))}}return e}_removeAllSchemas(e,t){for(const n in e){const r=e[n];t&&!t.test(n)||("string"==typeof r?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let i;const{schemaId:s}=this.opts;if("object"==typeof e)i=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;n=(0,u.normalizeId)(i||n);const l=u.getSchemaRefs.call(this,e,n);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:l}),this._cache.set(a.schema,a),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),r&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function b(e,t,n,r="error"){for(const o in e){const i=o;i in t&&this.logger[r](`${n}: option ${o}. ${e[i]}`)}}function w(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function x(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function E(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function C(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function S(){const e={...this.opts};for(const t of f)delete e[t];return e}t.default=v,v.ValidationError=i.default,v.MissingRefError=s.default;const T={log(){},warn(){},error(){}},k=/^[a-z_$][a-z0-9_$:-]*$/i;function I(e,t){const{RULES:n}=this;if((0,p.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function P(e,t,n){var r;const o=null==t?void 0:t.post;if(n&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find((({type:e})=>e===n));if(s||(s={type:n,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?A.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,null===(r=t.implements)||void 0===r||r.forEach((e=>this.addKeyword(e)))}function A(e,t,n){const r=e.rules.findIndex((e=>e.keyword===n));r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function O(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=R(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function R(e){return{anyOf:[e,N]}}},3510:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4063);r.code='require("ajv/dist/runtime/equal").default',t.default=r},4499:(e,t)=>{"use strict";function n(e){const t=e.length;let n,r=0,o=0;for(;o<t;)r++,n=e.charCodeAt(o++),n>=55296&&n<=56319&&o<t&&(n=e.charCodeAt(o),56320==(64512&n)&&o++);return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.code='require("ajv/dist/runtime/ucs2length").default'},7426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},4783:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const r=n(3487),o=n(6776),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:r}=t;Array.isArray(r)?s(e,r):(0,o.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:n,schema:i,data:s,keyword:a,it:c}=e;c.items=!0;const l=n.const("len",r._`${s}.length`);if(!1===i)e.setParams({len:t.length}),e.pass(r._`${l} <= ${t.length}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(c,i)){const i=n.var("valid",r._`${l} <= ${t.length}`);n.if((0,r.not)(i),(()=>function(i){n.forRange("i",t.length,l,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},i),c.allErrors||n.if((0,r.not)(i),(()=>n.break()))}))}(i))),e.ok(i)}}t.validateAdditionalItems=s,t.default=i},9351:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(412),o=n(3487),i=n(2141),s=n(6776),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:c,errsCount:l,it:u}=e;if(!l)throw new Error("ajv implementation error");const{allErrors:d,opts:p}=u;if(u.props=!0,"all"!==p.removeAdditional&&(0,s.alwaysValidSchema)(u,n))return;const h=(0,r.allSchemaProperties)(a.properties),f=(0,r.allSchemaProperties)(a.patternProperties);function m(e){t.code(o._`delete ${c}[${e}]`)}function g(r){if("all"===p.removeAdditional||p.removeAdditional&&!1===n)m(r);else{if(!1===n)return e.setParams({additionalProperty:r}),e.error(),void(d||t.break());if("object"==typeof n&&!(0,s.alwaysValidSchema)(u,n)){const n=t.name("valid");"failing"===p.removeAdditional?(_(r,n,!1),t.if((0,o.not)(n),(()=>{e.reset(),m(r)}))):(_(r,n),d||t.if((0,o.not)(n),(()=>t.break())))}}}function _(t,n,r){const o={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===r&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,n)}t.forIn("key",c,(n=>{h.length||f.length?t.if(function(n){let i;if(h.length>8){const e=(0,s.schemaRefOrVal)(u,a.properties,"properties");i=(0,r.isOwnProperty)(t,e,n)}else i=h.length?(0,o.or)(...h.map((e=>o._`${n} === ${e}`))):o.nil;return f.length&&(i=(0,o.or)(i,...f.map((t=>o._`${(0,r.usePattern)(e,t)}.test(${n})`)))),(0,o.not)(i)}(n),(()=>g(n))):g(n)})),e.ok(o._`${l} === ${i.default.errors}`)}};t.default=a},1125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6776),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const i=t.name("valid");n.forEach(((t,n)=>{if((0,r.alwaysValidSchema)(o,t))return;const s=e.subschema({keyword:"allOf",schemaProp:n},i);e.ok(i),e.mergeEvaluated(s)}))}};t.default=o},19:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(412).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r},9864:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o=n(6776),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?r.str`must contain at least ${e} valid item(s)`:r.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?r._`{minContains: ${e}}`:r._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:i,data:s,it:a}=e;let c,l;const{minContains:u,maxContains:d}=i;a.opts.next?(c=void 0===u?1:u,l=d):c=1;const p=t.const("len",r._`${s}.length`);if(e.setParams({min:c,max:l}),void 0===l&&0===c)return void(0,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.alwaysValidSchema)(a,n)){let t=r._`${p} >= ${c}`;return void 0!==l&&(t=r._`${t} && ${p} <= ${l}`),void e.pass(t)}a.items=!0;const h=t.name("valid");if(void 0===l&&1===c)f(h,(()=>t.if(h,(()=>t.break()))));else{t.let(h,!1);const e=t.name("_valid"),n=t.let("count",0);f(e,(()=>t.if(e,(()=>function(e){t.code(r._`${e}++`),void 0===l?t.if(r._`${e} >= ${c}`,(()=>t.assign(h,!0).break())):(t.if(r._`${e} > ${l}`,(()=>t.assign(h,!1).break())),1===c?t.assign(h,!0):t.if(r._`${e} >= ${c}`,(()=>t.assign(h,!0))))}(n)))))}function f(n,r){t.forRange("i",0,p,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:o.Type.Num,compositeRule:!0},n),r()}))}e.result(h,(()=>e.reset()))}};t.default=i},7772:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const r=n(3487),o=n(6776),i=n(412);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const o=1===t?"property":"properties";return r.str`must have ${o} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:o}})=>r._`{property: ${e},
missingProperty: ${o},
depsCount: ${t},
deps: ${n}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);a(e,t),c(e,n)}};function a(e,t=e.schema){const{gen:n,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const c in t){const l=t[c];if(0===l.length)continue;const u=(0,i.propertyInData)(n,o,c,s.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),s.allErrors?n.if(u,(()=>{for(const t of l)(0,i.checkReportMissingProp)(e,t)})):(n.if(r._`${u} && (${(0,i.checkMissingProp)(e,l,a)})`),(0,i.reportMissingProp)(e,a),n.else())}}function c(e,t=e.schema){const{gen:n,data:r,keyword:s,it:a}=e,c=n.name("valid");for(const l in t)(0,o.alwaysValidSchema)(a,t[l])||(n.if((0,i.propertyInData)(n,r,l,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:l},c);e.mergeValidEvaluated(t,c)}),(()=>n.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},9434:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o=n(6776),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str`must match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:i}=e;void 0===n.then&&void 0===n.else&&(0,o.checkStrictMode)(i,'"if" without "then" and "else" is ignored');const a=s(i,"then"),c=s(i,"else");if(!a&&!c)return;const l=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),a&&c){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(u,d("then",n),d("else",n))}else a?t.if(u,d("then")):t.if((0,r.not)(u),d("else"));function d(n,o){return()=>{const i=e.subschema({keyword:n},u);t.assign(l,u),e.mergeValidEvaluated(i,l),o?t.assign(o,r._`${n}`):e.setParams({ifClause:n})}}e.pass(l,(()=>e.error(!0)))}};function s(e,t){const n=e.schema[t];return void 0!==n&&!(0,o.alwaysValidSchema)(e,n)}t.default=i},8200:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4783),o=n(2924),i=n(4665),s=n(1119),a=n(9864),c=n(7772),l=n(3708),u=n(9351),d=n(6239),p=n(2296),h=n(5697),f=n(19),m=n(4200),g=n(1125),_=n(9434),y=n(6552);t.default=function(e=!1){const t=[h.default,f.default,m.default,g.default,_.default,y.default,l.default,u.default,c.default,d.default,p.default];return e?t.push(o.default,s.default):t.push(r.default,i.default),t.push(a.default),t}},4665:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(3487),o=n(6776),i=n(412),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,o.alwaysValidSchema)(n,t)||e.ok((0,i.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:i,parentSchema:s,data:a,keyword:c,it:l}=e;!function(e){const{opts:r,errSchemaPath:i}=l,s=n.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(r.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(l,e,r.strictTuples)}}(s),l.opts.unevaluated&&n.length&&!0!==l.items&&(l.items=o.mergeEvaluated.items(i,n.length,l.items));const u=i.name("valid"),d=i.const("len",r._`${a}.length`);n.forEach(((t,n)=>{(0,o.alwaysValidSchema)(l,t)||(i.if(r._`${d} > ${n}`,(()=>e.subschema({keyword:c,schemaProp:n,dataProp:n},u))),e.ok(u))}))}t.validateTuple=a,t.default=s},1119:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o=n(6776),i=n(412),s=n(4783),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:a}=n;r.items=!0,(0,o.alwaysValidSchema)(r,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},5697:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6776),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,r.alwaysValidSchema)(o,n))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=o},4200:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o=n(6776),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>r._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:n,parentSchema:i,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=n,c=t.let("valid",!1),l=t.let("passing",null),u=t.name("_valid");e.setParams({passing:l}),t.block((function(){a.forEach(((n,i)=>{let a;(0,o.alwaysValidSchema)(s,n)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},u),i>0&&t.if(r._`${u} && ${c}`).assign(c,!1).assign(l,r._`[${l}, ${i}]`).else(),t.if(u,(()=>{t.assign(c,!0),t.assign(l,i),a&&e.mergeEvaluated(a,r.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=i},2296:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(412),o=n(3487),i=n(6776),s=n(6776),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,r.allSchemaProperties)(n),p=d.filter((e=>(0,i.alwaysValidSchema)(l,n[e])));if(0===d.length||p.length===d.length&&(!l.opts.unevaluated||!0===l.props))return;const h=u.strictSchema&&!u.allowMatchingProperties&&c.properties,f=t.name("valid");!0===l.props||l.props instanceof o.Name||(l.props=(0,s.evaluatedPropsToName)(t,l.props));const{props:m}=l;function g(e){for(const t in h)new RegExp(e).test(t)&&(0,i.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function _(n){t.forIn("key",a,(i=>{t.if(o._`${(0,r.usePattern)(e,n)}.test(${i})`,(()=>{const r=p.includes(n);r||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:i,dataPropType:s.Type.Str},f),l.opts.unevaluated&&!0!==m?t.assign(o._`${m}[${i}]`,!0):r||l.allErrors||t.if((0,o.not)(f),(()=>t.break()))}))}))}!function(){for(const e of d)h&&g(e),l.allErrors?_(e):(t.var(f,!0),_(e),t.if(f))}()}};t.default=a},2924:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4665),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,r.validateTuple)(e,"items")};t.default=o},6239:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4815),o=n(412),i=n(6776),s=n(9351),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:c,it:l}=e;"all"===l.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new r.KeywordCxt(l,s.default,"additionalProperties"));const u=(0,o.allSchemaProperties)(n);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=i.mergeEvaluated.props(t,(0,i.toHash)(u),l.props));const d=u.filter((e=>!(0,i.alwaysValidSchema)(l,n[e])));if(0===d.length)return;const p=t.name("valid");for(const n of d)h(n)?f(n):(t.if((0,o.propertyInData)(t,c,n,l.opts.ownProperties)),f(n),l.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(p);function h(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==n[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}};t.default=a},3708:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o=n(6776),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>r._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:n,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,n))return;const a=t.name("valid");t.forIn("key",i,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,r.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=i},6552:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6776),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,r.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};t.default=o},412:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=n(3487),o=n(6776),i=n(2141);function s(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._`Object.prototype.hasOwnProperty`})}function a(e,t,n){return r._`${s(e)}.call(${t}, ${n})`}function c(e,t,n,o){const i=r._`${t}${(0,r.getProperty)(n)} === undefined`;return o?(0,r.or)(i,(0,r.not)(a(e,t,n))):i}function l(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:o,it:i}=e;n.if(c(n,o,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},o,i){return(0,r.or)(...o.map((o=>(0,r.and)(c(e,t,o,n.ownProperties),r._`${i} = ${o}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=s,t.isOwnProperty=a,t.propertyInData=function(e,t,n,o){const i=r._`${t}${(0,r.getProperty)(n)} !== undefined`;return o?r._`${i} && ${a(e,t,n)}`:i},t.noPropertyInData=c,t.allSchemaProperties=l,t.schemaProperties=function(e,t){return l(t).filter((n=>!(0,o.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:o,schemaPath:s,errorPath:a},it:c},l,u,d){const p=d?r._`${e}, ${t}, ${o}${s}`:t,h=[[i.default.instancePath,(0,r.strConcat)(i.default.instancePath,a)],[i.default.parentData,c.parentData],[i.default.parentDataProperty,c.parentDataProperty],[i.default.rootData,i.default.rootData]];c.opts.dynamicRef&&h.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const f=r._`${p}, ${n.object(...h)}`;return u!==r.nil?r._`${l}.call(${u}, ${f})`:r._`${l}(${f})`},t.usePattern=function({gen:e,it:{opts:t}},n){const o=t.unicodeRegExp?"u":"";return e.scopeValue("pattern",{key:n,ref:new RegExp(n,o),code:r._`new RegExp(${n}, ${o})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",r._`${n}.length`);t.forRange("i",0,c,(n=>{e.subschema({keyword:i,dataProp:n,dataPropType:o.Type.Num},a),t.if((0,r.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:i,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,o.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>n.forEach(((n,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},c);t.assign(a,r._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,r.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},8386:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},5684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8386),o=n(8280),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,o.default];t.default=i},8280:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r=n(6646),o=n(412),i=n(3487),s=n(2141),a=n(5173),c=n(6776),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:o}=e,{baseId:s,schemaEnv:c,validateName:l,opts:p,self:h}=o,{root:f}=c;if(("#"===n||"#/"===n)&&s===f.baseId)return function(){if(c===f)return d(e,l,c,c.$async);const n=t.scopeValue("root",{ref:f});return d(e,i._`${n}.validate`,f,f.$async)}();const m=a.resolveRef.call(h,f,s,n);if(void 0===m)throw new r.default(s,n);return m instanceof a.SchemaEnv?function(t){const n=u(e,t);d(e,n,t,t.$async)}(m):function(r){const o=t.scopeValue("schema",!0===p.code.source?{ref:r,code:(0,i.stringify)(r)}:{ref:r}),s=t.name("valid"),a=e.subschema({schema:r,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:n},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function u(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):i._`${n.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,n,r){const{gen:a,it:l}=e,{allErrors:u,schemaEnv:d,opts:p}=l,h=p.passContext?s.default.this:i.nil;function f(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function m(e){var t;if(!l.opts.unevaluated)return;const r=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(r&&!r.dynamicProps)void 0!==r.props&&(l.props=c.mergeEvaluated.props(a,r.props,l.props));else{const t=a.var("props",i._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,i.Name)}if(!0!==l.items)if(r&&!r.dynamicItems)void 0!==r.items&&(l.items=c.mergeEvaluated.items(a,r.items,l.items));else{const t=a.var("items",i._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,i.Name)}}r?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,h)}`),m(t),u||a.assign(n,!0)}),(e=>{a.if(i._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),f(e),u||a.assign(n,!1)})),e.ok(n)}():e.result((0,o.callValidateCode)(e,t,h),(()=>m(t)),(()=>f(t)))}t.getValidate=u,t.callRef=d,t.default=l},1240:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o=n(9306),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>r._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},code(e){const{gen:t,data:n,schema:i,parentSchema:s,it:a}=e,{oneOf:c}=s;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=i.propertyName;if("string"!=typeof l)throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");const u=t.let("valid",!1),d=t.const("tag",r._`${n}${(0,r.getProperty)(l)}`);function p(n){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:n},o);return e.mergeEvaluated(i,r.Name),o}t.if(r._`typeof ${d} == "string"`,(()=>function(){const n=function(){var e;const t={},n=o(s);let r=!0;for(let t=0;t<c.length;t++){const s=c[t],a=null===(e=s.properties)||void 0===e?void 0:e[l];if("object"!=typeof a)throw new Error(`discriminator: oneOf schemas must have "properties/${l}"`);r=r&&(n||o(s)),i(a,t)}if(!r)throw new Error(`discriminator: "${l}" must be required`);return t;function o({required:e}){return Array.isArray(e)&&e.includes(l)}function i(e,t){if(e.const)a(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`);for(const n of e.enum)a(n,t)}}function a(e,n){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${l}" values must be unique strings`);t[e]=n}}();t.if(!1);for(const e in n)t.elseIf(r._`${d} === ${e}`),t.assign(u,p(n[e]));t.else(),e.error(!1,{discrError:o.DiscrError.Mapping,tag:d,tagName:l}),t.endIf()}()),(()=>e.error(!1,{discrError:o.DiscrError.Tag,tag:d,tagName:l}))),e.ok(u)}};t.default=i},9306:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(n=t.DiscrError||(t.DiscrError={})).Tag="tag",n.Mapping="mapping"},3924:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5684),o=n(2649),i=n(8200),s=n(9502),a=n(6167),c=[r.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},9651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>r.str`must match format "${e}"`,params:({schemaCode:e})=>r._`{format: ${e}}`},code(e,t){const{gen:n,data:o,$data:i,schema:s,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:p}=c;l.validateFormats&&(i?function(){const i=n.scopeValue("formats",{ref:p.formats,code:l.code.formats}),s=n.const("fDef",r._`${i}[${a}]`),c=n.let("fType"),u=n.let("format");n.if(r._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>n.assign(c,r._`${s}.type || "string"`).assign(u,r._`${s}.validate`)),(()=>n.assign(c,r._`"string"`).assign(u,s))),e.fail$data((0,r.or)(!1===l.strictSchema?r.nil:r._`${a} && !${u}`,function(){const e=d.$async?r._`(${s}.async ? await ${u}(${o}) : ${u}(${o}))`:r._`${u}(${o})`,n=r._`(typeof ${u} == "function" ? ${e} : ${u}.test(${o}))`;return r._`${u} && ${u} !== true && ${c} === ${t} && !${n}`}()))}():function(){const i=p.formats[s];if(!i)return void function(){if(!1!==l.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${u}"`}p.logger.warn(e())}();if(!0===i)return;const[a,c,h]=function(e){const t=e instanceof RegExp?(0,r.regexpCode)(e):l.code.formats?r._`${l.code.formats}${(0,r.getProperty)(s)}`:void 0,o=n.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,r._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!d.$async)throw new Error("async format in sync schema");return r._`await ${h}(${o})`}return"function"==typeof c?r._`${h}(${o})`:r._`${h}.test(${o})`}())}())}};t.default=o},9502:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=[n(9651).default];t.default=r},6167:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},4693:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o=n(6776),i=n(3510),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>r._`{allowedValue: ${e}}`},code(e){const{gen:t,data:n,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(r._`!${(0,o.useFunc)(t,i.default)}(${n}, ${a})`):e.fail(r._`${c} !== ${n}`)}};t.default=s},966:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o=n(6776),i=n(3510),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>r._`{allowedValues: ${e}}`},code(e){const{gen:t,data:n,$data:s,schema:a,schemaCode:c,it:l}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=l.opts.loopEnum,d=(0,o.useFunc)(t,i.default);let p;if(u||s)p=t.let("valid"),e.block$data(p,(function(){t.assign(p,!1),t.forOf("v",c,(e=>t.if(r._`${d}(${n}, ${e})`,(()=>t.assign(p,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);p=(0,r.or)(...a.map(((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?r._`${d}(${n}, ${e}[${t}])`:r._`${n} === ${o}`}(e,o))))}e.pass(p)}};t.default=s},2649:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3983),o=n(430),i=n(3229),s=n(4336),a=n(498),c=n(3301),l=n(1687),u=n(2958),d=n(4693),p=n(966),h=[r.default,o.default,i.default,s.default,a.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,p.default];t.default=h},1687:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o}=e,i="maxItems"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`${n}.length ${i} ${o}`)}};t.default=o},3229:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o=n(6776),i=n(4499),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s,it:a}=e,c="maxLength"===t?r.operators.GT:r.operators.LT,l=!1===a.opts.unicode?r._`${n}.length`:r._`${(0,o.useFunc)(e.gen,i.default)}(${n})`;e.fail$data(r._`${l} ${c} ${s}`)}};t.default=s},3983:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o=r.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>r.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data(r._`${n} ${i[t].fail} ${o} || isNaN(${n})`)}};t.default=a},498:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o}=e,i="maxProperties"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${n}).length ${i} ${o}`)}};t.default=o},430:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3487),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>r.str`must be multiple of ${e}`,params:({schemaCode:e})=>r._`{multipleOf: ${e}}`},code(e){const{gen:t,data:n,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?r._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:r._`${a} !== parseInt(${a})`;e.fail$data(r._`(${o} === 0 || (${a} = ${n}/${o}, ${c}))`)}};t.default=o},4336:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(412),o=n(3487),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:i,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=n?o._`(new RegExp(${s}, ${c}))`:(0,r.usePattern)(e,i);e.fail$data(o._`!${l}.test(${t})`)}};t.default=i},3301:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(412),o=n(3487),i=n(6776),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:n,schemaCode:s,data:a,$data:c,it:l}=e,{opts:u}=l;if(!c&&0===n.length)return;const d=n.length>=u.loopRequired;if(l.allErrors?function(){if(d||c)e.block$data(o.nil,p);else for(const t of n)(0,r.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(d||c){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,i){e.setParams({missingProperty:n}),t.forOf(n,s,(()=>{t.assign(i,(0,r.propertyInData)(t,a,n,u.ownProperties)),t.if((0,o.not)(i),(()=>{e.error(),t.break()}))}),o.nil)}(i,n))),e.ok(n)}else t.if((0,r.checkMissingProp)(e,n,i)),(0,r.reportMissingProp)(e,i),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:r}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!r.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(l,t,l.opts.strictRequired)}}function p(){t.forOf("prop",s,(n=>{e.setParams({missingProperty:n}),t.if((0,r.noPropertyInData)(t,a,n,u.ownProperties),(()=>e.error()))}))}}};t.default=s},2958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(453),o=n(3487),i=n(6776),s=n(3510),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:n,$data:a,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!a&&!c)return;const p=t.let("valid"),h=l.items?(0,r.getSchemaTypes)(l.items):[];function f(i,s){const a=t.name("item"),c=(0,r.checkDataTypes)(h,a,d.opts.strictNumbers,r.DataType.Wrong),l=t.const("indices",o._`{}`);t.for(o._`;${i}--;`,(()=>{t.let(a,o._`${n}[${i}]`),t.if(c,o._`continue`),h.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(s,o._`${l}[${a}]`),e.error(),t.assign(p,!1).break()})).code(o._`${l}[${a}] = ${i}`)}))}function m(r,a){const c=(0,i.useFunc)(t,s.default),l=t.name("outer");t.label(l).for(o._`;${r}--;`,(()=>t.for(o._`${a} = ${r}; ${a}--;`,(()=>t.if(o._`${c}(${n}[${r}], ${n}[${a}])`,(()=>{e.error(),t.assign(p,!1).break(l)}))))))}e.block$data(p,(function(){const r=t.let("i",o._`${n}.length`),i=t.let("j");e.setParams({i:r,j:i}),t.assign(p,!0),t.if(o._`${r} > 1`,(()=>(h.length>0&&!h.some((e=>"object"===e||"array"===e))?f:m)(r,i)))}),o._`${u} === false`),e.ok(p)}};t.default=a},6281:(e,t,n)=>{"use strict";var r=n(7396),o=function(){function e(t){if(e.INSTANCE)throw new Error("Console logging adapter tracking should be configured from the applicationInsights object");this._client=t,e.INSTANCE=this}return e.prototype.enable=function(e,t){r.IsInitialized&&(n(4309).wp(e&&t,this._client),n(5823).wp(e,this._client),n(454).wp(e,this._client))},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1,!1)},e._methodNames=["debug","info","log","warn","error"],e}();e.exports=o},894:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5282),o=n(7396),i=function(){function e(){}return e.getCurrentContext=function(){if(!e.enabled)return null;var t=e.session.get(e.CONTEXT_NAME);return void 0===t?null:t},e.generateContextObject=function(e,t,n,r,o,i){return t=t||e,this.enabled?{operation:{name:n,id:e,parentId:t,traceparent:o,tracestate:i},customProperties:new s(r)}:null},e.runWithContext=function(t,n){return e.enabled?e.session.bind(n,((r={})[e.CONTEXT_NAME]=t,r))():n();var r},e.wrapEmitter=function(t){e.enabled&&e.session.bindEmitter(t)},e.wrapCallback=function(t){return e.enabled?e.session.bind(t):t},e.enable=function(t){this.enabled||(this.isNodeVersionCompatible()?(e.hasEverEnabled||(this.forceClsHooked=t,this.hasEverEnabled=!0,void 0===this.cls&&(!0===e.forceClsHooked||void 0===e.forceClsHooked&&e.shouldUseClsHooked()?this.cls=n(9562):this.cls=n(3057)),e.session=this.cls.createNamespace("AI-CLS-Session"),o.registerContextPreservation((function(t){return e.session.bind(t)}))),this.enabled=!0):this.enabled=!1)},e.disable=function(){this.enabled=!1},e.reset=function(){e.hasEverEnabled&&(e.session=null,e.session=this.cls.createNamespace("AI-CLS-Session"))},e.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},e.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},e.canUseClsHooked=function(){var e=process.versions.node.split("."),t=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,r=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(t&&n)&&r},e.enabled=!1,e.hasEverEnabled=!1,e.forceClsHooked=void 0,e.CONTEXT_NAME="ApplicationInsights-Context",e}();t.CorrelationContextManager=i;var s=function(){function e(e){this.props=[],this.addHeaderData(e)}return e.prototype.addHeaderData=function(e){var t=e?e.split(", "):[];this.props=t.map((function(e){var t=e.split("=");return{key:t[0],value:t[1]}})).concat(this.props)},e.prototype.serializeToHeader=function(){return this.props.map((function(e){return e.key+"="+e.value})).join(", ")},e.prototype.getProperty=function(e){for(var t=0;t<this.props.length;++t){var n=this.props[t];if(n.key===e)return n.value}},e.prototype.setProperty=function(t,n){if(e.bannedCharacters.test(t)||e.bannedCharacters.test(n))r.warn("Correlation context property keys and values must not contain ',' or '='. setProperty was called with key: "+t+" and value: "+n);else{for(var o=0;o<this.props.length;++o){var i=this.props[o];if(i.key===t)return void(i.value=n)}this.props.push({key:t,value:n})}},e.bannedCharacters=/[,=]/,e}()},6639:e=>{"use strict";var t=function(){function e(t){if(e.INSTANCE)throw new Error("Exception tracking should be configured from the applicationInsights object");e.INSTANCE=this,this._client=t;var n=process.versions.node.split(".");e._canUseUncaughtExceptionMonitor=parseInt(n[0])>13||13===parseInt(n[0])&&parseInt(n[1])>=7}return e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.enable=function(t){var n=this;if(t){if(this._isInitialized=!0,!this._exceptionListenerHandle){var r=function(t,r,o){void 0===o&&(o=new Error(e._FALLBACK_ERROR_MESSAGE)),n._client.trackException({exception:o}),n._client.flush({isAppCrashing:!0}),t&&r&&1===process.listeners(r).length&&(console.error(o),process.exit(1))};e._canUseUncaughtExceptionMonitor?(this._exceptionListenerHandle=r.bind(this,!1),process.on(e.UNCAUGHT_EXCEPTION_MONITOR_HANDLER_NAME,this._exceptionListenerHandle)):(this._exceptionListenerHandle=r.bind(this,!0,e.UNCAUGHT_EXCEPTION_HANDLER_NAME),this._rejectionListenerHandle=r.bind(this,!1),process.on(e.UNCAUGHT_EXCEPTION_HANDLER_NAME,this._exceptionListenerHandle),process.on(e.UNHANDLED_REJECTION_HANDLER_NAME,this._rejectionListenerHandle))}}else this._exceptionListenerHandle&&(e._canUseUncaughtExceptionMonitor?process.removeListener(e.UNCAUGHT_EXCEPTION_MONITOR_HANDLER_NAME,this._exceptionListenerHandle):(process.removeListener(e.UNCAUGHT_EXCEPTION_HANDLER_NAME,this._exceptionListenerHandle),process.removeListener(e.UNHANDLED_REJECTION_HANDLER_NAME,this._rejectionListenerHandle)),this._exceptionListenerHandle=void 0,this._rejectionListenerHandle=void 0,delete this._exceptionListenerHandle,delete this._rejectionListenerHandle)},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1),this._isInitialized=!1},e.INSTANCE=null,e.UNCAUGHT_EXCEPTION_MONITOR_HANDLER_NAME="uncaughtExceptionMonitor",e.UNCAUGHT_EXCEPTION_HANDLER_NAME="uncaughtException",e.UNHANDLED_REJECTION_HANDLER_NAME="unhandledRejection",e._RETHROW_EXIT_MESSAGE="Application Insights Rethrow Exception Handler",e._FALLBACK_ERROR_MESSAGE="A promise was rejected without providing an error. Application Insights generated this error stack for you.",e._canUseUncaughtExceptionMonitor=!1,e}();e.exports=t},8723:(e,t,n)=>{"use strict";var r=n(3685),o=n(5687),i=n(5282),s=n(5740),a=n(9036),c=n(8339),l=n(894),u=n(9962),d=n(8090),p=n(7396),h=function(){function e(t){if(e.INSTANCE)throw new Error("Client request tracking should be configured from the applicationInsights object");e.INSTANCE=this,this._client=t}return e.prototype.enable=function(e){this._isEnabled=e,this._isEnabled&&!this._isInitialized&&this._initialize(),p.IsInitialized&&(n(7886).wp(e,this._client),n(4777).wp(e,this._client),n(5071).wp(e,this._client),n(1227).wp(e,this._client))},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype._initialize=function(){var t=this;this._isInitialized=!0,r.get;var n=r.request,i=o.request,s=function(n,r){var o=!r[e.disableCollectionRequestOption]&&!n[e.alreadyAutoCollectedFlag];n[e.alreadyAutoCollectedFlag]=!0,n&&r&&o&&(l.CorrelationContextManager.wrapEmitter(n),e.trackRequest(t._client,{options:r,request:n}))};r.request=function(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];var i=n.call.apply(n,[r,e].concat(t));return s(i,e),i},o.request=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=i.call.apply(i,[o,e].concat(t));return s(r,e),r},r.get=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o,i=(o=r.request).call.apply(o,[r,e].concat(t));return i.end(),i},o.get=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,i=(r=o.request).call.apply(r,[o,e].concat(t));return i.end(),i}},e.trackRequest=function(t,n){if(n.options&&n.request&&t){var r,o,p=new c(n.options,n.request),h=l.CorrelationContextManager.getCurrentContext();if(h&&h.operation&&h.operation.traceparent&&d.isValidTraceId(h.operation.traceparent.traceId)?(h.operation.traceparent.updateSpanId(),r=h.operation.traceparent.getBackCompatRequestId()):u.w3cEnabled?(o=(m=new d).toString(),r=m.getBackCompatRequestId()):r=h&&h.operation&&h.operation.parentId+e.requestNumber+++".",s.canIncludeCorrelationHeader(t,p.getUrl())&&n.request.getHeader&&n.request.setHeader&&t.config&&t.config.correlationId){var f=n.request.getHeader(a.requestContextHeader);try{s.safeIncludeCorrelationHeader(t,n.request,f)}catch(e){i.warn("Request-Context header could not be set. Correlation of requests may be lost",e)}if(h&&h.operation)try{if(n.request.setHeader(a.requestIdHeader,r),n.request.setHeader(a.parentIdHeader,h.operation.id),n.request.setHeader(a.rootIdHeader,r),o||h.operation.traceparent)n.request.setHeader(a.traceparentHeader,o||h.operation.traceparent.toString());else if(u.w3cEnabled){var m=(new d).toString();n.request.setHeader(a.traceparentHeader,m)}if(h.operation.tracestate){var g=h.operation.tracestate.toString();g&&n.request.setHeader(a.traceStateHeader,g)}var _=h.customProperties.serializeToHeader();_&&n.request.setHeader(a.correlationContextHeader,_)}catch(e){i.warn("Correlation headers could not be set. Correlation of requests may be lost.",e)}}n.request.on&&(n.request.on("response",(function(e){p.onResponse(e);var o=p.getDependencyTelemetry(n,r);o.contextObjects=o.contextObjects||{},o.contextObjects["http.RequestOptions"]=n.options,o.contextObjects["http.ClientRequest"]=n.request,o.contextObjects["http.ClientResponse"]=e,t.trackDependency(o)})),n.request.on("error",(function(e){p.onError(e);var o=p.getDependencyTelemetry(n,r);o.contextObjects=o.contextObjects||{},o.contextObjects["http.RequestOptions"]=n.options,o.contextObjects["http.ClientRequest"]=n.request,o.contextObjects.Error=e,t.trackDependency(o)})))}else i.info("AutoCollectHttpDependencies.trackRequest was called with invalid parameters: ",!n.options,!n.request,!t)},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1),this._isInitialized=!1},e.disableCollectionRequestOption="disableAppInsightsAutoCollection",e.requestNumber=1,e.alreadyAutoCollectedFlag="_appInsightsAutoCollected",e}();e.exports=h},8339:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=n(7310),s=n(5290),a=n(5740),c=n(9036),l=n(3054),u=n(9962),d=function(e){function t(n,r){var o=e.call(this)||this;return r&&r.method&&n&&(o.method=r.method,o.url=t._getUrlFromRequestOptions(n,r),o.startTime=+new Date),o}return o(t,e),t.prototype.onError=function(e){this._setStatus(void 0,e)},t.prototype.onResponse=function(e){this._setStatus(e.statusCode,void 0),this.correlationId=a.getCorrelationContextTarget(e,c.requestContextTargetKey)},t.prototype.getDependencyTelemetry=function(e,t){var n=i.parse(this.url);n.search=void 0,n.hash=void 0;var r=this.method.toUpperCase()+" "+n.pathname,o=s.RemoteDependencyDataConstants.TYPE_HTTP,a=n.hostname;this.correlationId?(o=s.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==u.correlationIdPrefix&&(a=n.hostname+" | "+this.correlationId)):o=s.RemoteDependencyDataConstants.TYPE_HTTP,n.port&&(a+=":"+n.port);var c={id:t,name:r,data:this.url,duration:this.duration,success:this._isSuccess(),resultCode:this.statusCode?this.statusCode.toString():null,properties:this.properties||{},dependencyTypeName:o,target:a};if(e){for(var l in e)c[l]||(c[l]=e[l]);if(e.properties)for(var l in e.properties)c.properties[l]=e.properties[l]}return c},t._getUrlFromRequestOptions=function(e,t){if("string"==typeof e)e=i.parse(e);else{var n=e;e={},n&&Object.keys(n).forEach((function(t){e[t]=n[t]}))}if(e.path){var r=i.parse(e.path);e.pathname=r.pathname,e.search=r.search}return e.host&&e.port&&!i.parse("http://"+e.host).port&&e.port&&(e.hostname=e.host,delete e.host),e.protocol=e.protocol||t.agent&&t.agent.protocol||void 0,e.hostname=e.hostname||"your_fauxpilot_server_ip",i.format(e)},t}(l);e.exports=d},6694:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=n(7310),s=n(5290),a=n(5740),c=n(9036),l=n(3054),u=n(9962),d=n(1974),p=n(8090),h=function(e){function t(t,n){var r=e.call(this)||this;return t&&(r.method=t.method,r.url=r._getAbsoluteUrl(t),r.startTime=+new Date,r.socketRemoteAddress=t.socket&&t.socket.remoteAddress,r.parseHeaders(t,n),t.connection&&(r.connectionRemoteAddress=t.connection.remoteAddress,r.legacySocketRemoteAddress=t.connection.socket&&t.connection.socket.remoteAddress)),r}return o(t,e),t.prototype.onError=function(e,t){this._setStatus(void 0,e),t&&(this.duration=t)},t.prototype.onResponse=function(e,t){this._setStatus(e.statusCode,void 0),t&&(this.duration=t)},t.prototype.getRequestTelemetry=function(e){var t={id:this.requestId,name:this.method+" "+i.parse(this.url).pathname,url:this.url,source:this.sourceCorrelationId,duration:this.duration,resultCode:this.statusCode?this.statusCode.toString():null,success:this._isSuccess(),properties:this.properties};if(e){for(var n in e)t[n]||(t[n]=e[n]);if(e.properties)for(var n in e.properties)t.properties[n]=e.properties[n]}return t},t.prototype.getRequestTags=function(e){var n={};for(var r in e)n[r]=e[r];return n[t.keys.locationIp]=e[t.keys.locationIp]||this._getIp(),n[t.keys.sessionId]=e[t.keys.sessionId]||this._getId("ai_session"),n[t.keys.userId]=e[t.keys.userId]||this._getId("ai_user"),n[t.keys.userAuthUserId]=e[t.keys.userAuthUserId]||this._getId("ai_authUser"),n[t.keys.operationName]=this.getOperationName(e),n[t.keys.operationParentId]=this.getOperationParentId(e),n[t.keys.operationId]=this.getOperationId(e),n},t.prototype.getOperationId=function(e){return e[t.keys.operationId]||this.operationId},t.prototype.getOperationParentId=function(e){return e[t.keys.operationParentId]||this.parentId||this.getOperationId(e)},t.prototype.getOperationName=function(e){return e[t.keys.operationName]||this.method+" "+i.parse(this.url).pathname},t.prototype.getRequestId=function(){return this.requestId},t.prototype.getCorrelationContextHeader=function(){return this.correlationContextHeader},t.prototype.getTraceparent=function(){return this.traceparent},t.prototype.getTracestate=function(){return this.tracestate},t.prototype.getLegacyRootId=function(){return this.legacyRootId},t.prototype._getAbsoluteUrl=function(e){if(!e.headers)return e.url;var t=e.connection?e.connection.encrypted:null,n=i.parse(e.url),r=n.pathname,o=n.search;return i.format({protocol:t?"https":"http",host:e.headers.host,pathname:r,search:o})},t.prototype._getIp=function(){var e=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/,t=function(t){var n=e.exec(t);if(n)return n[0]},n=t(this.rawHeaders["x-forwarded-for"])||t(this.rawHeaders["x-client-ip"])||t(this.rawHeaders["x-real-ip"])||t(this.connectionRemoteAddress)||t(this.socketRemoteAddress)||t(this.legacySocketRemoteAddress);return!n&&this.connectionRemoteAddress&&this.connectionRemoteAddress.substr&&"::"===this.connectionRemoteAddress.substr(0,2)&&(n="your_fauxpilot_server_ip"),n},t.prototype._getId=function(e){var n=this.rawHeaders&&this.rawHeaders.cookie&&"string"==typeof this.rawHeaders.cookie&&this.rawHeaders.cookie||"";return t.parseId(a.getCookie(e,n))},t.prototype.setBackCompatFromThisTraceContext=function(){this.operationId=this.traceparent.traceId,this.traceparent.legacyRootId&&(this.legacyRootId=this.traceparent.legacyRootId),this.parentId=this.traceparent.parentId,this.traceparent.updateSpanId(),this.requestId=this.traceparent.getBackCompatRequestId()},t.prototype.parseHeaders=function(e,t){if(this.rawHeaders=e.headers||e.rawHeaders,this.userAgent=e.headers&&e.headers["user-agent"],this.sourceCorrelationId=a.getCorrelationContextTarget(e,c.requestContextSourceKey),e.headers){var n=e.headers[c.traceStateHeader],r=e.headers[c.traceparentHeader],o=e.headers[c.requestIdHeader],i=e.headers[c.parentIdHeader],s=e.headers[c.rootIdHeader];this.correlationContextHeader=e.headers[c.correlationContextHeader],u.w3cEnabled&&(r||n)?(this.traceparent=new p(r),this.tracestate=r&&n&&new d(n),this.setBackCompatFromThisTraceContext()):o?u.w3cEnabled?(this.traceparent=new p(null,o),this.setBackCompatFromThisTraceContext()):(this.parentId=o,this.requestId=u.generateRequestId(this.parentId),this.operationId=u.getRootId(this.requestId)):u.w3cEnabled?(this.traceparent=new p,this.traceparent.parentId=i,this.traceparent.legacyRootId=s||i,this.setBackCompatFromThisTraceContext()):(this.parentId=i,this.requestId=u.generateRequestId(s||this.parentId),this.correlationContextHeader=null,this.operationId=u.getRootId(this.requestId)),t&&(this.requestId=t,this.operationId=u.getRootId(this.requestId))}},t.parseId=function(e){var t=e.split("|");return t.length>0?t[0]:""},t.keys=new s.ContextTagKeys,t}(l);e.exports=h},731:(e,t,n)=>{"use strict";var r=n(3685),o=n(5687),i=n(5282),s=n(5740),a=n(9036),c=n(6694),l=n(894),u=n(4350),d=function(){function e(t){if(e.INSTANCE)throw new Error("Server request tracking should be configured from the applicationInsights object");e.INSTANCE=this,this._client=t}return e.prototype.enable=function(e){this._isEnabled=e,(this._isAutoCorrelating||this._isEnabled||u.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},e.prototype.useAutoCorrelation=function(e,t){e&&!this._isAutoCorrelating?l.CorrelationContextManager.enable(t):!e&&this._isAutoCorrelating&&l.CorrelationContextManager.disable(),this._isAutoCorrelating=e},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.isAutoCorrelating=function(){return this._isAutoCorrelating},e.prototype._generateCorrelationContext=function(e){if(this._isAutoCorrelating)return l.CorrelationContextManager.generateContextObject(e.getOperationId(this._client.context.tags),e.getRequestId(),e.getOperationName(this._client.context.tags),e.getCorrelationContextHeader(),e.getTraceparent(),e.getTracestate())},e.prototype._initialize=function(){var t=this;this._isInitialized=!0;var n=function(n){if(n){if("function"!=typeof n)throw new Error("onRequest handler must be a function");return function(r,o){l.CorrelationContextManager.wrapEmitter(r),l.CorrelationContextManager.wrapEmitter(o);var i=r&&!r[e.alreadyAutoCollectedFlag];if(r&&i){var s=new c(r),a=t._generateCorrelationContext(s);l.CorrelationContextManager.runWithContext(a,(function(){t._isEnabled&&(r[e.alreadyAutoCollectedFlag]=!0,e.trackRequest(t._client,{request:r,response:o},s)),"function"==typeof n&&n(r,o)}))}else"function"==typeof n&&n(r,o)}}},i=function(e){var t=e.addListener.bind(e);e.addListener=function(e,r){switch(e){case"request":case"checkContinue":return t(e,n(r));default:return t(e,r)}},e.on=e.addListener},s=r.createServer;r.createServer=function(e){var t=s(n(e));return i(t),t};var a=o.createServer;o.createServer=function(e,t){var r=a(e,n(t));return i(r),r}},e.trackRequestSync=function(t,n){if(n.request&&n.response&&t){e.addResponseCorrelationIdHeader(t,n.response);var r=l.CorrelationContextManager.getCurrentContext(),o=new c(n.request,r&&r.operation.parentId);r&&(r.operation.id=o.getOperationId(t.context.tags)||r.operation.id,r.operation.name=o.getOperationName(t.context.tags)||r.operation.name,r.operation.parentId=o.getRequestId()||r.operation.parentId,r.customProperties.addHeaderData(o.getCorrelationContextHeader())),e.endRequest(t,o,n,n.duration,n.error)}else i.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!n.request,!n.response,!t)},e.trackRequest=function(t,n,r){if(n.request&&n.response&&t){var o=l.CorrelationContextManager.getCurrentContext(),a=r||new c(n.request,o&&o.operation.parentId);s.canIncludeCorrelationHeader(t,a.getUrl())&&e.addResponseCorrelationIdHeader(t,n.response),o&&!r&&(o.operation.id=a.getOperationId(t.context.tags)||o.operation.id,o.operation.name=a.getOperationName(t.context.tags)||o.operation.name,o.operation.parentId=a.getOperationParentId(t.context.tags)||o.operation.parentId,o.customProperties.addHeaderData(a.getCorrelationContextHeader())),n.response.once&&n.response.once("finish",(function(){e.endRequest(t,a,n,null,null)})),n.request.on&&n.request.on("error",(function(r){e.endRequest(t,a,n,null,r)}))}else i.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!n.request,!n.response,!t)},e.addResponseCorrelationIdHeader=function(e,t){if(e.config&&e.config.correlationId&&t.getHeader&&t.setHeader&&!t.headersSent){var n=t.getHeader(a.requestContextHeader);s.safeIncludeCorrelationHeader(e,t,n)}},e.endRequest=function(e,t,n,r,o){o?t.onError(o,r):t.onResponse(n.response,r);var i=t.getRequestTelemetry(n);if(i.tagOverrides=t.getRequestTags(e.context.tags),n.tagOverrides)for(var s in n.tagOverrides)i.tagOverrides[s]=n.tagOverrides[s];var a=t.getLegacyRootId();a&&(i.properties.ai_legacyRootId=a),i.contextObjects=i.contextObjects||{},i.contextObjects["http.ServerRequest"]=n.request,i.contextObjects["http.ServerResponse"]=n.response,e.trackRequest(i)},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1),this._isInitialized=!1,l.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},e.alreadyAutoCollectedFlag="_appInsightsAutoCollected",e}();e.exports=d},1629:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(9253),i=n(4470),s=n(5282),a=function(){function e(t){this._disabledMetrics={},e.INSTANCE&&e.INSTANCE.dispose(),e.INSTANCE=this,this._client=t}return e.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>=6},e.prototype.enable=function(t,r,o){var i=this;if(void 0===r&&(r={}),void 0===o&&(o=6e4),e.isNodeVersionCompatible()){if(null==e._metricsAvailable&&t&&!this._isInitialized)try{var a=n(9166);e._emitter=new a,e._metricsAvailable=!0,s.info("Native metrics module successfully loaded!")}catch(t){return void(e._metricsAvailable=!1)}this._isEnabled=t,this._disabledMetrics=r,this._isEnabled&&!this._isInitialized&&(this._isInitialized=!0),this._isEnabled&&e._emitter?(e._emitter.enable(!0,o),this._handle=setInterval((function(){return i._trackNativeMetrics()}),o),this._handle.unref()):e._emitter&&(e._emitter.enable(!1),this._handle&&(clearInterval(this._handle),this._handle=void 0))}},e.prototype.dispose=function(){this.enable(!1)},e.parseEnabled=function(e){var t=process.env[o.ENV_nativeMetricsDisableAll],n=process.env[o.ENV_nativeMetricsDisablers];if(t)return{isEnabled:!1,disabledMetrics:{}};if(n){var i=n.split(","),s={};if(i.length>0)for(var a=0,c=i;a<c.length;a++)s[c[a]]=!0;return"object"==typeof e?{isEnabled:!0,disabledMetrics:r({},e,s)}:{isEnabled:e,disabledMetrics:s}}return"boolean"==typeof e?{isEnabled:e,disabledMetrics:{}}:{isEnabled:!0,disabledMetrics:e}},e.prototype._trackNativeMetrics=function(){var e=!0;"object"!=typeof this._isEnabled&&(e=this._isEnabled),e&&(this._trackGarbageCollection(),this._trackEventLoop(),this._trackHeapUsage())},e.prototype._trackGarbageCollection=function(){if(!this._disabledMetrics.gc){var t,n=e._emitter.getGCData();for(var r in n){var o=n[r].metrics,s=r+" Garbage Collection Duration",a=Math.sqrt(o.sumSquares/o.count-Math.pow(o.total/o.count,2))||0;this._client.trackMetric({name:s,value:o.total,count:o.count,max:o.max,min:o.min,stdDev:a,tagOverrides:(t={},t[this._client.context.keys.internalSdkVersion]="node-nativeperf:"+i.sdkVersion,t)})}}},e.prototype._trackEventLoop=function(){if(!this._disabledMetrics.loop){var t=e._emitter.getLoopData().loopUsage;if(0!=t.count){var n,r=Math.sqrt(t.sumSquares/t.count-Math.pow(t.total/t.count,2))||0;this._client.trackMetric({name:"Event Loop CPU Time",value:t.total,count:t.count,min:t.min,max:t.max,stdDev:r,tagOverrides:(n={},n[this._client.context.keys.internalSdkVersion]="node-nativeperf:"+i.sdkVersion,n)})}}},e.prototype._trackHeapUsage=function(){if(!this._disabledMetrics.heap){var e,t,n,r=process.memoryUsage(),o=r.heapUsed,s=r.heapTotal,a=r.rss;this._client.trackMetric({name:"Memory Usage (Heap)",value:o,count:1,tagOverrides:(e={},e[this._client.context.keys.internalSdkVersion]="node-nativeperf:"+i.sdkVersion,e)}),this._client.trackMetric({name:"Memory Total (Heap)",value:s,count:1,tagOverrides:(t={},t[this._client.context.keys.internalSdkVersion]="node-nativeperf:"+i.sdkVersion,t)}),this._client.trackMetric({name:"Memory Usage (Non-Heap)",value:a-s,count:1,tagOverrides:(n={},n[this._client.context.keys.internalSdkVersion]="node-nativeperf:"+i.sdkVersion,n)})}},e}();t.AutoCollectNativePerformance=a},4350:(e,t,n)=>{"use strict";var r=n(2037),o=n(3580),i=function(){function e(t,n,r){void 0===n&&(n=6e4),void 0===r&&(r=!1),this._lastIntervalRequestExecutionTime=0,this._lastIntervalDependencyExecutionTime=0,e.INSTANCE||(e.INSTANCE=this),this._isInitialized=!1,this._client=t,this._collectionInterval=n,this._enableLiveMetricsCounters=r}return e.prototype.enable=function(t,n){var o=this;this._isEnabled=t,this._isEnabled&&!this._isInitialized&&(this._isInitialized=!0),t?this._handle||(this._lastCpus=r.cpus(),this._lastRequests={totalRequestCount:e._totalRequestCount,totalFailedRequestCount:e._totalFailedRequestCount,time:+new Date},this._lastDependencies={totalDependencyCount:e._totalDependencyCount,totalFailedDependencyCount:e._totalFailedDependencyCount,time:+new Date},this._lastExceptions={totalExceptionCount:e._totalExceptionCount,time:+new Date},"function"==typeof process.cpuUsage&&(this._lastAppCpuUsage=process.cpuUsage()),this._lastHrtime=process.hrtime(),this._collectionInterval=n||this._collectionInterval,this._handle=setInterval((function(){return o.trackPerformance()}),this._collectionInterval),this._handle.unref()):this._handle&&(clearInterval(this._handle),this._handle=void 0)},e.countRequest=function(t,n){var r;if(e.isEnabled()){if("string"==typeof t)r=+new Date("1970-01-01T"+t+"Z");else{if("number"!=typeof t)return;r=t}e._intervalRequestExecutionTime+=r,!1===n&&e._totalFailedRequestCount++,e._totalRequestCount++}},e.countException=function(){e._totalExceptionCount++},e.countDependency=function(t,n){var r;if(e.isEnabled()){if("string"==typeof t)r=+new Date("1970-01-01T"+t+"Z");else{if("number"!=typeof t)return;r=t}e._intervalDependencyExecutionTime+=r,!1===n&&e._totalFailedDependencyCount++,e._totalDependencyCount++}},e.prototype.isInitialized=function(){return this._isInitialized},e.isEnabled=function(){return e.INSTANCE&&e.INSTANCE._isEnabled},e.prototype.trackPerformance=function(){this._trackCpu(),this._trackMemory(),this._trackNetwork(),this._trackDependencyRate(),this._trackExceptionRate()},e.prototype._trackCpu=function(){var e=r.cpus();if(e&&e.length&&this._lastCpus&&e.length===this._lastCpus.length){for(var t=0,n=0,i=0,s=0,a=0,c=0;e&&c<e.length;c++){var l=e[c],u=this._lastCpus[c],d=(l.model,l.speed,l.times),p=u.times;t+=d.user-p.user||0,n+=d.sys-p.sys||0,i+=d.nice-p.nice||0,s+=d.idle-p.idle||0,a+=d.irq-p.irq||0}var h=void 0;if("function"==typeof process.cpuUsage){var f=process.cpuUsage(),m=process.hrtime(),g=f.user-this._lastAppCpuUsage.user+(f.system-this._lastAppCpuUsage.system)||0;void 0!==this._lastHrtime&&2===this._lastHrtime.length&&(h=100*g/((1e6*(m[0]-this._lastHrtime[0])+(m[1]-this._lastHrtime[1])/1e3||0)*e.length)),this._lastAppCpuUsage=f,this._lastHrtime=m}var _=t+n+i+s+a||1;this._client.trackMetric({name:o.PerformanceCounter.PROCESSOR_TIME,value:(_-s)/_*100}),this._client.trackMetric({name:o.PerformanceCounter.PROCESS_TIME,value:h||t/_*100})}this._lastCpus=e},e.prototype._trackMemory=function(){var e=r.freemem(),t=process.memoryUsage().rss,n=r.totalmem()-e;this._client.trackMetric({name:o.PerformanceCounter.PRIVATE_BYTES,value:t}),this._client.trackMetric({name:o.PerformanceCounter.AVAILABLE_BYTES,value:e}),this._enableLiveMetricsCounters&&this._client.trackMetric({name:o.QuickPulseCounter.COMMITTED_BYTES,value:n})},e.prototype._trackNetwork=function(){var t=this._lastRequests,n={totalRequestCount:e._totalRequestCount,totalFailedRequestCount:e._totalFailedRequestCount,time:+new Date},r=n.totalRequestCount-t.totalRequestCount||0,i=n.totalFailedRequestCount-t.totalFailedRequestCount||0,s=n.time-t.time,a=s/1e3,c=(e._intervalRequestExecutionTime-this._lastIntervalRequestExecutionTime)/r||0;if(this._lastIntervalRequestExecutionTime=e._intervalRequestExecutionTime,s>0){var l=r/a,u=i/a;this._client.trackMetric({name:o.PerformanceCounter.REQUEST_RATE,value:l}),(!this._enableLiveMetricsCounters||r>0)&&this._client.trackMetric({name:o.PerformanceCounter.REQUEST_DURATION,value:c}),this._enableLiveMetricsCounters&&this._client.trackMetric({name:o.QuickPulseCounter.REQUEST_FAILURE_RATE,value:u})}this._lastRequests=n},e.prototype._trackDependencyRate=function(){if(this._enableLiveMetricsCounters){var t=this._lastDependencies,n={totalDependencyCount:e._totalDependencyCount,totalFailedDependencyCount:e._totalFailedDependencyCount,time:+new Date},r=n.totalDependencyCount-t.totalDependencyCount||0,i=n.totalFailedDependencyCount-t.totalFailedDependencyCount||0,s=n.time-t.time,a=s/1e3,c=(e._intervalDependencyExecutionTime-this._lastIntervalDependencyExecutionTime)/r||0;if(this._lastIntervalDependencyExecutionTime=e._intervalDependencyExecutionTime,s>0){var l=r/a,u=i/a;this._client.trackMetric({name:o.QuickPulseCounter.DEPENDENCY_RATE,value:l}),this._client.trackMetric({name:o.QuickPulseCounter.DEPENDENCY_FAILURE_RATE,value:u}),(!this._enableLiveMetricsCounters||r>0)&&this._client.trackMetric({name:o.QuickPulseCounter.DEPENDENCY_DURATION,value:c})}this._lastDependencies=n}},e.prototype._trackExceptionRate=function(){if(this._enableLiveMetricsCounters){var t=this._lastExceptions,n={totalExceptionCount:e._totalExceptionCount,time:+new Date},r=n.totalExceptionCount-t.totalExceptionCount||0,i=n.time-t.time;if(i>0){var s=r/(i/1e3);this._client.trackMetric({name:o.QuickPulseCounter.EXCEPTION_RATE,value:s})}this._lastExceptions=n}},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1),this._isInitialized=!1},e._totalRequestCount=0,e._totalFailedRequestCount=0,e._lastRequestExecutionTime=0,e._totalDependencyCount=0,e._totalFailedDependencyCount=0,e._lastDependencyExecutionTime=0,e._totalExceptionCount=0,e._intervalDependencyExecutionTime=0,e._intervalRequestExecutionTime=0,e}();e.exports=i},3054:e=>{"use strict";var t=function(){function e(){}return e.prototype.getUrl=function(){return this.url},e.prototype.RequestParser=function(){this.startTime=+new Date},e.prototype._setStatus=function(e,t){var n=+new Date;this.duration=n-this.startTime,this.statusCode=e;var r=this.properties||{};if(t)if("string"==typeof t)r.error=t;else if(t instanceof Error)r.error=t.message;else if("object"==typeof t)for(var o in t)r[o]=t[o]&&t[o].toString&&t[o].toString();this.properties=r},e.prototype._isSuccess=function(){return 0<this.statusCode&&this.statusCode<400},e}();e.exports=t},5823:(e,t,n)=>{"use strict";var r=n(5290),o=n(4953),i=[],s={10:r.SeverityLevel.Verbose,20:r.SeverityLevel.Verbose,30:r.SeverityLevel.Information,40:r.SeverityLevel.Warning,50:r.SeverityLevel.Error,60:r.SeverityLevel.Critical},a=function(e){var t=e.data.result;i.forEach((function(n){var r=s[e.data.level];t instanceof Error?n.trackException({exception:t}):n.trackTrace({message:t,severity:r})}))};t.wp=function(e,t){e?(0===i.length&&o.channel.subscribe("bunyan",a),i.push(t)):0===(i=i.filter((function(e){return e!=t}))).length&&o.channel.unsubscribe("bunyan",a)}},4309:(e,t,n)=>{"use strict";var r=n(5290),o=n(4953),i=[],s=function(e){var t=e.data.message;i.forEach((function(n){t instanceof Error?n.trackException({exception:t}):(t.lastIndexOf("\n")==t.length-1&&(t=t.substring(0,t.length-1)),n.trackTrace({message:t,severity:e.data.stderr?r.SeverityLevel.Warning:r.SeverityLevel.Information}))}))};t.wp=function(e,t){e?(0===i.length&&o.channel.subscribe("console",s),i.push(t)):0===(i=i.filter((function(e){return e!=t}))).length&&o.channel.unsubscribe("console",s)}},7396:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5282);t.IsInitialized=!process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL;var o="DiagnosticChannel";if(t.IsInitialized){var i=n(4106),s=(process.env.APPLICATION_INSIGHTS_NO_PATCH_MODULES||"").split(","),a={bunyan:i.bunyan,console:i.console,mongodb:i.mongodb,mongodbCore:i.mongodbCore,mysql:i.mysql,redis:i.redis,pg:i.pg,pgPool:i.pgPool,winston:i.winston};for(var c in a)-1===s.indexOf(c)&&(a[c].enable(),r.info(o,"Subscribed to "+c+" events"));s.length>0&&r.info(o,"Some modules will not be patched",s)}else r.info(o,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");t.registerContextPreservation=function(e){t.IsInitialized&&n(4953).channel.addContextPreservation(e)}},7886:(e,t,n)=>{"use strict";var r=n(4953),o=[];t.qP=function(e){e.data.event.commandName,o.forEach((function(t){var n=e.data.startedData&&e.data.startedData.databaseName||"Unknown database";t.trackDependency({target:n,data:e.data.event.commandName,name:e.data.event.commandName,duration:e.data.event.duration,success:e.data.succeeded,resultCode:e.data.succeeded?"0":"1",dependencyTypeName:"mongodb"})}))},t.wp=function(e,n){e?(0===o.length&&r.channel.subscribe("mongodb",t.qP),o.push(n)):0===(o=o.filter((function(e){return e!=n}))).length&&r.channel.unsubscribe("mongodb",t.qP)}},4777:(e,t,n)=>{"use strict";var r=n(4953),o=[];t.qP=function(e){o.forEach((function(t){var n=e.data.query||{},r=n.sql||"Unknown query",o=!e.data.err,i=(n._connection||{}).config||{},s=i.socketPath?i.socketPath:(i.host||"your_fauxpilot_server_ip")+":"+i.port;t.trackDependency({target:s,data:r,name:r,duration:e.data.duration,success:o,resultCode:o?"0":"1",dependencyTypeName:"mysql"})}))},t.wp=function(e,n){e?(0===o.length&&r.channel.subscribe("mysql",t.qP),o.push(n)):0===(o=o.filter((function(e){return e!=n}))).length&&r.channel.unsubscribe("mysql",t.qP)}},1227:(e,t,n)=>{"use strict";var r=n(4953),o=[];t.qP=function(e){o.forEach((function(t){var n=e.data.query,r=n.preparable&&n.preparable.text||n.plan||n.text||"unknown query",o=!e.data.error,i=e.data.database.host+":"+e.data.database.port;t.trackDependency({target:i,data:r,name:r,duration:e.data.duration,success:o,resultCode:o?"0":"1",dependencyTypeName:"postgres"})}))},t.wp=function(e,n){e?(0===o.length&&r.channel.subscribe("postgres",t.qP),o.push(n)):0===(o=o.filter((function(e){return e!=n}))).length&&r.channel.unsubscribe("postgres",t.qP)}},5071:(e,t,n)=>{"use strict";var r=n(4953),o=[];t.qP=function(e){o.forEach((function(t){"info"!==e.data.commandObj.command&&t.trackDependency({target:e.data.address,name:e.data.commandObj.command,data:e.data.commandObj.command,duration:e.data.duration,success:!e.data.err,resultCode:e.data.err?"1":"0",dependencyTypeName:"redis"})}))},t.wp=function(e,n){e?(0===o.length&&r.channel.subscribe("redis",t.qP),o.push(n)):0===(o=o.filter((function(e){return e!=n}))).length&&r.channel.unsubscribe("redis",t.qP)}},454:(e,t,n)=>{"use strict";var r=n(5290),o=n(4953),i=[],s={syslog:function(e){var t={emerg:r.SeverityLevel.Critical,alert:r.SeverityLevel.Critical,crit:r.SeverityLevel.Critical,error:r.SeverityLevel.Error,warning:r.SeverityLevel.Warning,notice:r.SeverityLevel.Information,info:r.SeverityLevel.Information,debug:r.SeverityLevel.Verbose};return void 0===t[e]?r.SeverityLevel.Information:t[e]},npm:function(e){var t={error:r.SeverityLevel.Error,warn:r.SeverityLevel.Warning,info:r.SeverityLevel.Information,verbose:r.SeverityLevel.Verbose,debug:r.SeverityLevel.Verbose,silly:r.SeverityLevel.Verbose};return void 0===t[e]?r.SeverityLevel.Information:t[e]},unknown:function(e){return r.SeverityLevel.Information}},a=function(e){var t=e.data.message;i.forEach((function(n){if(t instanceof Error)n.trackException({exception:t,properties:e.data.meta});else{var r=s[e.data.levelKind](e.data.level);n.trackTrace({message:t,severity:r,properties:e.data.meta})}}))};t.wp=function(e,t){e?(0===i.length&&o.channel.subscribe("winston",a),i.push(t)):0===(i=i.filter((function(e){return e!=t}))).length&&o.channel.unsubscribe("winston",a)}},3580:(e,t)=>{"use strict";var n,r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com",t.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com",t.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com",function(e){e.COMMITTED_BYTES="\\Memory\\Committed Bytes",e.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",e.REQUEST_RATE="\\ApplicationInsights\\Requests/Sec",e.REQUEST_FAILURE_RATE="\\ApplicationInsights\\Requests Failed/Sec",e.REQUEST_DURATION="\\ApplicationInsights\\Request Duration",e.DEPENDENCY_RATE="\\ApplicationInsights\\Dependency Calls/Sec",e.DEPENDENCY_FAILURE_RATE="\\ApplicationInsights\\Dependency Calls Failed/Sec",e.DEPENDENCY_DURATION="\\ApplicationInsights\\Dependency Call Duration",e.EXCEPTION_RATE="\\ApplicationInsights\\Exceptions/Sec"}(n=t.QuickPulseCounter||(t.QuickPulseCounter={})),function(e){e.PRIVATE_BYTES="\\Process(??APP_WIN32_PROC??)\\Private Bytes",e.AVAILABLE_BYTES="\\Memory\\Available Bytes",e.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",e.PROCESS_TIME="\\Process(??APP_WIN32_PROC??)\\% Processor Time",e.REQUEST_RATE="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",e.REQUEST_DURATION="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time"}(r=t.PerformanceCounter||(t.PerformanceCounter={})),t.PerformanceToQuickPulseCounter=((o={})[r.PROCESSOR_TIME]=n.PROCESSOR_TIME,o[r.REQUEST_RATE]=n.REQUEST_RATE,o[r.REQUEST_DURATION]=n.REQUEST_DURATION,o[n.COMMITTED_BYTES]=n.COMMITTED_BYTES,o[n.REQUEST_FAILURE_RATE]=n.REQUEST_FAILURE_RATE,o[n.DEPENDENCY_RATE]=n.DEPENDENCY_RATE,o[n.DEPENDENCY_FAILURE_RATE]=n.DEPENDENCY_FAILURE_RATE,o[n.DEPENDENCY_DURATION]=n.DEPENDENCY_DURATION,o[n.EXCEPTION_RATE]=n.EXCEPTION_RATE,o),t.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability"},t.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument"},t.TelemetryTypeStringToQuickPulseType={EventData:t.QuickPulseType.Event,ExceptionData:t.QuickPulseType.Exception,MessageData:t.QuickPulseType.Trace,MetricData:t.QuickPulseType.Metric,RequestData:t.QuickPulseType.Request,RemoteDependencyData:t.QuickPulseType.Dependency,AvailabilityData:t.QuickPulseType.Availability},t.TelemetryTypeStringToQuickPulseDocumentType={EventData:t.QuickPulseDocumentType.Event,ExceptionData:t.QuickPulseDocumentType.Exception,MessageData:t.QuickPulseDocumentType.Trace,MetricData:t.QuickPulseDocumentType.Metric,RequestData:t.QuickPulseDocumentType.Request,RemoteDependencyData:t.QuickPulseDocumentType.Dependency,AvailabilityData:t.QuickPulseDocumentType.Availability}},9382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9958),o=function(){function e(){}return e.TYPE_HTTP="Http",e.TYPE_AI="Http (tracked component)",e}();t.RemoteDependencyDataConstants=o,t.domainSupportsProperties=function(e){return"properties"in e||e instanceof r.EventData||e instanceof r.ExceptionData||e instanceof r.MessageData||e instanceof r.MetricData||e instanceof r.PageViewData||e instanceof r.RemoteDependencyData||e instanceof r.RequestData}},7220:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n(8934));e.exports=i},4101:e=>{"use strict";e.exports=function(){}},9871:e=>{"use strict";e.exports=function(){this.applicationVersion="ai.application.ver",this.deviceId="ai.device.id",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceOEMName="ai.device.oemName",this.deviceOSVersion="ai.device.osVersion",this.deviceType="ai.device.type",this.locationIp="ai.location.ip",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.userAccountId="ai.user.accountId",this.userId="ai.user.id",this.userAuthUserId="ai.user.authUserId",this.cloudRole="ai.cloud.role",this.cloudRoleInstance="ai.cloud.roleInstance",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"}},320:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(){return e.call(this)||this}return o(t,e),t}(n(4101));e.exports=i},8602:(e,t,n)=>{"use strict";var r=n(495);e.exports=function(){this.kind=r.Measurement}},495:e=>{"use strict";var t;!function(e){e[e.Measurement=0]="Measurement",e[e.Aggregation=1]="Aggregation"}(t||(t={})),e.exports=t},8934:e=>{"use strict";e.exports=function(){}},7300:e=>{"use strict";e.exports=function(){this.ver=1,this.sampleRate=100,this.tags={}}},4526:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n(8934));e.exports=i},935:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.exceptions=[],t.properties={},t.measurements={},t}return o(t,e),t}(n(8934));e.exports=i},8082:e=>{"use strict";e.exports=function(){this.hasFullStack=!0,this.parsedStack=[]}},901:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t}return o(t,e),t}(n(8934));e.exports=i},3092:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.metrics=[],t.properties={},t}return o(t,e),t}(n(8934));e.exports=i},6279:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n(4526));e.exports=i},6290:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.success=!0,t.properties={},t.measurements={},t}return o(t,e),t}(n(8934));e.exports=i},7339:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return o(t,e),t}(n(8934));e.exports=i},9697:e=>{"use strict";var t;!function(e){e[e.Verbose=0]="Verbose",e[e.Information=1]="Information",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e[e.Critical=4]="Critical"}(t||(t={})),e.exports=t},6376:e=>{"use strict";e.exports=function(){}},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvailabilityData=n(7220),t.Base=n(4101),t.ContextTagKeys=n(9871),t.Data=n(320),t.DataPoint=n(8602),t.DataPointType=n(495),t.Domain=n(8934),t.Envelope=n(7300),t.EventData=n(4526),t.ExceptionData=n(935),t.ExceptionDetails=n(8082),t.MessageData=n(901),t.MetricData=n(3092),t.PageViewData=n(6279),t.RemoteDependencyData=n(6290),t.RequestData=n(7339),t.SeverityLevel=n(9697),t.StackFrame=n(6376)},5481:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.telemetryTypeToBaseType=function(e){switch(e){case n.Event:return"EventData";case n.Exception:return"ExceptionData";case n.Trace:return"MessageData";case n.Metric:return"MetricData";case n.Request:return"RequestData";case n.Dependency:return"RemoteDependencyData";case n.Availability:return"AvailabilityData"}},t.baseTypeToTelemetryType=function(e){switch(e){case"EventData":return n.Event;case"ExceptionData":return n.Exception;case"MessageData":return n.Trace;case"MetricData":return n.Metric;case"RequestData":return n.Request;case"RemoteDependencyData":return n.Dependency;case"AvailabilityData":return n.Availability}},t.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData"},function(e){e[e.Event=0]="Event",e[e.Exception=1]="Exception",e[e.Trace=2]="Trace",e[e.Metric=3]="Metric",e[e.Request=4]="Request",e[e.Dependency=5]="Dependency",e[e.Availability=6]="Availability"}(n=t.TelemetryType||(t.TelemetryType={}))},2626:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(5481))},5290:(e,t,n)=>{"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(9382)),r(n(9958)),r(n(2626))},3504:(e,t,n)=>{"use strict";var r=n(5282),o=function(){function e(e,t,n,r){this._buffer=[],this._lastSend=0,this._isDisabled=e,this._getBatchSize=t,this._getBatchIntervalMs=n,this._sender=r}return e.prototype.setUseDiskRetryCaching=function(e,t,n){this._sender.setDiskRetryMode(e,t,n)},e.prototype.send=function(e){var t=this;if(!this._isDisabled())if(e){var n=this._stringify(e);"string"==typeof n&&(this._buffer.push(n),this._buffer.length>=this._getBatchSize()?this.triggerSend(!1):!this._timeoutHandle&&this._buffer.length>0&&(this._timeoutHandle=setTimeout((function(){t._timeoutHandle=null,t.triggerSend(!1)}),this._getBatchIntervalMs())))}else r.warn("Cannot send null/undefined telemetry")},e.prototype.triggerSend=function(e,t){var n=this._buffer.length<1;if(!n){var r=this._buffer.join("\n");e?(this._sender.saveOnCrash(r),"function"==typeof t&&t("data saved on crash")):this._sender.send(Buffer.from?Buffer.from(r):new Buffer(r),t)}this._lastSend=+new Date,this._buffer.length=0,clearTimeout(this._timeoutHandle),this._timeoutHandle=null,n&&"function"==typeof t&&t("no data to send")},e.prototype._stringify=function(e){try{return JSON.stringify(e)}catch(t){r.warn("Failed to serialize payload",t,e)}},e}();e.exports=o},9253:(e,t,n)=>{"use strict";var r=n(9962),o=n(5158),i=n(3580),s=n(7310),a=function(){function e(t){var n=this;this.endpointBase=i.DEFAULT_BREEZE_ENDPOINT;var r=process.env[e.ENV_connectionString],a=o.parse(t),c=o.parse(r),l=!a.instrumentationkey&&Object.keys(a).length>0?null:t;this.instrumentationKey=a.instrumentationkey||l||c.instrumentationkey||e._getInstrumentationKey(),this.endpointUrl=(a.ingestionendpoint||c.ingestionendpoint||this.endpointBase)+"/v2/track",this.maxBatchSize=250,this.maxBatchIntervalMs=15e3,this.disableAppInsights=!1,this.samplingPercentage=100,this.correlationIdRetryIntervalMs=3e4,this.correlationHeaderExcludedDomains=["*.core.windows.net","*.core.chinacloudapi.cn","*.core.cloudapi.de","*.core.usgovcloudapi.net","*.core.microsoft.scloud","*.core.eaglex.ic.gov"],this.setCorrelationId=function(e){return n.correlationId=e},this.proxyHttpUrl=process.env[e.ENV_http_proxy]||void 0,this.proxyHttpsUrl=process.env[e.ENV_https_proxy]||void 0,this.httpAgent=void 0,this.httpsAgent=void 0,this.profileQueryEndpoint=a.ingestionendpoint||c.ingestionendpoint||process.env[e.ENV_profileQueryEndpoint]||this.endpointBase,this._quickPulseHost=a.liveendpoint||c.liveendpoint||process.env[e.ENV_quickPulseHost]||i.DEFAULT_LIVEMETRICS_HOST,this._quickPulseHost.match(/^https?:\/\//)&&(this._quickPulseHost=s.parse(this._quickPulseHost).host)}return Object.defineProperty(e.prototype,"profileQueryEndpoint",{get:function(){return this._profileQueryEndpoint},set:function(e){r.cancelCorrelationIdQuery(this,this.setCorrelationId),this._profileQueryEndpoint=e,this.correlationId=r.correlationIdPrefix,r.queryCorrelationId(this,this.setCorrelationId)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"quickPulseHost",{get:function(){return this._quickPulseHost},set:function(e){this._quickPulseHost=e},enumerable:!0,configurable:!0}),e._getInstrumentationKey=function(){var t=process.env[e.ENV_iKey]||process.env[e.ENV_azurePrefix+e.ENV_iKey]||process.env[e.legacy_ENV_iKey]||process.env[e.ENV_azurePrefix+e.legacy_ENV_iKey];if(!t||""==t)throw new Error("Instrumentation key not found, pass the key in the config to this method or set the key in the environment variable APPINSIGHTS_INSTRUMENTATIONKEY before starting the server");return t},e.ENV_azurePrefix="APPSETTING_",e.ENV_iKey="APPINSIGHTS_INSTRUMENTATIONKEY",e.legacy_ENV_iKey="APPINSIGHTS_INSTRUMENTATION_KEY",e.ENV_profileQueryEndpoint="APPINSIGHTS_PROFILE_QUERY_ENDPOINT",e.ENV_quickPulseHost="APPINSIGHTS_QUICKPULSE_HOST",e.ENV_connectionString="APPLICATIONINSIGHTS_CONNECTION_STRING",e.ENV_nativeMetricsDisablers="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",e.ENV_nativeMetricsDisableAll="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",e.ENV_http_proxy="http_proxy",e.ENV_https_proxy="https_proxy",e}();e.exports=a},5158:(e,t,n)=>{"use strict";var r=n(3580),o=function(){function e(){}return e.parse=function(t){if(!t)return{};var n=t.split(e._FIELDS_SEPARATOR).reduce((function(t,n){var r=n.split(e._FIELD_KEY_VALUE_SEPARATOR);if(2===r.length){var o=r[0].toLowerCase(),i=r[1];t[o]=i}return t}),{});if(Object.keys(n).length>0){if(n.endpointsuffix){var o=n.location?n.location+".":"";n.ingestionendpoint=n.ingestionendpoint||"https://"+o+"dc."+n.endpointsuffix,n.liveendpoint=n.liveendpoint||"https://"+o+"live."+n.endpointsuffix}n.ingestionendpoint=n.ingestionendpoint||r.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||r.DEFAULT_LIVEMETRICS_ENDPOINT}return n},e._FIELDS_SEPARATOR=";",e._FIELD_KEY_VALUE_SEPARATOR="=",e}();e.exports=o},4470:(e,t,n)=>{"use strict";var r=n(2037),o=n(7147),i=n(1017),s=n(5290),a=n(5282),c=function(){function e(e){this.keys=new s.ContextTagKeys,this.tags={},this._loadApplicationContext(),this._loadDeviceContext(),this._loadInternalContext()}return e.prototype._loadApplicationContext=function(t){if(t=t||i.resolve(__dirname,"../../../../package.json"),!e.appVersion[t]){e.appVersion[t]="unknown";try{var n=JSON.parse(o.readFileSync(t,"utf8"));n&&"string"==typeof n.version&&(e.appVersion[t]=n.version)}catch(e){a.info("unable to read app version: ",e)}}this.tags[this.keys.applicationVersion]=e.appVersion[t]},e.prototype._loadDeviceContext=function(){this.tags[this.keys.deviceId]="",this.tags[this.keys.cloudRoleInstance]=r&&r.hostname(),this.tags[this.keys.deviceOSVersion]=r&&r.type()+" "+r.release(),this.tags[this.keys.cloudRole]=e.DefaultRoleName,this.tags["ai.device.osArchitecture"]=r&&r.arch(),this.tags["ai.device.osPlatform"]=r&&r.platform()},e.prototype._loadInternalContext=function(){var t=i.resolve(__dirname,"../../package.json");if(!e.sdkVersion){e.sdkVersion="unknown";try{var n=JSON.parse(o.readFileSync(t,"utf8"));n&&"string"==typeof n.version&&(e.sdkVersion=n.version)}catch(e){a.info("unable to read app version: ",e)}}this.tags[this.keys.internalSdkVersion]="node:"+e.sdkVersion},e.DefaultRoleName="Web",e.appVersion={},e.sdkVersion=null,e}();e.exports=c},9962:(e,t,n)=>{"use strict";var r=n(5740),o=n(5282),i=function(){function e(){}return e.queryCorrelationId=function(t,n){var i=t.profileQueryEndpoint+"/api/profiles/"+t.instrumentationKey+"/appId";if(e.completedLookups.hasOwnProperty(i))n(e.completedLookups[i]);else if(e.pendingLookups[i])e.pendingLookups[i].push(n);else{e.pendingLookups[i]=[n];var s=function(){if(e.pendingLookups[i]){var n={method:"GET",disableAppInsightsAutoCollection:!0};o.info(e.TAG,n);var a=r.makeRequest(t,i,n,(function(n){if(200===n.statusCode){var r="";n.setEncoding("utf-8"),n.on("data",(function(e){r+=e})),n.on("end",(function(){o.info(e.TAG,r);var t=e.correlationIdPrefix+r;e.completedLookups[i]=t,e.pendingLookups[i]&&e.pendingLookups[i].forEach((function(e){return e(t)})),delete e.pendingLookups[i]}))}else n.statusCode>=400&&n.statusCode<500?(e.completedLookups[i]=void 0,delete e.pendingLookups[i]):setTimeout(s,t.correlationIdRetryIntervalMs)}));a&&(a.on("error",(function(t){o.warn(e.TAG,t)})),a.end())}};setTimeout(s,0)}},e.cancelCorrelationIdQuery=function(t,n){var r=t.profileQueryEndpoint+"/api/profiles/"+t.instrumentationKey+"/appId",o=e.pendingLookups[r];o&&(e.pendingLookups[r]=o.filter((function(e){return e!=n})),0==e.pendingLookups[r].length&&delete e.pendingLookups[r])},e.generateRequestId=function(t){if(t){"."!==(t="|"==t[0]?t:"|"+t)[t.length-1]&&(t+=".");var n=(e.currentRootId++).toString(16);return e.appendSuffix(t,n,"_")}return e.generateRootId()},e.getRootId=function(e){var t=e.indexOf(".");t<0&&(t=e.length);var n="|"===e[0]?1:0;return e.substring(n,t)},e.generateRootId=function(){return"|"+r.w3cTraceId()+"."},e.appendSuffix=function(t,n,o){if(t.length+n.length<e.requestIdMaxLength)return t+n+o;var i=e.requestIdMaxLength-9;if(t.length>i)for(;i>1;--i){var s=t[i-1];if("."===s||"_"===s)break}if(i<=1)return e.generateRootId();for(n=r.randomu32().toString(16);n.length<8;)n="0"+n;return t.substring(0,i)+n+"#"},e.TAG="CorrelationIdManager",e.correlationIdPrefix="cid-v1:",e.w3cEnabled=!1,e.pendingLookups={},e.completedLookups={},e.requestIdMaxLength=1024,e.currentRootId=r.randomu32(),e}();e.exports=i},9813:(e,t,n)=>{"use strict";var r=n(5290),o=n(5740),i=n(894),s=function(){function e(){}return e.createEnvelope=function(t,n,i,s,a){var c=null;switch(n){case r.TelemetryType.Trace:c=e.createTraceData(t);break;case r.TelemetryType.Dependency:c=e.createDependencyData(t);break;case r.TelemetryType.Event:c=e.createEventData(t);break;case r.TelemetryType.Exception:c=e.createExceptionData(t);break;case r.TelemetryType.Request:c=e.createRequestData(t);break;case r.TelemetryType.Metric:c=e.createMetricData(t);break;case r.TelemetryType.Availability:c=e.createAvailabilityData(t)}if(i&&r.domainSupportsProperties(c.baseData)){if(c&&c.baseData)if(c.baseData.properties)for(var l in i)c.baseData.properties[l]||(c.baseData.properties[l]=i[l]);else c.baseData.properties=i;c.baseData.properties=o.validateStringMap(c.baseData.properties)}var u=a&&a.instrumentationKey||"",d=new r.Envelope;return d.data=c,d.iKey=u,d.name="Microsoft.ApplicationInsights."+u.replace(/-/g,"")+"."+c.baseType.substr(0,c.baseType.length-4),d.tags=this.getTags(s,t.tagOverrides),d.time=(new Date).toISOString(),d.ver=1,d.sampleRate=a?a.samplingPercentage:100,n===r.TelemetryType.Metric&&(d.sampleRate=100),d},e.createTraceData=function(e){var t=new r.MessageData;t.message=e.message,t.properties=e.properties,isNaN(e.severity)?t.severityLevel=r.SeverityLevel.Information:t.severityLevel=e.severity;var n=new r.Data;return n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Trace),n.baseData=t,n},e.createDependencyData=function(e){var t=new r.RemoteDependencyData;"string"==typeof e.name&&(t.name=e.name.length>1024?e.name.slice(0,1021)+"...":e.name),t.data=e.data,t.target=e.target,t.duration=o.msToTimeSpan(e.duration),t.success=e.success,t.type=e.dependencyTypeName,t.properties=e.properties,t.resultCode=e.resultCode?e.resultCode+"":"",e.id?t.id=e.id:t.id=o.w3cTraceId();var n=new r.Data;return n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Dependency),n.baseData=t,n},e.createEventData=function(e){var t=new r.EventData;t.name=e.name,t.properties=e.properties,t.measurements=e.measurements;var n=new r.Data;return n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Event),n.baseData=t,n},e.createExceptionData=function(e){var t=new r.ExceptionData;t.properties=e.properties,isNaN(e.severity)?t.severityLevel=r.SeverityLevel.Error:t.severityLevel=e.severity,t.measurements=e.measurements,t.exceptions=[];var n=e.exception.stack,i=new r.ExceptionDetails;i.message=e.exception.message,i.typeName=e.exception.name,i.parsedStack=this.parseStack(n),i.hasFullStack=o.isArray(i.parsedStack)&&i.parsedStack.length>0,t.exceptions.push(i);var s=new r.Data;return s.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Exception),s.baseData=t,s},e.createRequestData=function(e){var t=new r.RequestData;e.id?t.id=e.id:t.id=o.w3cTraceId(),t.name=e.name,t.url=e.url,t.source=e.source,t.duration=o.msToTimeSpan(e.duration),t.responseCode=e.resultCode?e.resultCode+"":"",t.success=e.success,t.properties=e.properties;var n=new r.Data;return n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Request),n.baseData=t,n},e.createMetricData=function(e){var t=new r.MetricData;t.metrics=[];var n=new r.DataPoint;n.count=isNaN(e.count)?1:e.count,n.kind=r.DataPointType.Aggregation,n.max=isNaN(e.max)?e.value:e.max,n.min=isNaN(e.min)?e.value:e.min,n.name=e.name,n.stdDev=isNaN(e.stdDev)?0:e.stdDev,n.value=e.value,t.metrics.push(n),t.properties=e.properties;var o=new r.Data;return o.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Metric),o.baseData=t,o},e.createAvailabilityData=function(e){var t=new r.AvailabilityData;e.id?t.id=e.id:t.id=o.w3cTraceId(),t.name=e.name,t.duration=o.msToTimeSpan(e.duration),t.success=e.success,t.runLocation=e.runLocation,t.message=e.message,t.measurements=e.measurements,t.properties=e.properties;var n=new r.Data;return n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Availability),n.baseData=t,n},e.getTags=function(e,t){var n=i.CorrelationContextManager.getCurrentContext(),r={};if(e&&e.tags)for(var o in e.tags)r[o]=e.tags[o];if(t)for(var o in t)r[o]=t[o];return n&&(r[e.keys.operationId]=r[e.keys.operationId]||n.operation.id,r[e.keys.operationName]=r[e.keys.operationName]||n.operation.name,r[e.keys.operationParentId]=r[e.keys.operationParentId]||n.operation.parentId),r},e.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,o=0,i=0;i<=n.length;i++){var s=n[i];if(a.regex.test(s)){var c=new a(n[i],r++);o+=c.sizeInBytes,t.push(c)}}if(o>32768)for(var l=0,u=t.length-1,d=0,p=l,h=u;l<u;){if((d+=t[l].sizeInBytes+t[u].sizeInBytes)>32768){var f=h-p+1;t.splice(p,f);break}p=l,h=u,l++,u--}}return t},e}(),a=function(){function e(t,n){this.sizeInBytes=0,this.level=n,this.method="<no_method>",this.assembly=o.trim(t);var r=t.match(e.regex);r&&r.length>=5&&(this.method=o.trim(r[2])||this.method,this.fileName=o.trim(r[4])||"<no_filename>",this.line=parseInt(r[5])||0),this.sizeInBytes+=this.method.length,this.sizeInBytes+=this.fileName.length,this.sizeInBytes+=this.assembly.length,this.sizeInBytes+=e.baseSize,this.sizeInBytes+=this.level.toString().length,this.sizeInBytes+=this.line.toString().length}return e.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,e.baseSize=58,e}();e.exports=s},5282:e=>{"use strict";var t=function(){function e(){}return e.info=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];e.enableDebug&&console.info(e.TAG+t,n)},e.warn=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];e.disableWarnings||console.warn(e.TAG+t,n)},e.enableDebug=!1,e.disableWarnings=!1,e.disableErrors=!1,e.TAG="ApplicationInsights:",e}();e.exports=t},1259:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=n(7625),s=n(731),a=n(8723),c=n(5282),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.trackNodeHttpRequestSync=function(e){e&&e.request&&e.response&&e.duration?s.trackRequestSync(this,e):c.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},t.prototype.trackNodeHttpRequest=function(e){(e.duration||e.error)&&c.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),e&&e.request&&e.response?s.trackRequest(this,e):c.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},t.prototype.trackNodeHttpDependency=function(e){e&&e.request?a.trackRequest(this,e):c.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},t}(i);e.exports=l},7148:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=n(2037),i=n(5290),s=n(3580),a=n(5740),c=n(5282),l=a.w3cTraceId(),u=function(){function e(){}return e.createQuickPulseEnvelope=function(e,t,n,r){var i=o&&"function"==typeof o.hostname&&o.hostname()||"Unknown",s=r.tags&&r.keys&&r.keys.cloudRoleInstance&&r.tags[r.keys.cloudRoleInstance]||i;return{Documents:t.length>0?t:null,InstrumentationKey:n.instrumentationKey||"",Metrics:e.length>0?e:null,InvariantVersion:1,Timestamp:"/Date("+Date.now()+")/",Version:r.tags[r.keys.internalSdkVersion],StreamId:l,MachineName:i,Instance:s}},e.createQuickPulseMetric=function(e){return{Name:e.name,Value:e.value,Weight:e.count||1}},e.telemetryEnvelopeToQuickPulseDocument=function(t){switch(t.data.baseType){case i.TelemetryTypeString.Event:return e.createQuickPulseEventDocument(t);case i.TelemetryTypeString.Exception:return e.createQuickPulseExceptionDocument(t);case i.TelemetryTypeString.Trace:return e.createQuickPulseTraceDocument(t);case i.TelemetryTypeString.Dependency:return e.createQuickPulseDependencyDocument(t);case i.TelemetryTypeString.Request:return e.createQuickPulseRequestDocument(t)}return null},e.createQuickPulseEventDocument=function(t){var n=e.createQuickPulseDocument(t),o=t.data.baseData.name;return r({},n,{Name:o})},e.createQuickPulseTraceDocument=function(t){var n=e.createQuickPulseDocument(t),o=t.data.baseData.severityLevel||0;return r({},n,{Message:t.data.baseData.message,SeverityLevel:i.SeverityLevel[o]})},e.createQuickPulseExceptionDocument=function(t){var n=e.createQuickPulseDocument(t),o=t.data.baseData.exceptions,i="",s="",a="";return o&&o.length>0&&(o[0].parsedStack&&o[0].parsedStack.length>0?o[0].parsedStack.forEach((function(e){i+=e.assembly+"\n"})):o[0].stack&&o[0].stack.length>0&&(i=o[0].stack),s=o[0].message,a=o[0].typeName),r({},n,{Exception:i,ExceptionMessage:s,ExceptionType:a})},e.createQuickPulseRequestDocument=function(t){var n=e.createQuickPulseDocument(t),o=t.data.baseData;return r({},n,{Name:o.name,Success:o.success,Duration:o.duration,ResponseCode:o.responseCode,OperationName:o.name})},e.createQuickPulseDependencyDocument=function(t){var n=e.createQuickPulseDocument(t),o=t.data.baseData;return r({},n,{Name:o.name,Target:o.target,Success:o.success,Duration:o.duration,ResultCode:o.resultCode,CommandName:o.data,OperationName:n.OperationId,DependencyTypeName:o.type})},e.createQuickPulseDocument=function(t){var n,r;return t.data.baseType?(r=s.TelemetryTypeStringToQuickPulseType[t.data.baseType],n=s.TelemetryTypeStringToQuickPulseDocumentType[t.data.baseType]):c.warn("Document type invalid; not sending live metric document",t.data.baseType),{DocumentType:n,__type:r,OperationId:t.tags[e.keys.operationId],Version:"1.0",Properties:e.aggregateProperties(t)}},e.aggregateProperties=function(e){var t=[],n=e.data.baseData.measurements||{};for(var r in n)if(n.hasOwnProperty(r)){var o={key:r,value:n[r]};t.push(o)}var i=e.data.baseData.properties||{};for(var r in i)i.hasOwnProperty(r)&&(o={key:r,value:i[r]},t.push(o));return t},e.keys=new i.ContextTagKeys,e}();e.exports=u},9184:(e,t,n)=>{"use strict";var r=n(5687),o=n(8723),i=n(5282),s=function(){function e(e){this._config=e,this._consecutiveErrors=0}return e.prototype.ping=function(e,t){this._submitData(e,t,"ping")},e.prototype.post=function(e,t){this._submitData([e],t,"post")},e.prototype._submitData=function(t,n,s){var a,c,l=this,u=JSON.stringify(t),d=((a={})[o.disableCollectionRequestOption]=!0,a.host=this._config.quickPulseHost,a.method="POST",a.path="/QuickPulseService.svc/"+s+"?ikey="+this._config.instrumentationKey,a.headers=((c={Expect:"100-continue"})["x-ms-qps-transmission-time"]=1e4*Date.now(),c["Content-Type"]="application/json",c["Content-Length"]=Buffer.byteLength(u),c),a),p=r.request(d,(function(e){var t="true"===e.headers["x-ms-qps-subscribed"];l._consecutiveErrors=0,n(t,e)}));p.on("error",(function(t){l._consecutiveErrors++;var r="Transient error connecting to the Live Metrics endpoint. This packet will not appear in your Live Metrics Stream. Error:";l._consecutiveErrors%e.MAX_QPS_FAILURES_BEFORE_WARN==0?(r="Live Metrics endpoint could not be reached "+l._consecutiveErrors+" consecutive times. Most recent error:",i.warn(e.TAG,r,t)):i.info(e.TAG,r,t),n()})),p.write(u),p.end()},e.TAG="QuickPulseSender",e.MAX_QPS_FAILURES_BEFORE_WARN=25,e}();e.exports=s},3668:(e,t,n)=>{"use strict";var r=n(5282),o=n(9253),i=n(7148),s=n(9184),a=n(3580),c=n(4470),l=function(){function e(e,t){this._isCollectingData=!1,this._lastSuccessTime=Date.now(),this._lastSendSucceeded=!0,this._metrics={},this._documents=[],this._collectors=[],this.config=new o(e),this.context=t||new c,this._sender=new s(this.config),this._isEnabled=!1}return e.prototype.addCollector=function(e){this._collectors.push(e)},e.prototype.trackMetric=function(e){this._addMetric(e)},e.prototype.addDocument=function(e){var t=i.telemetryEnvelopeToQuickPulseDocument(e);t&&this._documents.push(t)},e.prototype.enable=function(e){e&&!this._isEnabled?(this._isEnabled=!0,this._goQuickPulse()):!e&&this._isEnabled&&(this._isEnabled=!1,clearTimeout(this._handle),this._handle=void 0)},e.prototype.enableCollectors=function(e){this._collectors.forEach((function(t){t.enable(e)}))},e.prototype._addMetric=function(e){var t=e.value,n=e.count||1,r=a.PerformanceToQuickPulseCounter[e.name];r&&(this._metrics[r]?(this._metrics[r].Value=(this._metrics[r].Value*this._metrics[r].Weight+t*n)/(this._metrics[r].Weight+n),this._metrics[r].Weight+=n):(this._metrics[r]=i.createQuickPulseMetric(e),this._metrics[r].Name=r,this._metrics[r].Weight=1))},e.prototype._resetQuickPulseBuffer=function(){delete this._metrics,this._metrics={},this._documents.length=0},e.prototype._goQuickPulse=function(){var t=this,n=Object.keys(this._metrics).map((function(e){return t._metrics[e]})),r=i.createQuickPulseEnvelope(n,this._documents.slice(),this.config,this.context);this._resetQuickPulseBuffer(),this._isCollectingData?this._post(r):this._ping(r);var o=this._isCollectingData?e.POST_INTERVAL:e.PING_INTERVAL;this._isCollectingData&&Date.now()-this._lastSuccessTime>=e.MAX_POST_WAIT_TIME&&!this._lastSendSucceeded?(this._isCollectingData=!1,o=e.FALLBACK_INTERVAL):!this._isCollectingData&&Date.now()-this._lastSuccessTime>=e.MAX_PING_WAIT_TIME&&!this._lastSendSucceeded&&(o=e.FALLBACK_INTERVAL),this._lastSendSucceeded=null,this._handle=setTimeout(this._goQuickPulse.bind(this),o),this._handle.unref()},e.prototype._ping=function(e){this._sender.ping(e,this._quickPulseDone.bind(this))},e.prototype._post=function(e){this._sender.post(e,this._quickPulseDone.bind(this))},e.prototype._quickPulseDone=function(e,t){null!=e?(this._isCollectingData!==e&&(r.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,t&&t.statusCode<300&&t.statusCode>=200?(this._lastSuccessTime=Date.now(),this._lastSendSucceeded=!0):this._lastSendSucceeded=!1):this._lastSendSucceeded=!1},e.MAX_POST_WAIT_TIME=2e4,e.MAX_PING_WAIT_TIME=6e4,e.FALLBACK_INTERVAL=6e4,e.PING_INTERVAL=5e3,e.POST_INTERVAL=1e3,e}();e.exports=l},9036:e=>{"use strict";e.exports={requestContextHeader:"request-context",requestContextSourceKey:"appId",requestContextTargetKey:"appId",requestIdHeader:"request-id",parentIdHeader:"x-ms-request-id",rootIdHeader:"x-ms-request-root-id",correlationContextHeader:"correlation-context",traceparentHeader:"traceparent",traceStateHeader:"tracestate"}},2588:(e,t,n)=>{"use strict";var r=n(7147),o=n(2037),i=n(1017),s=n(9796),a=n(2081),c=n(5282),l=n(8723),u=n(5740),d=function(){function e(t,n,o){if(this._config=t,this._onSuccess=n,this._onError=o,this._enableDiskRetryMode=!1,this._resendInterval=e.WAIT_BETWEEN_RESEND,this._maxBytesOnDisk=e.MAX_BYTES_ON_DISK,this._numConsecutiveFailures=0,!e.OS_PROVIDES_FILE_PROTECTION)if(e.USE_ICACLS){try{e.OS_PROVIDES_FILE_PROTECTION=r.existsSync(e.ICACLS_PATH)}catch(e){}e.OS_PROVIDES_FILE_PROTECTION||c.warn(e.TAG,"Could not find ICACLS in expected location! This is necessary to use disk retry mode on Windows.")}else e.OS_PROVIDES_FILE_PROTECTION=!0}return e.prototype.setDiskRetryMode=function(t,n,r){this._enableDiskRetryMode=e.OS_PROVIDES_FILE_PROTECTION&&t,"number"==typeof n&&n>=0&&(this._resendInterval=Math.floor(n)),"number"==typeof r&&r>=0&&(this._maxBytesOnDisk=Math.floor(r)),t&&!e.OS_PROVIDES_FILE_PROTECTION&&(this._enableDiskRetryMode=!1,c.warn(e.TAG,"Ignoring request to enable disk retry mode. Sufficient file protection capabilities were not detected."))},e.prototype.send=function(t,n){var r=this,o=this._config.endpointUrl,i={method:"POST",withCredentials:!1,headers:{"Content-Type":"application/x-json-stream"}};s.gzip(t,(function(s,a){var d=a;s?(c.warn(s),d=t,i.headers["Content-Length"]=t.length.toString()):(i.headers["Content-Encoding"]="gzip",i.headers["Content-Length"]=a.length),c.info(e.TAG,i),i[l.disableCollectionRequestOption]=!0;var p=u.makeRequest(r._config,o,i,(function(o){o.setEncoding("utf-8");var i="";o.on("data",(function(e){i+=e})),o.on("end",(function(){r._numConsecutiveFailures=0,c.info(e.TAG,i),"function"==typeof r._onSuccess&&r._onSuccess(i),"function"==typeof n&&n(i),r._enableDiskRetryMode&&(200===o.statusCode?setTimeout((function(){return r._sendFirstFileOnDisk()}),r._resendInterval).unref():408!==o.statusCode&&429!==o.statusCode&&439!==o.statusCode&&500!==o.statusCode&&503!==o.statusCode||r._storeToDisk(t))}))}));p.on("error",(function(o){if(r._numConsecutiveFailures++,!r._enableDiskRetryMode||r._numConsecutiveFailures>0&&r._numConsecutiveFailures%e.MAX_CONNECTION_FAILURES_BEFORE_WARN==0){var i="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";r._enableDiskRetryMode&&(i="Ingestion endpoint could not be reached "+r._numConsecutiveFailures+" consecutive times. There may be resulting telemetry loss. Most recent error:"),c.warn(e.TAG,i,o)}else i="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:",c.info(e.TAG,i,o);if(r._onErrorHelper(o),"function"==typeof n){var s="error sending telemetry";o&&"function"==typeof o.toString&&(s=o.toString()),n(s)}r._enableDiskRetryMode&&r._storeToDisk(t)})),p.write(d),p.end()}))},e.prototype.saveOnCrash=function(e){this._enableDiskRetryMode&&this._storeToDiskSync(e)},e.prototype._runICACLS=function(t,n){var r=a.spawn(e.ICACLS_PATH,t,{windowsHide:!0});r.on("error",(function(e){return n(e)})),r.on("close",(function(e,t){return n(0===e?null:new Error("Setting ACL restrictions did not succeed (ICACLS returned code "+e+")"))}))},e.prototype._runICACLSSync=function(t){if(!a.spawnSync)throw new Error("Could not synchronously call ICACLS under current version of Node.js");var n=a.spawnSync(e.ICACLS_PATH,t,{windowsHide:!0});if(n.error)throw n.error;if(0!==n.status)throw new Error("Setting ACL restrictions did not succeed (ICACLS returned code "+n.status+")")},e.prototype._getACLIdentity=function(t){if(e.ACL_IDENTITY)return t(null,e.ACL_IDENTITY);var n=a.spawn(e.POWERSHELL_PATH,["-Command","[System.Security.Principal.WindowsIdentity]::GetCurrent().Name"],{windowsHide:!0,stdio:["ignore","pipe","pipe"]}),r="";n.stdout.on("data",(function(e){return r+=e})),n.on("error",(function(e){return t(e,null)})),n.on("close",(function(n,o){return e.ACL_IDENTITY=r&&r.trim(),t(0===n?null:new Error("Getting ACL identity did not succeed (PS returned code "+n+")"),e.ACL_IDENTITY)}))},e.prototype._getACLIdentitySync=function(){if(e.ACL_IDENTITY)return e.ACL_IDENTITY;if(a.spawnSync){var t=a.spawnSync(e.POWERSHELL_PATH,["-Command","[System.Security.Principal.WindowsIdentity]::GetCurrent().Name"],{windowsHide:!0,stdio:["ignore","pipe","pipe"]});if(t.error)throw t.error;if(0!==t.status)throw new Error("Getting ACL identity did not succeed (PS returned code "+t.status+")");return e.ACL_IDENTITY=t.stdout&&t.stdout.toString().trim(),e.ACL_IDENTITY}throw new Error("Could not synchronously get ACL identity under current version of Node.js")},e.prototype._getACLArguments=function(e,t){return[e,"/grant","*S-1-5-32-544:(OI)(CI)F","/grant",t+":(OI)(CI)F","/inheritance:r"]},e.prototype._applyACLRules=function(t,n){var r=this;return e.USE_ICACLS?void 0!==e.ACLED_DIRECTORIES[t]?n(e.ACLED_DIRECTORIES[t]?null:new Error("Setting ACL restrictions did not succeed (cached result)")):(e.ACLED_DIRECTORIES[t]=!1,void this._getACLIdentity((function(o,i){if(o)return e.ACLED_DIRECTORIES[t]=!1,n(o);r._runICACLS(r._getACLArguments(t,i),(function(r){return e.ACLED_DIRECTORIES[t]=!r,n(r)}))}))):n(null)},e.prototype._applyACLRulesSync=function(t){if(e.USE_ICACLS){if(void 0===e.ACLED_DIRECTORIES[t])return this._runICACLSSync(this._getACLArguments(t,this._getACLIdentitySync())),void(e.ACLED_DIRECTORIES[t]=!0);if(!e.ACLED_DIRECTORIES[t])throw new Error("Setting ACL restrictions did not succeed (cached result)")}},e.prototype._confirmDirExists=function(e,t){var n=this;r.lstat(e,(function(o,i){o&&"ENOENT"===o.code?r.mkdir(e,(function(r){r&&"EEXIST"!==r.code?t(r):n._applyACLRules(e,t)})):!o&&i.isDirectory()?n._applyACLRules(e,t):t(o||new Error("Path existed but was not a directory"))}))},e.prototype._getShallowDirectorySize=function(e,t){r.readdir(e,(function(n,o){if(n)return t(n,-1);var s=null,a=0,c=0;if(0!==o.length)for(var l=0;l<o.length;l++)r.stat(i.join(e,o[l]),(function(e,n){c++,e?s=e:n.isFile()&&(a+=n.size),c===o.length&&t(s,s?-1:a)}));else t(null,0)}))},e.prototype._getShallowDirectorySizeSync=function(e){for(var t=r.readdirSync(e),n=0,o=0;o<t.length;o++)n+=r.statSync(i.join(e,t[o])).size;return n},e.prototype._storeToDisk=function(t){var n=this,s=i.join(o.tmpdir(),e.TEMPDIR_PREFIX+this._config.instrumentationKey);c.info(e.TAG,"Checking existance of data storage directory: "+s),this._confirmDirExists(s,(function(o){if(o)return c.warn(e.TAG,"Error while checking/creating directory: "+(o&&o.message)),void n._onErrorHelper(o);n._getShallowDirectorySize(s,(function(o,a){if(o||a<0)return c.warn(e.TAG,"Error while checking directory size: "+(o&&o.message)),void n._onErrorHelper(o);if(a>n._maxBytesOnDisk)c.warn(e.TAG,"Not saving data due to max size limit being met. Directory size in bytes is: "+a);else{var l=(new Date).getTime()+".ai.json",u=i.join(s,l);c.info(e.TAG,"saving data to disk at: "+u),r.writeFile(u,t,{mode:384},(function(e){return n._onErrorHelper(e)}))}}))}))},e.prototype._storeToDiskSync=function(t){var n=i.join(o.tmpdir(),e.TEMPDIR_PREFIX+this._config.instrumentationKey);try{c.info(e.TAG,"Checking existance of data storage directory: "+n),r.existsSync(n)||r.mkdirSync(n),this._applyACLRulesSync(n);var s=this._getShallowDirectorySizeSync(n);if(s>this._maxBytesOnDisk)return void c.info(e.TAG,"Not saving data due to max size limit being met. Directory size in bytes is: "+s);var a=(new Date).getTime()+".ai.json",l=i.join(n,a);c.info(e.TAG,"saving data before crash to disk at: "+l),r.writeFileSync(l,t,{mode:384})}catch(t){c.warn(e.TAG,"Error while saving data to disk: "+(t&&t.message)),this._onErrorHelper(t)}},e.prototype._sendFirstFileOnDisk=function(){var t=this,n=i.join(o.tmpdir(),e.TEMPDIR_PREFIX+this._config.instrumentationKey);r.exists(n,(function(e){e&&r.readdir(n,(function(e,o){if(e)t._onErrorHelper(e);else if((o=o.filter((function(e){return i.basename(e).indexOf(".ai.json")>-1}))).length>0){var s=o[0],a=i.join(n,s);r.readFile(a,(function(e,n){e?t._onErrorHelper(e):r.unlink(a,(function(e){e?t._onErrorHelper(e):t.send(n)}))}))}}))}))},e.prototype._onErrorHelper=function(e){"function"==typeof this._onError&&this._onError(e)},e.TAG="Sender",e.ICACLS_PATH=process.env.systemdrive+"/windows/system32/icacls.exe",e.POWERSHELL_PATH=process.env.systemdrive+"/windows/system32/windowspowershell/v1.0/powershell.exe",e.ACLED_DIRECTORIES={},e.ACL_IDENTITY=null,e.WAIT_BETWEEN_RESEND=6e4,e.MAX_BYTES_ON_DISK=5e7,e.MAX_CONNECTION_FAILURES_BEFORE_WARN=5,e.TEMPDIR_PREFIX="appInsights-node",e.OS_PROVIDES_FILE_PROTECTION=!1,e.USE_ICACLS="Windows_NT"===o.type(),e}();e.exports=d},7625:(e,t,n)=>{"use strict";var r=n(7310),o=n(9253),i=n(4470),s=n(5290),a=n(3504),c=n(9428),l=n(894),u=n(2588),d=n(5740),p=n(5282),h=n(9813),f=function(){function e(e){this._telemetryProcessors=[];var t=new o(e);this.config=t,this.context=new i,this.commonProperties={};var n=new u(this.config);this.channel=new a((function(){return t.disableAppInsights}),(function(){return t.maxBatchSize}),(function(){return t.maxBatchIntervalMs}),n)}return e.prototype.trackAvailability=function(e){this.track(e,s.TelemetryType.Availability)},e.prototype.trackTrace=function(e){this.track(e,s.TelemetryType.Trace)},e.prototype.trackMetric=function(e){this.track(e,s.TelemetryType.Metric)},e.prototype.trackException=function(e){e&&e.exception&&!d.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,s.TelemetryType.Exception)},e.prototype.trackEvent=function(e){this.track(e,s.TelemetryType.Event)},e.prototype.trackRequest=function(e){this.track(e,s.TelemetryType.Request)},e.prototype.trackDependency=function(e){e&&!e.target&&e.data&&(e.target=r.parse(e.data).host),this.track(e,s.TelemetryType.Dependency)},e.prototype.flush=function(e){this.channel.triggerSend(!!e&&!!e.isAppCrashing,e?e.callback:void 0)},e.prototype.track=function(e,t){if(e&&s.telemetryTypeToBaseType(t)){var n=h.createEnvelope(e,t,this.commonProperties,this.context,this.config);e.time&&(n.time=e.time.toISOString());var r=this.runTelemetryProcessors(n,e.contextObjects);r=r&&c.samplingTelemetryProcessor(n,{correlationContext:l.CorrelationContextManager.getCurrentContext()}),c.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),r&&this.channel.send(n)}else p.warn("track() requires telemetry object and telemetryType to be specified.")},e.prototype.addTelemetryProcessor=function(e){this._telemetryProcessors.push(e)},e.prototype.clearTelemetryProcessors=function(){this._telemetryProcessors=[]},e.prototype.runTelemetryProcessors=function(e,t){var n=!0,r=this._telemetryProcessors.length;if(0===r)return n;(t=t||{}).correlationContext=l.CorrelationContextManager.getCurrentContext();for(var o=0;o<r;++o)try{var i=this._telemetryProcessors[o];if(i&&!1===i.apply(null,[e,t])){n=!1;break}}catch(t){n=!0,p.warn("One of telemetry processors failed, telemetry item will be sent.",t,e)}return n},e}();e.exports=f},8090:(e,t,n)=>{"use strict";var r=n(5740),o=n(9962),i=function(){function e(t,n){if(this.traceFlag=e.DEFAULT_TRACE_FLAG,this.version=e.DEFAULT_VERSION,t&&"string"==typeof t)if(t.split(",").length>1)this.traceId=r.w3cTraceId(),this.spanId=r.w3cTraceId().substr(0,16);else{var i=t.trim().split("-"),s=i.length;s>=4?(this.version=i[0],this.traceId=i[1],this.spanId=i[2],this.traceFlag=i[3]):(this.traceId=r.w3cTraceId(),this.spanId=r.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=e.DEFAULT_VERSION,this.traceId=r.w3cTraceId()),"00"===this.version&&4!==s&&(this.traceId=r.w3cTraceId(),this.spanId=r.w3cTraceId().substr(0,16)),"ff"===this.version&&(this.version=e.DEFAULT_VERSION,this.traceId=r.w3cTraceId(),this.spanId=r.w3cTraceId().substr(0,16)),this.version.match(/^0[0-9a-f]$/g)||(this.version=e.DEFAULT_VERSION),this.traceFlag.match(/^[0-9a-f]{2}$/g)||(this.traceFlag=e.DEFAULT_TRACE_FLAG,this.traceId=r.w3cTraceId()),e.isValidTraceId(this.traceId)||(this.traceId=r.w3cTraceId()),e.isValidSpanId(this.spanId)||(this.spanId=r.w3cTraceId().substr(0,16),this.traceId=r.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(n){this.parentId=n.slice();var a=o.getRootId(n);e.isValidTraceId(a)||(this.legacyRootId=a,a=r.w3cTraceId()),-1!==n.indexOf("|")&&(n=n.substring(1+n.substring(0,n.length-1).lastIndexOf("."),n.length-1)),this.traceId=a,this.spanId=n}else this.traceId=r.w3cTraceId(),this.spanId=r.w3cTraceId().substr(0,16)}return e.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&"00000000000000000000000000000000"!==e},e.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&"0000000000000000"!==e},e.prototype.getBackCompatRequestId=function(){return"|"+this.traceId+"."+this.spanId+"."},e.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag},e.prototype.updateSpanId=function(){this.spanId=r.w3cTraceId().substr(0,16)},e.DEFAULT_TRACE_FLAG="01",e.DEFAULT_VERSION="00",e}();e.exports=i},1974:e=>{"use strict";var t=function(){function e(e){this.fieldmap=[],e&&(this.fieldmap=this.parseHeader(e))}return e.prototype.toString=function(){var e=this.fieldmap;return e&&0!=e.length?e.join(", "):null},e.validateKeyChars=function(e){var t=e.split("@");if(2==t.length){var n=t[0].trim(),r=t[1].trim(),o=Boolean(n.match(/^[\ ]?[a-z0-9\*\-\_/]{1,241}$/)),i=Boolean(r.match(/^[\ ]?[a-z0-9\*\-\_/]{1,14}$/));return o&&i}return 1==t.length&&Boolean(e.match(/^[\ ]?[a-z0-9\*\-\_/]{1,256}$/))},e.prototype.parseHeader=function(t){var n=[],r={},o=t.split(",");if(o.length>32)return null;for(var i=0,s=o;i<s.length;i++){var a=s[i].trim();if(0!==a.length){var c=a.split("=");if(2!==c.length)return null;if(!e.validateKeyChars(c[0]))return null;if(r[c[0]])return null;r[c[0]]=!0,n.push(a)}}return n},e.strict=!0,e}();e.exports=t},5740:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=n(3685),i=n(5687),s=n(7310),a=n(2057),c=n(5282),l=n(9036),u=function(){function e(){}return e.getCookie=function(t,n){var r="";if(t&&t.length&&"string"==typeof n)for(var o=t+"=",i=n.split(";"),s=0;s<i.length;s++)if(n=i[s],(n=e.trim(n))&&0===n.indexOf(o)){r=n.substring(o.length,i[s].length);break}return r},e.trim=function(e){return"string"==typeof e?e.replace(/^\s+|\s+$/g,""):""},e.int32ArrayToBase64=function(e){var t=function(e,t){return String.fromCharCode(e>>t&255)},n=e.map((function(e){return t(e,24)+t(e,16)+t(e,8)+t(e,0)})).join(""),r=(Buffer.from?Buffer.from(n,"binary"):new Buffer(n,"binary")).toString("base64");return r.substr(0,r.indexOf("="))},e.random32=function(){return 4294967296*Math.random()|0},e.randomu32=function(){return e.random32()+2147483648},e.w3cTraceId=function(){for(var t,n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r="",o=0;o<4;o++)r+=n[15&(t=e.random32())]+n[t>>4&15]+n[t>>8&15]+n[t>>12&15]+n[t>>16&15]+n[t>>20&15]+n[t>>24&15]+n[t>>28&15];var i=n[8+4*Math.random()|0];return r.substr(0,8)+r.substr(9,4)+"4"+r.substr(13,3)+i+r.substr(16,3)+r.substr(19,12)},e.isValidW3CId=function(e){return 32===e.length&&"00000000000000000000000000000000"!==e},e.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},e.isError=function(e){return e instanceof Error},e.isPrimitive=function(e){var t=typeof e;return"string"===t||"number"===t||"boolean"===t},e.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},e.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=(e/1e3%60).toFixed(7).replace(/0{0,4}$/,""),n=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,o=Math.floor(e/864e5);return t=t.indexOf(".")<2?"0"+t:t,n=n.length<2?"0"+n:n,(o>0?o+".":"")+(r=r.length<2?"0"+r:r)+":"+n+":"+t},e.extractError=function(e){var t=e;return{message:e.message,code:t.code||t.id||""}},e.extractObject=function(t){return t instanceof Error?e.extractError(t):"function"==typeof t.toJSON?t.toJSON():t},e.validateStringMap=function(t){if("object"==typeof t){var n={};for(var r in t){var o="",i=t[r],s=typeof i;if(e.isPrimitive(i))o=i.toString();else if(null===i||"undefined"===s)o="";else{if("function"===s){c.info("key: "+r+" was function; will not serialize");continue}var a=e.isArray(i)?i:e.extractObject(i);try{o=e.isPrimitive(a)?a:JSON.stringify(a)}catch(e){o=i.constructor.name.toString()+" (Error: "+e.message+")",c.info("key: "+r+", could not be serialized")}}n[r]=o.substring(0,e.MAX_PROPERTY_LENGTH)}return n}c.info("Invalid properties dropped from payload")},e.canIncludeCorrelationHeader=function(e,t){var n=e&&e.config&&e.config.correlationHeaderExcludedDomains;if(!n||0==n.length||!t)return!0;for(var r=0;r<n.length;r++)if(new RegExp(n[r].replace(/\./g,".").replace(/\*/g,".*")).test(s.parse(t).hostname))return!1;return!0},e.getCorrelationContextTarget=function(e,t){var n=e.headers&&e.headers[l.requestContextHeader];if(n)for(var r=n.split(","),o=0;o<r.length;++o){var i=r[o].split("=");if(2==i.length&&i[0]==t)return i[1]}},e.makeRequest=function(t,n,a,l){n&&0===n.indexOf("//")&&(n="https:"+n);var u=s.parse(n),d=r({},a,{host:u.hostname,port:u.port,path:u.pathname}),p=void 0;if("https:"===u.protocol&&(p=t.proxyHttpsUrl||void 0),"http:"===u.protocol&&(p=t.proxyHttpUrl||void 0),p){0===p.indexOf("//")&&(p="http:"+p);var h=s.parse(p);"https:"===h.protocol?(c.info("Proxies that use HTTPS are not supported"),p=void 0):d=r({},d,{host:h.hostname,port:h.port||"80",path:n,headers:r({},d.headers,{Host:u.hostname})})}var f="https:"===u.protocol&&!p;return f&&void 0!==t.httpsAgent?d.agent=t.httpsAgent:f||void 0===t.httpAgent?f&&(d.agent=e.tlsRestrictedAgent):d.agent=t.httpAgent,f?i.request(d,l):o.request(d,l)},e.safeIncludeCorrelationHeader=function(t,n,r){var o;if("string"==typeof r)o=r;else if(r instanceof Array)o=r.join(",");else if(r&&"function"==typeof r.toString)try{o=r.toString()}catch(e){c.warn("Outgoing request-context header could not be read. Correlation of requests may be lost.",e,r)}o?e.addCorrelationIdHeaderFromString(t,n,o):n.setHeader(l.requestContextHeader,l.requestContextSourceKey+"="+t.config.correlationId)},e.addCorrelationIdHeaderFromString=function(e,t,n){var r=n.split(","),o=l.requestContextSourceKey+"=";r.some((function(e){return e.substring(0,o.length)===o}))||t.setHeader(l.requestContextHeader,n+","+l.requestContextSourceKey+"="+e.config.correlationId)},e.MAX_PROPERTY_LENGTH=8192,e.tlsRestrictedAgent=new i.Agent({secureOptions:a.SSL_OP_NO_SSLv2|a.SSL_OP_NO_SSLv3|a.SSL_OP_NO_TLSv1|a.SSL_OP_NO_TLSv1_1}),e}();e.exports=u},4127:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4350),o=n(5290);t.performanceMetricsTelemetryProcessor=function(e,t){switch(t&&t.addDocument(e),e.data.baseType){case o.TelemetryTypeString.Exception:r.countException();break;case o.TelemetryTypeString.Request:var n=e.data.baseData;r.countRequest(n.duration,n.success);break;case o.TelemetryTypeString.Dependency:var i=e.data.baseData;r.countDependency(i.duration,i.success)}return!0}},608:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5290);function o(e){var t=2147483647,n=5381;if(!e)return 0;for(;e.length<8;)e+=e;for(var r=0;r<e.length;r++)n=((n<<5)+n|0)+e.charCodeAt(r)|0;return(n=n<=-2147483648?t:Math.abs(n))/t*100}t.samplingTelemetryProcessor=function(e,t){var n=e.sampleRate;return null==n||n>=100||!(!e.data||r.TelemetryType.Metric!==r.baseTypeToTelemetryType(e.data.baseType))||(t.correlationContext&&t.correlationContext.operation?o(t.correlationContext.operation.id)<n:100*Math.random()<n)},t.getSamplingHashCode=o},9428:(e,t,n)=>{"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(608)),r(n(4127))},9574:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(894),i=n(6281),s=n(6639),a=n(4350),c=n(8723),l=n(731),u=n(9962),d=n(5282),p=n(3668),h=n(1629);t.TelemetryClient=n(1259),t.Contracts=n(5290),function(e){e[e.AI=0]="AI",e[e.AI_AND_W3C=1]="AI_AND_W3C"}(r=t.DistributedTracingModes||(t.DistributedTracingModes={}));var f,m,g,_,y,v,b,w,x,E=!0,C=!1,S=!0,T=!0,k=!0,I=!0,P=!0,A=!0,O=!1,N=!0,R=void 0,M=void 0,L=!1;function $(){return t.defaultClient?(L=!0,g.enable(E,C),_.enable(S),y.enable(T),v.enable(N,m),b.useAutoCorrelation(A,f),b.enable(k),w.enable(I),t.liveMetricsClient&&O&&t.liveMetricsClient.enable(O)):d.warn("Start cannot be called before setup"),D}t.setup=function(e){return t.defaultClient?d.info("The default client is already setup"):(t.defaultClient=new t.TelemetryClient(e),g=new i(t.defaultClient),_=new s(t.defaultClient),y=new a(t.defaultClient),b=new l(t.defaultClient),w=new c(t.defaultClient),v||(v=new h.AutoCollectNativePerformance(t.defaultClient))),t.defaultClient&&t.defaultClient.channel&&t.defaultClient.channel.setUseDiskRetryCaching(P,R,M),D},t.start=$,t.getCorrelationContext=function(){return A?o.CorrelationContextManager.getCurrentContext():null},t.wrapWithCorrelationContext=function(e){return o.CorrelationContextManager.wrapCallback(e)};var D=function(){function e(){}return e.setDistributedTracingMode=function(t){return u.w3cEnabled=t===r.AI_AND_W3C,e},e.setAutoCollectConsole=function(t,n){return void 0===n&&(n=!1),E=t,C=n,L&&g.enable(t,n),e},e.setAutoCollectExceptions=function(t){return S=t,L&&_.enable(t),e},e.setAutoCollectPerformance=function(t,n){void 0===n&&(n=!0),T=t;var r=h.AutoCollectNativePerformance.parseEnabled(n);return N=r.isEnabled,m=r.disabledMetrics,L&&(y.enable(t),v.enable(r.isEnabled,r.disabledMetrics)),e},e.setAutoCollectRequests=function(t){return k=t,L&&b.enable(t),e},e.setAutoCollectDependencies=function(t){return I=t,L&&w.enable(t),e},e.setAutoDependencyCorrelation=function(t,n){return A=t,f=n,L&&b.useAutoCorrelation(t,n),e},e.setUseDiskRetryCaching=function(n,r,o){return P=n,R=r,M=o,t.defaultClient&&t.defaultClient.channel&&t.defaultClient.channel.setUseDiskRetryCaching(n,r,o),e},e.setInternalLogging=function(t,n){return void 0===t&&(t=!1),void 0===n&&(n=!0),d.enableDebug=t,d.disableWarnings=!n,e},e.setSendLiveMetrics=function(n){return void 0===n&&(n=!1),t.defaultClient?(!t.liveMetricsClient&&n?(t.liveMetricsClient=new p(t.defaultClient.config.instrumentationKey),x=new a(t.liveMetricsClient,1e3,!0),t.liveMetricsClient.addCollector(x),t.defaultClient.quickPulseClient=t.liveMetricsClient):t.liveMetricsClient&&t.liveMetricsClient.enable(n),O=n,e):(d.warn("Live metrics client cannot be setup without the default client"),e)},e.start=$,e}();t.Configuration=D,t.dispose=function(){t.defaultClient=null,L=!1,g&&g.dispose(),_&&_.dispose(),y&&y.dispose(),v&&v.dispose(),b&&b.dispose(),w&&w.dispose(),t.liveMetricsClient&&(t.liveMetricsClient.enable(!1),O=!1,t.liveMetricsClient=void 0)}},9822:(e,t,n)=>{"use strict";const r=process.binding("async_wrap"),o=r.Providers.TIMERWRAP,i={nextTick:n(3269),promise:n(9565),timers:n(7190)},s=new Set;function a(){this.enabled=!1,this.counter=0}function c(){const e=this.initFns=[],t=this.preFns=[],n=this.postFns=[],r=this.destroyFns=[];this.init=function(t,n,r,i){if(n!==o)for(const o of e)o(t,this,n,r,i);else s.add(t)},this.pre=function(e){if(!s.has(e))for(const n of t)n(e,this)},this.post=function(e,t){if(!s.has(e))for(const r of n)r(e,this,t)},this.destroy=function(e){if(s.has(e))s.delete(e);else for(const t of r)t(e)}}function l(e,t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}function u(){this._state=new a,this._hooks=new c,this.version=n(6157).i8,this.providers=r.Providers;for(const e of Object.keys(i))i[e].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),r.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}c.prototype.add=function(e){e.init&&this.initFns.push(e.init),e.pre&&this.preFns.push(e.pre),e.post&&this.postFns.push(e.post),e.destroy&&this.destroyFns.push(e.destroy)},c.prototype.remove=function(e){e.init&&l(this.initFns,e.init),e.pre&&l(this.preFns,e.pre),e.post&&l(this.postFns,e.post),e.destroy&&l(this.destroyFns,e.destroy)},e.exports=u,u.prototype.addHooks=function(e){this._hooks.add(e)},u.prototype.removeHooks=function(e){this._hooks.remove(e)},u.prototype.enable=function(){this._state.enabled=!0,r.enable()},u.prototype.disable=function(){this._state.enabled=!1,r.disable()}},3223:(e,t,n)=>{"use strict";const r=n(9822);if(global._asyncHook){if(global._asyncHook.version!==n(6157).i8)throw new Error("Conflicting version of async-hook-jl found");e.exports=global._asyncHook}else n(2512).filter.attach((function(e,t){return t.filter((function(e){const t=e.getFileName();return!(t&&t.slice(0,__dirname.length)===__dirname)}))})),e.exports=global._asyncHook=new r},3269:e=>{"use strict";function t(){}e.exports=function(){const e=this._hooks,n=this._state,r=process.nextTick;process.nextTick=function(){if(!n.enabled)return r.apply(process,arguments);const o=new Array(arguments.length);for(let e=0;e<arguments.length;e++)o[e]=arguments[e];const i=o[0];if("function"!=typeof i)throw new TypeError("callback is not a function");const s=new t,a=--n.counter;return e.init.call(s,a,0,null,null),o[0]=function(){e.pre.call(s,a);let t=!0;try{i.apply(this,arguments),t=!1}finally{t&&process.listenerCount("uncaughtException")>0&&process.once("uncaughtException",(function(){e.post.call(s,a,!0),e.destroy.call(null,a)}))}e.post.call(s,a,!1),e.destroy.call(null,a)},r.apply(process,o)}}},9565:e=>{"use strict";function t(){}e.exports=function(){const e=this._hooks,n=this._state,r=global.Promise,o=r.prototype.then;function i(t,n,r,o){return"function"!=typeof t?o?function(t){return function(n){return e.destroy.call(null,t),n}}(r):function(t){return function(n){throw e.destroy.call(null,t),n}}(r):function(){e.pre.call(n,r);try{return t.apply(this,arguments)}finally{e.post.call(n,r,!1),e.destroy.call(null,r)}}}r.prototype.then=function(r,s){if(!n.enabled)return o.call(this,r,s);const a=new t,c=--n.counter;return e.init.call(a,c,0,null,null),o.call(this,i(r,a,c,!0),i(s,a,c,!1))}}},7190:(e,t,n)=>{"use strict";const r=n(9512);function o(){}function i(){}function s(){}const a=new Map,c=new Map,l=new Map;let u=null,d=!1;function p(e,t,n,o,i,s,a){const c=r[n],l=r[o];r[n]=function(){if(!t.enabled)return c.apply(r,arguments);const n=new Array(arguments.length);for(let e=0;e<arguments.length;e++)n[e]=arguments[e];const o=n[0];if("function"!=typeof o)throw new TypeError('"callback" argument must be a function');const l=new i,p=--t.counter;let h;return e.init.call(l,p,0,null,null),n[0]=function(){u=h,e.pre.call(l,p);let t=!0;try{o.apply(this,arguments),t=!1}finally{t&&process.listenerCount("uncaughtException")>0&&process.once("uncaughtException",(function(){e.post.call(l,p,!0),s.delete(h),e.destroy.call(null,p)}))}e.post.call(l,p,!1),u=null,(a||d)&&(d=!1,s.delete(h),e.destroy.call(null,p))},h=c.apply(r,n),s.set(h,p),h},r[o]=function(t){if(u===t&&null!==t)d=!0;else if(s.has(t)){const n=s.get(t);s.delete(t),e.destroy.call(null,n)}l.apply(r,arguments)}}e.exports=function(){p(this._hooks,this._state,"setTimeout","clearTimeout",o,a,!0),p(this._hooks,this._state,"setInterval","clearInterval",i,c,!1),p(this._hooks,this._state,"setImmediate","clearImmediate",s,l,!0),global.setTimeout=r.setTimeout,global.setInterval=r.setInterval,global.setImmediate=r.setImmediate,global.clearTimeout=r.clearTimeout,global.clearInterval=r.clearInterval,global.clearImmediate=r.clearImmediate}},8286:e=>{"use strict";e.exports=(e,t)=>class extends e{constructor(e){var n,r;super((function(e,i){n=this,r=[function(n){return t(o,!1),e(n)},function(e){return t(o,!1),i(e)}]}));var o=this;try{e.apply(n,r)}catch(e){r[1](e)}return o}}},9090:(e,t,n)=>{var r,o,i=n(6372).wrap,s=[],a=0,c=!1,l=[];function u(e,t){var n=e.length,r=t.length,o=[];if(0===n&&0===r)return o;for(var i=0;i<n;i++)o[i]=e[i];if(0===r)return o;for(var s=0;s<r;s++){var a=!0;for(i=0;i<n;i++)if(e[i].uid===t[s].uid){a=!1;break}a&&o.push(t[s])}return o}if(process._fatalException){var d,p=!1;r=function(e){var t=s.length;if(p||0===t)return!1;var n=!1;p=!0;for(var r=0;r<t;++r){var o=s[r];if(0!=(8&o.flags)){var i=d&&d[o.uid];n=o.error(i,e)||n}}return p=!1,l.length>0&&(s=l.pop()),d=void 0,n&&!c},o=function(e,t,n){var r=[];c=!0;for(var o=0;o<n;++o){var i=t[o];if(r[i.uid]=i.data,0!=(1&i.flags)){var a=i.create(i.data);void 0!==a&&(r[i.uid]=a)}}return c=!1,function(){d=r,l.push(s),s=u(t,s),c=!0;for(var o=0;o<n;++o)(2&t[o].flags)>0&&t[o].before(this,r[t[o].uid]);c=!1;var i=e.apply(this,arguments);for(c=!0,o=0;o<n;++o)(4&t[o].flags)>0&&t[o].after(this,r[t[o].uid]);return c=!1,s=l.pop(),d=void 0,i}},i(process,"_fatalException",(function(e){return function(t){return r(t)||e(t)}}))}else{var h=!1;r=function(e){if(h)throw e;for(var t=!1,n=s.length,r=0;r<n;++r){var o=s[r];0!=(8&o.flags)&&(t=o.error(null,e)||t)}if(!t&&c)throw e},o=function(e,t,n){var o=[];c=!0;for(var i=0;i<n;++i){var a=t[i];if(o[a.uid]=a.data,0!=(1&a.flags)){var d=a.create(a.data);void 0!==d&&(o[a.uid]=d)}}return c=!1,function(){var i,a=!1,d=!1;l.push(s),s=u(t,s),c=!0;for(var p=0;p<n;++p)(2&t[p].flags)>0&&t[p].before(this,o[t[p].uid]);c=!1;try{i=e.apply(this,arguments)}catch(e){for(a=!0,p=0;p<n;++p)if(0!=(8&s[p].flags))try{d=s[p].error(o[t[p].uid],e)||d}catch(e){throw h=!0,e}if(!d)throw process.removeListener("uncaughtException",r),process._originalNextTick((function(){process.addListener("uncaughtException",r)})),e}finally{if(!a||d){for(c=!0,p=0;p<n;++p)(4&t[p].flags)>0&&t[p].after(this,o[t[p].uid]);c=!1}s=l.pop()}return i}},process.addListener("uncaughtException",r)}function f(e,t){"function"==typeof e.create&&(this.create=e.create,this.flags|=1),"function"==typeof e.before&&(this.before=e.before,this.flags|=2),"function"==typeof e.after&&(this.after=e.after,this.flags|=4),"function"==typeof e.error&&(this.error=e.error,this.flags|=8),this.uid=++a,this.data=void 0===t?null:t}function m(e,t){if("object"!=typeof e||!e)throw new TypeError("callbacks argument must be an object");return e instanceof f?e:new f(e,t)}f.prototype.create=void 0,f.prototype.before=void 0,f.prototype.after=void 0,f.prototype.error=void 0,f.prototype.data=void 0,f.prototype.uid=0,f.prototype.flags=0,process.createAsyncListener=m,process.addAsyncListener=function(e,t){var n;n=e instanceof f?e:m(e,t);for(var r=!1,o=0;o<s.length;o++)if(n===s[o]){r=!0;break}return r||s.push(n),n},process.removeAsyncListener=function(e){for(var t=0;t<s.length;t++)if(e===s[t]){s.splice(t,1);break}},e.exports=function(e){var t=s.length;if(0===t)return e;for(var n=s.slice(),r=0;r<t;++r)if(n[r].flags>0)return o(e,n,t);return function(e,t,n){c=!0;for(var r=0;r<n;++r){var o=t[r];o.create&&o.create(o.data)}return c=!1,function(){l.push(s),s=u(t,s);var n=e.apply(this,arguments);return s=l.pop(),n}}(e,n,t)}},7645:(e,t,n)=>{"use strict";if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var r=n(6372),o=n(2249),i=r.wrap,s=r.massWrap,a=n(9090),c=n(3837),l=o.gte(process.version,"6.0.0"),u=o.gte(process.version,"7.0.0"),d=o.gte(process.version,"8.0.0"),p=o.gte(process.version,"11.0.0"),h=n(1808);function f(e){return function(){this.on("connection",(function(e){e._handle&&(e._handle.onread=a(e._handle.onread))}));try{return e.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=a(this._handle.onconnection))}}}function m(e){if(e&&e._handle){var t=e._handle;t._originalOnread||(t._originalOnread=t.onread),t.onread=a(t._originalOnread)}}u&&!h._normalizeArgs?h._normalizeArgs=function(e){if(0===e.length)return[{},null];var t,n,r=e[0],o={};"object"==typeof r&&null!==r?o=r:"string"==typeof(t=r)&&!1===(n=t,(n=Number(n))>=0&&n)?o.path=r:(o.port=r,e.length>1&&"string"==typeof e[1]&&(o.host=e[1]));var i=e[e.length-1];return"function"!=typeof i?[o,null]:[o,i]}:u||h._normalizeConnectArgs||(h._normalizeConnectArgs=function(e){var t,n={};"object"==typeof e[0]&&null!==e[0]?n=e[0]:"string"==typeof e[0]&&!1===(t=e[0],(t=Number(t))>=0&&t)?n.path=e[0]:(n.port=e[0],"string"==typeof e[1]&&(n.host=e[1]));var r=e[e.length-1];return"function"==typeof r?[n,r]:[n]}),"_setUpListenHandle"in h.Server.prototype?i(h.Server.prototype,"_setUpListenHandle",f):i(h.Server.prototype,"_listen2",f),i(h.Socket.prototype,"connect",(function(e){return function(){var t;(t=d&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?arguments[0]:u?h._normalizeArgs(arguments):h._normalizeConnectArgs(arguments))[1]&&(t[1]=a(t[1]));var n=e.apply(this,t);return m(this),n}}));var g=n(3685);i(g.Agent.prototype,"addRequest",(function(e){return function(t){var n=t.onSocket;return t.onSocket=a((function(e){return m(e),n.apply(this,arguments)})),e.apply(this,arguments)}}));var _=n(2081);function y(e){Array.isArray(e.stdio)&&e.stdio.forEach((function(e){e&&e._handle&&(e._handle.onread=a(e._handle.onread),i(e._handle,"close",N))})),e._handle&&(e._handle.onexit=a(e._handle.onexit))}_.ChildProcess?i(_.ChildProcess.prototype,"spawn",(function(e){return function(){var t=e.apply(this,arguments);return y(this),t}})):s(_,["execFile","fork","spawn"],(function(e){return function(){var t=e.apply(this,arguments);return y(t),t}})),process._fatalException||(process._originalNextTick=process.nextTick);var v=[];process._nextDomainTick&&v.push("_nextDomainTick"),process._tickDomainCallback&&v.push("_tickDomainCallback"),s(process,v,O),i(process,"nextTick",N);var b=["setTimeout","setInterval"];global.setImmediate&&b.push("setImmediate");var w=n(9512),x=global.setTimeout===w.setTimeout;s(w,b,N),x&&s(global,b,N);var E=n(9523);s(E,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],O),E.resolveNaptr&&i(E,"resolveNaptr",O);var C,S,T=n(7147);s(T,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],O),T.lchown&&i(T,"lchown",O),T.lchmod&&i(T,"lchmod",O),T.ftruncate&&i(T,"ftruncate",O);try{C=n(9796)}catch(e){}if(C&&C.Deflate&&C.Deflate.prototype){var k=Object.getPrototypeOf(C.Deflate.prototype);k._transform?i(k,"_transform",O):k.write&&k.flush&&k.end&&s(k,["write","flush","end"],O)}try{S=n(6113)}catch(e){}if(S){var I=["pbkdf2","randomBytes"];p||I.push("pseudoRandomBytes"),s(S,I,O)}var P=!!global.Promise&&"function Promise() { [native code] }"===Promise.toString()&&"function toString() { [native code] }"===Promise.toString.toString();if(P){var A=process.addAsyncListener({create:function(){P=!1}});global.Promise.resolve(!0).then((function(){P=!1})),process.removeAsyncListener(A)}function O(e){var t=function(){var t,n=arguments.length-1;if("function"==typeof arguments[n]){t=Array(arguments.length);for(var r=0;r<arguments.length-1;r++)t[r]=arguments[r];t[n]=a(arguments[n])}return e.apply(this,t||arguments)};switch(e.length){case 1:return function(n){return 1!==arguments.length?t.apply(this,arguments):("function"==typeof n&&(n=a(n)),e.call(this,n))};case 2:return function(n,r){return 2!==arguments.length?t.apply(this,arguments):("function"==typeof r&&(r=a(r)),e.call(this,n,r))};case 3:return function(n,r,o){return 3!==arguments.length?t.apply(this,arguments):("function"==typeof o&&(o=a(o)),e.call(this,n,r,o))};case 4:return function(n,r,o,i){return 4!==arguments.length?t.apply(this,arguments):("function"==typeof i&&(i=a(i)),e.call(this,n,r,o,i))};case 5:return function(n,r,o,i,s){return 5!==arguments.length?t.apply(this,arguments):("function"==typeof s&&(s=a(s)),e.call(this,n,r,o,i,s))};case 6:return function(n,r,o,i,s,c){return 6!==arguments.length?t.apply(this,arguments):("function"==typeof c&&(c=a(c)),e.call(this,n,r,o,i,s,c))};default:return t}}function N(e){var t=function(){var t;if("function"==typeof arguments[0]){(t=Array(arguments.length))[0]=a(arguments[0]);for(var n=1;n<arguments.length;n++)t[n]=arguments[n]}return e.apply(this,t||arguments)};switch(e.length){case 1:return function(n){return 1!==arguments.length?t.apply(this,arguments):("function"==typeof n&&(n=a(n)),e.call(this,n))};case 2:return function(n,r){return 2!==arguments.length?t.apply(this,arguments):("function"==typeof n&&(n=a(n)),e.call(this,n,r))};case 3:return function(n,r,o){return 3!==arguments.length?t.apply(this,arguments):("function"==typeof n&&(n=a(n)),e.call(this,n,r,o))};case 4:return function(n,r,o,i){return 4!==arguments.length?t.apply(this,arguments):("function"==typeof n&&(n=a(n)),e.call(this,n,r,o,i))};case 5:return function(n,r,o,i,s){return 5!==arguments.length?t.apply(this,arguments):("function"==typeof n&&(n=a(n)),e.call(this,n,r,o,i,s))};case 6:return function(n,r,o,i,s,c){return 6!==arguments.length?t.apply(this,arguments):("function"==typeof n&&(n=a(n)),e.call(this,n,r,o,i,s,c))};default:return t}}P&&function(){var e=global.Promise;function t(n){if(!(this instanceof t))return e(n);if("function"!=typeof n)return new e(n);var o,i,s=new e((function(e,t){o=this,i=[function(t){return r(s,!1),e(t)},function(e){return r(s,!1),t(e)}]}));s.__proto__=t.prototype;try{n.apply(o,i)}catch(e){i[1](e)}return s}function r(e,t){e.__asl_wrapper&&!t||(e.__asl_wrapper=a(o))}function o(t,n,i,s){var a;try{return{returnVal:a=n.call(t,i),error:!1}}catch(e){return{errorVal:e,error:!0}}finally{a instanceof e?s.__asl_wrapper=function(){return(a.__asl_wrapper||o).apply(this,arguments)}:r(s,!0)}}function s(e){return function(){var t=this,n=e.apply(t,Array.prototype.map.call(arguments,r));return n.__asl_wrapper=function(e,r,i,s){return t.__asl_wrapper?(t.__asl_wrapper(e,(function(){}),null,n),n.__asl_wrapper(e,r,i,s)):o(e,r,i,s)},n;function r(e){return"function"!=typeof e?e:a((function(r){var i=(t.__asl_wrapper||o)(this,e,r,n);if(i.error)throw i.errorVal;return i.returnVal}))}}}c.inherits(t,e),i(e.prototype,"then",s),e.prototype.chain&&i(e.prototype,"chain",s),l?global.Promise=n(8286)(e,r):(["all","race","reject","resolve","accept","defer"].forEach((function(n){"function"==typeof e[n]&&(t[n]=e[n])})),global.Promise=t)}()},2249:(e,t)=>{var n;t=e.exports=V,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var E=s++;i[E]=i[c]+"|x|X|\\*";var C=s++;i[C]=i[a]+"|x|X|\\*";var S=s++;i[S]="[v=\\s]*("+i[C]+")(?:\\.("+i[C]+")(?:\\.("+i[C]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var T=s++;i[T]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="^"+i[x]+"\\s*"+i[T]+"$";var P=s++;i[P]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var A=s++;i[A]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[A]+"\\s+",o[O]=new RegExp(i[O],"g");var N=s++;i[N]="^"+i[A]+i[S]+"$";var R=s++;i[R]="^"+i[A]+i[T]+"$";var M=s++;i[M]="(?:\\^)";var L=s++;i[L]="(\\s*)"+i[M]+"\\s+",o[L]=new RegExp(i[L],"g");var $=s++;i[$]="^"+i[M]+i[S]+"$";var D=s++;i[D]="^"+i[M]+i[T]+"$";var F=s++;i[F]="^"+i[x]+"\\s*("+b+")$|^$";var j=s++;i[j]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[S]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var U=s++;i[U]="^\\s*("+i[T]+")\\s+-\\s+("+i[T]+")\\s*$";var H=s++;i[H]="(<|>)?=?\\s*\\*";for(var z=0;z<35;z++)n(z,i[z]),o[z]||(o[z]=new RegExp(i[z]));function W(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof V)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new V(e,t)}catch(e){return null}}function V(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof V){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof V))return new V(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);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>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<r)return t}return e})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}t.parse=W,t.valid=function(e,t){var n=W(e,t);return n?n.version:null},t.clean=function(e,t){var n=W(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null},t.SemVer=V,V.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},V.prototype.toString=function(){return this.version},V.prototype.compare=function(e){return n("SemVer.compare",this.version,this.options,e),e instanceof V||(e=new V(e,this.options)),this.compareMain(e)||this.comparePre(e)},V.prototype.compareMain=function(e){return e instanceof V||(e=new V(e,this.options)),K(this.major,e.major)||K(this.minor,e.minor)||K(this.patch,e.patch)},V.prototype.comparePre=function(e){if(e instanceof V||(e=new V(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],o=e.prerelease[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return K(r,o)}while(++t)},V.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new V(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=W(e),r=W(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=K;var G=/^[0-9]+$/;function K(e,t){var n=G.test(e),r=G.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1}function J(e,t,n){return new V(e,n).compare(new V(t,n))}function X(e,t,n){return J(e,t,n)>0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return K(t,e)},t.major=function(e,t){return new V(e,t).major},t.minor=function(e,t){return new V(e,t).minor},t.patch=function(e,t){return new V(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o<e.length;o++)if(!e[o].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(o=0;o<e.length;o++)if(n(e[o].semver),e[o].semver!==oe&&e[o].semver.prerelease.length>0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new V(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l<t.set.length;++l){var u=t.set[l],d=null,p=null;if(u.forEach((function(e){e.semver===oe&&(e=new re(">=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[F]:o[j],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new V(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new V(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[U]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[L],"$1^")).split(/\s+/).join(" ");var i=t?o[F]:o[j],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[D]:o[$];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[R]:o[N];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[I]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[H],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new V(e,this.options));for(var t=0;t<this.set.length;t++)if(ce(this.set[t],e,this.options))return!0;return!1},t.satisfies=le,t.maxSatisfying=function(e,t,n){var r=null,o=null;try{var i=new ie(t,n)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(r&&-1!==o.compare(e)||(o=new V(r=e,n)))})),r},t.minSatisfying=function(e,t,n){var r=null,o=null;try{var i=new ie(t,n)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(r&&1!==o.compare(e)||(o=new V(r=e,n)))})),r},t.minVersion=function(e,t){e=new ie(e,t);var n=new V("0.0.0");if(e.test(n))return n;if(n=new V("0.0.0-0"),e.test(n))return n;n=null;for(var r=0;r<e.set.length;++r)e.set[r].forEach((function(e){var t=new V(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=W(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof V)return e;if("string"!=typeof e)return null;var t=e.match(o[P]);return null==t?null:W(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},5420:e=>{var t=Object.prototype.toString,n="function"==typeof Buffer.alloc&&"function"==typeof Buffer.allocUnsafe&&"function"==typeof Buffer.from;e.exports=function(e,r,o){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return i=e,"ArrayBuffer"===t.call(i).slice(8,-1)?function(e,t,r){t>>>=0;var o=e.byteLength-t;if(o<0)throw new RangeError("'offset' is out of bounds");if(void 0===r)r=o;else if((r>>>=0)>o)throw new RangeError("'length' is out of bounds");return n?Buffer.from(e.slice(t,t+r)):new Buffer(new Uint8Array(e.slice(t,t+r)))}(e,r,o):"string"==typeof e?function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!Buffer.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return n?Buffer.from(e,t):new Buffer(e,t)}(e,r):n?Buffer.from(e):new Buffer(e);var i}},4046:(e,t,n)=>{"use strict";const r=n(3837),o=n(9491),i=n(9867),s=n(3223),a="error@context",c=[];for(let e in s.providers)c[s.providers[e]]=e;const l=process.env.DEBUG_CLS_HOOKED;let u=-1;function d(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map}function p(e){return process.namespaces[e]}function h(e){let t=p(e);o.ok(t,"can't delete nonexistent namespace! \""+e+'"'),o.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function f(e){process.env.DEBUG&&process._rawDebug(e)}function m(e){return e?"function"==typeof e?e.name?e.name:(e.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1]:e.constructor&&e.constructor.name?e.constructor.name:void 0:e}if(e.exports={getNamespace:p,createNamespace:function(e){o.ok(e,"namespace must be given a name."),l&&f("CREATING NAMESPACE "+e);let t=new d(e);return t.id=u,s.addHooks({init(n,o,i,s,a){u=n,s?(t._contexts.set(n,t._contexts.get(s)),l&&f("PARENTID: "+e+" uid:"+n+" parent:"+s+" provider:"+i)):t._contexts.set(u,t.active),l&&f("INIT "+e+" uid:"+n+" parent:"+s+" provider:"+c[i]+" active:"+r.inspect(t.active,!0))},pre(n,o){u=n;let i=t._contexts.get(n);i?(l&&f(" PRE "+e+" uid:"+n+" handle:"+m(o)+" context:"+r.inspect(i)),t.enter(i)):l&&f(" PRE MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(o))},post(n,o){u=n;let i=t._contexts.get(n);i?(l&&f(" POST "+e+" uid:"+n+" handle:"+m(o)+" context:"+r.inspect(i)),t.exit(i)):l&&f(" POST MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(o))},destroy(n){u=n,l&&f("DESTROY "+e+" uid:"+n+" context:"+r.inspect(t._contexts.get(u))+" active:"+r.inspect(t.active,!0)),t._contexts.delete(n)}}),process.namespaces[e]=t,t},destroyNamespace:h,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){h(e)})),process.namespaces=Object.create(null)},ERROR_SYMBOL:a},d.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return l&&f(" SETTING KEY:"+e+"="+t+" in ns:"+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0)),this.active[e]=t,t},d.prototype.get=function(e){if(this.active)return l&&f(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0)),this.active[e];l&&f(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0))},d.prototype.createContext=function(){l&&f(" CREATING Context: "+this.name+" uid:"+u+" len:"+this._set.length+" active:"+r.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=u,l&&f(" CREATED Context: "+this.name+" uid:"+u+" len:"+this._set.length+" context:"+r.inspect(e,!0,2,!0)),e},d.prototype.run=function(e){let t=this.createContext();this.enter(t);try{return l&&f(" BEFORE RUN: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),e(t),t}catch(e){throw e&&(e[a]=t),e}finally{l&&f(" AFTER RUN: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t)}},d.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},d.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return l&&f(" BEFORE runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(l&&f(" AFTER runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,l&&f(" AFTER runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},d.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},d.prototype.enter=function(e){o.ok(e,"context must be provided for entering"),l&&f(" ENTER "+this.name+" uid:"+u+" len:"+this._set.length+" context: "+r.inspect(e)),this._set.push(this.active),this.active=e},d.prototype.exit=function(e){if(o.ok(e,"context must be provided for exiting"),l&&f(" EXIT "+this.name+" uid:"+u+" len:"+this._set.length+" context: "+r.inspect(e)),this.active===e)return o.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(l&&f("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),o.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(o.ok(t,"can't remove top context"),this._set.splice(t,1))},d.prototype.bindEmitter=function(e){o.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;i(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},d.prototype.fromException=function(e){return e[a]},process.namespaces={},s._state&&!s._state.enabled&&s.enable(),l){var g=n(2512);for(var _ in g.filter._modifiers)g.filter.deattach(_)}},3964:(e,t,n)=>{"use strict";const r=n(3837),o=n(9491),i=n(9867),s=n(852),a="error@context",c=process.env.DEBUG_CLS_HOOKED;let l=-1;function u(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}function d(e){return process.namespaces[e]}function p(e){let t=d(e);o.ok(t,"can't delete nonexistent namespace! \""+e+'"'),o.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function h(...e){c&&process._rawDebug(`${r.format(...e)}`)}e.exports={getNamespace:d,createNamespace:function(e){o.ok(e,"namespace must be given a name."),c&&h(`NS-CREATING NAMESPACE (${e})`);let t=new u(e);return t.id=l,s.createHook({init(n,o,i,a){if(l=s.executionAsyncId(),t.active){if(t._contexts.set(n,t.active),c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}else if(0===l){const i=s.triggerAsyncId(),u=t._contexts.get(i);if(u){if(t._contexts.set(n,u),c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT USING CONTEXT FROM TRIGGERID [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}else if(c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT MISSING CONTEXT [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}if(c&&"PROMISE"===o){h(r.inspect(a,{showHidden:!0}));const s=a.parentId;h(`${" ".repeat(t._indent<0?0:t._indent)}INIT RESOURCE-PROMISE [${o}] (${e}) parentId:${s} asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}},before(n){let o;if(l=s.executionAsyncId(),o=t._contexts.get(n)||t._contexts.get(l),o){if(c){const i=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}BEFORE (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`),t._indent+=2}t.enter(o)}else if(c){const o=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}BEFORE MISSING CONTEXT (${e}) asyncId:${n} currentUid:${l} triggerId:${o} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${r.inspect(t._contexts,{showHidden:!0,depth:2,colors:!0})}`),t._indent+=2}},after(n){let o;if(l=s.executionAsyncId(),o=t._contexts.get(n)||t._contexts.get(l),o){if(c){const i=s.triggerAsyncId();t._indent-=2;h(`${" ".repeat(t._indent<0?0:t._indent)}AFTER (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`)}t.exit(o)}else if(c){const i=s.triggerAsyncId();t._indent-=2;h(`${" ".repeat(t._indent<0?0:t._indent)}AFTER MISSING CONTEXT (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`)}},destroy(n){if(l=s.executionAsyncId(),c){const o=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}DESTROY (${e}) currentUid:${l} asyncId:${n} triggerId:${o} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(t._contexts.get(l))}`)}t._contexts.delete(n)}}).enable(),process.namespaces[e]=t,t},destroyNamespace:p,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){p(e)})),process.namespaces=Object.create(null)},ERROR_SYMBOL:a},u.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[e]=t,c&&h(" ".repeat(this._indent<0?0:this._indent)+"CONTEXT-SET KEY:"+e+"="+t+" in ns:"+this.name+" currentUid:"+l+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),t},u.prototype.get=function(e){if(this.active){if(c){const t=s.executionAsyncId(),n=s.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);h(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+l+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),h(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} active:${r.inspect(this.active)}`)}return this.active[e]}if(c){const t=s.currentId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length}`)}},u.prototype.createContext=function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=l,c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-CREATED Context: (${this.name}) currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} context:${r.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},u.prototype.run=function(e){let t=this.createContext();this.enter(t);try{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${l} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} context:${r.inspect(t)}`)}return e(t),t}catch(e){throw e&&(e[a]=t),e}finally{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN END: (${this.name}) currentUid:${l} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} ${r.inspect(t)}`)}this.exit(t)}},u.prototype.runAndReturn=function(e){let t;return this.run((function(n){t=e(n)})),t},u.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return c&&h("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(c&&h("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,c&&h("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},u.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},u.prototype.enter=function(e){if(o.ok(e,"context must be provided for entering"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-ENTER: (${this.name}) currentUid:${l} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}this._set.push(this.active),this.active=e},u.prototype.exit=function(e){if(o.ok(e,"context must be provided for exiting"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-EXIT: (${this.name}) currentUid:${l} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}if(this.active===e)return o.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(c&&h("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),o.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(o.ok(t,"can't remove top context"),this._set.splice(t,1))},u.prototype.bindEmitter=function(e){o.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;i(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},u.prototype.fromException=function(e){return e[a]},process.namespaces={}},9562:(e,t,n)=>{"use strict";const r=n(9012);process&&r.gte(process.versions.node,"8.0.0")?e.exports=n(3964):e.exports=n(4046)},9012:(e,t)=>{var n;t=e.exports=V,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var E=s++;i[E]=i[c]+"|x|X|\\*";var C=s++;i[C]=i[a]+"|x|X|\\*";var S=s++;i[S]="[v=\\s]*("+i[C]+")(?:\\.("+i[C]+")(?:\\.("+i[C]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var T=s++;i[T]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="^"+i[x]+"\\s*"+i[T]+"$";var P=s++;i[P]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var A=s++;i[A]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[A]+"\\s+",o[O]=new RegExp(i[O],"g");var N=s++;i[N]="^"+i[A]+i[S]+"$";var R=s++;i[R]="^"+i[A]+i[T]+"$";var M=s++;i[M]="(?:\\^)";var L=s++;i[L]="(\\s*)"+i[M]+"\\s+",o[L]=new RegExp(i[L],"g");var $=s++;i[$]="^"+i[M]+i[S]+"$";var D=s++;i[D]="^"+i[M]+i[T]+"$";var F=s++;i[F]="^"+i[x]+"\\s*("+b+")$|^$";var j=s++;i[j]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[S]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var U=s++;i[U]="^\\s*("+i[T]+")\\s+-\\s+("+i[T]+")\\s*$";var H=s++;i[H]="(<|>)?=?\\s*\\*";for(var z=0;z<35;z++)n(z,i[z]),o[z]||(o[z]=new RegExp(i[z]));function W(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof V)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new V(e,t)}catch(e){return null}}function V(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof V){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof V))return new V(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);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>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<r)return t}return e})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}t.parse=W,t.valid=function(e,t){var n=W(e,t);return n?n.version:null},t.clean=function(e,t){var n=W(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null},t.SemVer=V,V.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},V.prototype.toString=function(){return this.version},V.prototype.compare=function(e){return n("SemVer.compare",this.version,this.options,e),e instanceof V||(e=new V(e,this.options)),this.compareMain(e)||this.comparePre(e)},V.prototype.compareMain=function(e){return e instanceof V||(e=new V(e,this.options)),K(this.major,e.major)||K(this.minor,e.minor)||K(this.patch,e.patch)},V.prototype.comparePre=function(e){if(e instanceof V||(e=new V(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],o=e.prerelease[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return K(r,o)}while(++t)},V.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new V(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=W(e),r=W(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=K;var G=/^[0-9]+$/;function K(e,t){var n=G.test(e),r=G.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1}function J(e,t,n){return new V(e,n).compare(new V(t,n))}function X(e,t,n){return J(e,t,n)>0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return K(t,e)},t.major=function(e,t){return new V(e,t).major},t.minor=function(e,t){return new V(e,t).minor},t.patch=function(e,t){return new V(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o<e.length;o++)if(!e[o].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(o=0;o<e.length;o++)if(n(e[o].semver),e[o].semver!==oe&&e[o].semver.prerelease.length>0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new V(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l<t.set.length;++l){var u=t.set[l],d=null,p=null;if(u.forEach((function(e){e.semver===oe&&(e=new re(">=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[F]:o[j],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new V(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new V(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[U]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[L],"$1^")).split(/\s+/).join(" ");var i=t?o[F]:o[j],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[D]:o[$];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[R]:o[N];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[I]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[H],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new V(e,this.options));for(var t=0;t<this.set.length;t++)if(ce(this.set[t],e,this.options))return!0;return!1},t.satisfies=le,t.maxSatisfying=function(e,t,n){var r=null,o=null;try{var i=new ie(t,n)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(r&&-1!==o.compare(e)||(o=new V(r=e,n)))})),r},t.minSatisfying=function(e,t,n){var r=null,o=null;try{var i=new ie(t,n)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(r&&1!==o.compare(e)||(o=new V(r=e,n)))})),r},t.minVersion=function(e,t){e=new ie(e,t);var n=new V("0.0.0");if(e.test(n))return n;if(n=new V("0.0.0-0"),e.test(n))return n;n=null;for(var r=0;r<e.set.length;++r)e.set[r].forEach((function(e){var t=new V(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=W(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof V)return e;if("string"!=typeof e)return null;var t=e.match(o[P]);return null==t?null:W(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},3057:(e,t,n)=>{"use strict";var r=n(9491),o=n(9867),i="error@context";function s(e){this.name=e,this.active=null,this._set=[],this.id=null}function a(e){return process.namespaces[e]}function c(e){var t=a(e);r.ok(t,"can't delete nonexistent namespace!"),r.ok(t.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(t.id),process.namespaces[e]=null}function l(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){c(e)})),process.namespaces=Object.create(null)}process.addAsyncListener||n(7645),s.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[e]=t,t},s.prototype.get=function(e){if(this.active)return this.active[e]},s.prototype.createContext=function(){return Object.create(this.active)},s.prototype.run=function(e){var t=this.createContext();this.enter(t);try{return e(t),t}catch(e){throw e&&(e[i]=t),e}finally{this.exit(t)}},s.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},s.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());var n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[i]=t),e}finally{n.exit(t)}}},s.prototype.enter=function(e){r.ok(e,"context must be provided for entering"),this._set.push(this.active),this.active=e},s.prototype.exit=function(e){if(r.ok(e,"context must be provided for exiting"),this.active===e)return r.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());var t=this._set.lastIndexOf(e);r.ok(t>=0,"context not currently entered; can't exit"),r.ok(t,"can't remove top context"),this._set.splice(t,1)},s.prototype.bindEmitter=function(e){r.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");var t=this,n="context@"+this.name;o(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;var t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){var r=n[e];t=r.namespace.bind(t,r.context)})),t}))},s.prototype.fromException=function(e){return e[i]},process.namespaces||l(),e.exports={getNamespace:a,createNamespace:function(e){r.ok(e,"namespace must be given a name!");var t=new s(e);return t.id=process.addAsyncListener({create:function(){return t.active},before:function(e,n){n&&t.enter(n)},after:function(e,n){n&&t.exit(n)},error:function(e){e&&t.exit(e)}}),process.namespaces[e]=t,t},destroyNamespace:c,reset:l}},452:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib.BlockCipher,n=e.algo,o=[],i=[],s=[],a=[],c=[],l=[],u=[],d=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var f=r^r<<1^r<<2^r<<3^r<<4;f=f>>>8^255&f^99,o[n]=f,i[f]=n;var m=e[n],g=e[m],_=e[g],y=257*e[f]^16843008*f;s[n]=y<<24|y>>>8,a[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,l[n]=y,y=16843009*_^65537*g^257*m^16843008*n,u[f]=y<<24|y>>>8,d[f]=y<<16|y>>>16,p[f]=y<<8|y>>>24,h[f]=y,n?(n=m^e[e[e[_^m]]],r^=e[e[r]]):n=r=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],s=0;s<r;s++)s<n?i[s]=t[s]:(l=i[s-1],s%n?n>6&&s%n==4&&(l=o[l>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l]):(l=o[(l=l<<8|l>>>24)>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l],l^=f[s/n|0]<<24),i[s]=i[s-n]^l);for(var a=this._invKeySchedule=[],c=0;c<r;c++){if(s=r-c,c%4)var l=i[s];else l=i[s-4];a[c]=c<4||s<=4?l:u[o[l>>>24]]^d[o[l>>>16&255]]^p[o[l>>>8&255]]^h[o[255&l]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,c,l,o)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,p,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,o,i,s,a){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],p=e[t+3]^n[3],h=4,f=1;f<c;f++){var m=r[l>>>24]^o[u>>>16&255]^i[d>>>8&255]^s[255&p]^n[h++],g=r[u>>>24]^o[d>>>16&255]^i[p>>>8&255]^s[255&l]^n[h++],_=r[d>>>24]^o[p>>>16&255]^i[l>>>8&255]^s[255&u]^n[h++],y=r[p>>>24]^o[l>>>16&255]^i[u>>>8&255]^s[255&d]^n[h++];l=m,u=g,d=_,p=y}m=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&p])^n[h++],g=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[p>>>8&255]<<8|a[255&l])^n[h++],_=(a[d>>>24]<<24|a[p>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^n[h++],y=(a[p>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^n[h++],e[t]=m,e[t+1]=g,e[t+2]=_,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),r.AES)},5109:function(e,t,n){var r,o,i,s,a,c,l,u,d,p,h,f,m,g,_,y,v,b,w;e.exports=(r=n(8249),n(888),void(r.lib.Cipher||(o=r,i=o.lib,s=i.Base,a=i.WordArray,c=i.BufferedBlockAlgorithm,l=o.enc,l.Utf8,u=l.Base64,d=o.algo.EvpKDF,p=i.Cipher=c.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?w:v}return function(t){return{encrypt:function(n,r,o){return e(r).encrypt(t,n,r,o)},decrypt:function(n,r,o){return e(r).decrypt(t,n,r,o)}}}}()}),i.StreamCipher=p.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),h=o.mode={},f=i.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=h.CBC=function(){var e=f.extend();function t(e,t,n){var r,o=this._iv;o?(r=o,this._iv=void 0):r=this._prevBlock;for(var i=0;i<n;i++)e[t+i]^=r[i]}return e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,o=r.blockSize;t.call(this,e,n,o),r.encryptBlock(e,n),this._prevBlock=e.slice(n,n+o)}}),e.Decryptor=e.extend({processBlock:function(e,n){var r=this._cipher,o=r.blockSize,i=e.slice(n,n+o);r.decryptBlock(e,n),t.call(this,e,n,o),this._prevBlock=i}}),e}(),g=(o.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,o=r<<24|r<<16|r<<8|r,i=[],s=0;s<r;s+=4)i.push(o);var c=a.create(i,r);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},i.BlockCipher=p.extend({cfg:p.cfg.extend({mode:m,padding:g}),reset:function(){var e;p.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),_=i.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(o.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?a.create([1398893684,1701076831]).concat(n).concat(t):t).toString(u)},parse:function(e){var t,n=u.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=a.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),_.create({ciphertext:n,salt:t})}},v=i.SerializableCipher=s.extend({cfg:s.extend({format:y}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var o=e.createEncryptor(n,r),i=o.finalize(t),s=o.cfg;return _.create({ciphertext:i,key:n,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(o.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=a.random(8));var o=d.create({keySize:t+n}).compute(e,r),i=a.create(o.words.slice(t),4*n);return o.sigBytes=4*t,_.create({key:o,iv:i,salt:r})}},w=i.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:b}),encrypt:function(e,t,n,r){var o=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=o.iv;var i=v.encrypt.call(this,e,t,o.key,r);return i.mixIn(o),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var o=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=o.iv,v.decrypt.call(this,e,t,o.key,r)}}))))},8249:function(e,t,n){var r;e.exports=(r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r)try{r=n(6113)}catch(e){}var o=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},a=s.lib={},c=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=a.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var s=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=s<<24-(r+i)%4*8}else for(i=0;i<o;i+=4)t[r+i>>>2]=n[i>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(o());return new l.init(t,e)}}),u=s.enc={},d=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},p=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new l.init(n,t)}},h=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,s=this.blockSize,a=i/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,u=e.min(4*c,i);if(c){for(var d=0;d<c;d+=s)this._doProcessBlock(o,d);n=o.splice(0,c),r.sigBytes-=u}return new l.init(n,u)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),m=(a.Hasher=f.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new m.HMAC.init(e,n).finalize(t)}}}),s.algo={});return s}(Math),r)},8269:function(e,t,n){var r,o,i;e.exports=(r=n(8249),i=(o=r).lib.WordArray,o.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var o=[],i=0;i<n;i+=3)for(var s=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<n;a++)o.push(r.charAt(s>>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o<n.length;o++)r[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return function(e,t,n){for(var r=[],o=0,s=0;s<t;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2|n[e.charCodeAt(s)]>>>6-s%4*2;r[o>>>2]|=a<<24-o%4*8,o++}return i.create(r,o)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},298:function(e,t,n){var r;e.exports=(r=n(8249),function(){var e=r,t=e.lib.WordArray,n=e.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o+=2){var i=t[o>>>2]>>>16-o%4*8&65535;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var n=e.length,r=[],o=0;o<n;o++)r[o>>>1]|=e.charCodeAt(o)<<16-o%2*16;return t.create(r,2*n)}},n.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var s=o(t[i>>>2]>>>16-i%4*8&65535);r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){for(var n=e.length,r=[],i=0;i<n;i++)r[i>>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return t.create(r,2*n)}}}(),r.enc.Utf16)},888:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(u=n(8249),n(2783),n(9824),i=(o=(r=u).lib).Base,s=o.WordArray,c=(a=r.algo).MD5,l=a.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,o=r.hasher.create(),i=s.create(),a=i.words,c=r.keySize,l=r.iterations;a.length<c;){n&&o.update(n),n=o.update(e).finalize(t),o.reset();for(var u=1;u<l;u++)n=o.finalize(n),o.reset();i.concat(n)}return i.sigBytes=4*c,i}}),r.EvpKDF=function(e,t,n){return l.create(n).compute(e,t)},u.EvpKDF)},2209:function(e,t,n){var r,o,i,s;e.exports=(s=n(8249),n(5109),o=(r=s).lib.CipherParams,i=r.enc.Hex,r.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return o.create({ciphertext:t})}},s.format.Hex)},9824:function(e,t,n){var r,o,i;e.exports=(o=(r=n(8249)).lib.Base,i=r.enc.Utf8,void(r.algo.HMAC=o.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,c=s.words,l=0;l<n;l++)a[l]^=1549556828,c[l]^=909522486;o.sigBytes=s.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))},1354:function(e,t,n){var r;e.exports=(r=n(8249),n(4938),n(2422),n(298),n(8269),n(8214),n(2783),n(2153),n(7792),n(34),n(7460),n(3327),n(706),n(9824),n(2112),n(888),n(5109),n(8568),n(4242),n(9968),n(7660),n(1148),n(3615),n(2807),n(1077),n(6475),n(6991),n(2209),n(452),n(4253),n(1857),n(4454),n(3974),r)},2422:function(e,t,n){var r;e.exports=(r=n(8249),function(){if("function"==typeof ArrayBuffer){var e=r.lib.WordArray,t=e.init,n=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var n=e.byteLength,r=[],o=0;o<n;o++)r[o>>>2]|=e[o]<<24-o%4*8;t.call(this,r,n)}else t.apply(this,arguments)};n.prototype=e}}(),r.lib.WordArray)},8214:function(e,t,n){var r;e.exports=(r=n(8249),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=s.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,s=e[t+0],c=e[t+1],h=e[t+2],f=e[t+3],m=e[t+4],g=e[t+5],_=e[t+6],y=e[t+7],v=e[t+8],b=e[t+9],w=e[t+10],x=e[t+11],E=e[t+12],C=e[t+13],S=e[t+14],T=e[t+15],k=i[0],I=i[1],P=i[2],A=i[3];k=l(k,I,P,A,s,7,a[0]),A=l(A,k,I,P,c,12,a[1]),P=l(P,A,k,I,h,17,a[2]),I=l(I,P,A,k,f,22,a[3]),k=l(k,I,P,A,m,7,a[4]),A=l(A,k,I,P,g,12,a[5]),P=l(P,A,k,I,_,17,a[6]),I=l(I,P,A,k,y,22,a[7]),k=l(k,I,P,A,v,7,a[8]),A=l(A,k,I,P,b,12,a[9]),P=l(P,A,k,I,w,17,a[10]),I=l(I,P,A,k,x,22,a[11]),k=l(k,I,P,A,E,7,a[12]),A=l(A,k,I,P,C,12,a[13]),P=l(P,A,k,I,S,17,a[14]),k=u(k,I=l(I,P,A,k,T,22,a[15]),P,A,c,5,a[16]),A=u(A,k,I,P,_,9,a[17]),P=u(P,A,k,I,x,14,a[18]),I=u(I,P,A,k,s,20,a[19]),k=u(k,I,P,A,g,5,a[20]),A=u(A,k,I,P,w,9,a[21]),P=u(P,A,k,I,T,14,a[22]),I=u(I,P,A,k,m,20,a[23]),k=u(k,I,P,A,b,5,a[24]),A=u(A,k,I,P,S,9,a[25]),P=u(P,A,k,I,f,14,a[26]),I=u(I,P,A,k,v,20,a[27]),k=u(k,I,P,A,C,5,a[28]),A=u(A,k,I,P,h,9,a[29]),P=u(P,A,k,I,y,14,a[30]),k=d(k,I=u(I,P,A,k,E,20,a[31]),P,A,g,4,a[32]),A=d(A,k,I,P,v,11,a[33]),P=d(P,A,k,I,x,16,a[34]),I=d(I,P,A,k,S,23,a[35]),k=d(k,I,P,A,c,4,a[36]),A=d(A,k,I,P,m,11,a[37]),P=d(P,A,k,I,y,16,a[38]),I=d(I,P,A,k,w,23,a[39]),k=d(k,I,P,A,C,4,a[40]),A=d(A,k,I,P,s,11,a[41]),P=d(P,A,k,I,f,16,a[42]),I=d(I,P,A,k,_,23,a[43]),k=d(k,I,P,A,b,4,a[44]),A=d(A,k,I,P,E,11,a[45]),P=d(P,A,k,I,T,16,a[46]),k=p(k,I=d(I,P,A,k,h,23,a[47]),P,A,s,6,a[48]),A=p(A,k,I,P,y,10,a[49]),P=p(P,A,k,I,S,15,a[50]),I=p(I,P,A,k,g,21,a[51]),k=p(k,I,P,A,E,6,a[52]),A=p(A,k,I,P,f,10,a[53]),P=p(P,A,k,I,w,15,a[54]),I=p(I,P,A,k,c,21,a[55]),k=p(k,I,P,A,v,6,a[56]),A=p(A,k,I,P,T,10,a[57]),P=p(P,A,k,I,_,15,a[58]),I=p(I,P,A,k,C,21,a[59]),k=p(k,I,P,A,m,6,a[60]),A=p(A,k,I,P,x,10,a[61]),P=p(P,A,k,I,h,15,a[62]),I=p(I,P,A,k,b,21,a[63]),i[0]=i[0]+k|0,i[1]=i[1]+I|0,i[2]=i[2]+P|0,i[3]=i[3]+A|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;var i=e.floor(r/4294967296),s=r;n[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,r,o,i,s){var a=e+(t&n|~t&r)+o+s;return(a<<i|a>>>32-i)+t}function u(e,t,n,r,o,i,s){var a=e+(t&r|n&~r)+o+s;return(a<<i|a>>>32-i)+t}function d(e,t,n,r,o,i,s){var a=e+(t^n^r)+o+s;return(a<<i|a>>>32-i)+t}function p(e,t,n,r,o,i,s){var a=e+(n^(t|~r))+o+s;return(a<<i|a>>>32-i)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),r.MD5)},8568:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,n,r){var o,i=this._iv;i?(o=i.slice(0),this._iv=void 0):o=this._prevBlock,r.encryptBlock(o,0);for(var s=0;s<n;s++)e[t+s]^=o[s]}return e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,o=r.blockSize;t.call(this,e,n,o,r),this._prevBlock=e.slice(n,n+o)}}),e.Decryptor=e.extend({processBlock:function(e,n){var r=this._cipher,o=r.blockSize,i=e.slice(n,n+o);t.call(this,e,n,o,r),this._prevBlock=i}}),e}(),r.mode.CFB)},9968:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.mode.CTRGladman=function(){var e=r.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,o=r.blockSize,i=this._iv,s=this._counter;i&&(s=this._counter=i.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(s);var a=s.slice(0);r.encryptBlock(a,0);for(var c=0;c<o;c++)e[n+c]^=a[c]}});return e.Decryptor=n,e}(),r.mode.CTRGladman)},4242:function(e,t,n){var r,o,i;e.exports=(i=n(8249),n(5109),i.mode.CTR=(o=(r=i.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,o=this._iv,i=this._counter;o&&(i=this._counter=o.slice(0),this._iv=void 0);var s=i.slice(0);n.encryptBlock(s,0),i[r-1]=i[r-1]+1|0;for(var a=0;a<r;a++)e[t+a]^=s[a]}}),r.Decryptor=o,r),i.mode.CTR)},1148:function(e,t,n){var r,o;e.exports=(o=n(8249),n(5109),o.mode.ECB=((r=o.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),r.Decryptor=r.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),r),o.mode.ECB)},7660:function(e,t,n){var r,o,i;e.exports=(i=n(8249),n(5109),i.mode.OFB=(o=(r=i.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,o=this._iv,i=this._keystream;o&&(i=this._keystream=o.slice(0),this._iv=void 0),n.encryptBlock(i,0);for(var s=0;s<r;s++)e[t+s]^=i[s]}}),r.Decryptor=o,r),i.mode.OFB)},3615:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=4*t,o=r-n%r,i=n+o-1;e.clamp(),e.words[i>>>2]|=o<<24-i%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)},2807:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.Iso10126={pad:function(e,t){var n=4*t,o=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(o-1)).concat(r.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)},1077:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)},6991:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)},6475:function(e,t,n){var r;e.exports=(r=n(8249),n(5109),r.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},r.pad.ZeroPadding)},2112:function(e,t,n){var r,o,i,s,a,c,l,u,d;e.exports=(d=n(8249),n(2783),n(9824),i=(o=(r=d).lib).Base,s=o.WordArray,c=(a=r.algo).SHA1,l=a.HMAC,u=a.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=l.create(n.hasher,e),o=s.create(),i=s.create([1]),a=o.words,c=i.words,u=n.keySize,d=n.iterations;a.length<u;){var p=r.update(t).finalize(i);r.reset();for(var h=p.words,f=h.length,m=p,g=1;g<d;g++){m=r.finalize(m),r.reset();for(var _=m.words,y=0;y<f;y++)h[y]^=_[y]}o.concat(p),c[0]++}return o.sigBytes=4*u,o}}),r.PBKDF2=function(e,t,n){return u.create(n).compute(e,t)},d.PBKDF2)},3974:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],s=[],a=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)c.call(this);for(o=0;o<8;o++)r[o]^=n[o+4&7];if(t){var i=t.words,s=i[0],a=i[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=l>>>16|4294901760&u,p=u<<16|65535&l;for(r[0]^=l,r[1]^=d,r[2]^=u,r[3]^=p,r[4]^=l,r[5]^=d,r[6]^=u,r[7]^=p,o=0;o<4;o++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,a=r>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,l=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=c^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(a)}(),r.RabbitLegacy)},4454:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],s=[],a=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)o[n]^=r[n+4&7];if(t){var i=t.words,s=i[0],a=i[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=l>>>16|4294901760&u,p=u<<16|65535&l;for(o[0]^=l,o[1]^=d,o[2]^=u,o[3]^=p,o[4]^=l,o[5]^=d,o[6]^=u,o[7]^=p,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,a=r>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,l=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=c^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(a)}(),r.Rabbit)},1857:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],o=0;o<256;o++)r[o]=o;o=0;for(var i=0;o<256;o++){var s=o%n,a=t[s>>>2]>>>24-s%4*8&255;i=(i+r[o]+a)%256;var c=r[o];r[o]=r[i],r[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,n=this._j,r=0,o=0;o<4;o++){n=(n+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[n],e[n]=i,r|=e[(e[t]+e[n])%256]<<24-8*o}return this._i=t,this._j=n,r}e.RC4=t._createHelper(o);var s=n.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(s)}(),r.RC4)},706:function(e,t,n){var r;e.exports=(r=n(8249),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=o.create([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]),c=o.create([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]),l=o.create([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]),u=o.create([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]),d=o.create([0,1518500249,1859775393,2400959708,2840853838]),p=o.create([1352829926,1548603684,1836072691,2053994217,0]),h=s.RIPEMD160=i.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i,s,h,b,w,x,E,C,S,T,k,I=this._hash.words,P=d.words,A=p.words,O=a.words,N=c.words,R=l.words,M=u.words;for(x=i=I[0],E=s=I[1],C=h=I[2],S=b=I[3],T=w=I[4],n=0;n<80;n+=1)k=i+e[t+O[n]]|0,k+=n<16?f(s,h,b)+P[0]:n<32?m(s,h,b)+P[1]:n<48?g(s,h,b)+P[2]:n<64?_(s,h,b)+P[3]:y(s,h,b)+P[4],k=(k=v(k|=0,R[n]))+w|0,i=w,w=b,b=v(h,10),h=s,s=k,k=x+e[t+N[n]]|0,k+=n<16?y(E,C,S)+A[0]:n<32?_(E,C,S)+A[1]:n<48?g(E,C,S)+A[2]:n<64?m(E,C,S)+A[3]:f(E,C,S)+A[4],k=(k=v(k|=0,M[n]))+T|0,x=T,T=S,S=v(C,10),C=E,E=k;k=I[1]+h+S|0,I[1]=I[2]+b+T|0,I[2]=I[3]+w+x|0,I[3]=I[4]+i+E|0,I[4]=I[0]+s+C|0,I[0]=k},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,i=o.words,s=0;s<5;s++){var a=i[s];i[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,n){return e^t^n}function m(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function _(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function v(e,t){return e<<t|e>>>32-t}t.RIPEMD160=i._createHelper(h),t.HmacRIPEMD160=i._createHmacHelper(h)}(Math),r.RIPEMD160)},2783:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(o=(r=u=n(8249)).lib,i=o.WordArray,s=o.Hasher,a=r.algo,c=[],l=a.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],l=0;l<80;l++){if(l<16)c[l]=0|e[t+l];else{var u=c[l-3]^c[l-8]^c[l-14]^c[l-16];c[l]=u<<1|u>>>31}var d=(r<<5|r>>>27)+a+c[l];d+=l<20?1518500249+(o&i|~o&s):l<40?1859775393+(o^i^s):l<60?(o&i|o&s|i&s)-1894007588:(o^i^s)-899497514,a=s,s=i,i=o<<30|o>>>2,o=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=s._createHelper(l),r.HmacSHA1=s._createHmacHelper(l),u.SHA1)},7792:function(e,t,n){var r,o,i,s,a,c;e.exports=(c=n(8249),n(2153),o=(r=c).lib.WordArray,i=r.algo,s=i.SHA256,a=i.SHA224=s.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=s._createHelper(a),r.HmacSHA224=s._createHmacHelper(a),c.SHA224)},2153:function(e,t,n){var r;e.exports=(r=n(8249),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(a[o]=n(e.pow(r,.5))),c[o]=n(e.pow(r,1/3)),o++),r++}();var l=[],u=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],u=n[5],d=n[6],p=n[7],h=0;h<64;h++){if(h<16)l[h]=0|e[t+h];else{var f=l[h-15],m=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,g=l[h-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[h]=m+l[h-7]+_+l[h-16]}var y=r&o^r&i^o&i,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&d)+c[h]+l[h];p=d,d=u,u=a,a=s+b|0,s=i,i=o,o=r,r=b+(v+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(u),t.HmacSHA256=i._createHmacHelper(u)}(Math),r.SHA256)},3327:function(e,t,n){var r;e.exports=(r=n(8249),n(4938),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.x64.Word,a=t.algo,c=[],l=[],u=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var o=1,i=0;i<24;i++){for(var a=0,d=0,p=0;p<7;p++){if(1&o){var h=(1<<p)-1;h<32?d^=1<<h:a^=1<<h-32}128&o?o=o<<1^113:o<<=1}u[i]=s.create(a,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=s.create()}();var p=a.SHA3=i.extend({cfg:i.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,o=0;o<r;o++){var i=e[t+2*o],s=e[t+2*o+1];i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(I=n[o]).high^=s,I.low^=i}for(var a=0;a<24;a++){for(var p=0;p<5;p++){for(var h=0,f=0,m=0;m<5;m++)h^=(I=n[p+5*m]).high,f^=I.low;var g=d[p];g.high=h,g.low=f}for(p=0;p<5;p++){var _=d[(p+4)%5],y=d[(p+1)%5],v=y.high,b=y.low;for(h=_.high^(v<<1|b>>>31),f=_.low^(b<<1|v>>>31),m=0;m<5;m++)(I=n[p+5*m]).high^=h,I.low^=f}for(var w=1;w<25;w++){var x=(I=n[w]).high,E=I.low,C=c[w];C<32?(h=x<<C|E>>>32-C,f=E<<C|x>>>32-C):(h=E<<C-32|x>>>64-C,f=x<<C-32|E>>>64-C);var S=d[l[w]];S.high=h,S.low=f}var T=d[0],k=n[0];for(T.high=k.high,T.low=k.low,p=0;p<5;p++)for(m=0;m<5;m++){var I=n[w=p+5*m],P=d[w],A=d[(p+1)%5+5*m],O=d[(p+2)%5+5*m];I.high=P.high^~A.high&O.high,I.low=P.low^~A.low&O.low}I=n[0];var N=u[a];I.high^=N.high,I.low^=N.low}},_doFinalize:function(){var t=this._data,n=t.words,r=(this._nDataBytes,8*t.sigBytes),i=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/i)*i>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,c=a/8,l=[],u=0;u<c;u++){var d=s[u],p=d.high,h=d.low;p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),l.push(h),l.push(p)}return new o.init(l,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=i._createHelper(p),t.HmacSHA3=i._createHmacHelper(p)}(Math),r.SHA3)},7460:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(u=n(8249),n(4938),n(34),o=(r=u).x64,i=o.Word,s=o.WordArray,a=r.algo,c=a.SHA512,l=a.SHA384=c.extend({_doReset:function(){this._hash=new s.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=c._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=c._createHelper(l),r.HmacSHA384=c._createHmacHelper(l),u.SHA384)},34:function(e,t,n){var r;e.exports=(r=n(8249),n(4938),function(){var e=r,t=e.lib.Hasher,n=e.x64,o=n.Word,i=n.WordArray,s=e.algo;function a(){return o.create.apply(o,arguments)}var c=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=a()}();var u=s.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],u=n[5],d=n[6],p=n[7],h=r.high,f=r.low,m=o.high,g=o.low,_=i.high,y=i.low,v=s.high,b=s.low,w=a.high,x=a.low,E=u.high,C=u.low,S=d.high,T=d.low,k=p.high,I=p.low,P=h,A=f,O=m,N=g,R=_,M=y,L=v,$=b,D=w,F=x,j=E,q=C,B=S,U=T,H=k,z=I,W=0;W<80;W++){var V,G,K=l[W];if(W<16)G=K.high=0|e[t+2*W],V=K.low=0|e[t+2*W+1];else{var J=l[W-15],X=J.high,Q=J.low,Y=(X>>>1|Q<<31)^(X>>>8|Q<<24)^X>>>7,Z=(Q>>>1|X<<31)^(Q>>>8|X<<24)^(Q>>>7|X<<25),ee=l[W-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,oe=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ie=l[W-7],se=ie.high,ae=ie.low,ce=l[W-16],le=ce.high,ue=ce.low;G=(G=(G=Y+se+((V=Z+ae)>>>0<Z>>>0?1:0))+re+((V+=oe)>>>0<oe>>>0?1:0))+le+((V+=ue)>>>0<ue>>>0?1:0),K.high=G,K.low=V}var de,pe=D&j^~D&B,he=F&q^~F&U,fe=P&O^P&R^O&R,me=A&N^A&M^N&M,ge=(P>>>28|A<<4)^(P<<30|A>>>2)^(P<<25|A>>>7),_e=(A>>>28|P<<4)^(A<<30|P>>>2)^(A<<25|P>>>7),ye=(D>>>14|F<<18)^(D>>>18|F<<14)^(D<<23|F>>>9),ve=(F>>>14|D<<18)^(F>>>18|D<<14)^(F<<23|D>>>9),be=c[W],we=be.high,xe=be.low,Ee=H+ye+((de=z+ve)>>>0<z>>>0?1:0),Ce=_e+me;H=B,z=U,B=j,U=q,j=D,q=F,D=L+(Ee=(Ee=(Ee=Ee+pe+((de+=he)>>>0<he>>>0?1:0))+we+((de+=xe)>>>0<xe>>>0?1:0))+G+((de+=V)>>>0<V>>>0?1:0))+((F=$+de|0)>>>0<$>>>0?1:0)|0,L=R,$=M,R=O,M=N,O=P,N=A,P=Ee+(ge+fe+(Ce>>>0<_e>>>0?1:0))+((A=de+Ce|0)>>>0<de>>>0?1:0)|0}f=r.low=f+A,r.high=h+P+(f>>>0<A>>>0?1:0),g=o.low=g+N,o.high=m+O+(g>>>0<N>>>0?1:0),y=i.low=y+M,i.high=_+R+(y>>>0<M>>>0?1:0),b=s.low=b+$,s.high=v+L+(b>>>0<$>>>0?1:0),x=a.low=x+F,a.high=w+D+(x>>>0<F>>>0?1:0),C=u.low=C+q,u.high=E+j+(C>>>0<q>>>0?1:0),T=d.low=T+U,d.high=S+B+(T>>>0<U>>>0?1:0),I=p.low=I+z,p.high=k+H+(I>>>0<z>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),r.SHA512)},4253:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib,n=t.WordArray,o=t.BlockCipher,i=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=i.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=s[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var o=this._subKeys=[],i=0;i<16;i++){var l=o[i]=[],u=c[i];for(n=0;n<24;n++)l[n/6|0]|=t[(a[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=t[28+(a[n+24]-1+u)%28]<<31-n%6;for(l[0]=l[0]<<1|l[0]>>>31,n=1;n<7;n++)l[n]=l[n]>>>4*(n-1)+3;l[7]=l[7]<<5|l[7]>>>27}var d=this._invSubKeys=[];for(n=0;n<16;n++)d[n]=o[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],p.call(this,4,252645135),p.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),p.call(this,1,1431655765);for(var r=0;r<16;r++){for(var o=n[r],i=this._lBlock,s=this._rBlock,a=0,c=0;c<8;c++)a|=l[c][((s^o[c])&u[c])>>>0];this._lBlock=s,this._rBlock=i^a}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,p.call(this,1,1431655765),h.call(this,8,16711935),h.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function p(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function h(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}e.DES=o._createHelper(d);var f=i.TripleDES=o.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),o=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(o))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(f)}(),r.TripleDES)},4938:function(e,t,n){var r,o,i,s,a,c;e.exports=(r=n(8249),i=(o=r).lib,s=i.Base,a=i.WordArray,(c=o.x64={}).Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),c.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var o=e[r];n.push(o.high),n.push(o.low)}return a.create(n,this.sigBytes)},clone:function(){for(var e=s.clone.call(this),t=e.words=this.words.slice(0),n=t.length,r=0;r<n;r++)t[r]=t[r].clone();return e}}),r)},1758:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(2447)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,i,s=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];n=i.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(7824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},8104:(e,t,n)=>{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=n(1758):e.exports=n(39)},39:(e,t,n)=>{const r=n(6224),o=n(3837);t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(o.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),i=` ${o};1m${r} `;n[0]=i+n[0].split("\n").join("\n"+i),n.push(o+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=o.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=n(2130);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=n(2447)(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts)}},1906:e=>{"use strict";e.exports=(e,t,n)=>{const r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=n();return r(e),e},set(e){r(e)}}),e}},8604:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(4953);t.AzureMonitorSymbol="Azure_Monitor_Tracer";var i=function(){function e(){}return e.prototype.onStart=function(e){},e.prototype.onEnd=function(e){o.channel.publish("azure-coretracing",e)},e.prototype.shutdown=function(){},e}();t.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:function(e){try{var s=new(0,n(8028).BasicTracer)(o.channel.spanContextPropagator?{scopeManager:o.channel.spanContextPropagator}:void 0),a=s.startSpan;s.startSpan=function(e,t){if(!t||!t.parent){var n=s.getCurrentSpan();n&&n.operation&&n.operation.traceparent&&(t=r({},t,{parent:{traceId:n.operation.traceparent.traceId,spanId:n.operation.traceparent.spanId}}))}var o=a.call(this,e,t);return o.addEvent("Application Insights Integration enabled"),o},s.addSpanProcessor(new i),s[t.AzureMonitorSymbol]=!0,e.setTracer(s)}catch(e){}return e}},t.enable=function(){o.channel.registerMonkeyPatch("@azure/core-tracing",t.azureCoreTracing)}},8859:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953);t.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:function(e){var t=e.prototype._emit;return e.prototype._emit=function(e,n){var o=t.apply(this,arguments);if(!n){var i=o;i||(i=t.call(this,e,!0)),r.channel.publish("bunyan",{level:e.level,result:i})}return o},e}},t.enable=function(){r.channel.registerMonkeyPatch("bunyan",t.bunyan)}},2495:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953),o=n(2781);t.console={versionSpecifier:">= 4.0.0",patch:function(e){var t=new o.Writable,n=new o.Writable;t.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t}),!0},n.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t,stderr:!0}),!0};for(var i=new e.Console(t,n),s=function(t){var n=e[t];n&&(e[t]=function(){if(i[t])try{i[t].apply(i,arguments)}catch(e){}return n.apply(e,arguments)})},a=0,c=["log","info","warn","error","dir","time","timeEnd","trace","assert"];a<c.length;a++)s(c[a]);return e}},t.enable=function(){r.channel.registerMonkeyPatch("console",t.console),n(6206)}},4106:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8604);t.azuresdk=r;var o=n(8859);t.bunyan=o;var i=n(2495);t.console=i;var s=n(2028);t.mongodbCore=s;var a=n(8436);t.mongodb=a;var c=n(8002);t.mysql=c;var l=n(9024);t.pgPool=l;var u=n(8060);t.pg=u;var d=n(4487);t.redis=d;var p=n(6661);t.tedious=p;var h=n(4650);t.winston=h,t.enable=function(){o.enable(),i.enable(),s.enable(),a.enable(),c.enable(),u.enable(),l.enable(),d.enable(),h.enable(),r.enable(),p.enable()}},2028:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953);t.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:function(e){var t=e.Server.prototype.connect;return e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.pool.write;this.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=r.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var o=this.s.pool.logout;return this.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=r.channel.bindToContext(arguments[1])),o.apply(this,arguments)},e},e}},t.enable=function(){r.channel.registerMonkeyPatch("mongodb-core",t.mongoCore)}},8436:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(4953);t.mongo2={versionSpecifier:">= 2.0.0 <= 3.0.5",patch:function(e){var t=e.instrument({operationIdGenerator:{next:function(){return o.channel.bindToContext((function(e){return e()}))}}}),n={};return t.on("started",(function(e){n[e.requestId]||(n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})):o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})):o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),e}},t.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:function(e){var t=e.instrument(),n={},i={};return t.on("started",(function(e){n[e.requestId]||(i[e.requestId]=o.channel.bindToContext((function(e){return e()})),n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof i[e.requestId]&&(i[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete i[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof i[e.requestId]&&(i[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete i[e.requestId])})),e}},t.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:function(e){!function(e){var t=e.Server.prototype.connect;e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.coreTopology.s.pool.write;this.s.coreTopology.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=o.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var r=this.s.coreTopology.s.pool.logout;return this.s.coreTopology.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=o.channel.bindToContext(arguments[1])),r.apply(this,arguments)},e}}(e);var t=e.instrument(),n={},r={};return t.on("started",(function(e){n[e.requestId]||(r[e.requestId]=o.channel.bindToContext((function(e){return e()})),n[e.requestId]=e)})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete r[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete r[e.requestId])})),e}},t.enable=function(){o.channel.registerMonkeyPatch("mongodb",t.mongo2),o.channel.registerMonkeyPatch("mongodb",t.mongo3),o.channel.registerMonkeyPatch("mongodb",t.mongo330)}},8002:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953),o=n(1017);t.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:function(e,t){var i=function(e,t){return function(t,n){var o=e[t];o&&(e[t]=function(){for(var e=arguments.length-1,t=arguments.length-1;t>=0;--t){if("function"==typeof arguments[t]){e=t;break}if(void 0!==arguments[t])break}var i=arguments[e],s={result:null,startTime:null,startDate:null};"function"==typeof i&&(n?(s.startTime=process.hrtime(),s.startDate=new Date,arguments[e]=r.channel.bindToContext(n(s,i))):arguments[e]=r.channel.bindToContext(i));var a=o.apply(this,arguments);return s.result=a,a})}},s=function(e,t){return i(e.prototype)},a=n(4694)(o.dirname(t)+"/lib/Connection");["connect","changeUser","ping","statistics","end"].forEach((function(e){return s(a)(e)})),i(a)("createQuery",(function(e,t){return function(n){var o=process.hrtime(e.startTime),i=1e3*o[0]+o[1]/1e6|0;r.channel.publish("mysql",{query:e.result,callbackArgs:arguments,err:n,duration:i,time:e.startDate}),t.apply(this,arguments)}}));var c=n(420)(o.dirname(t)+"/lib/Pool");return["_enqueueCallback"].forEach((function(e){return s(c)(e)})),e}},t.enable=function(){r.channel.registerMonkeyPatch("mysql",t.mysql)}},9024:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953);t.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:function(e){var t=e.prototype.connect;return e.prototype.connect=function(e){return e&&(arguments[0]=r.channel.bindToContext(e)),t.apply(this,arguments)},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg-pool",t.postgresPool1)}},8060:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953),o=n(2361);t.postgres6={versionSpecifier:"6.*",patch:function(e,t){var n=e.Client.prototype.query,i="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},l=process.hrtime();function u(e){e&&e[i]&&(e=e[i]);var t=r.channel.bindToContext((function(t,n){var i=process.hrtime(l);if(c.result=n&&{rowCount:n.rowCount,command:n.command},c.error=t,c.duration=Math.ceil(1e3*i[0]+i[1]/1e6),r.channel.publish("postgres",c),t){if(e)return e.apply(this,arguments);a&&a instanceof o.EventEmitter&&a.emit("error",t)}else e&&e.apply(this,arguments)}));try{return Object.defineProperty(t,i,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(c.query.preparable={text:e,args:t},s=u(s)):(c.query.text=e,s?s=u(s):t=u(t)):("string"==typeof e.name?c.query.plan=e.name:e.values instanceof Array?c.query.preparable={text:e.text,args:e.values}:c.query.text=e.text,s?s=u(s):t?t=u(t):e.callback=u(e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments)},e}},t.postgres7={versionSpecifier:">=7.* <=8.*",patch:function(e,t){var n=e.Client.prototype.query,i="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c=this,l=!!s,u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},d=process.hrtime();function p(e){e&&e[i]&&(e=e[i]);var t=r.channel.bindToContext((function(t,n){var i=process.hrtime(d);if(u.result=n&&{rowCount:n.rowCount,command:n.command},u.error=t,u.duration=Math.ceil(1e3*i[0]+i[1]/1e6),r.channel.publish("postgres",u),t){if(e)return e.apply(this,arguments);a&&a instanceof o.EventEmitter&&a.emit("error",t)}else e&&e.apply(this,arguments)}));try{return Object.defineProperty(t,i,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(u.query.preparable={text:e,args:t},s=(l="function"==typeof s)?p(s):s):(u.query.text=e,s?s=(l="function"==typeof s)?p(s):s:t=(l="function"==typeof t)?p(t):t):("string"==typeof e.name?u.query.plan=e.name:e.values instanceof Array?u.query.preparable={text:e.text,args:e.values}:u.query.text=e.text,s?(l="function"==typeof s,s=p(s)):t?t=(l="function"==typeof t)?p(t):t:(l="function"==typeof e.callback,e.callback=l?p(e.callback):e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments),l?a:a.then((function(e){return p()(void 0,e),new c._Promise((function(t,n){t(e)}))})).catch((function(e){return p()(e,void 0),new c._Promise((function(t,n){n(e)}))}))},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg",t.postgres6),r.channel.registerMonkeyPatch("pg",t.postgres7)}},4487:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953);t.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:function(e){var t=e.RedisClient.prototype.internal_send_command;return e.RedisClient.prototype.internal_send_command=function(e){if(e){var n=e.callback;if(!n||!n.pubsubBound){var o=this.address,i=process.hrtime(),s=new Date;e.callback=r.channel.bindToContext((function(t,a){var c=process.hrtime(i),l=1e3*c[0]+c[1]/1e6|0;r.channel.publish("redis",{duration:l,address:o,commandObj:e,err:t,result:a,time:s}),"function"==typeof n&&n.apply(this,arguments)})),e.callback.pubsubBound=!0}}return t.call(this,e)},e}},t.enable=function(){r.channel.registerMonkeyPatch("redis",t.redis)}},6661:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(4953);t.tedious={versionSpecifier:">= 6.0.0 < 9.0.0",patch:function(e){var t=e.Connection.prototype.makeRequest;return e.Connection.prototype.makeRequest=function(){function e(e){var t=process.hrtime(),n={query:{},database:{host:null,port:null},result:null,error:null,duration:0};return o.channel.bindToContext((function(i,s,a){var c=process.hrtime(t);n=r({},n,{database:{host:this.connection.config.server,port:this.connection.config.options.port},result:!i&&{rowCount:s,rows:a},query:{text:this.parametersByName.statement.value},error:i,duration:Math.ceil(1e3*c[0]+c[1]/1e6)}),o.channel.publish("tedious",n),e.call(this,i,s,a)}))}var n=arguments[0];arguments[0].callback=e(n.callback),t.apply(this,arguments)},e}},t.enable=function(){o.channel.registerMonkeyPatch("tedious",t.tedious)}},4650:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(4953);t.winston3={versionSpecifier:"3.x",patch:function(e){var t=function(e){function t(t,n){var r=e.call(this,n)||this;return r.winston=t,r}return o(t,e),t.prototype.log=function(e,t){var n=e.message,r=e.level,o=e.meta,a=i(e,["message","level","meta"]);r="function"==typeof Symbol.for?e[Symbol.for("level")]:r,n=e instanceof Error?e:n;var c=function(e,t){return null!=e.config.npm.levels[t]?"npm":null!=e.config.syslog.levels[t]?"syslog":"unknown"}(this.winston,r);for(var l in o=o||{},a)a.hasOwnProperty(l)&&(o[l]=a[l]);s.channel.publish("winston",{message:n,level:r,levelKind:c,meta:o}),t()},t}(e.Transport);function n(){var n,r=arguments[0].levels||e.config.npm.levels;for(var o in r)r.hasOwnProperty(o)&&(n=void 0===n||r[o]>r[n]?o:n);this.add(new t(e,{level:n}))}var r=e.createLogger;e.createLogger=function(){var o,i=arguments[0].levels||e.config.npm.levels;for(var s in i)i.hasOwnProperty(s)&&(o=void 0===o||i[s]>i[o]?s:o);var a=r.apply(this,arguments);a.add(new t(e,{level:o}));var c=a.configure;return a.configure=function(){c.apply(this,arguments),n.apply(this,arguments)},a};var a=e.createLogger;return e.configure=function(){a.apply(this,arguments),n.apply(this,arguments)},e.add(new t(e)),e}},t.winston2={versionSpecifier:"2.x",patch:function(e){var t,n=e.Logger.prototype.log,r=function(n,r,o){var i;return i=t===e.config.npm.levels?"npm":t===e.config.syslog.levels?"syslog":"unknown",s.channel.publish("winston",{level:n,message:r,meta:o,levelKind:i}),r};return e.Logger.prototype.log=function(){return t=this.levels,this.filters&&0!==this.filters.length?this.filters[this.filters.length-1]!==r&&(this.filters=this.filters.filter((function(e){return e!==r})),this.filters.push(r)):this.filters=[r],n.apply(this,arguments)},e}},t.enable=function(){s.channel.registerMonkeyPatch("winston",t.winston2),s.channel.registerMonkeyPatch("winston",t.winston3)}},4694:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=4694,e.exports=t},420:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=420,e.exports=t},4953:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7424),o=n(7424);t.makePatchingRequire=o.makePatchingRequire;var i=function(e){return!0},s=function(){function e(){this.version=n(130).i8,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.currentlyPublishing=!1}return e.prototype.shouldPublish=function(e){var t=this.subscribers[e];return!!t&&t.some((function(e){var t=e.filter;return!t||t(!1)}))},e.prototype.publish=function(e,t){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var r={timestamp:Date.now(),data:t};this.currentlyPublishing=!0,n.forEach((function(e){var t=e.listener,n=e.filter;try{n&&n(!0)&&t(r)}catch(e){}})),this.currentlyPublishing=!1}}},e.prototype.subscribe=function(e,t,n){void 0===n&&(n=i),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:t,filter:n})},e.prototype.unsubscribe=function(e,t,n){void 0===n&&(n=i);var r=this.subscribers[e];if(r)for(var o=0;o<r.length;++o)if(r[o].listener===t&&r[o].filter===n)return r.splice(o,1),!0;return!1},e.prototype.reset=function(){var e=this;this.subscribers={},this.contextPreservationFunction=function(e){return e},Object.getOwnPropertyNames(this.knownPatches).forEach((function(t){return delete e.knownPatches[t]}))},e.prototype.bindToContext=function(e){return this.contextPreservationFunction(e)},e.prototype.addContextPreservation=function(e){var t=this.contextPreservationFunction;this.contextPreservationFunction=function(n){return e(t(n))}},e.prototype.registerMonkeyPatch=function(e,t){this.knownPatches[e]||(this.knownPatches[e]=[]),this.knownPatches[e].push(t)},e.prototype.getPatchesObject=function(){return this.knownPatches},e}();global.diagnosticsSource||(global.diagnosticsSource=new s,n(8188).prototype.require=r.makePatchingRequire(global.diagnosticsSource.getPatchesObject())),t.channel=global.diagnosticsSource},7424:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1017),o=n(4014),i=n(8188),s=Object.keys(process.binding("natives")),a=i.prototype.require;t.makePatchingRequire=function(e){var t={};return function(n){var c=a.apply(this,arguments);if(e[n]){var l=i._resolveFilename(n,this);if(t.hasOwnProperty(l))return t[l];var u=void 0;if(s.indexOf(n)<0)try{u=a.call(this,r.join(n,"package.json")).version}catch(e){return c}else u=process.version.substring(1);var d=u.indexOf("-");d>=0&&(u=u.substring(0,d));for(var p=c,h=0,f=e[n];h<f.length;h++){var m=f[h];o.satisfies(u,m.versionSpecifier)&&(p=m.patch(p,l))}return t[l]=p}return c}}},4014:(e,t)=>{var n;t=e.exports=V,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var E=s++;i[E]=i[c]+"|x|X|\\*";var C=s++;i[C]=i[a]+"|x|X|\\*";var S=s++;i[S]="[v=\\s]*("+i[C]+")(?:\\.("+i[C]+")(?:\\.("+i[C]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var T=s++;i[T]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="^"+i[x]+"\\s*"+i[T]+"$";var P=s++;i[P]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var A=s++;i[A]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[A]+"\\s+",o[O]=new RegExp(i[O],"g");var N=s++;i[N]="^"+i[A]+i[S]+"$";var R=s++;i[R]="^"+i[A]+i[T]+"$";var M=s++;i[M]="(?:\\^)";var L=s++;i[L]="(\\s*)"+i[M]+"\\s+",o[L]=new RegExp(i[L],"g");var $=s++;i[$]="^"+i[M]+i[S]+"$";var D=s++;i[D]="^"+i[M]+i[T]+"$";var F=s++;i[F]="^"+i[x]+"\\s*("+b+")$|^$";var j=s++;i[j]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[S]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var U=s++;i[U]="^\\s*("+i[T]+")\\s+-\\s+("+i[T]+")\\s*$";var H=s++;i[H]="(<|>)?=?\\s*\\*";for(var z=0;z<35;z++)n(z,i[z]),o[z]||(o[z]=new RegExp(i[z]));function W(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof V)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new V(e,t)}catch(e){return null}}function V(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof V){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof V))return new V(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);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>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<r)return t}return e})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}t.parse=W,t.valid=function(e,t){var n=W(e,t);return n?n.version:null},t.clean=function(e,t){var n=W(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null},t.SemVer=V,V.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},V.prototype.toString=function(){return this.version},V.prototype.compare=function(e){return n("SemVer.compare",this.version,this.options,e),e instanceof V||(e=new V(e,this.options)),this.compareMain(e)||this.comparePre(e)},V.prototype.compareMain=function(e){return e instanceof V||(e=new V(e,this.options)),K(this.major,e.major)||K(this.minor,e.minor)||K(this.patch,e.patch)},V.prototype.comparePre=function(e){if(e instanceof V||(e=new V(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],o=e.prerelease[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return K(r,o)}while(++t)},V.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new V(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=W(e),r=W(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=K;var G=/^[0-9]+$/;function K(e,t){var n=G.test(e),r=G.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1}function J(e,t,n){return new V(e,n).compare(new V(t,n))}function X(e,t,n){return J(e,t,n)>0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return K(t,e)},t.major=function(e,t){return new V(e,t).major},t.minor=function(e,t){return new V(e,t).minor},t.patch=function(e,t){return new V(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o<e.length;o++)if(!e[o].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(o=0;o<e.length;o++)if(n(e[o].semver),e[o].semver!==oe&&e[o].semver.prerelease.length>0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new V(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l<t.set.length;++l){var u=t.set[l],d=null,p=null;if(u.forEach((function(e){e.semver===oe&&(e=new re(">=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[F]:o[j],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new V(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new V(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[U]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[L],"$1^")).split(/\s+/).join(" ");var i=t?o[F]:o[j],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[D]:o[$];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[R]:o[N];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[I]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[H],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new V(e,this.options));for(var t=0;t<this.set.length;t++)if(ce(this.set[t],e,this.options))return!0;return!1},t.satisfies=le,t.maxSatisfying=function(e,t,n){var r=null,o=null;try{var i=new ie(t,n)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(r&&-1!==o.compare(e)||(o=new V(r=e,n)))})),r},t.minSatisfying=function(e,t,n){var r=null,o=null;try{var i=new ie(t,n)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(r&&1!==o.compare(e)||(o=new V(r=e,n)))})),r},t.minVersion=function(e,t){e=new ie(e,t);var n=new V("0.0.0");if(e.test(n))return n;if(n=new V("0.0.0-0"),e.test(n))return n;n=null;for(var r=0;r<e.set.length;++r)e.set[r].forEach((function(e){var t=new V(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=W(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof V)return e;if("string"!=typeof e)return null;var t=e.match(o[P]);return null==t?null:W(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},9867:(e,t,n)=>{"use strict";var r=n(6372),o=r.wrap,i=r.unwrap,s="wrap@before";function a(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function c(e,t){var n;return n=e._events&&e._events[t],Array.isArray(n)||(n=n?[n]:[]),n}function l(e,t){if(e){var n=e;if("function"==typeof e)n=t(e);else if(Array.isArray(e)){n=[];for(var r=0;r<e.length;r++)n[r]=t(e[r])}return n}}e.exports=function(e,t,n){if(!(e&&e.on&&e.addListener&&e.removeListener&&e.emit))throw new Error("can only wrap real EEs");if(!t)throw new Error("must have function to run on listener addition");if(!n)throw new Error("must have function to wrap listeners when emitting");function r(e){return function(t,n){var i=c(this,t).slice();try{var a=e.call(this,t,n);return function(e,t,n){var r=c(e,t).filter((function(e){return-1===n.indexOf(e)}));r.length>0&&function(e,t){for(var n=t.length,r=0;r<n;r++){var o=t[r],i=e[s];if("function"==typeof i)i(o);else if(Array.isArray(i))for(var a=i.length,c=0;c<a;c++)i[c](o)}}(e,r)}(this,t,i),a}finally{this.on.__wrapped||o(this,"on",r),this.addListener.__wrapped||o(this,"addListener",r)}}}e[s]?"function"==typeof e[s]?a(e,s,[e[s],t]):Array.isArray(e[s])&&e[s].push(t):a(e,s,t),e.__wrapped||(o(e,"addListener",r),o(e,"on",r),o(e,"emit",(function(e){return function(t){if(!this._events||!this._events[t])return e.apply(this,arguments);var r=this._events[t];function s(e){return function(){this._events[t]=r;try{return e.apply(this,arguments)}finally{r=this._events[t],this._events[t]=l(r,n)}}}o(this,"removeListener",s);try{return this._events[t]=l(r,n),e.apply(this,arguments)}finally{i(this,"removeListener"),this._events[t]=r}}})),a(e,"__unwrap",(function(){i(e,"addListener"),i(e,"on"),i(e,"emit"),delete e[s],delete e.__wrapped})),a(e,"__wrapped",!0))}},4063:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},9266:(e,t,n)=>{"use strict";var r=n(3905),o=n(9073);e.exports=function(e){var t=r(e);return t.token="","x-oauth-basic"===t.password?t.token=t.user:"x-token-auth"===t.user&&(t.token=t.password),o(t.protocols)||0===t.protocols.length&&o(e)?t.protocol="ssh":t.protocols.length?t.protocol=t.protocols[0]:(t.protocol="file",t.protocols=["file"]),t.href=t.href.replace(/\/$/,""),t}},3458:(e,t,n)=>{"use strict";var r=n(9266);function o(e){if("string"!=typeof e)throw new Error("The url must be a string.");/^([a-z\d-]{1,39})\/([-\.\w]{1,100})$/i.test(e)&&(e="https://github.com/"+e);var t=r(e),n=t.resource.split("."),i=null;switch(t.toString=function(e){return o.stringify(this,e)},t.source=n.length>2?n.slice(1-n.length).join("."):t.source=t.resource,t.git_suffix=/\.git$/.test(t.pathname),t.name=decodeURIComponent((t.pathname||t.href).replace(/(^\/)|(\/$)/g,"").replace(/\.git$/,"")),t.owner=decodeURIComponent(t.user),t.source){case"git.cloudforge.com":t.owner=t.user,t.organization=n[0],t.source="cloudforge.com";break;case"visualstudio.com":if("vs-ssh.visualstudio.com"===t.resource){4===(i=t.name.split("/")).length&&(t.organization=i[1],t.owner=i[2],t.name=i[3],t.full_name=i[2]+"/"+i[3]);break}2===(i=t.name.split("/")).length?(t.owner=i[1],t.name=i[1],t.full_name="_git/"+t.name):3===i.length?(t.name=i[2],"DefaultCollection"===i[0]?(t.owner=i[2],t.organization=i[0],t.full_name=t.organization+"/_git/"+t.name):(t.owner=i[0],t.full_name=t.owner+"/_git/"+t.name)):4===i.length&&(t.organization=i[0],t.owner=i[1],t.name=i[3],t.full_name=t.organization+"/"+t.owner+"/_git/"+t.name);break;case"dev.azure.com":case"azure.com":if("ssh.dev.azure.com"===t.resource){4===(i=t.name.split("/")).length&&(t.organization=i[1],t.owner=i[2],t.name=i[3]);break}5===(i=t.name.split("/")).length?(t.organization=i[0],t.owner=i[1],t.name=i[4],t.full_name="_git/"+t.name):3===i.length?(t.name=i[2],"DefaultCollection"===i[0]?(t.owner=i[2],t.organization=i[0],t.full_name=t.organization+"/_git/"+t.name):(t.owner=i[0],t.full_name=t.owner+"/_git/"+t.name)):4===i.length&&(t.organization=i[0],t.owner=i[1],t.name=i[3],t.full_name=t.organization+"/"+t.owner+"/_git/"+t.name),t.query&&t.query.path&&(t.filepath=t.query.path.replace(/^\/+/g,"")),t.query&&t.query.version&&(t.ref=t.query.version.replace(/^GB/,""));break;default:var s=(i=t.name.split("/")).length-1;if(i.length>=2){var a=i.indexOf("-",2),c=i.indexOf("blob",2),l=i.indexOf("tree",2),u=i.indexOf("commit",2),d=i.indexOf("src",2),p=i.indexOf("raw",2),h=i.indexOf("edit",2);s=a>0?a-1:c>0?c-1:l>0?l-1:u>0?u-1:d>0?d-1:p>0?p-1:h>0?h-1:s,t.owner=i.slice(0,s).join("/"),t.name=i[s],u&&(t.commit=i[s+2])}t.ref="",t.filepathtype="",t.filepath="";var f=i.length>s&&"-"===i[s+1]?s+1:s;i.length>f+2&&["raw","src","blob","tree","edit"].indexOf(i[f+1])>=0&&(t.filepathtype=i[f+1],t.ref=i[f+2],i.length>f+3&&(t.filepath=i.slice(f+3).join("/"))),t.organization=t.owner}t.full_name||(t.full_name=t.owner,t.name&&(t.full_name&&(t.full_name+="/"),t.full_name+=t.name)),t.owner.startsWith("scm/")&&(t.source="bitbucket-server",t.owner=t.owner.replace("scm/",""),t.organization=t.owner,t.full_name=t.owner+"/"+t.name);var m=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/.exec(t.pathname);return null!=m&&(t.source="bitbucket-server","users"===m[1]?t.owner="~"+m[2]:t.owner=m[2],t.organization=t.owner,t.name=m[3],(i=m[4].split("/")).length>1&&(["raw","browse"].indexOf(i[1])>=0?(t.filepathtype=i[1],i.length>2&&(t.filepath=i.slice(2).join("/"))):"commits"===i[1]&&i.length>2&&(t.commit=i[2])),t.full_name=t.owner+"/"+t.name,t.query.at?t.ref=t.query.at:t.ref=""),t}o.stringify=function(e,t){t=t||(e.protocols&&e.protocols.length?e.protocols.join("+"):e.protocol);var n=e.port?":"+e.port:"",r=e.user||"git",o=e.git_suffix?".git":"";switch(t){case"ssh":return n?"ssh://"+r+"@"+e.resource+n+"/"+e.full_name+o:r+"@"+e.resource+":"+e.full_name+o;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return t+"://"+r+"@"+e.resource+n+"/"+e.full_name+o;case"http":case"https":return t+"://"+(e.token?function(e){return"bitbucket.org"===e.source?"x-token-auth:"+e.token+"@":e.token+"@"}(e):e.user&&(e.protocols.includes("http")||e.protocols.includes("https"))?e.user+"@":"")+e.resource+n+"/"+function(e){return"bitbucket-server"===e.source?"scm/"+e.full_name:""+e.full_name}(e)+o;default:return e.href}},e.exports=o},6560:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return-1!==r&&(-1===o||r<o)}},6214:e=>{"use strict";const t=new Set([200,203,204,206,300,301,404,405,410,414,501]),n=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),r=new Set([500,502,503,504]),o={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},i={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function s(e){const t=parseInt(e,10);return isFinite(t)?t:0}function a(e){const t={};if(!e)return t;const n=e.trim().split(/\s*,\s*/);for(const e of n){const[n,r]=e.split(/\s*=\s*/,2);t[n]=void 0===r||r.replace(/^"|"$/g,"")}return t}function c(e){let t=[];for(const n in e){const r=e[n];t.push(!0===r?n:n+"="+r)}if(t.length)return t.join(", ")}e.exports=class{constructor(e,t,{shared:n,cacheHeuristic:r,immutableMinTimeToLive:o,ignoreCargoCult:i,_fromObject:s}={}){if(s)this._fromObject(s);else{if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=!1!==n,this._cacheHeuristic=void 0!==r?r:.1,this._immutableMinTtl=void 0!==o?o:864e5,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=a(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=a(e.headers["cache-control"]),i&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":c(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),null==t.headers["cache-control"]&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}}now(){return Date.now()}storable(){return!(this._reqcc["no-store"]||!("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())||!n.has(this._status)||this._rescc["no-store"]||this._isShared&&this._rescc.private||this._isShared&&!this._noAuthorization&&!this._allowsStoringAuthenticated()||!(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||t.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);const t=a(e.headers["cache-control"]);return!t["no-cache"]&&!/no-cache/.test(e.headers.pragma)&&(!(t["max-age"]&&this.age()>t["max-age"])&&(!(t["min-fresh"]&&this.timeToLive()<1e3*t["min-fresh"])&&(!(this.stale()&&(!t["max-stale"]||this._rescc["must-revalidate"]||!(!0===t["max-stale"]||t["max-stale"]>this.age()-this.maxAge())))&&this._requestMatches(e,!1))))}_requestMatches(e,t){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&"HEAD"===e.method)&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if("*"===this._resHeaders.vary)return!1;const t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const n of t)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){const t={};for(const n in e)o[n]||(t[n]=e[n]);if(e.connection){const n=e.connection.trim().split(/\s*,\s*/);for(const e of n)delete t[e]}if(t.warning){const e=t.warning.split(/,/).filter((e=>!/^\s*1[0-9][0-9]/.test(e)));e.length?t.warning=e.join(",").trim():delete t.warning}return t}responseHeaders(){const e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>86400&&!this._hasExplicitExpiration()&&this.maxAge()>86400&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){const e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){return this._ageValue()+(this.now()-this._responseTime)/1e3}_ageValue(){return s(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"])return 0;if(this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)return 0;if("*"===this._resHeaders.vary)return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return s(this._rescc["s-maxage"])}if(this._rescc["max-age"])return s(this._rescc["max-age"]);const e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){const n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||n<t?0:Math.max(e,(n-t)/1e3)}if(this._resHeaders["last-modified"]){const n=Date.parse(this._resHeaders["last-modified"]);if(isFinite(n)&&t>n)return Math.max(e,(t-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){const e=this.maxAge()-this.age(),t=e+s(this._rescc["stale-if-error"]),n=e+s(this._rescc["stale-while-revalidate"]);return 1e3*Math.max(0,e,t,n)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+s(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+s(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||1!==e.v)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=void 0!==e.imm?e.imm:864e5,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);const t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&"GET"!=this._method){if(delete t["if-modified-since"],t["if-none-match"]){const e=t["if-none-match"].split(/,/).filter((e=>!/^\s*W\//.test(e)));e.length?t["if-none-match"]=e.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&function(e){return!e||r.has(e.status)}(t))return{modified:!1,matches:!1,policy:this};if(!t||!t.headers)throw Error("Response headers missing");let n=!1;if(void 0!==t.status&&304!=t.status?n=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===t.headers["last-modified"]:this._resHeaders.etag||this._resHeaders["last-modified"]||t.headers.etag||t.headers["last-modified"]||(n=!0),!n)return{policy:new this.constructor(e,t),modified:304!=t.status,matches:!1};const o={};for(const e in this._resHeaders)o[e]=e in t.headers&&!i[e]?t.headers[e]:this._resHeaders[e];const s=Object.assign({},t,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}},1595:(e,t,n)=>{"use strict";const r=n(7147);let o;e.exports=()=>(void 0===o&&(o=function(){try{return r.statSync("/.dockerenv"),!0}catch(e){return!1}}()||function(){try{return r.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch(e){return!1}}()),o)},9073:(e,t,n)=>{"use strict";var r=n(2337);e.exports=function e(t){if(Array.isArray(t))return-1!==t.indexOf("ssh")||-1!==t.indexOf("rsync");if("string"!=typeof t)return!1;var n=r(t);if(t=t.substring(t.indexOf("://")+3),e(n))return!0;var o=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(o)&&t.indexOf("@")<t.indexOf(":")}},2818:(e,t,n)=>{"use strict";const r=n(2037),o=n(7147),i=n(1595),s=()=>{if("linux"!==process.platform)return!1;if(r.release().toLowerCase().includes("microsoft"))return!i();try{return!!o.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")&&!i()}catch(e){return!1}};process.env.__IS_WSL_TEST__?e.exports=s:e.exports=s()},9461:e=>{"use strict";var t=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,r,o,i,s,a,c,l,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in r(i,s,a,c,l,u,d),i){var h=i[p];if(Array.isArray(h)){if(p in t.arrayKeywords)for(var f=0;f<h.length;f++)n(e,r,o,h[f],s+"/"+p+"/"+f,a,s,p,i,f)}else if(p in t.propsKeywords){if(h&&"object"==typeof h)for(var m in h)n(e,r,o,h[m],s+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),a,s,p,i,m)}else(p in t.keywords||e.allKeys&&!(p in t.skipKeywords))&&n(e,r,o,h,s+"/"+p,a,s,p,i)}o(i,s,a,c,l,u,d)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},7824:e=>{var t=1e3,n=60*t,r=60*n,o=24*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,s){s=s||{};var a,c,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(i){var s=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===l&&isFinite(e))return s.long?(a=e,(c=Math.abs(a))>=o?i(a,c,o,"day"):c>=r?i(a,c,r,"hour"):c>=n?i(a,c,n,"minute"):c>=t?i(a,c,t,"second"):a+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},8318:(e,t,n)=>{const r=n(1017),o=n(2081),{promises:i,constants:s}=n(7147),a=n(2818),c=n(1595),l=n(1906),u=r.join(__dirname,"xdg-open"),{platform:d,arch:p}=process,h=(()=>{const e="/mnt/";let t;return async function(){if(t)return t;const n="/etc/wsl.conf";let r=!1;try{await i.access(n,s.F_OK),r=!0}catch{}if(!r)return e;const o=await i.readFile(n,{encoding:"utf8"}),a=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(o);return a?(t=a.groups.mountPoint.trim(),t=t.endsWith("/")?t:`${t}/`,t):e}})(),f=async(e,t)=>{let n;for(const r of e)try{return await t(r)}catch(e){n=e}throw n},m=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return f(e.app,(t=>m({...e,app:t})));let t,{name:n,arguments:r=[]}=e.app||{};if(r=[...r],Array.isArray(n))return f(n,(t=>m({...e,app:{name:t,arguments:r}})));const l=[],p={};if("darwin"===d)t="open",e.wait&&l.push("--wait-apps"),e.background&&l.push("--background"),e.newInstance&&l.push("--new"),n&&l.push("-a",n);else if("win32"===d||a&&!c()){const o=await h();t=a?`${o}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,l.push("-NoProfile","-NonInteractive","–ExecutionPolicy","Bypass","-EncodedCommand"),a||(p.windowsVerbatimArguments=!0);const i=["Start"];e.wait&&i.push("-Wait"),n?(i.push(`"\`"${n}\`""`,"-ArgumentList"),e.target&&r.unshift(e.target)):e.target&&i.push(`"${e.target}"`),r.length>0&&(r=r.map((e=>`"\`"${e}\`""`)),i.push(r.join(","))),e.target=Buffer.from(i.join(" "),"utf16le").toString("base64")}else{if(n)t=n;else{const e="/"===__dirname;let n=!1;try{await i.access(u,s.X_OK),n=!0}catch{}t=process.versions.electron||"android"===d||e||!n?"xdg-open":u}r.length>0&&l.push(...r),e.wait||(p.stdio="ignore",p.detached=!0)}e.target&&l.push(e.target),"darwin"===d&&r.length>0&&l.push("--args",...r);const g=o.spawn(t,l,p);return e.wait?new Promise(((t,n)=>{g.once("error",n),g.once("close",(r=>{e.allowNonzeroExitCode&&r>0?n(new Error(`Exited with code ${r}`)):t(g)}))})):(g.unref(),g)},g=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");return m({...t,target:e})};function _(e){if("string"==typeof e||Array.isArray(e))return e;const{[p]:t}=e;if(!t)throw new Error(`${p} is not supported`);return t}function y({[d]:e},{wsl:t}){if(t&&a)return _(t);if(!e)throw new Error(`${d} is not supported`);return _(e)}const v={};l(v,"chrome",(()=>y({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}))),l(v,"firefox",(()=>y({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}))),l(v,"edge",(()=>y({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}))),g.apps=v,g.openApp=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `name`");const{arguments:n=[]}=t||{};if(null!=n&&!Array.isArray(n))throw new TypeError("Expected `appArguments` as Array type");return m({...t,app:{name:e,arguments:n}})},e.exports=g},6008:(e,t,n)=>{"use strict";var r=n(2337);e.exports=function(e){var t={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:e,query:{},parse_failed:!1};try{var n=new URL(e);t.protocols=r(n),t.protocol=t.protocols[0],t.port=n.port,t.resource=n.hostname,t.host=n.host,t.user=n.username||"",t.password=n.password||"",t.pathname=n.pathname,t.hash=n.hash.slice(1),t.search=n.search.slice(1),t.href=n.href,t.query=Object.fromEntries(n.searchParams)}catch(n){t.protocols=["file"],t.protocol=t.protocols[0],t.port="",t.resource="",t.user="",t.pathname="",t.hash="",t.search="",t.href=e,t.query={},t.parse_failed=!0}return t}},3905:(e,t,n)=>{"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(n(6008));const i=(e,t)=>t.some((t=>t instanceof RegExp?t.test(e):t===e));const s=(e,t=!1)=>{const n=/^(?:([a-z_][a-z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:]([\~,\.\w,\-,\_,\/]+?(?:\.git|\/)?)$/,r=t=>{const n=new Error(t);throw n.subject_url=e,n};"string"==typeof e&&e.trim()||r("Invalid url."),e.length>s.MAX_INPUT_LENGTH&&r("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),t&&("object"!=typeof t&&(t={stripHash:!1}),e=function(e,t){if(t={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...t},e=e.trim(),/^data:/i.test(e))return((e,{stripHash:t})=>{const n=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(e);if(!n)throw new Error(`Invalid URL: ${e}`);let{type:r,data:o,hash:i}=n.groups;const s=r.split(";");i=t?"":i;let a=!1;"base64"===s[s.length-1]&&(s.pop(),a=!0);const c=(s.shift()||"").toLowerCase(),l=[...s.map((e=>{let[t,n=""]=e.split("=").map((e=>e.trim()));return"charset"===t&&(n=n.toLowerCase(),"us-ascii"===n)?"":`${t}${n?`=${n}`:""}`})).filter(Boolean)];return a&&l.push("base64"),(l.length>0||c&&"text/plain"!==c)&&l.unshift(c),`data:${l.join(";")},${a?o.trim():o}${i?`#${i}`:""}`})(e,t);if(/^view-source:/i.test(e))throw new Error("`view-source:` is not supported as it is a non-standard protocol");const n=e.startsWith("//");!n&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));const r=new URL(e);if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&"https:"===r.protocol&&(r.protocol="http:"),t.forceHttps&&"http:"===r.protocol&&(r.protocol="https:"),t.stripAuthentication&&(r.username="",r.password=""),t.stripHash?r.hash="":t.stripTextFragment&&(r.hash=r.hash.replace(/#?:~:text.*?$/i,"")),r.pathname){const e=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let t=0,n="";for(;;){const o=e.exec(r.pathname);if(!o)break;const i=o[0],s=o.index;n+=r.pathname.slice(t,s).replace(/\/{2,}/g,"/"),n+=i,t=s+i.length}n+=r.pathname.slice(t,r.pathname.length).replace(/\/{2,}/g,"/"),r.pathname=n}if(r.pathname)try{r.pathname=decodeURI(r.pathname)}catch{}if(!0===t.removeDirectoryIndex&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=r.pathname.split("/");const n=e[e.length-1];i(n,t.removeDirectoryIndex)&&(e=e.slice(0,-1),r.pathname=e.slice(1).join("/")+"/")}if(r.hostname&&(r.hostname=r.hostname.replace(/\.$/,""),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(r.hostname)&&(r.hostname=r.hostname.replace(/^www\./,""))),Array.isArray(t.removeQueryParameters))for(const e of[...r.searchParams.keys()])i(e,t.removeQueryParameters)&&r.searchParams.delete(e);if(!0===t.removeQueryParameters&&(r.search=""),t.sortQueryParameters){r.searchParams.sort();try{r.search=decodeURIComponent(r.search)}catch{}}t.removeTrailingSlash&&(r.pathname=r.pathname.replace(/\/$/,""));const o=e;return e=r.toString(),t.removeSingleSlash||"/"!==r.pathname||o.endsWith("/")||""!==r.hash||(e=e.replace(/\/$/,"")),(t.removeTrailingSlash||"/"===r.pathname)&&""===r.hash&&t.removeSingleSlash&&(e=e.replace(/\/$/,"")),n&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}(e,t));const a=o.default(e);if(a.parse_failed){const e=a.href.match(n);e?(a.protocols=["ssh"],a.protocol="ssh",a.resource=e[2],a.host=e[2],a.user=e[1],a.pathname=`/${e[3]}`,a.parse_failed=!1):r("URL parsing failed.")}return a};s.MAX_INPUT_LENGTH=2048,e.exports=s},2337:e=>{"use strict";e.exports=function(e,t){!0===t&&(t=0);var n="";if("string"==typeof e)try{n=new URL(e).protocol}catch(e){}else e&&e.constructor===URL&&(n=e.protocol);var r=n.split(/\:|\+/).filter(Boolean);return"number"==typeof t?r[t]:r}},6372:e=>{"use strict";function t(e){return"function"==typeof e}var n=console.error.bind(console);function r(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function o(e){e&&e.logger&&(t(e.logger)?n=e.logger:n("new logger isn't a function, not replacing"))}function i(e,o,i){if(e&&e[o]){if(!i)return n("no wrapper function"),void n((new Error).stack);if(t(e[o])&&t(i)){var s=e[o],a=i(s,o);return r(a,"__original",s),r(a,"__unwrap",(function(){e[o]===a&&r(e,o,s)})),r(a,"__wrapped",!0),r(e,o,a),a}n("original object and wrapper must be functions")}else n("no original function "+o+" to wrap")}function s(e,t){return e&&e[t]?e[t].__unwrap?e[t].__unwrap():void n("no original to unwrap to -- has "+t+" already been unwrapped?"):(n("no function to unwrap."),void n((new Error).stack))}o.wrap=i,o.massWrap=function(e,t,r){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){i(e,t,r)}))})):n("must provide one or more functions to wrap on modules")},o.unwrap=s,o.massUnwrap=function(e,t){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){s(e,t)}))})):n("must provide one or more functions to unwrap on modules")},e.exports=o},406:(e,t,n)=>{n(6252).install()},6252:(e,t,n)=>{e=n.nmd(e);var r,o=n(9125).SourceMapConsumer,i=n(1017);try{(r=n(7147)).existsSync&&r.readFileSync||(r=null)}catch(e){}var s=n(5420);function a(e,t){return e.require(t)}var c=!1,l=!1,u=!1,d="auto",p={},h={},f=/^data:application\/json[^,]+base64,/,m=[],g=[];function _(){return"browser"===d||"node"!==d&&"undefined"!=typeof window&&"function"==typeof XMLHttpRequest&&!(window.require&&window.module&&window.process&&"renderer"===window.process.type)}function y(e){return function(t){for(var n=0;n<e.length;n++){var r=e[n](t);if(r)return r}return null}}var v=y(m);function b(e,t){if(!e)return t;var n=i.dirname(e),r=/^\w+:\/\/[^\/]*/.exec(n),o=r?r[0]:"",s=n.slice(o.length);return o&&/^\/\w\:/.test(s)?(o+="/")+i.resolve(n.slice(o.length),t).replace(/\\/g,"/"):o+i.resolve(n.slice(o.length),t)}m.push((function(e){if(e=e.trim(),/^file:/.test(e)&&(e=e.replace(/file:\/\/\/(\w:)?/,(function(e,t){return t?"":"/"}))),e in p)return p[e];var t="";try{if(r)r.existsSync(e)&&(t=r.readFileSync(e,"utf8"));else{var n=new XMLHttpRequest;n.open("GET",e,!1),n.send(null),4===n.readyState&&200===n.status&&(t=n.responseText)}}catch(e){}return p[e]=t}));var w=y(g);function x(e){var t=h[e.source];if(!t){var n=w(e.source);n?(t=h[e.source]={url:n.url,map:new o(n.map)}).map.sourcesContent&&t.map.sources.forEach((function(e,n){var r=t.map.sourcesContent[n];if(r){var o=b(t.url,e);p[o]=r}})):t=h[e.source]={url:null,map:null}}if(t&&t.map&&"function"==typeof t.map.originalPositionFor){var r=t.map.originalPositionFor(e);if(null!==r.source)return r.source=b(t.url,r.source),r}return e}function E(e){var t=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(e);if(t){var n=x({source:t[2],line:+t[3],column:t[4]-1});return"eval at "+t[1]+" ("+n.source+":"+n.line+":"+(n.column+1)+")"}return(t=/^eval at ([^(]+) \((.+)\)$/.exec(e))?"eval at "+t[1]+" ("+E(t[2])+")":e}function C(){var e,t="";if(this.isNative())t="native";else{!(e=this.getScriptNameOrSourceURL())&&this.isEval()&&(t=this.getEvalOrigin(),t+=", "),t+=e||"<anonymous>";var n=this.getLineNumber();if(null!=n){t+=":"+n;var r=this.getColumnNumber();r&&(t+=":"+r)}}var o="",i=this.getFunctionName(),s=!0,a=this.isConstructor();if(this.isToplevel()||a)a?o+="new "+(i||"<anonymous>"):i?o+=i:(o+=t,s=!1);else{var c=this.getTypeName();"[object Object]"===c&&(c="null");var l=this.getMethodName();i?(c&&0!=i.indexOf(c)&&(o+=c+"."),o+=i,l&&i.indexOf("."+l)!=i.length-l.length-1&&(o+=" [as "+l+"]")):o+=c+"."+(l||"<anonymous>")}return s&&(o+=" ("+t+")"),o}function S(e){var t={};return Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(n){t[n]=/^(?:is|get)/.test(n)?function(){return e[n].call(e)}:e[n]})),t.toString=C,t}function T(e,t){if(void 0===t&&(t={nextPosition:null,curPosition:null}),e.isNative())return t.curPosition=null,e;var n=e.getFileName()||e.getScriptNameOrSourceURL();if(n){var r=e.getLineNumber(),o=e.getColumnNumber()-1,i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/.test("object"==typeof process&&null!==process?process.version:"")?0:62;1===r&&o>i&&!_()&&!e.isEval()&&(o-=i);var s=x({source:n,line:r,column:o});t.curPosition=s;var a=(e=S(e)).getFunctionName;return e.getFunctionName=function(){return null==t.nextPosition?a():t.nextPosition.name||a()},e.getFileName=function(){return s.source},e.getLineNumber=function(){return s.line},e.getColumnNumber=function(){return s.column+1},e.getScriptNameOrSourceURL=function(){return s.source},e}var c=e.isEval()&&e.getEvalOrigin();return c?(c=E(c),(e=S(e)).getEvalOrigin=function(){return c},e):e}function k(e,t){u&&(p={},h={});for(var n=(e.name||"Error")+": "+(e.message||""),r={nextPosition:null,curPosition:null},o=[],i=t.length-1;i>=0;i--)o.push("\n at "+T(t[i],r)),r.nextPosition=r.curPosition;return r.curPosition=r.nextPosition=null,n+o.reverse().join("")}function I(e){var t=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(e.stack);if(t){var n=t[1],o=+t[2],i=+t[3],s=p[n];if(!s&&r&&r.existsSync(n))try{s=r.readFileSync(n,"utf8")}catch(e){s=""}if(s){var a=s.split(/(?:\r\n|\r|\n)/)[o-1];if(a)return n+":"+o+"\n"+a+"\n"+new Array(i).join(" ")+"^"}}return null}function P(e){var t=I(e),n=function(){if("object"==typeof process&&null!==process)return process.stderr}();n&&n._handle&&n._handle.setBlocking&&n._handle.setBlocking(!0),t&&(console.error(),console.error(t)),console.error(e.stack),"object"==typeof process&&null!==process&&"function"==typeof process.exit&&process.exit(1)}g.push((function(e){var t,n=function(e){var t;if(_())try{var n=new XMLHttpRequest;n.open("GET",e,!1),n.send(null),t=4===n.readyState?n.responseText:null;var r=n.getResponseHeader("SourceMap")||n.getResponseHeader("X-SourceMap");if(r)return r}catch(e){}t=v(e);for(var o,i,s=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/gm;i=s.exec(t);)o=i;return o?o[1]:null}(e);if(!n)return null;if(f.test(n)){var r=n.slice(n.indexOf(",")+1);t=s(r,"base64").toString(),n=e}else n=b(e,n),t=v(n);return t?{url:n,map:t}:null}));var A=m.slice(0),O=g.slice(0);t.wrapCallSite=T,t.getErrorSource=I,t.mapSourcePosition=x,t.retrieveSourceMap=w,t.install=function(t){if((t=t||{}).environment&&(d=t.environment,-1===["node","browser","auto"].indexOf(d)))throw new Error("environment "+d+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(m.length=0),m.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(g.length=0),g.unshift(t.retrieveSourceMap)),t.hookRequire&&!_()){var n=a(e,"module"),r=n.prototype._compile;r.__sourceMapSupport||(n.prototype._compile=function(e,t){return p[t]=e,h[t]=void 0,r.call(this,e,t)},n.prototype._compile.__sourceMapSupport=!0)}if(u||(u="emptyCacheBetweenOperations"in t&&t.emptyCacheBetweenOperations),c||(c=!0,Error.prepareStackTrace=k),!l){var o=!("handleUncaughtExceptions"in t)||t.handleUncaughtExceptions;try{!1===a(e,"worker_threads").isMainThread&&(o=!1)}catch(e){}o&&"object"==typeof process&&null!==process&&"function"==typeof process.on&&(l=!0,i=process.emit,process.emit=function(e){if("uncaughtException"===e){var t=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(t&&!n)return P(arguments[1])}return i.apply(this,arguments)})}var i},t.resetRetrieveHandlers=function(){m.length=0,g.length=0,m=A.slice(0),g=O.slice(0),w=y(g),v=y(m)}},8213:(e,t,n)=>{var r=n(2728),o=Object.prototype.hasOwnProperty,i="undefined"!=typeof Map;function s(){this._array=[],this._set=i?new Map:Object.create(null)}s.fromArray=function(e,t){for(var n=new s,r=0,o=e.length;r<o;r++)n.add(e[r],t);return n},s.prototype.size=function(){return i?this._set.size:Object.getOwnPropertyNames(this._set).length},s.prototype.add=function(e,t){var n=i?e:r.toSetString(e),s=i?this.has(e):o.call(this._set,n),a=this._array.length;s&&!t||this._array.push(e),s||(i?this._set.set(e,a):this._set[n]=a)},s.prototype.has=function(e){if(i)return this._set.has(e);var t=r.toSetString(e);return o.call(this._set,t)},s.prototype.indexOf=function(e){if(i){var t=this._set.get(e);if(t>=0)return t}else{var n=r.toSetString(e);if(o.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},s.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},s.prototype.toArray=function(){return this._array.slice()},t.I=s},6400:(e,t,n)=>{var r=n(7923);t.encode=function(e){var t,n="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&o,(o>>>=5)>0&&(t|=32),n+=r.encode(t)}while(o>0);return n},t.decode=function(e,t,n){var o,i,s,a,c=e.length,l=0,u=0;do{if(t>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),l+=(i&=31)<<u,u+=5}while(o);n.value=(a=(s=l)>>1,1==(1&s)?-a:a),n.rest=t}},7923:(e,t)=>{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},9216:(e,t)=>{function n(e,r,o,i,s,a){var c=Math.floor((r-e)/2)+e,l=s(o,i[c],!0);return 0===l?c:l>0?r-c>1?n(c,r,o,i,s,a):a==t.LEAST_UPPER_BOUND?r<i.length?r:-1:c:c-e>1?n(e,c,o,i,s,a):a==t.LEAST_UPPER_BOUND?c:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,r,o,i){if(0===r.length)return-1;var s=n(-1,r.length,e,r,o,i||t.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(r[s],r[s-1],!0);)--s;return s}},1188:(e,t,n)=>{var r=n(2728);function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){var t,n,o,i,s,a;n=e,o=(t=this._last).generatedLine,i=n.generatedLine,s=t.generatedColumn,a=n.generatedColumn,i>o||i==o&&a>=s||r.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.H=o},2826:(e,t)=>{function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t,o,i){if(o<i){var s=o-1;n(e,(u=o,d=i,Math.round(u+Math.random()*(d-u))),i);for(var a=e[i],c=o;c<i;c++)t(e[c],a)<=0&&n(e,s+=1,c);n(e,s+1,c);var l=s+1;r(e,t,o,l-1),r(e,t,l+1,i)}var u,d}t.U=function(e,t){r(e,t,0,e.length-1)}},6771:(e,t,n)=>{var r=n(2728),o=n(9216),i=n(8213).I,s=n(6400),a=n(2826).U;function c(e,t){var n=e;return"string"==typeof e&&(n=r.parseSourceMapInput(e)),null!=n.sections?new d(n,t):new l(n,t)}function l(e,t){var n=e;"string"==typeof e&&(n=r.parseSourceMapInput(e));var o=r.getArg(n,"version"),s=r.getArg(n,"sources"),a=r.getArg(n,"names",[]),c=r.getArg(n,"sourceRoot",null),l=r.getArg(n,"sourcesContent",null),u=r.getArg(n,"mappings"),d=r.getArg(n,"file",null);if(o!=this._version)throw new Error("Unsupported version: "+o);c&&(c=r.normalize(c)),s=s.map(String).map(r.normalize).map((function(e){return c&&r.isAbsolute(c)&&r.isAbsolute(e)?r.relative(c,e):e})),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(s,!0),this._absoluteSources=this._sources.toArray().map((function(e){return r.computeSourceURL(c,e,t)})),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=t,this.file=d}function u(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function d(e,t){var n=e;"string"==typeof e&&(n=r.parseSourceMapInput(e));var o=r.getArg(n,"version"),s=r.getArg(n,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=s.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=r.getArg(e,"offset"),o=r.getArg(n,"line"),i=r.getArg(n,"column");if(o<a.line||o===a.line&&i<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=n,{generatedOffset:{generatedLine:o+1,generatedColumn:i+1},consumer:new c(r.getArg(e,"map"),t)}}))}c.fromSourceMap=function(e,t){return l.fromSourceMap(e,t)},c.prototype._version=3,c.prototype.__generatedMappings=null,Object.defineProperty(c.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),c.prototype.__originalMappings=null,Object.defineProperty(c.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),c.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},c.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},c.GENERATED_ORDER=1,c.ORIGINAL_ORDER=2,c.GREATEST_LOWER_BOUND=1,c.LEAST_UPPER_BOUND=2,c.prototype.eachMapping=function(e,t,n){var o,i=t||null;switch(n||c.GENERATED_ORDER){case c.GENERATED_ORDER:o=this._generatedMappings;break;case c.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;o.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return{source:t=r.computeSourceURL(s,t,this._sourceMapURL),generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}}),this).forEach(e,i)},c.prototype.allGeneratedPositionsFor=function(e){var t=r.getArg(e,"line"),n={source:r.getArg(e,"source"),originalLine:t,originalColumn:r.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(s>=0){var a=this._originalMappings[s];if(void 0===e.column)for(var c=a.originalLine;a&&a.originalLine===c;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s];else for(var l=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==l;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s]}return i},t.SourceMapConsumer=c,l.prototype=Object.create(c.prototype),l.prototype.consumer=c,l.prototype._findSourceIndex=function(e){var t,n=e;if(null!=this.sourceRoot&&(n=r.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==e)return t;return-1},l.fromSourceMap=function(e,t){var n=Object.create(l.prototype),o=n._names=i.fromArray(e._names.toArray(),!0),s=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map((function(e){return r.computeSourceURL(n.sourceRoot,e,t)}));for(var c=e._mappings.toArray().slice(),d=n.__generatedMappings=[],p=n.__originalMappings=[],h=0,f=c.length;h<f;h++){var m=c[h],g=new u;g.generatedLine=m.generatedLine,g.generatedColumn=m.generatedColumn,m.source&&(g.source=s.indexOf(m.source),g.originalLine=m.originalLine,g.originalColumn=m.originalColumn,m.name&&(g.name=o.indexOf(m.name)),p.push(g)),d.push(g)}return a(n.__originalMappings,r.compareByOriginalPositions),n},l.prototype._version=3,Object.defineProperty(l.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),l.prototype._parseMappings=function(e,t){for(var n,o,i,c,l,d=1,p=0,h=0,f=0,m=0,g=0,_=e.length,y=0,v={},b={},w=[],x=[];y<_;)if(";"===e.charAt(y))d++,y++,p=0;else if(","===e.charAt(y))y++;else{for((n=new u).generatedLine=d,c=y;c<_&&!this._charIsMappingSeparator(e,c);c++);if(i=v[o=e.slice(y,c)])y+=o.length;else{for(i=[];y<c;)s.decode(e,y,b),l=b.value,y=b.rest,i.push(l);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");v[o]=i}n.generatedColumn=p+i[0],p=n.generatedColumn,i.length>1&&(n.source=m+i[1],m+=i[1],n.originalLine=h+i[2],h=n.originalLine,n.originalLine+=1,n.originalColumn=f+i[3],f=n.originalColumn,i.length>4&&(n.name=g+i[4],g+=i[4])),x.push(n),"number"==typeof n.originalLine&&w.push(n)}a(x,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=x,a(w,r.compareByOriginalPositions),this.__originalMappings=w},l.prototype._findMapping=function(e,t,n,r,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return o.search(e,t,i,s)},l.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},l.prototype.originalPositionFor=function(e){var t={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",r.compareByGeneratedPositionsDeflated,r.getArg(e,"bias",c.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=r.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=r.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=r.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:r.getArg(o,"originalLine",null),column:r.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e}))},l.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o,i=e;if(null!=this.sourceRoot&&(i=r.relative(this.sourceRoot,i)),null!=this.sourceRoot&&(o=r.urlParse(this.sourceRoot))){var s=i.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!o.path||"/"==o.path)&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var t=r.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,r.getArg(e,"bias",c.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null),lastColumn:r.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},d.prototype=Object.create(c.prototype),d.prototype.constructor=c,d.prototype._version=3,Object.defineProperty(d.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),d.prototype.originalPositionFor=function(e){var t={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")},n=o.search(t,this._sections,(function(e,t){return e.generatedLine-t.generatedOffset.generatedLine||e.generatedColumn-t.generatedOffset.generatedColumn})),i=this._sections[n];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},d.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},d.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var r=this._sections[n].consumer.sourceContentFor(e,!0);if(r)return r}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},d.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(-1!==n.consumer._findSourceIndex(r.getArg(e,"source"))){var o=n.consumer.generatedPositionFor(e);if(o)return{line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},d.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var c=i[s],l=o.consumer._sources.at(c.source);l=r.computeSourceURL(o.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var u=null;c.name&&(u=o.consumer._names.at(c.name),this._names.add(u),u=this._names.indexOf(u));var d={source:l,generatedLine:c.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(o.generatedOffset.generatedLine===c.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:u};this.__generatedMappings.push(d),"number"==typeof d.originalLine&&this.__originalMappings.push(d)}a(this.__generatedMappings,r.compareByGeneratedPositionsDeflated),a(this.__originalMappings,r.compareByOriginalPositions)}},4433:(e,t,n)=>{var r=n(6400),o=n(2728),i=n(8213).I,s=n(1188).H;function a(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new i,this._names=new i,this._mappings=new s,this._sourcesContents=null}a.prototype._version=3,a.fromSourceMap=function(e){var t=e.sourceRoot,n=new a({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=o.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)})),e.sources.forEach((function(r){var i=r;null!==t&&(i=o.relative(t,r)),n._sources.has(i)||n._sources.add(i);var s=e.sourceContentFor(r);null!=s&&n.setSourceContent(r,s)})),n},a.prototype.addMapping=function(e){var t=o.getArg(e,"generated"),n=o.getArg(e,"original",null),r=o.getArg(e,"source",null),i=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i})},a.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=o.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},a.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var s=this._sourceRoot;null!=s&&(r=o.relative(s,r));var a=new i,c=new i;this._mappings.unsortedForEach((function(t){if(t.source===r&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=n&&(t.source=o.join(n,t.source)),null!=s&&(t.source=o.relative(s,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var l=t.source;null==l||a.has(l)||a.add(l);var u=t.name;null==u||c.has(u)||c.add(u)}),this),this._sources=a,this._names=c,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=o.join(n,t)),null!=s&&(t=o.relative(s,t)),this.setSourceContent(t,r))}),this)},a.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},a.prototype._serializeMappings=function(){for(var e,t,n,i,s=0,a=1,c=0,l=0,u=0,d=0,p="",h=this._mappings.toArray(),f=0,m=h.length;f<m;f++){if(e="",(t=h[f]).generatedLine!==a)for(s=0;t.generatedLine!==a;)e+=";",a++;else if(f>0){if(!o.compareByGeneratedPositionsInflated(t,h[f-1]))continue;e+=","}e+=r.encode(t.generatedColumn-s),s=t.generatedColumn,null!=t.source&&(i=this._sources.indexOf(t.source),e+=r.encode(i-d),d=i,e+=r.encode(t.originalLine-1-l),l=t.originalLine-1,e+=r.encode(t.originalColumn-c),c=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=r.encode(n-u),u=n)),p+=e}return p},a.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},a.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.h=a},7085:(e,t,n)=>{var r=n(4433).h,o=n(2728),i=/(\r?\n)/,s="$$$isSourceNode$$$";function a(e,t,n,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==o?null:o,this[s]=!0,null!=r&&this.add(r)}a.fromStringWithSourceMap=function(e,t,n){var r=new a,s=e.split(i),c=0,l=function(){return e()+(e()||"");function e(){return c<s.length?s[c++]:void 0}},u=1,d=0,p=null;return t.eachMapping((function(e){if(null!==p){if(!(u<e.generatedLine)){var t=(n=s[c]||"").substr(0,e.generatedColumn-d);return s[c]=n.substr(e.generatedColumn-d),d=e.generatedColumn,h(p,t),void(p=e)}h(p,l()),u++,d=0}for(;u<e.generatedLine;)r.add(l()),u++;if(d<e.generatedColumn){var n=s[c]||"";r.add(n.substr(0,e.generatedColumn)),s[c]=n.substr(e.generatedColumn),d=e.generatedColumn}p=e}),this),c<s.length&&(p&&h(p,l()),r.add(s.splice(c).join(""))),t.sources.forEach((function(e){var i=t.sourceContentFor(e);null!=i&&(null!=n&&(e=o.join(n,e)),r.setSourceContent(e,i))})),r;function h(e,t){if(null===e||void 0===e.source)r.add(t);else{var i=n?o.join(n,e.source):e.source;r.add(new a(e.originalLine,e.originalColumn,i,t,e.name))}}},a.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},a.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},a.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n<r;n++)(t=this.children[n])[s]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},a.prototype.join=function(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;n<r-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},a.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[s]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},a.prototype.setSourceContent=function(e,t){this.sourceContents[o.toSetString(e)]=t},a.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][s]&&this.children[t].walkSourceContents(e);var r=Object.keys(this.sourceContents);for(t=0,n=r.length;t<n;t++)e(o.fromSetString(r[t]),this.sourceContents[r[t]])},a.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},a.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new r(e),o=!1,i=null,s=null,a=null,c=null;return this.walk((function(e,r){t.code+=e,null!==r.source&&null!==r.line&&null!==r.column?(i===r.source&&s===r.line&&a===r.column&&c===r.name||n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name}),i=r.source,s=r.line,a=r.column,c=r.name,o=!0):o&&(n.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var l=0,u=e.length;l<u;l++)10===e.charCodeAt(l)?(t.line++,t.column=0,l+1===u?(i=null,o=!1):o&&n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name})):t.column++})),this.walkSourceContents((function(e,t){n.setSourceContent(e,t)})),{code:t.code,map:n}}},2728:(e,t)=>{t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function s(e){var n=e,r=o(e);if(r){if(!r.path)return e;n=r.path}for(var s,a=t.isAbsolute(n),c=n.split(/\/+/),l=0,u=c.length-1;u>=0;u--)"."===(s=c[u])?c.splice(u,1):".."===s?l++:l>0&&(""===s?(c.splice(u+1,l),l=0):(c.splice(u,2),l--));return""===(n=c.join("/"))&&(n=a?"/":"."),r?(r.path=n,i(r)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),a=o(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var c="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=c,i(a)):c}t.urlParse=o,t.urlGenerate=i,t.normalize=s,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var c=!("__proto__"in Object.create(null));function l(e){return e}function u(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function d(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=c?l:function(e){return u(e)?"$"+e:e},t.fromSetString=c?l:function(e){return u(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=d(e.source,t.source);return 0!==r||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)||n||0!=(r=e.generatedColumn-t.generatedColumn)||0!=(r=e.generatedLine-t.generatedLine)?r:d(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!=(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=d(e.source,t.source))||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r:d(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!=(n=e.generatedColumn-t.generatedColumn)||0!==(n=d(e.source,t.source))||0!=(n=e.originalLine-t.originalLine)||0!=(n=e.originalColumn-t.originalColumn)?n:d(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=o(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var c=r.path.lastIndexOf("/");c>=0&&(r.path=r.path.substring(0,c+1))}t=a(i(r),t)}return s(t)}},9125:(e,t,n)=>{n(4433).h,t.SourceMapConsumer=n(6771).SourceMapConsumer,n(7085)},465:e=>{e.exports=function(e,t){var n=[];n.push(function(e){try{return Error.prototype.toString.call(e)}catch(e){try{return"<error: "+e+">"}catch(e){return"<error>"}}}(e));for(var r=0;r<t.length;r++){var o,i=t[r];try{o=i.toString()}catch(e){try{o="<error: "+e+">"}catch(e){o="<error>"}}n.push(" at "+o)}return n.join("\n")}},2512:(e,t,n)=>{if(global._stackChain){if(global._stackChain.version!==n(2301).i8)throw new Error("Conflicting version of stack-chain found");e.exports=global._stackChain}else e.exports=global._stackChain=n(7898)},7898:(e,t,n)=>{var r=n(465);function o(){this.extend=new a,this.filter=new a,this.format=new c,this.version=n(2301).i8}var i=!1;o.prototype.callSite=function e(t){t||(t={}),i=!0;var n={};Error.captureStackTrace(n,e);var r=n.stack;return i=!1,r=r.slice(t.slice||0),t.extend&&(r=this.extend._modify(n,r)),t.filter&&(r=this.filter._modify(n,r)),r};var s=new o;function a(){this._modifiers=[]}function c(){this._formater=r,this._previous=void 0}a.prototype._modify=function(e,t){for(var n=0,r=this._modifiers.length;n<r;n++)t=this._modifiers[n](e,t);return t},a.prototype.attach=function(e){this._modifiers.push(e)},a.prototype.deattach=function(e){var t=this._modifiers.indexOf(e);return-1!==t&&(this._modifiers.splice(t,1),!0)},c.prototype.replace=function(e){e?this._formater=e:this.restore()},c.prototype.restore=function(){this._formater=r,this._previous=void 0},c.prototype._backup=function(){this._previous=this._formater},c.prototype._roolback=function(){this._previous===r?this.replace(void 0):this.replace(this._previous),this._previous=void 0},Error.prepareStackTrace&&s.format.replace(Error.prepareStackTrace);var l=!1;function u(e,t){if(i)return t;if(l)return r(e,t);var n=t.concat();n=s.extend._modify(e,n),n=(n=s.filter._modify(e,n)).slice(0,Error.stackTraceLimit),Object.isExtensible(e)&&void 0===Object.getOwnPropertyDescriptor(e,"callSite")&&(e.callSite={original:t,mutated:n}),l=!0;var o=s.format._formater(e,n);return l=!1,o}Object.defineProperty(Error,"prepareStackTrace",{get:function(){return u},set:function(e){e===u?s.format._roolback():(s.format._backup(),s.format.replace(e))}}),Object.defineProperty(Error.prototype,"callSite",{get:function(){return this.stack,this.callSite},set:function(e){Object.defineProperty(this,"callSite",{value:e,writable:!0,configurable:!0})},configurable:!0}),e.exports=s},2130:(e,t,n)=>{"use strict";const r=n(2037),o=n(6560),i=process.env;let s;function a(e){const t=function(e){if(!1===s)return 0;if(o("color=16m")||o("color=full")||o("color=truecolor"))return 3;if(o("color=256"))return 2;if(e&&!e.isTTY&&!0!==s)return 0;const t=s?1:0;if("win32"===process.platform){const e=r.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in i))||"codeship"===i.CI_NAME?1:t;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("truecolor"===i.COLORTERM)return 3;if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:(i.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}o("no-color")||o("no-colors")||o("color=false")?s=!1:(o("color")||o("colors")||o("color=true")||o("color=always"))&&(s=!0),"FORCE_COLOR"in i&&(s=0===i.FORCE_COLOR.length||0!==parseInt(i.FORCE_COLOR,10)),e.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},1862:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSCodeCopilotTokenManager=t.ExtensionNotificationSender=t.setExtensionContext=t.telemetryAcceptanceKey=void 0;const r=n(9496),o=n(362),i=n(6794),s=n(9899),a=n(6333),c=n(47);t.telemetryAcceptanceKey=`github.copilot.telemetryAccepted.${i.LAST_TELEMETRY_TERMS_UPDATE}`;const l=new s.Logger(s.LogLevel.INFO,"auth");let u,d=!1;t.setExtensionContext=function(e){u=e},t.ExtensionNotificationSender=class{async showWarningMessage(e,...t){return{title:await r.window.showWarningMessage(e,...t.map((e=>e.title)))}}};class p extends o.CopilotTokenManager{constructor(){super(),this.copilotToken=void 0}async getGitHubToken(){const e=await(0,c.getSession)();return null==e?void 0:e.accessToken}async getCopilotToken(e,n){return(!this.copilotToken||this.copilotToken.expires_at<(0,o.nowSeconds)()||n)&&(this.copilotToken=await async function(e){var n;const s=await async function(e){const t=await(0,c.getSession)();if(!t)return l.info(e,"GitHub login failed"),(0,a.telemetryError)(e,"auth.github_login_failed"),{kind:"failure",reason:"GitHubLoginFailed"};l.debug(e,`Logged in as ${t.account.label}, oauth token ${t.accessToken}`);const n=await(0,o.authFromGitHubToken)(e,{token:t.accessToken});if("success"==n.kind){const r=n.token;l.debug(e,`Copilot HMAC for ${t.account.label}: ${r}`)}return n}(e);if("failure"===s.kind&&"NotAuthorized"===s.reason)throw Error(null!==(n=s.message)&&void 0!==n?n:"User not authorized");if("failure"===s.kind&&"HTTP401"===s.reason){const e="Your GitHub token is invalid. Please sign out from your GitHub account using VSCode UI and try again.";throw d||(d=!0,r.window.showWarningMessage(e)),Error(e)}if("unconfigured"===s.telemetry&&!await async function(e){var n;const o=null==u?void 0:u.globalState;if(!o)return!1;const s=null===(n=(0,c.getGithubAccount)())||void 0===n?void 0:n.label;if(!s)return!1;const l=s,d=o.get(t.telemetryAcceptanceKey,void 0);if(d&&d===s)return!0;const p=await r.window.showWarningMessage(`I agree to these [telemetry terms](${i.TELEMETRY_TERMS_URL}) as part of the GitHub Copilot technical preview.`,"Cancel","Agree");if("Agree"!==p){const t=a.TelemetryData.createAndMarkAsIssued({choice:null!=p?p:"undefined"});return(0,a.telemetry)(e,"auth.telemetry_terms_rejected",t),!1}o.update(t.telemetryAcceptanceKey,l);const h=a.TelemetryData.createAndMarkAsIssued({terms_date:i.LAST_TELEMETRY_TERMS_UPDATE});return(0,a.telemetry)(e,"auth.telemetry_terms_accepted",h),!0}(e))throw Error("User did not agree to telemetry");return s}(e),(0,o.refreshToken)(e,this,this.copilotToken.refresh_in)),this.copilotToken.token}resetCopilotToken(e,t){void 0!==t&&(0,a.telemetry)(e,"auth.reset_token_"+t),l.debug(e,`Resetting copilot token on HTTP error ${t||"unknown"}`),this.copilotToken=void 0}}t.VSCodeCopilotTokenManager=p},9425:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSCodeEditorInfo=t.makeVscInfo=t.getExtension=t.setExtension=t.VSCodeConfigProvider=void 0;const r=n(9496),o=n(1133),i=n(4197),s=n(70),a=n(4147);function c(e){return"string"==typeof e?e:JSON.stringify(e)}class l extends o.ConfigProvider{constructor(){super(),this.config=r.workspace.getConfiguration(i.CopilotConfigPrefix),r.workspace.onDidChangeConfiguration((e=>{e.affectsConfiguration(i.CopilotConfigPrefix)&&(this.config=r.workspace.getConfiguration(i.CopilotConfigPrefix))}))}getConfigKeyFromObject(e,t){const n=this.config[e][t];return void 0===n?(0,o.getConfigDefaultForObjectKey)(e,t):n}getConfig(e){if(Array.isArray(e))return this.getConfigKeyFromObject(e[0],e[1]);const t=this.config.get(e);if(void 0===t)throw new Error(`Missing config default value: ${i.CopilotConfigPrefix}.${e}`);return t}isDefaultSettingOverwritten(e){if(Array.isArray(e))return void 0!==this.config[e[0]][e[1]];const t=this.config.inspect(e);return!!t&&!!(t.globalValue||t.workspaceValue||t.workspaceFolderValue||t.defaultLanguageValue||t.globalLanguageValue||t.workspaceLanguageValue||t.workspaceFolderLanguageValue)}dumpConfig(){const e={};try{const t=a.contributes.configuration[0].properties;for(const n in t){const t=n.replace(`${i.CopilotConfigPrefix}.`,"").split(".").reduce(((e,t)=>e[t]),this.config);"object"==typeof t&&null!==t?Object.keys(t).filter((e=>"secret_key"!==e)).forEach((r=>e[`${n}.${r}`]=c(t[r]))):e[n]=c(t)}}catch(e){console.error(`Failed to retrieve configuration properties ${e}`)}return e}getLanguageConfig(e,t){const n=this.getConfig(e);if(void 0===t){const e=r.window.activeTextEditor;t=e&&e.document.languageId}return t&&t in n?n[t]:n["*"]}updateEnabledConfig(e,t,n){const r=e.get(o.ConfigProvider).getConfig(o.ConfigKey.Enable);return r[t]=n,this.config.update(o.ConfigKey.Enable,r,!0)}}let u;t.VSCodeConfigProvider=l,t.setExtension=function(e){u=e},t.getExtension=function(e){if(!u&&(0,s.isRunningInTest)(e)&&(u=r.extensions.all.find((e=>e.id.startsWith("GitHub.copilot")))),!u)throw new Error("No GitHub.copilot extension found");return u},t.makeVscInfo=function(){return new o.VscInfo(r.env.sessionId,r.env.machineId,r.version)};class d extends o.EditorAndPluginInfo{getEditorInfo(e){return{name:"vscode",version:r.version}}getEditorPluginInfo(e){return{name:"copilot",version:(0,o.getVersion)(e)}}}t.VSCodeEditorInfo=d},3060:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotLabelPrefix=t.CMDSendFeedback=t.CMDShowActivationErrors=t.CMDToggleCopilot=t.CMDAcceptPanelSolution=t.CMDOpenPanelForRange=t.CMDOpenPanel=void 0,t.CMDOpenPanel="github.copilot.generate",t.CMDOpenPanelForRange="github.copilot.openPanelForRange",t.CMDAcceptPanelSolution="github.copilot.acceptPanelSolution",t.CMDToggleCopilot="github.copilot.toggleCopilot",t.CMDShowActivationErrors="github.copilot.showActivationErrors",t.CMDSendFeedback="github.copilot.sendFeedback",t.CopilotLabelPrefix="$(copilot-logo) "},1929:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OpenCopilotActionProvider=void 0;const r=n(9496),o=n(256),i=n(6333),s=n(3060),a=n(4540);t.OpenCopilotActionProvider=class{constructor(e){this.ctx=e,this.lastVersion=0,this.lastRange=void 0}indexOfGroup(e,t){let n=e.index;for(let r=1;r<t;r++)n+=e[r].length;return n}telemetryCodeAction(e,t){const n={languageId:e.languageId,codeActionType:(0,o.completionTypeToString)(t)};(0,i.telemetry)(this.ctx,"codeAction.displayed",i.TelemetryData.createAndMarkAsIssued(n))}async provideCodeActions(e,t,n,i){var c;if((0,a.ignoreDocument)(this.ctx,e))return;const l=e.lineAt(t.start);if(e.version===this.lastVersion&&this.lastRange&&this.lastRange.isEqual(t))return;this.lastVersion=e.version,this.lastRange=t;const u=/^(\W+)(todo)/i.exec(l.text);if(u){const n=u[u.length-1],i=this.indexOfGroup(u,u.length-1);if(new r.Range(new r.Position(t.start.line,i),new r.Position(t.start.line,i+n.length)).contains(t.start)){const t=new r.CodeAction("Implement with GitHub Copilot",r.CodeActionKind.QuickFix),n={title:"Implement with GitHub Copilot",command:s.CMDOpenPanelForRange,arguments:[new o.CompletionContext(this.ctx,l.rangeIncludingLineBreak.end,o.CompletionType.TODO_QUICK_FIX)]};return t.command=n,this.telemetryCodeAction(e,o.CompletionType.TODO_QUICK_FIX),[t]}}const d=n.diagnostics.find((e=>"ts"===e.source&&2304===e.code));if(d){const t=await r.commands.executeCommand("vscode.executeCodeActionProvider",e.uri,d.range),n=null==t?void 0:t.find((e=>e.title.startsWith("Add missing function declaration"))),i=null===(c=null==n?void 0:n.edit)||void 0===c?void 0:c.get(e.uri).pop();if(i){const t=new r.CodeAction("Implement with GitHub Copilot",r.CodeActionKind.QuickFix),n=new o.CompletionContext(this.ctx,i.range.start,o.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX),a=i.newText.trim().split("\n")[0];n.prependToCompletion="\n"+a;const c={title:"Implement with GitHub Copilot",command:s.CMDOpenPanelForRange,arguments:[n]};return t.command=c,this.telemetryCodeAction(e,o.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX),[t]}}}}},6267:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commandOpenPanel=t.completionContextForEditor=void 0;const r=n(9496),o=n(256);function i(e,t,n){return n||(0,o.completionContextForDocument)(e,t.document,t.selection.active)}t.completionContextForEditor=i,t.commandOpenPanel=function(e,t){const n=r.window.activeTextEditor;if(!n)return;if(!r.workspace.getConfiguration("editor",n.document.uri).get("codeLens"))return void r.window.showInformationMessage("GitHub Copilot Panel requires having Code Lens enabled. Please update your settings and then try again.","Open Settings").then((e=>{"Open Settings"===e&&r.commands.executeCommand("workbench.action.openSettings","editor.codeLens")}));t=i(e,n,t);const s=(0,o.encodeLocation)(n.document.uri,t),a=n.document.languageId;r.workspace.openTextDocument(s).then((e=>{r.languages.setTextDocumentLanguage(e,a),r.window.showTextDocument(e,r.ViewColumn.Beside)}))}},2990:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotPanel=void 0;const r=n(9496),o=n(1133),i=n(4197),s=n(256),a=n(893),c=n(7017),l=n(3060);t.CopilotPanel=class{constructor(e){this._onDidChange=new r.EventEmitter,this._documents=new Map,this._editorDecoration=r.window.createTextEditorDecorationType({textDecoration:"underline"}),this._ctx=e,this._subscriptions=r.workspace.onDidCloseTextDocument((e=>{e.isClosed&&e.uri.scheme==i.CopilotScheme&&this._documents.delete(e.uri.toString())}))}dispose(){this._subscriptions.dispose(),this._documents.clear(),this._editorDecoration.dispose(),this._onDidChange.dispose()}get onDidChange(){return this._onDidChange.event}async provideTextDocumentContent(e){var t;let n=null===(t=this._documents.get(e.toString()))||void 0===t?void 0:t.model;if(n)return n.value;const i=new r.CancellationTokenSource,[c,l]=(0,s.decodeLocation)(this._ctx,e),u=await r.workspace.openTextDocument(c);return n=new a.CopilotListDocument(this._ctx,e,u,l,(0,o.getConfig)(this._ctx,o.ConfigKey.ListCount),i.token),n.onDidResultUpdated((e=>this._onDidChange.fire(e))),this._documents.set(e.toString(),{model:n,cts:i}),n.runQuery(),n.value}getCodeLens(e){const t=e.model;let n=t.numberHeaderLines;const o=t.completionContext.insertPosition,i=a.CopilotListDocument.separator.split("\n").length-1;return t.solutions().map(((a,u)=>{const d=new r.Position(n+i,0),p=new r.Position(n+a.displayLines.length-1,0),h=t.savedTelemetryData.extendedBy({choiceIndex:a.choiceIndex.toString()},{compCharLen:a.completionText.length,meanProb:a.meanProb,rank:u});h.extendWithRequestId(a.requestId),h.markAsDisplayed();const f=new r.CodeLens(new r.Range(d,p),{title:"Accept Solution",tooltip:"Replace code with this solution",command:l.CMDAcceptPanelSolution,arguments:[t.targetUri,o,a.completionText,t.completionContext.completionType===s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX,async()=>{const n=(await r.workspace.openTextDocument(t.targetUri)).offsetAt(o);e.cts.cancel(),await(0,c.postInsertionTasks)(this._ctx,"solution",a.completionText,n,t.targetUri,h)}]});return n+=a.displayLines.length,f}))}provideCodeLenses(e,t){const n=this._documents.get(e.uri.toString());if(n)return this.getCodeLens(n)}}},9380:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupExperimentationService=t.logger=void 0;const r=n(9496),o=n(1133),i=n(9189),s=n(8142),a=n(9899);function c(e){return e.split("-")[0]}t.logger=new a.Logger(a.LogLevel.INFO,"Exp"),t.setupExperimentationService=function(e){const t=e.get(i.Features);t.setPrefix(r.env.machineId),t.registerStaticFilters(function(e){const t=e.get(o.BuildInfo);return{[s.Filter.ApplicationVersion]:c(r.version),[s.Filter.Build]:r.env.appName,[s.Filter.ClientId]:r.env.machineId,[s.Filter.ExtensionName]:t.getName(),[s.Filter.ExtensionVersion]:c(t.getVersion()),[s.Filter.Language]:r.env.language,[s.Filter.TargetPopulation]:s.TargetPopulation.Public}}(e)),t.registerDynamicFilter(s.Filter.CopilotOverrideEngine,(()=>(0,o.getConfig)(e,o.ConfigKey.DebugOverrideEngine)))}},6857:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extensionFileSystem=void 0;const r=n(9496);t.extensionFileSystem={readFile:async function(e){return await r.workspace.fs.readFile(r.Uri.parse(e))},mtime:async function(e){return(await r.workspace.fs.stat(r.Uri.parse(e))).mtime},stat:async function(e){return await r.workspace.fs.stat(r.Uri.parse(e))}}},3197:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerGhostText=t.handleGhostTextPostInsert=t.handleGhostTextShown=t.provideInlineCompletions=t.ghostTextLogger=t.getInsertionTextFromCompletion=void 0;const r=n(9496),o=n(1133),i=n(2218),s=n(9334),a=n(750),c=n(9899),l=n(7017),u=n(6333),d=n(4540),p="_ghostTextPostInsert";function h(e){return e.insertText}let f,m;t.getInsertionTextFromCompletion=h,t.ghostTextLogger=new c.Logger(c.LogLevel.INFO,"ghostText");let g,_=[];async function y(e,n,c,h,y){const v=await async function(e,n,a,c,h){const y=u.TelemetryData.createAndMarkAsIssued();if(!function(e){return(0,o.getConfig)(e,o.ConfigKey.InlineSuggestEnable)}(e))return{type:"abortedBeforeIssued",reason:"ghost text is disabled"};if((0,d.ignoreDocument)(e,n))return{type:"abortedBeforeIssued",reason:"document is ignored"};if(t.ghostTextLogger.debug(e,`Ghost text called at [${a.line}, ${a.character}], with triggerKind ${c.triggerKind}`),h.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled before extractPrompt"),{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt"};if(c.selectedCompletionInfo)return t.ghostTextLogger.debug(e,"Not showing ghost text because autocomplete widget is displayed"),{type:"abortedBeforeIssued",reason:"autocomplete widget is displayed"};const v=await(0,s.getGhostText)(e,n,a,c.triggerKind===r.InlineCompletionTriggerKind.Invoke,y,h);if("success"!==v.type)return t.ghostTextLogger.debug(e,"Breaking, no results from getGhostText -- "+v.type+": "+v.reason),v;const[b,w]=v.value;if(f&&m&&(!f.isEqual(a)||m!==n.uri)&&w!==s.ResultType.TypingAsSuggested){const t=_.flatMap((e=>e.displayText&&e.telemetry?[{completionText:e.displayText,completionTelemetryData:e.telemetry}]:[]));t.length>0&&(0,l.postRejectionTasks)(e,"ghostText",n.offsetAt(f),m,t)}if(f=a,m=n.uri,_=[],h.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after getGhostText"),{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:v.telemetryBlob}};const x=(0,i.completionsFromGhostTextResults)(e,b,w,n,a,function(e){const t=r.window.visibleTextEditors.find((t=>t.document===e));return null==t?void 0:t.options}(n),g);t.ghostTextLogger.debug(e,"Completions",x);const E=x.map((e=>{const{text:t,range:o}=e,i=new r.Range(new r.Position(o.start.line,o.start.character),new r.Position(o.end.line,o.end.character)),s=new r.InlineCompletionItem(t,i);return s.index=e.index,s.telemetry=e.telemetry,s.displayText=e.displayText,s.resultType=e.resultType,s.uri=n.uri,s.insertOffset=n.offsetAt(new r.Position(e.position.line,e.position.character)),s.command={title:"PostInsertTask",command:p,arguments:[s]},s}));return 0===E.length?{type:"empty",reason:"no completions in final result",telemetryData:v.telemetryData}:{...v,value:E}}(e,n,c,h,y);return await(0,a.handleGhostTextResultTelemetry)(e,v)}t.provideInlineCompletions=y;class v{constructor(e){this.ctx=e}async provideInlineCompletionItems(e,t,n,r){return y(this.ctx,e,t,n,r)}handleDidShowCompletionItem(e){b(this.ctx,e)}}function b(e,n){if(g=n.index,!_.find((e=>e.index===n.index))&&(_.push(n),n.telemetry)){const r=!(n.resultType===s.ResultType.Network);t.ghostTextLogger.debug(e,`[${n.telemetry.properties.headerRequestId}] shown choiceIndex: ${n.telemetry.properties.choiceIndex}, fromCache ${r}`),(0,a.telemetryShown)(e,"ghostText",n.telemetry,r)}}async function w(e,n){_=[],m=void 0,f=void 0,t.ghostTextLogger.debug(e,"Ghost text post insert"),n.telemetry&&n.uri&&n.displayText&&void 0!==n.insertOffset&&n.range&&(n.telemetry.measurements.compCharLen=h(n).length,await(0,l.postInsertionTasks)(e,"ghostText",n.displayText,n.insertOffset,n.uri,n.telemetry))}t.handleGhostTextShown=b,t.handleGhostTextPostInsert=w,t.registerGhostText=function(e){const t=new v(e);return[r.languages.registerInlineCompletionItemProvider({pattern:"**"},t),r.commands.registerCommand(p,(async t=>w(e,t)))]}},9477:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initProxyEnvironment=void 0;const r=n(7310),o=n(9496);t.initProxyEnvironment=function(e,t){const n=o.workspace.getConfiguration("http").get("proxy")||function(e){return e.HTTPS_PROXY||e.https_proxy||e.HTTP_PROXY||e.http_proxy||null}(t);if(n){const t={},i=o.workspace.getConfiguration("http").get("proxyAuthorization"),s=o.workspace.getConfiguration("http").get("proxyStrictSSL",!0);i&&(t["Proxy-Authorization"]=i);const{hostname:a,port:c,username:l,password:u}=function(e){try{return new r.URL(e)}catch(t){throw new Error(`Invalid proxy URL: '${e}'`)}}(n),d=l&&u&&`${l}:${u}`;e.proxySettings={host:a,port:parseInt(c),proxyAuth:d,headers:t,rejectUnauthorized:s}}}},47:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGithubAccount=t.getSession=void 0;const r=n(9496),o=["read:user"];let i,s=!1;function a(e){if("true"===process.env.CODESPACES&&process.env.GITHUB_TOKEN){const e=process.env.GITHUB_USER||"codespace-user",t={accessToken:process.env.GITHUB_TOKEN,account:{label:e}};return Promise.resolve(t)}return r.authentication.getSession("github",o,{createIfNone:e})}t.getSession=async function(){let e=await a(!1);return e||s||(s=!0,"Sign in to GitHub"===await r.window.showInformationMessage("Sign in to access GitHub Copilot.","Sign in to GitHub")&&(e=await a(!0))),e&&(i=e.account),e},t.getGithubAccount=function(){return i}},7254:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotStatusBar=void 0;const r=n(9496),o=n(106),i=n(1133),s=n(6333),a=n(3060);t.CopilotStatusBar=class{constructor(e){this.ctx=e,this.showingMessage=!1,this.status="Normal",this.errorMessage="",this.disabledColor=new r.ThemeColor("statusBarItem.warningBackground"),this.delayedUpdateDisplay=(0,o.debounce)(100,(()=>{this.updateDisplay()})),this.enabled=this.checkEnabledForLanguage(),this.item=r.window.createStatusBarItem(r.StatusBarAlignment.Right,0),this.updateDisplay(),this.item.show(),r.window.onDidChangeActiveTextEditor((()=>{this.updateStatusBarIndicator()})),r.workspace.onDidCloseTextDocument((()=>{this.updateStatusBarIndicator()})),r.workspace.onDidOpenTextDocument((()=>{this.updateStatusBarIndicator()}))}updateStatusBarIndicator(){this.enabled=this.checkEnabledForLanguage(),this.updateDisplay()}checkEnabledForLanguage(){return(0,i.getEnabledConfig)(this.ctx)||!1}updateDisplay(){switch(this.status){case"Error":this.item.text="$(copilot-notconnected)",this.item.command=a.CMDShowActivationErrors,this.item.tooltip="Copilot activation failed";break;case"Warning":this.item.text="$(copilot-warning)",this.item.command=void 0,this.item.tooltip="Copilot is encountering temporary issues";break;case"InProgress":this.item.text="$(loading~spin)";break;case"Normal":this.item.text="$(copilot-logo)",this.item.command=a.CMDToggleCopilot,this.item.tooltip=this.enabled?"Deactivate Copilot":"Activate Copilot",this.item.backgroundColor=this.enabled?void 0:this.disabledColor}}getStatusBarItem(){return this.item}setProgress(){"Error"!==this.status&&(this.status="InProgress",this.delayedUpdateDisplay())}removeProgress(){"Error"!==this.status&&"Warning"!==this.status&&(this.status="Normal",this.delayedUpdateDisplay())}setWarning(){"Error"!==this.status&&(this.status="Warning",this.updateDisplay())}setError(e,t){this.status="Error",this.errorMessage=e,this.errorRetry=t,this.updateDisplay()}forceNormal(){this.status="Normal",this.errorMessage="",this.errorRetry=void 0,this.updateDisplay()}toggleStatusBar(){var e;const t=this.ctx.get(i.ConfigProvider),n=this.enabled,o=null===(e=r.window.activeTextEditor)||void 0===e?void 0:e.document.languageId,a="editor.action.inlineSuggest.hide";if(this.showingMessage)return;const c=s.TelemetryData.createAndMarkAsIssued({languageId:o||"*"});if((0,i.getEnabledConfig)(this.ctx,"*")==(0,i.getEnabledConfig)(this.ctx,o)){this.showingMessage=!0,setTimeout((()=>{this.showingMessage=!1}),15e3);const e=n?"Disable":"Enable",i=`${e} Globally`,l=`${e} for ${o}`,u=o?[i,l]:[i];r.window.showInformationMessage(`Would you like to ${n?"disable":"enable"} Copilot?`,...u).then((e=>{const l=e===i;if(this.showingMessage=!1,void 0===e)return void(0,s.telemetry)(this.ctx,"statusBar.cancelToggle");(0,s.telemetry)(this.ctx,"statusBar"+(l?".global":".language")+(n?"Off":"On"),c),n&&r.commands.executeCommand(a);const u=l?"*":o;t.updateEnabledConfig(this.ctx,u,!n).then((()=>{this.enabled=!n,this.updateDisplay()}))}))}else(0,s.telemetry)(this.ctx,"statusBar.language"+(n?"Off":"On"),c),n&&r.commands.executeCommand(a),t.updateEnabledConfig(this.ctx,o||"*",!n).then((()=>{this.enabled=!n,this.updateDisplay()}));this.updateDisplay()}showActivationErrors(e){if(this.showingMessage)return;this.showingMessage=!0;const t=["Show output log"];this.errorRetry&&t.push("Retry"),r.window.showWarningMessage(this.errorMessage,...t).then((t=>{this.showingMessage=!1,"Show Output log"===t&&e.show(),"Retry"===t&&this.errorRetry&&this.errorRetry()}))}}},4540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ignoreDocument=void 0;const r=n(1133),o=n(4197);t.ignoreDocument=function(e,t){const n=t.languageId;return!(0,r.getEnabledConfig)(e,n)||!![o.CopilotScheme,"output","search-editor"].includes(t.uri.scheme)}},4428:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activate=void 0;const r=n(4398),o=n(1133),i=n(6333),s=n(9380);function a(e,t,n,o,a){const c=new r.default(t,n,o);return(0,s.setupExperimentationService)(e),(0,i.configureReporter)(e,c),c}t.activate=function(e,t){const n=t.extension.packageJSON.name,r=(0,o.getVersion)(e),s=a(e,n,r,i.APP_INSIGHTS_KEY,t.globalState),c=a(e,n,r,i.APP_INSIGHTS_KEY_SECURE,t.globalState);return t.subscriptions.push(s),t.subscriptions.push(c),new i.TelemetryReporters(s,c)}},8129:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionLocationFactory=void 0;const r=n(9496),o=n(6403);class i extends o.LocationFactory{range(e,t,n,o){return void 0!==n&&void 0!==o?new r.Range(e,t,n,o):new r.Range(e,t)}position(e,t){return new r.Position(e,t)}}t.ExtensionLocationFactory=i},385:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionTextDocumentManager=void 0;const r=n(1017),o=n(9496),i=n(3136);class s extends i.TextDocumentManager{constructor(){super(...arguments),this.onDidFocusTextDocument=o.window.onDidChangeActiveTextEditor,this.onDidChangeTextDocument=o.workspace.onDidChangeTextDocument}get textDocuments(){return o.workspace.textDocuments}async getTextDocument(e){return o.workspace.openTextDocument(e)}async getRelativePath(e){var t,n,s;const a=e;if(a){if(a.isUntitled)return;return null!==(s=(0,i.getRelativePath)(null!==(n=null===(t=o.workspace.workspaceFolders)||void 0===t?void 0:t.map((e=>e.uri)))&&void 0!==n?n:[],a.fileName))&&void 0!==s?s:r.basename(a.fileName)}}findNotebook(e){const t=e;return o.workspace.notebookDocuments.find((e=>e.getCells().some((e=>e.document===t))))}}t.ExtensionTextDocumentManager=s},362:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshToken=t.CopilotTokenManagerFromGitHubToken=t.FixedCopilotTokenManager=t.CopilotTokenManager=t.setTelemetryConfigFromTokenInfo=t.extractTrackingIdFromToken=t.authFromGitHubToken=t.nowSeconds=t.TOKEN_REFRESHED_EVENT=void 0;const r=n(2361),o=n(1133),i=n(9899),s=n(2279),a=n(1547),c=n(6333),l=n(7057),u=new i.Logger(i.LogLevel.INFO,"auth");let d=0;function p(){return Math.floor(Date.now()/1e3)}async function h(e,t){var n,r;(0,c.telemetry)(e,"auth.new_login");const i=null!==(r=null===(n=t.devOverride)||void 0===n?void 0:n.copilotTokenUrl)&&void 0!==r?r:"https://api.github.com/copilot_internal/v2/token",a=await e.get(s.Fetcher).fetch(i,{headers:{Authorization:`token ${t.token}`,...(0,o.editorVersionHeaders)(e)}});if(!a)return u.info(e,"Failed to get copilot token"),(0,c.telemetryError)(e,"auth.request_failed"),{kind:"failure",reason:"FailedToGetToken"};const l=await a.json();if(!l)return u.info(e,"Failed to get copilot token"),(0,c.telemetryError)(e,"auth.request_read_failed"),{kind:"failure",reason:"FailedToGetToken"};if(m(e,l.user_notification,t),401===a.status)return u.info(e,"Failed to get copilot token due to 401 status"),(0,c.telemetryError)(e,"auth.unknown_401"),{kind:"failure",reason:"HTTP401"};if(0){u.info(e,`Invalid copilot token--------------------: missing token: ${a.status} ${a.statusText}`),(0,c.telemetryError)(e,"auth.invalid_token",c.TelemetryData.createAndMarkAsIssued({status:a.status.toString(),status_text:a.statusText}));const n=l.error_details;return m(e,n,t),{kind:"failure",reason:"NotAuthorized",...n}}const d=l.expires_at;return {kind:"success",...l}}t.TOKEN_REFRESHED_EVENT="token_refreshed",t.nowSeconds=p,t.authFromGitHubToken=h;const f=new Map;function m(e,t,n){if(!t)return;const r=p();f.get(t.message)||(f.set(t.message,r),e.get(a.NotificationSender).showWarningMessage(t.message,{title:t.title},{title:"Dismiss"}).catch((t=>{console.error(t),u.error(e,`Error while sending notification: ${t.message}`)})).then((async r=>{const i=(null==r?void 0:r.title)===t.title,a=i||"Dismiss"===(null==r?void 0:r.title);if(i){const n=e.get(o.EditorAndPluginInfo).getEditorPluginInfo(e),r=t.url.replace("{EDITOR}",encodeURIComponent(n.name+"_"+n.version));await e.get(l.UrlOpener).open(r)}"notification_id"in t&&a&&await async function(e,t,n){var r,i;const a=null!==(i=null===(r=n.devOverride)||void 0===r?void 0:r.notificationUrl)&&void 0!==i?i:"https://api.github.com/copilot_internal/notification",c=await e.get(s.Fetcher).fetch(a,{headers:{Authorization:`token ${n.token}`,...(0,o.editorVersionHeaders)(e)},method:"POST",body:JSON.stringify({notification_id:t})});c&&c.ok||u.error(e,`Failed to send notification result to GitHub: ${null==c?void 0:c.status} ${null==c?void 0:c.statusText}`)}(e,t.notification_id,n)})))}function g(e){const t=null==e?void 0:e.split(":")[0],n=null==t?void 0:t.split(";");for(const e of n){const[t,n]=e.split("=");if("tid"===t)return n}}function _(e){const t=g(e.token);void 0!==t&&(0,c.setTelemetryConfig)({trackingId:t,optedIn:"enabled"===e.telemetry||"unconfigured"===e.telemetry})}t.extractTrackingIdFromToken=g,t.setTelemetryConfigFromTokenInfo=_;class y{constructor(){this.tokenRefreshEventEmitter=new r.EventEmitter}}function v(e,n,r){const o=p();d>0||(d++,setTimeout((async()=>{let r,i="";try{d--,await n.getCopilotToken(e,!0),r="success",n.tokenRefreshEventEmitter.emit(t.TOKEN_REFRESHED_EVENT)}catch(e){r="failure",i=e.toString()}const s=c.TelemetryData.createAndMarkAsIssued({result:r},{time_taken:p()-o,refresh_count:d});i&&(s.properties.reason=i),(0,c.telemetry)(e,"auth.token_refresh",s)}),1e3*r))}t.CopilotTokenManager=y,t.FixedCopilotTokenManager=class extends y{constructor(e){super(),this.tokenInfo=e,this.wasReset=!1,_(e)}async getGitHubToken(){return Promise.resolve("token")}async getCopilotToken(e,t){return this.tokenInfo.token}resetCopilotToken(e,t){this.wasReset=!0}async checkCopilotToken(e){return{status:"OK",telemetry:this.tokenInfo.telemetry}}},t.CopilotTokenManagerFromGitHubToken=class extends y{constructor(e){super(),this.githubToken=e,this.copilotToken=void 0}async getGitHubToken(){return Promise.resolve(this.githubToken.token)}async getCopilotToken(e,t){var n;if(!this.copilotToken||this.copilotToken.expires_at<p()||t){const t=await h(e,this.githubToken);if("failure"===t.kind)throw Error(`Failed to get copilot token: ${t.reason.toString()} ${null!==(n=t.message)&&void 0!==n?n:""}`);this.copilotToken={...t},v(e,this,t.refresh_in)}return this.copilotToken.token}async checkCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<p()){const t=await h(e,this.githubToken);if("failure"===t.kind)return t;this.copilotToken={...t},v(e,this,t.refresh_in)}return{status:"OK",telemetry:this.copilotToken.telemetry}}resetCopilotToken(e,t){void 0!==t&&(0,c.telemetry)(e,"auth.reset_token_"+t),u.debug(e,`Resetting copilot token on HTTP error ${t||"unknown"}`),this.copilotToken=void 0}},t.refreshToken=v},6794:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TELEMETRY_TERMS_URL=t.LAST_TELEMETRY_TERMS_UPDATE=void 0,t.LAST_TELEMETRY_TERMS_UPDATE="2021-10-14",t.TELEMETRY_TERMS_URL="https://github.co/copilot-telemetry-terms"},6881:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeTracker=void 0;const r=n(3136);t.ChangeTracker=class{constructor(e,t,n){this._referenceCount=0,this._isDisposed=!1,this._offset=n;const o=e.get(r.TextDocumentManager);this._tracker=o.onDidChangeTextDocument((async e=>{if(e.document.uri===t)for(const t of e.contentChanges)if(t.rangeOffset+t.rangeLength<=this.offset){const e=t.text.length-t.rangeLength;this._offset=this._offset+e}}))}get offset(){return this._offset}push(e,t){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout((()=>{e(),this._referenceCount--,0===this._referenceCount&&(this._tracker.dispose(),this._isDisposed=!0)}),t)}}},299:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Clock=void 0,t.Clock=class{now(){return new Date}}},3076:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.keyForPrompt=void 0;const r=n(1354);t.keyForPrompt=function(e){return(0,r.SHA256)(e.prefix+e.suffix).toString()},t.LRUCache=class{constructor(e=10){this.values=new Map,this.lruKeys=[],this.size=e}removeKeyFromLRU(e){const t=this.lruKeys.indexOf(e);-1!==t&&this.lruKeys.splice(t,1)}touchKeyInLRU(e){this.removeKeyFromLRU(e),this.lruKeys.push(e)}clear(){this.values.clear(),this.lruKeys=[]}deleteKey(e){this.removeKeyFromLRU(e),void 0!==this.values.get(e)&&this.values.delete(e)}get(e){if(this.values.has(e)){const t=this.values.get(e);return this.touchKeyInLRU(e),t}}put(e,t){let n=[];this.values.has(e)?n=[e]:this.lruKeys.length>=this.size&&(n=this.lruKeys.splice(0,1));for(const e of n)this.deleteKey(e);this.values.set(e,t),this.touchKeyInLRU(e)}}},106:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=t.Debouncer=void 0,t.Debouncer=class{async debounce(e){return this.state&&(clearTimeout(this.state.timer),this.state.reject(),this.state=void 0),new Promise(((t,n)=>{this.state={timer:setTimeout((()=>t()),e),reject:n}}))}},t.debounce=function(e,t){let n;return(...r)=>(n&&clearTimeout(n),new Promise((o=>{n=setTimeout((()=>{const e=t(...r);o(e)}),e)})))}},6932:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asyncIterableFromArray=t.asyncIterableMapFilter=t.asyncIterableFilter=t.asyncIterableMap=void 0,t.asyncIterableMap=async function*(e,t){for await(const n of e)yield t(n)},t.asyncIterableFilter=async function*(e,t){for await(const n of e)await t(n)&&(yield n)},t.asyncIterableMapFilter=async function*(e,t){for await(const n of e){const e=await t(n);void 0!==e&&(yield e)}},t.asyncIterableFromArray=async function*(e){for(const t of e)yield t}},1133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.editorVersionHeaders=t.EditorAndPluginInfo=t.formatNameAndVersion=t.getTestVscInfo=t.VscInfo=t.getVersion=t.getBuild=t.getBuildType=t.isProduction=t.BuildInfo=t.suffixMatchThreshold=t.suffixPercent=t.getEnabledConfig=t.getLanguageConfig=t.dumpConfig=t.getHiddenConfig=t.isDefaultSettingOverwritten=t.getConfig=t.getConfigDefaultForObjectKey=t.getConfigDefaultForKey=t.InMemoryConfigProvider=t.DefaultsOnlyConfigProvider=t.ConfigProvider=t.ConfigBlockModeConfig=t.BlockModeConfig=t.BuildType=t.shouldDoServerTrimming=t.shouldDoParsingTrimming=t.BlockMode=t.ConfigKey=void 0;const r=n(3055),o=n(4197),i=n(9189),s=n(4147);var a,c;t.ConfigKey={Enable:"enable",InlineSuggestEnable:"inlineSuggest.enable",ShowEditorCompletions:["editor","showEditorCompletions"],EnableAutoCompletions:["editor","enableAutoCompletions"],DelayCompletions:["editor","delayCompletions"],FilterCompletions:["editor","filterCompletions"],DisplayStyle:["advanced","displayStyle"],SecretKey:["advanced","secret_key"],SolutionLength:["advanced","length"],Stops:["advanced","stops"],Temperature:["advanced","temperature"],TopP:["advanced","top_p"],IndentationMode:["advanced","indentationMode"],InlineSuggestCount:["advanced","inlineSuggestCount"],ListCount:["advanced","listCount"],DebugOverrideProxyUrl:["advanced","debug.overrideProxyUrl"],DebugTestOverrideProxyUrl:["advanced","debug.testOverrideProxyUrl"],DebugOverrideEngine:["advanced","debug.overrideEngine"],DebugShowScores:["advanced","debug.showScores"],DebugOverrideLogLevels:["advanced","debug.overrideLogLevels"],DebugFilterLogCategories:["advanced","debug.filterLogCategories"],DebugUseSuffix:["advanced","debug.useSuffix"]},function(e){e.Parsing="parsing",e.Server="server",e.ParsingAndServer="parsingandserver"}(a=t.BlockMode||(t.BlockMode={})),t.shouldDoParsingTrimming=function(e){return[a.Parsing,a.ParsingAndServer].includes(e)},t.shouldDoServerTrimming=function(e){return[a.Server,a.ParsingAndServer].includes(e)},(c=t.BuildType||(t.BuildType={})).DEV="dev",c.PROD="prod",c.NIGHTLY="nightly";class l{}function u(e,t){return e!==a.ParsingAndServer||(0,r.isSupportedLanguageId)(t)?e:a.Server}t.BlockModeConfig=l,t.ConfigBlockModeConfig=class extends l{async forLanguage(e,n){if(e.get(d).isDefaultSettingOverwritten(t.ConfigKey.IndentationMode))switch(e.get(d).getLanguageConfig(t.ConfigKey.IndentationMode,n)){case"client":case!0:case"server":return a.Server;case"clientandserver":return u(a.ParsingAndServer,n);default:return a.Parsing}const o=await e.get(i.Features).overrideBlockMode();return o?u(o,n):(0,r.isSupportedLanguageId)(n)?a.Parsing:a.Server}};class d{}function p(e){try{const t=s.contributes.configuration[0].properties[`${o.CopilotConfigPrefix}.${e}`].default;if(void 0===t)throw new Error(`Missing config default value: ${o.CopilotConfigPrefix}.${e}`);return t}catch(t){throw new Error(`Error inspecting config default value ${o.CopilotConfigPrefix}.${e}: ${t}`)}}function h(e,t){try{const n=s.contributes.configuration[0].properties[`${o.CopilotConfigPrefix}.${e}`].properties[t].default;if(void 0===n)throw new Error(`Missing config default value: ${o.CopilotConfigPrefix}.${e}`);return n}catch(n){throw new Error(`Error inspecting config default value ${o.CopilotConfigPrefix}.${e}.${t}: ${n}`)}}function f(e,t){return e.get(d).getConfig(t)}function m(e,t){return e.get(d).isDefaultSettingOverwritten(t)}function g(e,t,n){return m(e,t)?f(e,t):n.default}function _(e,t,n){return e.get(d).getLanguageConfig(t,n)}t.ConfigProvider=d,t.DefaultsOnlyConfigProvider=class extends d{getConfig(e){return Array.isArray(e)?h(e[0],e[1]):p(e)}isDefaultSettingOverwritten(e){return!1}dumpConfig(){return{}}getLanguageConfig(e,t){const n=this.getConfig(e);return t&&t in n?n[t]:n["*"]}},t.InMemoryConfigProvider=class{constructor(e,t){this.baseConfigProvider=e,this.overrides=t}getConfig(e){const t=this.overrides.get(e);return void 0!==t?t:this.baseConfigProvider.getConfig(e)}setConfig(e,t){void 0!==t?this.overrides.set(e,t):this.overrides.delete(e)}setLanguageEnablement(e,n){this.overrides.set(t.ConfigKey.Enable,{[e]:n})}isDefaultSettingOverwritten(e){return!!this.overrides.has(e)||this.baseConfigProvider.isDefaultSettingOverwritten(e)}keyAsString(e){return Array.isArray(e)?e.join("."):e}dumpConfig(){const e=this.baseConfigProvider.dumpConfig();return this.overrides.forEach(((t,n)=>{e[this.keyAsString(n)]=JSON.stringify(t)})),e}getLanguageConfig(e,t){const n=this.overrides.get(e);return void 0!==n?void 0!==t?n[t]:n["*"]:this.baseConfigProvider.getLanguageConfig(e,t)}},t.getConfigDefaultForKey=p,t.getConfigDefaultForObjectKey=h,t.getConfig=f,t.isDefaultSettingOverwritten=m,t.getHiddenConfig=g,t.dumpConfig=function(e){return e.get(d).dumpConfig()},t.getLanguageConfig=_,t.getEnabledConfig=function(e,n){return _(e,t.ConfigKey.Enable,n)},t.suffixPercent=async function(e,n,r){return g(e,t.ConfigKey.DebugUseSuffix,{default:!1})?15:e.get(i.Features).suffixPercent(n,r)},t.suffixMatchThreshold=async function(e,n,r){return g(e,t.ConfigKey.DebugUseSuffix,{default:!1})?20:e.get(i.Features).suffixMatchThreshold(n,r)};class y{constructor(){this.packageJson=s}isProduction(){return"dev"!=this.getBuildType()}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}}t.BuildInfo=y,t.isProduction=function(e){return e.get(y).isProduction()},t.getBuildType=function(e){return e.get(y).getBuildType()},t.getBuild=function(e){return e.get(y).getBuild()},t.getVersion=function(e){return e.get(y).getVersion()};class v{constructor(e,t,n){this.sessionId=e,this.machineId=t,this.vsCodeVersion=n}}function b({name:e,version:t}){return`${e}/${t}`}t.VscInfo=v,t.getTestVscInfo=function(){return new v("test-session-id","test-machine-id","test-vscode-version")},t.formatNameAndVersion=b;class w{}t.EditorAndPluginInfo=w,t.editorVersionHeaders=function(e){const t=e.get(w);return{"Editor-Version":b(t.getEditorInfo(e)),"Editor-Plugin-Version":b(t.getEditorPluginInfo(e))}}},4197:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotScheme=t.CopilotConfigPrefix=void 0,t.CopilotConfigPrefix="github.copilot",t.CopilotScheme="copilot"},7870:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0,t.Context=class{constructor(e){var t;this.baseContext=e,this.constructionStack=[],this.instances=new Map;const n=null===(t=(new Error).stack)||void 0===t?void 0:t.split("\n");n&&this.constructionStack.push(...n.slice(1))}get(e){const t=this.tryGet(e);if(t)return t;throw new Error(`No instance of ${e.name} has been registered.\n${this}`)}tryGet(e){return this.instances.get(e)||(this.baseContext?this.baseContext.tryGet(e):void 0)}set(e,t){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.instances.set(e,t)}forceSet(e,t){this.instances.set(e,t)}toString(){var e,t;let n=" Context created at:\n";for(const e of this.constructionStack||[])n+=` ${e}\n`;return n+=null!==(t=null===(e=this.baseContext)||void 0===e?void 0:e.toString())&&void 0!==t?t:"",n}get debug(){const e={};for(const[t,n]of this.instances)e[t.name]=n;return e}}},256:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeLocation=t.encodeLocation=t.completionContextForDocument=t.CompletionContext=t.completionTypeToString=t.CompletionType=void 0;const r=n(7373),o=n(6403),i=n(4197);var s;!function(e){e[e.OPEN_COPILOT=2]="OPEN_COPILOT",e[e.TODO_QUICK_FIX=3]="TODO_QUICK_FIX",e[e.UNKNOWN_FUNCTION_QUICK_FIX=4]="UNKNOWN_FUNCTION_QUICK_FIX"}(s=t.CompletionType||(t.CompletionType={})),t.completionTypeToString=function(e){switch(e){case s.OPEN_COPILOT:return"open copilot";case s.TODO_QUICK_FIX:return"todo quick fix";case s.UNKNOWN_FUNCTION_QUICK_FIX:return"unknown function quick fix";default:return"unknown"}};class a{constructor(e,t,n){this.prependToCompletion="",this.appendToCompletion="",this.indentation=null,this.completionType=s.OPEN_COPILOT,this.insertPosition=e.get(o.LocationFactory).position(t.line,t.character),this.completionType=n}static fromJSONParse(e,t){const n=e.get(o.LocationFactory).position(t.insertPosition.line,t.insertPosition.character),r=new a(e,n,t.completionType);return r.prependToCompletion=t.prependToCompletion,r.appendToCompletion=t.appendToCompletion,r.indentation=t.indentation,r}}t.CompletionContext=a,t.completionContextForDocument=function(e,t,n){let r=n;const o=t.lineAt(n.line);return o.isEmptyOrWhitespace||(r=o.range.end),new a(e,r,s.OPEN_COPILOT)};let c=0;t.encodeLocation=function(e,t){const n=e.toString().split("#"),o=n.length>1?n[1]:"",s=JSON.stringify([n[0],t,o]);return r.URI.parse(`${i.CopilotScheme}:GitHub%20Copilot?${s}#${c++}`)},t.decodeLocation=function(e,t){const[n,o,i]=JSON.parse(t.query);return[r.URI.parse(i.length>0?n+"#"+i:n),a.fromJSONParse(e,o)]}},893:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotListDocument=void 0;const r=n(106),o=n(1133),i=n(6333),s=n(2388);class a{constructor(e,t,n,s,a,c){this.targetDocument=n,this.completionContext=s,this.token=c,this._solutionCount=0,this.solutionCountTarget=0,this._solutions=[],this._wasCancelled=!1,this._updateHandlers=new Set,this.savedTelemetryData=i.TelemetryData.createAndMarkAsIssued(),this.debouncedEventFire=(0,r.debounce)(10,(()=>this._updateHandlers.forEach((e=>e(this._uri))))),this.onDidResultUpdated=e=>(this._updateHandlers.add(e),{dispose:()=>{this._updateHandlers.delete(e)}}),this.solutionCountTarget=a,this._ctx=e,this._uri=t,this._showLogprobs=(0,o.getConfig)(e,o.ConfigKey.DebugShowScores),this.startPosition=this.completionContext.insertPosition,this.numberHeaderLines=Math.max(1,this.formatDisplayLines("").length-1)}async getDocument(){return this.targetDocument}get targetUri(){return this.targetDocument.uri}header(){if(this._wasCancelled)return"No synthesized solutions found.";{const e=this._solutionCount-this._solutions.length>0?" (Duplicates hidden)":"";return`Synthesizing ${this._solutionCount}/${this.solutionCountTarget} solutions${e}`}}areSolutionsDuplicates(e,t){return(0,s.normalizeCompletionText)(e.completionText)===(0,s.normalizeCompletionText)(t.completionText)}insertSorted(e,t,n){if(!/^\s*$/.test(t.completionText)){for(let r=0;r<e.length;r++){const o=e[r];if(this.areSolutionsDuplicates(o,t)){if(n(o)<n(t)){e.splice(r,1);break}return}}for(let r=0;r<e.length;r++)if(n(e[r])<n(t))return void e.splice(r,0,t);e.push(t)}}reportCancelled(){this._wasCancelled=!0,this.debouncedEventFire()}getCancellationToken(){return this.token}insertSolution(e){const t={displayLines:this.formatDisplayLines(e.displayText,e.meanProb,e.meanLogProb),completionText:e.completionText,meanLogProb:e.meanLogProb,meanProb:e.meanProb,prependToCompletion:e.prependToCompletion,requestId:e.requestId,choiceIndex:e.choiceIndex};this.insertSorted(this._solutions,t,(e=>e.meanProb)),this._solutionCount++,this.debouncedEventFire()}formatDisplayLines(e,t,n){let r="";return this._showLogprobs&&(n=n||0,r+=`\n\t# mean prob: ${t}`),`${a.separator}${r}\n\n${e}`.split("\n")}async runQuery(){const e=await(0,s.launchSolutions)(this._ctx,this);this.processNextSolution(e)}async processNextSolution(e){switch(e.status){case"FinishedNormally":case"FinishedWithError":return;case"Solution":this.insertSolution(e.solution),this.processNextSolution(await e.next)}}solutionsReceived(){return this._solutionCount}solutions(){return this._solutions}get value(){return[this.header()].concat(this._solutions.flatMap((e=>e.displayLines))).concat("").join("\n")}}t.CopilotListDocument=a,a.separator="\n======="},2388:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchSolutions=t.normalizeCompletionText=void 0;const r=n(2277),o=n(6932),i=n(1133),s=n(256),a=n(9899),c=n(3),l=n(937),u=n(6722),d=n(7727),p=n(4969),h=n(2533),f=n(766),m=n(1124),g=n(6333),_=n(6403),y=new a.Logger(a.LogLevel.INFO,"solutions");function v(e,t,n,r){return async o=>{if(r instanceof Array){const[i,s]=r;return(0,d.isBlockBodyFinishedWithPrefix)(e,t,n,o,s)}return(0,d.isBlockBodyFinished)(e,t,n,o)}}async function b(e,t,n){if(t.isCancellationRequested)return e.removeProgress(),{status:"FinishedWithError",error:"Cancelled"};const r=await n.next();return!0===r.done?(e.removeProgress(),{status:"FinishedNormally"}):{status:"Solution",solution:r.value,next:b(e,t,n)}}t.normalizeCompletionText=function(e){return e.replace(/\s+/g,"")},t.launchSolutions=async function(e,t){var n,a,w;const x=t.completionContext.insertPosition,E=t.completionContext.prependToCompletion,C=t.completionContext.indentation,S=e.get(_.LocationFactory),T=await t.getDocument(),k=await(0,p.extractPrompt)(e,T,x);if("contextTooShort"===k.type)return t.reportCancelled(),{status:"FinishedWithError",error:"Context too short"};const I=k.prompt,P=k.trailingWs;P.length>0&&(t.startPosition=S.position(t.startPosition.line,t.startPosition.character-P.length));const A=t.getCancellationToken(),O=r.v4();if(t.savedTelemetryData=g.TelemetryData.createAndMarkAsIssued({headerRequestId:O,languageId:T.languageId,source:(0,s.completionTypeToString)(t.completionContext.completionType)},{...(0,g.telemetrizePromptLength)(I),solutionCount:t.solutionCountTarget,promptEndPos:T.offsetAt(x)}),t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX){const e=I.prefix.split("\n"),t=e.pop(),n=e.pop();if(n){const r=/^\W+(todo:?\s+)/i.exec(n);if(r){const o=r[1],i=n.replace(o,"");I.prefix=e.join("\n")+"\n"+i+"\n"+t}}}t.completionContext.completionType===s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX&&(I.prefix+=t.completionContext.prependToCompletion),y.info(e,`prompt: ${JSON.stringify(I)}`),y.debug(e,`prependToCompletion: ${E}`),(0,g.telemetry)(e,"solution.requested",t.savedTelemetryData);const N=await e.get(i.BlockModeConfig).forLanguage(e,T.languageId),R=(0,h.isSupportedLanguageId)(T.languageId),M=(0,d.contextIndentation)(T,x),L={stream:!0,extra:{language:T.languageId,next_indent:null!==(n=M.next)&&void 0!==n?n:0}};"parsing"!==N||R||(L.stop=["\n\n","\r\n\r\n"]);const $=(0,f.extractRepoInfoInBackground)(e,T.fileName),D={prompt:I,languageId:T.languageId,repoInfo:$,ourRequestId:O,engineUrl:await(0,c.getEngineURL)(e,(0,f.tryGetGitHubNWO)($),T.languageId,(0,f.getDogFood)($),(0,f.getUserKind)(e),t.savedTelemetryData),count:t.solutionCountTarget,uiKind:l.CopilotUiKind.Panel,postOptions:L,requestLogProbs:!0};let F;const j=t.completionContext.completionType===s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX?[s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX,t.completionContext.prependToCompletion]:t.completionContext.completionType;switch(N){case i.BlockMode.Server:F=async e=>{},L.extra.force_indent=null!==(a=M.prev)&&void 0!==a?a:-1,L.extra.trim_by_indentation=!0;break;case i.BlockMode.ParsingAndServer:F=R?v(e,T,t.startPosition,j):async e=>{},L.extra.force_indent=null!==(w=M.prev)&&void 0!==w?w:-1,L.extra.trim_by_indentation=!0;break;case i.BlockMode.Parsing:default:F=R?v(e,T,t.startPosition,j):async e=>{}}e.get(u.StatusReporter).setProgress();const q=await e.get(l.OpenAIFetcher).fetchAndStreamCompletions(e,D,g.TelemetryData.createAndMarkAsIssued(),F,A);if("failed"===q.type||"canceled"===q.type)return t.reportCancelled(),e.get(u.StatusReporter).removeProgress(),{status:"FinishedWithError",error:`${q.type}: ${q.reason}`};let B=q.choices;B=async function*(e,t){for await(const n of e){const e={...n};e.completionText=t+e.completionText.trimRight(),yield e}}(B,E),null!==C&&(B=(0,l.cleanupIndentChoices)(B,C)),B=(0,o.asyncIterableMapFilter)(B,(async t=>(0,m.postProcessChoice)(e,"solution",T,x,t,!1,y)));const U=(0,o.asyncIterableMapFilter)(B,(async n=>{let r=n.completionText;if(y.info(e,`Open Copilot completion: [${n.completionText}]`),t.completionContext.completionType===s.CompletionType.OPEN_COPILOT||t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX){let t="";const o=await(0,d.getNodeStart)(e,T,x,n.completionText);if(o)[t]=(0,p.trimLastLine)(T.getText(S.range(S.position(o.line,o.character),x)));else{const e=S.position(x.line,0);t=T.getText(S.range(e,x))}r=t+r}let o=n.completionText;t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX&&(T.lineAt(x.line).isEmptyOrWhitespace||(o+="\n")),P.length>0&&o.startsWith(P)&&(o=o.substring(P.length));const i=n.meanLogProb;return{displayText:r,meanProb:void 0!==i?Math.exp(i):0,meanLogProb:i||0,completionText:o,requestId:n.requestId,choiceIndex:n.choiceIndex,prependToCompletion:E}}));return b(e.get(u.StatusReporter),A,U[Symbol.asyncIterator]())}},9408:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDefaultHandlers=void 0;const r=n(2279),o=n(6333);t.registerDefaultHandlers=function(e,t){process.addListener("uncaughtException",(t=>{console.error("uncaughtException",t),o.telemetryException(e,t,"uncaughtException")}));let n=!1;process.addListener("unhandledRejection",((i,s)=>{if(n)return;if(n=!0,"vscode"===t&&!i)return;if("aborted"===i.type||(0,r.isAbortError)(i))return;if("vscode"===t&&["ENOTFOUND","ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENETDOWN","ENETUNREACH","EADDRNOTAVAIL"].includes(i.code))return;if("ENOENT"==i.code)return;let a="";try{a=`${i.message} (${i.code})`,a=JSON.stringify(i)}catch(e){a="[actual reason JSON was cyclic]"}"vscode"===t&&"{}"===a||(console.error("unhandledRejection",a),o.telemetryError(e,"unhandledRejection",o.TelemetryData.createAndMarkAsIssued({origin:"unhandledRejection",reason:"Unhandled rejection logged to restricted telemetry"}),!1),o.telemetryError(e,"unhandledRejection",o.TelemetryData.createAndMarkAsIssued({origin:"unhandledRejection",reason:a}),!0),n=!1)}))}},1839:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDocumentTracker=t.sortByAccessTimes=void 0;const r=n(3136),o=new Map;t.sortByAccessTimes=function(e){return[...e].sort(((e,t)=>{var n,r;const i=null!==(n=o.get(e.uri.toString()))&&void 0!==n?n:0;return(null!==(r=o.get(t.uri.toString()))&&void 0!==r?r:0)-i}))},t.registerDocumentTracker=e=>e.get(r.TextDocumentManager).onDidFocusTextDocument((e=>{e&&o.set(e.document.uri.toString(),Date.now())}))},219:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpConfig=t.ExpTreatmentVariables=void 0;const r=n(6333),o=n(6500);var i;(i=t.ExpTreatmentVariables||(t.ExpTreatmentVariables={})).AA="copilotaa",i.CustomEngine="copilotcustomengine",i.Fetcher="copilotfetcher",i.OverrideBlockMode="copilotoverrideblockmode",i.OverrideNumGhostCompletions="copilotoverridednumghostcompletions",i.SuffixPercent="CopilotSuffixPercent",i.BeforeRequestWaitMs="copilotlms",i.NeighboringTabsOption="copilotneighboringtabs",i.DebounceMs="copilotdebouncems",i.DebouncePredict="copilotdebouncepredict",i.ContextualFilterAcceptThreshold="copilotcontextualfilteracceptthreshold",i.disableLogProb="copilotLogProb",i.RepetitionFilterMode="copilotrepetitionfiltermode",i.GranularityTimePeriodSizeInH="copilottimeperiodsizeinh",i.GranularityByCallBuckets="copilotbycallbuckets",i.SuffixStartMode="copilotsuffixstartmode",i.SuffixMatchThreshold="copilotsuffixmatchthreshold",i.MultiLogitBias="copilotlbeot";class s{constructor(e,t,n){this.variables=e,this.assignmentContext=t,this.features=n}static createFallbackConfig(e,t){return(0,r.telemetryExpProblem)(e,{reason:t}),this.createEmptyConfig()}static createEmptyConfig(){return new s({},"","")}addToTelemetry(e){e.properties[o.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features,e.properties[o.ExpServiceTelemetryNames.assignmentContextTelemetryPropertyName]=this.assignmentContext}}t.ExpConfig=s},9189:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Features=t.Task=void 0;const r=n(3055),o=n(299),i=n(3076),s=n(9657),a=n(219),c=n(9748),l=n(8142),u=n(9030);class d{constructor(e){this.ctx=e,this.cache=new i.LRUCache(200)}async fetchExpConfig(e){let t=this.cache.get(e.stringify());return t||(t=new p((()=>this.ctx.get(c.ExpConfigMaker).fetchExperiments(this.ctx,e.toHeaders())),36e5),this.cache.put(e.stringify(),t)),t.run()}getCachedExpConfig(e){const t=this.cache.get(e.stringify());return null==t?void 0:t.value()}}class p{constructor(e,t=1/0){this.producer=e,this.expirationMs=t}async run(){return void 0===this.promise&&(this.promise=this.producer(),this.storeResult(this.promise).then((()=>{this.expirationMs<1/0&&void 0!==this.promise&&setTimeout((()=>this.promise=void 0),this.expirationMs)}))),this.promise}async storeResult(e){try{this.result=await e}finally{void 0===this.result&&(this.promise=void 0)}}value(){return this.result}}t.Task=p;class h{constructor(e){this.ctx=e,this.staticFilters={},this.dynamicFilters={},this.upcomingDynamicFilters={},this.assignments=new d(this.ctx),this.granularityDirectory=new u.GranularityDirectory("unspecified",e.get(o.Clock))}setPrefix(e){this.granularityDirectory=new u.GranularityDirectory(e,this.ctx.get(o.Clock))}registerStaticFilters(e){Object.assign(this.staticFilters,e)}registerDynamicFilter(e,t){this.dynamicFilters[e]=t}getDynamicFilterValues(){const e={};for(const[t,n]of Object.entries(this.dynamicFilters))e[t]=n();return e}registerUpcomingDynamicFilter(e,t){this.upcomingDynamicFilters[e]=t}async getAssignment(e,t={},n){var r,o;const i=this.makeFilterSettings(t),s=this.granularityDirectory.extendFilters(i),c=await this.getExpConfig(s.newFilterSettings);this.granularityDirectory.update(i,+(null!==(r=c.variables[a.ExpTreatmentVariables.GranularityByCallBuckets])&&void 0!==r?r:NaN),+(null!==(o=c.variables[a.ExpTreatmentVariables.GranularityTimePeriodSizeInH])&&void 0!==o?o:NaN));const l=this.granularityDirectory.extendFilters(i),u=l.newFilterSettings,d=await this.getExpConfig(u);let p=new Promise((e=>setTimeout(e,h.upcomingDynamicFilterCheckDelayMs)));for(const e of l.otherFilterSettingsToPrefetch)p=p.then((async()=>{await new Promise((e=>setTimeout(e,h.upcomingDynamicFilterCheckDelayMs))),this.getExpConfig(e)}));return this.prepareForUpcomingFilters(u),n&&(n.filtersAndExp={exp:d,filters:u}),d.variables[e]}makeFilterSettings(e){return new l.FilterSettings({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e){try{return this.assignments.fetchExpConfig(e)}catch(e){return a.ExpConfig.createFallbackConfig(this.ctx,`Error fetching ExP config: ${e}`)}}async prepareForUpcomingFilters(e){if(!((new Date).getMinutes()<60-h.upcomingTimeBucketMinutes))for(const[t,n]of Object.entries(this.upcomingDynamicFilters))await new Promise((e=>setTimeout(e,h.upcomingDynamicFilterCheckDelayMs))),this.getExpConfig(e.withChange(t,n()))}stringify(){var e;const t=this.assignments.getCachedExpConfig(new l.FilterSettings({}));return JSON.stringify(null!==(e=null==t?void 0:t.variables)&&void 0!==e?e:{})}async customEngine(e,t,n,r,o){var i;const s={[l.Filter.CopilotRepository]:e,[l.Filter.CopilotFileType]:t,[l.Filter.CopilotDogfood]:n,[l.Filter.CopilotUserKind]:r};return null!==(i=await this.getAssignment(a.ExpTreatmentVariables.CustomEngine,s,o))&&void 0!==i?i:""}async beforeRequestWaitMs(e,t,n){var r;const o={[l.Filter.CopilotRepository]:e,[l.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(a.ExpTreatmentVariables.BeforeRequestWaitMs,o,n))&&void 0!==r?r:0}async multiLogitBias(e,t,n){var r;const o={[l.Filter.CopilotRepository]:e,[l.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(a.ExpTreatmentVariables.MultiLogitBias,o,n))&&void 0!==r&&r}async debounceMs(){var e;return null!==(e=await this.getAssignment(a.ExpTreatmentVariables.DebounceMs))&&void 0!==e?e:0}async debouncePredict(){var e;return null!==(e=await this.getAssignment(a.ExpTreatmentVariables.DebouncePredict))&&void 0!==e&&e}async contextualFilterAcceptThreshold(){var e;return null!==(e=await this.getAssignment(a.ExpTreatmentVariables.ContextualFilterAcceptThreshold))&&void 0!==e?e:void 0}async disableLogProb(){var e;return null!==(e=await this.getAssignment(a.ExpTreatmentVariables.disableLogProb))&&void 0!==e&&e}async overrideBlockMode(){return await this.getAssignment(a.ExpTreatmentVariables.OverrideBlockMode)}async overrideNumGhostCompletions(){return await this.getAssignment(a.ExpTreatmentVariables.OverrideNumGhostCompletions)}async suffixPercent(e,t){var n;const r={[l.Filter.CopilotRepository]:e,[l.Filter.CopilotFileType]:t};return null!==(n=await this.getAssignment(a.ExpTreatmentVariables.SuffixPercent,r))&&void 0!==n?n:0}async suffixMatchThreshold(e,t){var n;const r={[l.Filter.CopilotRepository]:e,[l.Filter.CopilotFileType]:t};return null!==(n=await this.getAssignment(a.ExpTreatmentVariables.SuffixMatchThreshold,r))&&void 0!==n?n:0}async suffixStartMode(e,t){const n={[l.Filter.CopilotRepository]:e,[l.Filter.CopilotFileType]:t};switch(await this.getAssignment(a.ExpTreatmentVariables.SuffixStartMode,n)){default:return r.SuffixStartMode.Cursor;case"cursortrimstart":return r.SuffixStartMode.CursorTrimStart;case"siblingblock":return r.SuffixStartMode.SiblingBlock;case"siblingblocktrimstart":return r.SuffixStartMode.SiblingBlockTrimStart}}async neighboringTabsOption(e,t){const n={[l.Filter.CopilotRepository]:e,[l.Filter.CopilotFileType]:t};switch(await this.getAssignment(a.ExpTreatmentVariables.NeighboringTabsOption,n)){case"none":return r.NeighboringTabsOption.None;case"conservative":return r.NeighboringTabsOption.Conservative;case"medium":return r.NeighboringTabsOption.Medium;default:return r.NeighboringTabsOption.Eager;case"eagerbutlittle":return r.NeighboringTabsOption.EagerButLittle}}async repetitionFilterMode(){switch(await this.getAssignment(a.ExpTreatmentVariables.RepetitionFilterMode)){case"proxy":return s.RepetitionFilterMode.PROXY;case"both":return s.RepetitionFilterMode.BOTH;default:return s.RepetitionFilterMode.CLIENT}}async addExpAndFilterToTelemetry(e){const t=this.makeFilterSettings({});e.filtersAndExp={filters:t,exp:await this.getExpConfig(t)}}}t.Features=h,h.upcomingDynamicFilterCheckDelayMs=20,h.upcomingTimeBucketMinutes=5+Math.floor(11*Math.random())},9748:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpConfigNone=t.ExpConfigFromTAS=t.ExpConfigMaker=void 0;const r=n(2279),o=n(219);class i{}t.ExpConfigMaker=i,t.ExpConfigFromTAS=class extends i{async fetchExperiments(e,t){var n;const i=e.get(r.Fetcher);let s;try{s=await i.fetch("https://default.exp-tas.com/vscode/ab",{method:"GET",headers:t})}catch(t){return o.ExpConfig.createFallbackConfig(e,`Error fetching ExP config: ${t}`)}if(!s.ok)return o.ExpConfig.createFallbackConfig(e,`ExP responded with ${s.status}`);const a=await s.json(),c=null!==(n=a.Configs.find((e=>"vscode"===e.Id)))&&void 0!==n?n:{Id:"vscode",Parameters:{}},l=Object.entries(c.Parameters).map((([e,t])=>e+(t?"":"cf")));return new o.ExpConfig(c.Parameters,a.AssignmentContext,l.join(";"))}},t.ExpConfigNone=class extends i{async fetchExperiments(e,t){return o.ExpConfig.createEmptyConfig()}}},8142:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.FilterSettings=t.telmetryNames=t.TargetPopulation=t.Filter=void 0,function(e){e.Market="X-MSEdge-Market",e.CorpNet="X-FD-Corpnet",e.ApplicationVersion="X-VSCode-AppVersion",e.Build="X-VSCode-Build",e.ClientId="X-MSEdge-ClientId",e.ExtensionName="X-VSCode-ExtensionName",e.ExtensionVersion="X-VSCode-ExtensionVersion",e.Language="X-VSCode-Language",e.TargetPopulation="X-VSCode-TargetPopulation",e.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",e.CopilotOverrideEngine="X-Copilot-OverrideEngine",e.CopilotRepository="X-Copilot-Repository",e.CopilotFileType="X-Copilot-FileType",e.CopilotUserKind="X-Copilot-UserKind",e.CopilotDogfood="X-Copilot-Dogfood"}(n=t.Filter||(t.Filter={})),(r=t.TargetPopulation||(t.TargetPopulation={})).Team="team",r.Internal="internal",r.Insiders="insider",r.Public="public",t.telmetryNames={[n.CopilotClientTimeBucket]:"timeBucket",[n.CopilotOverrideEngine]:"engine",[n.CopilotRepository]:"repo",[n.CopilotFileType]:"fileType",[n.CopilotUserKind]:"userKind"};class o{constructor(e){this.filters=e;for(const[e,t]of Object.entries(this.filters))""===t&&delete this.filters[e]}extends(e){for(const[t,n]of Object.entries(e.filters))if(this.filters[t]!==n)return!1;return!0}addToTelemetry(e){for(const[n,r]of Object.entries(this.filters)){const o=t.telmetryNames[n];void 0!==o&&(e.properties[o]=r)}}stringify(){const e=Object.keys(this.filters);return e.sort(),e.map((e=>`${e}:${this.filters[e]}`)).join(";")}toHeaders(){return{...this.filters}}withChange(e,t){return new o({...this.filters,[e]:t})}}t.FilterSettings=o},9030:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GranularityDirectory=void 0;const r=n(8142),o=n(862),i=r.Filter.CopilotClientTimeBucket;t.GranularityDirectory=class{constructor(e,t){this.specs=new Map,this.prefix=e,this.clock=t,this.defaultGranularity=(0,o.DEFAULT_GRANULARITY)(e)}selectGranularity(e){for(const[t,n]of this.specs.entries())if(e.extends(t))return n;return this.defaultGranularity}update(e,t,n){if(t=t>1?t:NaN,n=n>0?n:NaN,isNaN(t)&&isNaN(n))this.specs.delete(e);else{const r=new o.TimeBucketGranularity(this.prefix);isNaN(t)||r.setByCallBuckets(t),isNaN(n)||r.setTimePeriod(3600*n*1e3),this.specs.set(e,r)}}extendFilters(e){const t=this.selectGranularity(e),[n,r]=t.getCurrentAndUpComingValues(this.clock.now());return{newFilterSettings:e.withChange(i,n),otherFilterSettingsToPrefetch:r.map((t=>e.withChange(i,t)))}}}},862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBucketGranularity=t.DEFAULT_GRANULARITY=t.GranularityImplementation=void 0;class n{constructor(e){this.prefix=e}getCurrentAndUpComingValues(e){return[this.getValue(e),this.getUpcomingValues(e)]}}t.GranularityImplementation=n;class r extends n{getValue(e){return this.prefix}getUpcomingValues(e){return[]}}t.DEFAULT_GRANULARITY=e=>new r(e),t.TimeBucketGranularity=class extends n{constructor(e,t=.5,n=(new Date).setUTCHours(0,0,0,0)){super(e),this.prefix=e,this.fetchBeforeFactor=t,this.anchor=n}setTimePeriod(e){isNaN(e)?this.timePeriodLengthMs=void 0:this.timePeriodLengthMs=e}setByCallBuckets(e){isNaN(e)?this.numByCallBuckets=void 0:this.numByCallBuckets=e}getValue(e){return this.prefix+this.getTimePeriodBucketString(e)+(this.numByCallBuckets?this.timeHash(e):"")}getTimePeriodBucketString(e){return this.timePeriodLengthMs?this.dateToTimePartString(e):""}getUpcomingValues(e){const t=[],n=this.getUpcomingTimePeriodBucketStrings(e),r=this.getUpcomingByCallBucketStrings();for(const e of n)for(const n of r)t.push(this.prefix+e+n);return t}getUpcomingTimePeriodBucketStrings(e){if(void 0===this.timePeriodLengthMs)return[""];if((e.getTime()-this.anchor)%this.timePeriodLengthMs<this.fetchBeforeFactor*this.timePeriodLengthMs)return[this.getTimePeriodBucketString(e)];{const t=new Date(e.getTime()+this.timePeriodLengthMs);return[this.getTimePeriodBucketString(e),this.getTimePeriodBucketString(t)]}}getUpcomingByCallBucketStrings(){return void 0===this.numByCallBuckets?[""]:Array.from(Array(this.numByCallBuckets).keys()).map((e=>e.toString()))}timeHash(e){return null==this.numByCallBuckets?0:e.getTime()%this.numByCallBuckets*7883%this.numByCallBuckets}dateToTimePartString(e){return null==this.timePeriodLengthMs?"":Math.floor((e.getTime()-this.anchor)/this.timePeriodLengthMs).toString()}}},6500:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExpServiceTelemetryNames=void 0,(n=t.ExpServiceTelemetryNames||(t.ExpServiceTelemetryNames={})).featuresTelemetryPropertyName="VSCode.ABExp.Features",n.assignmentContextTelemetryPropertyName="abexp.assignmentcontext"},8965:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contextualFilterScore=t.getLastLineLength=t.ContextualFilterManager=void 0;const r=n(7744);class o{constructor(){this.previousLabel=0,this.previousLabelTimestamp=Date.now()-3600,this.probabilityAccept=0}}function i(e){const t=e.split("\n");return t[t.length-1].length}t.ContextualFilterManager=o,t.getLastLineLength=i,t.contextualFilterScore=function(e,t,n){const s=e.get(o),a=s.previousLabel;let c=0;"afterCursorWhitespace"in t.properties&&"true"===t.properties.afterCursorWhitespace&&(c=1);const l=(Date.now()-s.previousLabelTimestamp)/1e3,u=Math.log(1+l);let d=0,p=0;const h=n.prefix;if(h){d=Math.log(1+i(h));const e=h.slice(-1);void 0!==r.contextualFilterCharacterMap[e]&&(p=r.contextualFilterCharacterMap[e])}let f=0,m=0;const g=h.trimEnd();if(g){f=Math.log(1+i(g));const e=g.slice(-1);void 0!==r.contextualFilterCharacterMap[e]&&(m=r.contextualFilterCharacterMap[e])}let _=0;if("documentLength"in t.measurements){const e=t.measurements.documentLength;_=Math.log(1+e)}let y=0;if("promptEndPos"in t.measurements){const e=t.measurements.promptEndPos;y=Math.log(1+e)}let v=0;if("promptEndPos"in t.measurements&&"documentLength"in t.measurements){const e=t.measurements.documentLength;v=(t.measurements.promptEndPos+.5)/(1+e)}let b=0;void 0!==r.contextualFilterLanguageMap[t.properties.languageId]&&(b=r.contextualFilterLanguageMap[t.properties.languageId]);let w=r.contextualFilterIntercept;w+=r.contextualFilterWeights[0]*a,w+=r.contextualFilterWeights[1]*c,w+=r.contextualFilterWeights[2]*u,w+=r.contextualFilterWeights[3]*d,w+=r.contextualFilterWeights[4]*f,w+=r.contextualFilterWeights[5]*_,w+=r.contextualFilterWeights[6]*y,w+=r.contextualFilterWeights[7]*v,w+=r.contextualFilterWeights[8+b],w+=r.contextualFilterWeights[29+p],w+=r.contextualFilterWeights[125+m];const x=1/(1+Math.exp(-w));return e.get(o).probabilityAccept=x,x}},7744:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contextualFilterCharacterMap=t.contextualFilterLanguageMap=t.contextualFilterWeights=t.contextualFilterIntercept=void 0,t.contextualFilterIntercept=-.3043572714994554,t.contextualFilterWeights=[.9978708359643611,.7001905605239328,-.1736749244124868,-.22994157947320112,.13406692641682572,-.007751370662011853,.0057783222035240715,.41910878254476003,-.1621657125711092,.13770814958908187,-.06036011308184006,-.07351180985800129,0,-.05584878151248109,.30618794079412015,-.1282197982598485,.10951859303997555,.1700461782788777,-.3346057842644757,.22497985923128136,0,-.44038101825774356,-.6540115939236782,.16595600081341702,.20733910722385135,-.1337033766105696,-.06923072125290894,-.05806684191976292,.3583334671633344,-.47357732824944315,.17810871365594377,.42268219963946685,0,0,-.16379620467004602,-.43893868831061167,0,.11570094006709251,.9326431262654882,-.9990110509203912,-.44125275652726503,-.15840786997162004,-.4600396256644451,-.018814811994044403,.09230944537175266,.025814790934742798,-1.0940162204190154,-.9407503631235489,-.9854303778694269,-1.1045822488262245,-1.1417299456573262,-1.5623704405345513,-.4157473855795939,-1.0244257735561713,-.7477401944601753,-1.1275109699068402,-.0714715633552533,-1.1408628006786907,-1.0409898655074672,-.2288889836518878,-.5469549893760344,-.181946611106845,.1264329316374918,0,0,.312206968554707,-.3656436392517924,.23655650686038968,.1014912419901576,0,.06287549221765308,0,0,.19027065218932154,-.8519502045974378,0,.23753599905971923,.2488809322489166,.019969251907983224,0,.06916505526229488,.29053356359188204,-.14484456555431657,.014768129429370188,-.15051464926341374,.07614835502776021,-.3317489901313935,0,0,.04921938684669103,-.28248576768353445,-.9708816204525345,-1.3560464522265527,.014165375212383239,-.23924166472544983,.10006595730248855,.09867233147279562,.32330430333220644,-.058625706114180595,.17149853105783947,.4436484054395367,.047189049576707255,.16832520944790552,.1117259900942179,-.35469010329927253,0,-.1528189124465582,-.3804848349564939,.07278077320753953,.13263786480064088,.22920682659292527,1.1512955314336537,0,.016939862282340023,.4242994650403408,.12759835577444986,-.5577261135825583,-.19764560943067672,-.4042102444736004,.12063461617733708,-.2933966817484834,.2715683893968593,0,-.7138548251238751,0,-.023066228703035277,0,-.06383043976746139,.09683723720709651,-.7337151424080791,0,-.27191370124625525,.2819781269656171,-.08711496549050252,.11048604909969338,-.0934849550450534,.0721001250772912,.2589126797890794,.6729582659532254,-.21921032738244908,-.21535277468651456,-.45474006124091354,-.05861820126419139,-.007875306207720204,-.056661261678809284,.17727881404222662,.23603713348534658,.17485861412377932,-.5737483768696752,-.38220029570342745,-.5202722985519168,-.37187947527657256,.47155277792990113,-.12077912346691123,.47825628981545326,.4736704404000214,-.1615218651546898,.18362447973513005,0,0,-.18183417425866824,0,0,-.2538532305733833,-.1303692690676528,-.4073577969188216,.04172985870928789,-.1704527388573901,0,0,.7536858953385828,-.44703159588787644,0,-.7246484085580873,-.21378128540782063,0,.037461090552656146,-.16205852364367032,-.10973952064404884,.017468043407647377,-.1288980387397392,0,0,0,-1.218692715379445,.05536949662193305,-.3763799844799116,-.1845001725624579,-.1615576298149558,0,-.15373262203249874,-.04603412604270418,0,-.3068149681460828,.09412352468269412,0,.09116543650609721,.06065865264082559,.05688267379386188,-.05873945477722306,0,.14532465133322153,.1870857769705463,.36304258043185555,.1411392422180405,.0630388629716367,0,-1.1170522012450395,.16133697772771127,.15908534390781448,-.23485453704002232,-.1419980841417892,.21909510179526218,.39948420260153766,.40802294284289187,.15403767653746853,0,.19764784115096676,.584914157527457,0,-.4573883817015294],t.contextualFilterLanguageMap={javascript:1,typescript:2,typescriptreact:3,python:4,vue:5,php:6,dart:7,javascriptreact:8,go:9,css:10,cpp:11,html:12,scss:13,markdown:14,csharp:15,java:16,json:17,rust:18,ruby:19,c:20},t.contextualFilterCharacterMap={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95}},2218:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.completionsFromGhostTextResults=void 0;const r=n(2277),o=n(6403),i=n(9334),s=n(3286);t.completionsFromGhostTextResults=function(e,t,n,a,c,l,u){const d=e.get(o.LocationFactory),p=a.lineAt(c);let h=t.map((e=>{let t,o="";if(l&&(e.completion=(0,s.normalizeIndentCharacter)(l,e.completion,p.isEmptyOrWhitespace)),e.completion.displayNeedsWsOffset&&p.isEmptyOrWhitespace)t=d.range(d.position(c.line,0),c),o=e.completion.completionText;else if(p.isEmptyOrWhitespace&&e.completion.completionText.startsWith(p.text))t=d.range(d.position(c.line,0),c),o=e.completion.completionText;else{const n=a.getWordRangeAtPosition(c);if(e.isMiddleOfTheLine){const n=a.lineAt(c),r=d.range(d.position(c.line,0),c),i=a.getText(r);t=e.coversSuffix?n.range:r,o=i+e.completion.displayText}else if(n){const r=a.getText(n);t=d.range(n.start,c),o=r+e.completion.completionText}else{const n=d.range(d.position(c.line,0),c);t=n,o=a.getText(n)+e.completion.displayText}}return{uuid:(0,r.v4)(),text:o,range:t,file:a.uri,index:e.completion.completionIndex,telemetry:e.telemetry,displayText:e.completion.displayText,position:c,offset:a.offsetAt(c),resultType:n}}));if(n===i.ResultType.TypingAsSuggested&&void 0!==u){const e=h.find((e=>e.index===u));if(e){const t=h.filter((e=>e.index!==u));h=[e,...t]}}return h}},5413:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDebounceLimit=t.GhostTextDebounceManager=void 0;const r=n(9189);class o{constructor(e){this.forceDelayMs=e,this.extraDebounceMs=0}}t.GhostTextDebounceManager=o,t.getDebounceLimit=async function(e,t){let n;if(await e.get(r.Features).debouncePredict()&&t.measurements.contextualFilterScore){const e=t.measurements.contextualFilterScore,r=.275,o=6;n=25+250/(1+Math.pow(e/r,o))}else n=await e.get(r.Features).debounceMs();return(n>0?n:75)+e.get(o).extraDebounceMs}},9334:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGhostText=t.completionCache=t.ResultType=t.ghostTextLogger=void 0;const r=n(3055),o=n(2277),i=n(3076),s=n(106),a=n(6932),c=n(1133),l=n(9189),u=n(9899),d=n(2279),p=n(3),h=n(4419),f=n(937),m=n(6722),g=n(7727),_=n(4969),y=n(766),v=n(1006),b=n(1124),w=n(6333),x=n(70),E=n(6403),C=n(8965),S=n(5413),T=n(750);var k;let I,P;async function A(e,n,r,o,i,s,a){var u,p,m;t.ghostTextLogger.debug(e,`Getting ${s} from network`),r=r.extendedBy();const g=await async function(e,t){const n=await e.get(l.Features).overrideNumGhostCompletions();return n?t.isCycling?Math.max(0,3-n):n:(0,c.shouldDoParsingTrimming)(t.blockMode)&&t.multiline?(0,c.getConfig)(e,c.ConfigKey.InlineSuggestCount):t.isCycling?2:1}(e,n),_=(0,f.getTemperatureForSamples)(e,g),y={stream:!0,n:g,temperature:_,extra:{language:n.languageId,next_indent:null!==(u=n.indentation.next)&&void 0!==u?u:0,trim_by_indentation:(0,c.shouldDoServerTrimming)(n.blockMode)}};n.multiline||(y.stop=["\n"]),n.multiline&&n.multiLogitBias&&(y.logit_bias={50256:-100});const v=Date.now(),b={endpoint:"completions",uiKind:h.CopilotUiKind.GhostText,isCycling:JSON.stringify(n.isCycling),temperature:JSON.stringify(_),n:JSON.stringify(g),stop:null!==(p=JSON.stringify(y.stop))&&void 0!==p?p:"unset",logit_bias:JSON.stringify(null!==(m=y.logit_bias)&&void 0!==m?m:null)},E=(0,w.telemetrizePromptLength)(n.prompt);Object.assign(r.properties,b),Object.assign(r.measurements,E);try{const s={prompt:n.prompt,languageId:n.languageId,repoInfo:n.repoInfo,ourRequestId:n.ourRequestId,engineUrl:n.engineURL,count:g,uiKind:h.CopilotUiKind.GhostText,postOptions:y};n.delayMs>0&&await new Promise((e=>setTimeout(e,n.delayMs)));const c=await e.get(h.OpenAIFetcher).fetchAndStreamCompletions(e,s,r,i,o);return"failed"===c.type?{type:"failed",reason:c.reason,telemetryData:(0,T.mkBasicResultTelemetry)(r)}:"canceled"===c.type?(t.ghostTextLogger.debug(e,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:c.reason,telemetryData:(0,T.mkCanceledResultTelemetry)(r)}):a(g,v,c.getProcessingTime(),c.choices)}catch(n){if((0,d.isAbortError)(n))return{type:"canceled",reason:"network request aborted",telemetryData:(0,T.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(t.ghostTextLogger.error(e,`Error on ghost text request ${n}`),(0,x.shouldFailForDebugPurposes)(e))throw n;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,T.mkBasicResultTelemetry)(r)}}}function O(e,t){const n={...e};return n.completionText=e.completionText.trimEnd(),t.forceSingleLine&&(n.completionText=n.completionText.split("\n")[0]),n}t.ghostTextLogger=new u.Logger(u.LogLevel.INFO,"ghostText"),function(e){e[e.Network=0]="Network",e[e.Cache=1]="Cache",e[e.TypingAsSuggested=2]="TypingAsSuggested",e[e.Cycling=3]="Cycling"}(k=t.ResultType||(t.ResultType={})),t.completionCache=new i.LRUCache(100);const N=new s.Debouncer;function R(e,t){I=e,P=t}function M(e,n,r){const o=(0,i.keyForPrompt)(n.prompt),s=t.completionCache.get(o);s&&s.multiline===r.multiline?t.completionCache.put(o,{multiline:s.multiline,choices:s.choices.concat(r.choices)}):t.completionCache.put(o,r),t.ghostTextLogger.debug(e,`Appended cached ghost text for key: ${o}, multiline: ${r.multiline}, number of suggestions: ${r.choices.length}`)}function L(e,n){const r=t.completionCache.get(e);if(r&&(!n||r.multiline))return r.choices}function $(e,t,n){if(n.length>0){if(t.startsWith(n))return{completionIndex:e,completionText:t,displayText:t.substr(n.length),displayNeedsWsOffset:!1};{const r=t.substr(0,t.length-t.trimLeft().length);return n.startsWith(r)?{completionIndex:e,completionText:t,displayText:t.trimLeft(),displayNeedsWsOffset:!0}:{completionIndex:e,completionText:t,displayText:t,displayNeedsWsOffset:!1}}}return{completionIndex:e,completionText:t,displayText:t,displayNeedsWsOffset:!1}}function D(e,n){const r=n.requestId,o={choiceIndex:n.choiceIndex.toString()},i={numTokens:n.numTokens,compCharLen:n.completionText.length,numLines:n.completionText.split("\n").length};n.meanLogProb&&(i.meanLogProb=n.meanLogProb),n.meanAlternativeLogProb&&(i.meanAlternativeLogProb=n.meanAlternativeLogProb);const s=n.telemetryData.extendedBy(o,i);return s.extendWithRequestId(r),s.measurements.confidence=(0,v.ghostTextScoreConfidence)(e,s),s.measurements.quantile=(0,v.ghostTextScoreQuantile)(e,s),t.ghostTextLogger.debug(e,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${s.measurements.confidence} (expected as good or better than about ${s.measurements.quantile} of all suggestions)`),s}function F(e,t,n,r,o){const i=Date.now()-r,s=i-o,a=n.telemetryData.extendedBy({},{completionCharLen:n.completionText.length,requestTimeMs:i,processingTimeMs:o,deltaMs:s,meanLogProb:n.meanLogProb||NaN,meanAlternativeLogProb:n.meanAlternativeLogProb||NaN,numTokens:n.numTokens});a.extendWithRequestId(n.requestId),(0,w.telemetry)(e,`ghostText.${t}`,a)}t.getGhostText=async function(e,n,s,u,d,f){var v,j;const q=await(0,_.extractPrompt)(e,n,s);if("contextTooShort"===q.type)return t.ghostTextLogger.debug(e,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context"};if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled after extractPrompt"};const B=function(e,t){const n=(o=t,0!=e.lineAt(o).text.substr(o.character).trim().length),r=function(e,t){const n=t.lineAt(e).text.substr(e.character).trim();return/^\s*[)}\]"'`]*\s*[:{;,]?\s*$/.test(n)}(t,e);var o;if(!n||r)return n&&r}(n,s);if(void 0===B)return t.ghostTextLogger.debug(e,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line"};const U=e.get(m.StatusReporter),H=e.get(E.LocationFactory),z=await async function(e,t,n,o,i,s){const a=await e.get(c.BlockModeConfig).forLanguage(e,t.languageId);switch(a){case c.BlockMode.Server:return{blockMode:c.BlockMode.Server,requestMultiline:!0,isCyclingRequest:i,finishedCb:async e=>{}};case c.BlockMode.Parsing:case c.BlockMode.ParsingAndServer:default:{const c=await async function(e,t,n,o){if(t.lineCount>=8e3)(0,w.telemetry)(e,"ghostText.longFileMultilineSkip",w.TelemetryData.createAndMarkAsIssued({languageId:t.languageId,lineCount:String(t.lineCount),currentLine:String(n.line)}));else{if(!o&&(0,r.isSupportedLanguageId)(t.languageId))return await(0,g.isEmptyBlockStart)(t,n);if(o&&(0,r.isSupportedLanguageId)(t.languageId))return await(0,g.isEmptyBlockStart)(t,n)||await(0,g.isEmptyBlockStart)(t,t.lineAt(n).range.end)}return!1}(e,t,n,s);return c?{blockMode:a,requestMultiline:!0,isCyclingRequest:!1,finishedCb:async r=>{let i;return i=o.trailingWs.length>0&&!o.prompt.prefix.endsWith(o.trailingWs)?e.get(E.LocationFactory).position(n.line,Math.max(n.character-o.trailingWs.length,0)):n,(0,g.isBlockBodyFinished)(e,t,i,r)}}:{blockMode:a,requestMultiline:!1,isCyclingRequest:i,finishedCb:async e=>{}}}}}(e,n,s,q,u,B);if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after requestMultiline"),{type:"abortedBeforeIssued",reason:"Cancelled after requestMultiline"};const[W]=(0,_.trimLastLine)(n.getText(H.range(H.position(0,0),s)));let V=function(e,n,r,o){const s=function(e,n,r){if(!I||!P||!n.startsWith(I))return;const o=L(P,r);if(!o)return;const i=n.substring(I.length);t.ghostTextLogger.debug(e,`Getting completions for user-typing flow - remaining prefix: ${i}`);const s=[];return o.forEach((e=>{const t=O(e,{forceSingleLine:!1});t.completionText.startsWith(i)&&(t.completionText=t.completionText.substring(i.length),s.push(t))})),s}(e,n,o);if(s&&s.length>0)return[s,k.TypingAsSuggested];const a=function(e,n,r,o){const s=(0,i.keyForPrompt)(r);t.ghostTextLogger.debug(e,`Trying to get completions from cache for key: ${s}`);const a=L(s,o);if(a){t.ghostTextLogger.debug(e,`Got completions from cache for key: ${s}`);const r=[];a.forEach((e=>{const t=O(e,{forceSingleLine:!o});r.push(t)}));const i=r.filter((e=>e.completionText));return i.length>0&&R(n,s),i}}(e,n,r,o);return a&&a.length>0?[a,k.Cache]:void 0}(e,W,q.prompt,z.requestMultiline);const G=o.v4(),K=(0,y.extractRepoInfoInBackground)(e,n.fileName),J=await(0,p.getEngineURL)(e,(0,y.tryGetGitHubNWO)(K),n.languageId,(0,y.getDogFood)(K),(0,y.getUserKind)(e),d),X=await e.get(l.Features).beforeRequestWaitMs((0,y.tryGetGitHubNWO)(K)||"",n.languageId),Q=await e.get(l.Features).multiLogitBias((0,y.tryGetGitHubNWO)(K)||"",n.languageId),Y={blockMode:z.blockMode,languageId:n.languageId,repoInfo:K,engineURL:J,ourRequestId:G,prefix:W,prompt:q.prompt,multiline:z.requestMultiline,indentation:(0,g.contextIndentation)(n,s),isCycling:u,delayMs:X,multiLogitBias:Q},Z=await e.get(l.Features).debouncePredict(),ee=await e.get(l.Features).contextualFilterAcceptThreshold();let te=!1;(Z||"number"==typeof ee)&&(te=!0);const ne=function(e,t,n,r,o,i,s){const a=e.get(E.LocationFactory),c=t.lineAt(r.line),l=t.getText(a.range(c.range.start,r)),u=t.getText(a.range(r,c.range.end)),d={languageId:t.languageId,beforeCursorWhitespace:JSON.stringify(""===l.trim()),afterCursorWhitespace:JSON.stringify(""===u.trim())},p={...(0,w.telemetrizePromptLength)(o.prompt),promptEndPos:t.offsetAt(r),documentLength:t.getText().length,delayMs:n.delayMs},f=i.extendedBy(d,p);f.properties.promptChoices=JSON.stringify(o.promptChoices,((e,t)=>t instanceof Map?Array.from(t.entries()).reduce(((e,[t,n])=>({...e,[t]:n})),{}):t)),f.properties.promptBackground=JSON.stringify(o.promptBackground,((e,t)=>t instanceof Map?Array.from(t.values()):t)),f.measurements.promptComputeTimeMs=o.computeTimeMs,s&&(f.measurements.contextualFilterScore=(0,C.contextualFilterScore)(e,f,o.prompt));const m=n.repoInfo;return f.properties.gitRepoInformation=void 0===m?"unavailable":m===y.ComputationStatus.PENDING?"pending":"available",void 0!==m&&m!==y.ComputationStatus.PENDING&&(f.properties.gitRepoUrl=m.url,f.properties.gitRepoHost=m.hostname,f.properties.gitRepoOwner=m.owner,f.properties.gitRepoName=m.repo,f.properties.gitRepoPath=m.pathname),f.properties.engineName=(0,h.extractEngineName)(e,n.engineURL),f.properties.isMultiline=JSON.stringify(n.multiline),f.properties.blockMode=n.blockMode,f.properties.isCycling=JSON.stringify(n.isCycling),f.properties.headerRequestId=n.ourRequestId,(0,w.telemetry)(e,"ghostText.issued",f),f}(e,n,Y,s,q,d,te);if(z.isCyclingRequest&&(null!==(v=null==V?void 0:V[0].length)&&void 0!==v?v:0)>1||!z.isCyclingRequest&&void 0!==V)t.ghostTextLogger.info(e,"Found inline suggestions locally");else{if(null==U||U.setProgress(),z.isCyclingRequest){const n=await async function(e,n,r,o,i){return A(e,n,r,o,i,"all completions",(async(i,s,a,c)=>{const l=[];for await(const n of c){if(null==o?void 0:o.isCancellationRequested)return t.ghostTextLogger.debug(e,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,T.mkCanceledResultTelemetry)(r)};if(n.completionText.trimEnd()){if(-1!==l.findIndex((e=>e.completionText.trim()===n.completionText.trim())))continue;l.push(n)}}return l.length>0&&(M(e,n,{multiline:n.multiline,choices:l}),F(e,"cyclingPerformance",l[0],s,a)),{type:"success",value:l,telemetryData:(0,T.mkBasicResultTelemetry)(r),telemetryBlob:r}}))}(e,Y,ne,f,z.finishedCb);if("success"===n.type){const e=null!==(j=null==V?void 0:V[0])&&void 0!==j?j:[];n.value.forEach((t=>{-1===e.findIndex((e=>e.completionText.trim()===t.completionText.trim()))&&e.push(t)})),V=[e,k.Cycling]}else if(void 0===V)return null==U||U.removeProgress(),n}else{const n=await(0,S.getDebounceLimit)(e,ne);try{await N.debounce(n)}catch{return{type:"canceled",reason:"by debouncer",telemetryData:(0,T.mkCanceledResultTelemetry)(ne)}}if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled during debounce"),{type:"canceled",reason:"during debounce",telemetryData:(0,T.mkCanceledResultTelemetry)(ne)};if(ee&&ne.measurements.contextualFilterScore&&ne.measurements.contextualFilterScore<ee/100)return t.ghostTextLogger.info(e,"Cancelled by contextual filter"),{type:"canceled",reason:"contextualFilterScore below threshold",telemetryData:(0,T.mkCanceledResultTelemetry)(ne)};const r=await async function(e,n,r,o,s){return A(e,n,r,o,s,"completions",(async(s,a,c,l)=>{const u=l[Symbol.asyncIterator](),d=await u.next();if(d.done)return t.ghostTextLogger.debug(e,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,T.mkBasicResultTelemetry)(r)};if(null==o?void 0:o.isCancellationRequested)return t.ghostTextLogger.debug(e,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,T.mkCanceledResultTelemetry)(r)};const p=d.value;if(void 0===p)return t.ghostTextLogger.debug(e,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,T.mkBasicResultTelemetry)(r)};F(e,"performance",p,a,c);const h=s-1;t.ghostTextLogger.debug(e,`Awaited first result, id: ${p.choiceIndex}`),function(e,n,r){const o=(0,i.keyForPrompt)(n.prompt);R(n.prefix,o),t.completionCache.put(o,r),t.ghostTextLogger.debug(e,`Cached ghost text for key: ${o}, multiline: ${r.multiline}, number of suggestions: ${r.choices.length}`)}(e,n,{multiline:n.multiline,choices:[p]});const f=[];for(let e=0;e<h;e++)f.push(u.next());const m=Promise.all(f).then((r=>{t.ghostTextLogger.debug(e,`Awaited remaining results, number of results: ${r.length}`);const o=[];for(const n of r){const r=n.value;if(void 0!==r&&(t.ghostTextLogger.info(e,`GhostText later completion: [${r.completionText}]`),r.completionText.trimEnd())){if(-1!==o.findIndex((e=>e.completionText.trim()===r.completionText.trim())))continue;if(r.completionText.trim()===p.completionText.trim())continue;o.push(r)}}o.length>0&&M(e,n,{multiline:n.multiline,choices:o})}));return(0,x.isRunningInTest)(e)&&await m,{type:"success",value:O(d.value,{forceSingleLine:!1}),telemetryData:(0,T.mkBasicResultTelemetry)(r),telemetryBlob:r}}))}(e,Y,ne,f,z.finishedCb);if("success"!==r.type)return null==U||U.removeProgress(),r;V=[[r.value],k.Network]}null==U||U.removeProgress()}if(void 0===V)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,T.mkBasicResultTelemetry)(ne)};const[re,oe]=V,ie=(0,a.asyncIterableMapFilter)((0,a.asyncIterableFromArray)(re),(async r=>(0,b.postProcessChoice)(e,"ghostText",n,s,r,B,t.ghostTextLogger))),se=[];for await(const r of ie){const o=B&&(0,b.checkSuffix)(n,s,r);if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after post processing completions"),{type:"canceled",reason:"after post processing completions",telemetryData:(0,T.mkCanceledResultTelemetry)(ne)};const i=D(e,r),a={completion:$(r.choiceIndex,r.completionText,q.trailingWs),telemetry:i,isMiddleOfTheLine:B,coversSuffix:o};se.push(a)}return{type:"success",value:[se,oe],telemetryData:(0,T.mkBasicResultTelemetry)(ne),telemetryBlob:ne}}},3286:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeIndentCharacter=void 0,t.normalizeIndentCharacter=function(e,t,n){function r(e,t,n){const r=new RegExp(`^(${t})+`,"g");return e.split("\n").map((e=>{const t=e.replace(r,""),o=e.length-t.length;return n(o)+t})).join("\n")}let o;if(o=void 0===e.tabSize||"string"==typeof e.tabSize?4:e.tabSize,!1===e.insertSpaces){const e=e=>r(e," ",(e=>"\t".repeat(Math.floor(e/o))+" ".repeat(e%o)));t.displayText=e(t.displayText),t.completionText=e(t.completionText)}else if(!0===e.insertSpaces){const e=e=>r(e,"\t",(e=>" ".repeat(e*o)));if(t.displayText=e(t.displayText),t.completionText=e(t.completionText),n){const e=e=>{const t=e.length-e.trimLeft().length,n=t%o;return 0!==n&&t>0?r(e," ".repeat(n),(e=>" ".repeat((Math.floor(e/o)+1)*o))):e};t.displayText=e(t.displayText),t.completionText=e(t.completionText)}}return t}},750:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGhostTextResultTelemetry=t.mkBasicResultTelemetry=t.mkCanceledResultTelemetry=t.telemetryRejected=t.telemetryAccepted=t.telemetryShown=void 0;const r=n(6333),o=n(8965);t.telemetryShown=function(e,t,n,o){n.markAsDisplayed();const i=o?`${t}.shownFromCache`:`${t}.shown`;(0,r.telemetry)(e,i,n)},t.telemetryAccepted=function(e,t,n){const i=t+".accepted",s=e.get(o.ContextualFilterManager);s.previousLabel=1,s.previousLabelTimestamp=Date.now(),(0,r.telemetry)(e,i,n)},t.telemetryRejected=function(e,t,n){const i=t+".rejected",s=e.get(o.ContextualFilterManager);s.previousLabel=0,s.previousLabelTimestamp=Date.now(),(0,r.telemetry)(e,i,n)},t.mkCanceledResultTelemetry=function(e,t={}){return{...t,telemetryBlob:e}},t.mkBasicResultTelemetry=function(e){return{headerRequestId:e.properties.headerRequestId,copilot_trackingId:e.properties.copilot_trackingId}},t.handleGhostTextResultTelemetry=async function(e,t){if("success"===t.type)return(0,r.telemetryRaw)(e,"ghostText.produced",t.telemetryData,{}),t.value;"abortedBeforeIssued"!==t.type&&("canceled"!==t.type?(0,r.telemetryRaw)(e,`ghostText.${t.type}`,{...t.telemetryData,reason:t.reason},{}):(0,r.telemetry)(e,"ghostText.canceled",t.telemetryData.telemetryBlob.extendedBy({reason:t.reason,cancelledNetworkRequest:t.telemetryData.cancelledNetworkRequest?"true":"false"})))}},9899:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.toPlainText=t.Logger=t.MultiLog=t.OutputChannelLog=t.ConsoleLog=t.LogTarget=t.verboseLogging=t.LogVerbose=t.LogLevel=void 0;const r=n(299),o=n(1133),i=n(6333);var s;!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(s=t.LogLevel||(t.LogLevel={}));class a{constructor(e){this.logVerbose=e}}function c(e){return e.get(a).logVerbose}t.LogVerbose=a,t.verboseLogging=c;class l{shouldLog(e,t){}}t.LogTarget=l,t.ConsoleLog=class extends l{constructor(e){super(),this.console=e}logIt(e,t,n,...r){c(e)||t==s.ERROR?this.console.error(n,...r):t==s.WARN&&this.console.warn(n,...r)}},t.OutputChannelLog=class extends l{constructor(e){super(),this.output=e}logIt(e,t,n,...r){this.output.appendLine(`${n} ${r.map(d)}`)}},t.MultiLog=class extends l{constructor(e){super(),this.targets=e}logIt(e,t,n,...r){this.targets.forEach((o=>o.logIt(e,t,n,...r)))}};class u{constructor(e,t){this.minLoggedLevel=e,this.context=t}setLevel(e){this.minLoggedLevel=e}stringToLevel(e){return s[e]}log(e,t,n,...o){const a=s[t];t==s.ERROR&&(0,i.telemetryError)(e,"log",i.TelemetryData.createAndMarkAsIssued({context:this.context,level:a,message:o.length>0?JSON.stringify(o):"no msg"}),n);const c=e.get(l),u=c.shouldLog(e,t);if(!1===u)return;if(void 0===u&&!this.shouldLog(e,t,this.context))return;const d=e.get(r.Clock).now().toISOString(),p=`[${a}] [${this.context}] [${d}]`;c.logIt(e,t,p,...o)}shouldLog(e,t,n){var r,i;if(c(e))return!0;const s=(0,o.getConfig)(e,o.ConfigKey.DebugFilterLogCategories);if(s.length>0&&!s.includes(n))return!1;if((0,o.isProduction)(e))return t>=this.minLoggedLevel;const a=(0,o.getConfig)(e,o.ConfigKey.DebugOverrideLogLevels);return t>=(null!==(i=null!==(r=this.stringToLevel(a["*"]))&&void 0!==r?r:this.stringToLevel(a[this.context]))&&void 0!==i?i:this.minLoggedLevel)}debug(e,...t){this.log(e,s.DEBUG,!1,...t)}info(e,...t){this.log(e,s.INFO,!1,...t)}warn(e,...t){this.log(e,s.WARN,!1,...t)}error(e,...t){this.log(e,s.ERROR,!1,...t)}secureError(e,t,...n){this.log(e,s.ERROR,!1,t),this.log(e,s.ERROR,!0,t,...n)}}function d(e){return"object"==typeof e?JSON.stringify(e):String(e)}t.Logger=u,t.toPlainText=d,t.logger=new u(s.INFO,"default")},2279:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postRequest=t.Response=t.HelixFetcher=t.isAbortError=t.Fetcher=t.init=void 0;const r=n(9825),o=n(6149),i=n(3837),s=n(1133),a=n(5413),c=n(6333);let l,u=!1;t.init=function(e){if(u){if(e!==l)throw new Error(`Networking re-initialized with mismatched version (old: ${l}, new: ${e})`)}else l=e,u=!0};class d{}t.Fetcher=d,t.isAbortError=function(e){return e instanceof r.AbortError},t.HelixFetcher=class extends d{constructor(e){super(),this.ctx=e,this.createSocketFactory=e=>{const t=o.httpOverHttp({proxy:e});return e=>new Promise((n=>{t.createSocket(e,(e=>{n(e)}))}))},this.fetchApi=this.createFetchApi(e)}set proxySettings(e){this._proxySettings=e,this.fetchApi=this.createFetchApi(this.ctx)}get proxySettings(){return this._proxySettings}createFetchApi(e){var t;const n=e.get(s.BuildInfo);return!1===(null===(t=this._proxySettings)||void 0===t?void 0:t.rejectUnauthorized)&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"),r.context({userAgent:`GithubCopilot/${n.getVersion()}`,socketFactory:this._proxySettings?this.createSocketFactory(this._proxySettings):void 0})}async fetch(e,t){const n={...t,body:t.body?t.body:t.json,signal:t.signal},r=await this.fetchApi.fetch(e,n);return new p(r.status,r.statusText,r.headers,(()=>r.text()),(()=>r.json()),(async()=>r.body))}disconnectAll(){return this.fetchApi.reset()}makeAbortController(){return new r.AbortController}};class p{constructor(e,t,n,r,o,i){this.status=e,this.statusText=t,this.headers=n,this.getText=r,this.getJson=o,this.getBody=i,this.ok=this.status>=200&&this.status<300}async text(){return this.getText()}async json(){return this.getJson()}async body(){return this.getBody()}}t.Response=p,t.postRequest=function(e,t,n,r,o,l,p){if(!u)throw new Error("Networking must be initialized before being used");const h={Authorization:i.format("Bearer %s",n),"X-Request-Id":o,"Openai-Organization":"github-copilot","VScode-SessionId":e.get(s.VscInfo).sessionId,"VScode-MachineId":e.get(s.VscInfo).machineId,...(0,s.editorVersionHeaders)(e)};r&&(h["OpenAI-Intent"]=r);const f=e.get(a.GhostTextDebounceManager).forceDelayMs;f&&(h["X-Copilot-Force-Delay"]=f.toString());const m={method:"POST",headers:h,json:l,timeout:3e4},g=e.get(d);if(p){const t=g.makeAbortController();p.onCancellationRequested((()=>{(0,c.telemetry)(e,"networking.cancelRequest",c.TelemetryData.createAndMarkAsIssued({headerRequestId:o})),t.abort()})),m.signal=t.signal}return g.fetch(t,m).catch((n=>{if("ECONNRESET"==n.code||"ETIMEDOUT"==n.code||"ERR_HTTP2_INVALID_SESSION"==n.code||"ERR_HTTP2_GOAWAY_SESSION"==n.message)return(0,c.telemetry)(e,"networking.disconnectAll"),g.disconnectAll().then((()=>g.fetch(t,m)));throw n}))}},1547:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationSender=void 0,t.NotificationSender=class{}},3:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEngineURL=t.TEST_ENGINE_PATHS=t.OPENAI_PROXY_HOST=void 0;const r=n(1133),o=n(9189),i=n(766),s=n(70);t.OPENAI_PROXY_HOST="https://copilot-proxy.githubusercontent.com";const a="/v1/engines/copilot-codex";t.TEST_ENGINE_PATHS=[a],t.getEngineURL=async function(e,n="",c,l="",u=i.UserKind.UNKNOWN,d){return function(e,n){let o=function(e){return(0,s.isRunningInTest)(e)?(0,r.getConfig)(e,r.ConfigKey.DebugTestOverrideProxyUrl):(0,r.getConfig)(e,r.ConfigKey.DebugOverrideProxyUrl)}(e);return 0==o.length&&(o=t.OPENAI_PROXY_HOST),`${o}${n}`}(e,await async function(e,t,n,i,s,c){const l=(0,r.getConfig)(e,r.ConfigKey.DebugOverrideEngine);if(l)return`/v1/engines/${l}`;const u=await e.get(o.Features).customEngine(t,n,i,s,c);return""!==u?`/v1/engines/${u}`:a}(e,n,c,l,u,d))}},4419:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiveOpenAIFetcher=t.postProcessChoices=t.OpenAIFetcher=t.extractEngineName=t.getProcessingTime=t.getRequestId=t.CopilotUiKind=void 0;const r=n(3837),o=n(362),i=n(6932),s=n(1133),a=n(9189),c=n(5413),l=n(9899),u=n(2279),d=n(6722),p=n(766),h=n(9657),f=n(6333),m=n(937),g=n(2901),_=new l.Logger(l.LogLevel.INFO,"fetch");var y;function v(e,t){return{headerRequestId:e.headers.get("x-request-id")||"",completionId:t&&t.id?t.id:"",created:t&&t.created?t.created:0,serverExperiments:e.headers.get("X-Copilot-Experiment")||"",deploymentId:e.headers.get("azureml-model-deployment")||""}}function b(e){const t=e.headers.get("openai-processing-ms");return t?parseInt(t,10):0}function w(e,t){return t.split("/").pop()||(_.error(e,"Malformed engine URL: "+t),t)}!function(e){e.GhostText="ghostText",e.Panel="synthesize"}(y=t.CopilotUiKind||(t.CopilotUiKind={})),t.getRequestId=v,t.getProcessingTime=b,t.extractEngineName=w;class x{}function E(e,t){return null!=t&&t?e:(0,i.asyncIterableFilter)(e,(async e=>e.completionText.trim().length>0))}t.OpenAIFetcher=x,t.postProcessChoices=E,t.LiveOpenAIFetcher=class extends x{async fetchAndStreamCompletions(e,t,n,r,o){const s=e.get(d.StatusReporter),a="completions",c=await this.fetchWithParameters(e,a,t,o);if("not-sent"===c)return{type:"canceled",reason:"before fetch request"};if(null==o?void 0:o.isCancellationRequested){const t=await c.body();try{t.destroy()}catch(t){l.logger.error(e,`Error destroying stream: ${t}`)}return{type:"canceled",reason:"after fetch request"}}if(void 0===c){const n=this.createTelemetryData(a,e,t);return s.setWarning(),n.properties.error="Response was undefined",(0,f.telemetry)(e,"request.shownWarning",n),{type:"failed",reason:"fetch response was undefined"}}if(200!==c.status){const n=this.createTelemetryData(a,e,t);return this.handleError(e,s,n,c)}return{type:"success",choices:E((0,i.asyncIterableMap)((0,g.processSSE)(e,c,r,n,o),(async t=>(0,g.prepareSolutionForReturn)(e,t,n))),t.allowEmptyChoices),getProcessingTime:()=>b(c)}}createTelemetryData(e,t,n){return f.TelemetryData.createAndMarkAsIssued({endpoint:e,engineName:w(t,n.engineUrl),uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,t,n,i){var g;const _=(0,s.getLanguageConfig)(e,s.ConfigKey.Stops),b=await e.get(a.Features).disableLogProb(),x={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:(0,s.getConfig)(e,s.ConfigKey.SolutionLength),temperature:(0,m.getTemperatureForSamples)(e,n.count),top_p:(0,s.getConfig)(e,s.ConfigKey.TopP),n:n.count,stop:_};!n.requestLogProbs&&b||(x.logprobs=2);const E=(0,p.tryGetGitHubNWO)(n.repoInfo);return void 0!==E&&(x.nwo=E),[h.RepetitionFilterMode.PROXY,h.RepetitionFilterMode.BOTH].includes(await e.get(a.Features).repetitionFilterMode())&&(x.feature_flags=[...null!==(g=x.feature_flags)&&void 0!==g?g:[],"filter-repetitions"]),n.postOptions&&Object.assign(x,n.postOptions),(null==i?void 0:i.isCancellationRequested)?"not-sent":(l.logger.info(e,`[fetchCompletions] engine ${n.engineUrl}`),await function(e,t,n,o,i,s,a,p,h){var m;const g=e.get(d.StatusReporter),_=r.format("%s/%s",n,o);if(0)return void l.logger.error(e,`Failed to send request to ${_} due to missing key`);const b=f.TelemetryData.createAndMarkAsIssued({endpoint:o,engineName:w(e,n),uiKind:p},(0,f.telemetrizePromptLength)(t));for(const[e,t]of Object.entries(s))"prompt"!=e&&"suffix"!=e&&(b.properties[`request.option.${e}`]=null!==(m=JSON.stringify(t))&&void 0!==m?m:"undefined");b.properties.headerRequestId=i,(0,f.telemetry)(e,"request.sent",b);const x=(0,f.now)(),E=function(e){switch(e){case y.GhostText:return"copilot-ghost";case y.Panel:return"copilot-panel"}}(p);return(0,u.postRequest)(e,_,a,E,i,s,h).then((n=>{const r=v(n,void 0);b.extendWithRequestId(r);const o=(0,f.now)()-x;b.measurements.totalTimeMs=o,l.logger.info(e,`request.response: [${_}] took ${o} ms`),l.logger.debug(e,"request.response properties",b.properties),l.logger.debug(e,"request.response measurements",b.measurements),l.logger.debug(e,`prompt: ${JSON.stringify(t)}`),(0,f.telemetry)(e,"request.response",b);const i=n.headers.get("x-copilot-delay"),s=i?parseInt(i,10):0;return e.get(c.GhostTextDebounceManager).extraDebounceMs=s,n})).catch((t=>{var n,r,o,i;if((0,u.isAbortError)(t))throw t;g.setWarning();const s=b.extendedBy({error:"Network exception"});(0,f.telemetry)(e,"request.shownWarning",s),b.properties.code=String(null!==(n=t.code)&&void 0!==n?n:""),b.properties.errno=String(null!==(r=t.errno)&&void 0!==r?r:""),b.properties.message=String(null!==(o=t.message)&&void 0!==o?o:""),b.properties.type=String(null!==(i=t.type)&&void 0!==i?i:"");const a=(0,f.now)()-x;throw b.measurements.totalTimeMs=a,l.logger.debug(e,`request.response: [${_}] took ${a} ms`),l.logger.debug(e,"request.error properties",b.properties),l.logger.debug(e,"request.error measurements",b.measurements),l.logger.error(e,`Request Error: ${t.message}`),(0,f.telemetry)(e,"request.error",b),t})).finally((()=>{(0,f.logEnginePrompt)(e,t,b)}))}(e,n.prompt,n.engineUrl,t,n.ourRequestId,x,"111",n.uiKind,i))}async handleError(e,t,n,r){if(t.setWarning(),n.properties.error=`Response status was ${r.status}`,n.properties.status=String(r.status),(0,f.telemetry)(e,"request.shownWarning",n),401===r.status||403===r.status)return e.get(o.CopilotTokenManager).resetCopilotToken(e,r.status),{type:"failed",reason:`token expired or invalid: ${r.status}`};if(499===r.status)return _.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"};const i=await r.text();return 466===r.status?(t.setError(i),_.info(e,i),{type:"failed",reason:`client not supported: ${i}`}):(_.error(e,"Unhandled status from server:",r.status,i),{type:"failed",reason:`unhandled status from server: ${r.status} ${i}`})}}},937:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTemperatureForSamples=t.calculateMeanAlternativeLogProb=t.calculateMeanLogProb=t.cleanupIndentChoices=t.convertToAPIChoice=t.DEFAULT_CHARACTER_MULTIPLIER=t.MAX_PROMPT_LENGTH=t.OpenAIFetcher=t.LiveOpenAIFetcher=t.getRequestId=t.CopilotUiKind=void 0;const r=n(1133),o=n(9899),i=n(6333),s=n(70);var a=n(4419);function c(e,t){if(t.logprobs.token_logprobs)try{let e=0,n=0,r=50;for(let o=0;o<t.logprobs.token_logprobs.length-1&&r>0;o++,r--)e+=t.logprobs.token_logprobs[o],n+=1;return n>0?e/n:void 0}catch(t){o.logger.error(e,`Error calculating mean prob: ${t}`)}}function l(e,t){if(t.logprobs.top_logprobs)try{let e=0,n=0,r=50;for(let o=0;o<t.logprobs.token_logprobs.length-1&&r>0;o++,r--){const r={...t.logprobs.top_logprobs[o]};delete r[t.logprobs.tokens[o]],e+=Math.max(...Object.values(r)),n+=1}return n>0?e/n:void 0}catch(t){o.logger.error(e,`Error calculating mean prob: ${t}`)}}Object.defineProperty(t,"CopilotUiKind",{enumerable:!0,get:function(){return a.CopilotUiKind}}),Object.defineProperty(t,"getRequestId",{enumerable:!0,get:function(){return a.getRequestId}}),Object.defineProperty(t,"LiveOpenAIFetcher",{enumerable:!0,get:function(){return a.LiveOpenAIFetcher}}),Object.defineProperty(t,"OpenAIFetcher",{enumerable:!0,get:function(){return a.OpenAIFetcher}}),t.MAX_PROMPT_LENGTH=1500,t.DEFAULT_CHARACTER_MULTIPLIER=3,t.convertToAPIChoice=function(e,t,n,r,o,s,a,u){return(0,i.logEngineCompletion)(e,t,n,o,r),{completionText:t,meanLogProb:c(e,n),meanAlternativeLogProb:l(e,n),choiceIndex:r,requestId:o,modelInfo:u,blockFinished:s,tokens:n.logprobs.tokens,numTokens:n.logprobs.tokens.length,telemetryData:a}},t.cleanupIndentChoices=async function*(e,t){for await(const n of e){const e={...n},r=e.completionText.split("\n");for(let e=0;e<r.length;++e){const n=r[e].trimLeft();r[e]=""===n?n:t+n}e.completionText=r.join("\n"),yield e}},t.calculateMeanLogProb=c,t.calculateMeanAlternativeLogProb=l,t.getTemperatureForSamples=function(e,t){if((0,s.isRunningInTest)(e))return 0;const n=parseFloat((0,r.getConfig)(e,r.ConfigKey.Temperature));return n>=0&&n<=1?n:t<=1?0:t<10?.2:t<20?.4:.8}},2901:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prepareSolutionForReturn=t.processSSE=t.splitChunk=void 0;const r=n(9899),o=n(6333),i=n(937),s=new r.Logger(r.LogLevel.INFO,"streamChoices");function a(e){const t=e.split("\n"),n=t.pop();return[t.filter((e=>""!=e)),n]}t.splitChunk=a,t.processSSE=async function*(e,t,n,r,c){var l,u,d,p,h,f,m,g,_;const y=await t.body();y.setEncoding("utf8");let v=(0,i.getRequestId)(t);s.debug(e,`requestId: ${v.headerRequestId}`);const b={};let w="";for await(const x of y){if(null==c?void 0:c.isCancellationRequested)return s.info(e,"Cancelled after awaiting body chunk"),void y.destroy();s.debug(e,"chunk",x.toString());const[E,C]=a(w+x.toString());w=C;for(const a of E){const w=a.slice("data:".length).trim();if("[DONE]"==w){for(const[t,n]of Object.entries(b)){const r=Number(t);if(null!=n&&(yield{solution:n,finishOffset:void 0,reason:"DONE",requestId:v,index:r},null==c?void 0:c.isCancellationRequested))return s.debug(e,"Cancelled after yielding on DONE"),void y.destroy()}return}let x;try{x=JSON.parse(w)}catch(t){s.error(e,"Error parsing JSON stream data",a);continue}if(void 0!==x.choices||void 0===x.error){0==v.created&&(v=(0,i.getRequestId)(t,x),0==v.created&&s.error(e,`Request id invalid, should have "completionId" and "created": ${v}`,v));for(let t=0;t<x.choices.length;t++){const i=x.choices[t];s.debug(e,"choice",i),i.index in b||(b[i.index]={logprobs:[],top_logprobs:[],text:[],text_offset:[],tokens:[]});const a=b[i.index];if(null==a)continue;let w;if(a.text.push(i.text),a.tokens.push(null!==(u=null===(l=i.logprobs)||void 0===l?void 0:l.tokens)&&void 0!==u?u:[]),a.text_offset.push(null!==(p=null===(d=i.logprobs)||void 0===d?void 0:d.text_offset)&&void 0!==p?p:[]),a.logprobs.push(null!==(f=null===(h=i.logprobs)||void 0===h?void 0:h.token_logprobs)&&void 0!==f?f:[]),a.top_logprobs.push(null!==(g=null===(m=i.logprobs)||void 0===m?void 0:m.top_logprobs)&&void 0!==g?g:[]),(i.finish_reason||i.text.indexOf("\n")>-1)&&(w=await n(a.text.join("")),null==c?void 0:c.isCancellationRequested))return s.debug(e,"Cancelled after awaiting finishedCb"),void y.destroy();if(i.finish_reason||void 0!==w){const t=null!==(_=i.finish_reason)&&void 0!==_?_:"client-trimmed";if((0,o.telemetry)(e,"completion.finishReason",r.extendedBy({completionChoiceFinishReason:t})),yield{solution:a,finishOffset:w,reason:JSON.stringify(i.finish_reason),requestId:v,index:i.index},null==c?void 0:c.isCancellationRequested)return s.debug(e,"Cancelled after yielding finished choice"),void y.destroy();b[i.index]=null}}}else s.error(e,"Error in response:",x.error.message)}}for(const[t,n]of Object.entries(b)){const r=Number(t);if(null!=n&&(yield{solution:n,finishOffset:void 0,reason:"Iteration Done",requestId:v,index:r},null==c?void 0:c.isCancellationRequested))return s.debug(e,"Cancelled after yielding after iteration done"),void y.destroy()}if(w.length>0)try{const t=JSON.parse(w);void 0!==t.error&&s.error(e,`Error in response: ${t.error.message}`,t.error)}catch(t){s.error(e,`Error parsing extraData: ${w}`)}},t.prepareSolutionForReturn=function(e,t,n){let r=t.solution.text.join(""),o=!1;void 0!==t.finishOffset&&(s.debug(e,`solution ${t.index}: early finish at offset ${t.finishOffset}`),r=r.substring(0,t.finishOffset),o=!0),s.info(e,`solution ${t.index} returned. finish reason: [${t.reason}] finishOffset: [${t.finishOffset}] completionId: [{${t.requestId.completionId}}] created: [{${t.requestId.created}}]`);const a={text:(c=t.solution).text.join(""),logprobs:{token_logprobs:c.logprobs.reduce(((e,t)=>e.concat(t)),[]),top_logprobs:c.top_logprobs.reduce(((e,t)=>e.concat(t)),[]),text_offset:c.text_offset.reduce(((e,t)=>e.concat(t)),[]),tokens:c.tokens.reduce(((e,t)=>e.concat(t)),[])}};var c;return(0,i.convertToAPIChoice)(e,r,a,t.index,t.requestId,o,n)}},7017:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postInsertionTasks=t.postRejectionTasks=t.captureCode=void 0;const r=n(6881),o=n(750),i=n(9899),s=n(7727),a=n(4969),c=n(5120),l=n(6333),u=n(3136),d=new i.Logger(i.LogLevel.INFO,"post-insertion"),p=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}];async function h(e,t,n){const r=await e.get(u.TextDocumentManager).getTextDocument(t);if(!r)return d.info(e,`Could not get document for ${t.fsPath}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1,promptElementRanges:[]},capturedCode:"",terminationOffset:0};const o=r.getText(),i=o.substring(0,n),c=r.positionAt(n),l=await(0,a.extractPrompt)(e,r,c),p="prompt"===l.type?l.prompt:{prefix:i,suffix:"",isFimEnabled:!1,promptElementRanges:[]},h=o.substring(n),f=(0,s.contextIndentationFromText)(i,n,r.languageId),m=(0,s.indentationBlockFinished)(f,void 0),g=await m(h),_=Math.min(o.length,n+(g?2*g:500));return{prompt:p,capturedCode:o.substring(n,_),terminationOffset:null!=g?g:-1}}function f(e,t,n,r){const o=e.substring(Math.max(0,r-n),Math.min(e.length,r+t.length+n)),i=(0,c.lexEditDistance)(o,t),s=i.lexDistance/i.needleLexLength,{distance:a}=(0,c.editDistance)(o.substring(i.startOffset,i.endOffset),t);return{relativeLexEditDistance:s,charEditDistance:a,completionLexLength:i.needleLexLength,foundOffset:i.startOffset+Math.max(0,r-n),lexEditDistance:i.lexDistance,stillInCodeHeuristic:s<=.5?1:0}}t.captureCode=h,t.postRejectionTasks=function(e,t,n,i,s){s.forEach((({completionText:n,completionTelemetryData:r})=>{d.debug(e,`${t}.rejected choiceIndex: ${r.properties.choiceIndex}`),(0,o.telemetryRejected)(e,t,r)}));const a=new r.ChangeTracker(e,i,n);p.filter((e=>e.captureRejection)).map((r=>{a.push((async()=>{d.debug(e,`Original offset: ${n}, Tracked offset: ${a.offset}`);const{completionTelemetryData:o}=s[0],{prompt:c,capturedCode:u,terminationOffset:p}=await h(e,i,a.offset);let f;f=c.isFimEnabled?{hypotheticalPromptPrefixJson:JSON.stringify(c.prefix),hypotheticalPromptSuffixJson:JSON.stringify(c.suffix)}:{hypotheticalPromptJson:JSON.stringify(c.prefix)};const m=o.extendedBy({...f,capturedCodeJson:JSON.stringify(u)},{timeout:r.seconds,insertionOffset:n,trackedOffset:a.offset,terminationOffsetInCapturedCode:p});d.debug(e,`${t}.capturedAfterRejected choiceIndex: ${o.properties.choiceIndex}`,m),(0,l.telemetry)(e,t+".capturedAfterRejected",m,!0)}),1e3*r.seconds)}))},t.postInsertionTasks=async function(e,t,n,i,s,a){d.debug(e,`${t}.accepted choiceIndex: ${a.properties.choiceIndex}`),(0,o.telemetryAccepted)(e,t,a);const c=new r.ChangeTracker(e,s,i),m=n.trim();p.map((n=>c.push((()=>async function(e,t,n,r,o,i,s,a){const c=await e.get(u.TextDocumentManager).getTextDocument(o);if(c){const u=c.getText();let p=f(u,n,50,a.offset);p.stillInCodeHeuristic||(p=f(u,n,1500,a.offset)),d.debug(e,`stillInCode: ${p.stillInCodeHeuristic?"Found":"Not found"}! Completion '${n}' in file ${o.fsPath}. lexEditDistance fraction was ${p.relativeLexEditDistance}. Char edit distance was ${p.charEditDistance}. Inserted at ${r}, tracked at ${a.offset}, found at ${p.foundOffset}. choiceIndex: ${s.properties.choiceIndex}`);const m=s.extendedBy({},{timeout:i.seconds,insertionOffset:r,trackedOffset:a.offset}).extendedBy({},p);if((0,l.telemetry)(e,t+".stillInCode",m),i.captureCode){const{prompt:n,capturedCode:c,terminationOffset:u}=await h(e,o,a.offset);let p;p=n.isFimEnabled?{hypotheticalPromptPrefixJson:JSON.stringify(n.prefix),hypotheticalPromptSuffixJson:JSON.stringify(n.suffix)}:{hypotheticalPromptJson:JSON.stringify(n.prefix)};const f=s.extendedBy({...p,capturedCodeJson:JSON.stringify(c)},{timeout:i.seconds,insertionOffset:r,trackedOffset:a.offset,terminationOffsetInCapturedCode:u});d.debug(e,`${t}.capturedAfterAccepted choiceIndex: ${s.properties.choiceIndex}`,m),(0,l.telemetry)(e,t+".capturedAfterAccepted",f,!0)}}}(e,t,m,i,s,n,a,c)),1e3*n.seconds)))}},6722:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoOpStatusReporter=t.StatusReporter=void 0;class n{}t.StatusReporter=n,t.NoOpStatusReporter=class extends n{setProgress(){}removeProgress(){}setWarning(){}setError(e){}forceNormal(){}}},7727:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indentationBlockFinished=t.completionCutOrContinue=t.contextIndentationFromText=t.contextIndentation=t.getNodeStart=t.isBlockBodyFinishedWithPrefix=t.isBlockBodyFinished=t.isEmptyBlockStart=void 0;const r=n(6403),o=n(2533);t.isEmptyBlockStart=function(e,t){return o.isEmptyBlockStart(e.languageId,e.getText(),e.offsetAt(t))},t.isBlockBodyFinished=function(e,t,n,i){const s=e.get(r.LocationFactory),a=t.getText(s.range(s.position(0,0),n)),c=t.offsetAt(n);return o.isBlockBodyFinished(t.languageId,a,i,c)},t.isBlockBodyFinishedWithPrefix=function(e,t,n,i,s){const a=e.get(r.LocationFactory),c=t.getText(a.range(a.position(0,0),n)),l=t.offsetAt(n);return o.isBlockBodyFinished(t.languageId,c+s,i,l+s.length)},t.getNodeStart=async function(e,t,n,i){const s=e.get(r.LocationFactory),a=t.getText(s.range(s.position(0,0),n))+i,c=await o.getNodeStart(t.languageId,a,t.offsetAt(n));if(c)return t.positionAt(c)};const i=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map((e=>e+"\\b"))),s=new RegExp(`^(${i.join("|")})`);function a(e){return s.test(e.trimLeft().toLowerCase())}function c(e){const t=/^(\s*)([^]*)$/.exec(e);return t&&t[2]&&t[2].length>0?t[1].length:void 0}function l(e,t,n){const r=e.slice(0,t).split("\n"),o=e.slice(t).split("\n");function i(e,t,r){let o,i,s=t;for(;void 0===o&&s>=0&&s<e.length;)o=c(e[s]),i=s,s+=r;if("python"===n&&-1===r){s++;const t=e[s].trim();if(t.endsWith('"""')){if(!t.startsWith('"""')||'"""'===t)for(s--;s>=0&&!e[s].trim().startsWith('"""');)s--;if(s>=0)for(o=void 0,s--;void 0===o&&s>=0;)o=c(e[s]),i=s,s--}}return[o,i]}const[s,a]=i(r,r.length-1,-1),l=(()=>{if(void 0!==s&&void 0!==a)for(let e=a-1;e>=0;e--){const t=c(r[e]);if(void 0!==t&&t<s)return t}})(),[u]=i(o,1,1);return{prev:l,current:null!=s?s:0,next:u}}function u(e,t,n){var r;const o=e.split("\n"),i=void 0!==n,s=null==n?void 0:n.split("\n").pop();let l=0;if(i&&""!=(null==s?void 0:s.trim())&&""!==o[0].trim()&&l++,i||l++,o.length===l)return"continue";const u=Math.max(t.current,null!==(r=t.next)&&void 0!==r?r:0);for(let e=l;e<o.length;e++){let t=o[e];0==e&&void 0!==s&&(t=s+t);const n=c(t);if(void 0!==n&&(n<u||n===u&&!a(t)))return o.slice(0,e).join("\n").length}return"continue"}t.contextIndentation=function(e,t){return l(e.getText(),e.offsetAt(t),e.languageId)},t.contextIndentationFromText=l,t.completionCutOrContinue=u,t.indentationBlockFinished=function(e,t){return async n=>{const r=u(n,e,t);return"continue"===r?void 0:r}}},4969:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractPrompt=t.trimLastLine=t._contextTooShort=t.MIN_PROMPT_CHARS=void 0;const r=n(3055),o=n(1133),i=n(1839),s=n(9189),a=n(3136),c=n(2533),l=n(766);function u(e){const t=e.split("\n"),n=t[t.length-1],r=n.length-n.trimRight().length,o=e.slice(0,e.length-r),i=e.substr(o.length);return[n.length==r?o:e,i]}async function d(e,n,d,p,h,f){var m;const g=null!==(m=(0,l.tryGetGitHubNWO)((0,l.extractRepoInfoInBackground)(e,h.toString())))&&void 0!==m?m:"",_=await(0,o.suffixPercent)(e,g,f);if((_>0?n.length:d)<t.MIN_PROMPT_CHARS)return t._contextTooShort;const y=Date.now(),{prefix:v,suffix:b,promptChoices:w,promptBackground:x,promptElementRanges:E}=await async function(e,t,n,u,d,p){var h;let f=[];f=await async function(e,t,n){const r=[],o=(0,i.sortByAccessTimes)(e.get(a.TextDocumentManager).textDocuments);let s=0;for(const i of o){if(r.length+1>20||s+i.getText().length>2e5)break;"file"==i.uri.scheme&&i.fileName!==t&&i.languageId===n&&(r.push({uri:i.uri.toString(),relativePath:await e.get(a.TextDocumentManager).getRelativePath(i),languageId:i.languageId,source:i.getText()}),s+=i.getText().length)}return r}(e,d.fsPath,p);const m={uri:d.toString(),source:t,offset:n,relativePath:u,languageId:p},g=null!==(h=(0,l.tryGetGitHubNWO)((0,l.extractRepoInfoInBackground)(e,d.toString())))&&void 0!==h?h:"";let _={maxPromptLength:2048-(0,o.getConfig)(e,o.ConfigKey.SolutionLength),neighboringTabs:await e.get(s.Features).neighboringTabsOption(g,p),suffixStartMode:await e.get(s.Features).suffixStartMode(g,p)};const y=await(0,o.suffixPercent)(e,g,p),v=await(0,o.suffixMatchThreshold)(e,g,p);y>0&&(_={..._,includeSiblingFunctions:r.SiblingOption.NoSiblings,suffixPercent:y,suffixMatchThreshold:v});const b=e.get(r.FileSystem);return await(0,c.getPrompt)(b,m,_,f)}(e,n,d,p,h,f),[C,S]=u(v),T=Date.now();return{type:"prompt",prompt:{prefix:C,suffix:b,isFimEnabled:_>0,promptElementRanges:E.ranges},trailingWs:S,promptChoices:w,computeTimeMs:T-y,promptBackground:x}}async function p(e,t,n){const r=await e.get(a.TextDocumentManager).getRelativePath(t);return d(e,t.getText(),t.offsetAt(n),r,t.uri,t.languageId)}t.MIN_PROMPT_CHARS=10,t._contextTooShort={type:"contextTooShort"},t.trimLastLine=u,t.extractPrompt=function(e,t,n){const r=e.get(a.TextDocumentManager).findNotebook(t);return void 0===r?p(e,t,n):async function(e,t,n,r){const o=n.getCells().find((e=>e.document.uri===t.uri));if(o){const i=n.getCells().filter((e=>e.index<o.index&&e.document.languageId===o.document.languageId)),s=i.length>0?i.map((e=>e.document.getText())).join("\n\n")+"\n\n":"",c=s+t.getText(),l=s.length+t.offsetAt(r),u=await e.get(a.TextDocumentManager).getRelativePath(t);return d(e,c,l,u,t.uri,o.document.languageId)}return p(e,t,r)}(e,t,r,n)}},2533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsesWithoutError=t.getPrompt=t.getNodeStart=t.getFunctionPositions=t.getBlockCloseToken=t.isSupportedLanguageId=t.isBlockBodyFinished=t.isEmptyBlockStart=t.terminate=t.init=void 0;const r=n(3055);let o=null;const i=new Map;let s=0;t.init=function(t,u,d){if(!u){const t=n(4723);for(const n of[...a,...c])e.exports[n]=t[n];return}for(const n of a)e.exports[n]=l(t,d,n);e.exports.getPrompt=function(e,t){return function(n,...r){const a=s++;return new Promise(((n,s)=>{i.set(a,{resolve:n,reject:s}),t.debug(e,`Proxy getPrompt - ${a}`),null==o||o.postMessage({id:a,fn:"getPrompt",args:r})}))}}(t,d),o=r.createWorker(),i.clear(),s=0;const p=t.get(r.FileSystem);function h(e){d.error(t,e);for(const t of i.values())t.reject(e);i.clear()}o.on("message",(({id:e,err:n,res:r})=>{const o=i.get(e);d.debug(t,`Response ${e} - ${r}, ${n}`),o&&(i.delete(e),n?o.reject(n):o.resolve(r))})),o.on("error",h),o.on("exit",(e=>{0!==e&&h(new Error(`Worker thread exited with code ${e}.`))})),o.on("readFileReq",(e=>{d.debug(t,`READ_FILE_REQ - ${e}`),p.readFile(e).then((e=>{null==o||o.emit("readFileRes",e)})).catch(h)})),o.on("mtimeRes",(e=>{d.debug(t,`mTime_REQ - ${e}`),p.mtime(e).then((e=>{null==o||o.emit("mtimeRes",e)})).catch(h)}))},t.terminate=function(){o&&(o.removeAllListeners(),o.terminate(),o=null,i.clear())};const a=["getFunctionPositions","isEmptyBlockStart","isBlockBodyFinished","getNodeStart","parsesWithoutError"],c=["isSupportedLanguageId","getBlockCloseToken"];function l(e,t,n){return function(...r){const a=s++;return new Promise(((s,c)=>{i.set(a,{resolve:s,reject:c}),t.debug(e,`Proxy ${n}`),null==o||o.postMessage({id:a,fn:n,args:r})}))}}t.isEmptyBlockStart=r.isEmptyBlockStart,t.isBlockBodyFinished=r.isBlockBodyFinished,t.isSupportedLanguageId=r.isSupportedLanguageId,t.getBlockCloseToken=r.getBlockCloseToken,t.getFunctionPositions=r.getFunctionPositions,t.getNodeStart=r.getNodeStart,t.getPrompt=r.getPrompt,t.parsesWithoutError=r.parsesWithoutError},766:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComputationStatus=t.getRepoUrlFromConfigText=t.parseRepoUrl=t.extractRepoInfoInBackground=t.tryGetGitHubNWO=t.getDogFood=t.Dogfood=t.getUserKind=t.UserKind=t.isNotRepo=t.isRepoInfo=void 0;const r=n(3055),o=n(3458),i=n(1017),s=n(3076),a=n(6333);var c,l;function u(e){if(void 0!==e&&e!==f.PENDING)return"github.com"===e.hostname?e.owner+"/"+e.repo:void 0}t.isRepoInfo=function(e){return void 0!==e&&e!==f.PENDING},t.isNotRepo=function(e){return void 0===e},function(e){e.GITHUB="github",e.MICROSOFT="microsoft",e.UNKNOWN="unknown"}(c=t.UserKind||(t.UserKind={})),t.getUserKind=function(e){var t,n;return void 0===e.get(a.TelemetryReporters).token?c.UNKNOWN:(null===(n=null===(t=e.get(a.TelemetryReporters).token)||void 0===t?void 0:t.organization_list)||void 0===n?void 0:n.includes("a5db0bcaae94032fe715fb34a5e4bce2"))?c.MICROSOFT:c.UNKNOWN},function(e){e.GITHUB="github",e.MICROSOFT="microsoft",e.UNKNOWN=""}(l=t.Dogfood||(t.Dogfood={})),t.getDogFood=function(e){return void 0===e||e===f.PENDING?l.UNKNOWN:"github/github"===u(e)?l.GITHUB:"ssh.dev.azure.com"===e.hostname||"vs-ssh.visualstudio.com"===e.hostname||"dev.azure.com"===e.hostname||"domoreexp.visualstudio.com"===e.hostname||"office.visualstudio.com"===e.hostname?l.MICROSOFT:l.UNKNOWN},t.tryGetGitHubNWO=u,t.extractRepoInfoInBackground=function(e,t){if(!t)return;const n=(0,i.dirname)(t);return d(e,n)};const d=function(e,t){const n=new s.LRUCache(1e4),o=new Set;return(e,...t)=>{const s=JSON.stringify(t),a=n.get(s);if(a)return a.result;if(o.has(s))return f.PENDING;const c=async function(e,t){var n;const o=await async function(e,t){let n=t+"_add_to_make_longer";const o=e.get(r.FileSystem);for(;t.length>1&&t.length<n.length;){const e=(0,i.join)(t,".git","config");if(await o.stat(e).then((()=>!0),(()=>!1)))return t;n=t,t=(0,i.dirname)(t)}}(e,t);if(!o)return;const s=e.get(r.FileSystem),a=(0,i.join)(o,".git","config"),c=(await s.readFile(a)).toString(),l=null!==(n=h(c))&&void 0!==n?n:"",u=p(l);return void 0===u?{baseFolder:o,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:o,url:l,...u}}(e,...t);return o.add(s),c.then((e=>{n.put(s,new m(e)),o.delete(s)})),f.PENDING}}();function p(e){let t={};try{if(t=o(e),""==t.host||""==t.owner||""==t.name||""==t.pathname)return}catch(e){return}return{hostname:t.host,owner:t.owner,repo:t.name,pathname:t.pathname}}function h(e){var t;const n=/^\s*\[\s*remote\s+"((\\\\|\\"|[^\\"])+)"/,r=/^\s*\[remote.([^"\s]+)/,o=/^\s*url\s*=\s*([^\s#;]+)/,i=/^\s*\[/;let s,a,c=!1;for(const l of e.split("\n"))if(c&&void 0!==s){if(s+=l,l.endsWith("\\"))s=s.substring(0,s.length-1);else if(c=!1,"origin"===a)return s}else{const e=null!==(t=l.match(n))&&void 0!==t?t:l.match(r);if(e)a=e[1];else if(l.match(i))a=void 0;else{if(s&&"origin"!==a)continue;{const e=l.match(o);if(e)if(s=e[1],s.endsWith("\\"))s=s.substring(0,s.length-1),c=!0;else if("origin"===a)return s}}}return s}var f;t.parseRepoUrl=p,t.getRepoUrlFromConfigText=h,function(e){e[e.PENDING=0]="PENDING"}(f=t.ComputationStatus||(t.ComputationStatus={}));class m{constructor(e){this.result=e}}},9657:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRepetitive=t.RepetitionFilterMode=void 0;const n=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];var r;function o(e){const t=function(e){const t=Array(e.length).fill(0);t[0]=-1;let n=-1;for(let r=1;r<e.length;r++){for(;n>=0&&e[n+1]!==e[r];)n=t[n];e[n+1]===e[r]&&n++,t[r]=n}return t}(e);for(const r of n)if(!(e.length<r.last_tokens_to_consider)&&r.last_tokens_to_consider-1-t[r.last_tokens_to_consider-1]<=r.max_token_sequence_length)return!0;return!1}!function(e){e.CLIENT="client",e.PROXY="proxy",e.BOTH="both"}(r=t.RepetitionFilterMode||(t.RepetitionFilterMode={})),t.isRepetitive=function(e,t=r.CLIENT){return t!==r.PROXY&&(o(e.reverse())||o(e.reverse().filter((e=>e.trim().length>0))))}},5120:(e,t)=>{"use strict";function n(e,t,n=((e,t)=>e===t?0:1)){if(0===t.length||0===e.length)return{distance:t.length,startOffset:0,endOffset:0};let r=new Array(t.length+1).fill(0),o=new Array(t.length+1).fill(0),i=new Array(e.length+1).fill(0),s=new Array(e.length+1).fill(0),a=t[0];for(let t=0;t<e.length+1;t++)r[t]=0===t?1:n(e[t-1],a,t-1,0),o[t]=t>0?t-1:0;for(let c=1;c<t.length;c++){let l=i;i=r,r=l,l=s,s=o,o=l,a=t[c],r[0]=c+1;for(let t=1;t<e.length+1;t++){const l=1+i[t],u=1+r[t-1],d=n(e[t-1],a,t-1,c)+i[t-1];r[t]=Math.min(u,l,d),r[t]===d?o[t]=s[t-1]:r[t]===l?o[t]=s[t]:o[t]=o[t-1]}}let c=0;for(let t=0;t<e.length+1;t++)r[t]<r[c]&&(c=t);return{distance:r[c],startOffset:o[c],endOffset:c}}function r(){return new Map}function o(e){const t=new Array(e.size);for(const[n,r]of e)t[r]=n;return t}function*i(e){let t,n="";!function(e){e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other"}(t||(t={}));let r=t.Word;for(const o of e){let e;e=/(\p{L}|\p{Nd}|_)/u.test(o)?t.Word:" "===o?t.Space:t.Other,e===r&&e!==t.Other?n+=o:(n.length>0&&(yield n),n=o,r=e)}n.length>0&&(yield n)}function s(e,t,n,r){const o=[];let i=0;for(const s of n(e))r(s)&&(t.has(s)||t.set(s,t.size),o.push([t.get(s),i])),i+=s.length;return[o,t]}function a(e){return" "!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.lexEditDistance=t.lexicalAnalyzer=t.lexGeneratorWords=t.reverseLexDictionary=t.emptyLexDictionary=t.editDistance=void 0,t.editDistance=n,t.emptyLexDictionary=r,t.reverseLexDictionary=o,t.lexGeneratorWords=i,t.lexicalAnalyzer=s,t.lexEditDistance=function(e,t,c=i){const[l,u]=s(e,r(),c,a),[d,p]=s(t,u,c,a);if(0===d.length||0===l.length)return{lexDistance:d.length,startOffset:0,endOffset:0,haystackLexLength:l.length,needleLexLength:d.length};const h=o(p),f=d.length,m=h[d[0][0]],g=h[d[f-1][0]],_=n(l.map((e=>e[0])),d.map((e=>e[0])),(function(e,t,n,r){if(0===r||r===f-1){const e=h[l[n][0]];return 0==r&&e.endsWith(m)||r==f-1&&e.startsWith(g)?0:1}return e===t?0:1})),y=l[_.startOffset][1];let v=_.endOffset<l.length?l[_.endOffset][1]:e.length;return v>0&&" "===e[v-1]&&--v,{lexDistance:_.distance,startOffset:y,endOffset:v,haystackLexLength:l.length,needleLexLength:d.length}}},7481:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ghostTextDisplayQuantiles=t.ghostTextDisplayLanguageParameters=t.ghostTextDisplayMeanAlternativeLogProbParameter=t.ghostTextDisplayMeanLogProbParameter=t.ghostTextDisplayLog1pcompCharLenParameter=t.ghostTextDisplayInterceptParameter=void 0,t.ghostTextDisplayInterceptParameter=2.98410452738298,t.ghostTextDisplayLog1pcompCharLenParameter=-.838732736843507,t.ghostTextDisplayMeanLogProbParameter=1.50314646255716,t.ghostTextDisplayMeanAlternativeLogProbParameter=-.237798634012662,t.ghostTextDisplayLanguageParameters={python:.314368072478742},t.ghostTextDisplayQuantiles={.01:.225800751784931,.02:.290204307767402,.03:.333153496466045,.05:.404516749849559,.1:.513216040545626,.2:.626904979128674,.3:.694880719658273,.4:.743100684947291,.5:.782524520571946,.6:.816856186092243,.7:.84922977716585,.8:.883694877241999,.9:.921859050950077,.95:.944571268106974,.99:.969535563141733}},1006:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ghostTextScoreQuantile=t.ghostTextScoreConfidence=void 0;const r=n(9899),o=n(7481),i=(new r.Logger(r.LogLevel.INFO,"restraint"),{link:e=>Math.exp(e)/(1+Math.exp(e)),unlink:e=>Math.log(e/(1-e))});class s{constructor(e,t,n){this.name=e,this.coefficient=t,this.transformation=n||(e=>e)}contribution(e){return this.coefficient*this.transformation(e)}}const a=new class{constructor(e,t,n){if(this.link=i,this.intercept=e,this.coefficients=t,this.logitsToQuantiles=new Map,this.logitsToQuantiles.set(0,0),this.logitsToQuantiles.set(1,1),n)for(const e in n)this.logitsToQuantiles.set(n[e],Number(e))}predict(e,t){let n=this.intercept;for(const e of this.coefficients){const r=t[e.name];if(void 0===r)return NaN;n+=e.contribution(r)}return this.link.link(n)}quantile(e,t){return function(e,t){const n=Math.min(...Array.from(t.keys()).filter((t=>t>=e))),r=Math.max(...Array.from(t.keys()).filter((t=>t<e))),o=t.get(n),i=t.get(r);return i+(o-i)*(e-r)/(n-r)}(this.predict(e,t),this.logitsToQuantiles)}}(o.ghostTextDisplayInterceptParameter,[new s("compCharLen",o.ghostTextDisplayLog1pcompCharLenParameter,(e=>Math.log(1+e))),new s("meanLogProb",o.ghostTextDisplayMeanLogProbParameter),new s("meanAlternativeLogProb",o.ghostTextDisplayMeanAlternativeLogProbParameter)].concat(Object.entries(o.ghostTextDisplayLanguageParameters).map((e=>new s(e[0],e[1])))),o.ghostTextDisplayQuantiles);t.ghostTextScoreConfidence=function(e,t){const n={...t.measurements};return Object.keys(o.ghostTextDisplayLanguageParameters).forEach((e=>{n[e]=t.properties["customDimensions.languageId"]==e?1:0})),a.predict(e,n)},t.ghostTextScoreQuantile=function(e,t){const n={...t.measurements};return Object.keys(o.ghostTextDisplayLanguageParameters).forEach((e=>{n[e]=t.properties["customDimensions.languageId"]==e?1:0})),a.quantile(e,n)}},1124:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkSuffix=t.postProcessChoice=void 0;const r=n(9189),o=n(2533),i=n(6333),s=n(70),a=n(9657);t.postProcessChoice=async function(e,t,n,c,l,u,d){if((0,a.isRepetitive)(l.tokens,await e.get(r.Features).repetitionFilterMode())){const t=i.TelemetryData.createAndMarkAsIssued();return t.extendWithRequestId(l.requestId),(0,i.telemetry)(e,"repetition.detected",t,!0),void d.info(e,"Filtered out repetitive solution")}const p={...l};if(function(e,t,n){let r="",o=t.line+1;for(;""===r&&o<e.lineCount;){if(r=e.lineAt(o).text.trim(),r===n.trim())return!0;o++}return!1}(n,c,p.completionText)){const t=i.TelemetryData.createAndMarkAsIssued();return t.extendWithRequestId(l.requestId),(0,i.telemetry)(e,"completion.alreadyInDocument",t),(0,i.telemetry)(e,"completion.alreadyInDocument",t.extendedBy({completionTextJson:JSON.stringify(p.completionText)}),!0),void d.info(e,"Filtered out solution matching next line")}return p.completionText=await async function(e,t,n,r,i){var a;if(""===r)return r;let c="}";try{c=null!==(a=(0,o.getBlockCloseToken)(t.languageId))&&void 0!==a?a:"}"}catch(e){}let l=r.length;do{const o=r.lastIndexOf("\n",l-2)+1,a=r.substring(o,l);if(a.trim()===c){for(let e=n.line;e<t.lineCount;e++){let s=t.lineAt(e).text;if(e===n.line&&(s=s.substr(n.character)),s.startsWith(a.trimRight()))return r.substring(0,Math.max(0,i?o:o-1));if(""!==s.trim())break}break}if(l===o){if((0,s.shouldFailForDebugPurposes)(e))throw Error(`Aborting: maybeSnipCompletion would have looped on completion: ${r}`);break}l=o}while(l>1);return r}(e,n,c,p.completionText,u),p.completionText?p:void 0},t.checkSuffix=function(e,t,n){const r=e.lineAt(t.line).text.substring(t.character);if(r.length>0){if(-1!==n.completionText.indexOf(r))return!0;{let e=0;for(const t of r){const r=n.completionText.indexOf(t,e+1);if(!(r>e)){e=-1;break}e=r}return-1!==e}}return!1}},6333:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forceSendingTelemetry=t.dropTelemetryConfig=t.setTelemetryConfig=t.logEnginePrompt=t.logEngineCompletion=t.telemetryError=t.telemetryException=t.telemetryRaw=t.telemetryExpProblem=t.telemetry=t.configureReporter=t.telemetryEndpointUrlOverride=t.noTelemetryEndpointUrlOverride=t.TelemetryEndpointUrlOverride=t.now=t.telemetrizePromptLength=t.TelemetryData=t.setupEmptyReporters=t.setupStandardReporters=t.TelemetryReporters=t.APP_INSIGHTS_KEY_SECURE=t.APP_INSIGHTS_KEY=void 0;const r=n(1581),o=n(4398),i=n(1133),s=n(9189),a=n(6500),c=n(70),l=n(2499);t.APP_INSIGHTS_KEY="7d7048df-6dd0-4048-bb23-b716c1461f8f",t.APP_INSIGHTS_KEY_SECURE="3fdd7f28-937a-48c8-9a21-ba337db23bd1";class u{constructor(e,t){this.reporter=e,this.reporterSecure=t}getReporter(e){return this.reporter}getSecureReporter(e){if(y())return this.reporterSecure;if((0,c.shouldFailForDebugPurposes)(e))throw new Error("Internal error: telemetry opt-out")}setReporter(e){this.reporter=e}setSecureReporter(e){this.reporterSecure=e}async deactivate(){let e=Promise.resolve();this.reporter&&(e=this.reporter.dispose(),this.reporter=void 0);let t=Promise.resolve();this.reporterSecure&&(t=this.reporterSecure.dispose(),this.reporterSecure=void 0),await Promise.all([e,t])}hackOptOutListener(){this.reporter.optOutListener={dispose(){}},this.reporterSecure.optOutListener={dispose(){}}}setToken(e){this.reporter&&this.configureToken(this.reporter,e),this.reporterSecure&&this.configureToken(this.reporterSecure,e)}configureToken(e,t){const n=e;n&&n.appInsightsClient&&(n.appInsightsClient.context.tags.github_telemetry_token=t.token)}}let d;function p(e,t,n,r){const i=new o.default(t,n,r);return _(e,i),i}t.TelemetryReporters=u,t.setupStandardReporters=function(e,n){const r=(0,i.getVersion)(e),o=p(e,n,r,t.APP_INSIGHTS_KEY),s=p(e,n,r,t.APP_INSIGHTS_KEY_SECURE),a=e.get(u);return a.setReporter(o),a.setSecureReporter(s),a},t.setupEmptyReporters=function(){return new u};class h{constructor(e,t,n){this.properties=e,this.measurements=t,this.issuedTime=n}static createAndMarkAsIssued(e,t){return new h(e||{},t||{},m())}extendedBy(e,t){const n={...this.properties,...e},r={...this.measurements,...t},o=new h(n,r,this.issuedTime);return o.displayedTime=this.displayedTime,o.filtersAndExp=this.filtersAndExp,o}markAsDisplayed(){void 0===this.displayedTime&&(this.displayedTime=m())}async extendWithExpTelemetry(e){this.filtersAndExp||await e.get(s.Features).addExpAndFilterToTelemetry(this),this.filtersAndExp.exp.addToTelemetry(this),this.filtersAndExp.filters.addToTelemetry(this)}extendWithEditorAgnosticFields(e){this.properties.editor_version=(0,i.formatNameAndVersion)(e.get(i.EditorAndPluginInfo).getEditorInfo(e)),this.properties.editor_plugin_version=(0,i.formatNameAndVersion)(e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e));const t=e.get(i.VscInfo);this.properties.client_machineid=t.machineId,this.properties.client_sessionid=t.sessionId,this.properties.copilot_version=`copilot/${(0,i.getVersion)(e)}`,this.properties.common_extname=e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e).name,this.properties.common_extversion=e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e).version}extendWithConfigProperties(e){const t=(0,i.dumpConfig)(e);try{t["copilot.build"]=(0,i.getBuild)(e),t["copilot.buildType"]=(0,i.getBuildType)(e)}catch(e){}d&&(t["copilot.trackingId"]=d.trackingId),this.properties={...this.properties,...t}}extendWithRequestId(e){const t={completionId:e.completionId,created:e.created.toString(),headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...t}}static maybeRemoveRepoInfoFromPropertiesHack(e,t){if(e)return t;const n={};for(const e in t)h.keysToRemoveFromStandardTelemetryHack.includes(e)||(n[e]=t[e]);return n}sanitizeKeys(){this.properties=h.sanitizeKeys(this.properties),this.measurements=h.sanitizeKeys(this.measurements)}static sanitizeKeys(e){e=e||{};const t={};for(const n in e)t[h.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_")]=e[n];return t}updateTimeSinceIssuedAndDisplayed(){const e=m()-this.issuedTime;if(this.measurements.timeSinceIssuedMs=e,void 0!==this.displayedTime){const e=m()-this.displayedTime;this.measurements.timeSinceDisplayedMs=e}}validateData(e,t){var n;let r;if(h.validateTelemetryProperties(this.properties)||(r={problem:"properties",error:JSON.stringify(h.validateTelemetryProperties.errors)}),!h.validateTelemetryMeasurements(this.measurements)){const e=JSON.stringify(h.validateTelemetryMeasurements.errors);void 0===r?r={problem:"measurements",error:e}:(r.problem="both",r.error+=`; ${e}`)}if(void 0===r)return!0;if((0,c.shouldFailForDebugPurposes)(e))throw new Error(`Invalid telemetry data: ${r.problem} ${r.error} properties=${JSON.stringify(this.properties)} measurements=${JSON.stringify(this.measurements)}`);return b(e,"invalidTelemetryData",h.createAndMarkAsIssued({properties:JSON.stringify(this.properties),measurements:JSON.stringify(this.measurements),problem:r.problem,validationError:r.error}),t),t&&b(e,"invalidTelemetryData_in_secure",h.createAndMarkAsIssued({problem:r.problem,requestId:null!==(n=this.properties.requestId)&&void 0!==n?n:"unknown"}),!1),!1}async makeReadyForSending(e,t,n){this.extendWithConfigProperties(e),this.extendWithEditorAgnosticFields(e),this.sanitizeKeys(),"IncludeExp"===n&&await this.extendWithExpTelemetry(e),this.updateTimeSinceIssuedAndDisplayed(),this.validateData(e,t)||(this.properties.telemetry_failed_validation="true")}}function f(e,t,n,r){const o=t?e.get(u).getSecureReporter(e):e.get(u).getReporter(e);o&&o.sendTelemetryEvent(n,h.maybeRemoveRepoInfoFromPropertiesHack(t,r.properties),r.measurements)}function m(){return(new Date).getTime()}t.TelemetryData=h,h.ajv=new r.default({strictNumbers:!1}),h.validateTelemetryProperties=h.ajv.compile({type:"object",additionalProperties:{type:"string"},required:[]}),h.validateTelemetryMeasurements=h.ajv.compile({type:"object",properties:{meanLogProb:{type:"number",nullable:!0},meanAlternativeLogProb:{type:"number",nullable:!0}},additionalProperties:{type:"number"},required:[]}),h.keysExemptedFromSanitization=[a.ExpServiceTelemetryNames.assignmentContextTelemetryPropertyName,a.ExpServiceTelemetryNames.featuresTelemetryPropertyName],h.keysToRemoveFromStandardTelemetryHack=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo"],t.telemetrizePromptLength=function(e){return e.isFimEnabled?{promptPrefixCharLen:e.prefix.length,promptSuffixCharLen:e.suffix.length}:{promptCharLen:e.prefix.length}},t.now=m;class g{constructor(e){this.url=e}getUrl(){return this.url}}function _(e,t){const n=t;if(n.appInsightsClient){const t=n.appInsightsClient.commonProperties,r=h.sanitizeKeys(t);n.appInsightsClient.commonProperties=r,n.appInsightsClient.context.tags[n.appInsightsClient.context.keys.cloudRoleInstance]="REDACTED";const o=e.get(g).getUrl();void 0!==o&&(n.appInsightsClient.config.endpointUrl=o)}}function y(){var e;return null!==(e=null==d?void 0:d.optedIn)&&void 0!==e&&e}async function v(e,t,n,r){if(r&&!y())return;const o=n||h.createAndMarkAsIssued({},{});await o.makeReadyForSending(e,null!=r&&r,"IncludeExp"),f(e,null!=r&&r,t,o)}async function b(e,t,n,r){if(r&&!y())return;const o=n||h.createAndMarkAsIssued({},{});await o.makeReadyForSending(e,null!=r&&r,"IncludeExp"),function(e,t,n,r){const o=t?e.get(u).getSecureReporter(e):e.get(u).getReporter(e);o&&o.sendTelemetryErrorEvent(n,h.maybeRemoveRepoInfoFromPropertiesHack(t,r.properties),r.measurements)}(e,null!=r&&r,t,o)}t.TelemetryEndpointUrlOverride=g,t.noTelemetryEndpointUrlOverride=new g,t.telemetryEndpointUrlOverride=new g("https://copilot-telemetry.githubusercontent.com/telemetry"),t.configureReporter=_,t.telemetry=v,t.telemetryExpProblem=async function(e,t){const n=h.createAndMarkAsIssued(t,{});await n.makeReadyForSending(e,!1,"SkipExp"),f(e,!1,"expProblem",n)},t.telemetryRaw=async function(e,t,n,r){f(e,!1,t,{properties:n,measurements:r})},t.telemetryException=async function(e,t,n,r){const o=t instanceof Error?t:new Error("Non-error thrown: "+t),i=y(),s=h.createAndMarkAsIssued({origin:(0,l.redactPaths)(n),reason:i?"Exception logged to restricted telemetry":"Exception, not logged due to opt-out",...r});if(await s.makeReadyForSending(e,!1,"IncludeExp"),f(e,!1,"exception",s),!i)return;const a=h.createAndMarkAsIssued({origin:n,...r});await a.makeReadyForSending(e,!0,"IncludeExp"),function(e,t,n,r){const o=e.get(u).getSecureReporter(e);o&&o.sendTelemetryException(n,h.maybeRemoveRepoInfoFromPropertiesHack(true,r.properties),r.measurements)}(e,0,o,a)},t.telemetryError=b,t.logEngineCompletion=async function(e,t,n,r,o){var i;const s=h.createAndMarkAsIssued({completionTextJson:JSON.stringify(t),choiceIndex:o.toString()});for(const[e,t]of Object.entries(n.logprobs))s.properties["logprobs_"+e]=null!==(i=JSON.stringify(t))&&void 0!==i?i:"unset";s.extendWithRequestId(r),await v(e,"engine.completion",s,!0)},t.logEnginePrompt=async function(e,t,n){let r;r=t.isFimEnabled?{promptPrefixJson:JSON.stringify(t.prefix),promptSuffixJson:JSON.stringify(t.suffix),promptElementRanges:JSON.stringify(t.promptElementRanges)}:{promptJson:JSON.stringify(t.prefix),promptElementRanges:JSON.stringify(t.promptElementRanges)};const o=n.extendedBy(r);await v(e,"engine.prompt",o,!0)},t.setTelemetryConfig=function(e){d=e},t.dropTelemetryConfig=function(){d=void 0},t.forceSendingTelemetry=function(e,n){const r=n.getReporter(e);if(r){const n=r;n.userOptIn=!0,n.createAppInsightsClient(t.APP_INSIGHTS_KEY),_(e,r)}try{const r=n.getSecureReporter(e);if(r){const n=r;n.userOptIn=!0,n.createAppInsightsClient(t.APP_INSIGHTS_KEY_SECURE),_(e,r)}}catch(e){}}},956:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readTestingGitHubToken=t.makeTestingCopilotTokenManager=void 0;const r=n(7147),o=n(362);function i(){const e=`${process.env.HOME}/.copilot-testing-gh-token`;if(r.existsSync(e))return r.readFileSync(e).toString();throw new Error(`Tests: either GH_COPILOT_TOKEN, or GITHUB_TOKEN, must be set, or there must be a GitHub token from an app with access to Copilot in ${e}. Run "npm run get_token" to get one.`)}t.makeTestingCopilotTokenManager=function(){if(process.env.GH_COPILOT_TOKEN)return new o.FixedCopilotTokenManager({token:process.env.GH_COPILOT_TOKEN,telemetry:"enabled"});if(process.env.GITHUB_TOKEN)return new o.CopilotTokenManagerFromGitHubToken({token:process.env.GITHUB_TOKEN});const e=i();return process.env.GITHUB_TOKEN=e,new o.CopilotTokenManagerFromGitHubToken({token:e})},t.readTestingGitHubToken=i},70:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isVerboseLoggingEnabled=t.isDebugEnabled=t.shouldFailForDebugPurposes=t.isRunningInTest=t.RuntimeMode=void 0;class n{constructor(e){this.flags=e}static fromEnvironment(e){return new n({debug:(t=process.argv,r=process.env,t.includes("--debug")||"true"===(null===(s=r.GITHUB_COPILOT_DEBUG)||void 0===s?void 0:s.toLowerCase())),verboseLogging:o(process.env),testMode:e,recordInput:i(process.argv,process.env)});var t,r,s}}function r(e){return e.get(n).flags.testMode}function o(e){if("COPILOT_AGENT_VERBOSE"in e){const t=e.COPILOT_AGENT_VERBOSE;return"1"===t||"true"===t}return!1}function i(e,t){var n;return e.includes("--record")||"true"===(null===(n=t.GITHUB_COPILOT_RECORD)||void 0===n?void 0:n.toLowerCase())}t.RuntimeMode=n,t.isRunningInTest=r,t.shouldFailForDebugPurposes=function(e){return r(e)},t.isDebugEnabled=function(e){return e.get(n).flags.debug},t.isVerboseLoggingEnabled=function(e){return e.get(n).flags.verboseLogging}},8771:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestNotificationSender=t.TestUrlOpener=t.rangeToString=t.positionToString=void 0;const r=n(1547);function o(e){return`${e.line}:${e.character}`}t.positionToString=o,t.rangeToString=function(e){return`[${o(e.start)}--${o(e.end)}]`},t.TestUrlOpener=class{constructor(){this.openedUrls=[]}open(e){this.openedUrls.push(e)}};class i extends r.NotificationSender{constructor(){super(),this.sentMessages=[]}showWarningMessage(e,...t){return this.sentMessages.push(e),t?Promise.resolve(t[0]):Promise.resolve(void 0)}}t.TestNotificationSender=i},6403:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocationFactory=void 0,t.LocationFactory=class{}},3136:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocumentManager=t.getRelativePath=void 0;const r=n(1017);t.getRelativePath=function(e,t){for(const n of e){const e=n.fsPath;if(t.startsWith(e+r.sep))return r.relative(e,t)}},t.TextDocumentManager=class{}},7057:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RealUrlOpener=t.UrlOpener=void 0;const r=n(8318);t.UrlOpener=class{},t.RealUrlOpener=class{async open(e){await r(e)}}},2499:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redactPaths=void 0,t.redactPaths=function(e){return e.replace(/([\s|(]|file:\/\/)(\/[^\s]+)/g,"$1[redacted]").replace(/([\s|(]|file:\/\/)([a-zA-Z]:[(\\|/){1,2}][^\s]+)/gi,"$1[redacted]").replace(/([\s|(]|file:\/\/)(\\[^\s]+)/gi,"$1[redacted]")}},5012:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFileSystem=t.FileSystem=void 0;const r=n(7147);t.FileSystem=class{},t.defaultFileSystem={readFile:e=>r.promises.readFile(e),mtime:async e=>(await r.promises.stat(e)).mtimeMs,stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},9608:(e,t)=>{"use strict";function n(e){return"virtual"===e.type}function r(e){return"top"===e.type}Object.defineProperty(t,"__esModule",{value:!0}),t.duplicateTree=t.cutTreeAfterLine=t.isTop=t.isVirtual=t.isLine=t.isBlank=t.topNode=t.blankNode=t.lineNode=t.virtualNode=void 0,t.virtualNode=function(e,t,n){return{type:"virtual",indentation:e,subs:t,label:n}},t.lineNode=function(e,t,n,r,o){if(""===n)throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:e,lineNumber:t,sourceLine:n,subs:r,label:o}},t.blankNode=function(e){return{type:"blank",lineNumber:e,subs:[]}},t.topNode=function(e){return{type:"top",indentation:-1,subs:null!=e?e:[]}},t.isBlank=function(e){return"blank"===e.type},t.isLine=function(e){return"line"===e.type},t.isVirtual=n,t.isTop=r,t.cutTreeAfterLine=function(e,t){!function e(o){if(!n(o)&&!r(o)&&o.lineNumber===t)return o.subs=[],!0;for(let t=0;t<o.subs.length;t++)if(e(o.subs[t]))return o.subs=o.subs.slice(0,t+1),!0;return!1}(e)},t.duplicateTree=function(e){return JSON.parse(JSON.stringify(e))}},9829:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rebuildTree=t.foldTree=t.visitTreeConditionally=t.visitTree=t.resetLineNumbers=t.mapLabels=t.clearLabelsIf=t.clearLabels=void 0;const r=n(9608);function o(e,t,n){!function e(r){"topDown"===n&&t(r),r.subs.forEach((t=>{e(t)})),"bottomUp"===n&&t(r)}(e)}t.clearLabels=function(e){return o(e,(e=>{e.label=void 0}),"bottomUp"),e},t.clearLabelsIf=function(e,t){return o(e,(e=>{e.label=e.label?t(e.label)?void 0:e.label:void 0}),"bottomUp"),e},t.mapLabels=function e(t,n){switch(t.type){case"line":case"virtual":const r=t.subs.map((t=>e(t,n)));return{...t,subs:r,label:t.label?n(t.label):void 0};case"blank":return{...t,label:t.label?n(t.label):void 0};case"top":return{...t,subs:t.subs.map((t=>e(t,n))),label:t.label?n(t.label):void 0}}},t.resetLineNumbers=function(e){let t=0;o(e,(function(e){(0,r.isVirtual)(e)||(0,r.isTop)(e)||(e.lineNumber=t,t++)}),"topDown")},t.visitTree=o,t.visitTreeConditionally=function(e,t,n){!function e(r){if("topDown"===n&&!t(r))return!1;let o=!0;return r.subs.forEach((t=>{o=o&&e(t)})),"bottomUp"===n&&(o=o&&t(r)),o}(e)},t.foldTree=function(e,t,n,r){let i=t;return o(e,(function(e){i=n(e,i)}),r),i},t.rebuildTree=function(e,t,n){const o=e=>{if(void 0!==n&&n(e))return e;{const n=e.subs.map(o).filter((e=>void 0!==e));return e.subs=n,t(e)}},i=o(e);return void 0!==i?i:(0,r.topNode)()}},5288:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTree=t.registerLanguageSpecificParser=t.flattenVirtual=t.groupBlocks=t.combineClosersAndOpeners=t.buildLabelRules=t.labelVirtualInherited=t.labelLines=t.parseRaw=void 0;const r=n(9608),o=n(9829);function i(e){const t=e.split("\n"),n=t.map((e=>e.match(/^\s*/)[0].length)),o=t.map((e=>e.trimLeft()));function i(e){const[t,i]=s(e+1,n[e]);return[(0,r.lineNode)(n[e],e,o[e],t),i]}function s(e,t){let s;const a=[];let c,l=e;for(;l<o.length&&(""===o[l]||n[l]>t);)if(""===o[l])void 0===c&&(c=l),l+=1;else{if(void 0!==c){for(let e=c;e<l;e++)a.push((0,r.blankNode)(e));c=void 0}[s,l]=i(l),a.push(s)}return void 0!==c&&(l=c),[a,l]}const[a,c]=s(0,-1);let l=c;for(;l<o.length&&""===o[l];)a.push((0,r.blankNode)(l)),l+=1;if(l<o.length)throw new Error(`Parsing did not go to end of file. Ended at ${l} out of ${o.length}`);return(0,r.topNode)(a)}function s(e,t){(0,o.visitTree)(e,(function(e){if((0,r.isLine)(e)){const n=t.find((t=>t.matches(e.sourceLine)));n&&(e.label=n.label)}}),"bottomUp")}function a(e){return Object.keys(e).map((t=>{let n;return n=e[t].test?n=>e[t].test(n):e[t],{matches:n,label:t}}))}function c(e){const t=(0,o.rebuildTree)(e,(function(e){if(0===e.subs.length||-1===e.subs.findIndex((e=>"closer"===e.label||"opener"===e.label)))return e;const t=[];let n;for(let o=0;o<e.subs.length;o++){const i=e.subs[o],s=e.subs[o-1];if("opener"===i.label&&void 0!==s&&(0,r.isLine)(s))s.subs.push(i),i.subs.forEach((e=>s.subs.push(e))),i.subs=[];else if("closer"===i.label&&void 0!==n&&((0,r.isLine)(i)||(0,r.isVirtual)(i))&&i.indentation>=n.indentation){let e=t.length-1;for(;e>0&&(0,r.isBlank)(t[e]);)e-=1;if(n.subs.push(...t.splice(e+1)),i.subs.length>0){const e=n.subs.findIndex((e=>"newVirtual"!==e.label)),t=n.subs.slice(0,e),o=n.subs.slice(e),s=o.length>0?[(0,r.virtualNode)(i.indentation,o,"newVirtual")]:[];n.subs=[...t,...s,i]}else n.subs.push(i)}else t.push(i),(0,r.isBlank)(i)||(n=i)}return e.subs=t,e}));return(0,o.clearLabelsIf)(e,(e=>"newVirtual"===e)),t}t.parseRaw=i,t.labelLines=s,t.labelVirtualInherited=function(e){(0,o.visitTree)(e,(function(e){if((0,r.isVirtual)(e)&&void 0===e.label){const t=e.subs.filter((e=>!(0,r.isBlank)(e)));1===t.length&&(e.label=t[0].label)}}),"bottomUp")},t.buildLabelRules=a,t.combineClosersAndOpeners=c,t.groupBlocks=function(e,t=r.isBlank,n){return(0,o.rebuildTree)(e,(function(e){if(e.subs.length<=1)return e;const o=[];let i,s=[],a=!1;function c(e=!1){if(void 0!==i&&(o.length>0||!e)){const e=(0,r.virtualNode)(i,s,n);o.push(e)}else s.forEach((e=>o.push(e)))}for(let n=0;n<e.subs.length;n++){const o=e.subs[n],l=t(o);!l&&a&&(c(),s=[]),a=l,s.push(o),(0,r.isBlank)(o)||(i=null!=i?i:o.indentation)}return c(!0),e.subs=o,e}))},t.flattenVirtual=function(e){return(0,o.rebuildTree)(e,(function(e){return(0,r.isVirtual)(e)&&void 0===e.label&&e.subs.length<=1?0===e.subs.length?void 0:e.subs[0]:(1===e.subs.length&&(0,r.isVirtual)(e.subs[0])&&void 0===e.subs[0].label&&(e.subs=e.subs[0].subs),e)}))};const l=a({opener:/^[\[({]/,closer:/^[\])}]/}),u={};t.registerLanguageSpecificParser=function(e,t){u[e]=t},t.parseTree=function(e,t){const n=i(e),r=u[null!=t?t:""];return r?r(n):(s(n,l),c(n))}},4855:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowsDelineations=void 0;const r=n(5288),o=n(9829);t.getWindowsDelineations=function(e,t,n,i){if(e.length<n||0==i)return[];const s=[],a=(0,o.clearLabels)((0,r.parseTree)(e.join("\n"),t));return(0,o.visitTree)(a,(e=>{if("blank"===e.type)return void(e.label={totalLength:1,firstLineAfter:e.lineNumber+1});let t="line"===e.type?1:0,r="line"===e.type?e.lineNumber+1:NaN;function o(n){return-1==n?r-t:e.subs[n].label.firstLineAfter-e.subs[n].label.totalLength}function a(t,n){return 0==t?n+1:e.subs[t-1].label.firstLineAfter}let c="line"===e.type?-1:0,l="line"===e.type?1:0,u=0;for(let d=0;d<e.subs.length;d++){for(;c>=0&&c<e.subs.length&&"blank"===e.subs[c].type;)l-=e.subs[c].label.totalLength,c++;if("blank"!==e.subs[d].type&&(u=d),r=e.subs[d].label.firstLineAfter,t+=e.subs[d].label.totalLength,l+=e.subs[d].label.totalLength,l>i){const t=o(c),r=a(d,t),p=u==d?r:a(u,t);for(n<=r-t&&s.push([t,p]);l>i;)l-=-1==c?"line"==e.type?1:0:e.subs[c].label.totalLength,c++}}if(c<e.subs.length){const t=o(c),i=r,a=-1==c?i:e.subs[u].label.firstLineAfter;n<=i-t&&s.push([t,a])}e.label={totalLength:t,firstLineAfter:r}}),"bottomUp"),s.sort(((e,t)=>e[0]-t[0]||e[1]-t[1])).filter(((e,t,n)=>0==t||e[0]!=n[t-1][0]||e[1]!=n[t-1][1]))}},1788:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMarker=t.getLanguageMarker=t.comment=t.hasLanguageMarker=t.languageCommentMarkers=void 0,t.languageCommentMarkers={abap:{start:'"',end:""},bat:{start:"REM",end:""},bibtex:{start:"%",end:""},blade:{start:"#",end:""},c:{start:"//",end:""},clojure:{start:";",end:""},coffeescript:{start:"//",end:""},cpp:{start:"//",end:""},csharp:{start:"//",end:""},css:{start:"/*",end:"*/"},dart:{start:"//",end:""},dockerfile:{start:"#",end:""},elixir:{start:"#",end:""},erb:{start:"<%#",end:"%>"},erlang:{start:"%",end:""},fsharp:{start:"//",end:""},go:{start:"//",end:""},groovy:{start:"//",end:""},haml:{start:"-#",end:""},handlebars:{start:"{{!",end:"}}"},haskell:{start:"--",end:""},html:{start:"\x3c!--",end:"--\x3e"},ini:{start:";",end:""},java:{start:"//",end:""},javascript:{start:"//",end:""},javascriptreact:{start:"//",end:""},jsonc:{start:"//",end:""},jsx:{start:"//",end:""},julia:{start:"#",end:""},kotlin:{start:"//",end:""},latex:{start:"%",end:""},less:{start:"//",end:""},lua:{start:"--",end:""},makefile:{start:"#",end:""},markdown:{start:"[]: #",end:""},"objective-c":{start:"//",end:""},"objective-cpp":{start:"//",end:""},perl:{start:"#",end:""},php:{start:"//",end:""},powershell:{start:"#",end:""},pug:{start:"//",end:""},python:{start:"#",end:""},ql:{start:"//",end:""},r:{start:"#",end:""},razor:{start:"\x3c!--",end:"--\x3e"},ruby:{start:"#",end:""},rust:{start:"//",end:""},sass:{start:"//",end:""},scala:{start:"//",end:""},scss:{start:"//",end:""},shellscript:{start:"#",end:""},slim:{start:"/",end:""},solidity:{start:"//",end:""},sql:{start:"--",end:""},stylus:{start:"//",end:""},svelte:{start:"\x3c!--",end:"--\x3e"},swift:{start:"//",end:""},terraform:{start:"#",end:""},tex:{start:"%",end:""},typescript:{start:"//",end:""},typescriptreact:{start:"//",end:""},vb:{start:"'",end:""},verilog:{start:"//",end:""},"vue-html":{start:"\x3c!--",end:"--\x3e"},vue:{start:"//",end:""},xml:{start:"\x3c!--",end:"--\x3e"},xsl:{start:"\x3c!--",end:"--\x3e"},yaml:{start:"#",end:""}};const n=["php","plaintext"],r={html:"<!DOCTYPE html>",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function o({source:e}){return e.startsWith("#!")||e.startsWith("<!DOCTYPE")}function i(e,n){const r=t.languageCommentMarkers[n];if(r){const t=""==r.end?"":" "+r.end;return`${r.start} ${e}${t}`}return""}t.hasLanguageMarker=o,t.comment=i,t.getLanguageMarker=function(e){const{languageId:t}=e;return-1!==n.indexOf(t)||o(e)?"":t in r?r[t]:i(`Language: ${t}`,t)},t.getPathMarker=function(e){return e.relativePath?i(`Path: ${e.relativePath}`,e.languageId):""}},4723:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.createWorker=t.FileSystem=t.comment=t.languageCommentMarkers=void 0;const i=n(1017),s=n(1267);o(n(464),t),o(n(9940),t),o(n(1747),t),o(n(9852),t);var a=n(1788);Object.defineProperty(t,"languageCommentMarkers",{enumerable:!0,get:function(){return a.languageCommentMarkers}}),Object.defineProperty(t,"comment",{enumerable:!0,get:function(){return a.comment}});var c=n(5012);Object.defineProperty(t,"FileSystem",{enumerable:!0,get:function(){return c.FileSystem}}),t.createWorker=function(){return new s.Worker((0,i.resolve)(__dirname,"..","dist","worker.js"))}},3507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractLocalImportContext=t.getDocComment=void 0;const r=n(1017),o=n(464);function i(e,t){var n;let o=null===(n=t.namedChild(1))||void 0===n?void 0:n.text.slice(1,-1);if(!o||!o.startsWith("."))return null;if(""===(0,r.extname)(o))o+=".ts";else if(".ts"!==(0,r.extname)(o))return null;return(0,r.join)((0,r.dirname)(e),o)}function s(e){var t,n,r,o,i;let s=[];if("import_clause"===(null===(t=e.namedChild(0))||void 0===t?void 0:t.type)){let t=e.namedChild(0);if("named_imports"===(null===(n=null==t?void 0:t.namedChild(0))||void 0===n?void 0:n.type)){let e=t.namedChild(0);for(let t of null!==(r=null==e?void 0:e.namedChildren)&&void 0!==r?r:[])if("import_specifier"===t.type){const e=null===(o=t.childForFieldName("name"))||void 0===o?void 0:o.text;if(e){const n=null===(i=t.childForFieldName("alias"))||void 0===i?void 0:i.text;s.push({name:e,alias:n})}}}}return s}const a=new Map;function c(e,t){var n,r;let o=null!==(r=null===(n=null==t?void 0:t.childForFieldName("name"))||void 0===n?void 0:n.text)&&void 0!==r?r:"";switch(null==t?void 0:t.type){case"ambient_declaration":return c(e,t.namedChild(0));case"interface_declaration":case"enum_declaration":case"type_alias_declaration":return{name:o,decl:t.text};case"function_declaration":case"function_signature":return{name:o,decl:l(e,t)};case"class_declaration":{let n=function(e,t){let n=t.childForFieldName("body");if(n)return n.namedChildren.map((t=>d(e,t))).filter((e=>e))}(e,t),r="";if(n){let o=t.childForFieldName("body");r=`declare ${e.substring(t.startIndex,o.startIndex+1)}`,r+=n.map((e=>"\n"+e)).join(""),r+="\n}"}return{name:o,decl:r}}}return{name:o,decl:""}}function l(e,t){var n,r,o;const i=null!==(r=null===(n=t.childForFieldName("return_type"))||void 0===n?void 0:n.endIndex)&&void 0!==r?r:null===(o=t.childForFieldName("parameters"))||void 0===o?void 0:o.endIndex;if(void 0!==i){let n=e.substring(t.startIndex,i)+";";return"function_declaration"===t.type||"function_signature"===t.type?"declare "+n:n}return""}function u(e,t){const n=(0,o.getFirstPrecedingComment)(t);return n?e.substring(n.startIndex,t.startIndex):""}function d(e,t){var n,r,i,s,a;if("accessibility_modifier"===(null===(n=null==t?void 0:t.firstChild)||void 0===n?void 0:n.type)&&"private"===t.firstChild.text)return"";const c=(0,o.getFirstPrecedingComment)(t),p=null!==(r=function(e,t){let n=t.startIndex-1;for(;n>=0&&(" "===e[n]||"\t"===e[n]);)n--;if(n<0||"\n"===e[n])return e.substring(n+1,t.startIndex)}(e,null!=c?c:t))&&void 0!==r?r:" ",h=u(e,t);switch(t.type){case"ambient_declaration":const n=t.namedChild(0);return n?p+h+d(e,n):"";case"method_definition":case"method_signature":return p+h+l(e,t);case"public_field_definition":{let n=null!==(s=null===(i=t.childForFieldName("type"))||void 0===i?void 0:i.endIndex)&&void 0!==s?s:null===(a=t.childForFieldName("name"))||void 0===a?void 0:a.endIndex;if(void 0!==n)return p+h+e.substring(t.startIndex,n)+";"}}return""}async function p(e,t,n){let r=new Map,i=-1;try{i=await n.mtime(e)}catch{return r}let s=a.get(e);if(s&&s.mtime===i)return s.exports;if("typescript"===t){let i=null;try{let s=(await n.readFile(e)).toString();i=await(0,o.parseTree)(t,s);for(let e of(0,o.queryExports)(t,i.rootNode))for(let t of e.captures){let e=t.node;if("export_statement"===e.type){let t=e.childForFieldName("declaration");if(null==t?void 0:t.hasError())continue;let{name:n,decl:o}=c(s,t);if(n){o=u(s,e)+o;let t=r.get(n);t||(t=[],r.set(n,t)),t.push(o)}}}}catch{}finally{i&&i.delete()}}if(a.size>2e3)for(let e of a.keys())if(a.delete(e),r.size<=1e3)break;return a.set(e,{mtime:i,exports:r}),r}t.getDocComment=u;const h=/^\s*import\s*(type|)\s*\{[^}]*\}\s*from\s*['"]\./gm;t.extractLocalImportContext=async function(e,t){let{source:n,uri:r,languageId:a}=e;return t&&"typescript"===a?async function(e,t,n){let r="typescript",a=[];const c=function(e){let t,n=-1;h.lastIndex=-1;do{t=h.exec(e),t&&(n=h.lastIndex+t.length)}while(t);if(-1===n)return-1;const r=e.indexOf("\n",n);return-1!==r?r:e.length}(e);if(-1===c)return a;e=e.substring(0,c);let l=await(0,o.parseTree)(r,e);try{for(let e of function(e){let t=[];for(let n of e.namedChildren)"import_statement"===n.type&&t.push(n);return t}(l.rootNode)){let o=i(t,e);if(!o)continue;let c=s(e);if(0===c.length)continue;let l=await p(o,r,n);for(let e of c)l.has(e.name)&&a.push(...l.get(e.name))}}finally{l.delete()}return a}(n,r,t):[]}},464:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionPositions=t.getFirstPrecedingComment=t.isFunctionDefinition=t.isFunction=t.getAncestorWithSiblingFunctions=t.queryPythonIsDocstring=t.queryGlobalVars=t.queryExports=t.queryImports=t.queryFunctions=t.getBlockCloseToken=t.parsesWithoutError=t.parseTree=t.getLanguage=t.languageIdToWasmLanguage=t.isSupportedLanguageId=t.WASMLanguage=void 0;const r=n(1017),o=n(4087),i=n(4087);var s;!function(e){e.Python="python",e.JavaScript="javascript",e.TypeScript="typescript",e.Go="go",e.Ruby="ruby"}(s=t.WASMLanguage||(t.WASMLanguage={}));const a={python:s.Python,javascript:s.JavaScript,javascriptreact:s.JavaScript,jsx:s.JavaScript,typescript:s.TypeScript,typescriptreact:s.TypeScript,go:s.Go,ruby:s.Ruby};function c(e){if(!(e in a))throw new Error(`Unrecognized language: ${e}`);return a[e]}t.isSupportedLanguageId=function(e){return e in a},t.languageIdToWasmLanguage=c;const l={python:[["(function_definition body: (block\n (expression_statement (string))? @docstring) @body) @function"],['(ERROR ("def" (identifier) (parameters))) @function']],javascript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],typescript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],go:[["[\n (function_declaration body: (block) @body)\n (method_declaration body: (block) @body)\n ] @function"]],ruby:[['[\n (method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n (singleton_method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n ] @function']]},u='(variable_declarator value: (call_expression function: ((identifier) @req (#eq? @req "require"))))',d=`\n (lexical_declaration ${u}+)\n (variable_declaration ${u}+)\n`,p={python:[["(module (future_import_statement) @import)"],["(module (import_statement) @import)"],["(module (import_from_statement) @import)"]],javascript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) ] @import)"]],typescript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) (import_alias) ] @import)"]],go:[],ruby:[]},h={python:[],javascript:[["(program (export_statement) @export)"]],typescript:[["(program (export_statement) @export)"]],go:[],ruby:[]},f={python:[["(module (global_statement) @globalVar)"],["(module (expression_statement) @globalVar)"]],javascript:[],typescript:[],go:[],ruby:[]},m={python:new Set(["function_definition"]),javascript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),typescript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),go:new Set(["function_declaration","method_declaration"]),ruby:new Set(["method","singleton_method"])},g={python:e=>{var t;return"module"===e.type||"block"===e.type&&"class_definition"===(null===(t=e.parent)||void 0===t?void 0:t.type)},javascript:e=>"program"===e.type||"class_body"===e.type,typescript:e=>"program"===e.type||"class_body"===e.type,go:e=>"source_file"===e.type,ruby:e=>"program"===e.type||"class"===e.type},_=new Map;async function y(e){const t=c(e);if(!_.has(t)){const e=await async function(e){await o.init();const t=(0,r.resolve)(__dirname,"..","dist",`tree-sitter-${e}.wasm`);return i.Language.load(t)}(t);_.set(t,e)}return _.get(t)}async function v(e,t){let n=await y(e);const r=new o;r.setLanguage(n);const i=r.parse(t);return r.delete(),i}function b(e,t){const n=[];for(const r of e){if(!r[1]){const e=t.tree.getLanguage();r[1]=e.query(r[0])}n.push(...r[1].matches(t))}return n}function w(e,t){return b(l[c(e)],t)}t.getLanguage=y,t.parseTree=v,t.parsesWithoutError=async function(e,t){const n=await v(e,t),r=!n.rootNode.hasError();return n.delete(),r},t.getBlockCloseToken=function(e){switch(c(e)){case s.Python:return null;case s.JavaScript:case s.TypeScript:case s.Go:return"}";case s.Ruby:return"end"}},t.queryFunctions=w,t.queryImports=function(e,t){return b(p[c(e)],t)},t.queryExports=function(e,t){return b(h[c(e)],t)},t.queryGlobalVars=function(e,t){return b(f[c(e)],t)};const x=["[\n (class_definition (block (expression_statement (string))))\n (function_definition (block (expression_statement (string))))\n]"];function E(e,t){return m[c(e)].has(t.type)}t.queryPythonIsDocstring=function(e){return 1==b([x],e).length},t.getAncestorWithSiblingFunctions=function(e,t){const n=g[c(e)];for(;t.parent;){if(n(t.parent))return t;t=t.parent}return t.parent?t:null},t.isFunction=E,t.isFunctionDefinition=function(e,t){switch(c(e)){case s.Python:case s.Go:case s.Ruby:return E(e,t);case s.JavaScript:case s.TypeScript:if("function_declaration"===t.type||"generator_function_declaration"===t.type||"method_definition"===t.type)return!0;if("lexical_declaration"===t.type||"variable_declaration"===t.type){if(t.namedChildCount>1)return!1;let n=t.namedChild(0);if(null==n)return!1;let r=n.namedChild(1);return null!==r&&E(e,r)}if("expression_statement"===t.type){let n=t.namedChild(0);if("assignment_expression"===(null==n?void 0:n.type)){let t=n.namedChild(1);return null!==t&&E(e,t)}}return!1}},t.getFirstPrecedingComment=function(e){var t;let n=e;for(;"comment"===(null===(t=n.previousSibling)||void 0===t?void 0:t.type);){let e=n.previousSibling;if(e.endPosition.row<n.startPosition.row-1)break;n=e}return"comment"===(null==n?void 0:n.type)?n:null},t.getFunctionPositions=async function(e,t){return w(e,(await v(e,t)).rootNode).map((e=>{const t=e.captures.find((e=>"function"===e.name)).node;return{startIndex:t.startIndex,endIndex:t.endIndex}}))}},9940:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeStart=t.isBlockBodyFinished=t.isEmptyBlockStart=t.getBlockParser=void 0;const r=n(464);class o{constructor(e,t,n){this.languageId=e,this.nodeMatch=t,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,t,n){const o=await(0,r.parseTree)(this.languageId,e);try{let e=o.rootNode.descendantForIndex(t);for(;e;){const t=this.nodeMatch[e.type];if(t){if(!this.nodeTypesWithBlockOrStmtChild.has(e.type))break;const n=this.nodeTypesWithBlockOrStmtChild.get(e.type),r=""==n?e.namedChildren[0]:e.childForFieldName(n);if((null==r?void 0:r.type)==t)break}e=e.parent}if(!e)return;return n(e)}finally{o.delete()}}getNextBlockAtPosition(e,t,n){return this.getNodeMatchAtPosition(e,t,(e=>{let t=e.children.reverse().find((t=>t.type==this.nodeMatch[e.type]));if(t){if("python"==this.languageId&&t.parent){const e=":"==t.parent.type?t.parent.parent:t.parent;let n=null==e?void 0:e.nextSibling;for(;n&&"comment"==n.type;){const r=n.startPosition.row==t.endPosition.row&&n.startPosition.column>=t.endPosition.column,o=n.startPosition.row>e.endPosition.row&&n.startPosition.column>e.startPosition.column;if(!r&&!o)break;t=n,n=n.nextSibling}}if(!(t.endIndex>=t.tree.rootNode.endIndex-1&&(t.hasError()||t.parent.hasError())))return n(t)}}))}async isBlockBodyFinished(e,t,n){const r=(e+t).trimEnd(),o=await this.getNextBlockAtPosition(r,n,(e=>e.endIndex));if(void 0!==o&&o<r.length){const t=o-e.length;return t>0?t:void 0}}getNodeStart(e,t){const n=e.trimEnd();return this.getNodeMatchAtPosition(n,t,(e=>e.startIndex))}}class i extends o{constructor(e,t,n,r,o){super(e,r,o),this.blockEmptyMatch=t,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,t){const n=await this.getNextBlockAtPosition(e,t,(n=>{n.startIndex<t&&(t=n.startIndex);let r=e.substring(t,n.endIndex).trim();return""==r||r.replace(/\s/g,"")==this.blockEmptyMatch}));return void 0===n||n}async isEmptyBlockStart(e,t){return t=s(e,t),this.isBlockStart(function(e,t){const n=e.lastIndexOf("\n",t-1);let r=e.indexOf("\n",t);return r<0&&(r=e.length),e.slice(n+1,r)}(e,t))&&this.isBlockBodyEmpty(e,t)}}function s(e,t){let n=t;for(;n>0&&/\s/.test(e.charAt(n-1));)n--;return n}function a(e,t){const n=e.startIndex,r=e.startIndex-e.startPosition.column,o=t.substring(r,n);if(/^\s*$/.test(o))return o}function c(e,t,n){if(t.startPosition.row<=e.startPosition.row)return!1;const r=a(e,n),o=a(t,n);return void 0!==r&&void 0!==o&&r.startsWith(o)}class l extends o{constructor(e,t,n,r,o,i,s){super(e,t,n),this.startKeywords=r,this.blockNodeType=o,this.emptyStatementType=i,this.curlyBraceLanguage=s}isBlockEmpty(e,t){var n,o;let i=e.text.trim();return this.curlyBraceLanguage&&(i.startsWith("{")&&(i=i.slice(1)),i.endsWith("}")&&(i=i.slice(0,-1)),i=i.trim()),0==i.length||!("python"!=this.languageId||"class_definition"!=(null===(n=e.parent)||void 0===n?void 0:n.type)&&"function_definition"!=(null===(o=e.parent)||void 0===o?void 0:o.type)||1!=e.children.length||!(0,r.queryPythonIsDocstring)(e.parent))}async isEmptyBlockStart(e,t){var n,o,i;if(t>e.length)throw new RangeError("Invalid offset");for(let n=t;n<e.length&&"\n"!=e.charAt(n);n++)if(/\S/.test(e.charAt(n)))return!1;t=s(e,t);const a=await(0,r.parseTree)(this.languageId,e);try{const r=a.rootNode.descendantForIndex(t-1);if(null==r)return!1;if(this.curlyBraceLanguage&&"}"==r.type)return!1;if(("javascript"==this.languageId||"typescript"==this.languageId)&&r.parent&&"object"==r.parent.type&&"{"==r.parent.text.trim())return!0;if("typescript"==this.languageId){let n=r;for(;n.parent;){if("function_signature"==n.type||"method_signature"==n.type){const o=r.nextSibling;return!!(o&&n.hasError()&&c(n,o,e))||!n.children.find((e=>";"==e.type))&&n.endIndex<=t}n=n.parent}}let s=null,l=null,u=null,d=r;for(;null!=d;){if(d.type==this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if("ERROR"==d.type){s=d;break}d=d.parent}if(null!=l){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if("python"==this.languageId){const e=l.previousSibling;if(null!=e&&e.hasError()&&(e.text.startsWith('"""')||e.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,t)}if(null!=s){if("module"==(null===(n=s.previousSibling)||void 0===n?void 0:n.type)||"internal_module"==(null===(o=s.previousSibling)||void 0===o?void 0:o.type))return!0;const e=[...s.children].reverse(),a=e.find((e=>this.startKeywords.includes(e.type)));let c=e.find((e=>e.type==this.blockNodeType));if(a){switch(this.languageId){case"python":{"try"==a.type&&"identifier"==r.type&&r.text.length>4&&(c=null===(i=e.find((e=>e.hasError())))||void 0===i?void 0:i.children.find((e=>"block"==e.type)));const t=e.find((e=>":"==e.type));if(t&&a.endIndex<=t.startIndex&&t.nextSibling){if("def"==a.type){const e=t.nextSibling;if('"'==e.type||"'"==e.type)return!0;if("ERROR"==e.type&&('"""'==e.text||"'''"==e.text))return!0}return!1}break}case"javascript":{const t=e.find((e=>"formal_parameters"==e.type));if("class"==a.type&&t)return!0;const n=e.find((e=>"{"==e.type));if(n&&n.startIndex>a.endIndex&&null!=n.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}case"typescript":{const t=e.find((e=>"{"==e.type));if(t&&t.startIndex>a.endIndex&&null!=t.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}}return!(c&&c.startIndex>a.endIndex)||this.isBlockEmpty(c,t)}}if(null!=u){const e=this.nodeMatch[u.type],n=u.children.slice().reverse().find((t=>t.type==e));if(n)return this.isBlockEmpty(n,t);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){const e=this.nodeTypesWithBlockOrStmtChild.get(u.type),t=""==e?u.children[0]:u.childForFieldName(e);if(t&&t.type!=this.blockNodeType&&t.type!=this.emptyStatementType)return!1}return!0}return!1}finally{a.delete()}}}const u={python:new l("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new l("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new l("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new i("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new i("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map)};function d(e){return u[(0,r.languageIdToWasmLanguage)(e)]}t.getBlockParser=d,t.isEmptyBlockStart=async function(e,t,n){return!!(0,r.isSupportedLanguageId)(e)&&d(e).isEmptyBlockStart(t,n)},t.isBlockBodyFinished=async function(e,t,n,o){if((0,r.isSupportedLanguageId)(e))return d(e).isBlockBodyFinished(t,n,o)},t.getNodeStart=async function(e,t,n){if((0,r.isSupportedLanguageId)(e))return d(e).getNodeStart(t,n)}},1747:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrompt=t.newLineEnded=t.normalizeLanguageId=t.PromptOptions=t.SuffixStartMode=t.SuffixMatchOption=t.SuffixOption=t.LineEndingOptions=t.LocalImportContextOption=t.NeighboringTabsPositionOption=t.NeighboringTabsOption=t.SiblingOption=t.PathMarkerOption=t.LanguageMarkerOption=t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=t.MAX_PROMPT_LENGTH=void 0;const r=n(9852),o=n(1788),i=n(3507),s=n(9931),a=n(820),c=n(9852),l=n(7408),u=n(4431);let d="";var p,h,f,m,g,_,y,v,b,w;t.MAX_PROMPT_LENGTH=1500,t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=5,function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(p=t.LanguageMarkerOption||(t.LanguageMarkerOption={})),function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(h=t.PathMarkerOption||(t.PathMarkerOption={})),function(e){e.NoSiblings="nosiblings",e.SiblingsOverContext="siblingabove",e.ContextOverSiblings="contextabove"}(f=t.SiblingOption||(t.SiblingOption={})),function(e){e.None="none",e.Conservative="conservative",e.Medium="medium",e.Eager="eager",e.EagerButLittle="eagerButLittle"}(m=t.NeighboringTabsOption||(t.NeighboringTabsOption={})),function(e){e.TopOfText="top",e.DirectlyAboveCursor="aboveCursor",e.AfterSiblings="afterSiblings"}(g=t.NeighboringTabsPositionOption||(t.NeighboringTabsPositionOption={})),function(e){e.NoContext="nocontext",e.Declarations="declarations"}(_=t.LocalImportContextOption||(t.LocalImportContextOption={})),function(e){e.ConvertToUnix="unix",e.KeepOriginal="keep"}(y=t.LineEndingOptions||(t.LineEndingOptions={})),(w=t.SuffixOption||(t.SuffixOption={})).None="none",w.FifteenPercent="fifteenPercent",function(e){e.Equal="equal",e.Levenshtein="levenshteineditdistance"}(v=t.SuffixMatchOption||(t.SuffixMatchOption={})),function(e){e.Cursor="cursor",e.CursorTrimStart="cursortrimstart",e.SiblingBlock="siblingblock",e.SiblingBlockTrimStart="siblingblocktrimstart"}(b=t.SuffixStartMode||(t.SuffixStartMode={}));class x{constructor(e,n){if(this.fs=e,this.maxPromptLength=t.MAX_PROMPT_LENGTH,this.languageMarker=p.Top,this.pathMarker=h.Top,this.includeSiblingFunctions=f.ContextOverSiblings,this.localImportContext=_.Declarations,this.neighboringTabs=m.Eager,this.neighboringTabsPosition=g.TopOfText,this.lineEnding=y.ConvertToUnix,this.suffixPercent=0,this.suffixStartMode=b.Cursor,this.suffixMatchThreshold=20,this.suffixMatchCriteria=v.Levenshtein,n)for(const e in n)this[e]=n[e];if(this.suffixPercent<0||this.suffixPercent>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${this.suffixPercent}`);if(this.suffixPercent>0&&this.includeSiblingFunctions!=f.NoSiblings)throw new Error(`Invalid option combination. Cannot set suffixPercent > 0 (${this.suffixPercent}) and includeSiblingFunctions ${this.includeSiblingFunctions}`);if(this.suffixMatchThreshold<0||this.suffixMatchThreshold>100)throw new Error(`suffixMatchThreshold must be at between 0 and 100, but was ${this.suffixMatchThreshold}`);if(null!=this.neighboringTabsMinLength&&null!=this.neighboringTabsMaxLength&&this.neighboringTabsMinLength>this.neighboringTabsMaxLength)throw new Error(`neighboringTabsMinLength must be less than or equal to neighboringTabsMaxLength, but was ${this.neighboringTabsMinLength} and ${this.neighboringTabsMaxLength}`)}}t.PromptOptions=x;const E={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor"};function C(e){var t;return e=e.toLowerCase(),null!==(t=E[e])&&void 0!==t?t:e}function S(e){return""==e||e.endsWith("\n")?e:e+"\n"}t.normalizeLanguageId=C,t.newLineEnded=S,t.getPrompt=async function(e,n,y={},w=[]){var E;const T=new x(e,y);let k=!1;const{source:I,offset:P}=n;if(P<0||P>I.length)throw new Error(`Offset ${P} is out of range.`);n.languageId=C(n.languageId);const A=new l.Priorities,O=A.justBelow(l.Priorities.TOP),N=T.languageMarker==p.Always?A.justBelow(l.Priorities.TOP):A.justBelow(O),R=T.pathMarker==h.Always?A.justBelow(l.Priorities.TOP):A.justBelow(O),M=T.includeSiblingFunctions==f.ContextOverSiblings?A.justBelow(O):A.justAbove(O),L=A.justBelow(O,M),$=A.justBelow(L),D=new l.PromptWishlist(T.lineEnding);let F,j;if(T.languageMarker!=p.NoMarker){const e=S((0,o.getLanguageMarker)(n));F=D.append(e,l.PromptElementKind.LanguageMarker,N)}if(T.pathMarker!=h.NoMarker){const e=S((0,o.getPathMarker)(n));e.length>0&&(j=D.append(e,l.PromptElementKind.PathMarker,R))}if(T.localImportContext!=_.NoContext)for(const e of await(0,i.extractLocalImportContext)(n,T.fs))D.append(S(e),l.PromptElementKind.ImportedFile,L);const q=T.neighboringTabs==m.None||0==w.length?[]:await(0,s.getNeighborSnippets)(n,w,T.neighboringTabs,T.neighboringTabsMinLength,T.neighboringTabsMaxLength);function B(){q.forEach((e=>D.append(e.snippet,l.PromptElementKind.SimilarFile,$,(0,c.tokenLength)(e.snippet),e.score)))}T.neighboringTabsPosition==g.TopOfText&&B();const U=[];let H;if(T.includeSiblingFunctions==f.NoSiblings)H=I.substring(0,P);else{const{siblings:e,beforeInsertion:t,afterInsertion:r}=await(0,a.getSiblingFunctions)(n);D.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));let o=M;e.forEach((e=>{D.append(e,l.PromptElementKind.AfterCursor,o),o=A.justBelow(o)})),T.neighboringTabsPosition==g.AfterSiblings&&B(),H=r}if(T.neighboringTabsPosition==g.DirectlyAboveCursor){const e=H.lastIndexOf("\n")+1,t=H.substring(0,e),n=H.substring(e);D.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e))),B(),n.length>0&&(U.push(D.append(n,l.PromptElementKind.AfterCursor,O)),U.length>1&&D.require(U[U.length-2],U[U.length-1]))}else D.appendLineForLine(H,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));if(p.Top==T.languageMarker&&U.length>0&&void 0!==F&&D.require(F,U[0]),h.Top==T.pathMarker&&U.length>0&&void 0!==j&&(F?D.require(j,F):D.require(j,U[0])),void 0!==F&&void 0!==j&&D.exclude(j,F),0==T.suffixPercent)return D.fulfill(T.maxPromptLength);{let e=n.offset;T.suffixStartMode!==b.Cursor&&T.suffixStartMode!==b.CursorTrimStart&&(e=await(0,a.getSiblingFunctionStart)(n));const o=T.maxPromptLength-t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING;let i=Math.floor(o*(100-T.suffixPercent)/100),s=D.fulfill(i);const l=o-s.prefixLength;let p=I.slice(e);T.suffixStartMode!=b.SiblingBlockTrimStart&&T.suffixStartMode!=b.CursorTrimStart||(p=p.trimStart());const h=(0,r.takeFirstTokens)(p,l),f=(0,c.tokenLength)(h);f<=l-3&&(i=o-f,s=D.fulfill(i));const m=h.length,g=(0,c.tokenLength)(d);if(T.suffixMatchCriteria==v.Equal)h===d&&(k=!0);else if(T.suffixMatchCriteria==v.Levenshtein){const e=null===(E=(0,u.findEditDistanceScore)(h,d))||void 0===E?void 0:E.score;m>0&&T.suffixMatchThreshold>0&&100*e<T.suffixMatchThreshold*m&&(k=!0)}return!0===k&&g<=l?(g<=l-3&&(i=o-g,s=D.fulfill(i)),s.suffix=d,s.suffixLength=g):(s.suffix=h,s.suffixLength=f,d=h),s}}},820:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSiblingFunctionStart=t.getSiblingFunctions=void 0;const r=n(1747),o=n(464);t.getSiblingFunctions=async function({source:e,offset:t,languageId:n}){var i,s;const a=[];let c="",l=e.substring(0,t);if((0,o.isSupportedLanguageId)(n)){const u=await(0,o.parseTree)(n,e);try{let d=t;for(;d>=0&&/\s/.test(e[d]);)d--;const p=u.rootNode.descendantForIndex(d),h=(0,o.getAncestorWithSiblingFunctions)(n,p);if(h){const u=(0,o.getFirstPrecedingComment)(h),d=null!==(i=null==u?void 0:u.startIndex)&&void 0!==i?i:h.startIndex;let p,f=0;for(;" "==(p=e[d-f-1])||"\t"==p;)f++;const m=e.substring(d-f,d);for(let i=h.nextSibling;i;i=i.nextSibling)if((0,o.isFunctionDefinition)(n,i)){const n=(0,o.getFirstPrecedingComment)(i),c=null!==(s=null==n?void 0:n.startIndex)&&void 0!==s?s:i.startIndex;if(c<t)continue;const l=e.substring(c,i.endIndex),u=(0,r.newLineEnded)(l)+"\n"+m;a.push(u)}c=e.substring(0,d),l=e.substring(d,t)}}finally{u.delete()}}return{siblings:a,beforeInsertion:c,afterInsertion:l}},t.getSiblingFunctionStart=async function({source:e,offset:t,languageId:n}){var r;if((0,o.isSupportedLanguageId)(n)){const i=await(0,o.parseTree)(n,e);try{let s=t;for(;s>=0&&/\s/.test(e[s]);)s--;const a=i.rootNode.descendantForIndex(s),c=(0,o.getAncestorWithSiblingFunctions)(n,a);if(c){for(let e=c.nextSibling;e;e=e.nextSibling)if((0,o.isFunctionDefinition)(n,e)){const n=(0,o.getFirstPrecedingComment)(e),i=null!==(r=null==n?void 0:n.startIndex)&&void 0!==r?r:e.startIndex;if(i<t)continue;return i}if(c.endIndex>=t)return c.endIndex}}finally{i.delete()}}return t}},569:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeScore=t.IndentationBasedJaccardMatcher=t.FixedWindowSizeJaccardMatcher=void 0;const r=n(4855),o=n(1016);class i extends o.WindowedMatcher{constructor(e,t){super(e),this.windowLength=t}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){const t=[],n=e.length;for(let e=0;0==e||e<n-this.windowLength;e++){const r=Math.min(e+this.windowLength,n);t.push([e,r])}return t}trimDocument(e){return e.source.slice(0,e.offset).split("\n").slice(-this.windowLength).join("\n")}similarityScore(e,t){return a(e,t)}}t.FixedWindowSizeJaccardMatcher=i,i.FACTORY=e=>({to:t=>new i(t,e)});class s extends o.WindowedMatcher{constructor(e,t,n){super(e),this.minLength=t,this.maxLength=n,this.languageId=e.languageId}id(){return`indent:${this.minLength}:${this.maxLength}:${this.languageId}`}getWindowsDelineations(e){return(0,r.getWindowsDelineations)(e,this.languageId,this.minLength,this.maxLength)}trimDocument(e){return e.source.slice(0,e.offset).split("\n").slice(-this.maxLength).join("\n")}similarityScore(e,t){return a(e,t)}}function a(e,t){const n=new Set;return e.forEach((e=>{t.has(e)&&n.add(e)})),n.size/(e.size+t.size-n.size)}t.IndentationBasedJaccardMatcher=s,s.FACTORY=(e,t)=>({to:n=>new s(n,e,t)}),t.computeScore=a},9931:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNeighborSnippets=t.neighborOptionToSelection=void 0;const r=n(1788),o=n(569);function i(e){return[e.relativePath?"Compare this snippet from "+e.relativePath+":":"Compare this snippet:"].concat(e.snippet.split("\n"))}t.neighborOptionToSelection={none:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(1),threshold:-1,numberOfNeighbors:0},conservative:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:.3,numberOfNeighbors:1},medium:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(20),threshold:.1,numberOfNeighbors:2},eager:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(60),threshold:0,numberOfNeighbors:4},eagerButLittle:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:0,numberOfNeighbors:1}},t.getNeighborSnippets=async function(e,n,s,a,c){const l=t.neighborOptionToSelection[s],u=function(e,n,r,i){const s={...t.neighborOptionToSelection[n]};return void 0!==r&&void 0!==i&&(s.matcherFactory=o.IndentationBasedJaccardMatcher.FACTORY(r,i)),s.matcherFactory.to(e)}(e,s,a,c);return n.filter((e=>e.source.length<1e4&&e.source.length>0)).slice(0,20).map((e=>({relativePath:e.relativePath,...u.findBestMatch(e)}))).filter((e=>e.score&&e.snippet&&e.score>l.threshold)).sort(((e,t)=>e.score-t.score)).slice(-l.numberOfNeighbors).map((t=>({score:t.score,snippet:i(t).map((t=>(0,r.comment)(t,e.languageId)+"\n")).join(""),startLine:t.startLine,endLine:t.endLine})))}},1016:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.splitIntoWords=t.WindowedMatcher=t.SortOptions=void 0,function(e){e.Ascending="ascending",e.Descending="descending",e.None="none"}(n=t.SortOptions||(t.SortOptions={}));class r{constructor(e){var t;this.stopsForLanguage=null!==(t=c.get(e.languageId))&&void 0!==t?t:a}tokenize(e){return new Set(i(e).filter((e=>!this.stopsForLanguage.has(e))))}}const o=new class{constructor(e){this.keys=[],this.cache={},this.size=e}put(e,t){var n;if(this.cache[e]=t,this.keys.length>this.size){this.keys.push(e);const t=null!==(n=this.keys.shift())&&void 0!==n?n:"";delete this.cache[t]}}get(e){return this.cache[e]}}(20);function i(e){return e.split(/[^a-zA-Z0-9]/).filter((e=>e.length>0))}t.WindowedMatcher=class{constructor(e){this.tokenizer=new r(e),this.referenceTokens=this.tokenizer.tokenize(this.trimDocument(e))}sortScoredSnippets(e,t=n.Descending){return t==n.Ascending?e.sort(((e,t)=>e.score>t.score?1:-1)):t==n.Descending?e.sort(((e,t)=>e.score>t.score?-1:1)):e}retrieveAllSnippets(e,t=n.Descending){var r;const i=[];if(0===e.source.length||0===this.referenceTokens.size)return i;const s=e.source.split("\n"),a=this.id()+":"+e.source,c=null!==(r=o.get(a))&&void 0!==r?r:[],l=0==c.length,u=l?s.map(this.tokenizer.tokenize,this.tokenizer):[];for(const[e,[t,n]]of this.getWindowsDelineations(s).entries()){if(l){const e=new Set;u.slice(t,n).forEach((t=>t.forEach(e.add,e))),c.push(e)}const r=c[e],o=this.similarityScore(r,this.referenceTokens);i.push({score:o,startLine:t,endLine:n})}return l&&o.put(a,c),this.sortScoredSnippets(i,t)}findBestMatch(e){if(0===e.source.length||0===this.referenceTokens.size)return;const t=e.source.split("\n"),r=this.retrieveAllSnippets(e,n.Descending);return 0!==r.length&&0!==r[0].score?{snippet:t.slice(r[0].startLine,r[0].endLine).join("\n"),...r[0]}:void 0}findTopKMatch(e,t=3){if(0===e.source.length||0===this.referenceTokens.size||t<1)return;const r=e.source.split("\n"),o=this.retrieveAllSnippets(e,n.Descending);if(0===o.length||0===o[0].score)return;const i=[o[0]];for(let e=1;e<o.length&&i.length<t;e++)-1==i.findIndex((t=>o[e].startLine<t.endLine&&o[e].endLine>t.startLine))&&i.push(o[e]);return i.map((e=>({snippet:r.slice(e.startLine,e.endLine).join("\n"),...e})))}},t.splitIntoWords=i;const s=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),a=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...s]),c=new Map([])},4431:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findEditDistanceScore=void 0,t.findEditDistanceScore=function(e,t){if(0===e.length||0===t.length)return{score:e.length+t.length};const n=Array.from({length:e.length}).map((()=>Array.from({length:t.length}).map((()=>0))));for(let t=0;t<e.length;t++)n[t][0]=t;for(let e=0;e<t.length;e++)n[0][e]=e;for(let r=0;r<t.length;r++)for(let o=0;o<e.length;o++)n[o][r]=Math.min((0==o?r:n[o-1][r])+1,(0==r?o:n[o][r-1])+1,(0==o||0==r?Math.max(o,r):n[o-1][r-1])+(e[o]==t[r]?0:1));return{score:n[e.length-1][t.length-1]}}},7408:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Priorities=t.PromptWishlist=t.PromptElementRanges=t.PromptChoices=t.PromptBackground=t.PromptElementKind=void 0;const r=n(1747),o=n(9852);var i;!function(e){e.BeforeCursor="BeforeCursor",e.AfterCursor="AfterCursor",e.SimilarFile="SimilarFile",e.ImportedFile="ImportedFile",e.LanguageMarker="LanguageMarker",e.PathMarker="PathMarker"}(i=t.PromptElementKind||(t.PromptElementKind={}));class s{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.IsNeighboringTab(e)&&this.used.set(e.id,this.convert(e))}undoMarkUsed(e){this.IsNeighboringTab(e)&&this.used.delete(e.id)}markUnused(e){this.IsNeighboringTab(e)&&this.unused.set(e.id,this.convert(e))}convert(e){return{score:e.score.toFixed(4),length:e.text.length}}IsNeighboringTab(e){return e.kind==i.SimilarFile}}t.PromptBackground=s;class a{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}undoMarkUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)-e.tokens)}markUnused(e){this.unused.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}}t.PromptChoices=a;class c{constructor(e){this.ranges=new Array;let t,n=0;for(const{element:r}of e)0!==r.text.length&&(t===i.BeforeCursor&&r.kind===i.BeforeCursor?this.ranges[this.ranges.length-1].end+=r.text.length:this.ranges.push({kind:r.kind,start:n,end:n+r.text.length}),t=r.kind,n+=r.text.length)}}t.PromptElementRanges=c,t.PromptWishlist=class{constructor(e){this.content=[],this.lineEndingOption=e}getContent(){return[...this.content]}convertLineEndings(e){return this.lineEndingOption===r.LineEndingOptions.ConvertToUnix&&(e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),e}append(e,t,n,r=(0,o.tokenLength)(e),i=NaN){e=this.convertLineEndings(e);const s=this.content.length;return this.content.push({id:s,text:e,kind:t,priority:n,tokens:r,requires:[],excludes:[],score:i}),s}appendLineForLine(e,t,n){const r=(e=this.convertLineEndings(e)).split("\n");for(let e=0;e<r.length-1;e++)r[e]+="\n";const o=[];r.forEach(((e,t)=>{"\n"===e&&o.length>0&&!o[o.length-1].endsWith("\n\n")?o[o.length-1]+="\n":o.push(e)}));const i=[];return o.forEach(((e,r)=>{""!==e&&(i.push(this.append(e,t,n)),r>0&&(this.content[this.content.length-2].requires=[this.content[this.content.length-1]]))})),i}require(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.requires.push(r)}exclude(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.excludes.push(r)}fulfill(e){const t=new a,n=new s,r=this.content.map(((e,t)=>({element:e,index:t})));r.sort(((e,t)=>e.element.priority===t.element.priority?t.index-e.index:t.element.priority-e.element.priority));const i=new Set,l=new Set;let u;const d=[];let p=e;r.forEach((e=>{var r;const o=e.element,s=e.index;if(p>=0&&(p>0||void 0===u)&&o.requires.every((e=>i.has(e.id)))&&!l.has(o.id)){let a=o.tokens;const c=null===(r=function(e,t){let n,r=1/0;for(const o of e)o.index>t&&o.index<r&&(n=o,r=o.index);return n}(d,s))||void 0===r?void 0:r.element;o.text.endsWith("\n\n")&&c&&!c.text.match(/^\s/)&&a++,p>=a?(p-=a,i.add(o.id),o.excludes.forEach((e=>l.add(e.id))),t.markUsed(o),n.markUsed(o),d.push(e)):u=null!=u?u:e}else t.markUnused(o),n.markUnused(o)})),d.sort(((e,t)=>e.index-t.index));let h=d.reduce(((e,t)=>e+t.element.text),""),f=(0,o.tokenLength)(h);for(;f>e;){d.sort(((e,t)=>t.element.priority===e.element.priority?t.index-e.index:t.element.priority-e.element.priority));const e=d.pop();e&&(t.undoMarkUsed(e.element),t.markUnused(e.element),n.undoMarkUsed(e.element),n.markUnused(e.element),u=void 0),d.sort(((e,t)=>e.index-t.index)),h=d.reduce(((e,t)=>e+t.element.text),""),f=(0,o.tokenLength)(h)}const m=[...d];if(void 0!==u){m.push(u),m.sort(((e,t)=>e.index-t.index));const r=m.reduce(((e,t)=>e+t.element.text),""),i=(0,o.tokenLength)(r);if(i<=e){t.markUsed(u.element),n.markUsed(u.element);const e=new c(m);return{prefix:r,suffix:"",prefixLength:i,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:e}}t.markUnused(u.element),n.markUnused(u.element)}const g=new c(d);return{prefix:h,suffix:"",prefixLength:f,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:g}}};class l{constructor(){this.registeredPriorities=[0,1]}register(e){if(e>l.TOP||e<l.BOTTOM)throw new Error("Priority must be between 0 and 1");return this.registeredPriorities.push(e),e}justAbove(...e){const t=Math.max(...e),n=Math.min(...this.registeredPriorities.filter((e=>e>t)));return this.register((n+t)/2)}justBelow(...e){const t=Math.min(...e),n=Math.max(...this.registeredPriorities.filter((e=>e<t)));return this.register((n+t)/2)}between(e,t){if(this.registeredPriorities.some((n=>n>e&&n<t))||!this.registeredPriorities.includes(e)||!this.registeredPriorities.includes(t))throw new Error("Priorities must be adjacent in the list of priorities");return this.register((e+t)/2)}}t.Priorities=l,l.TOP=1,l.BOTTOM=0},6149:(e,t,n)=>{e.exports=n(5468)},5468:(e,t,n)=>{"use strict";n(1808);var r,o=n(4404),i=n(3685),s=n(5687),a=n(2361),c=(n(9491),n(3837));function l(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||i.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",(function(e,n,r,o){for(var i=d(n,r,o),s=0,a=t.requests.length;s<a;++s){var c=t.requests[s];if(c.host===i.host&&c.port===i.port)return t.requests.splice(s,1),void c.request.onSocket(e)}e.destroy(),t.removeSocket(e)}))}function u(e,t){var n=this;l.prototype.createSocket.call(n,e,(function(r){var i=e.request.getHeader("host"),s=p({},n.options,{socket:r,servername:i?i.replace(/:.*$/,""):e.host}),a=o.connect(0,s);n.sockets[n.sockets.indexOf(r)]=a,t(a)}))}function d(e,t,n){return"string"==typeof e?{host:e,port:t,localAddress:n}:e}function p(e){for(var t=1,n=arguments.length;t<n;++t){var r=arguments[t];if("object"==typeof r)for(var o=Object.keys(r),i=0,s=o.length;i<s;++i){var a=o[i];void 0!==r[a]&&(e[a]=r[a])}}return e}t.httpOverHttp=function(e){var t=new l(e);return t.request=i.request,t},t.httpsOverHttp=function(e){var t=new l(e);return t.request=i.request,t.createSocket=u,t.defaultPort=443,t},t.httpOverHttps=function(e){var t=new l(e);return t.request=s.request,t},t.httpsOverHttps=function(e){var t=new l(e);return t.request=s.request,t.createSocket=u,t.defaultPort=443,t},c.inherits(l,a.EventEmitter),l.prototype.addRequest=function(e,t,n,r){var o=this,i=p({request:e},o.options,d(t,n,r));o.sockets.length>=this.maxSockets?o.requests.push(i):o.createSocket(i,(function(t){function n(){o.emit("free",t,i)}function r(e){o.removeSocket(t),t.removeListener("free",n),t.removeListener("close",r),t.removeListener("agentRemove",r)}t.on("free",n),t.on("close",r),t.on("agentRemove",r),e.onSocket(t)}))},l.prototype.createSocket=function(e,t){var n=this,o={};n.sockets.push(o);var i=p({},n.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(i.localAddress=e.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),r("making CONNECT request");var s=n.request(i);function a(i,a,c){var l;return s.removeAllListeners(),a.removeAllListeners(),200!==i.statusCode?(r("tunneling socket could not be established, statusCode=%d",i.statusCode),a.destroy(),(l=new Error("tunneling socket could not be established, statusCode="+i.statusCode)).code="ECONNRESET",e.request.emit("error",l),void n.removeSocket(o)):c.length>0?(r("got illegal response body from proxy"),a.destroy(),(l=new Error("got illegal response body from proxy")).code="ECONNRESET",e.request.emit("error",l),void n.removeSocket(o)):(r("tunneling connection has established"),n.sockets[n.sockets.indexOf(o)]=a,t(a))}s.useChunkedEncodingByDefault=!1,s.once("response",(function(e){e.upgrade=!0})),s.once("upgrade",(function(e,t,n){process.nextTick((function(){a(e,t,n)}))})),s.once("connect",a),s.once("error",(function(t){s.removeAllListeners(),r("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var i=new Error("tunneling socket could not be established, cause="+t.message);i.code="ECONNRESET",e.request.emit("error",i),n.removeSocket(o)})),s.end()},l.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var n=this.requests.shift();n&&this.createSocket(n,(function(e){n.request.onSocket(e)}))}},r=process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},t.debug=r},540:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t.length>1){t[0]=t[0].slice(0,-1);for(var r=t.length-1,o=1;o<r;++o)t[o]=t[o].slice(1,-1);return t[r]=t[r].slice(1),t.join("")}return t[0]}function n(e){return"(?:"+e+")"}function r(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function i(e){var r="[A-Za-z]",o="[0-9]",i=t(o,"[A-Fa-f]"),s=n(n("%[EFef]"+i+"%"+i+i+"%"+i+i)+"|"+n("%[89A-Fa-f]"+i+"%"+i+i)+"|"+n("%"+i+i)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",a),l=e?"[\\uE000-\\uF8FF]":"[]",u=t(r,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),d=n(r+t(r,o,"[\\+\\-\\.]")+"*"),p=n(n(s+"|"+t(u,a,"[\\:]"))+"*"),h=(n(n("25[0-5]")+"|"+n("2[0-4][0-9]")+"|"+n("1[0-9][0-9]")+"|"+n("[1-9][0-9]")+"|"+o),n(n("25[0-5]")+"|"+n("2[0-4][0-9]")+"|"+n("1[0-9][0-9]")+"|"+n("0?[1-9][0-9]")+"|0?0?"+o)),f=n(h+"\\."+h+"\\."+h+"\\."+h),m=n(i+"{1,4}"),g=n(n(m+"\\:"+m)+"|"+f),_=n(n(m+"\\:")+"{6}"+g),y=n("\\:\\:"+n(m+"\\:")+"{5}"+g),v=n(n(m)+"?\\:\\:"+n(m+"\\:")+"{4}"+g),b=n(n(n(m+"\\:")+"{0,1}"+m)+"?\\:\\:"+n(m+"\\:")+"{3}"+g),w=n(n(n(m+"\\:")+"{0,2}"+m)+"?\\:\\:"+n(m+"\\:")+"{2}"+g),x=n(n(n(m+"\\:")+"{0,3}"+m)+"?\\:\\:"+m+"\\:"+g),E=n(n(n(m+"\\:")+"{0,4}"+m)+"?\\:\\:"+g),C=n(n(n(m+"\\:")+"{0,5}"+m)+"?\\:\\:"+m),S=n(n(n(m+"\\:")+"{0,6}"+m)+"?\\:\\:"),T=n([_,y,v,b,w,x,E,C,S].join("|")),k=n(n(u+"|"+s)+"+"),I=(n(T+"\\%25"+k),n(T+n("\\%25|\\%(?!"+i+"{2})")+k)),P=n("[vV]"+i+"+\\."+t(u,a,"[\\:]")+"+"),A=n("\\["+n(I+"|"+T+"|"+P)+"\\]"),O=n(n(s+"|"+t(u,a))+"*"),N=n(A+"|"+f+"(?!"+O+")|"+O),R=n("[0-9]*"),M=n(n(p+"@")+"?"+N+n("\\:"+R)+"?"),L=n(s+"|"+t(u,a,"[\\:\\@]")),$=n(L+"*"),D=n(L+"+"),F=n(n(s+"|"+t(u,a,"[\\@]"))+"+"),j=n(n("\\/"+$)+"*"),q=n("\\/"+n(D+j)+"?"),B=n(F+j),U=n(D+j),H="(?!"+L+")",z=(n(j+"|"+q+"|"+B+"|"+U+"|"+H),n(n(L+"|"+t("[\\/\\?]",l))+"*")),W=n(n(L+"|[\\/\\?]")+"*"),V=n(n("\\/\\/"+M+j)+"|"+q+"|"+U+"|"+H),G=n(d+"\\:"+V+n("\\?"+z)+"?"+n("\\#"+W)+"?"),K=n(n("\\/\\/"+M+j)+"|"+q+"|"+B+"|"+H),J=n(K+n("\\?"+z)+"?"+n("\\#"+W)+"?");return n(G+"|"+J),n(d+"\\:"+V+n("\\?"+z)+"?"),n(n("\\/\\/("+n("("+p+")@")+"?("+N+")"+n("\\:("+R+")")+"?)")+"?("+j+"|"+q+"|"+U+"|"+H+")"),n("\\?("+z+")"),n("\\#("+W+")"),n(n("\\/\\/("+n("("+p+")@")+"?("+N+")"+n("\\:("+R+")")+"?)")+"?("+j+"|"+q+"|"+B+"|"+H+")"),n("\\?("+z+")"),n("\\#("+W+")"),n(n("\\/\\/("+n("("+p+")@")+"?("+N+")"+n("\\:("+R+")")+"?)")+"?("+j+"|"+q+"|"+U+"|"+H+")"),n("\\?("+z+")"),n("\\#("+W+")"),n("("+p+")@"),n("\\:("+R+")"),{NOT_SCHEME:new RegExp(t("[^]",r,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",u,a),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",u,a),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",u,a),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",u,a),"g"),NOT_QUERY:new RegExp(t("[^\\%]",u,a,"[\\:\\@\\/\\?]",l),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",u,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",u,a),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",u,c),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+T+")"+n(n("\\%25|\\%(?!"+i+"{2})")+"("+k+")")+"?\\]?$")}}var s=i(!1),a=i(!0),c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},l=2147483647,u=36,d=/^xn--/,p=/[^\0-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function _(e){throw new RangeError(f[e])}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+function(e,t){for(var n=[],r=e.length;r--;)n[r]=t(e[r]);return n}((e=e.replace(h,".")).split("."),t).join(".")}function v(e){for(var t=[],n=0,r=e.length;n<r;){var o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){var i=e.charCodeAt(n++);56320==(64512&i)?t.push(((1023&o)<<10)+(1023&i)+65536):(t.push(o),n--)}else t.push(o)}return t}var b=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},w=function(e,t,n){var r=0;for(e=n?m(e/700):e>>1,e+=m(e/t);e>455;r+=u)e=m(e/35);return m(r+36*e/(e+38))},x=function(e){var t,n=[],r=e.length,o=0,i=128,s=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var c=0;c<a;++c)e.charCodeAt(c)>=128&&_("not-basic"),n.push(e.charCodeAt(c));for(var d=a>0?a+1:0;d<r;){for(var p=o,h=1,f=u;;f+=u){d>=r&&_("invalid-input");var g=(t=e.charCodeAt(d++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:u;(g>=u||g>m((l-o)/h))&&_("overflow"),o+=g*h;var y=f<=s?1:f>=s+26?26:f-s;if(g<y)break;var v=u-y;h>m(l/v)&&_("overflow"),h*=v}var b=n.length+1;s=w(o-p,b,0==p),m(o/b)>l-i&&_("overflow"),i+=m(o/b),o%=b,n.splice(o++,0,i)}return String.fromCodePoint.apply(String,n)},E=function(e){var t=[],n=(e=v(e)).length,r=128,o=0,i=72,s=!0,a=!1,c=void 0;try{for(var d,p=e[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;h<128&&t.push(g(h))}}catch(e){a=!0,c=e}finally{try{!s&&p.return&&p.return()}finally{if(a)throw c}}var f=t.length,y=f;for(f&&t.push("-");y<n;){var x=l,E=!0,C=!1,S=void 0;try{for(var T,k=e[Symbol.iterator]();!(E=(T=k.next()).done);E=!0){var I=T.value;I>=r&&I<x&&(x=I)}}catch(e){C=!0,S=e}finally{try{!E&&k.return&&k.return()}finally{if(C)throw S}}var P=y+1;x-r>m((l-o)/P)&&_("overflow"),o+=(x-r)*P,r=x;var A=!0,O=!1,N=void 0;try{for(var R,M=e[Symbol.iterator]();!(A=(R=M.next()).done);A=!0){var L=R.value;if(L<r&&++o>l&&_("overflow"),L==r){for(var $=o,D=u;;D+=u){var F=D<=i?1:D>=i+26?26:D-i;if($<F)break;var j=$-F,q=u-F;t.push(g(b(F+j%q,0))),$=m(j/q)}t.push(g(b($,0))),i=w(o,P,y==f),o=0,++y}}}catch(e){O=!0,N=e}finally{try{!A&&M.return&&M.return()}finally{if(O)throw N}}++o,++r}return t.join("")},C=function(e){return y(e,(function(e){return p.test(e)?"xn--"+E(e):e}))},S=function(e){return y(e,(function(e){return d.test(e)?x(e.slice(4).toLowerCase()):e}))},T={};function k(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function I(e){for(var t="",n=0,r=e.length;n<r;){var o=parseInt(e.substr(n+1,2),16);if(o<128)t+=String.fromCharCode(o),n+=3;else if(o>=194&&o<224){if(r-n>=6){var i=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&o)<<6|63&i)}else t+=e.substr(n,6);n+=6}else if(o>=224){if(r-n>=9){var s=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&o)<<12|(63&s)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function P(e,t){function n(e){var n=I(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,k).replace(t.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,k).replace(t.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,k).replace(t.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,k).replace(t.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,k).replace(t.PCT_ENCODED,o)),e}function A(e){return e.replace(/^0*(.*)/,"$1")||"0"}function O(e,t){var n=e.match(t.IPV4ADDRESS)||[],r=c(n,2)[1];return r?r.split(".").map(A).join("."):e}function N(e,t){var n=e.match(t.IPV6ADDRESS)||[],r=c(n,3),o=r[1],i=r[2];if(o){for(var s=o.toLowerCase().split("::").reverse(),a=c(s,2),l=a[0],u=a[1],d=u?u.split(":").map(A):[],p=l.split(":").map(A),h=t.IPV4ADDRESS.test(p[p.length-1]),f=h?7:8,m=p.length-f,g=Array(f),_=0;_<f;++_)g[_]=d[_]||p[m+_]||"";h&&(g[f-1]=O(g[f-1],t));var y=g.reduce((function(e,t,n){if(!t||"0"===t){var r=e[e.length-1];r&&r.index+r.length===n?r.length++:e.push({index:n,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],v=void 0;if(y&&y.length>1){var b=g.slice(0,y.index),w=g.slice(y.index+y.length);v=b.join(":")+"::"+w.join(":")}else v=g.join(":");return i&&(v+="%"+i),v}return e}var R=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,M=void 0==="".match(/(){0}/)[1];function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==t.iri?a:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var o=e.match(R);if(o){M?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||void 0,n.userinfo=-1!==e.indexOf("@")?o[3]:void 0,n.host=-1!==e.indexOf("//")?o[4]:void 0,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:void 0,n.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),n.host&&(n.host=N(O(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var i=T[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)P(n,r);else{if(n.host&&(t.domainHost||i&&i.domainHost))try{n.host=C(n.host.replace(r.PCT_ENCODED,I).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}P(n,s)}i&&i.parse&&i.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}function $(e,t){var n=!1!==t.iri?a:s,r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(N(O(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}var D=/^\.\.?\//,F=/^\/\.(\/|$)/,j=/^\/\.\.(\/|$)/,q=/^\/?(?:.|\n)*?(?=\/|$)/;function B(e){for(var t=[];e.length;)if(e.match(D))e=e.replace(D,"");else if(e.match(F))e=e.replace(F,"/");else if(e.match(j))e=e.replace(j,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(q);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];e=e.slice(r.length),t.push(r)}return t.join("")}function U(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?a:s,r=[],o=T[(t.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||o&&o.domainHost)try{e.host=t.iri?S(e.host):C(e.host.replace(n.PCT_ENCODED,I).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}P(e,n),"suffix"!==t.reference&&e.scheme&&(r.push(e.scheme),r.push(":"));var i=$(e,t);if(void 0!==i&&("suffix"!==t.reference&&r.push("//"),r.push(i),e.path&&"/"!==e.path.charAt(0)&&r.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||o&&o.absolutePath||(c=B(c)),void 0===i&&(c=c.replace(/^\/\//,"/%2F")),r.push(c)}return void 0!==e.query&&(r.push("?"),r.push(e.query)),void 0!==e.fragment&&(r.push("#"),r.push(e.fragment)),r.join("")}function H(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return arguments[3]||(e=L(U(e,n),n),t=L(U(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=B(t.path||""),r.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=B(t.path||""),r.query=t.query):(t.path?("/"===t.path.charAt(0)?r.path=B(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path:r.path="/"+t.path,r.path=B(r.path)),r.query=t.query):(r.path=e.path,void 0!==t.query?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function z(e,t){return e&&e.toString().replace(t&&t.iri?a.PCT_ENCODED:s.PCT_ENCODED,I)}var W={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},V={scheme:"https",domainHost:W.domainHost,parse:W.parse,serialize:W.serialize};function G(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var K={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=G(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(G(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),r=c(n,2),o=r[0],i=r[1];e.path=o&&"/"!==o?o:void 0,e.query=i,e.resourceName=void 0}return e.fragment=void 0,e}},J={scheme:"wss",domainHost:K.domainHost,parse:K.parse,serialize:K.serialize},X={},Q="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",Z=n(n("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+n("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+n("%"+Y+Y)),ee=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),te=new RegExp(Q,"g"),ne=new RegExp(Z,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ee),"g"),oe=new RegExp(t("[^]",Q,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ie=oe;function se(e){var t=I(e);return t.match(te)?t:e}var ae={scheme:"mailto",parse:function(e,t){var n=e,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var o=!1,i={},s=n.query.split("&"),a=0,c=s.length;a<c;++a){var l=s[a].split("=");switch(l[0]){case"to":for(var u=l[1].split(","),d=0,p=u.length;d<p;++d)r.push(u[d]);break;case"subject":n.subject=z(l[1],t);break;case"body":n.body=z(l[1],t);break;default:o=!0,i[z(l[0],t)]=z(l[1],t)}}o&&(n.headers=i)}n.query=void 0;for(var h=0,f=r.length;h<f;++h){var m=r[h].split("@");if(m[0]=z(m[0]),t.unicodeSupport)m[1]=z(m[1],t).toLowerCase();else try{m[1]=C(z(m[1],t).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}r[h]=m.join("@")}return n},serialize:function(e,t){var n,r=e,i=null!=(n=e.to)?n instanceof Array?n:"number"!=typeof n.length||n.split||n.setInterval||n.call?[n]:Array.prototype.slice.call(n):[];if(i){for(var s=0,a=i.length;s<a;++s){var c=String(i[s]),l=c.lastIndexOf("@"),u=c.slice(0,l).replace(ne,se).replace(ne,o).replace(re,k),d=c.slice(l+1);try{d=t.iri?S(d):C(z(d,t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}i[s]=u+"@"+d}r.path=i.join(",")}var p=e.headers=e.headers||{};e.subject&&(p.subject=e.subject),e.body&&(p.body=e.body);var h=[];for(var f in p)p[f]!==X[f]&&h.push(f.replace(ne,se).replace(ne,o).replace(oe,k)+"="+p[f].replace(ne,se).replace(ne,o).replace(ie,k));return h.length&&(r.query=h.join("&")),r}},ce=/^([^\:]+)\:(.*)/,le={scheme:"urn",parse:function(e,t){var n=e.path&&e.path.match(ce),r=e;if(n){var o=t.scheme||r.scheme||"urn",i=n[1].toLowerCase(),s=n[2],a=o+":"+(t.nid||i),c=T[a];r.nid=i,r.nss=s,r.path=void 0,c&&(r=c.parse(r,t))}else r.error=r.error||"URN can not be parsed.";return r},serialize:function(e,t){var n=t.scheme||e.scheme||"urn",r=e.nid,o=n+":"+(t.nid||r),i=T[o];i&&(e=i.serialize(e,t));var s=e,a=e.nss;return s.path=(r||t.nid)+":"+a,s}},ue=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,de={scheme:"urn:uuid",parse:function(e,t){var n=e;return n.uuid=n.nss,n.nss=void 0,t.tolerant||n.uuid&&n.uuid.match(ue)||(n.error=n.error||"UUID is not valid."),n},serialize:function(e,t){var n=e;return n.nss=(e.uuid||"").toLowerCase(),n}};T[W.scheme]=W,T[V.scheme]=V,T[K.scheme]=K,T[J.scheme]=J,T[ae.scheme]=ae,T[le.scheme]=le,T[de.scheme]=de,e.SCHEMES=T,e.pctEncChar=k,e.pctDecChars=I,e.parse=L,e.removeDotSegments=B,e.serialize=U,e.resolveComponents=H,e.resolve=function(e,t,n){var r=function(e,t){var n=e;if(t)for(var r in t)n[r]=t[r];return n}({scheme:"null"},n);return U(H(L(e,r),L(t,r),r,!0),r)},e.normalize=function(e,t){return"string"==typeof e?e=U(L(e,t),t):"object"===r(e)&&(e=L(U(e,t),t)),e},e.equal=function(e,t,n){return"string"==typeof e?e=U(L(e,n),n):"object"===r(e)&&(e=U(e,n)),"string"==typeof t?t=U(L(t,n),n):"object"===r(t)&&(t=U(t,n)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?a.ESCAPE:s.ESCAPE,k)},e.unescapeComponent=z,Object.defineProperty(e,"__esModule",{value:!0})}(t)},2277:(e,t,n)=>{"use strict";n.r(t),n.d(t,{NIL:()=>x,parse:()=>_,stringify:()=>d,v1:()=>g,v3:()=>v,v4:()=>b,v5:()=>w,validate:()=>l,version:()=>E});var r=n(6113),o=n.n(r);const i=new Uint8Array(256);let s=i.length;function a(){return s>i.length-16&&(o().randomFillSync(i),s=0),i.slice(s,s+=16)}const c=/^(?:[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,l=function(e){return"string"==typeof e&&c.test(e)},u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).substr(1));const d=function(e,t=0){const n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};let p,h,f=0,m=0;const g=function(e,t,n){let r=t&&n||0;const o=t||new Array(16);let i=(e=e||{}).node||p,s=void 0!==e.clockseq?e.clockseq:h;if(null==i||null==s){const t=e.random||(e.rng||a)();null==i&&(i=p=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==s&&(s=h=16383&(t[6]<<8|t[7]))}let c=void 0!==e.msecs?e.msecs:Date.now(),l=void 0!==e.nsecs?e.nsecs:m+1;const u=c-f+(l-m)/1e4;if(u<0&&void 0===e.clockseq&&(s=s+1&16383),(u<0||c>f)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=c,m=l,h=s,c+=122192928e5;const g=(1e4*(268435455&c)+l)%4294967296;o[r++]=g>>>24&255,o[r++]=g>>>16&255,o[r++]=g>>>8&255,o[r++]=255&g;const _=c/4294967296*1e4&268435455;o[r++]=_>>>8&255,o[r++]=255&_,o[r++]=_>>>24&15|16,o[r++]=_>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(let e=0;e<6;++e)o[r+e]=i[e];return t||d(o)},_=function(e){if(!l(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function y(e,t,n){function r(e,r,o,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=_(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+e.length);if(s.set(r),s.set(e,r.length),s=n(s),s[6]=15&s[6]|t,s[8]=63&s[8]|128,o){i=i||0;for(let e=0;e<16;++e)o[i+e]=s[e];return o}return d(s)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}const v=y("v3",48,(function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),o().createHash("md5").update(e).digest()})),b=function(e,t,n){const r=(e=e||{}).random||(e.rng||a)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return d(r)},w=y("v5",80,(function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),o().createHash("sha1").update(e).digest()})),x="00000000-0000-0000-0000-000000000000",E=function(e){if(!l(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},4398:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL=!0;var r=n(7147),o=n(2037),i=n(1017),s=n(9496),a=n(9574),c=function(){function e(e,t,n,o){var a=this;this.extensionId=e,this.extensionVersion=t,this.firstParty=!1,this.userOptIn=!1,this.firstParty=!!o;var c=process.env.VSCODE_LOGS||"";c&&e&&"trace"===process.env.VSCODE_LOG_LEVEL&&(c=i.join(c,e+".txt"),this.logStream=r.createWriteStream(c,{flags:"a",encoding:"utf8",autoClose:!0})),this.updateUserOptIn(n),void 0!==s.env.onDidChangeTelemetryEnabled?this.optOutListener=s.env.onDidChangeTelemetryEnabled((function(){return a.updateUserOptIn(n)})):this.optOutListener=s.workspace.onDidChangeConfiguration((function(){return a.updateUserOptIn(n)}))}return e.prototype.updateUserOptIn=function(t){var n=s.workspace.getConfiguration(e.TELEMETRY_CONFIG_ID),r=void 0===s.env.isTelemetryEnabled?n.get(e.TELEMETRY_CONFIG_ENABLED_ID,!0):s.env.isTelemetryEnabled;this.userOptIn!==r&&(this.userOptIn=r,this.userOptIn?this.createAppInsightsClient(t):this.dispose())},e.prototype.createAppInsightsClient=function(e){a.defaultClient?(this.appInsightsClient=new a.TelemetryClient(e),this.appInsightsClient.channel.setUseDiskRetryCaching(!0)):(a.setup(e).setAutoCollectRequests(!1).setAutoCollectPerformance(!1).setAutoCollectExceptions(!1).setAutoCollectDependencies(!1).setAutoDependencyCorrelation(!1).setAutoCollectConsole(!1).setUseDiskRetryCaching(!0).start(),this.appInsightsClient=a.defaultClient),this.appInsightsClient.commonProperties=this.getCommonProperties(),s&&s.env&&(this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.userId]=s.env.machineId,this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.sessionId]=s.env.sessionId),e&&0===e.indexOf("AIF-")&&(this.appInsightsClient.config.endpointUrl="https://vortex.data.microsoft.com/collect/v1",this.firstParty=!0)},e.prototype.getCommonProperties=function(){var e=Object.create(null);if(e["common.os"]=o.platform(),e["common.platformversion"]=(o.release()||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),e["common.extname"]=this.extensionId,e["common.extversion"]=this.extensionVersion,s&&s.env){switch(e["common.vscodemachineid"]=s.env.machineId,e["common.vscodesessionid"]=s.env.sessionId,e["common.vscodeversion"]=s.version,e["common.isnewappinstall"]=s.env.isNewAppInstall,s.env.uiKind){case s.UIKind.Web:e["common.uikind"]="web";break;case s.UIKind.Desktop:e["common.uikind"]="desktop";break;default:e["common.uikind"]="unknown"}e["common.remotename"]=this.cleanRemoteName(s.env.remoteName)}return e},e.prototype.cleanRemoteName=function(e){if(!e)return"none";var t="other";return["ssh-remote","dev-container","attached-container","wsl"].forEach((function(n){0===e.indexOf(n+"+")&&(t=n)})),t},e.prototype.shouldSendErrorTelemetry=function(){return!this.firstParty||"other"!==this.cleanRemoteName(s.env.remoteName)||void 0!==this.extension&&this.extension.extensionKind!==s.ExtensionKind.Workspace&&s.env.uiKind!==s.UIKind.Web},Object.defineProperty(e.prototype,"extension",{get:function(){return void 0===this._extension&&(this._extension=s.extensions.getExtension(this.extensionId)),this._extension},enumerable:!1,configurable:!0}),e.prototype.cloneAndChange=function(e,t){if(null===e||"object"!=typeof e)return e;if("function"!=typeof t)return e;var n={};for(var r in e)n[r]=t(r,e[r]);return n},e.prototype.anonymizeFilePaths=function(e,t){if(null==e)return"";var n=[new RegExp(s.env.appRoot.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi")];this.extension&&n.push(new RegExp(this.extension.extensionPath.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi"));var r=e;if(t){for(var o=[],i=0,a=n;i<a.length;i++)for(var c=a[i];;){var l=c.exec(e);if(!l)break;o.push([l.index,c.lastIndex])}var u=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,d=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g,p=0;r="";for(var h=function(){var t=d.exec(e);if(!t)return"break";!u.test(t[0])&&o.every((function(e){var n=e[0],r=e[1];return t.index<n||t.index>=r}))&&(r+=e.substring(p,t.index)+"<REDACTED: user-file-path>",p=d.lastIndex)};"break"!==h(););p<e.length&&(r+=e.substr(p))}for(var f=0,m=n;f<m.length;f++)c=m[f],r=r.replace(c,"");return r},e.prototype.sendTelemetryEvent=function(e,t,n){var r=this;if(this.userOptIn&&e&&this.appInsightsClient){var o=this.cloneAndChange(t,(function(e,t){return r.anonymizeFilePaths(t,r.firstParty)}));this.appInsightsClient.trackEvent({name:this.extensionId+"/"+e,properties:o,measurements:n}),this.logStream&&this.logStream.write("telemetry/"+e+" "+JSON.stringify({properties:t,measurements:n})+"\n")}},e.prototype.sendTelemetryErrorEvent=function(e,t,n,r){var o=this;if(this.userOptIn&&e&&this.appInsightsClient){var i=this.cloneAndChange(t,(function(e,t){return o.shouldSendErrorTelemetry()?o.anonymizeFilePaths(t,o.firstParty):void 0===r||-1!==r.indexOf(e)?"REDACTED":o.anonymizeFilePaths(t,o.firstParty)}));this.appInsightsClient.trackEvent({name:this.extensionId+"/"+e,properties:i,measurements:n}),this.logStream&&this.logStream.write("telemetry/"+e+" "+JSON.stringify({properties:t,measurements:n})+"\n")}},e.prototype.sendTelemetryException=function(e,t,n){var r=this;if(this.shouldSendErrorTelemetry()&&this.userOptIn&&e&&this.appInsightsClient){var o=this.cloneAndChange(t,(function(e,t){return r.anonymizeFilePaths(t,r.firstParty)}));this.appInsightsClient.trackException({exception:e,properties:o,measurements:n}),this.logStream&&this.logStream.write("telemetry/"+e.name+" "+e.message+" "+JSON.stringify({properties:t,measurements:n})+"\n")}},e.prototype.dispose=function(){var e=this;this.optOutListener.dispose();var t=new Promise((function(t){if(!e.logStream)return t(void 0);e.logStream.on("finish",t),e.logStream.end()})),n=new Promise((function(t){e.appInsightsClient?e.appInsightsClient.flush({callback:function(){e.appInsightsClient=void 0,t(void 0)}}):t(void 0)}));return Promise.all([n,t])},e.TELEMETRY_CONFIG_ID="telemetry",e.TELEMETRY_CONFIG_ENABLED_ID="enableTelemetry",e}();t.default=c},7373:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{URI:()=>o,Utils:()=>i}),r=(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",o=0,i=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(r.length<2||2!==o||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",o=0):o=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),i=a,s=0;continue}}else if(2===r.length||1===r.length){r="",o=0,i=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",o=2)}else r.length>0?r+="/"+e.slice(i+1,a):r=e.slice(i+1,a),o=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var s;i>=0?s=arguments[i]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,o=47===s.charCodeAt(0))}return r=n(r,!o),o?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&o&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var o=arguments[n];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var i=e.length,s=i-o,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var c=n.length-a,l=s<c?s:c,u=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else s>l&&(47===e.charCodeAt(o+d)?u=d:0===d&&(u=0));break}var p=e.charCodeAt(o+d);if(p!==n.charCodeAt(a+d))break;47===p&&(u=d)}var h="";for(d=o+u+1;d<=i;++d)d!==i&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(a+u):(a+=u,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?r?"/":".":r&&1===o?"//":e.slice(0,o)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,o=0,i=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(47===l){if(!s){o=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(l===n.charCodeAt(a)?-1==--a&&(i=r):(a=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){o=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var n=-1,r=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===o&&(i=!1,o=a+1),46===c?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!i){r=a+1;break}}return-1===n||-1===o||0===s||1===s&&n===o-1&&n===r+1?"":e.slice(n,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,o=e.charCodeAt(0),i=47===o;i?(n.root="/",r=1):r=0;for(var s=-1,a=0,c=-1,l=!0,u=e.length-1,d=0;u>=r;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===s?s=u:1!==d&&(d=1):-1!==s&&(d=-1);else if(!l){a=u+1;break}return-1===s||-1===c||0===d||1===d&&s===c-1&&s===a+1?-1!==c&&(n.base=n.name=0===a&&i?e.slice(1,c):e.slice(a,c)):(0===a&&i?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(a,s),n.base=e.slice(a,c)),n.ext=e.slice(s,c)),a>0?n.dir=e.slice(0,a-1):i&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},447:(e,t,n)=>{var r;if(n.r(t),n.d(t,{URI:()=>f,Utils:()=>S}),"object"==typeof process)r="win32"===process.platform;else if("object"==typeof navigator){var o=navigator.userAgent;r=o.indexOf("Windows")>=0}var i,s,a=(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=/^\w[\w\d+.-]*$/,l=/^\//,u=/^\/\//,d="",p="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,f=function(){function e(e,t,n,r,o,i){void 0===i&&(i=!1),"object"==typeof e?(this.scheme=e.scheme||d,this.authority=e.authority||d,this.path=e.path||d,this.query=e.query||d,this.fragment=e.fragment||d):(this.scheme=function(e,t){return e||t?e:"file"}(e,i),this.authority=t||d,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==p&&(t=p+t):t=p}return t}(this.scheme,n||d),this.query=r||d,this.fragment=o||d,function(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!c.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!l.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,i))}return e.isUri=function(t){return t instanceof e||!!t&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"function"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString},Object.defineProperty(e.prototype,"fsPath",{get:function(){return b(this,!1)},enumerable:!1,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,o=e.query,i=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=d),void 0===n?n=this.authority:null===n&&(n=d),void 0===r?r=this.path:null===r&&(r=d),void 0===o?o=this.query:null===o&&(o=d),void 0===i?i=this.fragment:null===i&&(i=d),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&i===this.fragment?this:new g(t,n,r,o,i)},e.parse=function(e,t){void 0===t&&(t=!1);var n=h.exec(e);return n?new g(n[2]||d,C(n[4]||d),C(n[5]||d),C(n[7]||d),C(n[9]||d),t):new g(d,d,d,d,d)},e.file=function(e){var t=d;if(r&&(e=e.replace(/\\/g,p)),e[0]===p&&e[1]===p){var n=e.indexOf(p,2);-1===n?(t=e.substring(2),e=p):(t=e.substring(2,n),e=e.substring(n)||p)}return new g("file",t,e,d,d)},e.from=function(e){return new g(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),w(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new g(t);return n._formatted=t.external,n._fsPath=t._sep===m?t.fsPath:null,n}return t},e}(),m=r?1:void 0,g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return a(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=m),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(f),_=((s={})[58]="%3A",s[47]="%2F",s[63]="%3F",s[35]="%23",s[91]="%5B",s[93]="%5D",s[64]="%40",s[33]="%21",s[36]="%24",s[38]="%26",s[39]="%27",s[40]="%28",s[41]="%29",s[42]="%2A",s[43]="%2B",s[44]="%2C",s[59]="%3B",s[61]="%3D",s[32]="%20",s);function y(e,t){for(var n=void 0,r=-1,o=0;o<e.length;o++){var i=e.charCodeAt(o);if(i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57||45===i||46===i||95===i||126===i||t&&47===i)-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));var s=_[i];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),n+=s):-1===r&&(r=o)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function v(e){for(var t=void 0,n=0;n<e.length;n++){var r=e.charCodeAt(n);35===r||63===r?(void 0===t&&(t=e.substr(0,n)),t+=_[r]):void 0!==t&&(t+=e[n])}return void 0!==t?t:e}function b(e,t){var n;return n=e.authority&&e.path.length>1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,r&&(n=n.replace(/\//g,"\\")),n}function w(e,t){var n=t?v:y,r="",o=e.scheme,i=e.authority,s=e.path,a=e.query,c=e.fragment;if(o&&(r+=o,r+=":"),(i||"file"===o)&&(r+=p,r+=p),i){var l=i.indexOf("@");if(-1!==l){var u=i.substr(0,l);i=i.substr(l+1),-1===(l=u.indexOf(":"))?r+=n(u,!1):(r+=n(u.substr(0,l),!1),r+=":",r+=n(u.substr(l+1),!1)),r+="@"}-1===(l=(i=i.toLowerCase()).indexOf(":"))?r+=n(i,!1):(r+=n(i.substr(0,l),!1),r+=i.substr(l))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(d=s.charCodeAt(1))>=65&&d<=90&&(s="/"+String.fromCharCode(d+32)+":"+s.substr(3));else if(s.length>=2&&58===s.charCodeAt(1)){var d;(d=s.charCodeAt(0))>=65&&d<=90&&(s=String.fromCharCode(d+32)+":"+s.substr(2))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),c&&(r+="#",r+=t?c:y(c,!1)),r}function x(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+x(e.substr(3)):e}}var E=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function C(e){return e.match(E)?e.replace(E,(function(e){return x(e)})):e}var S,T=n(470),k=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},I=T.posix||T;!function(e){e.joinPath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.with({path:I.join.apply(I,k([e.path],t))})},e.resolvePath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=e.path||"/";return e.with({path:I.resolve.apply(I,k([r],t))})},e.dirname=function(e){var t=I.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)?e:e.with({path:t})},e.basename=function(e){return I.basename(e.path)},e.extname=function(e){return I.extname(e.path)}}(S||(S={}))}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(447)})();const{URI:o,Utils:i}=r},4087:(e,t,n)=>{var r,o=void 0!==o?o:{};void 0===(r=function(){var t,r={};for(t in o)o.hasOwnProperty(t)&&(r[t]=o[t]);var i,s,a=[],c="./this.program",l=function(e,t){throw t},u=!1,d=!1;u="object"==typeof window,d="function"==typeof importScripts,i="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,s=!u&&!i&&!d;var p,h,f,m,g,_="";i?(_=d?n(1017).dirname(_)+"/":__dirname+"/",p=function(e,t){return m||(m=n(7147)),g||(g=n(1017)),e=g.normalize(e),m.readFileSync(e,t?null:"utf8")},f=function(e){var t=p(e,!0);return t.buffer||(t=new Uint8Array(t)),O(t.buffer),t},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),e.exports=o,l=function(e){process.exit(e)},o.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(p=function(e){return read(e)}),f=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(O("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(l=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||d)&&(d?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.lastIndexOf("/")+1):"",p=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}),o.print||console.log.bind(console);var y=o.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(o[t]=r[t]);r=null,o.arguments&&(a=o.arguments),o.thisProgram&&(c=o.thisProgram),o.quit&&(l=o.quit);var v,b=16,w=[];function x(e,t){if(!v){v=new WeakMap;for(var n=0;n<J.length;n++){var r=J.get(n);r&&v.set(r,n)}}if(v.has(e))return v.get(e);var o=function(){if(w.length)return w.pop();try{J.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return J.length-1}();try{J.set(o,e)}catch(n){if(!(n instanceof TypeError))throw n;var i=function(e,t){if("function"==typeof WebAssembly.Function){for(var n={i:"i32",j:"i64",f:"f32",d:"f64"},r={parameters:[],results:"v"==t[0]?[]:[n[t[0]]]},o=1;o<t.length;++o)r.parameters.push(n[t[o]]);return new WebAssembly.Function(r,e)}var i=[1,0,1,96],s=t.slice(0,1),a=t.slice(1),c={i:127,j:126,f:125,d:124};for(i.push(a.length),o=0;o<a.length;++o)i.push(c[a[o]]);"v"==s?i.push(0):i=i.concat([1,c[s]]),i[1]=i.length-2;var l=new Uint8Array([0,97,115,109,1,0,0,0].concat(i,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0])),u=new WebAssembly.Module(l);return new WebAssembly.Instance(u,{e:{f:e}}).exports.f}(e,t);J.set(o,i)}return v.set(e,o),o}var E,C=function(e){},S=o.dynamicLibraries||[];o.wasmBinary&&(E=o.wasmBinary);var T,k=o.noExitRuntime||!0;function I(e,t,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":R[e>>0]=t;break;case"i16":L[e>>1]=t;break;case"i32":$[e>>2]=t;break;case"i64":pe=[t>>>0,(de=t,+Math.abs(de)>=1?de>0?(0|Math.min(+Math.floor(de/4294967296),4294967295))>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],$[e>>2]=pe[0],$[e+4>>2]=pe[1];break;case"float":D[e>>2]=t;break;case"double":F[e>>3]=t;break;default:se("invalid type for setValue: "+n)}}function P(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return R[e>>0];case"i16":return L[e>>1];case"i32":case"i64":return $[e>>2];case"float":return D[e>>2];case"double":return F[e>>3];default:se("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&se("no native wasm support detected");var A=!1;function O(e,t){e||se("Assertion failed: "+t)}var N,R,M,L,$,D,F,j=1,q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&q)return q.decode(e.subarray(t,o));for(var i="";t<o;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var c=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|c:(7&s)<<18|a<<12|c<<6|63&e[t++])<65536)i+=String.fromCharCode(s);else{var l=s-65536;i+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function U(e,t){return e?B(M,e,t):""}function H(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-o}function z(e,t,n){return H(e,M,t,n)}function W(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function V(e){var t=W(e)+1,n=Ve(t);return H(e,R,n,t),n}function G(e){N=e,o.HEAP8=R=new Int8Array(e),o.HEAP16=L=new Int16Array(e),o.HEAP32=$=new Int32Array(e),o.HEAPU8=M=new Uint8Array(e),o.HEAPU16=new Uint16Array(e),o.HEAPU32=new Uint32Array(e),o.HEAPF32=D=new Float32Array(e),o.HEAPF64=F=new Float64Array(e)}var K=o.INITIAL_MEMORY||33554432;(T=o.wasmMemory?o.wasmMemory:new WebAssembly.Memory({initial:K/65536,maximum:32768}))&&(N=T.buffer),K=N.byteLength,G(N);var J=new WebAssembly.Table({initial:13,element:"anyfunc"}),X=[],Q=[],Y=[],Z=[],ee=!1,te=0,ne=null,re=null;function oe(e){te++,o.monitorRunDependencies&&o.monitorRunDependencies(te)}function ie(e){if(te--,o.monitorRunDependencies&&o.monitorRunDependencies(te),0==te&&(null!==ne&&(clearInterval(ne),ne=null),re)){var t=re;re=null,t()}}function se(e){throw o.onAbort&&o.onAbort(e),y(e+=""),A=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}o.preloadedImages={},o.preloadedAudios={},o.preloadedWasm={};var ae="data:application/octet-stream;base64,";function ce(e){return e.startsWith(ae)}function le(e){return e.startsWith("file://")}var ue,de,pe,he="tree-sitter.wasm";function fe(e){try{if(e==he&&E)return new Uint8Array(E);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}catch(e){se(e)}}ce(he)||(ue=he,he=o.locateFile?o.locateFile(ue,_):_+ue);var me={},ge={get:function(e,t){return me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),me[t]}};function _e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?J.get(n)():J.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(o)}}function ye(e){var t=0;function n(){for(var n=0,r=1;;){var o=e[t++];if(n+=(127&o)*r,r*=128,!(128&o))break}return n}if(e instanceof WebAssembly.Module){var r=WebAssembly.Module.customSections(e,"dylink");O(0!=r.length,"need dylink section"),e=new Int8Array(r[0])}else O(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),O(0===e[8],"need the dylink section to be first"),t=9,n(),O(6===e[t]),O(e[++t]==="d".charCodeAt(0)),O(e[++t]==="y".charCodeAt(0)),O(e[++t]==="l".charCodeAt(0)),O(e[++t]==="i".charCodeAt(0)),O(e[++t]==="n".charCodeAt(0)),O(e[++t]==="k".charCodeAt(0)),t++;var o={};o.memorySize=n(),o.memoryAlign=n(),o.tableSize=n(),o.tableAlign=n();var i=n();o.neededDynlibs=[];for(var s=0;s<i;++s){var a=n(),c=e.subarray(t,t+a);t+=a;var l=B(c,0);o.neededDynlibs.push(l)}return o}var ve=0;function be(){return k||ve>0}function we(e){return 0==e.indexOf("dynCall_")||["stackAlloc","stackSave","stackRestore"].includes(e)?e:"_"+e}function xe(e,t){for(var n in e)if(e.hasOwnProperty(n)){Be.hasOwnProperty(n)||(Be[n]=e[n]);var r=we(n);o.hasOwnProperty(r)||(o[r]=e[n])}}var Ee={nextHandle:1,loadedLibs:{},loadedLibNames:{}};function Ce(e,t,n){return e.includes("j")?function(e,t,n){var r=o["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):J.get(t).apply(null,n)}var Se=5250816;function Te(e){return["__cpp_exception","__wasm_apply_data_relocs","__dso_handle","__set_stack_limits"].includes(e)}function ke(e,t){var n={};for(var r in e){var o=e[r];"object"==typeof o&&(o=o.value),"number"==typeof o&&(o+=t),n[r]=o}return function(e){for(var t in e)if(!Te(t)){var n=!1,r=e[t];t.startsWith("orig$")&&(t=t.split("$")[1],n=!0),me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),(n||0==me[t].value)&&("function"==typeof r?me[t].value=x(r):"number"==typeof r?me[t].value=r:y("unhandled export type for `"+t+"`: "+typeof r))}}(n),n}function Ie(e,t){var n,r;return t&&(n=Be["orig$"+e]),n||(n=Be[e]),n||(n=o[we(e)]),!n&&e.startsWith("invoke_")&&(r=e.split("_")[1],n=function(){var e=ze();try{return Ce(r,arguments[0],Array.prototype.slice.call(arguments,1))}catch(t){if(We(e),t!==t+0&&"longjmp"!==t)throw t;Ge(1,0)}}),n}function Pe(e,t){var n=ye(e);function r(){var r=Math.pow(2,n.memoryAlign);r=Math.max(r,b);var o,i,s,a=(o=function(e){if(ee)return Ue(e);var t=Se,n=t+e+15&-16;return Se=n,me.__heap_base.value=n,t}(n.memorySize+r),(i=r)||(i=b),Math.ceil(o/i)*i),c=J.length;J.grow(n.tableSize);for(var l=a;l<a+n.memorySize;l++)R[l]=0;for(l=c;l<c+n.tableSize;l++)J.set(l,null);var u=new Proxy({},{get:function(e,t){switch(t){case"__memory_base":return a;case"__table_base":return c}return t in Be?Be[t]:(t in e||(e[t]=function(){return n||(n=function(e){var t=Ie(e,!1);return t||(t=s[e]),t}(t)),n.apply(null,arguments)}),e[t]);var n}}),d={"GOT.mem":new Proxy({},ge),"GOT.func":new Proxy({},ge),env:u,wasi_snapshot_preview1:u};function p(e){for(var r=0;r<n.tableSize;r++){var o=J.get(c+r);o&&v.set(o,c+r)}s=ke(e.exports,a),t.allowUndefined||Oe();var i=s.__wasm_call_ctors;return i||(i=s.__post_instantiate),i&&(ee?i():Q.push(i)),s}if(t.loadAsync){if(e instanceof WebAssembly.Module){var h=new WebAssembly.Instance(e,d);return Promise.resolve(p(h))}return WebAssembly.instantiate(e,d).then((function(e){return p(e.instance)}))}var f=e instanceof WebAssembly.Module?e:new WebAssembly.Module(e);return p(h=new WebAssembly.Instance(f,d))}return t.loadAsync?n.neededDynlibs.reduce((function(e,n){return e.then((function(){return Ae(n,t)}))}),Promise.resolve()).then((function(){return r()})):(n.neededDynlibs.forEach((function(e){Ae(e,t)})),r())}function Ae(e,t){"__main__"!=e||Ee.loadedLibNames[e]||(Ee.loadedLibs[-1]={refcount:1/0,name:"__main__",module:o.asm,global:!0},Ee.loadedLibNames.__main__=-1),t=t||{global:!0,nodelete:!0};var n,r=Ee.loadedLibNames[e];if(r)return n=Ee.loadedLibs[r],t.global&&!n.global&&(n.global=!0,"loading"!==n.module&&xe(n.module)),t.nodelete&&n.refcount!==1/0&&(n.refcount=1/0),n.refcount++,t.loadAsync?Promise.resolve(r):r;function i(e){if(t.fs){var n=t.fs.readFile(e,{encoding:"binary"});return n instanceof Uint8Array||(n=new Uint8Array(n)),t.loadAsync?Promise.resolve(n):n}return t.loadAsync?(r=e,fetch(r,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load binary file at '"+r+"'";return e.arrayBuffer()})).then((function(e){return new Uint8Array(e)}))):f(e);var r}function s(){if(void 0!==o.preloadedWasm&&void 0!==o.preloadedWasm[e]){var n=o.preloadedWasm[e];return t.loadAsync?Promise.resolve(n):n}return t.loadAsync?i(e).then((function(e){return Pe(e,t)})):Pe(i(e),t)}function a(e){n.global&&xe(e),n.module=e}return r=Ee.nextHandle++,n={refcount:t.nodelete?1/0:1,name:e,module:"loading",global:t.global},Ee.loadedLibNames[e]=r,Ee.loadedLibs[r]=n,t.loadAsync?s().then((function(e){return a(e),r})):(a(s()),r)}function Oe(){for(var e in me)if(0==me[e].value){var t=Ie(e,!0);"function"==typeof t?me[e].value=x(t,t.sig):"number"==typeof t?me[e].value=t:O(!1,"bad export type for `"+e+"`: "+typeof t)}}o.___heap_base=Se;var Ne,Re=new WebAssembly.Global({value:"i32",mutable:!0},5250816);function Me(){se()}o._abort=Me,Me.sig="v",Ne=i?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var Le=!0;function $e(e,t){var n;if(0===e)n=Date.now();else{if(1!==e&&4!==e||!Le)return 28,$[He()>>2]=28,-1;n=Ne()}return $[t>>2]=n/1e3|0,$[t+4>>2]=n%1e3*1e3*1e3|0,0}function De(e){try{return T.grow(e-N.byteLength+65535>>>16),G(T.buffer),1}catch(e){}}function Fe(e){Qe(e)}function je(e){C(e)}$e.sig="iii",Fe.sig="vi",je.sig="vi";var qe,Be={__heap_base:Se,__indirect_function_table:J,__memory_base:1024,__stack_pointer:Re,__table_base:1,abort:Me,clock_gettime:$e,emscripten_memcpy_big:function(e,t,n){M.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=M.length;if((e>>>=0)>2147483648)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),De(Math.min(2147483648,((t=Math.max(e,o))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1},exit:Fe,memory:T,setTempRet0:je,tree_sitter_log_callback:function(e,t){if(ft){const n=U(t);ft(n,0!==e)}},tree_sitter_parse_callback:function(e,t,n,r,o){var i=ht(t,{row:n,column:r});"string"==typeof i?(I(o,i.length,"i32"),function(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=(n-=2)<2*e.length?n/2:e.length,o=0;o<r;++o){var i=e.charCodeAt(o);L[t>>1]=i,t+=2}L[t>>1]=0}(i,e,10240)):I(o,0,"i32")}},Ue=(function(){var e={env:Be,wasi_snapshot_preview1:Be,"GOT.mem":new Proxy(Be,ge),"GOT.func":new Proxy(Be,ge)};function t(e,t){var n=e.exports;n=ke(n,1024),o.asm=n;var r,i=ye(t);i.neededDynlibs&&(S=i.neededDynlibs.concat(S)),xe(n),r=o.asm.__wasm_call_ctors,Q.unshift(r),ie()}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!E&&(u||d)){if("function"==typeof fetch&&!le(he))return fetch(he,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+he+"'";return e.arrayBuffer()})).catch((function(){return fe(he)}));if(h)return new Promise((function(e,t){h(he,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return fe(he)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),se(e)}))}if(oe(),o.instantiateWasm)try{return o.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}E||"function"!=typeof WebAssembly.instantiateStreaming||ce(he)||le(he)||"function"!=typeof fetch?r(n):fetch(he,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.__wasm_call_ctors).apply(null,arguments)},o._malloc=function(){return(Ue=o._malloc=o.asm.malloc).apply(null,arguments)}),He=(o._ts_language_symbol_count=function(){return(o._ts_language_symbol_count=o.asm.ts_language_symbol_count).apply(null,arguments)},o._ts_language_version=function(){return(o._ts_language_version=o.asm.ts_language_version).apply(null,arguments)},o._ts_language_field_count=function(){return(o._ts_language_field_count=o.asm.ts_language_field_count).apply(null,arguments)},o._ts_language_symbol_name=function(){return(o._ts_language_symbol_name=o.asm.ts_language_symbol_name).apply(null,arguments)},o._ts_language_symbol_for_name=function(){return(o._ts_language_symbol_for_name=o.asm.ts_language_symbol_for_name).apply(null,arguments)},o._ts_language_symbol_type=function(){return(o._ts_language_symbol_type=o.asm.ts_language_symbol_type).apply(null,arguments)},o._ts_language_field_name_for_id=function(){return(o._ts_language_field_name_for_id=o.asm.ts_language_field_name_for_id).apply(null,arguments)},o._memcpy=function(){return(o._memcpy=o.asm.memcpy).apply(null,arguments)},o._free=function(){return(o._free=o.asm.free).apply(null,arguments)},o._calloc=function(){return(o._calloc=o.asm.calloc).apply(null,arguments)},o._ts_parser_delete=function(){return(o._ts_parser_delete=o.asm.ts_parser_delete).apply(null,arguments)},o._ts_parser_reset=function(){return(o._ts_parser_reset=o.asm.ts_parser_reset).apply(null,arguments)},o._ts_parser_set_language=function(){return(o._ts_parser_set_language=o.asm.ts_parser_set_language).apply(null,arguments)},o._ts_parser_timeout_micros=function(){return(o._ts_parser_timeout_micros=o.asm.ts_parser_timeout_micros).apply(null,arguments)},o._ts_parser_set_timeout_micros=function(){return(o._ts_parser_set_timeout_micros=o.asm.ts_parser_set_timeout_micros).apply(null,arguments)},o._memcmp=function(){return(o._memcmp=o.asm.memcmp).apply(null,arguments)},o._ts_query_new=function(){return(o._ts_query_new=o.asm.ts_query_new).apply(null,arguments)},o._ts_query_delete=function(){return(o._ts_query_delete=o.asm.ts_query_delete).apply(null,arguments)},o._iswspace=function(){return(o._iswspace=o.asm.iswspace).apply(null,arguments)},o._iswalnum=function(){return(o._iswalnum=o.asm.iswalnum).apply(null,arguments)},o._ts_query_pattern_count=function(){return(o._ts_query_pattern_count=o.asm.ts_query_pattern_count).apply(null,arguments)},o._ts_query_capture_count=function(){return(o._ts_query_capture_count=o.asm.ts_query_capture_count).apply(null,arguments)},o._ts_query_string_count=function(){return(o._ts_query_string_count=o.asm.ts_query_string_count).apply(null,arguments)},o._ts_query_capture_name_for_id=function(){return(o._ts_query_capture_name_for_id=o.asm.ts_query_capture_name_for_id).apply(null,arguments)},o._ts_query_string_value_for_id=function(){return(o._ts_query_string_value_for_id=o.asm.ts_query_string_value_for_id).apply(null,arguments)},o._ts_query_predicates_for_pattern=function(){return(o._ts_query_predicates_for_pattern=o.asm.ts_query_predicates_for_pattern).apply(null,arguments)},o._ts_tree_copy=function(){return(o._ts_tree_copy=o.asm.ts_tree_copy).apply(null,arguments)},o._ts_tree_delete=function(){return(o._ts_tree_delete=o.asm.ts_tree_delete).apply(null,arguments)},o._ts_init=function(){return(o._ts_init=o.asm.ts_init).apply(null,arguments)},o._ts_parser_new_wasm=function(){return(o._ts_parser_new_wasm=o.asm.ts_parser_new_wasm).apply(null,arguments)},o._ts_parser_enable_logger_wasm=function(){return(o._ts_parser_enable_logger_wasm=o.asm.ts_parser_enable_logger_wasm).apply(null,arguments)},o._ts_parser_parse_wasm=function(){return(o._ts_parser_parse_wasm=o.asm.ts_parser_parse_wasm).apply(null,arguments)},o._ts_language_type_is_named_wasm=function(){return(o._ts_language_type_is_named_wasm=o.asm.ts_language_type_is_named_wasm).apply(null,arguments)},o._ts_language_type_is_visible_wasm=function(){return(o._ts_language_type_is_visible_wasm=o.asm.ts_language_type_is_visible_wasm).apply(null,arguments)},o._ts_tree_root_node_wasm=function(){return(o._ts_tree_root_node_wasm=o.asm.ts_tree_root_node_wasm).apply(null,arguments)},o._ts_tree_edit_wasm=function(){return(o._ts_tree_edit_wasm=o.asm.ts_tree_edit_wasm).apply(null,arguments)},o._ts_tree_get_changed_ranges_wasm=function(){return(o._ts_tree_get_changed_ranges_wasm=o.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)},o._ts_tree_cursor_new_wasm=function(){return(o._ts_tree_cursor_new_wasm=o.asm.ts_tree_cursor_new_wasm).apply(null,arguments)},o._ts_tree_cursor_delete_wasm=function(){return(o._ts_tree_cursor_delete_wasm=o.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)},o._ts_tree_cursor_reset_wasm=function(){return(o._ts_tree_cursor_reset_wasm=o.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_first_child_wasm=function(){return(o._ts_tree_cursor_goto_first_child_wasm=o.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_next_sibling_wasm=function(){return(o._ts_tree_cursor_goto_next_sibling_wasm=o.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_parent_wasm=function(){return(o._ts_tree_cursor_goto_parent_wasm=o.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_type_id_wasm=function(){return(o._ts_tree_cursor_current_node_type_id_wasm=o.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_is_named_wasm=function(){return(o._ts_tree_cursor_current_node_is_named_wasm=o.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_is_missing_wasm=function(){return(o._ts_tree_cursor_current_node_is_missing_wasm=o.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_id_wasm=function(){return(o._ts_tree_cursor_current_node_id_wasm=o.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)},o._ts_tree_cursor_start_position_wasm=function(){return(o._ts_tree_cursor_start_position_wasm=o.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)},o._ts_tree_cursor_end_position_wasm=function(){return(o._ts_tree_cursor_end_position_wasm=o.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)},o._ts_tree_cursor_start_index_wasm=function(){return(o._ts_tree_cursor_start_index_wasm=o.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)},o._ts_tree_cursor_end_index_wasm=function(){return(o._ts_tree_cursor_end_index_wasm=o.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)},o._ts_tree_cursor_current_field_id_wasm=function(){return(o._ts_tree_cursor_current_field_id_wasm=o.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_wasm=function(){return(o._ts_tree_cursor_current_node_wasm=o.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)},o._ts_node_symbol_wasm=function(){return(o._ts_node_symbol_wasm=o.asm.ts_node_symbol_wasm).apply(null,arguments)},o._ts_node_child_count_wasm=function(){return(o._ts_node_child_count_wasm=o.asm.ts_node_child_count_wasm).apply(null,arguments)},o._ts_node_named_child_count_wasm=function(){return(o._ts_node_named_child_count_wasm=o.asm.ts_node_named_child_count_wasm).apply(null,arguments)},o._ts_node_child_wasm=function(){return(o._ts_node_child_wasm=o.asm.ts_node_child_wasm).apply(null,arguments)},o._ts_node_named_child_wasm=function(){return(o._ts_node_named_child_wasm=o.asm.ts_node_named_child_wasm).apply(null,arguments)},o._ts_node_child_by_field_id_wasm=function(){return(o._ts_node_child_by_field_id_wasm=o.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)},o._ts_node_next_sibling_wasm=function(){return(o._ts_node_next_sibling_wasm=o.asm.ts_node_next_sibling_wasm).apply(null,arguments)},o._ts_node_prev_sibling_wasm=function(){return(o._ts_node_prev_sibling_wasm=o.asm.ts_node_prev_sibling_wasm).apply(null,arguments)},o._ts_node_next_named_sibling_wasm=function(){return(o._ts_node_next_named_sibling_wasm=o.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)},o._ts_node_prev_named_sibling_wasm=function(){return(o._ts_node_prev_named_sibling_wasm=o.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)},o._ts_node_parent_wasm=function(){return(o._ts_node_parent_wasm=o.asm.ts_node_parent_wasm).apply(null,arguments)},o._ts_node_descendant_for_index_wasm=function(){return(o._ts_node_descendant_for_index_wasm=o.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)},o._ts_node_named_descendant_for_index_wasm=function(){return(o._ts_node_named_descendant_for_index_wasm=o.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)},o._ts_node_descendant_for_position_wasm=function(){return(o._ts_node_descendant_for_position_wasm=o.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)},o._ts_node_named_descendant_for_position_wasm=function(){return(o._ts_node_named_descendant_for_position_wasm=o.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)},o._ts_node_start_point_wasm=function(){return(o._ts_node_start_point_wasm=o.asm.ts_node_start_point_wasm).apply(null,arguments)},o._ts_node_end_point_wasm=function(){return(o._ts_node_end_point_wasm=o.asm.ts_node_end_point_wasm).apply(null,arguments)},o._ts_node_start_index_wasm=function(){return(o._ts_node_start_index_wasm=o.asm.ts_node_start_index_wasm).apply(null,arguments)},o._ts_node_end_index_wasm=function(){return(o._ts_node_end_index_wasm=o.asm.ts_node_end_index_wasm).apply(null,arguments)},o._ts_node_to_string_wasm=function(){return(o._ts_node_to_string_wasm=o.asm.ts_node_to_string_wasm).apply(null,arguments)},o._ts_node_children_wasm=function(){return(o._ts_node_children_wasm=o.asm.ts_node_children_wasm).apply(null,arguments)},o._ts_node_named_children_wasm=function(){return(o._ts_node_named_children_wasm=o.asm.ts_node_named_children_wasm).apply(null,arguments)},o._ts_node_descendants_of_type_wasm=function(){return(o._ts_node_descendants_of_type_wasm=o.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)},o._ts_node_is_named_wasm=function(){return(o._ts_node_is_named_wasm=o.asm.ts_node_is_named_wasm).apply(null,arguments)},o._ts_node_has_changes_wasm=function(){return(o._ts_node_has_changes_wasm=o.asm.ts_node_has_changes_wasm).apply(null,arguments)},o._ts_node_has_error_wasm=function(){return(o._ts_node_has_error_wasm=o.asm.ts_node_has_error_wasm).apply(null,arguments)},o._ts_node_is_missing_wasm=function(){return(o._ts_node_is_missing_wasm=o.asm.ts_node_is_missing_wasm).apply(null,arguments)},o._ts_query_matches_wasm=function(){return(o._ts_query_matches_wasm=o.asm.ts_query_matches_wasm).apply(null,arguments)},o._ts_query_captures_wasm=function(){return(o._ts_query_captures_wasm=o.asm.ts_query_captures_wasm).apply(null,arguments)},o._iswdigit=function(){return(o._iswdigit=o.asm.iswdigit).apply(null,arguments)},o._iswalpha=function(){return(o._iswalpha=o.asm.iswalpha).apply(null,arguments)},o._iswlower=function(){return(o._iswlower=o.asm.iswlower).apply(null,arguments)},o._towupper=function(){return(o._towupper=o.asm.towupper).apply(null,arguments)},o.___errno_location=function(){return(He=o.___errno_location=o.asm.__errno_location).apply(null,arguments)}),ze=(o._memchr=function(){return(o._memchr=o.asm.memchr).apply(null,arguments)},o._strlen=function(){return(o._strlen=o.asm.strlen).apply(null,arguments)},o.stackSave=function(){return(ze=o.stackSave=o.asm.stackSave).apply(null,arguments)}),We=o.stackRestore=function(){return(We=o.stackRestore=o.asm.stackRestore).apply(null,arguments)},Ve=o.stackAlloc=function(){return(Ve=o.stackAlloc=o.asm.stackAlloc).apply(null,arguments)},Ge=o._setThrew=function(){return(Ge=o._setThrew=o.asm.setThrew).apply(null,arguments)};function Ke(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)},o.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return(o.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=o.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)},o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return(o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=o.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)},o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return(o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=o.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_).apply(null,arguments)},o.__Znwm=function(){return(o.__Znwm=o.asm._Znwm).apply(null,arguments)},o.__ZdlPv=function(){return(o.__ZdlPv=o.asm._ZdlPv).apply(null,arguments)},o.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return(o.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=o.asm._ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv).apply(null,arguments)},o._orig$ts_parser_timeout_micros=function(){return(o._orig$ts_parser_timeout_micros=o.asm.orig$ts_parser_timeout_micros).apply(null,arguments)},o._orig$ts_parser_set_timeout_micros=function(){return(o._orig$ts_parser_set_timeout_micros=o.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)},o.allocate=function(e,t){var n;return n=t==j?Ve(e.length):Ue(e.length),e.subarray||e.slice?M.set(e,n):M.set(new Uint8Array(e),n),n},re=function e(){qe||Xe(),qe||(re=e)};var Je=!1;function Xe(e){function t(){qe||(qe=!0,o.calledRun=!0,A||(ee=!0,_e(Q),_e(Y),o.onRuntimeInitialized&&o.onRuntimeInitialized(),Ye&&function(e){var t=o._main;if(t){var n=(e=e||[]).length+1,r=Ve(4*(n+1));$[r>>2]=V(c);for(var i=1;i<n;i++)$[(r>>2)+i]=V(e[i-1]);$[(r>>2)+n]=0;try{Qe(t(n,r),!0)}catch(e){if(e instanceof Ke)return;if("unwind"==e)return;var s=e;e&&"object"==typeof e&&e.stack&&(s=[e,e.stack]),y("exception thrown: "+s),l(1,e)}}}(e),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),Z.unshift(e);var e;_e(Z)}()))}e=e||a,te>0||!Je&&(function(){if(S.length){if(!f)return oe(),void S.reduce((function(e,t){return e.then((function(){return Ae(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}))}),Promise.resolve()).then((function(){ie(),Oe()}));S.forEach((function(e){Ae(e,{global:!0,nodelete:!0,allowUndefined:!0})})),Oe()}else Oe()}(),Je=!0,te>0)||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),X.unshift(e);var e;_e(X)}(),te>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}function Qe(e,t){t&&be()&&0===e||(be()||(o.onExit&&o.onExit(e),A=!0),l(e,new Ke(e)))}if(o.run=Xe,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();var Ye=!0;o.noInitialRun&&(Ye=!1),Xe();const Ze=o,et={},tt=4,nt=5*tt,rt=2*tt,ot=2*tt+2*rt,it={row:0,column:0},st=/[\w-.]*/g,at=1,ct=2,lt=/^_?tree_sitter_\w+/;var ut,dt,pt,ht,ft,mt=new Promise((e=>{o.onRuntimeInitialized=e})).then((()=>{pt=Ze._ts_init(),ut=P(pt,"i32"),dt=P(pt+tt,"i32")}));class gt{static init(){return mt}constructor(){if(null==pt)throw new Error("You must first call Parser.init() and wait for it to resolve.");Ze._ts_parser_new_wasm(),this[0]=P(pt,"i32"),this[1]=P(pt+tt,"i32")}delete(){Ze._ts_parser_delete(this[0]),Ze._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==bt)throw new Error("Argument must be a Language");{t=e[0];const n=Ze._ts_language_version(t);if(n<dt||ut<n)throw new Error(`Incompatible language version ${n}. Compatibility range ${dt} through ${ut}.`)}}else t=0,e=null;return this.language=e,Ze._ts_parser_set_language(this[0],t),this}getLanguage(){return this.language}parse(e,t,n){if("string"==typeof e)ht=(t,n,r)=>e.slice(t,r);else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");ht=e}this.logCallback?(ft=this.logCallback,Ze._ts_parser_enable_logger_wasm(this[0],1)):(ft=null,Ze._ts_parser_enable_logger_wasm(this[0],0));let r=0,o=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=o=Ze._calloc(r,ot);for(let t=0;t<r;t++)Nt(e,n.includedRanges[t]),e+=ot}const i=Ze._ts_parser_parse_wasm(this[0],this[1],t?t[0]:0,o,r);if(!i)throw ht=null,ft=null,new Error("Parsing failed");const s=new _t(et,i,this.language,ht);return ht=null,ft=null,s}reset(){Ze._ts_parser_reset(this[0])}setTimeoutMicros(e){Ze._ts_parser_set_timeout_micros(this[0],e)}getTimeoutMicros(){return Ze._ts_parser_timeout_micros(this[0])}setLogger(e){if(e){if("function"!=typeof e)throw new Error("Logger callback must be a function")}else e=null;return this.logCallback=e,this}getLogger(){return this.logCallback}}class _t{constructor(e,t,n,r){Ct(e),this[0]=t,this.language=n,this.textCallback=r}copy(){const e=Ze._ts_tree_copy(this[0]);return new _t(et,e,this.language,this.textCallback)}delete(){Ze._ts_tree_delete(this[0]),this[0]=0}edit(e){!function(e){let t=pt;At(t,e.startPosition),At(t+=rt,e.oldEndPosition),At(t+=rt,e.newEndPosition),I(t+=rt,e.startIndex,"i32"),I(t+=tt,e.oldEndIndex,"i32"),I(t+=tt,e.newEndIndex,"i32"),t+=tt}(e),Ze._ts_tree_edit_wasm(this[0])}get rootNode(){return Ze._ts_tree_root_node_wasm(this[0]),kt(this)}getLanguage(){return this.language}walk(){return this.rootNode.walk()}getChangedRanges(e){if(e.constructor!==_t)throw new TypeError("Argument must be a Tree");Ze._ts_tree_get_changed_ranges_wasm(this[0],e[0]);const t=P(pt,"i32"),n=P(pt+tt,"i32"),r=new Array(t);if(t>0){let e=n;for(let n=0;n<t;n++)r[n]=Rt(e),e+=ot;Ze._free(n)}return r}}class yt{constructor(e,t){Ct(e),this.tree=t}get typeId(){return Tt(this),Ze._ts_node_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get endPosition(){return Tt(this),Ze._ts_node_end_point_wasm(this.tree[0]),Ot(pt)}get endIndex(){return Tt(this),Ze._ts_node_end_index_wasm(this.tree[0])}get text(){return xt(this.tree,this.startIndex,this.endIndex)}isNamed(){return Tt(this),1===Ze._ts_node_is_named_wasm(this.tree[0])}hasError(){return Tt(this),1===Ze._ts_node_has_error_wasm(this.tree[0])}hasChanges(){return Tt(this),1===Ze._ts_node_has_changes_wasm(this.tree[0])}isMissing(){return Tt(this),1===Ze._ts_node_is_missing_wasm(this.tree[0])}equals(e){return this.id===e.id}child(e){return Tt(this),Ze._ts_node_child_wasm(this.tree[0],e),kt(this.tree)}namedChild(e){return Tt(this),Ze._ts_node_named_child_wasm(this.tree[0],e),kt(this.tree)}childForFieldId(e){return Tt(this),Ze._ts_node_child_by_field_id_wasm(this.tree[0],e),kt(this.tree)}childForFieldName(e){const t=this.tree.language.fields.indexOf(e);if(-1!==t)return this.childForFieldId(t)}get childCount(){return Tt(this),Ze._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return Tt(this),Ze._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){Tt(this),Ze._ts_node_children_wasm(this.tree[0]);const e=P(pt,"i32"),t=P(pt+tt,"i32");if(this._children=new Array(e),e>0){let n=t;for(let t=0;t<e;t++)this._children[t]=kt(this.tree,n),n+=nt;Ze._free(t)}}return this._children}get namedChildren(){if(!this._namedChildren){Tt(this),Ze._ts_node_named_children_wasm(this.tree[0]);const e=P(pt,"i32"),t=P(pt+tt,"i32");if(this._namedChildren=new Array(e),e>0){let n=t;for(let t=0;t<e;t++)this._namedChildren[t]=kt(this.tree,n),n+=nt;Ze._free(t)}}return this._namedChildren}descendantsOfType(e,t,n){Array.isArray(e)||(e=[e]),t||(t=it),n||(n=it);const r=[],o=this.tree.language.types;for(let t=0,n=o.length;t<n;t++)e.includes(o[t])&&r.push(t);const i=Ze._malloc(tt*r.length);for(let e=0,t=r.length;e<t;e++)I(i+e*tt,r[e],"i32");Tt(this),Ze._ts_node_descendants_of_type_wasm(this.tree[0],i,r.length,t.row,t.column,n.row,n.column);const s=P(pt,"i32"),a=P(pt+tt,"i32"),c=new Array(s);if(s>0){let e=a;for(let t=0;t<s;t++)c[t]=kt(this.tree,e),e+=nt}return Ze._free(a),Ze._free(i),c}get nextSibling(){return Tt(this),Ze._ts_node_next_sibling_wasm(this.tree[0]),kt(this.tree)}get previousSibling(){return Tt(this),Ze._ts_node_prev_sibling_wasm(this.tree[0]),kt(this.tree)}get nextNamedSibling(){return Tt(this),Ze._ts_node_next_named_sibling_wasm(this.tree[0]),kt(this.tree)}get previousNamedSibling(){return Tt(this),Ze._ts_node_prev_named_sibling_wasm(this.tree[0]),kt(this.tree)}get parent(){return Tt(this),Ze._ts_node_parent_wasm(this.tree[0]),kt(this.tree)}descendantForIndex(e,t=e){if("number"!=typeof e||"number"!=typeof t)throw new Error("Arguments must be numbers");Tt(this);let n=pt+nt;return I(n,e,"i32"),I(n+tt,t,"i32"),Ze._ts_node_descendant_for_index_wasm(this.tree[0]),kt(this.tree)}namedDescendantForIndex(e,t=e){if("number"!=typeof e||"number"!=typeof t)throw new Error("Arguments must be numbers");Tt(this);let n=pt+nt;return I(n,e,"i32"),I(n+tt,t,"i32"),Ze._ts_node_named_descendant_for_index_wasm(this.tree[0]),kt(this.tree)}descendantForPosition(e,t=e){if(!St(e)||!St(t))throw new Error("Arguments must be {row, column} objects");Tt(this);let n=pt+nt;return At(n,e),At(n+rt,t),Ze._ts_node_descendant_for_position_wasm(this.tree[0]),kt(this.tree)}namedDescendantForPosition(e,t=e){if(!St(e)||!St(t))throw new Error("Arguments must be {row, column} objects");Tt(this);let n=pt+nt;return At(n,e),At(n+rt,t),Ze._ts_node_named_descendant_for_position_wasm(this.tree[0]),kt(this.tree)}walk(){return Tt(this),Ze._ts_tree_cursor_new_wasm(this.tree[0]),new vt(et,this.tree)}toString(){Tt(this);const e=Ze._ts_node_to_string_wasm(this.tree[0]),t=function(e){for(var t="";;){var n=M[e++>>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return Ze._free(e),t}}class vt{constructor(e,t){Ct(e),this.tree=t,Pt(this)}delete(){It(this),Ze._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){Tt(e),It(this,pt+nt),Ze._ts_tree_cursor_reset_wasm(this.tree[0]),Pt(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return It(this),Ze._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return It(this),Ze._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return It(this),1===Ze._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return It(this),1===Ze._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){It(this);const e=Ze._ts_tree_cursor_start_index_wasm(this.tree[0]),t=Ze._ts_tree_cursor_end_index_wasm(this.tree[0]);return xt(this.tree,e,t)}get startPosition(){return It(this),Ze._ts_tree_cursor_start_position_wasm(this.tree[0]),Ot(pt)}get endPosition(){return It(this),Ze._ts_tree_cursor_end_position_wasm(this.tree[0]),Ot(pt)}get startIndex(){return It(this),Ze._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return It(this),Ze._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return It(this),Ze._ts_tree_cursor_current_node_wasm(this.tree[0]),kt(this.tree)}currentFieldId(){return It(this),Ze._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){It(this);const e=Ze._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return Pt(this),1===e}gotoNextSibling(){It(this);const e=Ze._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return Pt(this),1===e}gotoParent(){It(this);const e=Ze._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return Pt(this),1===e}}class bt{constructor(e,t){Ct(e),this[0]=t,this.types=new Array(Ze._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e<t;e++)Ze._ts_language_symbol_type(this[0],e)<2&&(this.types[e]=U(Ze._ts_language_symbol_name(this[0],e)));this.fields=new Array(Ze._ts_language_field_count(this[0])+1);for(let e=0,t=this.fields.length;e<t;e++){const t=Ze._ts_language_field_name_for_id(this[0],e);this.fields[e]=0!==t?U(t):null}}get version(){return Ze._ts_language_version(this[0])}get fieldCount(){return this.fields.length-1}fieldIdForName(e){const t=this.fields.indexOf(e);return-1!==t?t:null}fieldNameForId(e){return this.fields[e]||null}idForNodeType(e,t){const n=W(e),r=Ze._malloc(n+1);z(e,r,n+1);const o=Ze._ts_language_symbol_for_name(this[0],r,n,t);return Ze._free(r),o||null}get nodeTypeCount(){return Ze._ts_language_symbol_count(this[0])}nodeTypeForId(e){const t=Ze._ts_language_symbol_name(this[0],e);return t?U(t):null}nodeTypeIsNamed(e){return!!Ze._ts_language_type_is_named_wasm(this[0],e)}nodeTypeIsVisible(e){return!!Ze._ts_language_type_is_visible_wasm(this[0],e)}query(e){const t=W(e),n=Ze._malloc(t+1);z(e,n,t+1);const r=Ze._ts_query_new(this[0],n,t,pt,pt+tt);if(!r){const t=P(pt+tt,"i32"),r=U(n,P(pt,"i32")).length,o=e.substr(r,100).split("\n")[0];let i,s=o.match(st)[0];switch(t){case 2:i=new RangeError(`Bad node name '${s}'`);break;case 3:i=new RangeError(`Bad field name '${s}'`);break;case 4:i=new RangeError(`Bad capture name @${s}`);break;case 5:i=new TypeError(`Bad pattern structure at offset ${r}: '${o}'...`),s="";break;default:i=new SyntaxError(`Bad syntax at offset ${r}: '${o}'...`),s=""}throw i.index=r,i.length=s.length,Ze._free(n),i}const o=Ze._ts_query_string_count(r),i=Ze._ts_query_capture_count(r),s=Ze._ts_query_pattern_count(r),a=new Array(i),c=new Array(o);for(let e=0;e<i;e++){const t=Ze._ts_query_capture_name_for_id(r,e,pt),n=P(pt,"i32");a[e]=U(t,n)}for(let e=0;e<o;e++){const t=Ze._ts_query_string_value_for_id(r,e,pt),n=P(pt,"i32");c[e]=U(t,n)}const l=new Array(s),u=new Array(s),d=new Array(s),p=new Array(s),h=new Array(s);for(let e=0;e<s;e++){const t=Ze._ts_query_predicates_for_pattern(r,e,pt),n=P(pt,"i32");p[e]=[],h[e]=[];const o=[];let i=t;for(let t=0;t<n;t++){const t=P(i,"i32"),n=P(i+=tt,"i32");if(i+=tt,t===at)o.push({type:"capture",name:a[n]});else if(t===ct)o.push({type:"string",value:c[n]});else if(o.length>0){if("string"!==o[0].type)throw new Error("Predicates must begin with a literal value");const t=o[0].value;let n=!0;switch(t){case"not-eq?":n=!1;case"eq?":if(3!==o.length)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(o.length-1));if("capture"!==o[1].type)throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${o[1].value}"`);if("capture"===o[2].type){const t=o[1].name,r=o[2].name;h[e].push((function(e){let o,i;for(const n of e)n.name===t&&(o=n.node),n.name===r&&(i=n.node);return o.text===i.text===n}))}else{const t=o[1].name,r=o[2].value;h[e].push((function(e){for(const o of e)if(o.name===t)return o.node.text===r===n;return!1}))}break;case"not-match?":n=!1;case"match?":if(3!==o.length)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${o.length-1}.`);if("capture"!==o[1].type)throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${o[1].value}".`);if("string"!==o[2].type)throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${o[2].value}.`);const r=o[1].name,i=new RegExp(o[2].value);h[e].push((function(e){for(const t of e)if(t.name===r)return i.test(t.node.text)===n;return!1}));break;case"set!":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error('Arguments to `#set!` predicate must be a strings.".');l[e]||(l[e]={}),l[e][o[1].value]=o[2]?o[2].value:null;break;case"is?":case"is-not?":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#${t}\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error(`Arguments to \`#${t}\` predicate must be a strings.".`);const s="is?"===t?u:d;s[e]||(s[e]={}),s[e][o[1].value]=o[2]?o[2].value:null;break;default:p[e].push({operator:t,operands:o.slice(1)})}o.length=0}}Object.freeze(l[e]),Object.freeze(u[e]),Object.freeze(d[e])}return Ze._free(n),new wt(et,r,a,h,p,Object.freeze(l),Object.freeze(u),Object.freeze(d))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const r=e;if("undefined"!=typeof process&&process.versions&&process.versions.node){const e=n(7147);t=Promise.resolve(e.readFileSync(r))}else t=fetch(r).then((e=>e.arrayBuffer().then((t=>{if(e.ok)return new Uint8Array(t);{const n=new TextDecoder("utf-8").decode(t);throw new Error(`Language.load failed with status ${e.status}.\n\n${n}`)}}))))}const r="function"==typeof loadSideModule?loadSideModule:Pe;return t.then((e=>r(e,{loadAsync:!0}))).then((e=>{const t=Object.keys(e),n=t.find((e=>lt.test(e)&&!e.includes("external_scanner_")));n||console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(t,null,2)}`);const r=e[n]();return new bt(et,r)}))}}class wt{constructor(e,t,n,r,o,i,s,a){Ct(e),this[0]=t,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=i,this.assertedProperties=s,this.refutedProperties=a,this.exceededMatchLimit=!1}delete(){Ze._ts_query_delete(this[0]),this[0]=0}matches(e,t,n){t||(t=it),n||(n=it),Tt(e),Ze._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=P(pt,"i32"),o=P(pt+tt,"i32"),i=P(pt+2*tt,"i32"),s=new Array(r);this.exceededMatchLimit=!!i;let a=0,c=o;for(let t=0;t<r;t++){const n=P(c,"i32"),r=P(c+=tt,"i32");c+=tt;const o=new Array(r);if(c=Et(this,e.tree,c,o),this.textPredicates[n].every((e=>e(o)))){s[a++]={pattern:n,captures:o};const e=this.setProperties[n];e&&(s[t].setProperties=e);const r=this.assertedProperties[n];r&&(s[t].assertedProperties=r);const i=this.refutedProperties[n];i&&(s[t].refutedProperties=i)}}return s.length=a,Ze._free(o),s}captures(e,t,n){t||(t=it),n||(n=it),Tt(e),Ze._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=P(pt,"i32"),o=P(pt+tt,"i32"),i=P(pt+2*tt,"i32"),s=[];this.exceededMatchLimit=!!i;const a=[];let c=o;for(let t=0;t<r;t++){const t=P(c,"i32"),n=P(c+=tt,"i32"),r=P(c+=tt,"i32");if(c+=tt,a.length=n,c=Et(this,e.tree,c,a),this.textPredicates[t].every((e=>e(a)))){const e=a[r],n=this.setProperties[t];n&&(e.setProperties=n);const o=this.assertedProperties[t];o&&(e.assertedProperties=o);const i=this.refutedProperties[t];i&&(e.refutedProperties=i),s.push(e)}}return Ze._free(o),s}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function xt(e,t,n){const r=n-t;let o=e.textCallback(t,null,n);for(t+=o.length;t<n;){const r=e.textCallback(t,null,n);if(!(r&&r.length>0))break;t+=r.length,o+=r}return t>n&&(o=o.slice(0,r)),o}function Et(e,t,n,r){for(let o=0,i=r.length;o<i;o++){const i=P(n,"i32"),s=kt(t,n+=tt);n+=nt,r[o]={name:e.captureNames[i],node:s}}return n}function Ct(e){if(e!==et)throw new Error("Illegal constructor")}function St(e){return e&&"number"==typeof e.row&&"number"==typeof e.column}function Tt(e){let t=pt;I(t,e.id,"i32"),I(t+=tt,e.startIndex,"i32"),I(t+=tt,e.startPosition.row,"i32"),I(t+=tt,e.startPosition.column,"i32"),I(t+=tt,e[0],"i32")}function kt(e,t=pt){const n=P(t,"i32");if(0===n)return null;const r=P(t+=tt,"i32"),o=P(t+=tt,"i32"),i=P(t+=tt,"i32"),s=P(t+=tt,"i32"),a=new yt(et,e);return a.id=n,a.startIndex=r,a.startPosition={row:o,column:i},a[0]=s,a}function It(e,t=pt){I(t+0*tt,e[0],"i32"),I(t+1*tt,e[1],"i32"),I(t+2*tt,e[2],"i32")}function Pt(e){e[0]=P(pt+0*tt,"i32"),e[1]=P(pt+1*tt,"i32"),e[2]=P(pt+2*tt,"i32")}function At(e,t){I(e,t.row,"i32"),I(e+tt,t.column,"i32")}function Ot(e){return{row:P(e,"i32"),column:P(e+tt,"i32")}}function Nt(e,t){At(e,t.startPosition),At(e+=rt,t.endPosition),I(e+=rt,t.startIndex,"i32"),I(e+=tt,t.endIndex,"i32"),e+=tt}function Rt(e){const t={};return t.startPosition=Ot(e),e+=rt,t.endPosition=Ot(e),e+=rt,t.startIndex=P(e,"i32"),e+=tt,t.endIndex=P(e,"i32"),t}return gt.Language=bt,gt.Parser=gt,gt}.apply(t,[]))||(e.exports=r)},3055:(e,t,n)=>{var r,o,i;r={271:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFileSystem=t.FileSystem=void 0;const r=n(747);t.FileSystem=class{},t.defaultFileSystem={readFile:e=>r.promises.readFile(e),mtime:async e=>(await r.promises.stat(e)).mtimeMs,stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},876:(e,t)=>{"use strict";function n(e){return"virtual"===e.type}function r(e){return"top"===e.type}Object.defineProperty(t,"__esModule",{value:!0}),t.duplicateTree=t.cutTreeAfterLine=t.isTop=t.isVirtual=t.isLine=t.isBlank=t.topNode=t.blankNode=t.lineNode=t.virtualNode=void 0,t.virtualNode=function(e,t,n){return{type:"virtual",indentation:e,subs:t,label:n}},t.lineNode=function(e,t,n,r,o){if(""===n)throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:e,lineNumber:t,sourceLine:n,subs:r,label:o}},t.blankNode=function(e){return{type:"blank",lineNumber:e,subs:[]}},t.topNode=function(e){return{type:"top",indentation:-1,subs:null!=e?e:[]}},t.isBlank=function(e){return"blank"===e.type},t.isLine=function(e){return"line"===e.type},t.isVirtual=n,t.isTop=r,t.cutTreeAfterLine=function(e,t){!function e(o){if(!n(o)&&!r(o)&&o.lineNumber===t)return o.subs=[],!0;for(let t=0;t<o.subs.length;t++)if(e(o.subs[t]))return o.subs=o.subs.slice(0,t+1),!0;return!1}(e)},t.duplicateTree=function(e){return JSON.parse(JSON.stringify(e))}},617:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rebuildTree=t.foldTree=t.visitTreeConditionally=t.visitTree=t.resetLineNumbers=t.mapLabels=t.clearLabelsIf=t.clearLabels=void 0;const r=n(876);function o(e,t,n){!function e(r){"topDown"===n&&t(r),r.subs.forEach((t=>{e(t)})),"bottomUp"===n&&t(r)}(e)}t.clearLabels=function(e){return o(e,(e=>{e.label=void 0}),"bottomUp"),e},t.clearLabelsIf=function(e,t){return o(e,(e=>{e.label=e.label?t(e.label)?void 0:e.label:void 0}),"bottomUp"),e},t.mapLabels=function e(t,n){switch(t.type){case"line":case"virtual":const r=t.subs.map((t=>e(t,n)));return{...t,subs:r,label:t.label?n(t.label):void 0};case"blank":return{...t,label:t.label?n(t.label):void 0};case"top":return{...t,subs:t.subs.map((t=>e(t,n))),label:t.label?n(t.label):void 0}}},t.resetLineNumbers=function(e){let t=0;o(e,(function(e){r.isVirtual(e)||r.isTop(e)||(e.lineNumber=t,t++)}),"topDown")},t.visitTree=o,t.visitTreeConditionally=function(e,t,n){!function e(r){if("topDown"===n&&!t(r))return!1;let o=!0;return r.subs.forEach((t=>{o=o&&e(t)})),"bottomUp"===n&&(o=o&&t(r)),o}(e)},t.foldTree=function(e,t,n,r){let i=t;return o(e,(function(e){i=n(e,i)}),r),i},t.rebuildTree=function(e,t,n){const o=e=>{if(void 0!==n&&n(e))return e;{const n=e.subs.map(o).filter((e=>void 0!==e));return e.subs=n,t(e)}},i=o(e);return void 0!==i?i:r.topNode()}},469:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTree=t.registerLanguageSpecificParser=t.flattenVirtual=t.groupBlocks=t.combineClosersAndOpeners=t.buildLabelRules=t.labelVirtualInherited=t.labelLines=t.parseRaw=void 0;const r=n(876),o=n(617);function i(e){const t=e.split("\n"),n=t.map((e=>e.match(/^\s*/)[0].length)),o=t.map((e=>e.trimLeft()));function i(e){const[t,i]=s(e+1,n[e]);return[r.lineNode(n[e],e,o[e],t),i]}function s(e,t){let s;const a=[];let c,l=e;for(;l<o.length&&(""===o[l]||n[l]>t);)if(""===o[l])void 0===c&&(c=l),l+=1;else{if(void 0!==c){for(let e=c;e<l;e++)a.push(r.blankNode(e));c=void 0}[s,l]=i(l),a.push(s)}return void 0!==c&&(l=c),[a,l]}const[a,c]=s(0,-1);let l=c;for(;l<o.length&&""===o[l];)a.push(r.blankNode(l)),l+=1;if(l<o.length)throw new Error(`Parsing did not go to end of file. Ended at ${l} out of ${o.length}`);return r.topNode(a)}function s(e,t){o.visitTree(e,(function(e){if(r.isLine(e)){const n=t.find((t=>t.matches(e.sourceLine)));n&&(e.label=n.label)}}),"bottomUp")}function a(e){return Object.keys(e).map((t=>{let n;return n=e[t].test?n=>e[t].test(n):e[t],{matches:n,label:t}}))}function c(e){const t=o.rebuildTree(e,(function(e){if(0===e.subs.length||-1===e.subs.findIndex((e=>"closer"===e.label||"opener"===e.label)))return e;const t=[];let n;for(let o=0;o<e.subs.length;o++){const i=e.subs[o],s=e.subs[o-1];if("opener"===i.label&&void 0!==s&&r.isLine(s))s.subs.push(i),i.subs.forEach((e=>s.subs.push(e))),i.subs=[];else if("closer"===i.label&&void 0!==n&&(r.isLine(i)||r.isVirtual(i))&&i.indentation>=n.indentation){let e=t.length-1;for(;e>0&&r.isBlank(t[e]);)e-=1;if(n.subs.push(...t.splice(e+1)),i.subs.length>0){const e=n.subs.findIndex((e=>"newVirtual"!==e.label)),t=n.subs.slice(0,e),o=n.subs.slice(e),s=o.length>0?[r.virtualNode(i.indentation,o,"newVirtual")]:[];n.subs=[...t,...s,i]}else n.subs.push(i)}else t.push(i),r.isBlank(i)||(n=i)}return e.subs=t,e}));return o.clearLabelsIf(e,(e=>"newVirtual"===e)),t}t.parseRaw=i,t.labelLines=s,t.labelVirtualInherited=function(e){o.visitTree(e,(function(e){if(r.isVirtual(e)&&void 0===e.label){const t=e.subs.filter((e=>!r.isBlank(e)));1===t.length&&(e.label=t[0].label)}}),"bottomUp")},t.buildLabelRules=a,t.combineClosersAndOpeners=c,t.groupBlocks=function(e,t=r.isBlank,n){return o.rebuildTree(e,(function(e){if(e.subs.length<=1)return e;const o=[];let i,s=[],a=!1;function c(e=!1){if(void 0!==i&&(o.length>0||!e)){const e=r.virtualNode(i,s,n);o.push(e)}else s.forEach((e=>o.push(e)))}for(let n=0;n<e.subs.length;n++){const o=e.subs[n],l=t(o);!l&&a&&(c(),s=[]),a=l,s.push(o),r.isBlank(o)||(i=null!=i?i:o.indentation)}return c(!0),e.subs=o,e}))},t.flattenVirtual=function(e){return o.rebuildTree(e,(function(e){return r.isVirtual(e)&&void 0===e.label&&e.subs.length<=1?0===e.subs.length?void 0:e.subs[0]:(1===e.subs.length&&r.isVirtual(e.subs[0])&&void 0===e.subs[0].label&&(e.subs=e.subs[0].subs),e)}))};const l=a({opener:/^[\[({]/,closer:/^[\])}]/}),u={};t.registerLanguageSpecificParser=function(e,t){u[e]=t},t.parseTree=function(e,t){const n=i(e),r=u[null!=t?t:""];return r?r(n):(s(n,l),c(n))}},250:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowsDelineations=void 0;const r=n(469),o=n(617);t.getWindowsDelineations=function(e,t,n,i){if(e.length<n||0==i)return[];const s=[],a=o.clearLabels(r.parseTree(e.join("\n"),t));return o.visitTree(a,(e=>{if("blank"===e.type)return void(e.label={totalLength:1,firstLineAfter:e.lineNumber+1});let t="line"===e.type?1:0,r="line"===e.type?e.lineNumber+1:NaN;function o(n){return-1==n?r-t:e.subs[n].label.firstLineAfter-e.subs[n].label.totalLength}function a(t,n){return 0==t?n+1:e.subs[t-1].label.firstLineAfter}let c="line"===e.type?-1:0,l="line"===e.type?1:0,u=0;for(let d=0;d<e.subs.length;d++){for(;c>=0&&c<e.subs.length&&"blank"===e.subs[c].type;)l-=e.subs[c].label.totalLength,c++;if("blank"!==e.subs[d].type&&(u=d),r=e.subs[d].label.firstLineAfter,t+=e.subs[d].label.totalLength,l+=e.subs[d].label.totalLength,l>i){const t=o(c),r=a(d,t),p=u==d?r:a(u,t);for(n<=r-t&&s.push([t,p]);l>i;)l-=-1==c?"line"==e.type?1:0:e.subs[c].label.totalLength,c++}}if(c<e.subs.length){const t=o(c),i=r,a=-1==c?i:e.subs[u].label.firstLineAfter;n<=i-t&&s.push([t,a])}e.label={totalLength:t,firstLineAfter:r}}),"bottomUp"),s.sort(((e,t)=>e[0]-t[0]||e[1]-t[1])).filter(((e,t,n)=>0==t||e[0]!=n[t-1][0]||e[1]!=n[t-1][1]))}},417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMarker=t.getLanguageMarker=t.comment=t.hasLanguageMarker=t.languageCommentMarkers=void 0,t.languageCommentMarkers={abap:{start:'"',end:""},bat:{start:"REM",end:""},bibtex:{start:"%",end:""},blade:{start:"#",end:""},c:{start:"//",end:""},clojure:{start:";",end:""},coffeescript:{start:"//",end:""},cpp:{start:"//",end:""},csharp:{start:"//",end:""},css:{start:"/*",end:"*/"},dart:{start:"//",end:""},dockerfile:{start:"#",end:""},elixir:{start:"#",end:""},erb:{start:"<%#",end:"%>"},erlang:{start:"%",end:""},fsharp:{start:"//",end:""},go:{start:"//",end:""},groovy:{start:"//",end:""},haml:{start:"-#",end:""},handlebars:{start:"{{!",end:"}}"},haskell:{start:"--",end:""},html:{start:"\x3c!--",end:"--\x3e"},ini:{start:";",end:""},java:{start:"//",end:""},javascript:{start:"//",end:""},javascriptreact:{start:"//",end:""},jsonc:{start:"//",end:""},jsx:{start:"//",end:""},julia:{start:"#",end:""},kotlin:{start:"//",end:""},latex:{start:"%",end:""},less:{start:"//",end:""},lua:{start:"--",end:""},makefile:{start:"#",end:""},markdown:{start:"[]: #",end:""},"objective-c":{start:"//",end:""},"objective-cpp":{start:"//",end:""},perl:{start:"#",end:""},php:{start:"//",end:""},powershell:{start:"#",end:""},pug:{start:"//",end:""},python:{start:"#",end:""},ql:{start:"//",end:""},r:{start:"#",end:""},razor:{start:"\x3c!--",end:"--\x3e"},ruby:{start:"#",end:""},rust:{start:"//",end:""},sass:{start:"//",end:""},scala:{start:"//",end:""},scss:{start:"//",end:""},shellscript:{start:"#",end:""},slim:{start:"/",end:""},solidity:{start:"//",end:""},sql:{start:"--",end:""},stylus:{start:"//",end:""},svelte:{start:"\x3c!--",end:"--\x3e"},swift:{start:"//",end:""},terraform:{start:"#",end:""},tex:{start:"%",end:""},typescript:{start:"//",end:""},typescriptreact:{start:"//",end:""},vb:{start:"'",end:""},verilog:{start:"//",end:""},"vue-html":{start:"\x3c!--",end:"--\x3e"},vue:{start:"//",end:""},xml:{start:"\x3c!--",end:"--\x3e"},xsl:{start:"\x3c!--",end:"--\x3e"},yaml:{start:"#",end:""}};const n=["php","plaintext"],r={html:"<!DOCTYPE html>",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function o({source:e}){return e.startsWith("#!")||e.startsWith("<!DOCTYPE")}function i(e,n){const r=t.languageCommentMarkers[n];if(r){const t=""==r.end?"":" "+r.end;return`${r.start} ${e}${t}`}return""}t.hasLanguageMarker=o,t.comment=i,t.getLanguageMarker=function(e){const{languageId:t}=e;return-1!==n.indexOf(t)||o(e)?"":t in r?r[t]:i(`Language: ${t}`,t)},t.getPathMarker=function(e){return e.relativePath?i(`Path: ${e.relativePath}`,e.languageId):""}},563:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.createWorker=t.FileSystem=t.comment=t.languageCommentMarkers=void 0;const i=n(622),s=n(13);o(n(306),t),o(n(610),t),o(n(312),t),o(n(94),t);var a=n(417);Object.defineProperty(t,"languageCommentMarkers",{enumerable:!0,get:function(){return a.languageCommentMarkers}}),Object.defineProperty(t,"comment",{enumerable:!0,get:function(){return a.comment}});var c=n(271);Object.defineProperty(t,"FileSystem",{enumerable:!0,get:function(){return c.FileSystem}}),t.createWorker=function(){return new s.Worker(i.resolve(__dirname,"..","dist","worker.js"))}},179:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractLocalImportContext=t.getDocComment=void 0;const r=n(622),o=n(306);function i(e,t){var n;let o=null===(n=t.namedChild(1))||void 0===n?void 0:n.text.slice(1,-1);if(!o||!o.startsWith("."))return null;if(""===r.extname(o))o+=".ts";else if(".ts"!==r.extname(o))return null;return r.join(r.dirname(e),o)}function s(e){var t,n,r,o,i;let s=[];if("import_clause"===(null===(t=e.namedChild(0))||void 0===t?void 0:t.type)){let t=e.namedChild(0);if("named_imports"===(null===(n=null==t?void 0:t.namedChild(0))||void 0===n?void 0:n.type)){let e=t.namedChild(0);for(let t of null!==(r=null==e?void 0:e.namedChildren)&&void 0!==r?r:[])if("import_specifier"===t.type){const e=null===(o=t.childForFieldName("name"))||void 0===o?void 0:o.text;if(e){const n=null===(i=t.childForFieldName("alias"))||void 0===i?void 0:i.text;s.push({name:e,alias:n})}}}}return s}const a=new Map;function c(e,t){var n,r;let o=null!==(r=null===(n=null==t?void 0:t.childForFieldName("name"))||void 0===n?void 0:n.text)&&void 0!==r?r:"";switch(null==t?void 0:t.type){case"ambient_declaration":return c(e,t.namedChild(0));case"interface_declaration":case"enum_declaration":case"type_alias_declaration":return{name:o,decl:t.text};case"function_declaration":case"function_signature":return{name:o,decl:l(e,t)};case"class_declaration":{let n=function(e,t){let n=t.childForFieldName("body");if(n)return n.namedChildren.map((t=>d(e,t))).filter((e=>e))}(e,t),r="";if(n){let o=t.childForFieldName("body");r=`declare ${e.substring(t.startIndex,o.startIndex+1)}`,r+=n.map((e=>"\n"+e)).join(""),r+="\n}"}return{name:o,decl:r}}}return{name:o,decl:""}}function l(e,t){var n,r,o;const i=null!==(r=null===(n=t.childForFieldName("return_type"))||void 0===n?void 0:n.endIndex)&&void 0!==r?r:null===(o=t.childForFieldName("parameters"))||void 0===o?void 0:o.endIndex;if(void 0!==i){let n=e.substring(t.startIndex,i)+";";return"function_declaration"===t.type||"function_signature"===t.type?"declare "+n:n}return""}function u(e,t){const n=o.getFirstPrecedingComment(t);return n?e.substring(n.startIndex,t.startIndex):""}function d(e,t){var n,r,i,s,a;if("accessibility_modifier"===(null===(n=null==t?void 0:t.firstChild)||void 0===n?void 0:n.type)&&"private"===t.firstChild.text)return"";const c=o.getFirstPrecedingComment(t),p=null!==(r=function(e,t){let n=t.startIndex-1;for(;n>=0&&(" "===e[n]||"\t"===e[n]);)n--;if(n<0||"\n"===e[n])return e.substring(n+1,t.startIndex)}(e,null!=c?c:t))&&void 0!==r?r:" ",h=u(e,t);switch(t.type){case"ambient_declaration":const n=t.namedChild(0);return n?p+h+d(e,n):"";case"method_definition":case"method_signature":return p+h+l(e,t);case"public_field_definition":{let n=null!==(s=null===(i=t.childForFieldName("type"))||void 0===i?void 0:i.endIndex)&&void 0!==s?s:null===(a=t.childForFieldName("name"))||void 0===a?void 0:a.endIndex;if(void 0!==n)return p+h+e.substring(t.startIndex,n)+";"}}return""}async function p(e,t,n){let r=new Map,i=-1;try{i=await n.mtime(e)}catch{return r}let s=a.get(e);if(s&&s.mtime===i)return s.exports;if("typescript"===t){let i=null;try{let s=(await n.readFile(e)).toString();i=await o.parseTree(t,s);for(let e of o.queryExports(t,i.rootNode))for(let t of e.captures){let e=t.node;if("export_statement"===e.type){let t=e.childForFieldName("declaration");if(null==t?void 0:t.hasError())continue;let{name:n,decl:o}=c(s,t);if(n){o=u(s,e)+o;let t=r.get(n);t||(t=[],r.set(n,t)),t.push(o)}}}}catch{}finally{i&&i.delete()}}if(a.size>2e3)for(let e of a.keys())if(a.delete(e),r.size<=1e3)break;return a.set(e,{mtime:i,exports:r}),r}t.getDocComment=u;const h=/^\s*import\s*(type|)\s*\{[^}]*\}\s*from\s*['"]\./gm;t.extractLocalImportContext=async function(e,t){let{source:n,uri:r,languageId:a}=e;return t&&"typescript"===a?async function(e,t,n){let r="typescript",a=[];const c=function(e){let t,n=-1;h.lastIndex=-1;do{t=h.exec(e),t&&(n=h.lastIndex+t.length)}while(t);if(-1===n)return-1;const r=e.indexOf("\n",n);return-1!==r?r:e.length}(e);if(-1===c)return a;e=e.substring(0,c);let l=await o.parseTree(r,e);try{for(let e of function(e){let t=[];for(let n of e.namedChildren)"import_statement"===n.type&&t.push(n);return t}(l.rootNode)){let o=i(t,e);if(!o)continue;let c=s(e);if(0===c.length)continue;let l=await p(o,r,n);for(let e of c)l.has(e.name)&&a.push(...l.get(e.name))}}finally{l.delete()}return a}(n,r,t):[]}},306:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionPositions=t.getFirstPrecedingComment=t.isFunctionDefinition=t.isFunction=t.getAncestorWithSiblingFunctions=t.queryPythonIsDocstring=t.queryGlobalVars=t.queryExports=t.queryImports=t.queryFunctions=t.getBlockCloseToken=t.parsesWithoutError=t.parseTree=t.getLanguage=t.languageIdToWasmLanguage=t.isSupportedLanguageId=t.WASMLanguage=void 0;const r=n(622),o=n(87),i=n(87);var s;!function(e){e.Python="python",e.JavaScript="javascript",e.TypeScript="typescript",e.Go="go",e.Ruby="ruby"}(s=t.WASMLanguage||(t.WASMLanguage={}));const a={python:s.Python,javascript:s.JavaScript,javascriptreact:s.JavaScript,jsx:s.JavaScript,typescript:s.TypeScript,typescriptreact:s.TypeScript,go:s.Go,ruby:s.Ruby};function c(e){if(!(e in a))throw new Error(`Unrecognized language: ${e}`);return a[e]}t.isSupportedLanguageId=function(e){return e in a},t.languageIdToWasmLanguage=c;const l={python:[["(function_definition body: (block\n (expression_statement (string))? @docstring) @body) @function"],['(ERROR ("def" (identifier) (parameters))) @function']],javascript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],typescript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],go:[["[\n (function_declaration body: (block) @body)\n (method_declaration body: (block) @body)\n ] @function"]],ruby:[['[\n (method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n (singleton_method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n ] @function']]},u='(variable_declarator value: (call_expression function: ((identifier) @req (#eq? @req "require"))))',d=`\n (lexical_declaration ${u}+)\n (variable_declaration ${u}+)\n`,p={python:[["(module (future_import_statement) @import)"],["(module (import_statement) @import)"],["(module (import_from_statement) @import)"]],javascript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) ] @import)"]],typescript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) (import_alias) ] @import)"]],go:[],ruby:[]},h={python:[],javascript:[["(program (export_statement) @export)"]],typescript:[["(program (export_statement) @export)"]],go:[],ruby:[]},f={python:[["(module (global_statement) @globalVar)"],["(module (expression_statement) @globalVar)"]],javascript:[],typescript:[],go:[],ruby:[]},m={python:new Set(["function_definition"]),javascript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),typescript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),go:new Set(["function_declaration","method_declaration"]),ruby:new Set(["method","singleton_method"])},g={python:e=>{var t;return"module"===e.type||"block"===e.type&&"class_definition"===(null===(t=e.parent)||void 0===t?void 0:t.type)},javascript:e=>"program"===e.type||"class_body"===e.type,typescript:e=>"program"===e.type||"class_body"===e.type,go:e=>"source_file"===e.type,ruby:e=>"program"===e.type||"class"===e.type},_=new Map;async function y(e){const t=c(e);if(!_.has(t)){const e=await async function(e){await o.init();const t=r.resolve(__dirname,"..","dist",`tree-sitter-${e}.wasm`);return i.Language.load(t)}(t);_.set(t,e)}return _.get(t)}async function v(e,t){let n=await y(e);const r=new o;r.setLanguage(n);const i=r.parse(t);return r.delete(),i}function b(e,t){const n=[];for(const r of e){if(!r[1]){const e=t.tree.getLanguage();r[1]=e.query(r[0])}n.push(...r[1].matches(t))}return n}function w(e,t){return b(l[c(e)],t)}t.getLanguage=y,t.parseTree=v,t.parsesWithoutError=async function(e,t){const n=await v(e,t),r=!n.rootNode.hasError();return n.delete(),r},t.getBlockCloseToken=function(e){switch(c(e)){case s.Python:return null;case s.JavaScript:case s.TypeScript:case s.Go:return"}";case s.Ruby:return"end"}},t.queryFunctions=w,t.queryImports=function(e,t){return b(p[c(e)],t)},t.queryExports=function(e,t){return b(h[c(e)],t)},t.queryGlobalVars=function(e,t){return b(f[c(e)],t)};const x=["[\n (class_definition (block (expression_statement (string))))\n (function_definition (block (expression_statement (string))))\n]"];function E(e,t){return m[c(e)].has(t.type)}t.queryPythonIsDocstring=function(e){return 1==b([x],e).length},t.getAncestorWithSiblingFunctions=function(e,t){const n=g[c(e)];for(;t.parent;){if(n(t.parent))return t;t=t.parent}return t.parent?t:null},t.isFunction=E,t.isFunctionDefinition=function(e,t){switch(c(e)){case s.Python:case s.Go:case s.Ruby:return E(e,t);case s.JavaScript:case s.TypeScript:if("function_declaration"===t.type||"generator_function_declaration"===t.type||"method_definition"===t.type)return!0;if("lexical_declaration"===t.type||"variable_declaration"===t.type){if(t.namedChildCount>1)return!1;let n=t.namedChild(0);if(null==n)return!1;let r=n.namedChild(1);return null!==r&&E(e,r)}if("expression_statement"===t.type){let n=t.namedChild(0);if("assignment_expression"===(null==n?void 0:n.type)){let t=n.namedChild(1);return null!==t&&E(e,t)}}return!1}},t.getFirstPrecedingComment=function(e){var t;let n=e;for(;"comment"===(null===(t=n.previousSibling)||void 0===t?void 0:t.type);){let e=n.previousSibling;if(e.endPosition.row<n.startPosition.row-1)break;n=e}return"comment"===(null==n?void 0:n.type)?n:null},t.getFunctionPositions=async function(e,t){return w(e,(await v(e,t)).rootNode).map((e=>{const t=e.captures.find((e=>"function"===e.name)).node;return{startIndex:t.startIndex,endIndex:t.endIndex}}))}},610:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeStart=t.isBlockBodyFinished=t.isEmptyBlockStart=t.getBlockParser=void 0;const r=n(306);class o{constructor(e,t,n){this.languageId=e,this.nodeMatch=t,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,t,n){const o=await r.parseTree(this.languageId,e);try{let e=o.rootNode.descendantForIndex(t);for(;e;){const t=this.nodeMatch[e.type];if(t){if(!this.nodeTypesWithBlockOrStmtChild.has(e.type))break;const n=this.nodeTypesWithBlockOrStmtChild.get(e.type),r=""==n?e.namedChildren[0]:e.childForFieldName(n);if((null==r?void 0:r.type)==t)break}e=e.parent}if(!e)return;return n(e)}finally{o.delete()}}getNextBlockAtPosition(e,t,n){return this.getNodeMatchAtPosition(e,t,(e=>{let t=e.children.reverse().find((t=>t.type==this.nodeMatch[e.type]));if(t){if("python"==this.languageId&&t.parent){const e=":"==t.parent.type?t.parent.parent:t.parent;let n=null==e?void 0:e.nextSibling;for(;n&&"comment"==n.type;){const r=n.startPosition.row==t.endPosition.row&&n.startPosition.column>=t.endPosition.column,o=n.startPosition.row>e.endPosition.row&&n.startPosition.column>e.startPosition.column;if(!r&&!o)break;t=n,n=n.nextSibling}}if(!(t.endIndex>=t.tree.rootNode.endIndex-1&&(t.hasError()||t.parent.hasError())))return n(t)}}))}async isBlockBodyFinished(e,t,n){const r=(e+t).trimEnd(),o=await this.getNextBlockAtPosition(r,n,(e=>e.endIndex));if(void 0!==o&&o<r.length){const t=o-e.length;return t>0?t:void 0}}getNodeStart(e,t){const n=e.trimEnd();return this.getNodeMatchAtPosition(n,t,(e=>e.startIndex))}}class i extends o{constructor(e,t,n,r,o){super(e,r,o),this.blockEmptyMatch=t,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,t){const n=await this.getNextBlockAtPosition(e,t,(n=>{n.startIndex<t&&(t=n.startIndex);let r=e.substring(t,n.endIndex).trim();return""==r||r.replace(/\s/g,"")==this.blockEmptyMatch}));return void 0===n||n}async isEmptyBlockStart(e,t){return t=s(e,t),this.isBlockStart(function(e,t){const n=e.lastIndexOf("\n",t-1);let r=e.indexOf("\n",t);return r<0&&(r=e.length),e.slice(n+1,r)}(e,t))&&this.isBlockBodyEmpty(e,t)}}function s(e,t){let n=t;for(;n>0&&/\s/.test(e.charAt(n-1));)n--;return n}function a(e,t){const n=e.startIndex,r=e.startIndex-e.startPosition.column,o=t.substring(r,n);if(/^\s*$/.test(o))return o}function c(e,t,n){if(t.startPosition.row<=e.startPosition.row)return!1;const r=a(e,n),o=a(t,n);return void 0!==r&&void 0!==o&&r.startsWith(o)}class l extends o{constructor(e,t,n,r,o,i,s){super(e,t,n),this.startKeywords=r,this.blockNodeType=o,this.emptyStatementType=i,this.curlyBraceLanguage=s}isBlockEmpty(e,t){var n,o;let i=e.text.trim();return this.curlyBraceLanguage&&(i.startsWith("{")&&(i=i.slice(1)),i.endsWith("}")&&(i=i.slice(0,-1)),i=i.trim()),0==i.length||!("python"!=this.languageId||"class_definition"!=(null===(n=e.parent)||void 0===n?void 0:n.type)&&"function_definition"!=(null===(o=e.parent)||void 0===o?void 0:o.type)||1!=e.children.length||!r.queryPythonIsDocstring(e.parent))}async isEmptyBlockStart(e,t){var n,o,i;if(t>e.length)throw new RangeError("Invalid offset");for(let n=t;n<e.length&&"\n"!=e.charAt(n);n++)if(/\S/.test(e.charAt(n)))return!1;t=s(e,t);const a=await r.parseTree(this.languageId,e);try{const r=a.rootNode.descendantForIndex(t-1);if(null==r)return!1;if(this.curlyBraceLanguage&&"}"==r.type)return!1;if(("javascript"==this.languageId||"typescript"==this.languageId)&&r.parent&&"object"==r.parent.type&&"{"==r.parent.text.trim())return!0;if("typescript"==this.languageId){let n=r;for(;n.parent;){if("function_signature"==n.type||"method_signature"==n.type){const o=r.nextSibling;return!!(o&&n.hasError()&&c(n,o,e))||!n.children.find((e=>";"==e.type))&&n.endIndex<=t}n=n.parent}}let s=null,l=null,u=null,d=r;for(;null!=d;){if(d.type==this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if("ERROR"==d.type){s=d;break}d=d.parent}if(null!=l){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if("python"==this.languageId){const e=l.previousSibling;if(null!=e&&e.hasError()&&(e.text.startsWith('"""')||e.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,t)}if(null!=s){if("module"==(null===(n=s.previousSibling)||void 0===n?void 0:n.type)||"internal_module"==(null===(o=s.previousSibling)||void 0===o?void 0:o.type))return!0;const e=[...s.children].reverse(),a=e.find((e=>this.startKeywords.includes(e.type)));let c=e.find((e=>e.type==this.blockNodeType));if(a){switch(this.languageId){case"python":{"try"==a.type&&"identifier"==r.type&&r.text.length>4&&(c=null===(i=e.find((e=>e.hasError())))||void 0===i?void 0:i.children.find((e=>"block"==e.type)));const t=e.find((e=>":"==e.type));if(t&&a.endIndex<=t.startIndex&&t.nextSibling){if("def"==a.type){const e=t.nextSibling;if('"'==e.type||"'"==e.type)return!0;if("ERROR"==e.type&&('"""'==e.text||"'''"==e.text))return!0}return!1}break}case"javascript":{const t=e.find((e=>"formal_parameters"==e.type));if("class"==a.type&&t)return!0;const n=e.find((e=>"{"==e.type));if(n&&n.startIndex>a.endIndex&&null!=n.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}case"typescript":{const t=e.find((e=>"{"==e.type));if(t&&t.startIndex>a.endIndex&&null!=t.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}}return!(c&&c.startIndex>a.endIndex)||this.isBlockEmpty(c,t)}}if(null!=u){const e=this.nodeMatch[u.type],n=u.children.slice().reverse().find((t=>t.type==e));if(n)return this.isBlockEmpty(n,t);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){const e=this.nodeTypesWithBlockOrStmtChild.get(u.type),t=""==e?u.children[0]:u.childForFieldName(e);if(t&&t.type!=this.blockNodeType&&t.type!=this.emptyStatementType)return!1}return!0}return!1}finally{a.delete()}}}const u={python:new l("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new l("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new l("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new i("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new i("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map)};function d(e){return u[r.languageIdToWasmLanguage(e)]}t.getBlockParser=d,t.isEmptyBlockStart=async function(e,t,n){return!!r.isSupportedLanguageId(e)&&d(e).isEmptyBlockStart(t,n)},t.isBlockBodyFinished=async function(e,t,n,o){if(r.isSupportedLanguageId(e))return d(e).isBlockBodyFinished(t,n,o)},t.getNodeStart=async function(e,t,n){if(r.isSupportedLanguageId(e))return d(e).getNodeStart(t,n)}},312:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrompt=t.newLineEnded=t.normalizeLanguageId=t.PromptOptions=t.SuffixStartMode=t.SuffixMatchOption=t.SuffixOption=t.LineEndingOptions=t.LocalImportContextOption=t.NeighboringTabsPositionOption=t.NeighboringTabsOption=t.SiblingOption=t.PathMarkerOption=t.LanguageMarkerOption=t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=t.MAX_PROMPT_LENGTH=void 0;const r=n(94),o=n(417),i=n(179),s=n(125),a=n(670),c=n(94),l=n(456),u=n(395);let d="";var p,h,f,m,g,_,y,v,b,w;t.MAX_PROMPT_LENGTH=1500,t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=5,function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(p=t.LanguageMarkerOption||(t.LanguageMarkerOption={})),function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(h=t.PathMarkerOption||(t.PathMarkerOption={})),function(e){e.NoSiblings="nosiblings",e.SiblingsOverContext="siblingabove",e.ContextOverSiblings="contextabove"}(f=t.SiblingOption||(t.SiblingOption={})),function(e){e.None="none",e.Conservative="conservative",e.Medium="medium",e.Eager="eager",e.EagerButLittle="eagerButLittle"}(m=t.NeighboringTabsOption||(t.NeighboringTabsOption={})),function(e){e.TopOfText="top",e.DirectlyAboveCursor="aboveCursor",e.AfterSiblings="afterSiblings"}(g=t.NeighboringTabsPositionOption||(t.NeighboringTabsPositionOption={})),function(e){e.NoContext="nocontext",e.Declarations="declarations"}(_=t.LocalImportContextOption||(t.LocalImportContextOption={})),function(e){e.ConvertToUnix="unix",e.KeepOriginal="keep"}(y=t.LineEndingOptions||(t.LineEndingOptions={})),(w=t.SuffixOption||(t.SuffixOption={})).None="none",w.FifteenPercent="fifteenPercent",function(e){e.Equal="equal",e.Levenshtein="levenshteineditdistance"}(v=t.SuffixMatchOption||(t.SuffixMatchOption={})),function(e){e.Cursor="cursor",e.CursorTrimStart="cursortrimstart",e.SiblingBlock="siblingblock",e.SiblingBlockTrimStart="siblingblocktrimstart"}(b=t.SuffixStartMode||(t.SuffixStartMode={}));class x{constructor(e,n){if(this.fs=e,this.maxPromptLength=t.MAX_PROMPT_LENGTH,this.languageMarker=p.Top,this.pathMarker=h.Top,this.includeSiblingFunctions=f.ContextOverSiblings,this.localImportContext=_.Declarations,this.neighboringTabs=m.Eager,this.neighboringTabsPosition=g.TopOfText,this.lineEnding=y.ConvertToUnix,this.suffixPercent=0,this.suffixStartMode=b.Cursor,this.suffixMatchThreshold=20,this.suffixMatchCriteria=v.Levenshtein,n)for(const e in n)this[e]=n[e];if(this.suffixPercent<0||this.suffixPercent>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${this.suffixPercent}`);if(this.suffixPercent>0&&this.includeSiblingFunctions!=f.NoSiblings)throw new Error(`Invalid option combination. Cannot set suffixPercent > 0 (${this.suffixPercent}) and includeSiblingFunctions ${this.includeSiblingFunctions}`);if(this.suffixMatchThreshold<0||this.suffixMatchThreshold>100)throw new Error(`suffixMatchThreshold must be at between 0 and 100, but was ${this.suffixMatchThreshold}`);if(null!=this.neighboringTabsMinLength&&null!=this.neighboringTabsMaxLength&&this.neighboringTabsMinLength>this.neighboringTabsMaxLength)throw new Error(`neighboringTabsMinLength must be less than or equal to neighboringTabsMaxLength, but was ${this.neighboringTabsMinLength} and ${this.neighboringTabsMaxLength}`)}}t.PromptOptions=x;const E={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor"};function C(e){var t;return e=e.toLowerCase(),null!==(t=E[e])&&void 0!==t?t:e}function S(e){return""==e||e.endsWith("\n")?e:e+"\n"}t.normalizeLanguageId=C,t.newLineEnded=S,t.getPrompt=async function(e,n,y={},w=[]){var E;const T=new x(e,y);let k=!1;const{source:I,offset:P}=n;if(P<0||P>I.length)throw new Error(`Offset ${P} is out of range.`);n.languageId=C(n.languageId);const A=new l.Priorities,O=A.justBelow(l.Priorities.TOP),N=T.languageMarker==p.Always?A.justBelow(l.Priorities.TOP):A.justBelow(O),R=T.pathMarker==h.Always?A.justBelow(l.Priorities.TOP):A.justBelow(O),M=T.includeSiblingFunctions==f.ContextOverSiblings?A.justBelow(O):A.justAbove(O),L=A.justBelow(O,M),$=A.justBelow(L),D=new l.PromptWishlist(T.lineEnding);let F,j;if(T.languageMarker!=p.NoMarker){const e=S(o.getLanguageMarker(n));F=D.append(e,l.PromptElementKind.LanguageMarker,N)}if(T.pathMarker!=h.NoMarker){const e=S(o.getPathMarker(n));e.length>0&&(j=D.append(e,l.PromptElementKind.PathMarker,R))}if(T.localImportContext!=_.NoContext)for(const e of await i.extractLocalImportContext(n,T.fs))D.append(S(e),l.PromptElementKind.ImportedFile,L);const q=T.neighboringTabs==m.None||0==w.length?[]:await s.getNeighborSnippets(n,w,T.neighboringTabs,T.neighboringTabsMinLength,T.neighboringTabsMaxLength);function B(){q.forEach((e=>D.append(e.snippet,l.PromptElementKind.SimilarFile,$,c.tokenLength(e.snippet),e.score)))}T.neighboringTabsPosition==g.TopOfText&&B();const U=[];let H;if(T.includeSiblingFunctions==f.NoSiblings)H=I.substring(0,P);else{const{siblings:e,beforeInsertion:t,afterInsertion:r}=await a.getSiblingFunctions(n);D.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));let o=M;e.forEach((e=>{D.append(e,l.PromptElementKind.AfterCursor,o),o=A.justBelow(o)})),T.neighboringTabsPosition==g.AfterSiblings&&B(),H=r}if(T.neighboringTabsPosition==g.DirectlyAboveCursor){const e=H.lastIndexOf("\n")+1,t=H.substring(0,e),n=H.substring(e);D.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e))),B(),n.length>0&&(U.push(D.append(n,l.PromptElementKind.AfterCursor,O)),U.length>1&&D.require(U[U.length-2],U[U.length-1]))}else D.appendLineForLine(H,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));if(p.Top==T.languageMarker&&U.length>0&&void 0!==F&&D.require(F,U[0]),h.Top==T.pathMarker&&U.length>0&&void 0!==j&&(F?D.require(j,F):D.require(j,U[0])),void 0!==F&&void 0!==j&&D.exclude(j,F),0==T.suffixPercent)return D.fulfill(T.maxPromptLength);{let e=n.offset;T.suffixStartMode!==b.Cursor&&T.suffixStartMode!==b.CursorTrimStart&&(e=await a.getSiblingFunctionStart(n));const o=T.maxPromptLength-t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING;let i=Math.floor(o*(100-T.suffixPercent)/100),s=D.fulfill(i);const l=o-s.prefixLength;let p=I.slice(e);T.suffixStartMode!=b.SiblingBlockTrimStart&&T.suffixStartMode!=b.CursorTrimStart||(p=p.trimStart());const h=r.takeFirstTokens(p,l),f=c.tokenLength(h);f<=l-3&&(i=o-f,s=D.fulfill(i));const m=h.length,g=c.tokenLength(d);if(T.suffixMatchCriteria==v.Equal)h===d&&(k=!0);else if(T.suffixMatchCriteria==v.Levenshtein){const e=null===(E=u.findEditDistanceScore(h,d))||void 0===E?void 0:E.score;m>0&&T.suffixMatchThreshold>0&&100*e<T.suffixMatchThreshold*m&&(k=!0)}return!0===k&&g<=l?(g<=l-3&&(i=o-g,s=D.fulfill(i)),s.suffix=d,s.suffixLength=g):(s.suffix=h,s.suffixLength=f,d=h),s}}},670:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSiblingFunctionStart=t.getSiblingFunctions=void 0;const r=n(312),o=n(306);t.getSiblingFunctions=async function({source:e,offset:t,languageId:n}){var i,s;const a=[];let c="",l=e.substring(0,t);if(o.isSupportedLanguageId(n)){const u=await o.parseTree(n,e);try{let d=t;for(;d>=0&&/\s/.test(e[d]);)d--;const p=u.rootNode.descendantForIndex(d),h=o.getAncestorWithSiblingFunctions(n,p);if(h){const u=o.getFirstPrecedingComment(h),d=null!==(i=null==u?void 0:u.startIndex)&&void 0!==i?i:h.startIndex;let p,f=0;for(;" "==(p=e[d-f-1])||"\t"==p;)f++;const m=e.substring(d-f,d);for(let i=h.nextSibling;i;i=i.nextSibling)if(o.isFunctionDefinition(n,i)){const n=o.getFirstPrecedingComment(i),c=null!==(s=null==n?void 0:n.startIndex)&&void 0!==s?s:i.startIndex;if(c<t)continue;const l=e.substring(c,i.endIndex),u=r.newLineEnded(l)+"\n"+m;a.push(u)}c=e.substring(0,d),l=e.substring(d,t)}}finally{u.delete()}}return{siblings:a,beforeInsertion:c,afterInsertion:l}},t.getSiblingFunctionStart=async function({source:e,offset:t,languageId:n}){var r;if(o.isSupportedLanguageId(n)){const i=await o.parseTree(n,e);try{let s=t;for(;s>=0&&/\s/.test(e[s]);)s--;const a=i.rootNode.descendantForIndex(s),c=o.getAncestorWithSiblingFunctions(n,a);if(c){for(let e=c.nextSibling;e;e=e.nextSibling)if(o.isFunctionDefinition(n,e)){const n=o.getFirstPrecedingComment(e),i=null!==(r=null==n?void 0:n.startIndex)&&void 0!==r?r:e.startIndex;if(i<t)continue;return i}if(c.endIndex>=t)return c.endIndex}}finally{i.delete()}}return t}},404:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeScore=t.IndentationBasedJaccardMatcher=t.FixedWindowSizeJaccardMatcher=void 0;const r=n(250),o=n(467);class i extends o.WindowedMatcher{constructor(e,t){super(e),this.windowLength=t}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){const t=[],n=e.length;for(let e=0;0==e||e<n-this.windowLength;e++){const r=Math.min(e+this.windowLength,n);t.push([e,r])}return t}trimDocument(e){return e.source.slice(0,e.offset).split("\n").slice(-this.windowLength).join("\n")}similarityScore(e,t){return a(e,t)}}t.FixedWindowSizeJaccardMatcher=i,i.FACTORY=e=>({to:t=>new i(t,e)});class s extends o.WindowedMatcher{constructor(e,t,n){super(e),this.minLength=t,this.maxLength=n,this.languageId=e.languageId}id(){return`indent:${this.minLength}:${this.maxLength}:${this.languageId}`}getWindowsDelineations(e){return r.getWindowsDelineations(e,this.languageId,this.minLength,this.maxLength)}trimDocument(e){return e.source.slice(0,e.offset).split("\n").slice(-this.maxLength).join("\n")}similarityScore(e,t){return a(e,t)}}function a(e,t){const n=new Set;return e.forEach((e=>{t.has(e)&&n.add(e)})),n.size/(e.size+t.size-n.size)}t.IndentationBasedJaccardMatcher=s,s.FACTORY=(e,t)=>({to:n=>new s(n,e,t)}),t.computeScore=a},125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNeighborSnippets=t.neighborOptionToSelection=void 0;const r=n(417),o=n(404);function i(e){return[e.relativePath?"Compare this snippet from "+e.relativePath+":":"Compare this snippet:"].concat(e.snippet.split("\n"))}t.neighborOptionToSelection={none:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(1),threshold:-1,numberOfNeighbors:0},conservative:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:.3,numberOfNeighbors:1},medium:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(20),threshold:.1,numberOfNeighbors:2},eager:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(60),threshold:0,numberOfNeighbors:4},eagerButLittle:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:0,numberOfNeighbors:1}},t.getNeighborSnippets=async function(e,n,s,a,c){const l=t.neighborOptionToSelection[s],u=function(e,n,r,i){const s={...t.neighborOptionToSelection[n]};return void 0!==r&&void 0!==i&&(s.matcherFactory=o.IndentationBasedJaccardMatcher.FACTORY(r,i)),s.matcherFactory.to(e)}(e,s,a,c);return n.filter((e=>e.source.length<1e4&&e.source.length>0)).slice(0,20).map((e=>({relativePath:e.relativePath,...u.findBestMatch(e)}))).filter((e=>e.score&&e.snippet&&e.score>l.threshold)).sort(((e,t)=>e.score-t.score)).slice(-l.numberOfNeighbors).map((t=>({score:t.score,snippet:i(t).map((t=>r.comment(t,e.languageId)+"\n")).join(""),startLine:t.startLine,endLine:t.endLine})))}},467:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.splitIntoWords=t.WindowedMatcher=t.SortOptions=void 0,function(e){e.Ascending="ascending",e.Descending="descending",e.None="none"}(n=t.SortOptions||(t.SortOptions={}));class r{constructor(e){var t;this.stopsForLanguage=null!==(t=c.get(e.languageId))&&void 0!==t?t:a}tokenize(e){return new Set(i(e).filter((e=>!this.stopsForLanguage.has(e))))}}const o=new class{constructor(e){this.keys=[],this.cache={},this.size=e}put(e,t){var n;if(this.cache[e]=t,this.keys.length>this.size){this.keys.push(e);const t=null!==(n=this.keys.shift())&&void 0!==n?n:"";delete this.cache[t]}}get(e){return this.cache[e]}}(20);function i(e){return e.split(/[^a-zA-Z0-9]/).filter((e=>e.length>0))}t.WindowedMatcher=class{constructor(e){this.tokenizer=new r(e),this.referenceTokens=this.tokenizer.tokenize(this.trimDocument(e))}sortScoredSnippets(e,t=n.Descending){return t==n.Ascending?e.sort(((e,t)=>e.score>t.score?1:-1)):t==n.Descending?e.sort(((e,t)=>e.score>t.score?-1:1)):e}retrieveAllSnippets(e,t=n.Descending){var r;const i=[];if(0===e.source.length||0===this.referenceTokens.size)return i;const s=e.source.split("\n"),a=this.id()+":"+e.source,c=null!==(r=o.get(a))&&void 0!==r?r:[],l=0==c.length,u=l?s.map(this.tokenizer.tokenize,this.tokenizer):[];for(const[e,[t,n]]of this.getWindowsDelineations(s).entries()){if(l){const e=new Set;u.slice(t,n).forEach((t=>t.forEach(e.add,e))),c.push(e)}const r=c[e],o=this.similarityScore(r,this.referenceTokens);i.push({score:o,startLine:t,endLine:n})}return l&&o.put(a,c),this.sortScoredSnippets(i,t)}findBestMatch(e){if(0===e.source.length||0===this.referenceTokens.size)return;const t=e.source.split("\n"),r=this.retrieveAllSnippets(e,n.Descending);return 0!==r.length&&0!==r[0].score?{snippet:t.slice(r[0].startLine,r[0].endLine).join("\n"),...r[0]}:void 0}findTopKMatch(e,t=3){if(0===e.source.length||0===this.referenceTokens.size||t<1)return;const r=e.source.split("\n"),o=this.retrieveAllSnippets(e,n.Descending);if(0===o.length||0===o[0].score)return;const i=[o[0]];for(let e=1;e<o.length&&i.length<t;e++)-1==i.findIndex((t=>o[e].startLine<t.endLine&&o[e].endLine>t.startLine))&&i.push(o[e]);return i.map((e=>({snippet:r.slice(e.startLine,e.endLine).join("\n"),...e})))}},t.splitIntoWords=i;const s=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),a=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...s]),c=new Map([])},395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findEditDistanceScore=void 0,t.findEditDistanceScore=function(e,t){if(0===e.length||0===t.length)return{score:e.length+t.length};const n=Array.from({length:e.length}).map((()=>Array.from({length:t.length}).map((()=>0))));for(let t=0;t<e.length;t++)n[t][0]=t;for(let e=0;e<t.length;e++)n[0][e]=e;for(let r=0;r<t.length;r++)for(let o=0;o<e.length;o++)n[o][r]=Math.min((0==o?r:n[o-1][r])+1,(0==r?o:n[o][r-1])+1,(0==o||0==r?Math.max(o,r):n[o-1][r-1])+(e[o]==t[r]?0:1));return{score:n[e.length-1][t.length-1]}}},456:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Priorities=t.PromptWishlist=t.PromptElementRanges=t.PromptChoices=t.PromptBackground=t.PromptElementKind=void 0;const r=n(312),o=n(94);var i;!function(e){e.BeforeCursor="BeforeCursor",e.AfterCursor="AfterCursor",e.SimilarFile="SimilarFile",e.ImportedFile="ImportedFile",e.LanguageMarker="LanguageMarker",e.PathMarker="PathMarker"}(i=t.PromptElementKind||(t.PromptElementKind={}));class s{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.IsNeighboringTab(e)&&this.used.set(e.id,this.convert(e))}undoMarkUsed(e){this.IsNeighboringTab(e)&&this.used.delete(e.id)}markUnused(e){this.IsNeighboringTab(e)&&this.unused.set(e.id,this.convert(e))}convert(e){return{score:e.score.toFixed(4),length:e.text.length}}IsNeighboringTab(e){return e.kind==i.SimilarFile}}t.PromptBackground=s;class a{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}undoMarkUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)-e.tokens)}markUnused(e){this.unused.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}}t.PromptChoices=a;class c{constructor(e){this.ranges=new Array;let t,n=0;for(const{element:r}of e)0!==r.text.length&&(t===i.BeforeCursor&&r.kind===i.BeforeCursor?this.ranges[this.ranges.length-1].end+=r.text.length:this.ranges.push({kind:r.kind,start:n,end:n+r.text.length}),t=r.kind,n+=r.text.length)}}t.PromptElementRanges=c,t.PromptWishlist=class{constructor(e){this.content=[],this.lineEndingOption=e}getContent(){return[...this.content]}convertLineEndings(e){return this.lineEndingOption===r.LineEndingOptions.ConvertToUnix&&(e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),e}append(e,t,n,r=o.tokenLength(e),i=NaN){e=this.convertLineEndings(e);const s=this.content.length;return this.content.push({id:s,text:e,kind:t,priority:n,tokens:r,requires:[],excludes:[],score:i}),s}appendLineForLine(e,t,n){const r=(e=this.convertLineEndings(e)).split("\n");for(let e=0;e<r.length-1;e++)r[e]+="\n";const o=[];r.forEach(((e,t)=>{"\n"===e&&o.length>0&&!o[o.length-1].endsWith("\n\n")?o[o.length-1]+="\n":o.push(e)}));const i=[];return o.forEach(((e,r)=>{""!==e&&(i.push(this.append(e,t,n)),r>0&&(this.content[this.content.length-2].requires=[this.content[this.content.length-1]]))})),i}require(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.requires.push(r)}exclude(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.excludes.push(r)}fulfill(e){const t=new a,n=new s,r=this.content.map(((e,t)=>({element:e,index:t})));r.sort(((e,t)=>e.element.priority===t.element.priority?t.index-e.index:t.element.priority-e.element.priority));const i=new Set,l=new Set;let u;const d=[];let p=e;r.forEach((e=>{var r;const o=e.element,s=e.index;if(p>=0&&(p>0||void 0===u)&&o.requires.every((e=>i.has(e.id)))&&!l.has(o.id)){let a=o.tokens;const c=null===(r=function(e,t){let n,r=1/0;for(const o of e)o.index>t&&o.index<r&&(n=o,r=o.index);return n}(d,s))||void 0===r?void 0:r.element;o.text.endsWith("\n\n")&&c&&!c.text.match(/^\s/)&&a++,p>=a?(p-=a,i.add(o.id),o.excludes.forEach((e=>l.add(e.id))),t.markUsed(o),n.markUsed(o),d.push(e)):u=null!=u?u:e}else t.markUnused(o),n.markUnused(o)})),d.sort(((e,t)=>e.index-t.index));let h=d.reduce(((e,t)=>e+t.element.text),""),f=o.tokenLength(h);for(;f>e;){d.sort(((e,t)=>t.element.priority===e.element.priority?t.index-e.index:t.element.priority-e.element.priority));const e=d.pop();e&&(t.undoMarkUsed(e.element),t.markUnused(e.element),n.undoMarkUsed(e.element),n.markUnused(e.element),u=void 0),d.sort(((e,t)=>e.index-t.index)),h=d.reduce(((e,t)=>e+t.element.text),""),f=o.tokenLength(h)}const m=[...d];if(void 0!==u){m.push(u),m.sort(((e,t)=>e.index-t.index));const r=m.reduce(((e,t)=>e+t.element.text),""),i=o.tokenLength(r);if(i<=e){t.markUsed(u.element),n.markUsed(u.element);const e=new c(m);return{prefix:r,suffix:"",prefixLength:i,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:e}}t.markUnused(u.element),n.markUnused(u.element)}const g=new c(d);return{prefix:h,suffix:"",prefixLength:f,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:g}}};class l{constructor(){this.registeredPriorities=[0,1]}register(e){if(e>l.TOP||e<l.BOTTOM)throw new Error("Priority must be between 0 and 1");return this.registeredPriorities.push(e),e}justAbove(...e){const t=Math.max(...e),n=Math.min(...this.registeredPriorities.filter((e=>e>t)));return this.register((n+t)/2)}justBelow(...e){const t=Math.min(...e),n=Math.max(...this.registeredPriorities.filter((e=>e<t)));return this.register((n+t)/2)}between(e,t){if(this.registeredPriorities.some((n=>n>e&&n<t))||!this.registeredPriorities.includes(e)||!this.registeredPriorities.includes(t))throw new Error("Priorities must be adjacent in the list of priorities");return this.register((e+t)/2)}}t.Priorities=l,l.TOP=1,l.BOTTOM=0},87:(e,t,n)=>{var r,o,i=void 0!==i?i:{};void 0===(o="function"==typeof(r=function(){var t,r={};for(t in i)i.hasOwnProperty(t)&&(r[t]=i[t]);var o,s,a=[],c="./this.program",l=function(e,t){throw t},u=!1,d=!1;u="object"==typeof window,d="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,s=!u&&!o&&!d;var p,h,f,m,g,_="";o?(_=d?n(622).dirname(_)+"/":__dirname+"/",p=function(e,t){return m||(m=n(747)),g||(g=n(622)),e=g.normalize(e),m.readFileSync(e,t?null:"utf8")},f=function(e){var t=p(e,!0);return t.buffer||(t=new Uint8Array(t)),O(t.buffer),t},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),e.exports=i,l=function(e){process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(p=function(e){return read(e)}),f=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(O("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(l=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||d)&&(d?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.lastIndexOf("/")+1):"",p=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}),i.print||console.log.bind(console);var y=i.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(i[t]=r[t]);r=null,i.arguments&&(a=i.arguments),i.thisProgram&&(c=i.thisProgram),i.quit&&(l=i.quit);var v,b=16,w=[];function x(e,t){if(!v){v=new WeakMap;for(var n=0;n<J.length;n++){var r=J.get(n);r&&v.set(r,n)}}if(v.has(e))return v.get(e);var o=function(){if(w.length)return w.pop();try{J.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return J.length-1}();try{J.set(o,e)}catch(n){if(!(n instanceof TypeError))throw n;var i=function(e,t){if("function"==typeof WebAssembly.Function){for(var n={i:"i32",j:"i64",f:"f32",d:"f64"},r={parameters:[],results:"v"==t[0]?[]:[n[t[0]]]},o=1;o<t.length;++o)r.parameters.push(n[t[o]]);return new WebAssembly.Function(r,e)}var i=[1,0,1,96],s=t.slice(0,1),a=t.slice(1),c={i:127,j:126,f:125,d:124};for(i.push(a.length),o=0;o<a.length;++o)i.push(c[a[o]]);"v"==s?i.push(0):i=i.concat([1,c[s]]),i[1]=i.length-2;var l=new Uint8Array([0,97,115,109,1,0,0,0].concat(i,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0])),u=new WebAssembly.Module(l);return new WebAssembly.Instance(u,{e:{f:e}}).exports.f}(e,t);J.set(o,i)}return v.set(e,o),o}var E,C=function(e){},S=i.dynamicLibraries||[];i.wasmBinary&&(E=i.wasmBinary);var T,k=i.noExitRuntime||!0;function I(e,t,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":R[e>>0]=t;break;case"i16":L[e>>1]=t;break;case"i32":$[e>>2]=t;break;case"i64":pe=[t>>>0,(de=t,+Math.abs(de)>=1?de>0?(0|Math.min(+Math.floor(de/4294967296),4294967295))>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],$[e>>2]=pe[0],$[e+4>>2]=pe[1];break;case"float":D[e>>2]=t;break;case"double":F[e>>3]=t;break;default:se("invalid type for setValue: "+n)}}function P(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return R[e>>0];case"i16":return L[e>>1];case"i32":case"i64":return $[e>>2];case"float":return D[e>>2];case"double":return F[e>>3];default:se("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&se("no native wasm support detected");var A=!1;function O(e,t){e||se("Assertion failed: "+t)}var N,R,M,L,$,D,F,j=1,q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&q)return q.decode(e.subarray(t,o));for(var i="";t<o;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var c=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|c:(7&s)<<18|a<<12|c<<6|63&e[t++])<65536)i+=String.fromCharCode(s);else{var l=s-65536;i+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function U(e,t){return e?B(M,e,t):""}function H(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-o}function z(e,t,n){return H(e,M,t,n)}function W(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function V(e){var t=W(e)+1,n=Ve(t);return H(e,R,n,t),n}function G(e){N=e,i.HEAP8=R=new Int8Array(e),i.HEAP16=L=new Int16Array(e),i.HEAP32=$=new Int32Array(e),i.HEAPU8=M=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAPU32=new Uint32Array(e),i.HEAPF32=D=new Float32Array(e),i.HEAPF64=F=new Float64Array(e)}var K=i.INITIAL_MEMORY||33554432;(T=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:K/65536,maximum:32768}))&&(N=T.buffer),K=N.byteLength,G(N);var J=new WebAssembly.Table({initial:13,element:"anyfunc"}),X=[],Q=[],Y=[],Z=[],ee=!1,te=0,ne=null,re=null;function oe(e){te++,i.monitorRunDependencies&&i.monitorRunDependencies(te)}function ie(e){if(te--,i.monitorRunDependencies&&i.monitorRunDependencies(te),0==te&&(null!==ne&&(clearInterval(ne),ne=null),re)){var t=re;re=null,t()}}function se(e){throw i.onAbort&&i.onAbort(e),y(e+=""),A=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}i.preloadedImages={},i.preloadedAudios={},i.preloadedWasm={};var ae="data:application/octet-stream;base64,";function ce(e){return e.startsWith(ae)}function le(e){return e.startsWith("file://")}var ue,de,pe,he="tree-sitter.wasm";function fe(e){try{if(e==he&&E)return new Uint8Array(E);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}catch(e){se(e)}}ce(he)||(ue=he,he=i.locateFile?i.locateFile(ue,_):_+ue);var me={},ge={get:function(e,t){return me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),me[t]}};function _e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?J.get(n)():J.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(i)}}function ye(e){var t=0;function n(){for(var n=0,r=1;;){var o=e[t++];if(n+=(127&o)*r,r*=128,!(128&o))break}return n}if(e instanceof WebAssembly.Module){var r=WebAssembly.Module.customSections(e,"dylink");O(0!=r.length,"need dylink section"),e=new Int8Array(r[0])}else O(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),O(0===e[8],"need the dylink section to be first"),t=9,n(),O(6===e[t]),O(e[++t]==="d".charCodeAt(0)),O(e[++t]==="y".charCodeAt(0)),O(e[++t]==="l".charCodeAt(0)),O(e[++t]==="i".charCodeAt(0)),O(e[++t]==="n".charCodeAt(0)),O(e[++t]==="k".charCodeAt(0)),t++;var o={};o.memorySize=n(),o.memoryAlign=n(),o.tableSize=n(),o.tableAlign=n();var i=n();o.neededDynlibs=[];for(var s=0;s<i;++s){var a=n(),c=e.subarray(t,t+a);t+=a;var l=B(c,0);o.neededDynlibs.push(l)}return o}var ve=0;function be(){return k||ve>0}var we={nextHandle:1,loadedLibs:{},loadedLibNames:{}};function xe(e,t,n){return e.includes("j")?function(e,t,n){var r=i["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):J.get(t).apply(null,n)}var Ee=5250832;function Ce(e){return["__cpp_exception","__wasm_apply_data_relocs","__dso_handle","__set_stack_limits"].includes(e)}function Se(e,t){var n={};for(var r in e){var o=e[r];"object"==typeof o&&(o=o.value),"number"==typeof o&&(o+=t),n[r]=o}return function(e){for(var t in e)if(!Ce(t)){var n=!1,r=e[t];t.startsWith("orig$")&&(t=t.split("$")[1],n=!0),me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),(n||0==me[t].value)&&("function"==typeof r?me[t].value=x(r):"number"==typeof r?me[t].value=r:y("unhandled export type for `"+t+"`: "+typeof r))}}(n),n}function Te(e){return 0==e.indexOf("dynCall_")||["stackAlloc","stackSave","stackRestore"].includes(e)?e:"_"+e}function ke(e,t){var n,r;return t&&(n=i.asm["orig$"+e]),n||(n=i.asm[e]),!n&&t&&(n=i["_orig$"+e]),n||(n=i[Te(e)]),!n&&e.startsWith("invoke_")&&(r=e.split("_")[1],n=function(){var e=ze();try{return xe(r,arguments[0],Array.prototype.slice.call(arguments,1))}catch(t){if(We(e),t!==t+0&&"longjmp"!==t)throw t;Ge(1,0)}}),n}function Ie(e,t){var n=ye(e);function r(){var r=Math.pow(2,n.memoryAlign);r=Math.max(r,b);var o,i,s,a=(o=function(e){if(ee)return Ue(e);var t=Ee,n=t+e+15&-16;return Ee=n,me.__heap_base.value=n,t}(n.memorySize+r),(i=r)||(i=b),Math.ceil(o/i)*i),c=J.length;J.grow(n.tableSize);for(var l=a;l<a+n.memorySize;l++)R[l]=0;for(l=c;l<c+n.tableSize;l++)J.set(l,null);var u=new Proxy(Be,{get:function(e,t){switch(t){case"__memory_base":return a;case"__table_base":return c}return t in e?e[t]:e[t]=function(){return n||(n=function(e){var t=ke(e,!1);return t||(t=s[e]),t}(t)),n.apply(null,arguments)};var n}}),d={"GOT.mem":new Proxy(Be,ge),"GOT.func":new Proxy(Be,ge),env:u,wasi_snapshot_preview1:u};function p(e){for(var r=0;r<n.tableSize;r++){var o=J.get(c+r);o&&v.set(o,c+r)}s=Se(e.exports,a),t.allowUndefined||Oe();var i=s.__wasm_call_ctors;return i||(i=s.__post_instantiate),i&&(ee?i():Q.push(i)),s}if(t.loadAsync){if(e instanceof WebAssembly.Module){var h=new WebAssembly.Instance(e,d);return Promise.resolve(p(h))}return WebAssembly.instantiate(e,d).then((function(e){return p(e.instance)}))}var f=e instanceof WebAssembly.Module?e:new WebAssembly.Module(e);return p(h=new WebAssembly.Instance(f,d))}return t.loadAsync?n.neededDynlibs.reduce((function(e,n){return e.then((function(){return Ae(n,t)}))}),Promise.resolve()).then((function(){return r()})):(n.neededDynlibs.forEach((function(e){Ae(e,t)})),r())}function Pe(e,t){for(var n in e)if(e.hasOwnProperty(n)){Be.hasOwnProperty(n)||(Be[n]=e[n]);var r=Te(n);i.hasOwnProperty(r)||(i[r]=e[n])}}function Ae(e,t){"__main__"!=e||we.loadedLibNames[e]||(we.loadedLibs[-1]={refcount:1/0,name:"__main__",module:i.asm,global:!0},we.loadedLibNames.__main__=-1),t=t||{global:!0,nodelete:!0};var n,r=we.loadedLibNames[e];if(r)return n=we.loadedLibs[r],t.global&&!n.global&&(n.global=!0,"loading"!==n.module&&Pe(n.module)),t.nodelete&&n.refcount!==1/0&&(n.refcount=1/0),n.refcount++,t.loadAsync?Promise.resolve(r):r;function o(e){if(t.fs){var n=t.fs.readFile(e,{encoding:"binary"});return n instanceof Uint8Array||(n=new Uint8Array(n)),t.loadAsync?Promise.resolve(n):n}return t.loadAsync?(r=e,fetch(r,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load binary file at '"+r+"'";return e.arrayBuffer()})).then((function(e){return new Uint8Array(e)}))):f(e);var r}function s(){if(void 0!==i.preloadedWasm&&void 0!==i.preloadedWasm[e]){var n=i.preloadedWasm[e];return t.loadAsync?Promise.resolve(n):n}return t.loadAsync?o(e).then((function(e){return Ie(e,t)})):Ie(o(e),t)}function a(e){n.global&&Pe(e),n.module=e}return r=we.nextHandle++,n={refcount:t.nodelete?1/0:1,name:e,module:"loading",global:t.global},we.loadedLibNames[e]=r,we.loadedLibs[r]=n,t.loadAsync?s().then((function(e){return a(e),r})):(a(s()),r)}function Oe(){for(var e in me)if(0==me[e].value){var t=ke(e,!0);"function"==typeof t?me[e].value=x(t,t.sig):"number"==typeof t?me[e].value=t:O(!1,"bad export type for `"+e+"`: "+typeof t)}}i.___heap_base=Ee;var Ne,Re=new WebAssembly.Global({value:"i32",mutable:!0},5250832);function Me(){se()}i._abort=Me,Me.sig="v",Ne=o?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var Le=!0;function $e(e,t){var n;if(0===e)n=Date.now();else{if(1!==e&&4!==e||!Le)return $[He()>>2]=28,-1;n=Ne()}return $[t>>2]=n/1e3|0,$[t+4>>2]=n%1e3*1e3*1e3|0,0}function De(e){try{return T.grow(e-N.byteLength+65535>>>16),G(T.buffer),1}catch(e){}}function Fe(e){Qe(e)}function je(e){C(e)}$e.sig="iii",Fe.sig="vi",je.sig="vi";var qe,Be={__heap_base:Ee,__indirect_function_table:J,__memory_base:1024,__stack_pointer:Re,__table_base:1,abort:Me,clock_gettime:$e,emscripten_memcpy_big:function(e,t,n){M.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=M.length;if((e>>>=0)>2147483648)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),De(Math.min(2147483648,((t=Math.max(e,o))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1},exit:Fe,memory:T,setTempRet0:je,tree_sitter_log_callback:function(e,t){if(ft){const n=U(t);ft(n,0!==e)}},tree_sitter_parse_callback:function(e,t,n,r,o){var i=ht(t,{row:n,column:r});"string"==typeof i?(I(o,i.length,"i32"),function(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=(n-=2)<2*e.length?n/2:e.length,o=0;o<r;++o){var i=e.charCodeAt(o);L[t>>1]=i,t+=2}L[t>>1]=0}(i,e,10240)):I(o,0,"i32")}},Ue=(function(){var e={env:Be,wasi_snapshot_preview1:Be,"GOT.mem":new Proxy(Be,ge),"GOT.func":new Proxy(Be,ge)};function t(e,t){var n=e.exports;n=Se(n,1024),i.asm=n;var r,o=ye(t);o.neededDynlibs&&(S=o.neededDynlibs.concat(S)),r=i.asm.__wasm_call_ctors,Q.unshift(r),ie()}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!E&&(u||d)){if("function"==typeof fetch&&!le(he))return fetch(he,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+he+"'";return e.arrayBuffer()})).catch((function(){return fe(he)}));if(h)return new Promise((function(e,t){h(he,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return fe(he)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),se(e)}))}if(oe(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}E||"function"!=typeof WebAssembly.instantiateStreaming||ce(he)||le(he)||"function"!=typeof fetch?r(n):fetch(he,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.__wasm_call_ctors).apply(null,arguments)},i._malloc=function(){return(Ue=i._malloc=i.asm.malloc).apply(null,arguments)}),He=(i._ts_language_symbol_count=function(){return(i._ts_language_symbol_count=i.asm.ts_language_symbol_count).apply(null,arguments)},i._ts_language_version=function(){return(i._ts_language_version=i.asm.ts_language_version).apply(null,arguments)},i._ts_language_field_count=function(){return(i._ts_language_field_count=i.asm.ts_language_field_count).apply(null,arguments)},i._ts_language_symbol_name=function(){return(i._ts_language_symbol_name=i.asm.ts_language_symbol_name).apply(null,arguments)},i._ts_language_symbol_for_name=function(){return(i._ts_language_symbol_for_name=i.asm.ts_language_symbol_for_name).apply(null,arguments)},i._ts_language_symbol_type=function(){return(i._ts_language_symbol_type=i.asm.ts_language_symbol_type).apply(null,arguments)},i._ts_language_field_name_for_id=function(){return(i._ts_language_field_name_for_id=i.asm.ts_language_field_name_for_id).apply(null,arguments)},i._memcpy=function(){return(i._memcpy=i.asm.memcpy).apply(null,arguments)},i._free=function(){return(i._free=i.asm.free).apply(null,arguments)},i._calloc=function(){return(i._calloc=i.asm.calloc).apply(null,arguments)},i._ts_parser_delete=function(){return(i._ts_parser_delete=i.asm.ts_parser_delete).apply(null,arguments)},i._ts_parser_reset=function(){return(i._ts_parser_reset=i.asm.ts_parser_reset).apply(null,arguments)},i._ts_parser_set_language=function(){return(i._ts_parser_set_language=i.asm.ts_parser_set_language).apply(null,arguments)},i._ts_parser_timeout_micros=function(){return(i._ts_parser_timeout_micros=i.asm.ts_parser_timeout_micros).apply(null,arguments)},i._ts_parser_set_timeout_micros=function(){return(i._ts_parser_set_timeout_micros=i.asm.ts_parser_set_timeout_micros).apply(null,arguments)},i._memcmp=function(){return(i._memcmp=i.asm.memcmp).apply(null,arguments)},i._ts_query_new=function(){return(i._ts_query_new=i.asm.ts_query_new).apply(null,arguments)},i._ts_query_delete=function(){return(i._ts_query_delete=i.asm.ts_query_delete).apply(null,arguments)},i._iswspace=function(){return(i._iswspace=i.asm.iswspace).apply(null,arguments)},i._iswalnum=function(){return(i._iswalnum=i.asm.iswalnum).apply(null,arguments)},i._ts_query_pattern_count=function(){return(i._ts_query_pattern_count=i.asm.ts_query_pattern_count).apply(null,arguments)},i._ts_query_capture_count=function(){return(i._ts_query_capture_count=i.asm.ts_query_capture_count).apply(null,arguments)},i._ts_query_string_count=function(){return(i._ts_query_string_count=i.asm.ts_query_string_count).apply(null,arguments)},i._ts_query_capture_name_for_id=function(){return(i._ts_query_capture_name_for_id=i.asm.ts_query_capture_name_for_id).apply(null,arguments)},i._ts_query_string_value_for_id=function(){return(i._ts_query_string_value_for_id=i.asm.ts_query_string_value_for_id).apply(null,arguments)},i._ts_query_predicates_for_pattern=function(){return(i._ts_query_predicates_for_pattern=i.asm.ts_query_predicates_for_pattern).apply(null,arguments)},i._ts_tree_copy=function(){return(i._ts_tree_copy=i.asm.ts_tree_copy).apply(null,arguments)},i._ts_tree_delete=function(){return(i._ts_tree_delete=i.asm.ts_tree_delete).apply(null,arguments)},i._ts_init=function(){return(i._ts_init=i.asm.ts_init).apply(null,arguments)},i._ts_parser_new_wasm=function(){return(i._ts_parser_new_wasm=i.asm.ts_parser_new_wasm).apply(null,arguments)},i._ts_parser_enable_logger_wasm=function(){return(i._ts_parser_enable_logger_wasm=i.asm.ts_parser_enable_logger_wasm).apply(null,arguments)},i._ts_parser_parse_wasm=function(){return(i._ts_parser_parse_wasm=i.asm.ts_parser_parse_wasm).apply(null,arguments)},i._ts_language_type_is_named_wasm=function(){return(i._ts_language_type_is_named_wasm=i.asm.ts_language_type_is_named_wasm).apply(null,arguments)},i._ts_language_type_is_visible_wasm=function(){return(i._ts_language_type_is_visible_wasm=i.asm.ts_language_type_is_visible_wasm).apply(null,arguments)},i._ts_tree_root_node_wasm=function(){return(i._ts_tree_root_node_wasm=i.asm.ts_tree_root_node_wasm).apply(null,arguments)},i._ts_tree_edit_wasm=function(){return(i._ts_tree_edit_wasm=i.asm.ts_tree_edit_wasm).apply(null,arguments)},i._ts_tree_get_changed_ranges_wasm=function(){return(i._ts_tree_get_changed_ranges_wasm=i.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)},i._ts_tree_cursor_new_wasm=function(){return(i._ts_tree_cursor_new_wasm=i.asm.ts_tree_cursor_new_wasm).apply(null,arguments)},i._ts_tree_cursor_delete_wasm=function(){return(i._ts_tree_cursor_delete_wasm=i.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)},i._ts_tree_cursor_reset_wasm=function(){return(i._ts_tree_cursor_reset_wasm=i.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_first_child_wasm=function(){return(i._ts_tree_cursor_goto_first_child_wasm=i.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_next_sibling_wasm=function(){return(i._ts_tree_cursor_goto_next_sibling_wasm=i.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_parent_wasm=function(){return(i._ts_tree_cursor_goto_parent_wasm=i.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_type_id_wasm=function(){return(i._ts_tree_cursor_current_node_type_id_wasm=i.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_is_named_wasm=function(){return(i._ts_tree_cursor_current_node_is_named_wasm=i.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_is_missing_wasm=function(){return(i._ts_tree_cursor_current_node_is_missing_wasm=i.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_id_wasm=function(){return(i._ts_tree_cursor_current_node_id_wasm=i.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)},i._ts_tree_cursor_start_position_wasm=function(){return(i._ts_tree_cursor_start_position_wasm=i.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)},i._ts_tree_cursor_end_position_wasm=function(){return(i._ts_tree_cursor_end_position_wasm=i.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)},i._ts_tree_cursor_start_index_wasm=function(){return(i._ts_tree_cursor_start_index_wasm=i.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)},i._ts_tree_cursor_end_index_wasm=function(){return(i._ts_tree_cursor_end_index_wasm=i.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)},i._ts_tree_cursor_current_field_id_wasm=function(){return(i._ts_tree_cursor_current_field_id_wasm=i.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_wasm=function(){return(i._ts_tree_cursor_current_node_wasm=i.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)},i._ts_node_symbol_wasm=function(){return(i._ts_node_symbol_wasm=i.asm.ts_node_symbol_wasm).apply(null,arguments)},i._ts_node_child_count_wasm=function(){return(i._ts_node_child_count_wasm=i.asm.ts_node_child_count_wasm).apply(null,arguments)},i._ts_node_named_child_count_wasm=function(){return(i._ts_node_named_child_count_wasm=i.asm.ts_node_named_child_count_wasm).apply(null,arguments)},i._ts_node_child_wasm=function(){return(i._ts_node_child_wasm=i.asm.ts_node_child_wasm).apply(null,arguments)},i._ts_node_named_child_wasm=function(){return(i._ts_node_named_child_wasm=i.asm.ts_node_named_child_wasm).apply(null,arguments)},i._ts_node_child_by_field_id_wasm=function(){return(i._ts_node_child_by_field_id_wasm=i.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)},i._ts_node_next_sibling_wasm=function(){return(i._ts_node_next_sibling_wasm=i.asm.ts_node_next_sibling_wasm).apply(null,arguments)},i._ts_node_prev_sibling_wasm=function(){return(i._ts_node_prev_sibling_wasm=i.asm.ts_node_prev_sibling_wasm).apply(null,arguments)},i._ts_node_next_named_sibling_wasm=function(){return(i._ts_node_next_named_sibling_wasm=i.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)},i._ts_node_prev_named_sibling_wasm=function(){return(i._ts_node_prev_named_sibling_wasm=i.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)},i._ts_node_parent_wasm=function(){return(i._ts_node_parent_wasm=i.asm.ts_node_parent_wasm).apply(null,arguments)},i._ts_node_descendant_for_index_wasm=function(){return(i._ts_node_descendant_for_index_wasm=i.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)},i._ts_node_named_descendant_for_index_wasm=function(){return(i._ts_node_named_descendant_for_index_wasm=i.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)},i._ts_node_descendant_for_position_wasm=function(){return(i._ts_node_descendant_for_position_wasm=i.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)},i._ts_node_named_descendant_for_position_wasm=function(){return(i._ts_node_named_descendant_for_position_wasm=i.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)},i._ts_node_start_point_wasm=function(){return(i._ts_node_start_point_wasm=i.asm.ts_node_start_point_wasm).apply(null,arguments)},i._ts_node_end_point_wasm=function(){return(i._ts_node_end_point_wasm=i.asm.ts_node_end_point_wasm).apply(null,arguments)},i._ts_node_start_index_wasm=function(){return(i._ts_node_start_index_wasm=i.asm.ts_node_start_index_wasm).apply(null,arguments)},i._ts_node_end_index_wasm=function(){return(i._ts_node_end_index_wasm=i.asm.ts_node_end_index_wasm).apply(null,arguments)},i._ts_node_to_string_wasm=function(){return(i._ts_node_to_string_wasm=i.asm.ts_node_to_string_wasm).apply(null,arguments)},i._ts_node_children_wasm=function(){return(i._ts_node_children_wasm=i.asm.ts_node_children_wasm).apply(null,arguments)},i._ts_node_named_children_wasm=function(){return(i._ts_node_named_children_wasm=i.asm.ts_node_named_children_wasm).apply(null,arguments)},i._ts_node_descendants_of_type_wasm=function(){return(i._ts_node_descendants_of_type_wasm=i.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)},i._ts_node_is_named_wasm=function(){return(i._ts_node_is_named_wasm=i.asm.ts_node_is_named_wasm).apply(null,arguments)},i._ts_node_has_changes_wasm=function(){return(i._ts_node_has_changes_wasm=i.asm.ts_node_has_changes_wasm).apply(null,arguments)},i._ts_node_has_error_wasm=function(){return(i._ts_node_has_error_wasm=i.asm.ts_node_has_error_wasm).apply(null,arguments)},i._ts_node_is_missing_wasm=function(){return(i._ts_node_is_missing_wasm=i.asm.ts_node_is_missing_wasm).apply(null,arguments)},i._ts_query_matches_wasm=function(){return(i._ts_query_matches_wasm=i.asm.ts_query_matches_wasm).apply(null,arguments)},i._ts_query_captures_wasm=function(){return(i._ts_query_captures_wasm=i.asm.ts_query_captures_wasm).apply(null,arguments)},i._iswalpha=function(){return(i._iswalpha=i.asm.iswalpha).apply(null,arguments)},i._iswdigit=function(){return(i._iswdigit=i.asm.iswdigit).apply(null,arguments)},i._iswlower=function(){return(i._iswlower=i.asm.iswlower).apply(null,arguments)},i._towupper=function(){return(i._towupper=i.asm.towupper).apply(null,arguments)},i._memchr=function(){return(i._memchr=i.asm.memchr).apply(null,arguments)},i.___errno_location=function(){return(He=i.___errno_location=i.asm.__errno_location).apply(null,arguments)}),ze=(i._strlen=function(){return(i._strlen=i.asm.strlen).apply(null,arguments)},i.stackSave=function(){return(ze=i.stackSave=i.asm.stackSave).apply(null,arguments)}),We=i.stackRestore=function(){return(We=i.stackRestore=i.asm.stackRestore).apply(null,arguments)},Ve=i.stackAlloc=function(){return(Ve=i.stackAlloc=i.asm.stackAlloc).apply(null,arguments)},Ge=i._setThrew=function(){return(Ge=i._setThrew=i.asm.setThrew).apply(null,arguments)};function Ke(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)},i.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return(i.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=i.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)},i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return(i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=i.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)},i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return(i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=i.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_).apply(null,arguments)},i.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return(i.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=i.asm._ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv).apply(null,arguments)},i.__Znwm=function(){return(i.__Znwm=i.asm._Znwm).apply(null,arguments)},i.__ZdlPv=function(){return(i.__ZdlPv=i.asm._ZdlPv).apply(null,arguments)},i._orig$ts_parser_timeout_micros=function(){return(i._orig$ts_parser_timeout_micros=i.asm.orig$ts_parser_timeout_micros).apply(null,arguments)},i._orig$ts_parser_set_timeout_micros=function(){return(i._orig$ts_parser_set_timeout_micros=i.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)},i._TRANSFER_BUFFER=7296,i.___THREW__=7932,i.___threwValue=7936,i.___cxa_new_handler=7928,i.allocate=function(e,t){var n;return n=t==j?Ve(e.length):Ue(e.length),e.subarray||e.slice?M.set(e,n):M.set(new Uint8Array(e),n),n},re=function e(){qe||Xe(),qe||(re=e)};var Je=!1;function Xe(e){function t(){qe||(qe=!0,i.calledRun=!0,A||(ee=!0,_e(Q),_e(Y),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Ye&&function(e){var t=i._main;if(t){var n=(e=e||[]).length+1,r=Ve(4*(n+1));$[r>>2]=V(c);for(var o=1;o<n;o++)$[(r>>2)+o]=V(e[o-1]);$[(r>>2)+n]=0;try{Qe(t(n,r),!0)}catch(e){if(e instanceof Ke)return;if("unwind"==e)return;var s=e;e&&"object"==typeof e&&e.stack&&(s=[e,e.stack]),y("exception thrown: "+s),l(1,e)}}}(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),Z.unshift(e);var e;_e(Z)}()))}e=e||a,te>0||!Je&&(function(){if(S.length){if(!f)return oe(),void S.reduce((function(e,t){return e.then((function(){return Ae(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}))}),Promise.resolve()).then((function(){ie(),Oe()}));S.forEach((function(e){Ae(e,{global:!0,nodelete:!0,allowUndefined:!0})})),Oe()}else Oe()}(),Je=!0,te>0)||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),X.unshift(e);var e;_e(X)}(),te>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t()))}function Qe(e,t){t&&be()&&0===e||(be()||(i.onExit&&i.onExit(e),A=!0),l(e,new Ke(e)))}if(i.run=Xe,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Ye=!0;i.noInitialRun&&(Ye=!1),Xe();const Ze=i,et={},tt=4,nt=5*tt,rt=2*tt,ot=2*tt+2*rt,it={row:0,column:0},st=/[\w-.]*/g,at=1,ct=2,lt=/^_?tree_sitter_\w+/;var ut,dt,pt,ht,ft,mt=new Promise((e=>{i.onRuntimeInitialized=e})).then((()=>{pt=Ze._ts_init(),ut=P(pt,"i32"),dt=P(pt+tt,"i32")}));class gt{static init(){return mt}constructor(){if(null==pt)throw new Error("You must first call Parser.init() and wait for it to resolve.");Ze._ts_parser_new_wasm(),this[0]=P(pt,"i32"),this[1]=P(pt+tt,"i32")}delete(){Ze._ts_parser_delete(this[0]),Ze._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==bt)throw new Error("Argument must be a Language");{t=e[0];const n=Ze._ts_language_version(t);if(n<dt||ut<n)throw new Error(`Incompatible language version ${n}. Compatibility range ${dt} through ${ut}.`)}}else t=0,e=null;return this.language=e,Ze._ts_parser_set_language(this[0],t),this}getLanguage(){return this.language}parse(e,t,n){if("string"==typeof e)ht=(t,n,r)=>e.slice(t,r);else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");ht=e}this.logCallback?(ft=this.logCallback,Ze._ts_parser_enable_logger_wasm(this[0],1)):(ft=null,Ze._ts_parser_enable_logger_wasm(this[0],0));let r=0,o=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=o=Ze._calloc(r,ot);for(let t=0;t<r;t++)Nt(e,n.includedRanges[t]),e+=ot}const i=Ze._ts_parser_parse_wasm(this[0],this[1],t?t[0]:0,o,r);if(!i)throw ht=null,ft=null,new Error("Parsing failed");const s=new _t(et,i,this.language,ht);return ht=null,ft=null,s}reset(){Ze._ts_parser_reset(this[0])}setTimeoutMicros(e){Ze._ts_parser_set_timeout_micros(this[0],e)}getTimeoutMicros(){return Ze._ts_parser_timeout_micros(this[0])}setLogger(e){if(e){if("function"!=typeof e)throw new Error("Logger callback must be a function")}else e=null;return this.logCallback=e,this}getLogger(){return this.logCallback}}class _t{constructor(e,t,n,r){Ct(e),this[0]=t,this.language=n,this.textCallback=r}copy(){const e=Ze._ts_tree_copy(this[0]);return new _t(et,e,this.language,this.textCallback)}delete(){Ze._ts_tree_delete(this[0]),this[0]=0}edit(e){!function(e){let t=pt;At(t,e.startPosition),At(t+=rt,e.oldEndPosition),At(t+=rt,e.newEndPosition),I(t+=rt,e.startIndex,"i32"),I(t+=tt,e.oldEndIndex,"i32"),I(t+=tt,e.newEndIndex,"i32"),t+=tt}(e),Ze._ts_tree_edit_wasm(this[0])}get rootNode(){return Ze._ts_tree_root_node_wasm(this[0]),kt(this)}getLanguage(){return this.language}walk(){return this.rootNode.walk()}getChangedRanges(e){if(e.constructor!==_t)throw new TypeError("Argument must be a Tree");Ze._ts_tree_get_changed_ranges_wasm(this[0],e[0]);const t=P(pt,"i32"),n=P(pt+tt,"i32"),r=new Array(t);if(t>0){let e=n;for(let n=0;n<t;n++)r[n]=Rt(e),e+=ot;Ze._free(n)}return r}}class yt{constructor(e,t){Ct(e),this.tree=t}get typeId(){return Tt(this),Ze._ts_node_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get endPosition(){return Tt(this),Ze._ts_node_end_point_wasm(this.tree[0]),Ot(pt)}get endIndex(){return Tt(this),Ze._ts_node_end_index_wasm(this.tree[0])}get text(){return xt(this.tree,this.startIndex,this.endIndex)}isNamed(){return Tt(this),1===Ze._ts_node_is_named_wasm(this.tree[0])}hasError(){return Tt(this),1===Ze._ts_node_has_error_wasm(this.tree[0])}hasChanges(){return Tt(this),1===Ze._ts_node_has_changes_wasm(this.tree[0])}isMissing(){return Tt(this),1===Ze._ts_node_is_missing_wasm(this.tree[0])}equals(e){return this.id===e.id}child(e){return Tt(this),Ze._ts_node_child_wasm(this.tree[0],e),kt(this.tree)}namedChild(e){return Tt(this),Ze._ts_node_named_child_wasm(this.tree[0],e),kt(this.tree)}childForFieldId(e){return Tt(this),Ze._ts_node_child_by_field_id_wasm(this.tree[0],e),kt(this.tree)}childForFieldName(e){const t=this.tree.language.fields.indexOf(e);if(-1!==t)return this.childForFieldId(t)}get childCount(){return Tt(this),Ze._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return Tt(this),Ze._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){Tt(this),Ze._ts_node_children_wasm(this.tree[0]);const e=P(pt,"i32"),t=P(pt+tt,"i32");if(this._children=new Array(e),e>0){let n=t;for(let t=0;t<e;t++)this._children[t]=kt(this.tree,n),n+=nt;Ze._free(t)}}return this._children}get namedChildren(){if(!this._namedChildren){Tt(this),Ze._ts_node_named_children_wasm(this.tree[0]);const e=P(pt,"i32"),t=P(pt+tt,"i32");if(this._namedChildren=new Array(e),e>0){let n=t;for(let t=0;t<e;t++)this._namedChildren[t]=kt(this.tree,n),n+=nt;Ze._free(t)}}return this._namedChildren}descendantsOfType(e,t,n){Array.isArray(e)||(e=[e]),t||(t=it),n||(n=it);const r=[],o=this.tree.language.types;for(let t=0,n=o.length;t<n;t++)e.includes(o[t])&&r.push(t);const i=Ze._malloc(tt*r.length);for(let e=0,t=r.length;e<t;e++)I(i+e*tt,r[e],"i32");Tt(this),Ze._ts_node_descendants_of_type_wasm(this.tree[0],i,r.length,t.row,t.column,n.row,n.column);const s=P(pt,"i32"),a=P(pt+tt,"i32"),c=new Array(s);if(s>0){let e=a;for(let t=0;t<s;t++)c[t]=kt(this.tree,e),e+=nt}return Ze._free(a),Ze._free(i),c}get nextSibling(){return Tt(this),Ze._ts_node_next_sibling_wasm(this.tree[0]),kt(this.tree)}get previousSibling(){return Tt(this),Ze._ts_node_prev_sibling_wasm(this.tree[0]),kt(this.tree)}get nextNamedSibling(){return Tt(this),Ze._ts_node_next_named_sibling_wasm(this.tree[0]),kt(this.tree)}get previousNamedSibling(){return Tt(this),Ze._ts_node_prev_named_sibling_wasm(this.tree[0]),kt(this.tree)}get parent(){return Tt(this),Ze._ts_node_parent_wasm(this.tree[0]),kt(this.tree)}descendantForIndex(e,t=e){if("number"!=typeof e||"number"!=typeof t)throw new Error("Arguments must be numbers");Tt(this);let n=pt+nt;return I(n,e,"i32"),I(n+tt,t,"i32"),Ze._ts_node_descendant_for_index_wasm(this.tree[0]),kt(this.tree)}namedDescendantForIndex(e,t=e){if("number"!=typeof e||"number"!=typeof t)throw new Error("Arguments must be numbers");Tt(this);let n=pt+nt;return I(n,e,"i32"),I(n+tt,t,"i32"),Ze._ts_node_named_descendant_for_index_wasm(this.tree[0]),kt(this.tree)}descendantForPosition(e,t=e){if(!St(e)||!St(t))throw new Error("Arguments must be {row, column} objects");Tt(this);let n=pt+nt;return At(n,e),At(n+rt,t),Ze._ts_node_descendant_for_position_wasm(this.tree[0]),kt(this.tree)}namedDescendantForPosition(e,t=e){if(!St(e)||!St(t))throw new Error("Arguments must be {row, column} objects");Tt(this);let n=pt+nt;return At(n,e),At(n+rt,t),Ze._ts_node_named_descendant_for_position_wasm(this.tree[0]),kt(this.tree)}walk(){return Tt(this),Ze._ts_tree_cursor_new_wasm(this.tree[0]),new vt(et,this.tree)}toString(){Tt(this);const e=Ze._ts_node_to_string_wasm(this.tree[0]),t=function(e){for(var t="";;){var n=M[e++>>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return Ze._free(e),t}}class vt{constructor(e,t){Ct(e),this.tree=t,Pt(this)}delete(){It(this),Ze._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){Tt(e),It(this,pt+nt),Ze._ts_tree_cursor_reset_wasm(this.tree[0]),Pt(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return It(this),Ze._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return It(this),Ze._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return It(this),1===Ze._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return It(this),1===Ze._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){It(this);const e=Ze._ts_tree_cursor_start_index_wasm(this.tree[0]),t=Ze._ts_tree_cursor_end_index_wasm(this.tree[0]);return xt(this.tree,e,t)}get startPosition(){return It(this),Ze._ts_tree_cursor_start_position_wasm(this.tree[0]),Ot(pt)}get endPosition(){return It(this),Ze._ts_tree_cursor_end_position_wasm(this.tree[0]),Ot(pt)}get startIndex(){return It(this),Ze._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return It(this),Ze._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return It(this),Ze._ts_tree_cursor_current_node_wasm(this.tree[0]),kt(this.tree)}currentFieldId(){return It(this),Ze._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){It(this);const e=Ze._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return Pt(this),1===e}gotoNextSibling(){It(this);const e=Ze._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return Pt(this),1===e}gotoParent(){It(this);const e=Ze._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return Pt(this),1===e}}class bt{constructor(e,t){Ct(e),this[0]=t,this.types=new Array(Ze._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e<t;e++)Ze._ts_language_symbol_type(this[0],e)<2&&(this.types[e]=U(Ze._ts_language_symbol_name(this[0],e)));this.fields=new Array(Ze._ts_language_field_count(this[0])+1);for(let e=0,t=this.fields.length;e<t;e++){const t=Ze._ts_language_field_name_for_id(this[0],e);this.fields[e]=0!==t?U(t):null}}get version(){return Ze._ts_language_version(this[0])}get fieldCount(){return this.fields.length-1}fieldIdForName(e){const t=this.fields.indexOf(e);return-1!==t?t:null}fieldNameForId(e){return this.fields[e]||null}idForNodeType(e,t){const n=W(e),r=Ze._malloc(n+1);z(e,r,n+1);const o=Ze._ts_language_symbol_for_name(this[0],r,n,t);return Ze._free(r),o||null}get nodeTypeCount(){return Ze._ts_language_symbol_count(this[0])}nodeTypeForId(e){const t=Ze._ts_language_symbol_name(this[0],e);return t?U(t):null}nodeTypeIsNamed(e){return!!Ze._ts_language_type_is_named_wasm(this[0],e)}nodeTypeIsVisible(e){return!!Ze._ts_language_type_is_visible_wasm(this[0],e)}query(e){const t=W(e),n=Ze._malloc(t+1);z(e,n,t+1);const r=Ze._ts_query_new(this[0],n,t,pt,pt+tt);if(!r){const t=P(pt+tt,"i32"),r=U(n,P(pt,"i32")).length,o=e.substr(r,100).split("\n")[0];let i,s=o.match(st)[0];switch(t){case 2:i=new RangeError(`Bad node name '${s}'`);break;case 3:i=new RangeError(`Bad field name '${s}'`);break;case 4:i=new RangeError(`Bad capture name @${s}`);break;case 5:i=new TypeError(`Bad pattern structure at offset ${r}: '${o}'...`),s="";break;default:i=new SyntaxError(`Bad syntax at offset ${r}: '${o}'...`),s=""}throw i.index=r,i.length=s.length,Ze._free(n),i}const o=Ze._ts_query_string_count(r),i=Ze._ts_query_capture_count(r),s=Ze._ts_query_pattern_count(r),a=new Array(i),c=new Array(o);for(let e=0;e<i;e++){const t=Ze._ts_query_capture_name_for_id(r,e,pt),n=P(pt,"i32");a[e]=U(t,n)}for(let e=0;e<o;e++){const t=Ze._ts_query_string_value_for_id(r,e,pt),n=P(pt,"i32");c[e]=U(t,n)}const l=new Array(s),u=new Array(s),d=new Array(s),p=new Array(s),h=new Array(s);for(let e=0;e<s;e++){const t=Ze._ts_query_predicates_for_pattern(r,e,pt),n=P(pt,"i32");p[e]=[],h[e]=[];const o=[];let i=t;for(let t=0;t<n;t++){const t=P(i,"i32"),n=P(i+=tt,"i32");if(i+=tt,t===at)o.push({type:"capture",name:a[n]});else if(t===ct)o.push({type:"string",value:c[n]});else if(o.length>0){if("string"!==o[0].type)throw new Error("Predicates must begin with a literal value");const t=o[0].value;let n=!0;switch(t){case"not-eq?":n=!1;case"eq?":if(3!==o.length)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(o.length-1));if("capture"!==o[1].type)throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${o[1].value}"`);if("capture"===o[2].type){const t=o[1].name,r=o[2].name;h[e].push((function(e){let o,i;for(const n of e)n.name===t&&(o=n.node),n.name===r&&(i=n.node);return o.text===i.text===n}))}else{const t=o[1].name,r=o[2].value;h[e].push((function(e){for(const o of e)if(o.name===t)return o.node.text===r===n;return!1}))}break;case"not-match?":n=!1;case"match?":if(3!==o.length)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${o.length-1}.`);if("capture"!==o[1].type)throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${o[1].value}".`);if("string"!==o[2].type)throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${o[2].value}.`);const r=o[1].name,i=new RegExp(o[2].value);h[e].push((function(e){for(const t of e)if(t.name===r)return i.test(t.node.text)===n;return!1}));break;case"set!":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error('Arguments to `#set!` predicate must be a strings.".');l[e]||(l[e]={}),l[e][o[1].value]=o[2]?o[2].value:null;break;case"is?":case"is-not?":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#${t}\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error(`Arguments to \`#${t}\` predicate must be a strings.".`);const s="is?"===t?u:d;s[e]||(s[e]={}),s[e][o[1].value]=o[2]?o[2].value:null;break;default:p[e].push({operator:t,operands:o.slice(1)})}o.length=0}}Object.freeze(l[e]),Object.freeze(u[e]),Object.freeze(d[e])}return Ze._free(n),new wt(et,r,a,h,p,Object.freeze(l),Object.freeze(u),Object.freeze(d))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const r=e;if("undefined"!=typeof process&&process.versions&&process.versions.node){const e=n(747);t=Promise.resolve(e.readFileSync(r))}else t=fetch(r).then((e=>e.arrayBuffer().then((t=>{if(e.ok)return new Uint8Array(t);{const n=new TextDecoder("utf-8").decode(t);throw new Error(`Language.load failed with status ${e.status}.\n\n${n}`)}}))))}const r="function"==typeof loadSideModule?loadSideModule:Ie;return t.then((e=>r(e,{loadAsync:!0}))).then((e=>{const t=Object.keys(e),n=t.find((e=>lt.test(e)&&!e.includes("external_scanner_")));n||console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(t,null,2)}`);const r=e[n]();return new bt(et,r)}))}}class wt{constructor(e,t,n,r,o,i,s,a){Ct(e),this[0]=t,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=i,this.assertedProperties=s,this.refutedProperties=a,this.exceededMatchLimit=!1}delete(){Ze._ts_query_delete(this[0]),this[0]=0}matches(e,t,n){t||(t=it),n||(n=it),Tt(e),Ze._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=P(pt,"i32"),o=P(pt+tt,"i32"),i=P(pt+2*tt,"i32"),s=new Array(r);this.exceededMatchLimit=!!i;let a=0,c=o;for(let t=0;t<r;t++){const n=P(c,"i32"),r=P(c+=tt,"i32");c+=tt;const o=new Array(r);if(c=Et(this,e.tree,c,o),this.textPredicates[n].every((e=>e(o)))){s[a++]={pattern:n,captures:o};const e=this.setProperties[n];e&&(s[t].setProperties=e);const r=this.assertedProperties[n];r&&(s[t].assertedProperties=r);const i=this.refutedProperties[n];i&&(s[t].refutedProperties=i)}}return s.length=a,Ze._free(o),s}captures(e,t,n){t||(t=it),n||(n=it),Tt(e),Ze._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=P(pt,"i32"),o=P(pt+tt,"i32"),i=P(pt+2*tt,"i32"),s=[];this.exceededMatchLimit=!!i;const a=[];let c=o;for(let t=0;t<r;t++){const t=P(c,"i32"),n=P(c+=tt,"i32"),r=P(c+=tt,"i32");if(c+=tt,a.length=n,c=Et(this,e.tree,c,a),this.textPredicates[t].every((e=>e(a)))){const e=a[r],n=this.setProperties[t];n&&(e.setProperties=n);const o=this.assertedProperties[t];o&&(e.assertedProperties=o);const i=this.refutedProperties[t];i&&(e.refutedProperties=i),s.push(e)}}return Ze._free(o),s}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function xt(e,t,n){const r=n-t;let o=e.textCallback(t,null,n);for(t+=o.length;t<n;){const r=e.textCallback(t,null,n);if(!(r&&r.length>0))break;t+=r.length,o+=r}return t>n&&(o=o.slice(0,r)),o}function Et(e,t,n,r){for(let o=0,i=r.length;o<i;o++){const i=P(n,"i32"),s=kt(t,n+=tt);n+=nt,r[o]={name:e.captureNames[i],node:s}}return n}function Ct(e){if(e!==et)throw new Error("Illegal constructor")}function St(e){return e&&"number"==typeof e.row&&"number"==typeof e.column}function Tt(e){let t=pt;I(t,e.id,"i32"),I(t+=tt,e.startIndex,"i32"),I(t+=tt,e.startPosition.row,"i32"),I(t+=tt,e.startPosition.column,"i32"),I(t+=tt,e[0],"i32")}function kt(e,t=pt){const n=P(t,"i32");if(0===n)return null;const r=P(t+=tt,"i32"),o=P(t+=tt,"i32"),i=P(t+=tt,"i32"),s=P(t+=tt,"i32"),a=new yt(et,e);return a.id=n,a.startIndex=r,a.startPosition={row:o,column:i},a[0]=s,a}function It(e,t=pt){I(t+0*tt,e[0],"i32"),I(t+1*tt,e[1],"i32"),I(t+2*tt,e[2],"i32")}function Pt(e){e[0]=P(pt+0*tt,"i32"),e[1]=P(pt+1*tt,"i32"),e[2]=P(pt+2*tt,"i32")}function At(e,t){I(e,t.row,"i32"),I(e+tt,t.column,"i32")}function Ot(e){return{row:P(e,"i32"),column:P(e+tt,"i32")}}function Nt(e,t){At(e,t.startPosition),At(e+=rt,t.endPosition),I(e+=rt,t.startIndex,"i32"),I(e+=tt,t.endIndex,"i32"),e+=tt}function Rt(e){const t={};return t.startPosition=Ot(e),e+=rt,t.endPosition=Ot(e),e+=rt,t.startIndex=P(e,"i32"),e+=tt,t.endIndex=P(e,"i32"),t}return gt.Language=bt,gt.Parser=gt,gt})?r.apply(t,[]):r)||(e.exports=o)},94:(e,t,n)=>{const r=n(747),o=n(622),i=(e,t)=>Array.from(Array(t).keys()).slice(e),s=e=>e.charCodeAt(0),a=new TextDecoder("utf-8"),c=e=>a.decode(new Uint8Array(e));function l(e){const t=new Set;let n=e[0];for(let r=1;r<e.length;r++){const o=e[r];t.add([n,o]),n=o}return t}const u=new TextEncoder("utf-8"),d=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu;let p=!1;const h={};let f,m={},g=new Map,_=new Map;const y=new Map;function v(){if(p)return;m=JSON.parse(r.readFileSync(o.resolve(__dirname,"..","dist","tokenizer.json"))),Object.keys(m).map((e=>{h[m[e]]=e}));const e=r.readFileSync(o.resolve(__dirname,"..","dist","vocab.bpe"),"utf-8").split("\n"),t=e.slice(1,e.length-1).map((e=>e.split(/(\s+)/).filter((function(e){return e.trim().length>0}))));f=((e,t)=>{const n={};return e.map(((r,o)=>{n[e[o]]=t[o]})),n})(t,i(0,t.length)),function(e){const t=i(s("!"),s("~")+1).concat(i(s("¡"),s("¬")+1),i(s("®"),s("ÿ")+1));let n=t.slice(),r=0;for(let e=0;e<256;e++)t.includes(e)||(t.push(e),n.push(256+r),r+=1);n=n.map((e=>(e=>String.fromCharCode(e))(e)));for(let r=0;r<t.length;r++)e.set(t[r],n[r])}(g),g.forEach((function(e,t,n){_.set(e,t)})),p=!0}function b(e){if(y.has(e))return y.get(e);let t=(r=e,Array.from(u.encode(r))).map((e=>g.get(e))),n=l(t);var r;if(!n)return t.map((e=>m[e]));for(;;){const e={};Array.from(n).map((t=>{const n=f[t];e[isNaN(n)?1e11:n]=t}));const r=e[Math.min(...Object.keys(e).map((e=>parseInt(e))))];if(!(r in f))break;const o=r[0],i=r[1];let s=[],a=0;for(;a<t.length;){const e=t.indexOf(o,a);if(-1===e){Array.prototype.push.apply(s,t.slice(a));break}Array.prototype.push.apply(s,t.slice(a,e)),a=e,t[a]===o&&a<t.length-1&&t[a+1]===i?(s.push(o+i),a+=2):(s.push(t[a]),a+=1)}if(t=s,1===t.length)break;n=l(t)}return tokens=t.map((e=>m[e])),y.set(e,tokens),tokens}function w(e){v();let t=[];const n=Array.from(e.matchAll(d)).map((e=>e[0]));for(let e of n){const n=b(e);Array.prototype.push.apply(t,n)}return t}function x(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(-n),o=w(r);for(;o.length<t+2&&n<e.length;)n=Math.min(e.length,n+1*t),r=e.slice(-n),o=w(r);return o.length<t?e:(o=o.slice(-t),E(o))}function E(e){v();let t=e.map((e=>h[e])).join("");return t=c(t.split("").map((e=>_.get(e)))),t}e.exports={prepareTokenizer:v,tokenize:w,tokenize_strings:function(e){return w(e).map((e=>c(h[e].split("").map((e=>_.get(e))))))},tokenLength:function(e){return w(e).length},takeLastTokens:x,takeLastLinesTokens:function(e,t){const n=x(e,t);if(n.length===e.length||"\n"===e[e.length-n.length-1])return n;let r=n.indexOf("\n");return n.substring(r+1)},takeFirstTokens:function(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(0,n),o=w(r);for(;o.length<t+2&&n<e.length;)n=Math.min(e.length,n+1*t),r=e.slice(0,n),o=w(r);return o.length<t?e:(o=o.slice(0,t),E(o))},detokenize:E}},747:e=>{"use strict";e.exports=n(7147)},622:e=>{"use strict";e.exports=n(1017)},13:e=>{"use strict";e.exports=n(1267)}},o={},i=function e(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return r[t].call(i.exports,i,i.exports,e),i.exports}(563),e.exports=i},9852:(e,t,n)=>{const r=n(7147),o=n(1017),i=(e,t)=>Array.from(Array(t).keys()).slice(e),s=e=>e.charCodeAt(0),a=new TextDecoder("utf-8"),c=e=>a.decode(new Uint8Array(e));function l(e){const t=new Set;let n=e[0];for(let r=1;r<e.length;r++){const o=e[r];t.add([n,o]),n=o}return t}const u=new TextEncoder("utf-8");const d=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu;let p=!1;const h={};let f,m={},g=new Map,_=new Map;const y=new Map;function v(){if(p)return;m=JSON.parse(r.readFileSync(o.resolve(__dirname,"..","dist","tokenizer.json"))),Object.keys(m).map((e=>{h[m[e]]=e}));const e=r.readFileSync(o.resolve(__dirname,"..","dist","vocab.bpe"),"utf-8").split("\n"),t=e.slice(1,e.length-1).map((e=>e.split(/(\s+)/).filter((function(e){return e.trim().length>0}))));f=((e,t)=>{const n={};return e.map(((r,o)=>{n[e[o]]=t[o]})),n})(t,i(0,t.length)),function(e){const t=i(s("!"),s("~")+1).concat(i(s("¡"),s("¬")+1),i(s("®"),s("ÿ")+1));let n=t.slice(),r=0;for(let e=0;e<256;e++)t.includes(e)||(t.push(e),n.push(256+r),r+=1);n=n.map((e=>(e=>String.fromCharCode(e))(e)));for(let r=0;r<t.length;r++)e.set(t[r],n[r])}(g),g.forEach((function(e,t,n){_.set(e,t)})),p=!0}function b(e){if(y.has(e))return y.get(e);let t=(r=e,Array.from(u.encode(r))).map((e=>g.get(e))),n=l(t);var r;if(!n)return t.map((e=>m[e]));for(;;){const e={};Array.from(n).map((t=>{const n=f[t];e[isNaN(n)?1e11:n]=t}));const r=e[Math.min(...Object.keys(e).map((e=>parseInt(e))))];if(!(r in f))break;const o=r[0],i=r[1];let s=[],a=0;for(;a<t.length;){const e=t.indexOf(o,a);if(-1===e){Array.prototype.push.apply(s,t.slice(a));break}Array.prototype.push.apply(s,t.slice(a,e)),a=e,t[a]===o&&a<t.length-1&&t[a+1]===i?(s.push(o+i),a+=2):(s.push(t[a]),a+=1)}if(t=s,1===t.length)break;n=l(t)}return tokens=t.map((e=>m[e])),y.set(e,tokens),tokens}function w(e){v();let t=[];const n=Array.from(e.matchAll(d)).map((e=>e[0]));for(let e of n){const n=b(e);Array.prototype.push.apply(t,n)}return t}function x(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(-n),o=w(r);for(;o.length<t+2&&n<e.length;)n=Math.min(e.length,n+1*t),r=e.slice(-n),o=w(r);return o.length<t?e:(o=o.slice(-t),E(o))}function E(e){v();let t=e.map((e=>h[e])).join("");return t=c(t.split("").map((e=>_.get(e)))),t}e.exports={prepareTokenizer:v,tokenize:w,tokenize_strings:function(e){return w(e).map((e=>c(h[e].split("").map((e=>_.get(e))))))},tokenLength:function(e){return w(e).length},takeLastTokens:x,takeLastLinesTokens:function(e,t){const n=x(e,t);if(n.length===e.length||"\n"===e[e.length-n.length-1])return n;let r=n.indexOf("\n");return n.substring(r+1)},takeFirstTokens:function(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(0,n),o=w(r);for(;o.length<t+2&&n<e.length;)n=Math.min(e.length,n+1*t),r=e.slice(0,n),o=w(r);return o.length<t?e:(o=o.slice(0,t),E(o))},detokenize:E}},8028:e=>{"use strict";e.exports=require("@opentelemetry/tracing")},9166:e=>{"use strict";e.exports=require("applicationinsights-native-metrics")},9496:e=>{"use strict";e.exports=require("vscode")},9491:e=>{"use strict";e.exports=require("assert")},852:e=>{"use strict";e.exports=require("async_hooks")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6206:e=>{"use strict";e.exports=require("console")},2057:e=>{"use strict";e.exports=require("constants")},6113:e=>{"use strict";e.exports=require("crypto")},9523:e=>{"use strict";e.exports=require("dns")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},1995:e=>{"use strict";e.exports=require("http2")},5687:e=>{"use strict";e.exports=require("https")},8188:e=>{"use strict";e.exports=require("module")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},2781:e=>{"use strict";e.exports=require("stream")},9512:e=>{"use strict";e.exports=require("timers")},4404:e=>{"use strict";e.exports=require("tls")},6224:e=>{"use strict";e.exports=require("tty")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},1267:e=>{"use strict";e.exports=require("worker_threads")},9796:e=>{"use strict";e.exports=require("zlib")},5258:e=>{"use strict";e.exports=JSON.parse('{"name":"@adobe/helix-fetch","version":"3.1.1","description":"Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2","main":"src/index.js","scripts":{"test":"nyc mocha","lint":"./node_modules/.bin/eslint .","semantic-release":"semantic-release"},"mocha":{"timeout":"5000","recursive":"true","reporter":"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},"engines":{"node":">=12.0"},"types":"src/index.d.ts","exports":{"import":"./src/index.mjs","require":"./src/index.js"},"repository":{"type":"git","url":"https://github.com/adobe/helix-fetch"},"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/adobe/helix-fetch/issues"},"homepage":"https://github.com/adobe/helix-fetch#readme","keywords":["fetch","whatwg","Fetch API","http","https","http2","h2","promise","async","request","RFC 7234","7234","caching","cache"],"dependencies":{"debug":"4.3.4","http-cache-semantics":"4.1.0","lru-cache":"7.13.1"},"devDependencies":{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1","chai":"4.3.6","chai-as-promised":"7.1.1","chai-bytes":"0.1.2","chai-iterator":"3.0.2","eslint":"8.21.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.26.0","formdata-node":"4.3.3","lint-staged":"13.0.3","mocha":"10.0.0","mocha-multi-reporters":"1.5.1","nock":"13.2.9","nyc":"15.1.0","parse-cache-control":"1.0.1","pem":"1.14.6","proxy":"^1.0.2","semantic-release":"19.0.3","sinon":"14.0.0","stream-buffers":"3.0.2","tunnel":"^0.0.6"},"lint-staged":{"*.js":"eslint"},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"},"ghooks":{"pre-commit":"npx lint-staged"}}}')},4775:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},98:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},6157:e=>{"use strict";e.exports={i8:"1.7.6"}},130:e=>{"use strict";e.exports={i8:"0.2.0"}},2301:e=>{"use strict";e.exports={i8:"1.3.7"}},4147:e=>{"use strict";e.exports=JSON.parse('{"name":"copilot","displayName":"GitHub Copilot","description":"Your AI pair programmer","version":"1.54.7077","build":"7077","buildType":"prod","publisher":"GitHub","preview":false,"homepage":"https://github.com/features/copilot","bugs":{"url":"https://github.com/community/community/discussions/categories/copilot"},"qna":"https://github.com/github-community/community/discussions/categories/copilot","icon":"assets/Copilot-App-Icon.png","engines":{"vscode":"^1.68.0","npm":">=7.0.0"},"categories":["Other"],"badges":[{"url":"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange","href":"https://github.com/github-copilot/signup","description":"Sign up for GitHub Copilot"}],"activationEvents":["onStartupFinished"],"main":"./dist/extension","enabledApiProposals":["inlineCompletionsAdditions"],"contributes":{"commands":[{"command":"github.copilot.generate","title":"Open GitHub Copilot"},{"command":"github.copilot.toggleCopilot","title":"GitHub Copilot: Configure Enabled/Disabled"},{"command":"github.copilot.sendFeedback","title":"GitHub Copilot: Send Feedback"}],"keybindings":[{"command":"github.copilot.generate","key":"ctrl+enter","mac":"ctrl+enter","when":"editorTextFocus && github.copilot.activated"},{"command":"editor.action.inlineSuggest.trigger","key":"alt+\\\\","when":"editorTextFocus && !editorHasSelection && config.github.copilot.inlineSuggest.enable && !inlineSuggestionsVisible"}],"menus":{"editor/inlineCompletions/actions":[{"command":"github.copilot.generate","when":"github.copilot.activated"}],"commandPalette":[{"command":"github.copilot.generate","when":"github.copilot.activated"},{"command":"github.copilot.toggleCopilot","when":"github.copilot.activated"},{"command":"github.copilot.sendFeedback","when":"github.copilot.activated"}]},"configuration":[{"title":"Copilot","properties":{"github.copilot.advanced":{"type":"object","title":"Advanced Settings","properties":{"secret_key":{"type":"string","default":"","description":"Secret API key"},"length":{"type":"integer","default":500,"description":"Length of code to generate in tokens"},"temperature":{"type":"string","default":"","description":"Override sampling temperature (range 0.0 - 1.0)"},"top_p":{"type":"number","default":1,"description":"Top probability mass to consider"},"stops":{"type":"object","default":{"*":["\\n\\n\\n"],"python":["\\ndef ","\\nclass ","\\nif ","\\n\\n#"]},"description":"Configure per-language stop sequences"},"indentationMode":{"type":"object","default":{"python":false,"javascript":false,"javascriptreact":false,"jsx":false,"typescript":false,"typescriptreact":false,"go":false,"ruby":false,"*":true},"markdownDescription":"Enable or disable indentation block termination for specified [languages](https://code.visualstudio.com/docs/languages/identifiers). Set to \'clientandserver\' to run both parser-based and indent-based termination."},"inlineSuggestCount":{"type":"integer","default":3,"description":"Number of inline suggestions to fetch"},"listCount":{"type":"integer","default":10,"description":"Number of solutions to list in Open GitHub Copilot"},"debug.showScores":{"type":"boolean","default":false,"description":"Show scores in sorted solutions"},"debug.overrideEngine":{"type":"string","default":"","description":"Override engine name"},"debug.overrideProxyUrl":{"type":"string","default":"","description":"Override GitHub authentication proxy full URL"},"debug.testOverrideProxyUrl":{"type":"string","default":"","description":"Override GitHub authentication proxy URL when running tests"},"debug.filterLogCategories":{"type":"array","default":[],"description":"Show only log categories listed in this setting. If an array is empty, show all loggers"}}},"github.copilot.enable":{"type":"object","default":{"*":true,"yaml":false,"plaintext":false,"markdown":false},"markdownDescription":"Enable or disable Copilot for specified [languages](https://code.visualstudio.com/docs/languages/identifiers)"},"github.copilot.inlineSuggest.enable":{"type":"boolean","default":true,"description":"Show inline suggestions"}}}],"icons":{"copilot-logo":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0041"}},"copilot-warning":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0042"}},"copilot-notconnected":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0043"}}},"iconFonts":[{"id":"copilot-font","src":[{"path":"assets/copilot.woff","format":"woff"}]}]},"scripts":{"postinstall":"npx vscode-dts dev && mv vscode.proposed.*.ts extension/src","vscode:prepublish":"npm-run-all build:extension","build":"npm-run-all build:*","build:agent":"cd agent && npm run build","build:agent-no-pkg":"cd agent && npm run build-no-pkg","build:extension":"webpack --mode production","build:lib":"cd lib && npm run build","compile":"npm-run-all compile:*","compile:agent":"cd agent && npm run compile","compile:extension":"webpack --mode development","compile:lib":"cd lib && npm run compile","watch":"npm-run-all -p watch:*","watch:agent":"cd agent && npm run watch","watch:extension":"webpack --mode development --watch","watch:lib":"cd lib && npm run watch","lint":"eslint lib extension agent --ext ts","check_deps":"depcruise -c .dependency-cruiser.js .","test":"npm-run-all test:*","test:agent":"cd agent && npm run test","test:extension":"cd extension && ts-node ./test/runTest.ts","test:prompt":"cd prompt && npm install && npm run test","test:lib":"cd lib && npm run test","test:lsp-client":"cd lsp-client && npm run smokeTest","build_test":"tsc extension/test/run.ts","get_token":"ts-node script/getToken.ts"},"devDependencies":{"@github/prettier-config":"0.0.4","@types/crypto-js":"^4.0.1","@types/mocha":"^5.2.6","@types/node":"^13.11.0","@types/tunnel":"^0.0.3","@types/uuid":"^8.3.1","@types/vscode":"^1.68.0","@typescript-eslint/eslint-plugin":"^4.27.0","@typescript-eslint/parser":"^4.27.0","dependency-cruiser":"^9.26.1","eslint":"^7.29.0","eslint-plugin-no-only-tests":"^2.6.0","fantasticon":"^1.2.2","get-port":"^5.1.1","mocha":"^6.1.4","npm-run-all":"^4.1.5","prettier":"2.5.1","prettier-plugin-organize-imports":"^2.3.4","ts-dedent":"^2.2.0","ts-loader":"^8.0.11","ts-node":"^9.0.0","typescript":"^4.4.3","vsce":"1.91.0","vscode-dts":"^0.3.2","vscode-test":"^1.3.0","webpack":"^5.54.0","webpack-cli":"^4.2.0","zlib":"^1.0.5"},"dependencies":{"@adobe/helix-fetch":"github:bmuskalla/helix-fetch#4e33e47bf6e64b637d5d713558fde504bf71c947","@github/copilot-promptlib":"file:prompt","@sinclair/typebox":"^0.23.4","@types/git-url-parse":"^9.0.1","ajv":"^8.6.3","ajv-errors":"^3.0.0","crypto-js":"^4.0.0","git-url-parse":"^13.1.0","open":"^8.4.0","source-map-support":"^0.5.19","tunnel":"^0.0.6","uuid":"^8.3.2","vscode-extension-telemetry":"^0.1.6","vscode-uri":"^3.0.2"}}')}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.deactivate=e.activate=e.init=void 0;const t=n(3055);n(406);const o=n(9496),i=n(362),s=n(299),a=n(1133),c=n(4197),l=n(7870),u=n(9408),d=n(1839),p=n(9189),h=n(9748),f=n(8965),m=n(5413),g=n(9899),_=n(2279),y=n(1547),v=n(4419),b=n(6722),w=n(2533),x=n(766),E=n(6333),C=n(956),S=n(70),T=n(8771),k=n(6403),I=n(3136),P=n(7057),A=n(3197),O=n(1862),N=n(9425),R=n(3060),M=(n(1929),n(6267)),L=n(2990),$=n(6857),D=n(9477),F=n(7254),j=n(4428),q=n(8129),B=n(385),U=o.window.createOutputChannel("GitHub Copilot");function H(){(0,_.init)((new a.BuildInfo).getVersion())}function z(e,t,n){return o.commands.registerCommand(t,(async(...r)=>{try{return await n(...r)}catch(n){E.telemetryException(e,n,t)}}))}let W;e.init=H,H(),e.activate=async function(e){const n=new l.Context;n.set(a.ConfigProvider,new N.VSCodeConfigProvider),n.set(s.Clock,new s.Clock),n.set(a.BuildInfo,new a.BuildInfo),n.set(a.EditorAndPluginInfo,new N.VSCodeEditorInfo),n.set(g.LogVerbose,new g.LogVerbose(!1)),n.set(m.GhostTextDebounceManager,new m.GhostTextDebounceManager),n.set(f.ContextualFilterManager,new f.ContextualFilterManager);const r=new g.MultiLog([new g.ConsoleLog(console),new g.OutputChannelLog(U)]);n.set(g.LogTarget,r),n.set(k.LocationFactory,new q.ExtensionLocationFactory),n.set(I.TextDocumentManager,new B.ExtensionTextDocumentManager),n.set(p.Features,new p.Features(n));const H=new _.HelixFetcher(n);n.set(_.Fetcher,H),(0,D.initProxyEnvironment)(H,process.env),n.set(t.FileSystem,$.extensionFileSystem),n.set(y.NotificationSender,new O.ExtensionNotificationSender),n.set(E.TelemetryEndpointUrlOverride,E.telemetryEndpointUrlOverride),e.extensionMode===o.ExtensionMode.Test?(n.set(i.CopilotTokenManager,(0,C.makeTestingCopilotTokenManager)()),n.set(a.VscInfo,(0,a.getTestVscInfo)()),n.set(S.RuntimeMode,S.RuntimeMode.fromEnvironment(!0)),n.set(h.ExpConfigMaker,new h.ExpConfigNone),n.set(E.TelemetryReporters,E.setupStandardReporters(n,"copilot-test")),n.set(P.UrlOpener,new T.TestUrlOpener)):(n.set(i.CopilotTokenManager,new O.VSCodeCopilotTokenManager),n.set(a.VscInfo,(0,N.makeVscInfo)()),n.set(v.OpenAIFetcher,new v.LiveOpenAIFetcher),n.set(a.BlockModeConfig,new a.ConfigBlockModeConfig),n.set(S.RuntimeMode,S.RuntimeMode.fromEnvironment(!1)),n.set(h.ExpConfigMaker,new h.ExpConfigFromTAS),n.set(E.TelemetryReporters,j.activate(n,e)),n.set(P.UrlOpener,new P.RealUrlOpener)),"GitHub.copilot-nightly"===e.extension.id&&(0,u.registerDefaultHandlers)(n,"vscode"),(0,N.setExtension)(e.extension),(0,O.setExtensionContext)(e),e.globalState.setKeysForSync([O.telemetryAcceptanceKey]);const V=(0,a.getBuildType)(n)===a.BuildType.DEV,G="GitHub.copilot-nightly"===e.extension.id;if(G&&o.extensions.all.find((e=>"GitHub.copilot"===e.id)))return void("Uninstall"===await o.window.showWarningMessage("To use GitHub Copilot Nightly you need to uninstall GitHub Copilot extension","Uninstall")&&await o.commands.executeCommand("workbench.extensions.uninstallExtension","GitHub.copilot"));(G||V)&&o.commands.executeCommand("setContext","github.copilot.nightly",!0);const K=function(e,t){const n=new F.CopilotStatusBar(e);return t.subscriptions.push(z(e,R.CMDToggleCopilot,(()=>{n.toggleStatusBar()}))),t.subscriptions.push(z(e,R.CMDShowActivationErrors,(()=>{n.showActivationErrors(U)}))),t.subscriptions.push(n.getStatusBarItem()),n}(n,e);n.set(b.StatusReporter,K);const J=async()=>{try{1+1}catch(e){const t=e.message||e;E.telemetryError(n,"activationFailed",E.TelemetryData.createAndMarkAsIssued({reason:t})),n.get(E.TelemetryReporters).deactivate();const r=`GitHub Copilot could not connect to server. Extension activation failed: "${t}"`;return K.setError(r,J),g.logger.error(n,r),void o.commands.executeCommand("setContext","github.copilot.activated",!1)}K.forceNormal(),o.commands.executeCommand("setContext","github.copilot.activated",!0),e.subscriptions.push(z(n,R.CMDOpenPanel,(()=>{o.commands.executeCommand("editor.action.inlineSuggest.hide"),(0,M.commandOpenPanel)(n)}))),e.subscriptions.push(z(n,R.CMDOpenPanelForRange,(e=>{(0,M.commandOpenPanel)(n,e)})),z(n,R.CMDAcceptPanelSolution,(async(e,t,n,r,i)=>{const s=new o.WorkspaceEdit;if(s.insert(e,t,n),await o.workspace.applyEdit(s),i(),await o.commands.executeCommand("workbench.action.closeActiveEditor"),r&&o.window.activeTextEditor&&o.window.activeTextEditor.document.uri.toString()===e.toString()){const e=t.translate(1).with(void 0,0),n=new o.Selection(e,e);o.window.activeTextEditor.selection=n}}))),e.subscriptions.push(z(n,R.CMDSendFeedback,(()=>{o.env.openExternal(o.Uri.parse("https://github.com/github/feedback/discussions/categories/copilot"))})));const t=new L.CopilotPanel(n);e.subscriptions.push(o.workspace.registerTextDocumentContentProvider(c.CopilotScheme,t),o.languages.registerCodeLensProvider({scheme:c.CopilotScheme},t));try{e.subscriptions.push(...(0,A.registerGhostText)(n));const t=o.workspace.getConfiguration(),r=t.inspect("editor.inlineSuggest.enabled");void 0===(null==r?void 0:r.globalValue)&&t.update("editor.inlineSuggest.enabled",!0,o.ConfigurationTarget.Global)}catch(e){o.window.showErrorMessage("GitHub Copilot requires VS Code 1.57+. Please update your VS Code")}e.subscriptions.push((0,d.registerDocumentTracker)(n)),e.subscriptions.push(o.window.onDidChangeActiveTextEditor((e=>e?e.document.isUntitled||"file"===e.document.uri.scheme&&(0,x.extractRepoInfoInBackground)(n,e.document.uri.toString()):void 0)));const r=e.extensionMode!==o.ExtensionMode.Development;w.init(n,r,new g.Logger(g.LogLevel.INFO,"promptlib proxy")),E.telemetry(n,"extension.activate"),W=n};await J()},e.deactivate=function(){W&&(E.telemetry(W,"extension.deactivate"),W.get(E.TelemetryReporters).deactivate()),w.terminate()}})(),module.exports=r})();
//# sourceMappingURL=extension.js.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment