-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathauth-app.bundle.mjs
15 lines (14 loc) · 62.6 KB
/
auth-app.bundle.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* esm.sh - esbuild bundle(@octokit/[email protected]) es2015 production */
(()=>{var G=Object.defineProperty;var g=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var K=(n,i,c)=>i in n?G(n,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):n[i]=c,F=(n,i)=>{for(var c in i||(i={}))S.call(i,c)&&K(n,c,i[c]);if(g)for(var c of g(i))W.call(i,c)&&K(n,c,i[c]);return n};var I=(n,i)=>{var c={};for(var l in n)S.call(n,l)&&i.indexOf(l)<0&&(c[l]=n[l]);if(n!=null&&g)for(var l of g(n))i.indexOf(l)<0&&W.call(n,l)&&(c[l]=n[l]);return c};var ee=Object.create,j=Object.defineProperty,te=Object.getOwnPropertyDescriptor,re=Object.getOwnPropertyNames,ne=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty,u=(n,i)=>j(n,"name",{value:i,configurable:!0}),oe=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports),se=(n,i,c,l)=>{if(i&&typeof i=="object"||typeof i=="function")for(let d of re(i))!ie.call(n,d)&&d!==c&&j(n,d,{get:()=>i[d],enumerable:!(l=te(i,d))||l.enumerable});return n},H=(n,i,c)=>(c=n!=null?ee(ne(n)):{},se(i||!n||!n.__esModule?j(c,"default",{value:n,enumerable:!0}):c,n)),$=oe((n,i)=>{"use strict";var c=typeof Reflect=="object"?Reflect:null,l=c&&typeof c.apply=="function"?c.apply:u(function(e,t,r){return Function.prototype.apply.call(e,t,r)},"ReflectApply"),d;c&&typeof c.ownKeys=="function"?d=c.ownKeys:Object.getOwnPropertySymbols?d=u(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):d=u(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function C(e){console&&console.warn&&console.warn(e)}u(C,"ProcessEmitWarning");var P=Number.isNaN||u(function(e){return e!==e},"NumberIsNaN");function f(){f.init.call(this)}u(f,"EventEmitter"),i.exports=f,i.exports.once=A,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var D=10;function y(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}u(y,"checkListener"),Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return D},set:function(e){if(typeof e!="number"||e<0||P(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");D=e}}),f.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},f.prototype.setMaxListeners=u(function(e){if(typeof e!="number"||e<0||P(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function L(e){return e._maxListeners===void 0?f.defaultMaxListeners:e._maxListeners}u(L,"_getMaxListeners"),f.prototype.getMaxListeners=u(function(){return L(this)},"getMaxListeners"),f.prototype.emit=u(function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o=e==="error",s=this._events;if(s!==void 0)o=o&&s.error===void 0;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var p=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw p.context=a,p}var v=s[e];if(v===void 0)return!1;if(typeof v=="function")l(v,this,t);else for(var k=v.length,Z=E(v,k),r=0;r<k;++r)l(Z[r],this,t);return!0},"emit");function b(e,t,r,o){var s,a,p;if(y(r),a=e._events,a===void 0?(a=e._events=Object.create(null),e._eventsCount=0):(a.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),p=a[t]),p===void 0)p=a[t]=r,++e._eventsCount;else if(typeof p=="function"?p=a[t]=o?[r,p]:[p,r]:o?p.unshift(r):p.push(r),s=L(e),s>0&&p.length>s&&!p.warned){p.warned=!0;var v=new Error("Possible EventEmitter memory leak detected. "+p.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");v.name="MaxListenersExceededWarning",v.emitter=e,v.type=t,v.count=p.length,C(v)}return e}u(b,"_addListener"),f.prototype.addListener=u(function(e,t){return b(this,e,t,!1)},"addListener"),f.prototype.on=f.prototype.addListener,f.prototype.prependListener=u(function(e,t){return b(this,e,t,!0)},"prependListener");function M(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}u(M,"onceWrapper");function w(e,t,r){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=M.bind(o);return s.listener=r,o.wrapFn=s,s}u(w,"_onceWrap"),f.prototype.once=u(function(e,t){return y(t),this.on(e,w(this,e,t)),this},"once"),f.prototype.prependOnceListener=u(function(e,t){return y(t),this.prependListener(e,w(this,e,t)),this},"prependOnceListener"),f.prototype.removeListener=u(function(e,t){var r,o,s,a,p;if(y(t),o=this._events,o===void 0)return this;if(r=o[e],r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(s=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){p=r[a].listener,s=a;break}if(s<0)return this;s===0?r.shift():R(r,s),r.length===1&&(o[e]=r[0]),o.removeListener!==void 0&&this.emit("removeListener",e,p||t)}return this},"removeListener"),f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=u(function(e){var t,r,o;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var s=Object.keys(r),a;for(o=0;o<s.length;++o)a=s[o],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=r[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},"removeAllListeners");function _(e,t,r){var o=e._events;if(o===void 0)return[];var s=o[t];return s===void 0?[]:typeof s=="function"?r?[s.listener||s]:[s]:r?N(s):E(s,s.length)}u(_,"_listeners"),f.prototype.listeners=u(function(e){return _(this,e,!0)},"listeners"),f.prototype.rawListeners=u(function(e){return _(this,e,!1)},"rawListeners"),f.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):O.call(e,t)},f.prototype.listenerCount=O;function O(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}u(O,"listenerCount"),f.prototype.eventNames=u(function(){return this._eventsCount>0?d(this._events):[]},"eventNames");function E(e,t){for(var r=new Array(t),o=0;o<t;++o)r[o]=e[o];return r}u(E,"arrayClone");function R(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}u(R,"spliceOne");function N(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}u(N,"unwrapListeners");function A(e,t){return new Promise(function(r,o){function s(p){e.removeListener(t,a),o(p)}u(s,"errorListener");function a(){typeof e.removeListener=="function"&&e.removeListener("error",s),r([].slice.call(arguments))}u(a,"resolver"),x(e,t,a,{once:!0}),t!=="error"&&T(e,s,{once:!0})})}u(A,"once");function T(e,t,r){typeof e.on=="function"&&x(e,"error",t,r)}u(T,"addErrorHandlerIfEventEmitter");function x(e,t,r,o){if(typeof e.on=="function")o.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,u(function s(a){o.once&&e.removeEventListener(t,s),r(a)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}u(x,"eventTargetAgnosticAddListener")}),ue=H($()),B=H($()),{EventEmitter:J,init:le,listenerCount:ve,once:de}=B,q=B,{default:ae}=q,ce=I(q,["default"]),z,U,he=(U=(z=ue.default)!=null?z:ae)!=null?U:ce;var h=new J;h.setMaxListeners(1024);var m=typeof Deno!="undefined",Q,V,X,Y={title:m?"deno":"browser",browser:!0,env:m?new Proxy({},{get(n,i){return Deno.env.get(String(i))},ownKeys:()=>Reflect.ownKeys(Deno.env.toObject()),getOwnPropertyDescriptor:(n,i)=>{let c=Deno.env.toObject();if(i in Deno.env.toObject()){let l={enumerable:!0,configurable:!0};return typeof i=="string"&&(l.value=c[i]),l}},set(n,i,c){return Deno.env.set(String(i),String(c)),c}}):{},argv:m?(Q=Deno.args)!=null?Q:[]:[],pid:m&&(V=Deno.pid)!=null?V:0,version:"v16.18.0",versions:F({node:"16.18.0",v8:"9.4.146.26-node.22",uv:"1.43.0",zlib:"1.2.11",brotli:"1.0.9",ares:"1.18.1",modules:"93",nghttp2:"1.47.0",napi:"8",llhttp:"6.0.10",openssl:"1.1.1q+quic",cldr:"41.0",icu:"71.1",tz:"2022b",unicode:"14.0",ngtcp2:"0.8.1",nghttp3:"0.7.0"},m?(X=Deno.version)!=null?X:{}:{}),on:(...n)=>h.on(...n),addListener:(...n)=>h.addListener(...n),once:(...n)=>h.once(...n),off:(...n)=>h.off(...n),removeListener:(...n)=>h.removeListener(...n),removeAllListeners:(...n)=>h.removeAllListeners(...n),emit:(...n)=>h.emit(...n),prependListener:(...n)=>h.prependListener(...n),prependOnceListener:(...n)=>h.prependOnceListener(...n),listeners:()=>[],emitWarning:()=>{throw new Error("process.emitWarning is not supported")},binding:()=>{throw new Error("process.binding is not supported")},cwd:()=>{var n,i;return m&&(i=(n=Deno.cwd)==null?void 0:n.call(Deno))!=null?i:"/"},chdir:n=>{if(m)Deno.chdir(n);else throw new Error("process.chdir is not supported")},umask:()=>{var n;return m&&(n=Deno.umask)!=null?n:0},nextTick:(n,...i)=>queueMicrotask(()=>n(...i))};globalThis.__Process$=Y;})();
var mn=Object.create;var ze=Object.defineProperty,yn=Object.defineProperties,wn=Object.getOwnPropertyDescriptor,bn=Object.getOwnPropertyDescriptors,_n=Object.getOwnPropertyNames,Je=Object.getOwnPropertySymbols,An=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable;var ht=(e,t,i)=>t in e?ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,g=(e,t)=>{for(var i in t||(t={}))lt.call(t,i)&&ht(e,i,t[i]);if(Je)for(var i of Je(t))Nt.call(t,i)&&ht(e,i,t[i]);return e},A=(e,t)=>yn(e,bn(t));var J=(e,t)=>{var i={};for(var n in e)lt.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&Je)for(var n of Je(e))t.indexOf(n)<0&&Nt.call(e,n)&&(i[n]=e[n]);return i};var R=(e,t)=>()=>(e&&(t=e(e=0)),t);var be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ee=(e,t)=>{for(var i in t)ze(e,i,{get:t[i],enumerable:!0})},Ye=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of _n(t))!lt.call(e,r)&&r!==i&&ze(e,r,{get:()=>t[r],enumerable:!(n=wn(t,r))||n.enumerable});return e},fe=(e,t,i)=>(Ye(e,t,"default"),i&&Ye(i,t,"default")),U=(e,t,i)=>(i=e!=null?mn(An(e)):{},Ye(t||!e||!e.__esModule?ze(i,"default",{value:e,enumerable:!0}):i,e)),_e=e=>Ye(ze({},"__esModule",{value:!0}),e);var E=(e,t,i)=>(ht(e,typeof t!="symbol"?t+"":t,i),i),ft=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)};var s=(e,t,i)=>(ft(e,t,"read from private field"),i?i.call(e):t.get(e)),w=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},f=(e,t,i,n)=>(ft(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);var Qe=(e,t,i,n)=>({set _(r){f(e,t,r,i)},get _(){return s(e,t,n)}}),h=(e,t,i)=>(ft(e,t,"access private method"),i);var m=(e,t,i)=>new Promise((n,r)=>{var o=u=>{try{c(i.next(u))}catch(d){r(d)}},a=u=>{try{c(i.throw(u))}catch(d){r(d)}},c=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);c((i=i.apply(e,t)).next())});var Ae=be(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});function Sn(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof __Process$=="object"&&"version"in __Process$?`Node.js/${__Process$.version.substr(1)} (${__Process$.platform}; ${__Process$.arch})`:"<environment undetectable>"}pt.getUserAgent=Sn});function Wt(e){return Object.prototype.toString.call(e)==="[object Object]"}function Xe(e){var t,i;return Wt(e)===!1?!1:(t=e.constructor,t===void 0?!0:(i=t.prototype,!(Wt(i)===!1||i.hasOwnProperty("isPrototypeOf")===!1)))}var dt=R(()=>{});function On(e){return e?Object.keys(e).reduce((t,i)=>(t[i.toLowerCase()]=e[i],t),{}):{}}function Vt(e,t){let i=Object.assign({},e);return Object.keys(t).forEach(n=>{Xe(t[n])?n in e?i[n]=Vt(e[n],t[n]):Object.assign(i,{[n]:t[n]}):Object.assign(i,{[n]:t[n]})}),i}function Lt(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function mt(e,t,i){var r;if(typeof t=="string"){let[o,a]=t.split(" ");i=Object.assign(a?{method:o,url:a}:{url:o},i)}else i=Object.assign({},t);i.headers=On(i.headers),Lt(i),Lt(i.headers);let n=Vt(e||{},i);return i.url==="/graphql"&&(e&&((r=e.mediaType.previews)!=null&&r.length)&&(n.mediaType.previews=e.mediaType.previews.filter(o=>!n.mediaType.previews.includes(o)).concat(n.mediaType.previews)),n.mediaType.previews=(n.mediaType.previews||[]).map(o=>o.replace(/-preview/,""))),n}function En(e,t){let i=/\?/.test(e)?"&":"?",n=Object.keys(t);return n.length===0?e:e+i+n.map(r=>r==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${r}=${encodeURIComponent(t[r])}`).join("&")}function xn(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function jn(e){let t=e.match(In);return t?t.map(xn).reduce((i,n)=>i.concat(n),[]):[]}function Mt(e,t){return Object.keys(e).filter(i=>!t.includes(i)).reduce((i,n)=>(i[n]=e[n],i),{})}function Bt(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function xe(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function Ue(e,t,i){return t=e==="+"||e==="#"?Bt(t):xe(t),i?xe(i)+"="+t:t}function Ie(e){return e!=null}function gt(e){return e===";"||e==="&"||e==="?"}function qn(e,t,i,n){var r=e[i],o=[];if(Ie(r)&&r!=="")if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")r=r.toString(),n&&n!=="*"&&(r=r.substring(0,parseInt(n,10))),o.push(Ue(t,r,gt(t)?i:""));else if(n==="*")Array.isArray(r)?r.filter(Ie).forEach(function(a){o.push(Ue(t,a,gt(t)?i:""))}):Object.keys(r).forEach(function(a){Ie(r[a])&&o.push(Ue(t,r[a],a))});else{let a=[];Array.isArray(r)?r.filter(Ie).forEach(function(c){a.push(Ue(t,c))}):Object.keys(r).forEach(function(c){Ie(r[c])&&(a.push(xe(c)),a.push(Ue(t,r[c].toString())))}),gt(t)?o.push(xe(i)+"="+a.join(",")):a.length!==0&&o.push(a.join(","))}else t===";"?Ie(r)&&o.push(xe(i)):r===""&&(t==="&"||t==="?")?o.push(xe(i)+"="):r===""&&o.push("");return o}function Rn(e){return{expand:$n.bind(null,e)}}function $n(e,t){var i=["+","#",".","/",";","?","&"];return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(n,r,o){if(r){let c="",u=[];if(i.indexOf(r.charAt(0))!==-1&&(c=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(d){var p=/([^:\*]*)(?::(\d+)|(\*))?/.exec(d);u.push(qn(t,c,p[1],p[2]||p[3]))}),c&&c!=="+"){var a=",";return c==="?"?a="&":c!=="#"&&(a=c),(u.length!==0?c:"")+u.join(a)}else return u.join(",")}else return Bt(o)})}function Ht(e){var p;let t=e.method.toUpperCase(),i=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},e.headers),r,o=Mt(e,["method","baseUrl","url","headers","request","mediaType"]),a=jn(i);i=Rn(i).expand(o),/^http/.test(i)||(i=e.baseUrl+i);let c=Object.keys(e).filter(l=>a.includes(l)).concat("baseUrl"),u=Mt(o,c);if(!/application\/octet-stream/i.test(n.accept)&&(e.mediaType.format&&(n.accept=n.accept.split(/,/).map(l=>l.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),i.endsWith("/graphql")&&(p=e.mediaType.previews)!=null&&p.length)){let l=n.accept.match(/[\w-]+(?=-preview)/g)||[];n.accept=l.concat(e.mediaType.previews).map(S=>{let j=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${S}-preview${j}`}).join(",")}return["GET","HEAD"].includes(t)?i=En(i,u):"data"in u?r=u.data:Object.keys(u).length&&(r=u),!n["content-type"]&&typeof r!="undefined"&&(n["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof r=="undefined"&&(r=""),Object.assign({method:t,url:i,headers:n},typeof r!="undefined"?{body:r}:null,e.request?{request:e.request}:null)}function Dn(e,t,i){return Ht(mt(e,t,i))}function Kt(e,t){let i=mt(e,t),n=Dn.bind(null,i);return Object.assign(n,{DEFAULTS:i,defaults:Kt.bind(null,i),merge:mt.bind(null,i),parse:Ht})}var Gt,Tn,vn,kn,In,Jt,Yt=R(()=>{Gt=U(Ae());dt();Tn="9.0.0",vn=`octokit-endpoint.js/${Tn} ${(0,Gt.getUserAgent)()}`,kn={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":vn},mediaType:{format:""}};In=/\{[^}]+\}/g;Jt=Kt(null,kn)});var bt=be(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});var yt=class extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="Deprecation"}};wt.Deprecation=yt});var Zt=be((Nr,Xt)=>{Xt.exports=Qt;function Qt(e,t){if(e&&t)return Qt(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){i[n]=e[n]}),i;function i(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=e.apply(this,n),a=n[n.length-1];return typeof o=="function"&&o!==a&&Object.keys(a).forEach(function(c){o[c]=a[c]}),o}}});var ii=be((Wr,_t)=>{var ei=Zt();_t.exports=ei(Ze);_t.exports.strict=ei(ti);Ze.proto=Ze(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Ze(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return ti(this)},configurable:!0})});function Ze(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function ti(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},i=e.name||"Function wrapped with `once`";return t.onceError=i+" shouldn't be called more than once",t.called=!1,t}});var ni={};Ee(ni,{RequestError:()=>oe});var At,St,Fn,Cn,oe,et=R(()=>{At=U(bt()),St=U(ii()),Fn=(0,St.default)(e=>console.warn(e)),Cn=(0,St.default)(e=>console.warn(e)),oe=class extends Error{constructor(e,t,i){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=t;let n;"headers"in i&&typeof i.headers!="undefined"&&(n=i.headers),"response"in i&&(this.response=i.response,n=i.response.headers);let r=Object.assign({},i.request);i.request.headers.authorization&&(r.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),r.url=r.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=r,Object.defineProperty(this,"code",{get(){return Fn(new At.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")),t}}),Object.defineProperty(this,"headers",{get(){return Cn(new At.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")),n||{}}})}}});var oi={};Ee(oi,{request:()=>I});function Un(e){return e.arrayBuffer()}function ri(e){var c,u,d;let t=e.request&&e.request.log?e.request.log:console,i=((c=e.request)==null?void 0:c.parseSuccessResponseBody)!==!1;(Xe(e.body)||Array.isArray(e.body))&&(e.body=JSON.stringify(e.body));let n={},r,o,{fetch:a}=globalThis;if((u=e.request)!=null&&u.fetch&&(a=e.request.fetch),!a)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");return a(e.url,g({method:e.method,body:e.body,headers:e.headers,signal:(d=e.request)==null?void 0:d.signal},e.body&&{duplex:"half"})).then(p=>m(this,null,function*(){o=p.url,r=p.status;for(let l of p.headers)n[l[0]]=l[1];if("deprecation"in n){let l=n.link&&n.link.match(/<([^>]+)>; rel="deprecation"/),S=l&&l.pop();t.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${n.sunset}${S?`. See ${S}`:""}`)}if(!(r===204||r===205)){if(e.method==="HEAD"){if(r<400)return;throw new oe(p.statusText,r,{response:{url:o,status:r,headers:n,data:void 0},request:e})}if(r===304)throw new oe("Not modified",r,{response:{url:o,status:r,headers:n,data:yield Tt(p)},request:e});if(r>=400){let l=yield Tt(p);throw new oe(Pn(l),r,{response:{url:o,status:r,headers:n,data:l},request:e})}return i?yield Tt(p):p.body}})).then(p=>({status:r,url:o,headers:n,data:p})).catch(p=>{throw p instanceof oe||p.name==="AbortError"?p:new oe(p.message,500,{request:e})})}function Tt(e){return m(this,null,function*(){let t=e.headers.get("content-type");return/application\/json/.test(t)?e.json():!t||/^text\/|charset=utf-8$/.test(t)?e.text():Un(e)})}function Pn(e){return typeof e=="string"?e:"message"in e?Array.isArray(e.errors)?`${e.message}: ${e.errors.map(JSON.stringify).join(", ")}`:e.message:`Unknown error: ${JSON.stringify(e)}`}function vt(e,t){let i=e.defaults(t);return Object.assign(function(r,o){let a=i.merge(r,o);if(!a.request||!a.request.hook)return ri(i.parse(a));let c=(u,d)=>ri(i.parse(i.merge(u,d)));return Object.assign(c,{endpoint:i,defaults:vt.bind(null,i)}),a.request.hook(c,a)},{endpoint:i,defaults:vt.bind(null,i)})}var si,zn,I,V=R(()=>{Yt();si=U(Ae());dt();et();zn="8.1.1";I=vt(Jt,{headers:{"user-agent":`octokit-request.js/${zn} ${(0,si.getUserAgent)()}`}})});var ae=be((Hr,ai)=>{ai.exports=function(t){return btoa(t)}});function Nn(e){let t=e.endpoint.DEFAULTS;return/^https:\/\/(api\.)?github\.com$/.test(t.baseUrl)?"https://github.com":t.baseUrl.replace("/api/v3","")}function pe(e,t,i){return m(this,null,function*(){let n=g({baseUrl:Nn(e),headers:{accept:"application/json"}},i),r=yield e(t,n);if("error"in r.data){let o=new oe(`${r.data.error_description} (${r.data.error}, ${r.data.error_uri})`,400,{request:e.endpoint.merge(t,n),headers:r.headers});throw o.response=r,o}return r})}var Pe=R(()=>{et()});var ci=R(()=>{});function hi(e){return m(this,null,function*(){let t=e.request||I,i=yield pe(t,"POST /login/oauth/access_token",{client_id:e.clientId,client_secret:e.clientSecret,code:e.code,redirect_uri:e.redirectUrl}),n={clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:i.data.access_token,scopes:i.data.scope.split(/\s+/).filter(Boolean)};if(e.clientType==="github-app"){if("refresh_token"in i.data){let r=new Date(i.headers.date).getTime();n.refreshToken=i.data.refresh_token,n.expiresAt=ui(r,i.data.expires_in),n.refreshTokenExpiresAt=ui(r,i.data.refresh_token_expires_in)}delete n.scopes}return A(g({},i),{authentication:n})})}function ui(e,t){return new Date(e+t*1e3).toISOString()}var li=R(()=>{V();Pe()});function fi(e){return m(this,null,function*(){let t=e.request||I,i={client_id:e.clientId};return"scopes"in e&&Array.isArray(e.scopes)&&(i.scope=e.scopes.join(" ")),pe(t,"POST /login/device/code",i)})}var pi=R(()=>{V();Pe()});function kt(e){return m(this,null,function*(){let t=e.request||I,i=yield pe(t,"POST /login/oauth/access_token",{client_id:e.clientId,device_code:e.code,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),n={clientType:e.clientType,clientId:e.clientId,token:i.data.access_token,scopes:i.data.scope.split(/\s+/).filter(Boolean)};if("clientSecret"in e&&(n.clientSecret=e.clientSecret),e.clientType==="github-app"){if("refresh_token"in i.data){let r=new Date(i.headers.date).getTime();n.refreshToken=i.data.refresh_token,n.expiresAt=di(r,i.data.expires_in),n.refreshTokenExpiresAt=di(r,i.data.refresh_token_expires_in)}delete n.scopes}return A(g({},i),{authentication:n})})}function di(e,t){return new Date(e+t*1e3).toISOString()}var gi=R(()=>{V();Pe()});function yi(e){return m(this,null,function*(){let i=yield(e.request||I)("POST /applications/{client_id}/token",{headers:{authorization:`basic ${(0,mi.default)(`${e.clientId}:${e.clientSecret}`)}`},client_id:e.clientId,access_token:e.token}),n={clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:e.token,scopes:i.data.scopes};return i.data.expires_at&&(n.expiresAt=i.data.expires_at),e.clientType==="github-app"&&delete n.scopes,A(g({},i),{authentication:n})})}var mi,wi=R(()=>{V();mi=U(ae())});function _i(e){return m(this,null,function*(){let t=e.request||I,i=yield pe(t,"POST /login/oauth/access_token",{client_id:e.clientId,client_secret:e.clientSecret,grant_type:"refresh_token",refresh_token:e.refreshToken}),n=new Date(i.headers.date).getTime(),r={clientType:"github-app",clientId:e.clientId,clientSecret:e.clientSecret,token:i.data.access_token,refreshToken:i.data.refresh_token,expiresAt:bi(n,i.data.expires_in),refreshTokenExpiresAt:bi(n,i.data.refresh_token_expires_in)};return A(g({},i),{authentication:r})})}function bi(e,t){return new Date(e+t*1e3).toISOString()}var Ai=R(()=>{V();Pe()});var Wn,Si=R(()=>{Wn=U(ae())});function vi(e){return m(this,null,function*(){let t=e.request||I,i=(0,Ti.default)(`${e.clientId}:${e.clientSecret}`),n=yield t("PATCH /applications/{client_id}/token",{headers:{authorization:`basic ${i}`},client_id:e.clientId,access_token:e.token}),r={clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:n.data.token,scopes:n.data.scopes};return n.data.expires_at&&(r.expiresAt=n.data.expires_at),e.clientType==="github-app"&&delete r.scopes,A(g({},n),{authentication:r})})}var Ti,ki=R(()=>{V();Ti=U(ae())});function Ei(e){return m(this,null,function*(){let t=e.request||I,i=(0,Oi.default)(`${e.clientId}:${e.clientSecret}`);return t("DELETE /applications/{client_id}/token",{headers:{authorization:`basic ${i}`},client_id:e.clientId,access_token:e.token})})}var Oi,Ii=R(()=>{V();Oi=U(ae())});function ji(e){return m(this,null,function*(){let t=e.request||I,i=(0,xi.default)(`${e.clientId}:${e.clientSecret}`);return t("DELETE /applications/{client_id}/grant",{headers:{authorization:`basic ${i}`},client_id:e.clientId,access_token:e.token})})}var xi,qi=R(()=>{V();xi=U(ae())});var tt=R(()=>{ci();li();pi();gi();wi();Ai();Si();ki();Ii();qi()});function Di(e,t){return m(this,null,function*(){let i=Ln(e,t.auth);if(i)return i;let{data:n}=yield fi({clientType:e.clientType,clientId:e.clientId,request:t.request||e.request,scopes:t.auth.scopes||e.scopes});yield e.onVerification(n);let r=yield Ot(t.request||e.request,e.clientId,e.clientType,n);return e.authentication=r,r})}function Ln(e,t){if(t.refresh===!0||!e.authentication)return!1;if(e.clientType==="github-app")return e.authentication;let i=e.authentication,n=("scopes"in t&&t.scopes||e.scopes).join(" "),r=i.scopes.join(" ");return n===r?i:!1}function Ri(e){return m(this,null,function*(){yield new Promise(t=>setTimeout(t,e*1e3))})}function Ot(e,t,i,n){return m(this,null,function*(){try{let r={clientId:t,request:e,code:n.device_code},{authentication:o}=i==="oauth-app"?yield kt(A(g({},r),{clientType:"oauth-app"})):yield kt(A(g({},r),{clientType:"github-app"}));return g({type:"token",tokenType:"oauth"},o)}catch(r){if(!r.response)throw r;let o=r.response.data.error;if(o==="authorization_pending")return yield Ri(n.interval),Ot(e,t,i,n);if(o==="slow_down")return yield Ri(n.interval+5),Ot(e,t,i,n);throw r}})}function Mn(e,t){return m(this,null,function*(){return Di(e,{auth:t})})}function Gn(e,t,i,n){return m(this,null,function*(){let r=t.endpoint.merge(i,n);if(/\/login\/(oauth\/access_token|device\/code)$/.test(r.url))return t(r);let{token:o}=yield Di(e,{request:t,auth:{type:"oauth"}});return r.headers.authorization=`token ${o}`,t(r)})}function Fi(e){let t=e.request||I.defaults({headers:{"user-agent":`octokit-auth-oauth-device.js/${Vn} ${(0,$i.getUserAgent)()}`}}),o=e,{request:i=t}=o,n=J(o,["request"]),r=e.clientType==="github-app"?A(g({},n),{clientType:"github-app",request:i}):A(g({},n),{clientType:"oauth-app",request:i,scopes:e.scopes||[]});if(!e.clientId)throw new Error('[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');if(!e.onVerification)throw new Error('[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');return Object.assign(Mn.bind(null,r),{hook:Gn.bind(null,r)})}var $i,Vn,Ci=R(()=>{$i=U(Ae());V();tt();Vn="6.0.0"});var It={};Ee(It,{createOAuthUserAuth:()=>Se,requiresBasicAuth:()=>it});function zi(e){return m(this,null,function*(){if("code"in e.strategyOptions){let{authentication:t}=yield hi(A(g({clientId:e.clientId,clientSecret:e.clientSecret,clientType:e.clientType,onTokenCreated:e.onTokenCreated},e.strategyOptions),{request:e.request}));return g({type:"token",tokenType:"oauth"},t)}if("onVerification"in e.strategyOptions){let i=yield Fi(A(g({clientType:e.clientType,clientId:e.clientId,onTokenCreated:e.onTokenCreated},e.strategyOptions),{request:e.request}))({type:"oauth"});return g({clientSecret:e.clientSecret},i)}if("token"in e.strategyOptions)return g({type:"token",tokenType:"oauth",clientId:e.clientId,clientSecret:e.clientSecret,clientType:e.clientType,onTokenCreated:e.onTokenCreated},e.strategyOptions);throw new Error("[@octokit/auth-oauth-user] Invalid strategy options")})}function Et(i){return m(this,arguments,function*(e,t={}){var r,o;if(e.authentication||(e.authentication=e.clientType==="oauth-app"?yield zi(e):yield zi(e)),e.authentication.invalid)throw new Error("[@octokit/auth-oauth-user] Token is invalid");let n=e.authentication;if("expiresAt"in n&&(t.type==="refresh"||new Date(n.expiresAt)<new Date)){let{authentication:a}=yield _i({clientType:"github-app",clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:n.refreshToken,request:e.request});e.authentication=g({tokenType:"oauth",type:"token"},a)}if(t.type==="refresh"){if(e.clientType==="oauth-app")throw new Error("[@octokit/auth-oauth-user] OAuth Apps do not support expiring tokens");if(!n.hasOwnProperty("expiresAt"))throw new Error("[@octokit/auth-oauth-user] Refresh token missing");yield(r=e.onTokenCreated)==null?void 0:r.call(e,e.authentication,{type:t.type})}if(t.type==="check"||t.type==="reset"){let a=t.type==="check"?yi:vi;try{let{authentication:c}=yield a({clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:e.authentication.token,request:e.request});return e.authentication=g({tokenType:"oauth",type:"token"},c),t.type==="reset"&&(yield(o=e.onTokenCreated)==null?void 0:o.call(e,e.authentication,{type:t.type})),e.authentication}catch(c){throw c.status===404&&(c.message="[@octokit/auth-oauth-user] Token is invalid",e.authentication.invalid=!0),c}}if(t.type==="delete"||t.type==="deleteAuthorization"){let a=t.type==="delete"?Ei:ji;try{yield a({clientType:e.clientType,clientId:e.clientId,clientSecret:e.clientSecret,token:e.authentication.token,request:e.request})}catch(c){if(c.status!==404)throw c}return e.authentication.invalid=!0,e.authentication}return e.authentication})}function it(e){return e&&Bn.test(e)}function Hn(r,o,a){return m(this,arguments,function*(e,t,i,n={}){let c=t.endpoint.merge(i,n);if(/\/login\/(oauth\/access_token|device\/code)$/.test(c.url))return t(c);if(it(c.url)){let d=(0,Ni.default)(`${e.clientId}:${e.clientSecret}`);return c.headers.authorization=`basic ${d}`,t(c)}let{token:u}=e.clientType==="oauth-app"?yield Et(A(g({},e),{request:t})):yield Et(A(g({},e),{request:t}));return c.headers.authorization="token "+u,t(c)})}function Se(a){var c=a,{clientId:e,clientSecret:t,clientType:i="oauth-app",request:n=I.defaults({headers:{"user-agent":`octokit-auth-oauth-app.js/${Pi} ${(0,Ui.getUserAgent)()}`}}),onTokenCreated:r}=c,o=J(c,["clientId","clientSecret","clientType","request","onTokenCreated"]);let u=Object.assign({clientType:i,clientId:e,clientSecret:t,onTokenCreated:r,strategyOptions:o,request:n});return Object.assign(Et.bind(null,u),{hook:Hn.bind(null,u)})}var Ui,Ni,Pi,Bn,je=R(()=>{Ui=U(Ae());V();Ci();tt();tt();Ni=U(ae()),Pi="4.0.0";Bn=/\/applications\/[^/]+\/(token|grant)s?/;Se.VERSION=Pi});var xt={};Ee(xt,{createOAuthAppAuth:()=>Qn,createOAuthUserAuth:()=>Se});function Kn(e,t){return m(this,null,function*(){if(t.type==="oauth-app")return{type:"oauth-app",clientId:e.clientId,clientSecret:e.clientSecret,clientType:e.clientType,headers:{authorization:`basic ${(0,Li.default)(`${e.clientId}:${e.clientSecret}`)}`}};if("factory"in t){let r=g(g({},t),e),{type:o}=r,a=J(r,["type"]);return t.factory(a)}let i=g({clientId:e.clientId,clientSecret:e.clientSecret,request:e.request},t);return(e.clientType==="oauth-app"?yield Se(A(g({},i),{clientType:e.clientType})):yield Se(A(g({},i),{clientType:e.clientType})))()})}function Jn(e,t,i,n){return m(this,null,function*(){let r=t.endpoint.merge(i,n);if(/\/login\/(oauth\/access_token|device\/code)$/.test(r.url))return t(r);if(e.clientType==="github-app"&&!it(r.url))throw new Error(`[@octokit/auth-oauth-app] GitHub Apps cannot use their client ID/secret for basic authentication for endpoints other than "/applications/{client_id}/**". "${r.method} ${r.url}" is not supported.`);let o=(0,Mi.default)(`${e.clientId}:${e.clientSecret}`);r.headers.authorization=`basic ${o}`;try{return yield t(r)}catch(a){throw a.status!==401||(a.message=`[@octokit/auth-oauth-app] "${r.method} ${r.url}" does not support clientId/clientSecret basic authentication.`),a}})}function Qn(e){let t=Object.assign({request:I.defaults({headers:{"user-agent":`octokit-auth-oauth-app.js/${Yn} ${(0,Wi.getUserAgent)()}`}}),clientType:"oauth-app"},e);return Object.assign(Kn.bind(null,t),{hook:Jn.bind(null,t)})}var Wi,Li,Mi,Yn,jt=R(()=>{Wi=U(Ae());V();Li=U(ae());je();Mi=U(ae());je();je();Yn="7.0.0"});var Yi={};Ee(Yi,{githubAppJwt:()=>Zn});function Gi(e,t,i,n,r,o,a){try{var c=e[o](a),u=c.value}catch(d){return void i(d)}c.done?t(u):Promise.resolve(u).then(n,r)}function Hi(e){return function(){var t=this,i=arguments;return new Promise(function(n,r){var o=e.apply(t,i);function a(u){Gi(o,n,r,a,c,"next",u)}function c(u){Gi(o,n,r,a,c,"throw",u)}a(void 0)})}}function Vi(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0,r=e.length;n<r;n++)i[n]=e.charCodeAt(n);return t}function Ki(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Bi(e){return Ki(btoa(JSON.stringify(e)))}function Zn(e){return Ji.apply(this,arguments)}function Ji(){return(Ji=Hi(function*(e){var{id:t,privateKey:i,now:n=Math.floor(Date.now()/1e3)}=e,r=n-30,o=r+600,a={iat:r,exp:o,iss:t};return{appId:t,expiration:o,token:yield Xn({privateKey:i,payload:a})}})).apply(this,arguments)}var Xn,Qi=R(()=>{Xn=function(){var e=Hi(function*(t){var{privateKey:i,payload:n}=t;if(/BEGIN RSA PRIVATE KEY/.test(i))throw new Error("[universal-github-app-jwt] Private Key is in PKCS#1 format, but only PKCS#8 is supported. See https://github.com/gr2m/universal-github-app-jwt#readme");var r,o={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},a=(r=i.trim().split(`
`).slice(1,-1).join(""),Vi(atob(r))),c=yield crypto.subtle.importKey("pkcs8",a,o,!1,["sign"]),u=function(l,S){return"".concat(Bi(l),".").concat(Bi(S))}({alg:"RS256",typ:"JWT"},n),d=Vi(u),p=function(l){for(var S="",j=new Uint8Array(l),N=j.byteLength,T=0;T<N;T++)S+=String.fromCharCode(j[T]);return Ki(btoa(S))}(yield crypto.subtle.sign(o.name,c,d));return"".concat(u,".").concat(p)});return function(t){return e.apply(this,arguments)}}()});var sn=be(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.LRUCache=void 0;var Ne=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,en=new Set,qt=typeof __Process$=="object"&&__Process$?__Process$:{},tn=(e,t,i,n)=>{typeof qt.emitWarning=="function"?qt.emitWarning(e,t,i,n):console.error(`[${i}] ${t}: ${e}`)},st=globalThis.AbortController,Xi=globalThis.AbortSignal,Zi;if(typeof st=="undefined"){Xi=class{constructor(){E(this,"onabort");E(this,"_onabort",[]);E(this,"reason");E(this,"aborted",!1)}addEventListener(n,r){this._onabort.push(r)}},st=class{constructor(){E(this,"signal",new Xi);t()}abort(n){var r,o;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let a of this.signal._onabort)a(n);(o=(r=this.signal).onabort)==null||o.call(r,n)}}};let e=((Zi=qt.env)==null?void 0:Zi.LRU_CACHE_IGNORE_AC_WARNING)!=="1",t=()=>{e&&(e=!1,tn("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var er=e=>!en.has(e),io=Symbol("type"),de=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),nn=e=>de(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?qe:null:null,qe=class extends Array{constructor(t){super(t),this.fill(0)}},Re,Te=class Te{constructor(t,i){E(this,"heap");E(this,"length");if(!s(Te,Re))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0}static create(t){let i=nn(t);if(!i)return[];f(Te,Re,!0);let n=new Te(t,i);return f(Te,Re,!1),n}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}};Re=new WeakMap,w(Te,Re,!1);var Rt=Te,Y,B,Q,X,$e,$,Z,D,k,y,L,H,P,F,ee,C,ce,ue,te,ie,ye,M,Le,Dt,ve,he,Me,K,ot,rn,ke,De,Ge,ne,ge,re,me,Ve,Ft,Fe,nt,Ce,rt,v,O,Be,Ct,Oe,We,zt=class zt{constructor(t){w(this,Le);w(this,ot);w(this,ne);w(this,re);w(this,Ve);w(this,Fe);w(this,Ce);w(this,v);w(this,Be);w(this,Oe);w(this,Y,void 0);w(this,B,void 0);w(this,Q,void 0);w(this,X,void 0);w(this,$e,void 0);E(this,"ttl");E(this,"ttlResolution");E(this,"ttlAutopurge");E(this,"updateAgeOnGet");E(this,"updateAgeOnHas");E(this,"allowStale");E(this,"noDisposeOnSet");E(this,"noUpdateTTL");E(this,"maxEntrySize");E(this,"sizeCalculation");E(this,"noDeleteOnFetchRejection");E(this,"noDeleteOnStaleGet");E(this,"allowStaleOnFetchAbort");E(this,"allowStaleOnFetchRejection");E(this,"ignoreFetchAbort");w(this,$,void 0);w(this,Z,void 0);w(this,D,void 0);w(this,k,void 0);w(this,y,void 0);w(this,L,void 0);w(this,H,void 0);w(this,P,void 0);w(this,F,void 0);w(this,ee,void 0);w(this,C,void 0);w(this,ce,void 0);w(this,ue,void 0);w(this,te,void 0);w(this,ie,void 0);w(this,ye,void 0);w(this,M,void 0);w(this,ve,()=>{});w(this,he,()=>{});w(this,Me,()=>{});w(this,K,()=>!1);w(this,ke,t=>{});w(this,De,(t,i,n)=>{});w(this,Ge,(t,i,n,r)=>{if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});let{max:i=0,ttl:n,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:u,dispose:d,disposeAfter:p,noDisposeOnSet:l,noUpdateTTL:S,maxSize:j=0,maxEntrySize:N=0,sizeCalculation:T,fetchMethod:q,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:W,ignoreFetchAbort:G}=t;if(i!==0&&!de(i))throw new TypeError("max option must be a nonnegative integer");let z=i?nn(i):Array;if(!z)throw new Error("invalid max value: "+i);if(f(this,Y,i),f(this,B,j),this.maxEntrySize=N||s(this,B),this.sizeCalculation=T,this.sizeCalculation){if(!s(this,B)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(q!==void 0&&typeof q!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,$e,q),f(this,ye,!!q),f(this,D,new Map),f(this,k,new Array(i).fill(void 0)),f(this,y,new Array(i).fill(void 0)),f(this,L,new z(i)),f(this,H,new z(i)),f(this,P,0),f(this,F,0),f(this,ee,Rt.create(i)),f(this,$,0),f(this,Z,0),typeof d=="function"&&f(this,Q,d),typeof p=="function"?(f(this,X,p),f(this,C,[])):(f(this,X,void 0),f(this,C,void 0)),f(this,ie,!!s(this,Q)),f(this,M,!!s(this,X)),this.noDisposeOnSet=!!l,this.noUpdateTTL=!!S,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!W,this.ignoreFetchAbort=!!G,this.maxEntrySize!==0){if(s(this,B)!==0&&!de(s(this,B)))throw new TypeError("maxSize must be a positive integer if specified");if(!de(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,ot,rn).call(this)}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=de(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!de(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,Le,Dt).call(this)}if(s(this,Y)===0&&this.ttl===0&&s(this,B)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!s(this,Y)&&!s(this,B)){let se="LRU_CACHE_UNBOUNDED";er(se)&&(en.add(se),tn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",se,zt))}}static unsafeExposeInternals(t){return{starts:s(t,ue),ttls:s(t,te),sizes:s(t,ce),keyMap:s(t,D),keyList:s(t,k),valList:s(t,y),next:s(t,L),prev:s(t,H),get head(){return s(t,P)},get tail(){return s(t,F)},free:s(t,ee),isBackgroundFetch:i=>{var n;return h(n=t,v,O).call(n,i)},backgroundFetch:(i,n,r,o)=>{var a;return h(a=t,Ce,rt).call(a,i,n,r,o)},moveToTail:i=>{var n;return h(n=t,Oe,We).call(n,i)},indexes:i=>{var n;return h(n=t,ne,ge).call(n,i)},rindexes:i=>{var n;return h(n=t,re,me).call(n,i)},isStale:i=>{var n;return s(n=t,K).call(n,i)}}}get max(){return s(this,Y)}get maxSize(){return s(this,B)}get calculatedSize(){return s(this,Z)}get size(){return s(this,$)}get fetchMethod(){return s(this,$e)}get dispose(){return s(this,Q)}get disposeAfter(){return s(this,X)}getRemainingTTL(t){return s(this,D).has(t)?1/0:0}*entries(){for(let t of h(this,ne,ge).call(this))s(this,y)[t]!==void 0&&s(this,k)[t]!==void 0&&!h(this,v,O).call(this,s(this,y)[t])&&(yield[s(this,k)[t],s(this,y)[t]])}*rentries(){for(let t of h(this,re,me).call(this))s(this,y)[t]!==void 0&&s(this,k)[t]!==void 0&&!h(this,v,O).call(this,s(this,y)[t])&&(yield[s(this,k)[t],s(this,y)[t]])}*keys(){for(let t of h(this,ne,ge).call(this)){let i=s(this,k)[t];i!==void 0&&!h(this,v,O).call(this,s(this,y)[t])&&(yield i)}}*rkeys(){for(let t of h(this,re,me).call(this)){let i=s(this,k)[t];i!==void 0&&!h(this,v,O).call(this,s(this,y)[t])&&(yield i)}}*values(){for(let t of h(this,ne,ge).call(this))s(this,y)[t]!==void 0&&!h(this,v,O).call(this,s(this,y)[t])&&(yield s(this,y)[t])}*rvalues(){for(let t of h(this,re,me).call(this))s(this,y)[t]!==void 0&&!h(this,v,O).call(this,s(this,y)[t])&&(yield s(this,y)[t])}[Symbol.iterator](){return this.entries()}find(t,i={}){for(let n of h(this,ne,ge).call(this)){let r=s(this,y)[n],o=h(this,v,O).call(this,r)?r.__staleWhileFetching:r;if(o!==void 0&&t(o,s(this,k)[n],this))return this.get(s(this,k)[n],i)}}forEach(t,i=this){for(let n of h(this,ne,ge).call(this)){let r=s(this,y)[n],o=h(this,v,O).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(i,o,s(this,k)[n],this)}}rforEach(t,i=this){for(let n of h(this,re,me).call(this)){let r=s(this,y)[n],o=h(this,v,O).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(i,o,s(this,k)[n],this)}}purgeStale(){let t=!1;for(let i of h(this,re,me).call(this,{allowStale:!0}))s(this,K).call(this,i)&&(this.delete(s(this,k)[i]),t=!0);return t}dump(){let t=[];for(let i of h(this,ne,ge).call(this,{allowStale:!0})){let n=s(this,k)[i],r=s(this,y)[i],o=h(this,v,O).call(this,r)?r.__staleWhileFetching:r;if(o===void 0||n===void 0)continue;let a={value:o};if(s(this,te)&&s(this,ue)){a.ttl=s(this,te)[i];let c=Ne.now()-s(this,ue)[i];a.start=Math.floor(Date.now()-c)}s(this,ce)&&(a.size=s(this,ce)[i]),t.unshift([n,a])}return t}load(t){this.clear();for(let[i,n]of t){if(n.start){let r=Date.now()-n.start;n.start=Ne.now()-r}this.set(i,n.value,n)}}set(t,i,n={}){var S,j,N,T,q;if(i===void 0)return this.delete(t),this;let{ttl:r=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,p=s(this,Ge).call(this,t,i,n.size||0,c);if(this.maxEntrySize&&p>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.delete(t),this;let l=s(this,$)===0?void 0:s(this,D).get(t);if(l===void 0)l=s(this,$)===0?s(this,F):s(this,ee).length!==0?s(this,ee).pop():s(this,$)===s(this,Y)?h(this,Fe,nt).call(this,!1):s(this,$),s(this,k)[l]=t,s(this,y)[l]=i,s(this,D).set(t,l),s(this,L)[s(this,F)]=l,s(this,H)[l]=s(this,F),f(this,F,l),Qe(this,$)._++,s(this,De).call(this,l,p,u),u&&(u.set="add"),d=!1;else{h(this,Oe,We).call(this,l);let _=s(this,y)[l];if(i!==_){if(s(this,ye)&&h(this,v,O).call(this,_)){_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:b}=_;b!==void 0&&!a&&(s(this,ie)&&((S=s(this,Q))==null||S.call(this,b,t,"set")),s(this,M)&&((j=s(this,C))==null||j.push([b,t,"set"])))}else a||(s(this,ie)&&((N=s(this,Q))==null||N.call(this,_,t,"set")),s(this,M)&&((T=s(this,C))==null||T.push([_,t,"set"])));if(s(this,ke).call(this,l),s(this,De).call(this,l,p,u),s(this,y)[l]=i,u){u.set="replace";let b=_&&h(this,v,O).call(this,_)?_.__staleWhileFetching:_;b!==void 0&&(u.oldValue=b)}}else u&&(u.set="update")}if(r!==0&&!s(this,te)&&h(this,Le,Dt).call(this),s(this,te)&&(d||s(this,Me).call(this,l,r,o),u&&s(this,he).call(this,u,l)),!a&&s(this,M)&&s(this,C)){let _=s(this,C),b;for(;b=_==null?void 0:_.shift();)(q=s(this,X))==null||q.call(this,...b)}return this}pop(){var t;try{for(;s(this,$);){let i=s(this,y)[s(this,P)];if(h(this,Fe,nt).call(this,!0),h(this,v,O).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(s(this,M)&&s(this,C)){let i=s(this,C),n;for(;n=i==null?void 0:i.shift();)(t=s(this,X))==null||t.call(this,...n)}}}has(t,i={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=i,o=s(this,D).get(t);if(o!==void 0){let a=s(this,y)[o];if(h(this,v,O).call(this,a)&&a.__staleWhileFetching===void 0)return!1;if(s(this,K).call(this,o))r&&(r.has="stale",s(this,he).call(this,r,o));else return n&&s(this,ve).call(this,o),r&&(r.has="hit",s(this,he).call(this,r,o)),!0}else r&&(r.has="miss");return!1}peek(t,i={}){let{allowStale:n=this.allowStale}=i,r=s(this,D).get(t);if(r!==void 0&&(n||!s(this,K).call(this,r))){let o=s(this,y)[r];return h(this,v,O).call(this,o)?o.__staleWhileFetching:o}}fetch(n){return m(this,arguments,function*(t,i={}){let{allowStale:r=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:d=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:j=this.allowStaleOnFetchRejection,ignoreFetchAbort:N=this.ignoreFetchAbort,allowStaleOnFetchAbort:T=this.allowStaleOnFetchAbort,context:q,forceRefresh:_=!1,status:b,signal:x}=i;if(!s(this,ye))return b&&(b.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:o,noDeleteOnStaleGet:a,status:b});let W={allowStale:r,updateAgeOnGet:o,noDeleteOnStaleGet:a,ttl:c,noDisposeOnSet:u,size:d,sizeCalculation:p,noUpdateTTL:l,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:j,allowStaleOnFetchAbort:T,ignoreFetchAbort:N,status:b,signal:x},G=s(this,D).get(t);if(G===void 0){b&&(b.fetch="miss");let z=h(this,Ce,rt).call(this,t,G,W,q);return z.__returned=z}else{let z=s(this,y)[G];if(h(this,v,O).call(this,z)){let Ke=r&&z.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",Ke&&(b.returnedStale=!0)),Ke?z.__staleWhileFetching:z.__returned=z}let se=s(this,K).call(this,G);if(!_&&!se)return b&&(b.fetch="hit"),h(this,Oe,We).call(this,G),o&&s(this,ve).call(this,G),b&&s(this,he).call(this,b,G),z;let we=h(this,Ce,rt).call(this,t,G,W,q),He=we.__staleWhileFetching!==void 0&&r;return b&&(b.fetch=se?"stale":"refresh",He&&se&&(b.returnedStale=!0)),He?we.__staleWhileFetching:we.__returned=we}})}get(t,i={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=i,c=s(this,D).get(t);if(c!==void 0){let u=s(this,y)[c],d=h(this,v,O).call(this,u);return a&&s(this,he).call(this,a,c),s(this,K).call(this,c)?(a&&(a.get="stale"),d?(a&&n&&u.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?u.__staleWhileFetching:void 0):(o||this.delete(t),a&&n&&(a.returnedStale=!0),n?u:void 0)):(a&&(a.get="hit"),d?u.__staleWhileFetching:(h(this,Oe,We).call(this,c),r&&s(this,ve).call(this,c),u))}else a&&(a.get="miss")}delete(t){var n,r,o,a;let i=!1;if(s(this,$)!==0){let c=s(this,D).get(t);if(c!==void 0)if(i=!0,s(this,$)===1)this.clear();else{s(this,ke).call(this,c);let u=s(this,y)[c];h(this,v,O).call(this,u)?u.__abortController.abort(new Error("deleted")):(s(this,ie)||s(this,M))&&(s(this,ie)&&((n=s(this,Q))==null||n.call(this,u,t,"delete")),s(this,M)&&((r=s(this,C))==null||r.push([u,t,"delete"]))),s(this,D).delete(t),s(this,k)[c]=void 0,s(this,y)[c]=void 0,c===s(this,F)?f(this,F,s(this,H)[c]):c===s(this,P)?f(this,P,s(this,L)[c]):(s(this,L)[s(this,H)[c]]=s(this,L)[c],s(this,H)[s(this,L)[c]]=s(this,H)[c]),Qe(this,$)._--,s(this,ee).push(c)}}if(s(this,M)&&((o=s(this,C))!=null&&o.length)){let c=s(this,C),u;for(;u=c==null?void 0:c.shift();)(a=s(this,X))==null||a.call(this,...u)}return i}clear(){var t,i,n;for(let r of h(this,re,me).call(this,{allowStale:!0})){let o=s(this,y)[r];if(h(this,v,O).call(this,o))o.__abortController.abort(new Error("deleted"));else{let a=s(this,k)[r];s(this,ie)&&((t=s(this,Q))==null||t.call(this,o,a,"delete")),s(this,M)&&((i=s(this,C))==null||i.push([o,a,"delete"]))}}if(s(this,D).clear(),s(this,y).fill(void 0),s(this,k).fill(void 0),s(this,te)&&s(this,ue)&&(s(this,te).fill(0),s(this,ue).fill(0)),s(this,ce)&&s(this,ce).fill(0),f(this,P,0),f(this,F,0),s(this,ee).length=0,f(this,Z,0),f(this,$,0),s(this,M)&&s(this,C)){let r=s(this,C),o;for(;o=r==null?void 0:r.shift();)(n=s(this,X))==null||n.call(this,...o)}}};Y=new WeakMap,B=new WeakMap,Q=new WeakMap,X=new WeakMap,$e=new WeakMap,$=new WeakMap,Z=new WeakMap,D=new WeakMap,k=new WeakMap,y=new WeakMap,L=new WeakMap,H=new WeakMap,P=new WeakMap,F=new WeakMap,ee=new WeakMap,C=new WeakMap,ce=new WeakMap,ue=new WeakMap,te=new WeakMap,ie=new WeakMap,ye=new WeakMap,M=new WeakMap,Le=new WeakSet,Dt=function(){let t=new qe(s(this,Y)),i=new qe(s(this,Y));f(this,te,t),f(this,ue,i),f(this,Me,(o,a,c=Ne.now())=>{if(i[o]=a!==0?c:0,t[o]=a,a!==0&&this.ttlAutopurge){let u=setTimeout(()=>{s(this,K).call(this,o)&&this.delete(s(this,k)[o])},a+1);u.unref&&u.unref()}}),f(this,ve,o=>{i[o]=t[o]!==0?Ne.now():0}),f(this,he,(o,a)=>{if(t[a]){let c=t[a],u=i[a];o.ttl=c,o.start=u,o.now=n||r();let d=o.now-u;o.remainingTTL=c-d}});let n=0,r=()=>{let o=Ne.now();if(this.ttlResolution>0){n=o;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{let a=s(this,D).get(o);if(a===void 0)return 0;let c=t[a],u=i[a];if(c===0||u===0)return 1/0;let d=(n||r())-u;return c-d},f(this,K,o=>t[o]!==0&&i[o]!==0&&(n||r())-i[o]>t[o])},ve=new WeakMap,he=new WeakMap,Me=new WeakMap,K=new WeakMap,ot=new WeakSet,rn=function(){let t=new qe(s(this,Y));f(this,Z,0),f(this,ce,t),f(this,ke,i=>{f(this,Z,s(this,Z)-t[i]),t[i]=0}),f(this,Ge,(i,n,r,o)=>{if(h(this,v,O).call(this,n))return 0;if(!de(r))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(r=o(n,i),!de(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),f(this,De,(i,n,r)=>{if(t[i]=n,s(this,B)){let o=s(this,B)-t[i];for(;s(this,Z)>o;)h(this,Fe,nt).call(this,!0)}f(this,Z,s(this,Z)+t[i]),r&&(r.entrySize=n,r.totalCalculatedSize=s(this,Z))})},ke=new WeakMap,De=new WeakMap,Ge=new WeakMap,ne=new WeakSet,ge=function*({allowStale:t=this.allowStale}={}){if(s(this,$))for(let i=s(this,F);!(!h(this,Ve,Ft).call(this,i)||((t||!s(this,K).call(this,i))&&(yield i),i===s(this,P)));)i=s(this,H)[i]},re=new WeakSet,me=function*({allowStale:t=this.allowStale}={}){if(s(this,$))for(let i=s(this,P);!(!h(this,Ve,Ft).call(this,i)||((t||!s(this,K).call(this,i))&&(yield i),i===s(this,F)));)i=s(this,L)[i]},Ve=new WeakSet,Ft=function(t){return t!==void 0&&s(this,D).get(s(this,k)[t])===t},Fe=new WeakSet,nt=function(t){var o,a;let i=s(this,P),n=s(this,k)[i],r=s(this,y)[i];return s(this,ye)&&h(this,v,O).call(this,r)?r.__abortController.abort(new Error("evicted")):(s(this,ie)||s(this,M))&&(s(this,ie)&&((o=s(this,Q))==null||o.call(this,r,n,"evict")),s(this,M)&&((a=s(this,C))==null||a.push([r,n,"evict"]))),s(this,ke).call(this,i),t&&(s(this,k)[i]=void 0,s(this,y)[i]=void 0,s(this,ee).push(i)),s(this,$)===1?(f(this,P,f(this,F,0)),s(this,ee).length=0):f(this,P,s(this,L)[i]),s(this,D).delete(n),Qe(this,$)._--,i},Ce=new WeakSet,rt=function(t,i,n,r){let o=i===void 0?void 0:s(this,y)[i];if(h(this,v,O).call(this,o))return o;let a=new st,{signal:c}=n;c==null||c.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let u={signal:a.signal,options:n,context:r},d=(T,q=!1)=>{let{aborted:_}=a.signal,b=n.ignoreFetchAbort&&T!==void 0;if(n.status&&(_&&!q?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,b&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!b&&!q)return l(a.signal.reason);let x=j;return s(this,y)[i]===j&&(T===void 0?x.__staleWhileFetching?s(this,y)[i]=x.__staleWhileFetching:this.delete(t):(n.status&&(n.status.fetchUpdated=!0),this.set(t,T,u.options))),T},p=T=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=T),l(T)),l=T=>{let{aborted:q}=a.signal,_=q&&n.allowStaleOnFetchAbort,b=_||n.allowStaleOnFetchRejection,x=b||n.noDeleteOnFetchRejection,W=j;if(s(this,y)[i]===j&&(!x||W.__staleWhileFetching===void 0?this.delete(t):_||(s(this,y)[i]=W.__staleWhileFetching)),b)return n.status&&W.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),W.__staleWhileFetching;if(W.__returned===W)throw T},S=(T,q)=>{var b;let _=(b=s(this,$e))==null?void 0:b.call(this,t,o,u);_&&_ instanceof Promise&&_.then(x=>T(x===void 0?void 0:x),q),a.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(T(void 0),n.allowStaleOnFetchAbort&&(T=x=>d(x,!0)))})};n.status&&(n.status.fetchDispatched=!0);let j=new Promise(S).then(d,p),N=Object.assign(j,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return i===void 0?(this.set(t,N,A(g({},u.options),{status:void 0})),i=s(this,D).get(t)):s(this,y)[i]=N,N},v=new WeakSet,O=function(t){if(!s(this,ye))return!1;let i=t;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof st},Be=new WeakSet,Ct=function(t,i){s(this,H)[i]=t,s(this,L)[t]=i},Oe=new WeakSet,We=function(t){t!==s(this,F)&&(t===s(this,P)?f(this,P,s(this,L)[t]):h(this,Be,Ct).call(this,s(this,H)[t],s(this,L)[t]),h(this,Be,Ct).call(this,s(this,F),t),f(this,F,t))};var $t=zt;at.LRUCache=$t});var Ut=be((ao,fn)=>{"use strict";var tr=Object.create,ut=Object.defineProperty,ir=Object.getOwnPropertyDescriptor,nr=Object.getOwnPropertyNames,rr=Object.getPrototypeOf,sr=Object.prototype.hasOwnProperty,or=(e,t)=>{for(var i in t)ut(e,i,{get:t[i],enumerable:!0})},an=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of nr(t))!sr.call(e,r)&&r!==i&&ut(e,r,{get:()=>t[r],enumerable:!(n=ir(t,r))||n.enumerable});return e},ar=(e,t,i)=>(i=e!=null?tr(rr(e)):{},an(t||!e||!e.__esModule?ut(i,"default",{value:e,enumerable:!0}):i,e)),cr=e=>an(ut({},"__esModule",{value:!0}),e),cn={};or(cn,{createAppAuth:()=>xr,createOAuthUserAuth:()=>Ir.createOAuthUserAuth});fn.exports=cr(cn);var ur=Ae(),hr=(V(),_e(oi)),lr=(jt(),_e(xt)),fr=bt(),so=ar((jt(),_e(xt))),pr=(Qi(),_e(Yi));function ct(n){return m(this,arguments,function*({appId:e,privateKey:t,timeDifference:i}){try{let r=yield(0,pr.githubAppJwt)({id:+e,privateKey:t,now:i&&Math.floor(Date.now()/1e3)+i});return{type:"app",token:r.token,appId:r.appId,expiresAt:new Date(r.expiration*1e3).toISOString()}}catch(r){throw t==="-----BEGIN RSA PRIVATE KEY-----"?new Error("The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\n'"):r}})}var dr=sn();function gr(){return new dr.LRUCache({max:15e3,ttl:1e3*60*59})}function mr(e,t){return m(this,null,function*(){let i=un(t),n=yield e.get(i);if(!n)return;let[r,o,a,c,u,d]=n.split("|"),p=t.permissions||u.split(/,/).reduce((l,S)=>(/!$/.test(S)?l[S.slice(0,-1)]="write":l[S]="read",l),{});return{token:r,createdAt:o,expiresAt:a,permissions:p,repositoryIds:t.repositoryIds,repositoryNames:t.repositoryNames,singleFileName:d,repositorySelection:c}})}function yr(e,t,i){return m(this,null,function*(){let n=un(t),r=t.permissions?"":Object.keys(i.permissions).map(a=>`${a}${i.permissions[a]==="write"?"!":""}`).join(","),o=[i.token,i.createdAt,i.expiresAt,i.repositorySelection,r,i.singleFileName].join("|");yield e.set(n,o)})}function un({installationId:e,permissions:t={},repositoryIds:i=[],repositoryNames:n=[]}){let r=Object.keys(t).sort().map(c=>t[c]==="read"?c:`${c}!`).join(","),o=i.sort().join(","),a=n.join(",");return[e,o,a,r].filter(Boolean).join("|")}function on({installationId:e,token:t,createdAt:i,expiresAt:n,repositorySelection:r,permissions:o,repositoryIds:a,repositoryNames:c,singleFileName:u}){return Object.assign({type:"token",tokenType:"installation",token:t,installationId:e,permissions:o,createdAt:i,expiresAt:n,repositorySelection:r},a?{repositoryIds:a}:null,c?{repositoryNames:c}:null,u?{singleFileName:u}:null)}function hn(e,t,i){return m(this,null,function*(){let n=Number(t.installationId||e.installationId);if(!n)throw new Error("[@octokit/auth-app] installationId option is required for installation authentication.");if(t.factory){let b=g(g({},e),t),{type:x,factory:W,oauthApp:G}=b,z=J(b,["type","factory","oauthApp"]);return W(z)}let r=Object.assign({installationId:n},t);if(!t.refresh){let x=yield mr(e.cache,r);if(x){let{token:W,createdAt:G,expiresAt:z,permissions:se,repositoryIds:we,repositoryNames:Pt,singleFileName:He,repositorySelection:Ke}=x;return on({installationId:n,token:W,createdAt:G,expiresAt:z,permissions:se,repositorySelection:Ke,repositoryIds:we,repositoryNames:Pt,singleFileName:He})}}let o=yield ct(e),a=i||e.request,{data:{token:c,expires_at:u,repositories:d,permissions:p,repository_selection:l,single_file:S}}=yield a("POST /app/installations/{installation_id}/access_tokens",{installation_id:n,repository_ids:t.repositoryIds,repositories:t.repositoryNames,permissions:t.permissions,mediaType:{previews:["machine-man"]},headers:{authorization:`bearer ${o.token}`}}),j=p||{},N=l||"all",T=d?d.map(x=>x.id):void 0,q=d?d.map(x=>x.name):void 0,_=new Date().toISOString();return yield yr(e.cache,r,{token:c,createdAt:_,expiresAt:u,repositorySelection:N,permissions:j,repositoryIds:T,repositoryNames:q,singleFileName:S}),on({installationId:n,token:c,createdAt:_,expiresAt:u,repositorySelection:N,permissions:j,repositoryIds:T,repositoryNames:q,singleFileName:S})})}function wr(e,t){return m(this,null,function*(){switch(t.type){case"app":return ct(e);case"oauth":e.log.warn(new fr.Deprecation('[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead'));case"oauth-app":return e.oauthApp({type:"oauth-app"});case"installation":return hn(e,A(g({},t),{type:"installation"}));case"oauth-user":return e.oauthApp(t);default:throw new Error(`Invalid auth type: ${t.type}`)}})}var br=(je(),_e(It)),oo=(et(),_e(ni)),_r=["/app","/app/hook/config","/app/hook/deliveries","/app/hook/deliveries/{delivery_id}","/app/hook/deliveries/{delivery_id}/attempts","/app/installations","/app/installations/{installation_id}","/app/installations/{installation_id}/access_tokens","/app/installations/{installation_id}/suspended","/marketplace_listing/accounts/{account_id}","/marketplace_listing/plan","/marketplace_listing/plans","/marketplace_listing/plans/{plan_id}/accounts","/marketplace_listing/stubbed/accounts/{account_id}","/marketplace_listing/stubbed/plan","/marketplace_listing/stubbed/plans","/marketplace_listing/stubbed/plans/{plan_id}/accounts","/orgs/{org}/installation","/repos/{owner}/{repo}/installation","/users/{username}/installation"];function Ar(e){let i=`^(?:${e.map(n=>n.split("/").map(r=>r.startsWith("{")?"(?:.+?)":r).join("/")).map(n=>`(?:${n})`).join("|")})$`;return new RegExp(i,"i")}var Sr=Ar(_r);function Tr(e){return!!e&&Sr.test(e.split("?")[0])}var vr=5*1e3;function kr(e){return!(e.message.match(/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/)||e.message.match(/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/))}function Or(e,t,i,n){return m(this,null,function*(){let r=t.endpoint.merge(i,n),o=r.url;if(/\/login\/oauth\/access_token$/.test(o))return t(r);if(Tr(o.replace(t.endpoint.DEFAULTS.baseUrl,""))){let{token:u}=yield ct(e);r.headers.authorization=`bearer ${u}`;let d;try{d=yield t(r)}catch(p){if(kr(p)||typeof p.response.headers.date=="undefined")throw p;let l=Math.floor((Date.parse(p.response.headers.date)-Date.parse(new Date().toString()))/1e3);e.log.warn(p.message),e.log.warn(`[@octokit/auth-app] GitHub API time and system time are different by ${l} seconds. Retrying request with the difference accounted for.`);let{token:S}=yield ct(A(g({},e),{timeDifference:l}));return r.headers.authorization=`bearer ${S}`,t(r)}return d}if((0,br.requiresBasicAuth)(o)){let u=yield e.oauthApp({type:"oauth-app"});return r.headers.authorization=u.headers.authorization,t(r)}let{token:a,createdAt:c}=yield hn(e,{},t);return r.headers.authorization=`token ${a}`,ln(e,t,r,c)})}function ln(e,t,i,n,r=0){return m(this,null,function*(){let o=+new Date-+new Date(n);try{return yield t(i)}catch(a){if(a.status!==401)throw a;if(o>=vr)throw r>0&&(a.message=`After ${r} retries within ${o/1e3}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`),a;++r;let c=r*1e3;return e.log.warn(`[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${r}, wait: ${c/1e3}s)`),yield new Promise(u=>setTimeout(u,c)),ln(e,t,i,n,r)}})}var Er="6.0.0",Ir=(je(),_e(It));function xr(e){if(!e.appId)throw new Error("[@octokit/auth-app] appId option is required");if(!Number.isFinite(+e.appId))throw new Error("[@octokit/auth-app] appId option must be a number or numeric string");if(!e.privateKey)throw new Error("[@octokit/auth-app] privateKey option is required");if("installationId"in e&&!e.installationId)throw new Error("[@octokit/auth-app] installationId is set to a falsy value");let t=Object.assign({warn:console.warn.bind(console)},e.log),i=e.request||hr.request.defaults({headers:{"user-agent":`octokit-auth-app.js/${Er} ${(0,ur.getUserAgent)()}`}}),n=Object.assign({request:i,cache:gr()},e,e.installationId?{installationId:Number(e.installationId)}:{},{log:t,oauthApp:(0,lr.createOAuthAppAuth)({clientType:"github-app",clientId:e.clientId||"",clientSecret:e.clientSecret||"",request:i})});return Object.assign(wr.bind(null,n),{hook:Or.bind(null,n)})}});var le={};Ee(le,{createAppAuth:()=>jr,createOAuthUserAuth:()=>qr,default:()=>$r});var gn=U(Ut());fe(le,U(Ut()));var{createAppAuth:jr,createOAuthUserAuth:qr}=gn,pn=gn,{default:dn}=pn,Rr=J(pn,["default"]),$r=dn!==void 0?dn:Rr;export{jr as createAppAuth,qr as createOAuthUserAuth,$r as default};
/*! Bundled license information:
is-plain-object/dist/is-plain-object.mjs:
(*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*)
*/
//# sourceMappingURL=auth-app.bundle.mjs.map