diff --git a/assets/05-modal-exercises-e1c62cac.js b/assets/05-modal-exercises-63285a5c.js similarity index 87% rename from assets/05-modal-exercises-e1c62cac.js rename to assets/05-modal-exercises-63285a5c.js index 70f5a11..04b3235 100644 --- a/assets/05-modal-exercises-e1c62cac.js +++ b/assets/05-modal-exercises-63285a5c.js @@ -1,11 +1,11 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();document.addEventListener("DOMContentLoaded",function(){const e=document.getElementById("homeButton"),t=document.getElementById("favoritesButton");e.addEventListener("click",()=>{console.log("Home button clicked"),e.classList.add("active"),t.classList.remove("active")}),t.addEventListener("click",()=>{console.log("Favorites button clicked"),t.classList.add("active"),e.classList.remove("active")})});const nt=document.querySelector(".js-open-menu"),st=document.querySelector(".js-close-menu"),Ce=document.querySelector("#mobile-menu"),ae=document.querySelector("[data-menu-backdrop]"),rt=document.querySelectorAll(".menu__nav-link");function ot(){Ce.classList.add("is-open"),ae.classList.remove("is-hidden"),document.body.classList.add("no-scroll")}function ce(){Ce.classList.remove("is-open"),ae.classList.add("is-hidden"),document.body.classList.remove("no-scroll")}nt.addEventListener("click",()=>{ot()});st.addEventListener("click",()=>{ce()});ae.addEventListener("click",()=>{ce()});rt.forEach(e=>{e.addEventListener("click",()=>{const t=e.getAttribute("href").substring(1),n=document.getElementById(t);n&&(n.scrollIntoView({behavior:"smooth"}),ce())})});document.addEventListener("DOMContentLoaded",()=>{const e=window.location.pathname,t=document.getElementById("homeButton"),n=document.getElementById("favoritesButton");e.includes("index.html")?(t.classList.add("active"),t.addEventListener("click",G)):e.includes("favorites.html")?(n.classList.add("active"),n.addEventListener("click",G)):(t.classList.add("active"),t.addEventListener("click",G))});const G=e=>{const t=document.getElementById("homeButton"),n=document.getElementById("favoritesButton");e.currentTarget.classList.contains("active")?e.preventDefault():alert("Button clicked!"),e.currentTarget===n&&t.classList.remove("active")};function Ne(e,t){return function(){return e.apply(t,arguments)}}const{toString:it}=Object.prototype,{getPrototypeOf:le}=Object,H=(e=>t=>{const n=it.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),x=e=>(e=e.toLowerCase(),t=>H(t)===e),J=e=>t=>typeof t===e,{isArray:N}=Array,D=J("undefined");function at(e){return e!==null&&!D(e)&&e.constructor!==null&&!D(e.constructor)&&S(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Pe=x("ArrayBuffer");function ct(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Pe(e.buffer),t}const lt=J("string"),S=J("function"),Be=J("number"),z=e=>e!==null&&typeof e=="object",ut=e=>e===!0||e===!1,j=e=>{if(H(e)!=="object")return!1;const t=le(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},dt=x("Date"),ft=x("File"),pt=x("Blob"),ht=x("FileList"),mt=e=>z(e)&&S(e.pipe),yt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||S(e.append)&&((t=H(e))==="formdata"||t==="object"&&S(e.toString)&&e.toString()==="[object FormData]"))},bt=x("URLSearchParams"),gt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function $(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),N(e))for(s=0,r=e.length;s0;)if(r=n[s],t===r.toLowerCase())return r;return null}const De=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),$e=e=>!D(e)&&e!==De;function te(){const{caseless:e}=$e(this)&&this||{},t={},n=(s,r)=>{const o=e&&Fe(t,r)||r;j(t[o])&&j(s)?t[o]=te(t[o],s):j(s)?t[o]=te({},s):N(s)?t[o]=s.slice():t[o]=s};for(let s=0,r=arguments.length;s($(t,(r,o)=>{n&&S(r)?e[o]=Ne(r,n):e[o]=r},{allOwnKeys:s}),e),wt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),St=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},_t=(e,t,n,s)=>{let r,o,i;const c={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),o=r.length;o-- >0;)i=r[o],(!s||s(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&le(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},xt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},Rt=e=>{if(!e)return null;if(N(e))return e;let t=e.length;if(!Be(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ot=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&le(Uint8Array)),vt=(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=s.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},At=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},Lt=x("HTMLFormElement"),Tt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),be=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ct=x("RegExp"),ke=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};$(n,(r,o)=>{let i;(i=t(r,o,e))!==!1&&(s[o]=i||r)}),Object.defineProperties(e,s)},Nt=e=>{ke(e,(t,n)=>{if(S(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(S(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Pt=(e,t)=>{const n={},s=r=>{r.forEach(o=>{n[o]=!0})};return N(e)?s(e):s(String(e).split(t)),n},Bt=()=>{},Ft=(e,t)=>(e=+e,Number.isFinite(e)?e:t),X="abcdefghijklmnopqrstuvwxyz",ge="0123456789",je={DIGIT:ge,ALPHA:X,ALPHA_DIGIT:X+X.toUpperCase()+ge},Dt=(e=16,t=je.ALPHA_DIGIT)=>{let n="";const{length:s}=t;for(;e--;)n+=t[Math.random()*s|0];return n};function $t(e){return!!(e&&S(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const kt=e=>{const t=new Array(10),n=(s,r)=>{if(z(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[r]=s;const o=N(s)?[]:{};return $(s,(i,c)=>{const f=n(i,r+1);!D(f)&&(o[c]=f)}),t[r]=void 0,o}}return s};return n(e,0)},jt=x("AsyncFunction"),Ut=e=>e&&(z(e)||S(e))&&S(e.then)&&S(e.catch),a={isArray:N,isArrayBuffer:Pe,isBuffer:at,isFormData:yt,isArrayBufferView:ct,isString:lt,isNumber:Be,isBoolean:ut,isObject:z,isPlainObject:j,isUndefined:D,isDate:dt,isFile:ft,isBlob:pt,isRegExp:Ct,isFunction:S,isStream:mt,isURLSearchParams:bt,isTypedArray:Ot,isFileList:ht,forEach:$,merge:te,extend:Et,trim:gt,stripBOM:wt,inherits:St,toFlatObject:_t,kindOf:H,kindOfTest:x,endsWith:xt,toArray:Rt,forEachEntry:vt,matchAll:At,isHTMLForm:Lt,hasOwnProperty:be,hasOwnProp:be,reduceDescriptors:ke,freezeMethods:Nt,toObjectSet:Pt,toCamelCase:Tt,noop:Bt,toFiniteNumber:Ft,findKey:Fe,global:De,isContextDefined:$e,ALPHABET:je,generateString:Dt,isSpecCompliantForm:$t,toJSONObject:kt,isAsyncFn:jt,isThenable:Ut};function m(e,t,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r)}a.inherits(m,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ue=m.prototype,Me={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Me[e]={value:e}});Object.defineProperties(m,Me);Object.defineProperty(Ue,"isAxiosError",{value:!0});m.from=(e,t,n,s,r,o)=>{const i=Object.create(Ue);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),m.call(i,e.message,t,n,s,r),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Mt=null;function ne(e){return a.isPlainObject(e)||a.isArray(e)}function Ie(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ee(e,t,n){return e?e.concat(t).map(function(r,o){return r=Ie(r),!n&&o?"["+r+"]":r}).join(n?".":""):t}function It(e){return a.isArray(e)&&!e.some(ne)}const qt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function V(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,E){return!a.isUndefined(E[h])});const s=n.metaTokens,r=n.visitor||u,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(r))throw new TypeError("visitor must be a function");function p(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(!f&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,h,E){let w=d;if(d&&!E&&typeof d=="object"){if(a.endsWith(h,"{}"))h=s?h:h.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&It(d)||(a.isFileList(d)||a.endsWith(h,"[]"))&&(w=a.toArray(d)))return h=Ie(h),w.forEach(function(v,tt){!(a.isUndefined(v)||v===null)&&t.append(i===!0?Ee([h],tt,o):i===null?h:h+"[]",p(v))}),!1}return ne(d)?!0:(t.append(Ee(E,h,o),p(d)),!1)}const l=[],y=Object.assign(qt,{defaultVisitor:u,convertValue:p,isVisitable:ne});function g(d,h){if(!a.isUndefined(d)){if(l.indexOf(d)!==-1)throw Error("Circular reference detected in "+h.join("."));l.push(d),a.forEach(d,function(w,O){(!(a.isUndefined(w)||w===null)&&r.call(t,w,a.isString(O)?O.trim():O,h,y))===!0&&g(w,h?h.concat(O):[O])}),l.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return g(e),t}function we(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function ue(e,t){this._pairs=[],e&&V(e,this,t)}const qe=ue.prototype;qe.append=function(t,n){this._pairs.push([t,n])};qe.toString=function(t){const n=t?function(s){return t.call(this,s,we)}:we;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function Ht(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function He(e,t,n){if(!t)return e;const s=n&&n.encode||Ht,r=n&&n.serialize;let o;if(r?o=r(t,n):o=a.isURLSearchParams(t)?t.toString():new ue(t,n).toString(s),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Jt{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Se=Jt,Je={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zt=typeof URLSearchParams<"u"?URLSearchParams:ue,Vt=typeof FormData<"u"?FormData:null,Wt=typeof Blob<"u"?Blob:null,Kt={isBrowser:!0,classes:{URLSearchParams:zt,FormData:Vt,Blob:Wt},protocols:["http","https","file","blob","url","data"]},ze=typeof window<"u"&&typeof document<"u",Gt=(e=>ze&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Xt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Qt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ze,hasStandardBrowserEnv:Gt,hasStandardBrowserWebWorkerEnv:Xt},Symbol.toStringTag,{value:"Module"})),_={...Qt,...Kt};function Zt(e,t){return V(e,new _.classes.URLSearchParams,Object.assign({visitor:function(n,s,r,o){return _.isNode&&a.isBuffer(n)?(this.append(s,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Yt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function en(e){const t={},n=Object.keys(e);let s;const r=n.length;let o;for(s=0;s=n.length;return i=!i&&a.isArray(r)?r.length:i,f?(a.hasOwnProp(r,i)?r[i]=[r[i],s]:r[i]=s,!c):((!r[i]||!a.isObject(r[i]))&&(r[i]=[]),t(n,s,r[i],o)&&a.isArray(r[i])&&(r[i]=en(r[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(s,r)=>{t(Yt(s),r,n,0)}),n}return null}function tn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const de={transitional:Je,adapter:["xhr","http"],transformRequest:[function(t,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return r&&r?JSON.stringify(Ve(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Zt(t,this.formSerializer).toString();if((c=a.isFileList(t))||s.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return V(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||r?(n.setContentType("application/json",!1),tn(t)):t}],transformResponse:[function(t){const n=this.transitional||de.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(t&&a.isString(t)&&(s&&!this.responseType||r)){const i=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_.classes.FormData,Blob:_.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{de.headers[e]={}});const fe=de,nn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),sn=e=>{const t={};let n,s,r;return e&&e.split(` +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();document.addEventListener("DOMContentLoaded",function(){const e=document.getElementById("homeButton"),t=document.getElementById("favoritesButton");e.addEventListener("click",()=>{console.log("Home button clicked"),e.classList.add("active"),t.classList.remove("active")}),t.addEventListener("click",()=>{console.log("Favorites button clicked"),t.classList.add("active"),e.classList.remove("active")})});const nt=document.querySelector(".js-open-menu"),st=document.querySelector(".js-close-menu"),Ne=document.querySelector("#mobile-menu"),ae=document.querySelector("[data-menu-backdrop]"),rt=document.querySelectorAll(".menu__nav-link");function ot(){Ne.classList.add("is-open"),ae.classList.remove("is-hidden"),document.body.classList.add("no-scroll")}function ce(){Ne.classList.remove("is-open"),ae.classList.add("is-hidden"),document.body.classList.remove("no-scroll")}nt.addEventListener("click",()=>{ot()});st.addEventListener("click",()=>{ce()});ae.addEventListener("click",()=>{ce()});rt.forEach(e=>{e.addEventListener("click",()=>{const t=e.getAttribute("href").substring(1),n=document.getElementById(t);n&&(n.scrollIntoView({behavior:"smooth"}),ce())})});document.addEventListener("DOMContentLoaded",()=>{const e=window.location.pathname,t=document.getElementById("homeButton"),n=document.getElementById("favoritesButton");e.includes("index.html")?(t.classList.add("active"),t.addEventListener("click",G)):e.includes("favorites.html")?(n.classList.add("active"),n.addEventListener("click",G)):(t.classList.add("active"),t.addEventListener("click",G))});const G=e=>{const t=document.getElementById("homeButton"),n=document.getElementById("favoritesButton");e.currentTarget.classList.contains("active")?e.preventDefault():alert("Button clicked!"),e.currentTarget===n&&t.classList.remove("active")};function Ce(e,t){return function(){return e.apply(t,arguments)}}const{toString:it}=Object.prototype,{getPrototypeOf:le}=Object,H=(e=>t=>{const n=it.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),x=e=>(e=e.toLowerCase(),t=>H(t)===e),J=e=>t=>typeof t===e,{isArray:C}=Array,D=J("undefined");function at(e){return e!==null&&!D(e)&&e.constructor!==null&&!D(e.constructor)&&S(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Pe=x("ArrayBuffer");function ct(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Pe(e.buffer),t}const lt=J("string"),S=J("function"),Be=J("number"),z=e=>e!==null&&typeof e=="object",ut=e=>e===!0||e===!1,j=e=>{if(H(e)!=="object")return!1;const t=le(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},dt=x("Date"),ft=x("File"),pt=x("Blob"),ht=x("FileList"),mt=e=>z(e)&&S(e.pipe),yt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||S(e.append)&&((t=H(e))==="formdata"||t==="object"&&S(e.toString)&&e.toString()==="[object FormData]"))},bt=x("URLSearchParams"),gt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function $(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),C(e))for(s=0,r=e.length;s0;)if(r=n[s],t===r.toLowerCase())return r;return null}const De=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),$e=e=>!D(e)&&e!==De;function te(){const{caseless:e}=$e(this)&&this||{},t={},n=(s,r)=>{const o=e&&Fe(t,r)||r;j(t[o])&&j(s)?t[o]=te(t[o],s):j(s)?t[o]=te({},s):C(s)?t[o]=s.slice():t[o]=s};for(let s=0,r=arguments.length;s($(t,(r,o)=>{n&&S(r)?e[o]=Ce(r,n):e[o]=r},{allOwnKeys:s}),e),wt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),St=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},_t=(e,t,n,s)=>{let r,o,i;const c={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),o=r.length;o-- >0;)i=r[o],(!s||s(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&le(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},xt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},Ot=e=>{if(!e)return null;if(C(e))return e;let t=e.length;if(!Be(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Rt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&le(Uint8Array)),vt=(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=s.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},At=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},Lt=x("HTMLFormElement"),Tt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),be=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nt=x("RegExp"),ke=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};$(n,(r,o)=>{let i;(i=t(r,o,e))!==!1&&(s[o]=i||r)}),Object.defineProperties(e,s)},Ct=e=>{ke(e,(t,n)=>{if(S(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(S(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Pt=(e,t)=>{const n={},s=r=>{r.forEach(o=>{n[o]=!0})};return C(e)?s(e):s(String(e).split(t)),n},Bt=()=>{},Ft=(e,t)=>(e=+e,Number.isFinite(e)?e:t),X="abcdefghijklmnopqrstuvwxyz",ge="0123456789",je={DIGIT:ge,ALPHA:X,ALPHA_DIGIT:X+X.toUpperCase()+ge},Dt=(e=16,t=je.ALPHA_DIGIT)=>{let n="";const{length:s}=t;for(;e--;)n+=t[Math.random()*s|0];return n};function $t(e){return!!(e&&S(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const kt=e=>{const t=new Array(10),n=(s,r)=>{if(z(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[r]=s;const o=C(s)?[]:{};return $(s,(i,c)=>{const f=n(i,r+1);!D(f)&&(o[c]=f)}),t[r]=void 0,o}}return s};return n(e,0)},jt=x("AsyncFunction"),Ut=e=>e&&(z(e)||S(e))&&S(e.then)&&S(e.catch),a={isArray:C,isArrayBuffer:Pe,isBuffer:at,isFormData:yt,isArrayBufferView:ct,isString:lt,isNumber:Be,isBoolean:ut,isObject:z,isPlainObject:j,isUndefined:D,isDate:dt,isFile:ft,isBlob:pt,isRegExp:Nt,isFunction:S,isStream:mt,isURLSearchParams:bt,isTypedArray:Rt,isFileList:ht,forEach:$,merge:te,extend:Et,trim:gt,stripBOM:wt,inherits:St,toFlatObject:_t,kindOf:H,kindOfTest:x,endsWith:xt,toArray:Ot,forEachEntry:vt,matchAll:At,isHTMLForm:Lt,hasOwnProperty:be,hasOwnProp:be,reduceDescriptors:ke,freezeMethods:Ct,toObjectSet:Pt,toCamelCase:Tt,noop:Bt,toFiniteNumber:Ft,findKey:Fe,global:De,isContextDefined:$e,ALPHABET:je,generateString:Dt,isSpecCompliantForm:$t,toJSONObject:kt,isAsyncFn:jt,isThenable:Ut};function m(e,t,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r)}a.inherits(m,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ue=m.prototype,Ie={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ie[e]={value:e}});Object.defineProperties(m,Ie);Object.defineProperty(Ue,"isAxiosError",{value:!0});m.from=(e,t,n,s,r,o)=>{const i=Object.create(Ue);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),m.call(i,e.message,t,n,s,r),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const It=null;function ne(e){return a.isPlainObject(e)||a.isArray(e)}function Me(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ee(e,t,n){return e?e.concat(t).map(function(r,o){return r=Me(r),!n&&o?"["+r+"]":r}).join(n?".":""):t}function Mt(e){return a.isArray(e)&&!e.some(ne)}const qt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function V(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,E){return!a.isUndefined(E[h])});const s=n.metaTokens,r=n.visitor||u,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(r))throw new TypeError("visitor must be a function");function p(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(!f&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,h,E){let w=d;if(d&&!E&&typeof d=="object"){if(a.endsWith(h,"{}"))h=s?h:h.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&Mt(d)||(a.isFileList(d)||a.endsWith(h,"[]"))&&(w=a.toArray(d)))return h=Me(h),w.forEach(function(v,tt){!(a.isUndefined(v)||v===null)&&t.append(i===!0?Ee([h],tt,o):i===null?h:h+"[]",p(v))}),!1}return ne(d)?!0:(t.append(Ee(E,h,o),p(d)),!1)}const l=[],y=Object.assign(qt,{defaultVisitor:u,convertValue:p,isVisitable:ne});function g(d,h){if(!a.isUndefined(d)){if(l.indexOf(d)!==-1)throw Error("Circular reference detected in "+h.join("."));l.push(d),a.forEach(d,function(w,R){(!(a.isUndefined(w)||w===null)&&r.call(t,w,a.isString(R)?R.trim():R,h,y))===!0&&g(w,h?h.concat(R):[R])}),l.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return g(e),t}function we(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function ue(e,t){this._pairs=[],e&&V(e,this,t)}const qe=ue.prototype;qe.append=function(t,n){this._pairs.push([t,n])};qe.toString=function(t){const n=t?function(s){return t.call(this,s,we)}:we;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function Ht(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function He(e,t,n){if(!t)return e;const s=n&&n.encode||Ht,r=n&&n.serialize;let o;if(r?o=r(t,n):o=a.isURLSearchParams(t)?t.toString():new ue(t,n).toString(s),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Jt{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Se=Jt,Je={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zt=typeof URLSearchParams<"u"?URLSearchParams:ue,Vt=typeof FormData<"u"?FormData:null,Wt=typeof Blob<"u"?Blob:null,Kt={isBrowser:!0,classes:{URLSearchParams:zt,FormData:Vt,Blob:Wt},protocols:["http","https","file","blob","url","data"]},ze=typeof window<"u"&&typeof document<"u",Gt=(e=>ze&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Xt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Qt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ze,hasStandardBrowserEnv:Gt,hasStandardBrowserWebWorkerEnv:Xt},Symbol.toStringTag,{value:"Module"})),_={...Qt,...Kt};function Zt(e,t){return V(e,new _.classes.URLSearchParams,Object.assign({visitor:function(n,s,r,o){return _.isNode&&a.isBuffer(n)?(this.append(s,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Yt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function en(e){const t={},n=Object.keys(e);let s;const r=n.length;let o;for(s=0;s=n.length;return i=!i&&a.isArray(r)?r.length:i,f?(a.hasOwnProp(r,i)?r[i]=[r[i],s]:r[i]=s,!c):((!r[i]||!a.isObject(r[i]))&&(r[i]=[]),t(n,s,r[i],o)&&a.isArray(r[i])&&(r[i]=en(r[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(s,r)=>{t(Yt(s),r,n,0)}),n}return null}function tn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const de={transitional:Je,adapter:["xhr","http"],transformRequest:[function(t,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return r&&r?JSON.stringify(Ve(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Zt(t,this.formSerializer).toString();if((c=a.isFileList(t))||s.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return V(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||r?(n.setContentType("application/json",!1),tn(t)):t}],transformResponse:[function(t){const n=this.transitional||de.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(t&&a.isString(t)&&(s&&!this.responseType||r)){const i=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_.classes.FormData,Blob:_.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{de.headers[e]={}});const fe=de,nn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),sn=e=>{const t={};let n,s,r;return e&&e.split(` `).forEach(function(i){r=i.indexOf(":"),n=i.substring(0,r).trim().toLowerCase(),s=i.substring(r+1).trim(),!(!n||t[n]&&nn[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},_e=Symbol("internals");function P(e){return e&&String(e).trim().toLowerCase()}function U(e){return e===!1||e==null?e:a.isArray(e)?e.map(U):String(e)}function rn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const on=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Q(e,t,n,s,r){if(a.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!a.isString(t)){if(a.isString(s))return t.indexOf(s)!==-1;if(a.isRegExp(s))return s.test(t)}}function an(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function cn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,o,i){return this[s].call(this,t,r,o,i)},configurable:!0})})}class W{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function o(c,f,p){const u=P(f);if(!u)throw new Error("header name must be a non-empty string");const l=a.findKey(r,u);(!l||r[l]===void 0||p===!0||p===void 0&&r[l]!==!1)&&(r[l||f]=U(c))}const i=(c,f)=>a.forEach(c,(p,u)=>o(p,u,f));return a.isPlainObject(t)||t instanceof this.constructor?i(t,n):a.isString(t)&&(t=t.trim())&&!on(t)?i(sn(t),n):t!=null&&o(n,t,s),this}get(t,n){if(t=P(t),t){const s=a.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return rn(r);if(a.isFunction(n))return n.call(this,r,s);if(a.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=P(t),t){const s=a.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||Q(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function o(i){if(i=P(i),i){const c=a.findKey(s,i);c&&(!n||Q(s,s[c],c,n))&&(delete s[c],r=!0)}}return a.isArray(t)?t.forEach(o):o(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const o=n[s];(!t||Q(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){const n=this,s={};return a.forEach(this,(r,o)=>{const i=a.findKey(s,o);if(i){n[i]=U(r),delete n[o];return}const c=t?an(o):String(o).trim();c!==o&&delete n[o],n[c]=U(r),s[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&a.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[_e]=this[_e]={accessors:{}}).accessors,r=this.prototype;function o(i){const c=P(i);s[c]||(cn(r,i),s[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}}W.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(W.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});a.freezeMethods(W);const R=W;function Z(e,t){const n=this||fe,s=t||n,r=R.from(s.headers);let o=s.data;return a.forEach(e,function(c){o=c.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function We(e){return!!(e&&e.__CANCEL__)}function k(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(k,m,{__CANCEL__:!0});function ln(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const un=_.hasStandardBrowserEnv?{write(e,t,n,s,r,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(s)&&i.push("path="+s),a.isString(r)&&i.push("domain="+r),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function dn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function fn(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Ke(e,t){return e&&!dn(t)?fn(e,t):t}const pn=_.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let s;function r(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=r(window.location.href),function(i){const c=a.isString(i)?r(i):i;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}();function hn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mn(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const p=Date.now(),u=s[o];i||(i=p),n[r]=f,s[r]=p;let l=o,y=0;for(;l!==r;)y+=n[l++],l=l%e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),p-i{const o=r.loaded,i=r.lengthComputable?r.total:void 0,c=o-n,f=s(c),p=o<=i;n=o;const u={loaded:o,total:i,progress:i?o/i:void 0,bytes:c,rate:f||void 0,estimated:f&&i&&p?(i-o)/f:void 0,event:r};u[t?"download":"upload"]=!0,e(u)}}const yn=typeof XMLHttpRequest<"u",bn=yn&&function(e){return new Promise(function(n,s){let r=e.data;const o=R.from(e.headers).normalize();let{responseType:i,withXSRFToken:c}=e,f;function p(){e.cancelToken&&e.cancelToken.unsubscribe(f),e.signal&&e.signal.removeEventListener("abort",f)}let u;if(a.isFormData(r)){if(_.hasStandardBrowserEnv||_.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((u=o.getContentType())!==!1){const[h,...E]=u?u.split(";").map(w=>w.trim()).filter(Boolean):[];o.setContentType([h||"multipart/form-data",...E].join("; "))}}let l=new XMLHttpRequest;if(e.auth){const h=e.auth.username||"",E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(h+":"+E))}const y=Ke(e.baseURL,e.url);l.open(e.method.toUpperCase(),He(y,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function g(){if(!l)return;const h=R.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),w={data:!i||i==="text"||i==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:h,config:e,request:l};ln(function(v){n(v),p()},function(v){s(v),p()},w),l=null}if("onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){l&&(s(new m("Request aborted",m.ECONNABORTED,e,l)),l=null)},l.onerror=function(){s(new m("Network Error",m.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let E=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const w=e.transitional||Je;e.timeoutErrorMessage&&(E=e.timeoutErrorMessage),s(new m(E,w.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,l)),l=null},_.hasStandardBrowserEnv&&(c&&a.isFunction(c)&&(c=c(e)),c||c!==!1&&pn(y))){const h=e.xsrfHeaderName&&e.xsrfCookieName&&un.read(e.xsrfCookieName);h&&o.set(e.xsrfHeaderName,h)}r===void 0&&o.setContentType(null),"setRequestHeader"in l&&a.forEach(o.toJSON(),function(E,w){l.setRequestHeader(w,E)}),a.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),i&&i!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",xe(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",xe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(f=h=>{l&&(s(!h||h.type?new k(null,e,l):h),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(f),e.signal&&(e.signal.aborted?f():e.signal.addEventListener("abort",f)));const d=hn(y);if(d&&_.protocols.indexOf(d)===-1){s(new m("Unsupported protocol "+d+":",m.ERR_BAD_REQUEST,e));return}l.send(r||null)})},se={http:Mt,xhr:bn};a.forEach(se,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Re=e=>`- ${e}`,gn=e=>a.isFunction(e)||e===null||e===!1,Ge={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,s;const r={};for(let o=0;o`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since : -`+o.map(Re).join(` -`):" "+Re(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return s},adapters:se};function Y(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new k(null,e)}function Oe(e){return Y(e),e.headers=R.from(e.headers),e.data=Z.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ge.getAdapter(e.adapter||fe.adapter)(e).then(function(s){return Y(e),s.data=Z.call(e,e.transformResponse,s),s.headers=R.from(s.headers),s},function(s){return We(s)||(Y(e),s&&s.response&&(s.response.data=Z.call(e,e.transformResponse,s.response),s.response.headers=R.from(s.response.headers))),Promise.reject(s)})}const ve=e=>e instanceof R?e.toJSON():e;function C(e,t){t=t||{};const n={};function s(p,u,l){return a.isPlainObject(p)&&a.isPlainObject(u)?a.merge.call({caseless:l},p,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function r(p,u,l){if(a.isUndefined(u)){if(!a.isUndefined(p))return s(void 0,p,l)}else return s(p,u,l)}function o(p,u){if(!a.isUndefined(u))return s(void 0,u)}function i(p,u){if(a.isUndefined(u)){if(!a.isUndefined(p))return s(void 0,p)}else return s(void 0,u)}function c(p,u,l){if(l in t)return s(p,u);if(l in e)return s(void 0,p)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(p,u)=>r(ve(p),ve(u),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(u){const l=f[u]||r,y=l(e[u],t[u],u);a.isUndefined(y)&&l!==c||(n[u]=y)}),n}const Xe="1.6.2",pe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{pe[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ae={};pe.transitional=function(t,n,s){function r(o,i){return"[Axios v"+Xe+"] Transitional option '"+o+"'"+i+(s?". "+s:"")}return(o,i,c)=>{if(t===!1)throw new m(r(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!Ae[i]&&(Ae[i]=!0,console.warn(r(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function En(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const o=s[r],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new m("option "+o+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const re={assertOptions:En,validators:pe},A=re.validators;class I{constructor(t){this.defaults=t,this.interceptors={request:new Se,response:new Se}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=C(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&re.assertOptions(s,{silentJSONParsing:A.transitional(A.boolean),forcedJSONParsing:A.transitional(A.boolean),clarifyTimeoutError:A.transitional(A.boolean)},!1),r!=null&&(a.isFunction(r)?n.paramsSerializer={serialize:r}:re.assertOptions(r,{encode:A.function,serialize:A.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=R.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(f=f&&h.synchronous,c.unshift(h.fulfilled,h.rejected))});const p=[];this.interceptors.response.forEach(function(h){p.push(h.fulfilled,h.rejected)});let u,l=0,y;if(!f){const d=[Oe.bind(this),void 0];for(d.unshift.apply(d,c),d.push.apply(d,p),y=d.length,u=Promise.resolve(n);l{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const i=new Promise(c=>{s.subscribe(c),o=c}).then(r);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,c){s.reason||(s.reason=new k(o,i,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new he(function(r){t=r}),cancel:t}}}const wn=he;function Sn(e){return function(n){return e.apply(null,n)}}function _n(e){return a.isObject(e)&&e.isAxiosError===!0}const oe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(oe).forEach(([e,t])=>{oe[t]=e});const xn=oe;function Qe(e){const t=new M(e),n=Ne(M.prototype.request,t);return a.extend(n,M.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Qe(C(e,r))},n}const b=Qe(fe);b.Axios=M;b.CanceledError=k;b.CancelToken=wn;b.isCancel=We;b.VERSION=Xe;b.toFormData=V;b.AxiosError=m;b.Cancel=b.CanceledError;b.all=function(t){return Promise.all(t)};b.spread=Sn;b.isAxiosError=_n;b.mergeConfig=C;b.AxiosHeaders=R;b.formToJSON=e=>Ve(a.isHTMLForm(e)?new FormData(e):e);b.getAdapter=Ge.getAdapter;b.HttpStatusCode=xn;b.default=b;const L=b;class me{constructor(){this.baseURL="https://your-energy.b.goit.study/api/",this.page=0}resetPage(){this.page=0}async getExercises(t,n,s){try{return(await L.get(`${this.baseURL}exercises?${t}=${n}&page=${s}&limit=10`)).data}catch(r){console.log(r)}}async getSearch(t,n,s){try{return(await L.get(`${this.baseURL}exercises?${t}=${n}&keyword=${s}&page=1&limit=10`)).data.results}catch(r){console.log(r)}}async getExercisesById(t){try{return(await L.get(`${this.baseURL}exercises/${t}`)).data}catch(n){console.log(n)}}async getFilter(t,n){try{return(await L.get(`${this.baseURL}filters?filter=${t}&page=${n}&limit=12`)).data}catch(s){console.log(s)}}async getQuote(){try{return this.page+=1,(await L.get(`${this.baseURL}quote`)).data}catch(t){console.log(t)}}async patchRating(t,n){try{return this.page+=1,(await L.patch(`${this.baseURL}exercises/${t}/rating`,n)).data}catch(s){console.log(s)}}async postSubscriptions(t){try{return this.page+=1,(await L.post(`${this.baseURL}subscription`,t)).data}catch(n){console.log(n)}}}const Rn=document.querySelector(".js-quote"),On=new me;vn();async function vn(){const e=JSON.parse(localStorage.getItem("quoteDay")),n=new Date().toISOString().split("T")[0];if((e==null?void 0:e.currentDate)===n){Le(e.data);return}try{const s=await On.getQuote(),r={data:s,currentDate:n};localStorage.setItem("quoteDay",JSON.stringify(r)),Le(s)}catch(s){console.log(s)}}function Le({author:e,quote:t}){Rn.innerHTML=` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[_e]=this[_e]={accessors:{}}).accessors,r=this.prototype;function o(i){const c=P(i);s[c]||(cn(r,i),s[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}}W.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(W.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});a.freezeMethods(W);const O=W;function Z(e,t){const n=this||fe,s=t||n,r=O.from(s.headers);let o=s.data;return a.forEach(e,function(c){o=c.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function We(e){return!!(e&&e.__CANCEL__)}function k(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(k,m,{__CANCEL__:!0});function ln(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const un=_.hasStandardBrowserEnv?{write(e,t,n,s,r,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(s)&&i.push("path="+s),a.isString(r)&&i.push("domain="+r),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function dn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function fn(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Ke(e,t){return e&&!dn(t)?fn(e,t):t}const pn=_.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let s;function r(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=r(window.location.href),function(i){const c=a.isString(i)?r(i):i;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}();function hn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mn(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const p=Date.now(),u=s[o];i||(i=p),n[r]=f,s[r]=p;let l=o,y=0;for(;l!==r;)y+=n[l++],l=l%e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),p-i{const o=r.loaded,i=r.lengthComputable?r.total:void 0,c=o-n,f=s(c),p=o<=i;n=o;const u={loaded:o,total:i,progress:i?o/i:void 0,bytes:c,rate:f||void 0,estimated:f&&i&&p?(i-o)/f:void 0,event:r};u[t?"download":"upload"]=!0,e(u)}}const yn=typeof XMLHttpRequest<"u",bn=yn&&function(e){return new Promise(function(n,s){let r=e.data;const o=O.from(e.headers).normalize();let{responseType:i,withXSRFToken:c}=e,f;function p(){e.cancelToken&&e.cancelToken.unsubscribe(f),e.signal&&e.signal.removeEventListener("abort",f)}let u;if(a.isFormData(r)){if(_.hasStandardBrowserEnv||_.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((u=o.getContentType())!==!1){const[h,...E]=u?u.split(";").map(w=>w.trim()).filter(Boolean):[];o.setContentType([h||"multipart/form-data",...E].join("; "))}}let l=new XMLHttpRequest;if(e.auth){const h=e.auth.username||"",E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(h+":"+E))}const y=Ke(e.baseURL,e.url);l.open(e.method.toUpperCase(),He(y,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function g(){if(!l)return;const h=O.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),w={data:!i||i==="text"||i==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:h,config:e,request:l};ln(function(v){n(v),p()},function(v){s(v),p()},w),l=null}if("onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){l&&(s(new m("Request aborted",m.ECONNABORTED,e,l)),l=null)},l.onerror=function(){s(new m("Network Error",m.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let E=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const w=e.transitional||Je;e.timeoutErrorMessage&&(E=e.timeoutErrorMessage),s(new m(E,w.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,l)),l=null},_.hasStandardBrowserEnv&&(c&&a.isFunction(c)&&(c=c(e)),c||c!==!1&&pn(y))){const h=e.xsrfHeaderName&&e.xsrfCookieName&&un.read(e.xsrfCookieName);h&&o.set(e.xsrfHeaderName,h)}r===void 0&&o.setContentType(null),"setRequestHeader"in l&&a.forEach(o.toJSON(),function(E,w){l.setRequestHeader(w,E)}),a.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),i&&i!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",xe(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",xe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(f=h=>{l&&(s(!h||h.type?new k(null,e,l):h),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(f),e.signal&&(e.signal.aborted?f():e.signal.addEventListener("abort",f)));const d=hn(y);if(d&&_.protocols.indexOf(d)===-1){s(new m("Unsupported protocol "+d+":",m.ERR_BAD_REQUEST,e));return}l.send(r||null)})},se={http:It,xhr:bn};a.forEach(se,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Oe=e=>`- ${e}`,gn=e=>a.isFunction(e)||e===null||e===!1,Ge={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,s;const r={};for(let o=0;o`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since : +`+o.map(Oe).join(` +`):" "+Oe(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return s},adapters:se};function Y(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new k(null,e)}function Re(e){return Y(e),e.headers=O.from(e.headers),e.data=Z.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ge.getAdapter(e.adapter||fe.adapter)(e).then(function(s){return Y(e),s.data=Z.call(e,e.transformResponse,s),s.headers=O.from(s.headers),s},function(s){return We(s)||(Y(e),s&&s.response&&(s.response.data=Z.call(e,e.transformResponse,s.response),s.response.headers=O.from(s.response.headers))),Promise.reject(s)})}const ve=e=>e instanceof O?e.toJSON():e;function N(e,t){t=t||{};const n={};function s(p,u,l){return a.isPlainObject(p)&&a.isPlainObject(u)?a.merge.call({caseless:l},p,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function r(p,u,l){if(a.isUndefined(u)){if(!a.isUndefined(p))return s(void 0,p,l)}else return s(p,u,l)}function o(p,u){if(!a.isUndefined(u))return s(void 0,u)}function i(p,u){if(a.isUndefined(u)){if(!a.isUndefined(p))return s(void 0,p)}else return s(void 0,u)}function c(p,u,l){if(l in t)return s(p,u);if(l in e)return s(void 0,p)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(p,u)=>r(ve(p),ve(u),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(u){const l=f[u]||r,y=l(e[u],t[u],u);a.isUndefined(y)&&l!==c||(n[u]=y)}),n}const Xe="1.6.2",pe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{pe[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ae={};pe.transitional=function(t,n,s){function r(o,i){return"[Axios v"+Xe+"] Transitional option '"+o+"'"+i+(s?". "+s:"")}return(o,i,c)=>{if(t===!1)throw new m(r(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!Ae[i]&&(Ae[i]=!0,console.warn(r(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function En(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const o=s[r],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new m("option "+o+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const re={assertOptions:En,validators:pe},A=re.validators;class M{constructor(t){this.defaults=t,this.interceptors={request:new Se,response:new Se}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=N(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&re.assertOptions(s,{silentJSONParsing:A.transitional(A.boolean),forcedJSONParsing:A.transitional(A.boolean),clarifyTimeoutError:A.transitional(A.boolean)},!1),r!=null&&(a.isFunction(r)?n.paramsSerializer={serialize:r}:re.assertOptions(r,{encode:A.function,serialize:A.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=O.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(f=f&&h.synchronous,c.unshift(h.fulfilled,h.rejected))});const p=[];this.interceptors.response.forEach(function(h){p.push(h.fulfilled,h.rejected)});let u,l=0,y;if(!f){const d=[Re.bind(this),void 0];for(d.unshift.apply(d,c),d.push.apply(d,p),y=d.length,u=Promise.resolve(n);l{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const i=new Promise(c=>{s.subscribe(c),o=c}).then(r);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,c){s.reason||(s.reason=new k(o,i,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new he(function(r){t=r}),cancel:t}}}const wn=he;function Sn(e){return function(n){return e.apply(null,n)}}function _n(e){return a.isObject(e)&&e.isAxiosError===!0}const oe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(oe).forEach(([e,t])=>{oe[t]=e});const xn=oe;function Qe(e){const t=new I(e),n=Ce(I.prototype.request,t);return a.extend(n,I.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Qe(N(e,r))},n}const b=Qe(fe);b.Axios=I;b.CanceledError=k;b.CancelToken=wn;b.isCancel=We;b.VERSION=Xe;b.toFormData=V;b.AxiosError=m;b.Cancel=b.CanceledError;b.all=function(t){return Promise.all(t)};b.spread=Sn;b.isAxiosError=_n;b.mergeConfig=N;b.AxiosHeaders=O;b.formToJSON=e=>Ve(a.isHTMLForm(e)?new FormData(e):e);b.getAdapter=Ge.getAdapter;b.HttpStatusCode=xn;b.default=b;const L=b;class me{constructor(){this.baseURL="https://your-energy.b.goit.study/api/",this.page=0}resetPage(){this.page=0}async getExercises(t,n,s){try{return(await L.get(`${this.baseURL}exercises?${t}=${n}&page=${s}&limit=10`)).data}catch(r){console.log(r)}}async getSearch(t,n,s){try{return(await L.get(`${this.baseURL}exercises?${t}=${n}&keyword=${s}&page=1&limit=10`)).data.results}catch(r){console.log(r)}}async getExercisesById(t){try{return(await L.get(`${this.baseURL}exercises/${t}`)).data}catch(n){console.log(n)}}async getFilter(t,n){try{return(await L.get(`${this.baseURL}filters?filter=${t}&page=${n}&limit=12`)).data}catch(s){console.log(s)}}async getQuote(){try{return this.page+=1,(await L.get(`${this.baseURL}quote`)).data}catch(t){console.log(t)}}async patchRating(t,n){try{return this.page+=1,(await L.patch(`${this.baseURL}exercises/${t}/rating`,n)).data}catch(s){console.log(s)}}async postSubscriptions(t){try{return this.page+=1,(await L.post(`${this.baseURL}subscription`,t)).data}catch(n){console.log(n)}}}const On=document.querySelector(".js-quote"),Rn=new me;vn();async function vn(){const e=JSON.parse(localStorage.getItem("quoteDay")),n=new Date().toISOString().split("T")[0];if((e==null?void 0:e.currentDate)===n){Le(e.data);return}try{const s=await Rn.getQuote(),r={data:s,currentDate:n};localStorage.setItem("quoteDay",JSON.stringify(r)),Le(s)}catch(s){console.log(s)}}function Le({author:e,quote:t}){On.innerHTML=`

${t}

${e}

- `}const An=new me,Ln=document.querySelector(".modal-exercises");Ln.addEventListener("click",Tn);let ee=[];async function Tn(e){if(e.target.closest(".modal-exercises__btn-favorites"))try{const t=e.target.closest(".modal-exercises__btn-favorites").getAttribute("data-id"),n=await An.getExercisesById(t),s=JSON.parse(localStorage.getItem("exerciseData"));s!=null&&s.some(r=>r._id===n._id)?ee=s.filter(r=>r._id!==n._id):ee.push(n),localStorage.setItem("exerciseData",JSON.stringify(ee))}catch(t){console.log(t)}}const T="/your-energy/assets/sprite-ea467297.svg",B=document.querySelector(".js-list");B.addEventListener("click",Cn);function Cn(e){if(!e.target.closest(".js-remove-btn"))return;const t=e.target.closest(".js-remove-btn").getAttribute("data-id"),s=JSON.parse(localStorage.getItem("exerciseData")).filter(r=>r._id!==t);localStorage.setItem("exerciseData",JSON.stringify(s)),ie()}function ie(){const e=JSON.parse(localStorage.getItem("exerciseData"));if(e.length===0){B.innerHTML="";const t=` + `}const An=new me,Ln=document.querySelector(".modal-exercises");Ln.addEventListener("click",Tn);let ee=JSON.parse(localStorage.getItem("exerciseData"))||[];async function Tn(e){if(e.target.closest(".modal-exercises__btn-favorites"))try{const t=e.target.closest(".modal-exercises__btn-favorites").getAttribute("data-id"),n=await An.getExercisesById(t),s=JSON.parse(localStorage.getItem("exerciseData"));s!=null&&s.some(r=>r._id===n._id)?ee=s.filter(r=>r._id!==n._id):ee.push(n),localStorage.setItem("exerciseData",JSON.stringify(ee))}catch(t){console.log(t)}}const T="/your-energy/assets/sprite-ea467297.svg",B=document.querySelector(".js-list");B.addEventListener("click",Nn);function Nn(e){if(!e.target.closest(".js-remove-btn"))return;const t=e.target.closest(".js-remove-btn").getAttribute("data-id"),s=JSON.parse(localStorage.getItem("exerciseData")).filter(r=>r._id!==t);localStorage.setItem("exerciseData",JSON.stringify(s)),ie()}function ie(){const e=JSON.parse(localStorage.getItem("exerciseData"));if(e.length===0){B.innerHTML="";const t=`
  • It appears that you haven't added any exercises to your favorites yet. To get started, you can add exercises that you like to your @@ -43,11 +43,11 @@

    Target:${i}

    -
  • `).join("");B.insertAdjacentHTML("beforeend",t)}}const Te="/your-energy/assets/modal-exercise-image-3ecfcf3d.jpg",Nn="/your-energy/assets/modal-exercise-image@2x-88eeae48.jpg",Pn=new me;let F=!1,Ze;const K=document.querySelector(".modal-exercises"),q=document.querySelector(".overlay"),Bn=document.querySelector(".js-list");Bn.addEventListener("click",Fn);async function Fn(e){if(e.target.closest(".card__btn"))try{const t=e.target.closest(".card__btn").getAttribute("data-id"),n=await Pn.getExercisesById(t);Ze=t;const s=jn(n);$n(s),Dn(),document.querySelector(".modal-exercises__btn-favorites").addEventListener("click",Mn),document.querySelector(".modal-exercises__btn-close").addEventListener("click",ye)}catch(t){console.log(t)}}function Dn(){const e=window.innerWidth-document.body.offsetWidth+"px";K.classList.remove("hidden"),q.classList.remove("hidden"),document.body.style.paddingRight=e,document.body.style.overflow="hidden"}function $n(e){K.innerHTML=e,Un()}function kn(e){const t="#EEA10C",n="#F4F4F4";let r="";for(let c=0;c<5;c++){const f=`starGradient${c}`,p=c+1<=e?100:c`).join("");B.insertAdjacentHTML("beforeend",t)}}const Te="/your-energy/assets/modal-exercise-image-3ecfcf3d.jpg",Cn="/your-energy/assets/modal-exercise-image@2x-88eeae48.jpg",Pn=new me;let F=!1,Ze;const K=document.querySelector(".modal-exercises"),q=document.querySelector(".overlay"),Bn=document.querySelector(".js-list");Bn.addEventListener("click",Fn);async function Fn(e){if(e.target.closest(".card__btn"))try{const t=e.target.closest(".card__btn").getAttribute("data-id"),n=await Pn.getExercisesById(t);Ze=t;const s=jn(n);$n(s),Dn(),document.querySelector(".modal-exercises__btn-favorites").addEventListener("click",In),document.querySelector(".modal-exercises__btn-close").addEventListener("click",ye)}catch(t){console.log(t)}}function Dn(){const e=window.innerWidth-document.body.offsetWidth+"px";K.classList.remove("hidden"),q.classList.remove("hidden"),document.body.style.paddingRight=e,document.body.style.overflow="hidden"}function $n(e){K.innerHTML=e,Un()}function kn(e){const t="#EEA10C",n="#F4F4F4";let r="";for(let c=0;c<5;c++){const f=`starGradient${c}`,p=c+1<=e?100:c ${u.map(g=>``).join("")} - `,y=`url(#${f})`;r+=`${l}`}return`${Number.isInteger(e)?`${e}.0`:e.toFixed(1)} ${r}`}function jn({_id:e,bodyPart:t,equipment:n,gifUrl:s,name:r,target:o,description:i,rating:c,burnedCalories:f,time:p,popularity:u}){const l=y(s);function y(d){return d===null||!d?`srcset = '${Te} 1x,${Nn} 2x' + `,y=`url(#${f})`;r+=`${l}`}return`${Number.isInteger(e)?`${e}.0`:e.toFixed(1)} ${r}`}function jn({_id:e,bodyPart:t,equipment:n,gifUrl:s,name:r,target:o,description:i,rating:c,burnedCalories:f,time:p,popularity:u}){const l=y(s);function y(d){return d===null||!d?`srcset = '${Te} 1x,${Cn} 2x' src = '${Te}'`:`src="${d}"`}const g=kn(c);return` -`}function Un(){const e=JSON.parse(localStorage.getItem("exerciseData")),t=document.querySelector(".modal-exercises__btn-favorites");e!=null&&e.some(n=>n._id===Ze)?(F=!0,t.innerHTML=et()):(F=!1,t.innerHTML=Ye())}function Mn(){F=!F;const e=document.querySelector(".modal-exercises__btn-favorites"),t=document.querySelector(".favorites__list");F?(e.innerHTML=et(),t==null?console.log(""):setTimeout(()=>{ie()},100)):(e.innerHTML=Ye(),t==null?console.log(""):setTimeout(()=>{ie()},100))}function Ye(){return` +`}function Un(){const e=JSON.parse(localStorage.getItem("exerciseData")),t=document.querySelector(".modal-exercises__btn-favorites");e!=null&&e.some(n=>n._id===Ze)?(F=!0,t.innerHTML=et()):(F=!1,t.innerHTML=Ye())}function In(){F=!F;const e=document.querySelector(".modal-exercises__btn-favorites"),t=document.querySelector(".favorites__list");F?(e.innerHTML=et(),t==null?console.log(""):setTimeout(()=>{ie()},100)):(e.innerHTML=Ye(),t==null?console.log(""):setTimeout(()=>{ie()},100))}function Ye(){return` Add to favorites diff --git a/assets/favorites-3a77b26a.js b/assets/favorites-cd2b8eb0.js similarity index 97% rename from assets/favorites-3a77b26a.js rename to assets/favorites-cd2b8eb0.js index f29746f..3651507 100644 --- a/assets/favorites-3a77b26a.js +++ b/assets/favorites-cd2b8eb0.js @@ -1,4 +1,4 @@ -import{i as o}from"./05-modal-exercises-e1c62cac.js";const l=document.querySelector(".favorites__list"),d=document.getElementById("favoritesButton");d.addEventListener("click",v());function v(){const t=JSON.parse(localStorage.getItem("exerciseData"));if(!(t==null||t.length===0)){l.innerHTML="";const s=t.map(({_id:a,name:i,burnedCalories:r,bodyPart:c,target:e})=>` +import{i as o}from"./05-modal-exercises-63285a5c.js";const l=document.querySelector(".favorites__list"),d=document.getElementById("favoritesButton");d.addEventListener("click",v());function v(){const t=JSON.parse(localStorage.getItem("exerciseData"));if(!(t==null||t.length===0)){l.innerHTML="";const s=t.map(({_id:a,name:i,burnedCalories:r,bodyPart:c,target:e})=>`
  • diff --git a/assets/index-e5893753.js b/assets/index-a3e73dcf.js similarity index 99% rename from assets/index-e5893753.js rename to assets/index-a3e73dcf.js index 7f1dc75..45c5d80 100644 --- a/assets/index-e5893753.js +++ b/assets/index-a3e73dcf.js @@ -1,4 +1,4 @@ -import{A as V,i as D,a as Ee}from"./05-modal-exercises-e1c62cac.js";const we=new V,P=document.querySelector(".js-list"),ee=document.getElementById("pagination-numbers");let S=1;$("Muscles",S);async function $(r,c){try{const{results:f,totalPages:l}=await we.getFilter(r,c);Ie({results:f,totalPages:l}),Ce(f)}catch(f){console.log(f)}}function Ce(r){P.innerHTML="";const c=r.map(({filter:f,name:l,imgURL:n})=>` +import{A as V,i as D,a as Ee}from"./05-modal-exercises-63285a5c.js";const we=new V,P=document.querySelector(".js-list"),ee=document.getElementById("pagination-numbers");let S=1;$("Muscles",S);async function $(r,c){try{const{results:f,totalPages:l}=await we.getFilter(r,c);Ie({results:f,totalPages:l}),Ce(f)}catch(f){console.log(f)}}function Ce(r){P.innerHTML="";const c=r.map(({filter:f,name:l,imgURL:n})=>`
  • diff --git a/favorites.html b/favorites.html index a5240d6..5d3655d 100644 --- a/favorites.html +++ b/favorites.html @@ -14,8 +14,8 @@ /> Your Energy - - + + diff --git a/index.html b/index.html index 4aef56c..bb25bd4 100644 --- a/index.html +++ b/index.html @@ -14,8 +14,8 @@ /> Your Energy - - + +