"use strict";(self.webpackChunkjupyterlab_autoversion=self.webpackChunkjupyterlab_autoversion||[]).push([[873],{873:(e,t)=>{function s(e={}){return Object.keys(e).map((t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&")}function o(e,t={}){const o=s(t);return o?e+(-1===e.indexOf("?")?"?":"&")+o:e}function n(e,t=!1){return{data:t?e.response:e.responseText,headers:e.getAllResponseHeaders(),json:()=>JSON.parse(e.responseText),ok:e.status>=200&&e.status<300,status:e.status,statusText:e.statusText,url:e.responseURL}}function a(e,t=null){return{data:t||e.statusText,headers:e.getAllResponseHeaders(),json:()=>JSON.parse(t||e.statusText),ok:!1,status:e.status,statusText:e.statusText,url:e.responseURL}}Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_REQUEST_OPTIONS={blob:!1,headers:{Accept:"application/json, text/javascript, text/plain"},ignoreCache:!1,timeout:5e3},t.request=function(e,s,r={},u=null,c=t.DEFAULT_REQUEST_OPTIONS){const T=c.ignoreCache||t.DEFAULT_REQUEST_OPTIONS.ignoreCache,i=c.headers||t.DEFAULT_REQUEST_OPTIONS.headers,p=c.timeout||t.DEFAULT_REQUEST_OPTIONS.timeout,E=c.blob||t.DEFAULT_REQUEST_OPTIONS.blob;return new Promise(((t,c)=>{const d=new XMLHttpRequest;d.open(e,o(s,r)),i&&Object.keys(i).forEach((e=>d.setRequestHeader(e,i[e]))),T&&d.setRequestHeader("Cache-Control","no-cache"),d.timeout=p,d.onload=e=>{t(n(d,E))},d.onerror=e=>{t(a(d,"Failed to make request."))},d.ontimeout=e=>{t(a(d,"Request took longer than expected."))},"post"===e&&u?(d.setRequestHeader("Content-Type","application/json"),d.send(JSON.stringify(u))):d.send()}))},t.requestFormData=function(e,r){const u=t.DEFAULT_REQUEST_OPTIONS,c=u.ignoreCache||t.DEFAULT_REQUEST_OPTIONS.ignoreCache,T=u.headers||t.DEFAULT_REQUEST_OPTIONS.headers,i=u.timeout||t.DEFAULT_REQUEST_OPTIONS.timeout;return new Promise(((t,u)=>{const p=new XMLHttpRequest;p.open("post",o(e,s)),Object.keys(T).forEach((e=>p.setRequestHeader(e,T[e]))),c&&p.setRequestHeader("Cache-Control","no-cache"),p.timeout=i,p.onload=e=>{t(n(p))},p.onerror=e=>{t(a(p,"Failed to make request."))},p.ontimeout=e=>{t(a(p,"Request took longer than expected."))},p.send(r)}))}}}]);