Page MenuHomePhorge

375.ac3798cd.js
No OneTemporary

Size
13 KB
Referenced Files
None
Subscribers
None

375.ac3798cd.js

/*! For license information please see 375.ac3798cd.js.LICENSE.txt */
"use strict";(self.webpackChunkspa=self.webpackChunkspa||[]).push([["375"],{306(t,e,r){r.d(e,{A:()=>k});class o extends Error{response;request;options;constructor(t,e,r){const o=t.status||0===t.status?t.status:"",s=t.statusText??"",i=`${o} ${s}`.trim();super(`Request failed with ${i?`status code ${i}`:"an unknown error"}: ${e.method} ${e.url}`),this.name="HTTPError",this.response=t,this.request=e,this.options=r}}class s extends Error{name="NonError";value;constructor(t){let e="Non-error value was thrown";try{"string"==typeof t?e=t:t&&"object"==typeof t&&"message"in t&&"string"==typeof t.message&&(e=t.message)}catch{}super(e),this.value=t}}class i extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(t){const e=t?.cause?t.cause instanceof Error?t.cause:new s(t.cause):void 0;super(t?.code?`Forced retry: ${t.code}`:"Forced retry",e?{cause:e}:void 0),this.customDelay=t?.delay,this.code=t?.code,this.customRequest=t?.request}}let n=(()=>{let t=!1,e=!1,r="function"==typeof globalThis.Request;if("function"==typeof globalThis.ReadableStream&&r)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(t){if(t instanceof Error&&"unsupported BodyInit type"===t.message)return!1;throw t}return t&&!e})(),a="function"==typeof globalThis.AbortController,h="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,l="function"==typeof globalThis.ReadableStream,u="function"==typeof globalThis.FormData,p=["get","post","put","patch","head","delete"],f={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},c=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,d=Symbol("stop");class y{options;constructor(t){this.options=t}}let b=t=>new y(t),g={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},m={next:!0},w={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},R=(t,e,r)=>{let o,s=0;return t.pipeThrough(new TransformStream({transform(t,i){if(i.enqueue(t),o){s+=o.byteLength;let t=0===e?0:s/e;t>=1&&(t=1-Number.EPSILON),r?.({percent:t,totalBytes:Math.max(e,s),transferredBytes:s},o)}o=t},flush(){o&&(s+=o.byteLength,r?.({percent:1,totalBytes:Math.max(e,s),transferredBytes:s},o))}}))},T=t=>null!==t&&"object"==typeof t,q=(...t)=>{for(let e of t)if((!T(e)||Array.isArray(e))&&void 0!==e)throw TypeError("The `options` argument must be an object");return S({},...t)},x=(t={},e={})=>{let r=new globalThis.Headers(t),o=e instanceof globalThis.Headers;for(let[t,s]of new globalThis.Headers(e).entries())o&&"undefined"===s||void 0===s?r.delete(t):r.set(t,s);return r};function P(t,e,r){return Object.hasOwn(e,r)&&void 0===e[r]?[]:S(t[r]??[],e[r]??[])}let A=(t={},e={})=>({beforeRequest:P(t,e,"beforeRequest"),beforeRetry:P(t,e,"beforeRetry"),afterResponse:P(t,e,"afterResponse"),beforeError:P(t,e,"beforeError")}),E=(t,e)=>{let r=new URLSearchParams;for(let o of[t,e])if(void 0!==o)if(o instanceof URLSearchParams)for(let[t,e]of o.entries())r.append(t,e);else if(Array.isArray(o))for(let t of o){if(!Array.isArray(t)||2!==t.length)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(t[0]),String(t[1]))}else if(T(o))for(let[t,e]of Object.entries(o))void 0!==e&&r.append(t,String(e));else for(let[t,e]of new URLSearchParams(o).entries())r.append(t,e);return r},S=(...t)=>{let e,r={},o={},s={},i=[];for(let n of t)if(Array.isArray(n))Array.isArray(r)||(r=[]),r=[...r,...n];else if(T(n)){for(let[t,o]of Object.entries(n)){if("signal"===t&&o instanceof globalThis.AbortSignal){i.push(o);continue}if("context"===t){if(null!=o&&(!T(o)||Array.isArray(o)))throw TypeError("The `context` option must be an object");r={...r,context:null==o?{}:{...r.context,...o}};continue}if("searchParams"===t){e=null==o?void 0:void 0===e?o:E(e,o);continue}T(o)&&t in r&&(o=S(r[t],o)),r={...r,[t]:o}}T(n.hooks)&&(s=A(s,n.hooks),r.hooks=s),T(n.headers)&&(o=x(o,n.headers),r.headers=o)}return void 0!==e&&(r.searchParams=e),i.length>0&&(1===i.length?r.signal=i[0]:h?r.signal=AbortSignal.any(i):r.signal=i.at(-1)),void 0===r.context&&(r.context={}),r},v={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:1/0,backoffLimit:1/0,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1};class C extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}}async function j(t,e,r,o){return new Promise((s,i)=>{let n=setTimeout(()=>{r&&r.abort(),i(new C(t))},o.timeout);o.fetch(t,e).then(s).catch(i).then(()=>{clearTimeout(n)})})}async function O(t,{signal:e}){return new Promise((r,o)=>{function s(){clearTimeout(i),o(e.reason)}e&&(e.throwIfAborted(),e.addEventListener("abort",s,{once:!0}));let i=setTimeout(()=>{e?.removeEventListener("abort",s),r()},t)})}class U{static create(t,e){let r=new U(t,e),s=async()=>{if("number"==typeof r.#t.timeout&&r.#t.timeout>0x7fffffff)throw RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let t=await r.#e();for(let e of r.#t.hooks.afterResponse){let o=r.#r(t.clone()),s=await e(r.request,r.#o(),o,{retryCount:r.#s});if(s instanceof globalThis.Response&&(t=s),s instanceof y)throw await Promise.all([o.body?.cancel(),t.body?.cancel()]),new i(s.options)}if(r.#r(t),!t.ok&&("function"==typeof r.#t.throwHttpErrors?r.#t.throwHttpErrors(t.status):r.#t.throwHttpErrors)){let e=new o(t,r.request,r.#o());for(let t of r.#t.hooks.beforeError)e=await t(e,{retryCount:r.#s});throw e}if(r.#t.onDownloadProgress){if("function"!=typeof r.#t.onDownloadProgress)throw TypeError("The `onDownloadProgress` option must be a function");if(!l)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");return((t,e)=>{if(!t.body)return t;if(204===t.status)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});let r=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(R(t.body,r,e),{status:t.status,statusText:t.statusText,headers:t.headers})})(t.clone(),r.#t.onDownloadProgress)}return t},n=r.#i(s).finally(async()=>{let t=r.#n,e=[];t&&!t.bodyUsed&&e.push(t.body?.cancel()),r.request.bodyUsed||e.push(r.request.body?.cancel()),await Promise.all(e)});for(let[t,o]of Object.entries(f))("bytes"!==t||"function"==typeof globalThis.Response?.prototype?.bytes)&&(n[t]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||o);let s=await n;if("json"===t){if(204===s.status)return"";let t=await s.text();return""===t?"":e.parseJson?e.parseJson(t):JSON.parse(t)}return s[t]()});return n}static #a(t){return!t||"object"!=typeof t||Array.isArray(t)||t instanceof URLSearchParams?t:Object.fromEntries(Object.entries(t).filter(([,t])=>void 0!==t))}request;#h;#s=0;#l;#t;#n;#u;#p;constructor(t,e={}){if(this.#l=t,this.#t={...e,headers:x(this.#l.headers,e.headers),hooks:A({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:(t=>p.includes(t)?t.toUpperCase():t)(e.method??this.#l.method??"GET"),prefixUrl:String(e.prefixUrl||""),retry:((t={})=>{if("number"==typeof t)return{...v,limit:t};if(t.methods&&!Array.isArray(t.methods))throw Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw Error("retry.statusCodes must be an array");let e=Object.fromEntries(Object.entries(t).filter(([,t])=>void 0!==t));return{...v,...e}})(e.retry),throwHttpErrors:e.throwHttpErrors??!0,timeout:e.timeout??1e4,fetch:e.fetch??globalThis.fetch.bind(globalThis),context:e.context??{}},"string"!=typeof this.#l&&!(this.#l instanceof URL||this.#l instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(this.#t.prefixUrl&&"string"==typeof this.#l){if(this.#l.startsWith("/"))throw Error("`input` must not begin with a slash when using `prefixUrl`");this.#t.prefixUrl.endsWith("/")||(this.#t.prefixUrl+="/"),this.#l=this.#t.prefixUrl+this.#l}a&&h&&(this.#u=this.#t.signal??this.#l.signal,this.#h=new globalThis.AbortController,this.#t.signal=this.#u?AbortSignal.any([this.#u,this.#h.signal]):this.#h.signal),n&&(this.#t.duplex="half"),void 0!==this.#t.json&&(this.#t.body=this.#t.stringifyJson?.(this.#t.json)??JSON.stringify(this.#t.json),this.#t.headers.set("content-type",this.#t.headers.get("content-type")??"application/json"));const r=e.headers&&new globalThis.Headers(e.headers).has("content-type");if(this.#l instanceof globalThis.Request&&(u&&this.#t.body instanceof globalThis.FormData||this.#t.body instanceof URLSearchParams)&&!r&&this.#t.headers.delete("content-type"),this.request=new globalThis.Request(this.#l,this.#t),(t=>void 0!==t&&(Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0:"object"==typeof t?Object.keys(t).length>0:"string"==typeof t?t.trim().length>0:!!t))(this.#t.searchParams)){const t="string"==typeof this.#t.searchParams?this.#t.searchParams.replace(/^\?/,""):new URLSearchParams(U.#a(this.#t.searchParams)).toString(),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,"?"+t);this.request=new globalThis.Request(e,this.#t)}if(this.#t.onUploadProgress){if("function"!=typeof this.#t.onUploadProgress)throw TypeError("The `onUploadProgress` option must be a function");if(!n)throw Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#f(this.request,this.#t.body??void 0)}}#c(){let t=this.#t.retry.delay(this.#s),e=t;return!0===this.#t.retry.jitter?e=Math.random()*t:"function"==typeof this.#t.retry.jitter&&(!Number.isFinite(e=this.#t.retry.jitter(t))||e<0)&&(e=t),Math.min(this.#t.retry.backoffLimit??1/0,e)}async #d(t){if(this.#s++,this.#s>this.#t.retry.limit)throw t;let e=t instanceof Error?t:new s(t);if(e instanceof i)return e.customDelay??this.#c();if(!this.#t.retry.methods.includes(this.request.method.toLowerCase()))throw t;if(void 0!==this.#t.retry.shouldRetry){let r=await this.#t.retry.shouldRetry({error:e,retryCount:this.#s});if(!1===r)throw t;if(!0===r)return this.#c()}if((t instanceof C||t?.name===C.name)&&!this.#t.retry.retryOnTimeout)throw t;if(t instanceof o||t?.name===o.name){if(!this.#t.retry.statusCodes.includes(t.response.status))throw t;let e=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(e&&this.#t.retry.afterStatusCodes.includes(t.response.status)){let t=1e3*Number(e);Number.isNaN(t)?t=Date.parse(e)-Date.now():t>=Date.parse("2024-01-01")&&(t-=Date.now());let r=this.#t.retry.maxRetryAfter??t;return t<r?t:r}if(413===t.response.status)throw t}return this.#c()}#r(t){return this.#t.parseJson&&(t.json=async()=>this.#t.parseJson(await t.text())),t}async #i(t){try{return await t()}catch(r){let e=Math.min(await this.#d(r),0x7fffffff);if(this.#s<1)throw r;if(await O(e,this.#u?{signal:this.#u}:{}),r instanceof i&&r.customRequest){let t=this.#t.signal?new globalThis.Request(r.customRequest,{signal:this.#t.signal}):new globalThis.Request(r.customRequest);this.#y(t)}for(let t of this.#t.hooks.beforeRetry){let e=await t({request:this.request,options:this.#o(),error:r,retryCount:this.#s});if(e instanceof globalThis.Request){this.#y(e);break}if(e instanceof globalThis.Response)return e;if(e===d)return}return this.#i(t)}}async #e(){for(let t of(this.#h?.signal.aborted&&(this.#h=new globalThis.AbortController,this.#t.signal=this.#u?AbortSignal.any([this.#u,this.#h.signal]):this.#h.signal,this.request=new globalThis.Request(this.request,{signal:this.#t.signal})),this.#t.hooks.beforeRequest)){let e=await t(this.request,this.#o(),{retryCount:this.#s});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#y(e);break}}let t=((t,e)=>{let r={};for(let o in e)Object.hasOwn(e,o)&&(o in w||o in g||o in t&&!(o in m)||(r[o]=e[o]));return r})(this.request,this.#t);return(this.#n=this.request,this.request=this.#n.clone(),!1===this.#t.timeout)?this.#t.fetch(this.#n,t):j(this.#n,t,this.#h,this.#t)}#o(){if(!this.#p){let{hooks:t,...e}=this.#t;this.#p=Object.freeze(e)}return this.#p}#y(t){this.#p=void 0,this.request=this.#f(t)}#f(t,e){return this.#t.onUploadProgress&&t.body?((t,e,r)=>{if(!t.body)return t;let o=(t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[r,o]of t)e+=c,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,e+="string"==typeof o?new TextEncoder().encode(o).length:o.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if("string"==typeof t)return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if("object"==typeof t&&null!==t)try{let e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{}return 0})(r??t.body);return new Request(t,{duplex:"half",body:R(t.body,o,e)})})(t,this.#t.onUploadProgress,e??this.#t.body??void 0):t}}let L=t=>{let e=(e,r)=>U.create(e,q(t,r));for(let r of p)e[r]=(e,o)=>U.create(e,q(t,o,{method:r}));return e.create=t=>L(q(t)),e.extend=e=>("function"==typeof e&&(e=e(t??{})),L(q(t,e))),e.stop=d,e.retry=b,e},k=L()}}]);

File Metadata

Mime Type
application/javascript
Expires
Fri, Mar 27, 1:07 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
513133
Default Alt Text
375.ac3798cd.js (13 KB)

Event Timeline