@apolitical/sdk 12.2.0-ent-211.0 → 12.2.1-ra0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/index.js +1 -1
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/gtm"),require("http-status-codes"),require("socket.io-client"),require("buffer")):"function"==typeof define&&define.amd?define(["@apolitical/content","@apolitical/error-reporting","@apolitical/gtm","http-status-codes","socket.io-client","buffer"],t):"object"==typeof exports?exports.ApoliticalSDK=t(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/gtm"),require("http-status-codes"),require("socket.io-client"),require("buffer")):e.ApoliticalSDK=t(e["@apolitical/content"],e["@apolitical/error-reporting"],e["@apolitical/gtm"],e["http-status-codes"],e["socket.io-client"],e.buffer)}(this,(e,t,r,n,s,o)=>(()=>{"use strict";var i={584:t=>{t.exports=e},568:e=>{e.exports=t},59:e=>{e.exports=r},18:e=>{e.exports=o},606:e=>{e.exports=n},443:e=>{e.exports=s}},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return i[e](r,r.exports,c),r.exports}c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};c.r(l),c.d(l,{assets:()=>rr,auth:()=>ar,badges:()=>to,buildAnswer:()=>Vo,buildCardCtaClickHandler:()=>Ho,buildCarouselCard:()=>Go,buildQuestion:()=>Po,carouselCards:()=>oo,communities:()=>Dr,contentInteraction:()=>Cr,decodeBase64:()=>Jo,default:()=>zo,editorialPages:()=>uo,getEntries:()=>p.getEntries,getEntry:()=>p.getEntry,management:()=>Qr,mgmt:()=>an,payments:()=>dn,people:()=>Os,peopleEngagement:()=>Ds,qaQuestions:()=>wo,reportError:()=>f.reportError,search:()=>Hs,useMaps:()=>No});var u={};c.r(u),c.d(u,{hasBrowserEnv:()=>ke,hasStandardBrowserEnv:()=>Me,hasStandardBrowserWebWorkerEnv:()=>Fe,navigator:()=>xe,origin:()=>qe});var d={};c.r(d),c.d(d,{read:()=>Vs,remove:()=>Ys,stream:()=>Ks});var p=c(584),f=c(568),h=c(59);const E={APOLITICAL:{WEBSITES:{LIVE:"https://apolitical.co",LOCALHOST:"localhost",STAGING:/https:\/\/([\w|\d|-]+)\.apolitical\.co/i,STAGING_SPLITTER:"-"},ENVIRONMENTS:{PRODUCTION:"live",LOCAL:"local"}},APIS:{ASSETS_API:{BASE_URL:"/api/assets-api",ENDPOINTS:{USERS:"/users",CERTIFICATES:"/certificates",PROFILE_IMAGES:"/profile-images",LINK_PREVIEWS:"/link-previews"}},AUTH_API:{BASE_URL:"/api/auth-api",ENDPOINTS:{USER_PASSWORD:"/password",USERS:"/users"}},CONTENT_INTERACTION_API:{BASE_URL:"/api/content-interaction-api",ENDPOINTS:{QUESTIONS:"/questions",ANSWERS:"/answers",REPLIES:"/replies",LIKES:"/likes"}},COMMUNITIES_API:{BASE_URL:"/api/communities-api",ENDPOINTS:{COMMUNITIES:"/me/communities"}},MANAGEMENT_API:{BASE_URL:"/api/management-api",ENDPOINTS:{ACCOUNTS:"/accounts",EVENT_REGISTRATIONS:"/event-registrations",LOGINS:"/logins",LOGIN_PASSWORDLESS:"/passwordless",BULK_ENROLMENTS:"/bulk-enrolments",PROFILE:"/users/me/profile"}},MGMT_API:{BASE_URL:"/api/mgmt-api",ENDPOINTS:{REFERRALS:"/referrals",BULK_REFERRALS:"/bulk-referrals",BULK_ENROLMENTS:"/bulk-enrolments"}},PAYMENTS_API:{BASE_URL:"/api/payments-api",BASE_URL_V2:"/api/payments-api/v2",ENDPOINTS:{PRODUCTS:"/products"}},PEOPLE_API:{BASE_URL:"/api/people-api",BASE_URL_V2:"/api/people-api/v2",ENDPOINTS:{BULK_ENROLMENTS:"/bulk-enrolments",COMMUNITIES:"/communities",REGISTRATIONS:"/registrations",USERS:"/users",USER_ANSWERS:"/answers",USER_COURSES:"/courses",USER_EVENTS:"/events",USER_LIKES:"/likes",USER_LESSONS:"/lessons",USER_PRODUCTS:"/products",USER_RATINGS:"/ratings",USER_REFERRALS:"/referrals",USER_SUBSCRIPTIONS:"/subscriptions"}},PEOPLE_ENGAGEMENT_API:{BASE_URL:"/api/people-engagement-api",ENDPOINTS:{ENQUIRY_EMAILS:"/enquiry-emails",USERS:"/users",USER_PROPERTIES:"/properties"}},SEARCH_API:{BASE_URL:"/api/search-api",ENDPOINTS:{AI_SEARCH:"/ai-search",CHATBOT:{COURSES:"/chatbot/me/courses"}}}},CONTENTFUL:{ARTICLES:{TYPE:"solutionArticle"},BADGES:{TYPE:"badge",INCLUDE:0,LIMIT:1e3,SELECT:"fields.name,fields.slug,fields.description,fields.icon,fields.colour",SKIP:0},CAROUSELS:{CARD_TYPES:{communityPage:{INCLUDE:1,SELECT:"fields.image,fields.slug,fields.title"},customCard:{INCLUDE:1,SELECT:"fields.icon,fields.label,fields.image,fields.primaryText,fields.secondaryText,fields.authorName,fields.authorImage,fields.link,fields.openInNewTab"},solutionArticle:{INCLUDE:1,SELECT:"fields.authorIds,fields.authorTag,fields.image,fields.coverImage,fields.publishedDate,fields.readingTime,fields.slug,fields.title"},courseJourney:{INCLUDE:1,SELECT:"fields.bannerImage,fields.slug,fields.title,fields.accessPrivacy,fields.partnerLogos"},microcourse:{INCLUDE:2,SELECT:"fields.banner,fields.freeCourse,fields.partnershipDetails,fields.slug,fields.title,fields.courseType"},event:{INCLUDE:1,SELECT:"fields.bannerImage,fields.defaultStartDate,fields.slug,fields.speakers,fields.title,fields.isEventOngoing"},listPage:{INCLUDE:1,SELECT:"fields.hero,fields.slug,fields.title"},qaQuestion:{INCLUDE:0,SELECT:"fields.answers,fields.authorId,fields.slug,fields.title,sys.createdAt,fields.projectNames"},learningHub:{INCLUDE:1,SELECT:"fields.bannerSection,fields.customLabel,fields.slug,fields.title"}}},COMMUNITY:{TYPE:"communityPage"},COURSES:{TYPE:"microcourse"},COURSE_JOURNEYS:{TYPE:"courseJourney"},CUSTOM_CARD:{TYPE:"customCard"},EDITORIAL_PAGES:{INCLUDE:1,SELECT:"fields.carousels,fields.slug,fields.showCarouselCta,fields.header,fields.subHeader",TYPE:"editorialPage"},EVENTS:{TYPE:"event"},LISTS:{TYPE:"listPage"},QUESTIONS:{TYPE:"qaQuestion",INCLUDE:1,LIMIT:10,ORDER:"-fields.postedAt",SELECT:"sys.updatedAt,fields.postedAt,fields.title,fields.slug,fields.authorId,fields.answers,fields.isEdited,fields.projectNames",SKIP:0},ANSWERS:{TYPE:"qaAnswer"},REPLIES:{TYPE:"reply"},LEARNING_HUB:{TYPE:"learningHub"}},GOOGLE:{MAPS:{LIBRARIES:{PLACES:"places",GEOCODING:"geocoding"},VERSION:"weekly"}},HUBSPOT:{ENVIRONMENTS_MAPPING:{local:"SANDBOX",beta:"SANDBOX",rc:"SANDBOX",live:"LIVE"},EMAIL_IDS:{SANDBOX:{internalEmailId:49099078634,externalEmailId:55196526554},LIVE:{internalEmailId:55233583049,externalEmailId:55231159239}}},USERS:{MYSELF:"me"},STATUS_CODES:{INVALID_TOKEN:498},ERROR_MESSAGES:{INVALID_TOKEN:"Invalid token error: Logging user out..."}},{HUBSPOT:{ENVIRONMENTS_MAPPING:S,EMAIL_IDS:g}}=E;let m={emailIds:{}};const w=({environment:e})=>{const t=(e=>{if(!e)throw new Error("Cannot map environment: Environment not defined");if(!S[e])throw new Error(`Cannot map environment: No mapping found for environment ${e}`);return S[e]})(e);m.emailIds=g[t]},y=({apiKey:e})=>{m.googleMaps={apiKey:e}},R=()=>m,{APOLITICAL:{WEBSITES:{LIVE:b,LOCALHOST:I,STAGING:A,STAGING_SPLITTER:T},ENVIRONMENTS:{PRODUCTION:O,LOCAL:N}}}=E,P=e=>{let t=null;e?t=e:"undefined"!=typeof window&&(t=window.origin||window.location.origin),t||new Error("Cannot select environment: Website not defined");let r=null;const n=t.match(A);return n?r=n[1].split(T)[0]:t===b?r=O:t.includes(I)&&(r=N),r||new Error(`Cannot select environment: No rule for website ${t}`),r};function L(e,t){return function(){return e.apply(t,arguments)}}const{toString:U}=Object.prototype,{getPrototypeOf:C}=Object,{iterator:_,toStringTag:v}=Symbol,$=(D=Object.create(null),e=>{const t=U.call(e);return D[t]||(D[t]=t.slice(8,-1).toLowerCase())});var D;const B=e=>(e=e.toLowerCase(),t=>$(t)===e),j=e=>t=>typeof t===e,{isArray:k}=Array,x=j("undefined");function M(e){return null!==e&&!x(e)&&null!==e.constructor&&!x(e.constructor)&&G(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const F=B("ArrayBuffer"),q=j("string"),G=j("function"),V=j("number"),K=e=>null!==e&&"object"==typeof e,Y=e=>{if("object"!==$(e))return!1;const t=C(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||v in e||_ in e)},H=B("Date"),W=B("File"),J=B("Blob"),z=B("FileList"),Q=B("URLSearchParams"),[X,Z,ee,te]=["ReadableStream","Request","Response","Headers"].map(B);function re(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),k(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(M(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let i;for(n=0;n<o;n++)i=s[n],t.call(null,e[i],i,e)}}function ne(e,t){if(M(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,s=r.length;for(;s-- >0;)if(n=r[s],t===n.toLowerCase())return n;return null}const se="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,oe=e=>!x(e)&&e!==se,ie=(ae="undefined"!=typeof Uint8Array&&C(Uint8Array),e=>ae&&e instanceof ae);var ae;const ce=B("HTMLFormElement"),le=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ue=B("RegExp"),de=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};re(r,(r,s)=>{let o;!1!==(o=t(r,s,e))&&(n[s]=o||r)}),Object.defineProperties(e,n)},pe=B("AsyncFunction"),fe=(he="function"==typeof setImmediate,Ee=G(se.postMessage),he?setImmediate:Ee?(Se=`axios@${Math.random()}`,ge=[],se.addEventListener("message",({source:e,data:t})=>{e===se&&t===Se&&ge.length&&ge.shift()()},!1),e=>{ge.push(e),se.postMessage(Se,"*")}):e=>setTimeout(e));var he,Ee,Se,ge;const me="undefined"!=typeof queueMicrotask?queueMicrotask.bind(se):"undefined"!=typeof process&&process.nextTick||fe,we={isArray:k,isArrayBuffer:F,isBuffer:M,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||G(e.append)&&("formdata"===(t=$(e))||"object"===t&&G(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&F(e.buffer),t},isString:q,isNumber:V,isBoolean:e=>!0===e||!1===e,isObject:K,isPlainObject:Y,isEmptyObject:e=>{if(!K(e)||M(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:X,isRequest:Z,isResponse:ee,isHeaders:te,isUndefined:x,isDate:H,isFile:W,isBlob:J,isRegExp:ue,isFunction:G,isStream:e=>K(e)&&G(e.pipe),isURLSearchParams:Q,isTypedArray:ie,isFileList:z,forEach:re,merge:function e(){const{caseless:t,skipUndefined:r}=oe(this)&&this||{},n={},s=(s,o)=>{const i=t&&ne(n,o)||o;Y(n[i])&&Y(s)?n[i]=e(n[i],s):Y(s)?n[i]=e({},s):k(s)?n[i]=s.slice():r&&x(s)||(n[i]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&re(arguments[e],s);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(re(t,(t,n)=>{r&&G(t)?e[n]=L(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let s,o,i;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&C(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:$,kindOfTest:B,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(k(e))return e;let t=e.length;if(!V(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[_]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:ce,hasOwnProperty:le,hasOwnProp:le,reduceDescriptors:de,freezeMethods:e=>{de(e,(t,r)=>{if(G(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];G(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return k(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ne,global:se,isContextDefined:oe,isSpecCompliantForm:function(e){return!!(e&&G(e.append)&&"FormData"===e[v]&&e[_])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(K(e)){if(t.indexOf(e)>=0)return;if(M(e))return e;if(!("toJSON"in e)){t[n]=e;const s=k(e)?[]:{};return re(e,(e,t)=>{const o=r(e,n+1);!x(o)&&(s[t]=o)}),t[n]=void 0,s}}return e};return r(e,0)},isAsyncFn:pe,isThenable:e=>e&&(K(e)||G(e))&&G(e.then)&&G(e.catch),setImmediate:fe,asap:me,isIterable:e=>null!=e&&G(e[_])};function ye(e,t,r,n,s){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),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}we.inherits(ye,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:we.toJSONObject(this.config),code:this.code,status:this.status}}});const Re=ye.prototype,be={};["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=>{be[e]={value:e}}),Object.defineProperties(ye,be),Object.defineProperty(Re,"isAxiosError",{value:!0}),ye.from=(e,t,r,n,s,o)=>{const i=Object.create(Re);we.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return ye.call(i,a,c,r,n,s),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const Ie=ye;function Ae(e){return we.isPlainObject(e)||we.isArray(e)}function Te(e){return we.endsWith(e,"[]")?e.slice(0,-2):e}function Oe(e,t,r){return e?e.concat(t).map(function(e,t){return e=Te(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const Ne=we.toFlatObject(we,{},null,function(e){return/^is[A-Z]/.test(e)}),Pe=function(e,t,r){if(!we.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=we.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!we.isUndefined(t[e])})).metaTokens,s=r.visitor||l,o=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&we.isSpecCompliantForm(t);if(!we.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(we.isDate(e))return e.toISOString();if(we.isBoolean(e))return e.toString();if(!a&&we.isBlob(e))throw new Ie("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(e)||we.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,s){let a=e;if(e&&!s&&"object"==typeof e)if(we.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(we.isArray(e)&&function(e){return we.isArray(e)&&!e.some(Ae)}(e)||(we.isFileList(e)||we.endsWith(r,"[]"))&&(a=we.toArray(e)))return r=Te(r),a.forEach(function(e,n){!we.isUndefined(e)&&null!==e&&t.append(!0===i?Oe([r],n,o):null===i?r:r+"[]",c(e))}),!1;return!!Ae(e)||(t.append(Oe(s,r,o),c(e)),!1)}const u=[],d=Object.assign(Ne,{defaultVisitor:l,convertValue:c,isVisitable:Ae});if(!we.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!we.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),we.forEach(r,function(r,o){!0===(!(we.isUndefined(r)||null===r)&&s.call(t,r,we.isString(o)?o.trim():o,n,d))&&e(r,n?n.concat(o):[o])}),u.pop()}}(e),t};function Le(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Ue(e,t){this._pairs=[],e&&Pe(e,this,t)}const Ce=Ue.prototype;Ce.append=function(e,t){this._pairs.push([e,t])},Ce.toString=function(e){const t=e?function(t){return e.call(this,t,Le)}:Le;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const _e=Ue;function ve(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $e(e,t,r){if(!t)return e;const n=r&&r.encode||ve;we.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let o;if(o=s?s(t,r):we.isURLSearchParams(t)?t.toString():new _e(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const De=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){we.forEach(this.handlers,function(t){null!==t&&e(t)})}},Be={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},je={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:_e,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ke="undefined"!=typeof window&&"undefined"!=typeof document,xe="object"==typeof navigator&&navigator||void 0,Me=ke&&(!xe||["ReactNative","NativeScript","NS"].indexOf(xe.product)<0),Fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,qe=ke&&window.location.href||"http://localhost",Ge={...u,...je},Ve=function(e){function t(e,r,n,s){let o=e[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=e.length;return o=!o&&we.isArray(n)?n.length:o,a?(we.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!i):(n[o]&&we.isObject(n[o])||(n[o]=[]),t(e,r,n[o],s)&&we.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}(n[o])),!i)}if(we.isFormData(e)&&we.isFunction(e.entries)){const r={};return we.forEachEntry(e,(e,n)=>{t(function(e){return we.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null},Ke={transitional:Be,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,s=we.isObject(e);if(s&&we.isHTMLForm(e)&&(e=new FormData(e)),we.isFormData(e))return n?JSON.stringify(Ve(e)):e;if(we.isArrayBuffer(e)||we.isBuffer(e)||we.isStream(e)||we.isFile(e)||we.isBlob(e)||we.isReadableStream(e))return e;if(we.isArrayBufferView(e))return e.buffer;if(we.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Pe(e,new Ge.classes.URLSearchParams,{visitor:function(e,t,r,n){return Ge.isNode&&we.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=we.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Pe(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||n?(t.setContentType("application/json",!1),function(e){if(we.isString(e))try{return(0,JSON.parse)(e),we.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ke.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(we.isResponse(e)||we.isReadableStream(e))return e;if(e&&we.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw Ie.from(e,Ie.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ge.classes.FormData,Blob:Ge.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};we.forEach(["delete","get","head","post","put","patch"],e=>{Ke.headers[e]={}});const Ye=Ke,He=we.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"]),We=Symbol("internals");function Je(e){return e&&String(e).trim().toLowerCase()}function ze(e){return!1===e||null==e?e:we.isArray(e)?e.map(ze):String(e)}function Qe(e,t,r,n,s){return we.isFunction(n)?n.call(this,t,r):(s&&(t=r),we.isString(t)?we.isString(n)?-1!==t.indexOf(n):we.isRegExp(n)?n.test(t):void 0:void 0)}class Xe{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function s(e,t,r){const s=Je(t);if(!s)throw new Error("header name must be a non-empty string");const o=we.findKey(n,s);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=ze(e))}const o=(e,t)=>we.forEach(e,(e,r)=>s(e,r,t));if(we.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(we.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),r=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!r||t[r]&&He[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(we.isObject(e)&&we.isIterable(e)){let r,n,s={};for(const t of e){if(!we.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[n=t[0]]=(r=s[n])?we.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}o(s,t)}else null!=e&&s(t,e,r);return this}get(e,t){if(e=Je(e)){const r=we.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(we.isFunction(t))return t.call(this,e,r);if(we.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Je(e)){const r=we.findKey(this,e);return!(!r||void 0===this[r]||t&&!Qe(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function s(e){if(e=Je(e)){const s=we.findKey(r,e);!s||t&&!Qe(0,r[s],s,t)||(delete r[s],n=!0)}}return we.isArray(e)?e.forEach(s):s(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const s=t[r];e&&!Qe(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,r={};return we.forEach(this,(n,s)=>{const o=we.findKey(r,s);if(o)return t[o]=ze(n),void delete t[s];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(s):String(s).trim();i!==s&&delete t[s],t[i]=ze(n),r[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return we.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&we.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[We]=this[We]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Je(e);t[n]||(function(e,t){const r=we.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,s){return this[n].call(this,t,e,r,s)},configurable:!0})})}(r,e),t[n]=!0)}return we.isArray(e)?e.forEach(n):n(e),this}}Xe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),we.reduceDescriptors(Xe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),we.freezeMethods(Xe);const Ze=Xe;function et(e,t){const r=this||Ye,n=t||r,s=Ze.from(n.headers);let o=n.data;return we.forEach(e,function(e){o=e.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function tt(e){return!(!e||!e.__CANCEL__)}function rt(e,t,r){Ie.call(this,null==e?"canceled":e,Ie.ERR_CANCELED,t,r),this.name="CanceledError"}we.inherits(rt,Ie,{__CANCEL__:!0});const nt=rt;function st(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Ie("Request failed with status code "+r.status,[Ie.ERR_BAD_REQUEST,Ie.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const ot=(e,t,r=3)=>{let n=0;const s=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s,o=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=n[i];s||(s=c),r[o]=a,n[o]=c;let u=i,d=0;for(;u!==o;)d+=r[u++],u%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let r,n,s=0,o=1e3/t;const i=(t,o=Date.now())=>{s=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=o?i(e,t):(r=e,n||(n=setTimeout(()=>{n=null,i(r)},o-a)))},()=>r&&i(r)]}(r=>{const o=r.loaded,i=r.lengthComputable?r.total:void 0,a=o-n,c=s(a);n=o,e({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})},r)},it=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},at=e=>(...t)=>we.asap(()=>e(...t)),ct=Ge.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Ge.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Ge.origin),Ge.navigator&&/(msie|trident)/i.test(Ge.navigator.userAgent)):()=>!0,lt=Ge.hasStandardBrowserEnv?{write(e,t,r,n,s,o){const i=[e+"="+encodeURIComponent(t)];we.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),we.isString(n)&&i.push("path="+n),we.isString(s)&&i.push("domain="+s),!0===o&&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:()=>null,remove(){}};function ut(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const dt=e=>e instanceof Ze?{...e}:e;function pt(e,t){t=t||{};const r={};function n(e,t,r,n){return we.isPlainObject(e)&&we.isPlainObject(t)?we.merge.call({caseless:n},e,t):we.isPlainObject(t)?we.merge({},t):we.isArray(t)?t.slice():t}function s(e,t,r,s){return we.isUndefined(t)?we.isUndefined(e)?void 0:n(void 0,e,0,s):n(e,t,0,s)}function o(e,t){if(!we.isUndefined(t))return n(void 0,t)}function i(e,t){return we.isUndefined(t)?we.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,s,o){return o in t?n(r,s):o in e?n(void 0,r):void 0}const c={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:a,headers:(e,t,r)=>s(dt(e),dt(t),0,!0)};return we.forEach(Object.keys({...e,...t}),function(n){const o=c[n]||s,i=o(e[n],t[n],n);we.isUndefined(i)&&o!==a||(r[n]=i)}),r}const ft=e=>{const t=pt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=Ze.from(i),t.url=$e(ut(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),we.isFormData(r))if(Ge.hasStandardBrowserEnv||Ge.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(we.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&i.set(e,r)})}if(Ge.hasStandardBrowserEnv&&(n&&we.isFunction(n)&&(n=n(t)),n||!1!==n&&ct(t.url))){const e=s&&o&&lt.read(o);e&&i.set(s,e)}return t},ht="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=ft(e);let s=n.data;const o=Ze.from(n.headers).normalize();let i,a,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=n;function h(){l&&l(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let E=new XMLHttpRequest;function S(){if(!E)return;const n=Ze.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders());st(function(e){t(e),h()},function(e){r(e),h()},{data:d&&"text"!==d&&"json"!==d?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:n,config:e,request:E}),E=null}E.open(n.method.toUpperCase(),n.url,!0),E.timeout=n.timeout,"onloadend"in E?E.onloadend=S:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(S)},E.onabort=function(){E&&(r(new Ie("Request aborted",Ie.ECONNABORTED,e,E)),E=null)},E.onerror=function(t){const n=t&&t.message?t.message:"Network Error",s=new Ie(n,Ie.ERR_NETWORK,e,E);s.event=t||null,r(s),E=null},E.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const s=n.transitional||Be;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new Ie(t,s.clarifyTimeoutError?Ie.ETIMEDOUT:Ie.ECONNABORTED,e,E)),E=null},void 0===s&&o.setContentType(null),"setRequestHeader"in E&&we.forEach(o.toJSON(),function(e,t){E.setRequestHeader(t,e)}),we.isUndefined(n.withCredentials)||(E.withCredentials=!!n.withCredentials),d&&"json"!==d&&(E.responseType=n.responseType),f&&([c,u]=ot(f,!0),E.addEventListener("progress",c)),p&&E.upload&&([a,l]=ot(p),E.upload.addEventListener("progress",a),E.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(i=t=>{E&&(r(!t||t.type?new nt(null,e,E):t),E.abort(),E=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===Ge.protocols.indexOf(g)?r(new Ie("Unsupported protocol "+g+":",Ie.ERR_BAD_REQUEST,e)):E.send(s||null)})},Et=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const s=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Ie?t:new nt(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,s(new Ie(`timeout ${t} of ms exceeded`,Ie.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:a}=n;return a.unsubscribe=()=>we.asap(i),a}},St=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,s=0;for(;s<r;)n=s+t,yield e.slice(s,n),s=n},gt=(e,t,r,n)=>{const s=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*St(r,t)}(e,t);let o,i=0,a=e=>{o||(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await s.next();if(t)return a(),void e.close();let o=n.byteLength;if(r){let e=i+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),s.return())},{highWaterMark:2})},{isFunction:mt}=we,wt=(({Request:e,Response:t})=>({Request:e,Response:t}))(we.global),{ReadableStream:yt,TextEncoder:Rt}=we.global,bt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},It=e=>{e=we.merge.call({skipUndefined:!0},wt,e);const{fetch:t,Request:r,Response:n}=e,s=t?mt(t):"function"==typeof fetch,o=mt(r),i=mt(n);if(!s)return!1;const a=s&&mt(yt),c=s&&("function"==typeof Rt?(l=new Rt,e=>l.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var l;const u=o&&a&&bt(()=>{let e=!1;const t=new r(Ge.origin,{body:new yt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=i&&a&&bt(()=>we.isReadableStream(new n("").body)),p={stream:d&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new Ie(`Response type '${e}' is not supported`,Ie.ERR_NOT_SUPPORT,r)})});return async e=>{let{url:s,method:i,data:a,signal:l,cancelToken:f,timeout:h,onDownloadProgress:E,onUploadProgress:S,responseType:g,headers:m,withCredentials:w="same-origin",fetchOptions:y}=ft(e),R=t||fetch;g=g?(g+"").toLowerCase():"text";let b=Et([l,f&&f.toAbortSignal()],h),I=null;const A=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let T;try{if(S&&u&&"get"!==i&&"head"!==i&&0!==(T=await(async(e,t)=>{const n=we.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(we.isBlob(e))return e.size;if(we.isSpecCompliantForm(e)){const t=new r(Ge.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return we.isArrayBufferView(e)||we.isArrayBuffer(e)?e.byteLength:(we.isURLSearchParams(e)&&(e+=""),we.isString(e)?(await c(e)).byteLength:void 0)})(t):n})(m,a))){let e,t=new r(s,{method:"POST",body:a,duplex:"half"});if(we.isFormData(a)&&(e=t.headers.get("content-type"))&&m.setContentType(e),t.body){const[e,r]=it(T,ot(at(S)));a=gt(t.body,65536,e,r)}}we.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in r.prototype,l={...y,signal:b,method:i.toUpperCase(),headers:m.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};I=o&&new r(s,l);let f=await(o?R(I,y):R(s,l));const h=d&&("stream"===g||"response"===g);if(d&&(E||h&&A)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=f[t]});const t=we.toFiniteNumber(f.headers.get("content-length")),[r,s]=E&&it(t,ot(at(E),!0))||[];f=new n(gt(f.body,65536,r,()=>{s&&s(),A&&A()}),e)}g=g||"text";let O=await p[we.findKey(p,g)||"text"](f,e);return!h&&A&&A(),await new Promise((t,r)=>{st(t,r,{data:O,headers:Ze.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:I})})}catch(t){if(A&&A(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Ie("Network Error",Ie.ERR_NETWORK,e,I),{cause:t.cause||t});throw Ie.from(t,t&&t.code,e,I)}}},At=new Map,Tt=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i,a,c=o.length,l=At;for(;c--;)i=o[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:It(t)),l=a;return a},Ot=(Tt(),{http:null,xhr:ht,fetch:{get:Tt}});we.forEach(Ot,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Nt=e=>`- ${e}`,Pt=e=>we.isFunction(e)||null===e||!1===e,Lt=(e,t)=>{e=we.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){let r;if(n=e[i],s=n,!Pt(n)&&(s=Ot[(r=String(n)).toLowerCase()],void 0===s))throw new Ie(`Unknown adapter '${r}'`);if(s&&(we.isFunction(s)||(s=s.get(t))))break;o[r||"#"+i]=s}if(!s){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=r?e.length>1?"since :\n"+e.map(Nt).join("\n"):" "+Nt(e[0]):"as no adapter specified";throw new Ie("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return s};function Ut(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nt(null,e)}function Ct(e){return Ut(e),e.headers=Ze.from(e.headers),e.data=et.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Lt(e.adapter||Ye.adapter,e)(e).then(function(t){return Ut(e),t.data=et.call(e,e.transformResponse,t),t.headers=Ze.from(t.headers),t},function(t){return tt(t)||(Ut(e),t&&t.response&&(t.response.data=et.call(e,e.transformResponse,t.response),t.response.headers=Ze.from(t.response.headers))),Promise.reject(t)})}const _t="1.12.2",vt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{vt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const $t={};vt.transitional=function(e,t,r){function n(e,t){return"[Axios v"+_t+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,s,o)=>{if(!1===e)throw new Ie(n(s," has been removed"+(t?" in "+t:"")),Ie.ERR_DEPRECATED);return t&&!$t[s]&&($t[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,s,o)}},vt.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const Dt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Ie("options must be an object",Ie.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],i=t[o];if(i){const t=e[o],r=void 0===t||i(t,o,e);if(!0!==r)throw new Ie("option "+o+" must be "+r,Ie.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Ie("Unknown option "+o,Ie.ERR_BAD_OPTION)}},validators:vt},Bt=Dt.validators;class jt{constructor(e){this.defaults=e||{},this.interceptors={request:new De,response:new De}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=pt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:s}=t;void 0!==r&&Dt.assertOptions(r,{silentJSONParsing:Bt.transitional(Bt.boolean),forcedJSONParsing:Bt.transitional(Bt.boolean),clarifyTimeoutError:Bt.transitional(Bt.boolean)},!1),null!=n&&(we.isFunction(n)?t.paramsSerializer={serialize:n}:Dt.assertOptions(n,{encode:Bt.function,serialize:Bt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Dt.assertOptions(t,{baseUrl:Bt.spelling("baseURL"),withXsrfToken:Bt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&we.merge(s.common,s[t.method]);s&&we.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=Ze.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[Ct.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let p=t;for(;d<u;){const e=i[d++],t=i[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=Ct.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return $e(ut((e=pt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}we.forEach(["delete","get","head","options"],function(e){jt.prototype[e]=function(t,r){return this.request(pt(r||{},{method:e,url:t,data:(r||{}).data}))}}),we.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,s){return this.request(pt(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}jt.prototype[e]=t(),jt.prototype[e+"Form"]=t(!0)});const kt=jt;class xt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,s){r.reason||(r.reason=new nt(e,n,s),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new xt(function(t){e=t}),cancel:e}}}const Mt=xt,Ft={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(Ft).forEach(([e,t])=>{Ft[t]=e});const qt=Ft,Gt=function e(t){const r=new kt(t),n=L(kt.prototype.request,r);return we.extend(n,kt.prototype,r,{allOwnKeys:!0}),we.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(pt(t,r))},n}(Ye);Gt.Axios=kt,Gt.CanceledError=nt,Gt.CancelToken=Mt,Gt.isCancel=tt,Gt.VERSION=_t,Gt.toFormData=Pe,Gt.AxiosError=Ie,Gt.Cancel=Gt.CanceledError,Gt.all=function(e){return Promise.all(e)},Gt.spread=function(e){return function(t){return e.apply(null,t)}},Gt.isAxiosError=function(e){return we.isObject(e)&&!0===e.isAxiosError},Gt.mergeConfig=pt,Gt.AxiosHeaders=Ze,Gt.formToJSON=e=>Ve(we.isHTMLForm(e)?new FormData(e):e),Gt.getAdapter=Lt,Gt.HttpStatusCode=qt,Gt.default=Gt;const Vt=Gt,Kt=async e=>{try{const{message:t,response:r,request:n}=e;let s=t;return r?s+=` - The request was made and the server responded with ${JSON.stringify({status:r.status,data:r.data})}`:n&&(s+=" - The request was made but no response was received"),console.warn(s),await(0,f.reportError)(new Error(s)),s}catch(e){return console.warn(`Cannot handle error: ${e.message}`),e.message}},{APIS:{ASSETS_API:{BASE_URL:Yt,ENDPOINTS:{USERS:Ht,CERTIFICATES:Wt}}}}=E,Jt={create:async(e,t)=>{let r=[];try{const{data:n}=await Vt.post(`${Yt}${Ht}/${e}${Wt}`,t);n&&(r=n)}catch(e){await Kt(e)}return r}},{APIS:{ASSETS_API:{BASE_URL:zt,ENDPOINTS:{USERS:Qt,PROFILE_IMAGES:Xt}}}}=E,Zt={create:async({userId:e,fileObject:t})=>{let r=[];try{if(!e)throw new Error("userSlug not found!");const n=new FormData;n.append("file",t);const{data:s}=await Vt.post(`${zt}${Qt}/${e}${Xt}`,n);s&&(r=s)}catch(e){await Kt(e)}return r}},{APIS:{ASSETS_API:{BASE_URL:er,ENDPOINTS:{LINK_PREVIEWS:tr}}}}=E,rr={certificates:Jt,profileImages:Zt,linkPreviews:{get:async e=>{let t={};try{if(!e)throw new Error("url not found!");const{data:r}=await Vt.get(`${er}${tr}/${encodeURIComponent(btoa(e))}`);r&&r.url&&(t=r)}catch(e){await Kt(e)}return t}}},{APIS:{AUTH_API:{BASE_URL:nr,ENDPOINTS:{USER_PASSWORD:sr,USERS:or}}},USERS:{MYSELF:ir}}=E,ar={userPassword:{update:async e=>{let t=null;try{t=await Vt.put(`${nr}${or}/${ir}${sr}`,e)}catch(e){t={message:(((e||{}).response||{}).data||{}).message},await Kt(e)}return t}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:cr,ENDPOINTS:{ANSWERS:lr,QUESTIONS:ur,LIKES:dr}}}}=E,pr=`${cr}${ur}`,fr={create:async({questionSlug:e},t)=>{try{await Vt.post(`${pr}/${encodeURIComponent(e)}${lr}`,t)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t})=>{try{await Vt.delete(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}`)}catch(e){const t=await Kt(e);throw new Error(t)}},update:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.put(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}`,r)}catch(e){const t=await Kt(e);throw new Error(t)}},like:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.post(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}${dr}`,r)}catch(e){const t=await Kt(e);throw new Error(t)}},unlike:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.delete(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}${dr}`)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:hr,ENDPOINTS:{QUESTIONS:Er}}}}=E,Sr=`${hr}${Er}`,gr={create:async e=>{try{return await Vt.post(Sr,e)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e})=>{try{await Vt.delete(`${Sr}/${encodeURIComponent(e)}`)}catch(e){const t=await Kt(e);throw new Error(t)}},update:async({questionSlug:e},t)=>{try{return await Vt.put(`${Sr}/${encodeURIComponent(e)}`,t)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:mr,ENDPOINTS:{REPLIES:wr,ANSWERS:yr,QUESTIONS:Rr,LIKES:br}}}}=E,Ir=`${mr}${Rr}`,Ar=({questionSlug:e,answerSlug:t,replySlug:r},n=!1)=>{let s=`${Ir}/${encodeURIComponent(e)}${yr}/${encodeURIComponent(t)}${wr}`;return r&&(s=`${s}/${encodeURIComponent(r)}`,n&&(s=`${s}${br}`)),s},Tr={create:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.post(Ar({questionSlug:e,answerSlug:t}),r)}catch(e){const t=await Kt(e);throw new Error(t)}},update:async({questionSlug:e,answerSlug:t,replySlug:r},n)=>{try{return await Vt.put(Ar({questionSlug:e,answerSlug:t,replySlug:r}),n)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t,replySlug:r})=>{try{await Vt.delete(Ar({questionSlug:e,answerSlug:t,replySlug:r}))}catch(e){const t=await Kt(e);throw new Error(t)}},like:async({questionSlug:e,answerSlug:t,replySlug:r,payload:n})=>{try{await Vt.post(Ar({questionSlug:e,answerSlug:t,replySlug:r},!0),n)}catch(e){const t=await Kt(e);throw new Error(t)}},unlike:async({questionSlug:e,answerSlug:t,replySlug:r})=>{try{await Vt.delete(Ar({questionSlug:e,answerSlug:t,replySlug:r},!0))}catch(e){const t=await Kt(e);throw new Error(t)}},getReplyUrl:Ar},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:Or,ENDPOINTS:{QUESTIONS:Nr,ANSWERS:Pr,LIKES:Lr}}}}=E,Ur=`${Or}${Nr}`,Cr={answers:fr,questions:gr,replies:Tr,likes:{create:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.post(`${Ur}/${encodeURIComponent(e)}${Pr}/${encodeURIComponent(t)}${Lr}`)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.delete(`${Ur}/${encodeURIComponent(e)}${Pr}/${encodeURIComponent(t)}${Lr}`)}catch(e){const t=await Kt(e);throw new Error(t)}}}},{APIS:{COMMUNITIES_API:{BASE_URL:_r,ENDPOINTS:{COMMUNITIES:vr}}}}=E,$r=`${_r}${vr}`,Dr={join:async e=>{let t=null;try{const{data:r}=await Vt.put(`${$r}/${encodeURIComponent(e)}/membership`,{});t=r}catch(e){await Kt(e)}return t}},{APIS:{MANAGEMENT_API:{BASE_URL:Br,ENDPOINTS:{ACCOUNTS:jr}}}}=E,kr={create:async e=>{try{await Vt.post(`${Br}${jr}`,e)}catch(e){throw await Kt(e),e}},read:async(e,t=null)=>{let r=null;try{const n=`${Br}${jr}/${encodeURIComponent(e)}`,s=t?{ref:t}:{};({data:r}=await Vt.get(n,{params:s}))}catch(e){await Kt(e)}return r},update:async(e,t)=>{try{await Vt.put(`${Br}${jr}/${encodeURIComponent(e)}`,t)}catch(e){throw await Kt(e),e}}},{APIS:{MANAGEMENT_API:{BASE_URL:xr,ENDPOINTS:{EVENT_REGISTRATIONS:Mr}}}}=E,Fr={create:async e=>{try{await Vt.post(`${xr}${Mr}`,e)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{MANAGEMENT_API:{BASE_URL:qr,ENDPOINTS:{LOGINS:Gr,LOGIN_PASSWORDLESS:Vr}}}}=E,Kr=`${qr}${Gr}`,Yr={update:async e=>{try{await Vt.put(`${Kr}/${encodeURIComponent(e)}${Vr}`)}catch(e){throw await Kt(e),e}}},{APIS:{MANAGEMENT_API:{BASE_URL:Hr}}}=E,Wr={create:async e=>{try{await Vt.post(`${Hr}/users/${e.id}/products`,e)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{MANAGEMENT_API:{BASE_URL:Jr,ENDPOINTS:{PROFILE:zr}}}}=E,Qr={accounts:kr,eventRegistrations:Fr,passwordless:Yr,userProducts:Wr,profile:{update:async e=>{try{const t=["name","jobTitle","organization","location","biography","image"];if(!Object.keys(e).some(e=>t.includes(e)))throw new Error("Profile data should include at least one of 'name', 'jobTitle', 'organization', 'location', 'biography', 'image'");await Vt.put(`${Jr}${zr}`,e)}catch(e){const t=await Kt(e);throw new Error(`An error occurred while trying to update the user's profile in the management api: ${t}`)}}}},{APIS:{MGMT_API:{BASE_URL:Xr,ENDPOINTS:{REFERRALS:Zr}}}}=E,en={create:async e=>{try{await Vt.post(`${Xr}${Zr}`,e)}catch(e){throw await Kt(e),e}}},{APIS:{MGMT_API:{BASE_URL:tn,ENDPOINTS:{BULK_REFERRALS:rn}}}}=E,nn={create:async e=>{try{await Vt.post(`${tn}${rn}`,e)}catch(e){throw await Kt(e),e}}},{APIS:{MGMT_API:{BASE_URL:sn,ENDPOINTS:{BULK_ENROLMENTS:on}}}}=E,an={referrals:en,bulkReferrals:nn,bulkEnrolments:{create:async e=>{try{await Vt.post(`${sn}${on}`,e)}catch(e){throw await Kt(e),e}}}},{APIS:{PAYMENTS_API:{BASE_URL_V2:cn,ENDPOINTS:{PRODUCTS:ln}}}}=E,un=`${cn}${ln}`,dn={products:{list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(un,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}}},{APIS:{PEOPLE_API:{BASE_URL_V2:pn,ENDPOINTS:{BULK_ENROLMENTS:fn}}}}=E,hn={list:async e=>{let t=[];try{const{data:r}=await Vt.get(`${pn}${fn}`,{params:e});r&&r.length&&(t=r)}catch(e){await Kt(e)}return t}};var En=c(606);const{OK:Sn,MULTIPLE_CHOICES:gn,NOT_FOUND:mn,FORBIDDEN:wn}=En.StatusCodes,yn=e=>e>=Sn&&e<gn||e===wn||e===mn,{APIS:{PEOPLE_API:{BASE_URL_V2:Rn,ENDPOINTS:{USERS:bn}}},STATUS_CODES:{INVALID_TOKEN:In},ERROR_MESSAGES:{INVALID_TOKEN:An}}=E,Tn=async e=>{let t=null;try{const{data:r}=await Vt.get(`${Rn}${bn}/${encodeURIComponent(e)}`,{validateStatus:yn});r&&r.id&&(t=r)}catch(e){if(e?.response?.status===In)throw new Error(An);await Kt(e)}return t},On=async e=>{let t=[];try{if(e&&e.length<2)throw new Error("users list method requires at least two ids");const r=e.map(e=>`ids=${encodeURIComponent(e)}`).join("&"),n=await Vt.get(`${Rn}${bn}?${r}`,{validateStatus:yn});n&&n.length&&(t=n)}catch(e){await Kt(e)}return t},Nn={read:Tn,update:async(e,t)=>{let r=!1;try{const{data:n}=await Vt.put(`${Rn}${bn}/${encodeURIComponent(e)}`,t);r=!(!n||!n.id)}catch(e){await Kt(e)}return r},list:On},{APIS:{PEOPLE_API:{BASE_URL_V2:Pn,ENDPOINTS:{USERS:Ln,USER_LIKES:Un}}},USERS:{MYSELF:Cn}}=E,_n=`${Pn}${Ln}/${Cn}${Un}`,vn=async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(_n,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t},$n={list:vn},Dn={authors:{readQuestionAuthors:async(e,t,r)=>{try{if(e.author=await Tn(e.authorId),e.answers&&e.answers.length&&!r.ignoreAnswersAuthors){e.answers.sort((e,t)=>new Date(t.updatedAt)-new Date(e.updatedAt)),e.totalAnswers=e.answers.length;let n=e.answers;if(r.limit&&r.pageNumber){const t=r.limit*(r.pageNumber-1);n=e.answers.slice(t,t+r.limit)}for(let e of n){e.author=e.authorId&&await Tn(e.authorId)||{};const[r]=t?await vn({contentType:E.CONTENTFUL.ANSWERS.TYPE,contentSlug:e.slug}):[null];e.userLiked=!!r}e.answers=n}else e.answers||(e.answers=[]);return e}catch(e){throw await Kt(e),new Error(`Cannot read authors for question: ${e.message}`)}},readAuthors:async(e=[])=>{let t=[];try{if(!1===Array.isArray(e))throw new Error("authorIds is not an array!");if(e&&1===e.length){const r=await Tn(e[0]);r&&t.push(r)}else if(e&&e.length>1){const r=await On(e);r&&r.length>0&&(t=r)}}catch(e){throw await Kt(e),new Error(`Cannot read authors: ${e.message}`)}return t}}},{APIS:{PEOPLE_API:{BASE_URL:Bn,ENDPOINTS:{REGISTRATIONS:jn}}}}=E,kn={list:async e=>{let t=[];try{const{data:r}=await Vt.get(`${Bn}${jn}`,{params:e});r&&r.length&&(t=r)}catch(e){await Kt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:xn,ENDPOINTS:{COMMUNITIES:Mn,USERS:Fn}}}}=E,qn=`${xn}${Fn}`;function Gn(e){const t=e["content-range"].split(" ")[1].split("/"),[r,n,s]=[...t[0].split("-"),t[1]].map(e=>parseInt(e,10)||0);return{start:r,end:n,total:s}}const Vn={list:async(e="me",t={})=>{let r={items:[],start:0,end:0,total:0},n=t?{params:t}:{params:{}};try{const{data:t,headers:s}=await Vt.get(`${qn}/${e}${Mn}`,{...n,headers:{"Cache-Control":"no-cache",Pragma:"no-cache",Expires:0}});return t?.length>0&&(r={data:t,pagination:Gn(s)}),r}catch(e){await Kt(e)}return r}},{APIS:{PEOPLE_API:{BASE_URL_V2:Kn,ENDPOINTS:{USERS:Yn,USER_COURSES:Hn}}},USERS:{MYSELF:Wn}}=E,Jn=`${Kn}${Yn}/${Wn}${Hn}`,zn={create:async e=>{try{await Vt.post(Jn,e)}catch(e){await Kt(e)}},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Jn,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${Jn}/${e}`,t)}catch(e){await Kt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:Qn,ENDPOINTS:{USERS:Xn,USER_EVENTS:Zn}}},USERS:{MYSELF:es}}=E,ts=`${Qn}${Xn}/${es}${Zn}`,rs={list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(ts,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:ns,ENDPOINTS:{USERS:ss,USER_LESSONS:os}}},USERS:{MYSELF:is}}=E,as=`${ns}${ss}/${is}${os}`,cs={create:async e=>{let t=null;try{t=await Vt.post(as,e)}catch(e){await Kt(e)}return t},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(as,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:ls,ENDPOINTS:{USERS:us,USER_PRODUCTS:ds}}},USERS:{MYSELF:ps}}=E,fs=`${ls}${us}/${ps}${ds}`,hs={create:async e=>{let t=null;try{t=await Vt.post(fs,e)}catch(e){await Kt(e)}return t},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(fs,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${fs}/${e}`,t)}catch(e){await Kt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:Es,ENDPOINTS:{USERS:Ss,USER_RATINGS:gs}}},USERS:{MYSELF:ms}}=E,ws=`${Es}${Ss}/${ms}${gs}`,ys={create:async e=>{let t=null;try{const{data:r}=await Vt.post(ws,e);r?.id&&(t=r)}catch(e){await Kt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${ws}/${e}`,t)}catch(e){await Kt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:Rs,ENDPOINTS:{USERS:bs,USER_REFERRALS:Is}}},USERS:{MYSELF:As}}=E,Ts=`${Rs}${bs}/${As}${Is}`,Os={bulkEnrolments:hn,handlers:Dn,registrations:kn,users:Nn,userCommunities:Vn,userCourses:zn,userEvents:rs,userLessons:cs,userLikes:$n,userProducts:hs,userRatings:ys,userReferrals:{list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Ts,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}}},{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:Ns,ENDPOINTS:{ENQUIRY_EMAILS:Ps}}}}=E,Ls={create:async e=>{let t=null;try{const{data:r}=await Vt.post(`${Ns}${Ps}`,e);r&&(t=r)}catch(e){await Kt(e)}return t}},Us={forms:{sendEnquiryEmails:async e=>{let t=null;try{const{emailIds:r}=R();t=await Ds.emails.create({...r,...e})}catch(e){await Kt(e)}return t}}},{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:Cs,ENDPOINTS:{USERS:_s,USER_PROPERTIES:vs}}},USERS:{MYSELF:$s}}=E,Ds={emails:Ls,handlers:Us,userProperties:{update:async(e,t)=>{try{await Vt.put(`${Cs}${_s}/${$s}${vs}/${e}`,t)}catch(e){await Kt(e)}}}};var Bs=c(443);const{APIS:{SEARCH_API:{BASE_URL:js,ENDPOINTS:{AI_SEARCH:ks}}}}=E,xs=`${js}${ks}`,Ms={ask:async e=>{try{let t=null;const{data:r}=await Vt.get(xs,{params:{question:e}});return r?.answer&&r?.references&&r?.version&&(t=r),t}catch(e){const t=await Kt(e);throw new Error(t)}},stream:(e,t,r)=>{const n=(0,Bs.io)(void 0,{path:"/api/search-api/web-sockets"});function s(){n.emit("ai-search",{question:e})}function o(e){r(e),i(),n.disconnect()}function i(){n.off("connect",s),n.off("update",t),n.off("result",o)}return n.on("connect",s),n.on("update",t),n.on("result",o),i}},{APIS:{SEARCH_API:{BASE_URL:Fs,ENDPOINTS:{CHATBOT:{COURSES:qs}}}}}=E,Gs=`${Fs}${qs}`;async function Vs(e,t){try{let r=null;const{data:n}=await Vt.get(`${Gs}/${e}`,{params:{text:t}});return n&&(r=n),r}catch(e){await Kt(e)}}const Ks=(e,t,r,n)=>{const s=(0,Bs.io)(void 0,{path:"/api/search-api/web-sockets"});function o(){s.emit("chatbot",{text:e,courseSlug:t})}s.on("connect",o),s.on("update",r),s.on("result",function e(t){n(t),s.off("connect",o),s.off("update",r),s.off("result",e),s.disconnect()})};async function Ys(e){try{let t=null;const{data:r}=await Vt.delete(`${Gs}/${e}`);return r&&(t=r),t}catch(e){await Kt(e)}}const Hs={...Ms,chatbot:{courses:d}},{CONTENTFUL:Ws}=E,{TYPE:Js,ORDER:zs,SELECT:Qs,SKIP:Xs,LIMIT:Zs,INCLUDE:eo}=Ws.BADGES,to={list:async()=>{try{return await(0,p.getEntries)({content_type:Js,include:eo,limit:Zs,order:zs,select:Qs,skip:Xs})}catch(e){return await Kt(e),[]}}},{CONTENTFUL:ro}=E,{CARD_TYPES:no}=ro.CAROUSELS,so={read:async(e,t)=>{try{if(!t||!t.sys||!t.sys.id)throw new Error("Invalid link to card");if(!e||!no[e])throw new Error("Unsupported card content type");const{INCLUDE:r,SELECT:n}=no[e],s=await(0,p.getEntry)({content_type:e,"sys.id":t.sys.id,include:r,select:n},{assetDetails:!0});if("courseJourney"===e){const e=await(0,p.getEntry)({content_type:"course","fields.journeys.sys.id":t.sys.id,include:1,select:"fields.slug,fields.journeys"});s.courseParent=e}return s}catch(e){throw await Kt(e),new Error(`Cannot read carousel card: ${e.message}`)}}},oo=so,{CONTENTFUL:io}=E,{INCLUDE:ao,SELECT:co,TYPE:lo}=io.EDITORIAL_PAGES,uo={read:async e=>{try{return await(0,p.getEntry)({content_type:lo,"fields.slug":e,include:ao,select:co})}catch(e){throw await Kt(e),new Error(`Cannot read editorial page: ${e.message}`)}}},{CONTENTFUL:po}=E,{TYPE:fo,ORDER:ho,SELECT:Eo,SKIP:So,LIMIT:go,INCLUDE:mo}=po.QUESTIONS,wo={read:async e=>{try{return await(0,p.getEntry)({content_type:fo,"fields.slug":e,include:2,select:Eo})}catch(e){throw await Kt(e),new Error(`Cannot read question: ${e.message}`)}},list:async(e={})=>{try{return await(0,p.getEntries)({content_type:fo,include:mo,limit:go,order:ho,select:Eo,skip:So,...e})}catch(e){throw await Kt(e),new Error(`Cannot list questions: ${e.message}`)}}};var yo=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(s=n;0!==s--;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(s=n;0!==s--;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;0!==s--;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r};const Ro="__googleMapsScriptId";var bo;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(bo||(bo={}));class Io{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:n,id:s=Ro,language:o,libraries:i=[],mapIds:a,nonce:c,region:l,retries:u=3,url:d="https://maps.googleapis.com/maps/api/js",version:p}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=r,this.client=n,this.id=s||Ro,this.language=o,this.libraries=i,this.mapIds=a,this.nonce=c,this.region=l,this.retries=u,this.url=d,this.version=p,Io.instance){if(!yo(this.options,Io.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Io.instance.options)}`);return Io.instance}Io.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?bo.FAILURE:this.done?bo.SUCCESS:this.loading?bo.LOADING:bo.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`&region=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(r=>{r?t(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id))return void this.callback();const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(e=>!r[e]&&delete r[e]),(null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.importLibrary)||(e=>{let t,r,n,s="The Google Maps JavaScript API",o="google",i="importLibrary",a="__ib__",c=document,l=window;l=l[o]||(l[o]={});const u=l.maps||(l.maps={}),d=new Set,p=new URLSearchParams,f=()=>t||(t=new Promise((i,l)=>{return f=this,h=void 0,S=function*(){var f;for(n in yield r=c.createElement("script"),r.id=this.id,p.set("libraries",[...d]+""),e)p.set(n.replace(/[A-Z]/g,e=>"_"+e[0].toLowerCase()),e[n]);p.set("callback",o+".maps."+a),r.src=this.url+"?"+p,u[a]=i,r.onerror=()=>t=l(Error(s+" could not load.")),r.nonce=this.nonce||(null===(f=c.querySelector("script[nonce]"))||void 0===f?void 0:f.nonce)||"",c.head.append(r)},new((E=void 0)||(E=Promise))(function(e,t){function r(e){try{s(S.next(e))}catch(e){t(e)}}function n(e){try{s(S.throw(e))}catch(e){t(e)}}function s(t){var s;t.done?e(t.value):(s=t.value,s instanceof E?s:new E(function(e){e(s)})).then(r,n)}s((S=S.apply(f,h||[])).next())});var f,h,E,S}));u[i]?console.warn(s+" only loads once. Ignoring:",e):u[i]=(e,...t)=>d.add(e)&&f().then(()=>u[i](e,...t))})(r);const n=this.libraries.map(e=>this.importLibrary(e));n.length||n.push(this.importLibrary("core")),Promise.all(n).then(()=>this.callback(),e=>{const t=new ErrorEvent("error",{error:e});this.loadErrorCallback(t)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${e} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setScript())}}}const{GOOGLE:{MAPS:{LIBRARIES:{GEOCODING:Ao,PLACES:To},VERSION:Oo}}}=E,No=function(e={}){let t=[];const r=R(),n=new Io({apiKey:r?.googleMaps?.apiKey,version:Oo});return{buildLocation:async function(e){try{const r=t.find(t=>t.description===e);if(!r)throw new Error("Place not found");const{place_id:s,description:o}=r,{Geocoder:i}=await n.importLibrary(Ao),a=new i;return new Promise(e=>{a.geocode({placeId:s},(t=[],r)=>{if("OK"===r){const r=t[0].address_components.find(e=>e.types.includes("country")),n=r?r.short_name:null;e({id:s,en:o,code:n})}else e({id:s,en:o,code:null})}).catch(()=>e({id:s,en:o,code:null}))})}catch(e){return await Kt(e),null}},isValidPlace:function(e){return t.some(t=>t.description===e)},predictPlaces:async function(r){try{const{AutocompleteService:s}=await n.importLibrary(To),o=new s;return new Promise(n=>{o.getPlacePredictions({...e,input:r,types:["(cities)"]},(e=[],r)=>{"OK"===r?(t=e,n(e)):n([])}).catch(()=>n([]))})}catch(e){return await Kt(e),[]}}}},Po=async(e,t,r={ignoreAnswersAuthors:!1})=>{try{let n={};return n=await wo.read(e),n=await Os.handlers.authors.readQuestionAuthors(n,t,r),n}catch(e){throw await Kt(e),new Error(`Cannot build question: ${e.message}`)}},{ARTICLES:{TYPE:Lo},COURSES:{TYPE:Uo},COURSE_JOURNEYS:{TYPE:Co},CUSTOM_CARD:{TYPE:_o},COMMUNITY:{TYPE:vo},EVENTS:{TYPE:$o},LISTS:{TYPE:Do},QUESTIONS:{TYPE:Bo},LEARNING_HUB:{TYPE:jo}}=E.CONTENTFUL,ko={ClosedHidden:"closed-hidden",ClosedVisible:"closed-visible",OpenHidden:"open-hidden",OpenVisible:"open-visible"},xo=e=>e&&e.url?(Object.assign(e,{aspect:"responsiveCard",query:"q=90&fit=fill"}),e):null,Mo=e=>e&&e.url?`${e.url}?w=100&h=100&fit=thumb&f=center`:null,Fo=e=>e.toLowerCase().split(" ")[0],qo={[Lo]:async e=>{const{authorIds:t,authorTag:r,image:n,coverImage:s,publishedDate:o,readingTime:i,slug:a,title:c}=e;let l=n;s&&(l.url=s.url,l.width=s.width,l.height=s.height,l.color=s.color);const u=await Os.handlers.authors.readAuthors(t),d=u&&u.length?u:r?[Fo(r)]:null;return{banner:xo(l),contributors:d,publishedDate:o,readingTime:i,slug:a,title:c}},[vo]:async e=>{const{title:t,slug:r,image:n,privacy:s,createdAt:o}=e,i=[ko.ClosedVisible,ko.ClosedHidden].includes(s),a=[ko.OpenVisible,ko.ClosedVisible].includes(s);return{banner:n?xo(n):null,slug:r,title:t,privacy:s,isPrivate:i,isVisible:a,createdAt:o}},[Uo]:async(e,t)=>{const{banner:r,freeCourse:n,partnershipDetails:s,slug:o,title:i,registered:a,courseType:c,courseV2:l}=e,u={banner:xo(r),slug:o,title:i,pill:n?"free":"premium",registered:!!a,courseType:c,courseV2:l};if(s){const{partners:e}=s;if(e)if(e.length>1){let t=[];for(let r=0;r<e.length;r++)t.push(e[r].title);u.partner=t}else u.partner=[e[0].title]}if(void 0===a&&t){const[e]=await Os.userProducts.list({courseSlug:o});u.registered=!!e}return u},[Co]:async(e,t)=>{const{bannerImage:r,slug:n,title:s,courseParent:o,accessPrivacy:i,partnerLogos:a,locale:c}=e;let l,u=!1;if(t){const[e]=await Os.userProducts.list({courseSlug:o.slug,journeySlug:n});u=!!e}return l=o.journeys&&o.journeys[0]?.slug===n?o.slug:`${o.slug}/${n}`,{banner:xo(r),slug:l,title:s,partner:a?a.map(e=>e.title):[],registered:u,pill:i.includes("open")?"free":"premium",courseType:i.includes("public")?"Public":"Private",customLabel:"Course",locale:c||"en"}},[_o]:e=>{const{authorName:t,authorImage:r,icon:n,image:s,label:o,link:i,primaryText:a}=e;return{...e,banner:s?xo(s):null,customIcon:n?n.toLowerCase():null,customLabel:o,contributors:t?[{name:t,image:r?{thumbnail:Mo(r)}:null}]:null,slug:i,text:a}},[$o]:async(e,t)=>{const{bannerImage:r,defaultStartDate:n,isEventOngoing:s,slug:o,speakers:i,title:a,registered:c}=e,l=new Date(n),u=!!l&&l<new Date;if(i&&i.length)for(const e of i)e.image=Mo(e.image);const d={banner:xo(r),dateHasPassed:u,title:a,slug:o,isOngoingEvent:s,contributors:i,startDate:l,registered:!!c};if(void 0===c&&t){const[e]=await Os.userEvents.list({eventSlug:o});d.registered=!!e}return d},[Do]:async e=>{const{hero:t,slug:r,title:n}=e;return{banner:xo(t),slug:r,title:n}},[Bo]:async e=>{const{answers:t,authorId:r,createdAt:n,slug:s,title:o}=e;let i=null;if(r){const e=await Os.users.read(r);e&&(i=e)}return{answers:t&&t.length?t.length:0,contributors:i?[i]:[],createdAt:n,slug:s,title:o}},[jo]:e=>{const{bannerSection:t,customLabel:r,slug:n,title:s}=e;return{banner:xo(t.image),slug:n,title:s,customLabel:r}},people:e=>{const{id:t,name:r,jobTitle:n,location:s,image:o,customLink:i}=e;return{profile:o,slug:i?.link||t,title:r,text:n,secondaryText:s,customLinkText:i?.text}}},Go=async({contentType:e,...t}={},r)=>{try{if(!qo[e])throw new Error("Content type not supported");if("function"!=typeof qo[e])throw new Error("No builder function for content type");return"people"!==e&&t.sys&&t.sys.type&&"Link"===t.sys.type&&(t=await oo.read(e,t)),{contentType:e,...await qo[e](t,r)}}catch(e){throw await Kt(e),new Error(`Cannot build carousel card: ${e.message}`)}},Vo=async(e,t,r={})=>{try{if(!e.replies||0===e.replies.length)return e.replies=[],e;e.replies.sort((e,t)=>new Date(e.postedAt)-new Date(t.postedAt)),e.totalReplies=e.totalReplies||e.replies.length;let n=e.replies;if(r.limit&&r.pageNumber){const t=r.limit*(r.pageNumber-1);n=e.replies.slice(t,t+r.limit)}for(const r of n){if(r.authorId===e.authorId){r.author=e.author,r.userLiked=!1;continue}r.author=r.authorId&&await Tn(r.authorId)||{};const[n]=t?await vn({contentType:E.CONTENTFUL.REPLIES.TYPE,contentSlug:r.slug}):[null];r.userLiked=!!n}return e.replies=n,e}catch(e){throw await Kt(e),new Error(`Cannot build replies for answer: ${e.message}`)}},Ko="success",Yo="error",Ho=e=>async t=>{const{contentType:r}=t;switch(r){case"event":try{return await Qr.eventRegistrations.create({eventSlug:t.slug,expectation:null,userEmail:e.email,startsAt:new Date(t.startDate).toISOString()}),Ko}catch(e){return reportError(new Error(`Error registering for event: ${JSON.stringify(e)}`)),Yo}case"microcourse":try{return await Qr.userProducts.create({id:e.id,courseSlug:t.slug,email:e.email,courseType:t.courseType}),Ko}catch(e){return reportError(new Error(`Error registering for microcourse: ${JSON.stringify(e)}`)),Yo}case"communityPage":try{return await Dr.join(t.slug),Ko}catch(e){return reportError(new Error(`Error joining community: ${JSON.stringify(e)}`)),Yo}default:return Yo}};var Wo=c(18);const Jo=e=>e&&Wo.Buffer.from(e,"base64").toString("ascii");function zo({contentContext:e=null,errorsContext:t=null,googleMapsContext:r=null,gtmContext:n=null,origin:s}){try{const o=P(s);return e&&(0,p.setContext)(Object.assign({},e,{environment:o})),t&&(0,f.setContext)(Object.assign({},t,{environment:o})),r&&y(Object.assign({},r,{environment:o})),n&&((0,h.setContext)(Object.assign({},n,{environment:o})),(0,h.setupGTM)()),w(Object.assign({},{environment:o})),o}catch(e){console.warn(`Cannot load SDK: ${e.message}`)}}return l})());
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/gtm"),require("http-status-codes"),require("socket.io-client"),require("buffer")):"function"==typeof define&&define.amd?define(["@apolitical/content","@apolitical/error-reporting","@apolitical/gtm","http-status-codes","socket.io-client","buffer"],t):"object"==typeof exports?exports.ApoliticalSDK=t(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/gtm"),require("http-status-codes"),require("socket.io-client"),require("buffer")):e.ApoliticalSDK=t(e["@apolitical/content"],e["@apolitical/error-reporting"],e["@apolitical/gtm"],e["http-status-codes"],e["socket.io-client"],e.buffer)}(this,(e,t,r,n,s,o)=>(()=>{"use strict";var i={584:t=>{t.exports=e},568:e=>{e.exports=t},59:e=>{e.exports=r},18:e=>{e.exports=o},606:e=>{e.exports=n},443:e=>{e.exports=s}},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return i[e](r,r.exports,c),r.exports}c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};c.r(l),c.d(l,{assets:()=>ar,auth:()=>pr,badges:()=>oo,buildAnswer:()=>Wo,buildCardCtaClickHandler:()=>Qo,buildCarouselCard:()=>Yo,buildQuestion:()=>_o,carouselCards:()=>lo,communities:()=>Mr,contentInteraction:()=>Br,decodeBase64:()=>Zo,default:()=>ei,editorialPages:()=>Eo,getEntries:()=>p.getEntries,getEntry:()=>p.getEntry,management:()=>rn,mgmt:()=>pn,payments:()=>Sn,people:()=>Us,peopleEngagement:()=>xs,qaQuestions:()=>bo,reportError:()=>f.reportError,search:()=>Qs,useMaps:()=>Co});var u={};c.r(u),c.d(u,{hasBrowserEnv:()=>ke,hasStandardBrowserEnv:()=>Me,hasStandardBrowserWebWorkerEnv:()=>Fe,navigator:()=>xe,origin:()=>qe});var d={};c.r(d),c.d(d,{read:()=>Ws,remove:()=>zs,stream:()=>Js});var p=c(584),f=c(568),h=c(59);const E={APOLITICAL:{WEBSITES:{LIVE:"https://apolitical.co",LOCALHOST:"localhost",STAGING:/https:\/\/([\w|\d|-]+)\.apolitical\.co/i,STAGING_SPLITTER:"-"},ENVIRONMENTS:{PRODUCTION:"live",LOCAL:"local"}},APIS:{ASSETS_API:{BASE_URL:"/api/assets-api",ENDPOINTS:{USERS:"/users",CERTIFICATES:"/certificates",PROFILE_IMAGES:"/profile-images",LINK_PREVIEWS:"/link-previews"}},AUTH_API:{BASE_URL:"/api/auth-api",ENDPOINTS:{USER_PASSWORD:"/password",USERS:"/users"}},CONTENT_INTERACTION_API:{BASE_URL:"/api/content-interaction-api",ENDPOINTS:{QUESTIONS:"/questions",ANSWERS:"/answers",REPLIES:"/replies",LIKES:"/likes"}},COMMUNITIES_API:{BASE_URL:"/api/communities-api",ENDPOINTS:{COMMUNITIES:"/me/communities"}},MANAGEMENT_API:{BASE_URL:"/api/management-api",ENDPOINTS:{ACCOUNTS:"/accounts",EVENT_REGISTRATIONS:"/event-registrations",LOGINS:"/logins",LOGIN_PASSWORDLESS:"/passwordless",BULK_ENROLMENTS:"/bulk-enrolments",PROFILE:"/users/me/profile"}},MGMT_API:{BASE_URL:"/api/mgmt-api",ENDPOINTS:{REFERRALS:"/referrals",BULK_REFERRALS:"/bulk-referrals",BULK_ENROLMENTS:"/bulk-enrolments"}},PAYMENTS_API:{BASE_URL:"/api/payments-api",BASE_URL_V2:"/api/payments-api/v2",ENDPOINTS:{PRODUCTS:"/products"}},PEOPLE_API:{BASE_URL:"/api/people-api",BASE_URL_V2:"/api/people-api/v2",ENDPOINTS:{BULK_ENROLMENTS:"/bulk-enrolments",COMMUNITIES:"/communities",REGISTRATIONS:"/registrations",USERS:"/users",USER_ANSWERS:"/answers",USER_COURSES:"/courses",USER_EVENTS:"/events",USER_LIKES:"/likes",USER_LESSONS:"/lessons",USER_PRODUCTS:"/products",USER_RATINGS:"/ratings",USER_REFERRALS:"/referrals",USER_SUBSCRIPTIONS:"/subscriptions"}},PEOPLE_ENGAGEMENT_API:{BASE_URL:"/api/people-engagement-api",ENDPOINTS:{ENQUIRY_EMAILS:"/enquiry-emails",USERS:"/users",USER_PROPERTIES:"/properties"}},SEARCH_API:{BASE_URL:"/api/search-api",ENDPOINTS:{AI_SEARCH:"/ai-search",CHATBOT:{COURSES:"/chatbot/me/courses"}}}},CONTENTFUL:{ARTICLES:{TYPE:"solutionArticle"},BADGES:{TYPE:"badge",INCLUDE:0,LIMIT:1e3,SELECT:"fields.name,fields.slug,fields.description,fields.icon,fields.colour",SKIP:0},CAROUSELS:{CARD_TYPES:{communityPage:{INCLUDE:1,SELECT:"fields.image,fields.slug,fields.title"},customCard:{INCLUDE:1,SELECT:"fields.icon,fields.label,fields.image,fields.primaryText,fields.secondaryText,fields.authorName,fields.authorImage,fields.link,fields.openInNewTab"},solutionArticle:{INCLUDE:1,SELECT:"fields.authorIds,fields.authorTag,fields.image,fields.coverImage,fields.publishedDate,fields.readingTime,fields.slug,fields.title"},courseJourney:{INCLUDE:1,SELECT:"fields.bannerImage,fields.slug,fields.title,fields.accessPrivacy,fields.partnerLogos"},microcourse:{INCLUDE:2,SELECT:"fields.banner,fields.freeCourse,fields.partnershipDetails,fields.slug,fields.title,fields.courseType"},event:{INCLUDE:1,SELECT:"fields.bannerImage,fields.defaultStartDate,fields.slug,fields.speakers,fields.title,fields.isEventOngoing"},listPage:{INCLUDE:1,SELECT:"fields.hero,fields.slug,fields.title"},qaQuestion:{INCLUDE:0,SELECT:"fields.answers,fields.authorId,fields.slug,fields.title,sys.createdAt,fields.projectNames"},learningHub:{INCLUDE:1,SELECT:"fields.bannerSection,fields.customLabel,fields.slug,fields.title"}}},COMMUNITY:{TYPE:"communityPage"},COURSES:{TYPE:"microcourse"},COURSE_JOURNEYS:{TYPE:"courseJourney"},CUSTOM_CARD:{TYPE:"customCard"},EDITORIAL_PAGES:{INCLUDE:1,SELECT:"fields.carousels,fields.slug,fields.showCarouselCta,fields.header,fields.subHeader",TYPE:"editorialPage"},EVENTS:{TYPE:"event"},LISTS:{TYPE:"listPage"},QUESTIONS:{TYPE:"qaQuestion",INCLUDE:1,LIMIT:10,ORDER:"-fields.postedAt",SELECT:"sys.updatedAt,fields.postedAt,fields.title,fields.slug,fields.authorId,fields.answers,fields.isEdited,fields.projectNames",SKIP:0},ANSWERS:{TYPE:"qaAnswer"},REPLIES:{TYPE:"reply"},LEARNING_HUB:{TYPE:"learningHub"}},GOOGLE:{MAPS:{LIBRARIES:{PLACES:"places",GEOCODING:"geocoding"},VERSION:"weekly"}},HUBSPOT:{ENVIRONMENTS_MAPPING:{local:"SANDBOX",beta:"SANDBOX",rc:"SANDBOX",live:"LIVE"},EMAIL_IDS:{SANDBOX:{internalEmailId:49099078634,externalEmailId:55196526554},LIVE:{internalEmailId:55233583049,externalEmailId:55231159239}}},USERS:{MYSELF:"me"},STATUS_CODES:{INVALID_TOKEN:498},ERROR_MESSAGES:{INVALID_TOKEN:"Invalid token error: Logging user out..."}},{HUBSPOT:{ENVIRONMENTS_MAPPING:S,EMAIL_IDS:g}}=E;let m={emailIds:{}};const w=({environment:e})=>{const t=(e=>{if(!e)throw new Error("Cannot map environment: Environment not defined");if(!S[e])throw new Error(`Cannot map environment: No mapping found for environment ${e}`);return S[e]})(e);m.emailIds=g[t]},y=({apiKey:e})=>{m.googleMaps={apiKey:e}},R=()=>m,{APOLITICAL:{WEBSITES:{LIVE:I,LOCALHOST:b,STAGING:T,STAGING_SPLITTER:A},ENVIRONMENTS:{PRODUCTION:O,LOCAL:N}}}=E,P=e=>{let t=null;e?t=e:"undefined"!=typeof window&&(t=window.origin||window.location.origin),t||new Error("Cannot select environment: Website not defined");let r=null;const n=t.match(T);return n?r=n[1].split(A)[0]:t===I?r=O:t.includes(b)&&(r=N),r||new Error(`Cannot select environment: No rule for website ${t}`),r};function L(e,t){return function(){return e.apply(t,arguments)}}const{toString:U}=Object.prototype,{getPrototypeOf:C}=Object,{iterator:_,toStringTag:v}=Symbol,$=(D=Object.create(null),e=>{const t=U.call(e);return D[t]||(D[t]=t.slice(8,-1).toLowerCase())});var D;const B=e=>(e=e.toLowerCase(),t=>$(t)===e),j=e=>t=>typeof t===e,{isArray:k}=Array,x=j("undefined");function M(e){return null!==e&&!x(e)&&null!==e.constructor&&!x(e.constructor)&&G(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const F=B("ArrayBuffer"),q=j("string"),G=j("function"),V=j("number"),K=e=>null!==e&&"object"==typeof e,H=e=>{if("object"!==$(e))return!1;const t=C(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||v in e||_ in e)},Y=B("Date"),W=B("File"),J=B("Blob"),z=B("FileList"),Q=B("URLSearchParams"),[X,Z,ee,te]=["ReadableStream","Request","Response","Headers"].map(B);function re(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),k(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(M(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let i;for(n=0;n<o;n++)i=s[n],t.call(null,e[i],i,e)}}function ne(e,t){if(M(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,s=r.length;for(;s-- >0;)if(n=r[s],t===n.toLowerCase())return n;return null}const se="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,oe=e=>!x(e)&&e!==se,ie=(ae="undefined"!=typeof Uint8Array&&C(Uint8Array),e=>ae&&e instanceof ae);var ae;const ce=B("HTMLFormElement"),le=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ue=B("RegExp"),de=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};re(r,(r,s)=>{let o;!1!==(o=t(r,s,e))&&(n[s]=o||r)}),Object.defineProperties(e,n)},pe=B("AsyncFunction"),fe=(he="function"==typeof setImmediate,Ee=G(se.postMessage),he?setImmediate:Ee?(Se=`axios@${Math.random()}`,ge=[],se.addEventListener("message",({source:e,data:t})=>{e===se&&t===Se&&ge.length&&ge.shift()()},!1),e=>{ge.push(e),se.postMessage(Se,"*")}):e=>setTimeout(e));var he,Ee,Se,ge;const me="undefined"!=typeof queueMicrotask?queueMicrotask.bind(se):"undefined"!=typeof process&&process.nextTick||fe,we={isArray:k,isArrayBuffer:F,isBuffer:M,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||G(e.append)&&("formdata"===(t=$(e))||"object"===t&&G(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&F(e.buffer),t},isString:q,isNumber:V,isBoolean:e=>!0===e||!1===e,isObject:K,isPlainObject:H,isEmptyObject:e=>{if(!K(e)||M(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:X,isRequest:Z,isResponse:ee,isHeaders:te,isUndefined:x,isDate:Y,isFile:W,isBlob:J,isRegExp:ue,isFunction:G,isStream:e=>K(e)&&G(e.pipe),isURLSearchParams:Q,isTypedArray:ie,isFileList:z,forEach:re,merge:function e(){const{caseless:t,skipUndefined:r}=oe(this)&&this||{},n={},s=(s,o)=>{const i=t&&ne(n,o)||o;H(n[i])&&H(s)?n[i]=e(n[i],s):H(s)?n[i]=e({},s):k(s)?n[i]=s.slice():r&&x(s)||(n[i]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&re(arguments[e],s);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(re(t,(t,n)=>{r&&G(t)?e[n]=L(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let s,o,i;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&C(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:$,kindOfTest:B,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(k(e))return e;let t=e.length;if(!V(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[_]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:ce,hasOwnProperty:le,hasOwnProp:le,reduceDescriptors:de,freezeMethods:e=>{de(e,(t,r)=>{if(G(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];G(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return k(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ne,global:se,isContextDefined:oe,isSpecCompliantForm:function(e){return!!(e&&G(e.append)&&"FormData"===e[v]&&e[_])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(K(e)){if(t.indexOf(e)>=0)return;if(M(e))return e;if(!("toJSON"in e)){t[n]=e;const s=k(e)?[]:{};return re(e,(e,t)=>{const o=r(e,n+1);!x(o)&&(s[t]=o)}),t[n]=void 0,s}}return e};return r(e,0)},isAsyncFn:pe,isThenable:e=>e&&(K(e)||G(e))&&G(e.then)&&G(e.catch),setImmediate:fe,asap:me,isIterable:e=>null!=e&&G(e[_])};function ye(e,t,r,n,s){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),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}we.inherits(ye,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:we.toJSONObject(this.config),code:this.code,status:this.status}}});const Re=ye.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(ye,Ie),Object.defineProperty(Re,"isAxiosError",{value:!0}),ye.from=(e,t,r,n,s,o)=>{const i=Object.create(Re);we.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return ye.call(i,a,c,r,n,s),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const be=ye;function Te(e){return we.isPlainObject(e)||we.isArray(e)}function Ae(e){return we.endsWith(e,"[]")?e.slice(0,-2):e}function Oe(e,t,r){return e?e.concat(t).map(function(e,t){return e=Ae(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const Ne=we.toFlatObject(we,{},null,function(e){return/^is[A-Z]/.test(e)}),Pe=function(e,t,r){if(!we.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=we.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!we.isUndefined(t[e])})).metaTokens,s=r.visitor||l,o=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&we.isSpecCompliantForm(t);if(!we.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(we.isDate(e))return e.toISOString();if(we.isBoolean(e))return e.toString();if(!a&&we.isBlob(e))throw new be("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(e)||we.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,s){let a=e;if(e&&!s&&"object"==typeof e)if(we.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(we.isArray(e)&&function(e){return we.isArray(e)&&!e.some(Te)}(e)||(we.isFileList(e)||we.endsWith(r,"[]"))&&(a=we.toArray(e)))return r=Ae(r),a.forEach(function(e,n){!we.isUndefined(e)&&null!==e&&t.append(!0===i?Oe([r],n,o):null===i?r:r+"[]",c(e))}),!1;return!!Te(e)||(t.append(Oe(s,r,o),c(e)),!1)}const u=[],d=Object.assign(Ne,{defaultVisitor:l,convertValue:c,isVisitable:Te});if(!we.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!we.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),we.forEach(r,function(r,o){!0===(!(we.isUndefined(r)||null===r)&&s.call(t,r,we.isString(o)?o.trim():o,n,d))&&e(r,n?n.concat(o):[o])}),u.pop()}}(e),t};function Le(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Ue(e,t){this._pairs=[],e&&Pe(e,this,t)}const Ce=Ue.prototype;Ce.append=function(e,t){this._pairs.push([e,t])},Ce.toString=function(e){const t=e?function(t){return e.call(this,t,Le)}:Le;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const _e=Ue;function ve(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $e(e,t,r){if(!t)return e;const n=r&&r.encode||ve;we.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let o;if(o=s?s(t,r):we.isURLSearchParams(t)?t.toString():new _e(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const De=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){we.forEach(this.handlers,function(t){null!==t&&e(t)})}},Be={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},je={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:_e,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ke="undefined"!=typeof window&&"undefined"!=typeof document,xe="object"==typeof navigator&&navigator||void 0,Me=ke&&(!xe||["ReactNative","NativeScript","NS"].indexOf(xe.product)<0),Fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,qe=ke&&window.location.href||"http://localhost",Ge={...u,...je},Ve=function(e){function t(e,r,n,s){let o=e[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=e.length;return o=!o&&we.isArray(n)?n.length:o,a?(we.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!i):(n[o]&&we.isObject(n[o])||(n[o]=[]),t(e,r,n[o],s)&&we.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}(n[o])),!i)}if(we.isFormData(e)&&we.isFunction(e.entries)){const r={};return we.forEachEntry(e,(e,n)=>{t(function(e){return we.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null},Ke={transitional:Be,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,s=we.isObject(e);if(s&&we.isHTMLForm(e)&&(e=new FormData(e)),we.isFormData(e))return n?JSON.stringify(Ve(e)):e;if(we.isArrayBuffer(e)||we.isBuffer(e)||we.isStream(e)||we.isFile(e)||we.isBlob(e)||we.isReadableStream(e))return e;if(we.isArrayBufferView(e))return e.buffer;if(we.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Pe(e,new Ge.classes.URLSearchParams,{visitor:function(e,t,r,n){return Ge.isNode&&we.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=we.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Pe(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||n?(t.setContentType("application/json",!1),function(e){if(we.isString(e))try{return(0,JSON.parse)(e),we.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ke.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(we.isResponse(e)||we.isReadableStream(e))return e;if(e&&we.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw be.from(e,be.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ge.classes.FormData,Blob:Ge.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};we.forEach(["delete","get","head","post","put","patch"],e=>{Ke.headers[e]={}});const He=Ke,Ye=we.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"]),We=Symbol("internals");function Je(e){return e&&String(e).trim().toLowerCase()}function ze(e){return!1===e||null==e?e:we.isArray(e)?e.map(ze):String(e)}function Qe(e,t,r,n,s){return we.isFunction(n)?n.call(this,t,r):(s&&(t=r),we.isString(t)?we.isString(n)?-1!==t.indexOf(n):we.isRegExp(n)?n.test(t):void 0:void 0)}class Xe{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function s(e,t,r){const s=Je(t);if(!s)throw new Error("header name must be a non-empty string");const o=we.findKey(n,s);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=ze(e))}const o=(e,t)=>we.forEach(e,(e,r)=>s(e,r,t));if(we.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(we.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),r=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!r||t[r]&&Ye[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(we.isObject(e)&&we.isIterable(e)){let r,n,s={};for(const t of e){if(!we.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[n=t[0]]=(r=s[n])?we.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}o(s,t)}else null!=e&&s(t,e,r);return this}get(e,t){if(e=Je(e)){const r=we.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(we.isFunction(t))return t.call(this,e,r);if(we.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Je(e)){const r=we.findKey(this,e);return!(!r||void 0===this[r]||t&&!Qe(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function s(e){if(e=Je(e)){const s=we.findKey(r,e);!s||t&&!Qe(0,r[s],s,t)||(delete r[s],n=!0)}}return we.isArray(e)?e.forEach(s):s(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const s=t[r];e&&!Qe(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,r={};return we.forEach(this,(n,s)=>{const o=we.findKey(r,s);if(o)return t[o]=ze(n),void delete t[s];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(s):String(s).trim();i!==s&&delete t[s],t[i]=ze(n),r[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return we.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&we.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[We]=this[We]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Je(e);t[n]||(function(e,t){const r=we.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,s){return this[n].call(this,t,e,r,s)},configurable:!0})})}(r,e),t[n]=!0)}return we.isArray(e)?e.forEach(n):n(e),this}}Xe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),we.reduceDescriptors(Xe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),we.freezeMethods(Xe);const Ze=Xe;function et(e,t){const r=this||He,n=t||r,s=Ze.from(n.headers);let o=n.data;return we.forEach(e,function(e){o=e.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function tt(e){return!(!e||!e.__CANCEL__)}function rt(e,t,r){be.call(this,null==e?"canceled":e,be.ERR_CANCELED,t,r),this.name="CanceledError"}we.inherits(rt,be,{__CANCEL__:!0});const nt=rt;function st(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new be("Request failed with status code "+r.status,[be.ERR_BAD_REQUEST,be.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const ot=(e,t,r=3)=>{let n=0;const s=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s,o=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=n[i];s||(s=c),r[o]=a,n[o]=c;let u=i,d=0;for(;u!==o;)d+=r[u++],u%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let r,n,s=0,o=1e3/t;const i=(t,o=Date.now())=>{s=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=o?i(e,t):(r=e,n||(n=setTimeout(()=>{n=null,i(r)},o-a)))},()=>r&&i(r)]}(r=>{const o=r.loaded,i=r.lengthComputable?r.total:void 0,a=o-n,c=s(a);n=o,e({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})},r)},it=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},at=e=>(...t)=>we.asap(()=>e(...t)),ct=Ge.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Ge.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Ge.origin),Ge.navigator&&/(msie|trident)/i.test(Ge.navigator.userAgent)):()=>!0,lt=Ge.hasStandardBrowserEnv?{write(e,t,r,n,s,o){const i=[e+"="+encodeURIComponent(t)];we.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),we.isString(n)&&i.push("path="+n),we.isString(s)&&i.push("domain="+s),!0===o&&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:()=>null,remove(){}};function ut(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const dt=e=>e instanceof Ze?{...e}:e;function pt(e,t){t=t||{};const r={};function n(e,t,r,n){return we.isPlainObject(e)&&we.isPlainObject(t)?we.merge.call({caseless:n},e,t):we.isPlainObject(t)?we.merge({},t):we.isArray(t)?t.slice():t}function s(e,t,r,s){return we.isUndefined(t)?we.isUndefined(e)?void 0:n(void 0,e,0,s):n(e,t,0,s)}function o(e,t){if(!we.isUndefined(t))return n(void 0,t)}function i(e,t){return we.isUndefined(t)?we.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,s,o){return o in t?n(r,s):o in e?n(void 0,r):void 0}const c={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:a,headers:(e,t,r)=>s(dt(e),dt(t),0,!0)};return we.forEach(Object.keys({...e,...t}),function(n){const o=c[n]||s,i=o(e[n],t[n],n);we.isUndefined(i)&&o!==a||(r[n]=i)}),r}const ft=e=>{const t=pt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=Ze.from(i),t.url=$e(ut(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),we.isFormData(r))if(Ge.hasStandardBrowserEnv||Ge.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(we.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&i.set(e,r)})}if(Ge.hasStandardBrowserEnv&&(n&&we.isFunction(n)&&(n=n(t)),n||!1!==n&&ct(t.url))){const e=s&&o&&lt.read(o);e&&i.set(s,e)}return t},ht="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=ft(e);let s=n.data;const o=Ze.from(n.headers).normalize();let i,a,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=n;function h(){l&&l(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let E=new XMLHttpRequest;function S(){if(!E)return;const n=Ze.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders());st(function(e){t(e),h()},function(e){r(e),h()},{data:d&&"text"!==d&&"json"!==d?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:n,config:e,request:E}),E=null}E.open(n.method.toUpperCase(),n.url,!0),E.timeout=n.timeout,"onloadend"in E?E.onloadend=S:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(S)},E.onabort=function(){E&&(r(new be("Request aborted",be.ECONNABORTED,e,E)),E=null)},E.onerror=function(t){const n=t&&t.message?t.message:"Network Error",s=new be(n,be.ERR_NETWORK,e,E);s.event=t||null,r(s),E=null},E.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const s=n.transitional||Be;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new be(t,s.clarifyTimeoutError?be.ETIMEDOUT:be.ECONNABORTED,e,E)),E=null},void 0===s&&o.setContentType(null),"setRequestHeader"in E&&we.forEach(o.toJSON(),function(e,t){E.setRequestHeader(t,e)}),we.isUndefined(n.withCredentials)||(E.withCredentials=!!n.withCredentials),d&&"json"!==d&&(E.responseType=n.responseType),f&&([c,u]=ot(f,!0),E.addEventListener("progress",c)),p&&E.upload&&([a,l]=ot(p),E.upload.addEventListener("progress",a),E.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(i=t=>{E&&(r(!t||t.type?new nt(null,e,E):t),E.abort(),E=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===Ge.protocols.indexOf(g)?r(new be("Unsupported protocol "+g+":",be.ERR_BAD_REQUEST,e)):E.send(s||null)})},Et=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const s=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof be?t:new nt(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,s(new be(`timeout ${t} of ms exceeded`,be.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:a}=n;return a.unsubscribe=()=>we.asap(i),a}},St=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,s=0;for(;s<r;)n=s+t,yield e.slice(s,n),s=n},gt=(e,t,r,n)=>{const s=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*St(r,t)}(e,t);let o,i=0,a=e=>{o||(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await s.next();if(t)return a(),void e.close();let o=n.byteLength;if(r){let e=i+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),s.return())},{highWaterMark:2})},{isFunction:mt}=we,wt=(({Request:e,Response:t})=>({Request:e,Response:t}))(we.global),{ReadableStream:yt,TextEncoder:Rt}=we.global,It=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},bt=e=>{e=we.merge.call({skipUndefined:!0},wt,e);const{fetch:t,Request:r,Response:n}=e,s=t?mt(t):"function"==typeof fetch,o=mt(r),i=mt(n);if(!s)return!1;const a=s&&mt(yt),c=s&&("function"==typeof Rt?(l=new Rt,e=>l.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var l;const u=o&&a&&It(()=>{let e=!1;const t=new r(Ge.origin,{body:new yt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=i&&a&&It(()=>we.isReadableStream(new n("").body)),p={stream:d&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new be(`Response type '${e}' is not supported`,be.ERR_NOT_SUPPORT,r)})});return async e=>{let{url:s,method:i,data:a,signal:l,cancelToken:f,timeout:h,onDownloadProgress:E,onUploadProgress:S,responseType:g,headers:m,withCredentials:w="same-origin",fetchOptions:y}=ft(e),R=t||fetch;g=g?(g+"").toLowerCase():"text";let I=Et([l,f&&f.toAbortSignal()],h),b=null;const T=I&&I.unsubscribe&&(()=>{I.unsubscribe()});let A;try{if(S&&u&&"get"!==i&&"head"!==i&&0!==(A=await(async(e,t)=>{const n=we.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(we.isBlob(e))return e.size;if(we.isSpecCompliantForm(e)){const t=new r(Ge.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return we.isArrayBufferView(e)||we.isArrayBuffer(e)?e.byteLength:(we.isURLSearchParams(e)&&(e+=""),we.isString(e)?(await c(e)).byteLength:void 0)})(t):n})(m,a))){let e,t=new r(s,{method:"POST",body:a,duplex:"half"});if(we.isFormData(a)&&(e=t.headers.get("content-type"))&&m.setContentType(e),t.body){const[e,r]=it(A,ot(at(S)));a=gt(t.body,65536,e,r)}}we.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in r.prototype,l={...y,signal:I,method:i.toUpperCase(),headers:m.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};b=o&&new r(s,l);let f=await(o?R(b,y):R(s,l));const h=d&&("stream"===g||"response"===g);if(d&&(E||h&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=f[t]});const t=we.toFiniteNumber(f.headers.get("content-length")),[r,s]=E&&it(t,ot(at(E),!0))||[];f=new n(gt(f.body,65536,r,()=>{s&&s(),T&&T()}),e)}g=g||"text";let O=await p[we.findKey(p,g)||"text"](f,e);return!h&&T&&T(),await new Promise((t,r)=>{st(t,r,{data:O,headers:Ze.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:b})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new be("Network Error",be.ERR_NETWORK,e,b),{cause:t.cause||t});throw be.from(t,t&&t.code,e,b)}}},Tt=new Map,At=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i,a,c=o.length,l=Tt;for(;c--;)i=o[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:bt(t)),l=a;return a},Ot=(At(),{http:null,xhr:ht,fetch:{get:At}});we.forEach(Ot,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Nt=e=>`- ${e}`,Pt=e=>we.isFunction(e)||null===e||!1===e,Lt=(e,t)=>{e=we.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){let r;if(n=e[i],s=n,!Pt(n)&&(s=Ot[(r=String(n)).toLowerCase()],void 0===s))throw new be(`Unknown adapter '${r}'`);if(s&&(we.isFunction(s)||(s=s.get(t))))break;o[r||"#"+i]=s}if(!s){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=r?e.length>1?"since :\n"+e.map(Nt).join("\n"):" "+Nt(e[0]):"as no adapter specified";throw new be("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return s};function Ut(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nt(null,e)}function Ct(e){return Ut(e),e.headers=Ze.from(e.headers),e.data=et.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Lt(e.adapter||He.adapter,e)(e).then(function(t){return Ut(e),t.data=et.call(e,e.transformResponse,t),t.headers=Ze.from(t.headers),t},function(t){return tt(t)||(Ut(e),t&&t.response&&(t.response.data=et.call(e,e.transformResponse,t.response),t.response.headers=Ze.from(t.response.headers))),Promise.reject(t)})}const _t="1.12.2",vt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{vt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const $t={};vt.transitional=function(e,t,r){function n(e,t){return"[Axios v"+_t+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,s,o)=>{if(!1===e)throw new be(n(s," has been removed"+(t?" in "+t:"")),be.ERR_DEPRECATED);return t&&!$t[s]&&($t[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,s,o)}},vt.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const Dt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new be("options must be an object",be.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],i=t[o];if(i){const t=e[o],r=void 0===t||i(t,o,e);if(!0!==r)throw new be("option "+o+" must be "+r,be.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new be("Unknown option "+o,be.ERR_BAD_OPTION)}},validators:vt},Bt=Dt.validators;class jt{constructor(e){this.defaults=e||{},this.interceptors={request:new De,response:new De}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=pt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:s}=t;void 0!==r&&Dt.assertOptions(r,{silentJSONParsing:Bt.transitional(Bt.boolean),forcedJSONParsing:Bt.transitional(Bt.boolean),clarifyTimeoutError:Bt.transitional(Bt.boolean)},!1),null!=n&&(we.isFunction(n)?t.paramsSerializer={serialize:n}:Dt.assertOptions(n,{encode:Bt.function,serialize:Bt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Dt.assertOptions(t,{baseUrl:Bt.spelling("baseURL"),withXsrfToken:Bt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&we.merge(s.common,s[t.method]);s&&we.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=Ze.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[Ct.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let p=t;for(;d<u;){const e=i[d++],t=i[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=Ct.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return $e(ut((e=pt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}we.forEach(["delete","get","head","options"],function(e){jt.prototype[e]=function(t,r){return this.request(pt(r||{},{method:e,url:t,data:(r||{}).data}))}}),we.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,s){return this.request(pt(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}jt.prototype[e]=t(),jt.prototype[e+"Form"]=t(!0)});const kt=jt;class xt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,s){r.reason||(r.reason=new nt(e,n,s),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new xt(function(t){e=t}),cancel:e}}}const Mt=xt,Ft={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(Ft).forEach(([e,t])=>{Ft[t]=e});const qt=Ft,Gt=function e(t){const r=new kt(t),n=L(kt.prototype.request,r);return we.extend(n,kt.prototype,r,{allOwnKeys:!0}),we.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(pt(t,r))},n}(He);Gt.Axios=kt,Gt.CanceledError=nt,Gt.CancelToken=Mt,Gt.isCancel=tt,Gt.VERSION=_t,Gt.toFormData=Pe,Gt.AxiosError=be,Gt.Cancel=Gt.CanceledError,Gt.all=function(e){return Promise.all(e)},Gt.spread=function(e){return function(t){return e.apply(null,t)}},Gt.isAxiosError=function(e){return we.isObject(e)&&!0===e.isAxiosError},Gt.mergeConfig=pt,Gt.AxiosHeaders=Ze,Gt.formToJSON=e=>Ve(we.isHTMLForm(e)?new FormData(e):e),Gt.getAdapter=Lt,Gt.HttpStatusCode=qt,Gt.default=Gt;const Vt=Gt;var Kt=c(606);const{UNAUTHORIZED:Ht,FORBIDDEN:Yt,NOT_FOUND:Wt}=Kt.StatusCodes,Jt=[Ht,Yt,Wt],zt=async e=>{try{const{message:t,response:r,request:n}=e;let s=t;return r?s+=` - The request was made and the server responded with ${JSON.stringify({status:r.status,data:r.data})}`:n&&(s+=" - The request was made but no response was received"),console.warn(s),r&&Jt.includes(r.status)||await(0,f.reportError)(new Error(s)),s}catch(e){return console.warn(`Cannot handle error: ${e.message}`),e.message}},{APIS:{ASSETS_API:{BASE_URL:Qt,ENDPOINTS:{USERS:Xt,CERTIFICATES:Zt}}}}=E,er={create:async(e,t)=>{let r=[];try{const{data:n}=await Vt.post(`${Qt}${Xt}/${e}${Zt}`,t);n&&(r=n)}catch(e){await zt(e)}return r}},{APIS:{ASSETS_API:{BASE_URL:tr,ENDPOINTS:{USERS:rr,PROFILE_IMAGES:nr}}}}=E,sr={create:async({userId:e,fileObject:t})=>{let r=[];try{if(!e)throw new Error("userSlug not found!");const n=new FormData;n.append("file",t);const{data:s}=await Vt.post(`${tr}${rr}/${e}${nr}`,n);s&&(r=s)}catch(e){await zt(e)}return r}},{APIS:{ASSETS_API:{BASE_URL:or,ENDPOINTS:{LINK_PREVIEWS:ir}}}}=E,ar={certificates:er,profileImages:sr,linkPreviews:{get:async e=>{let t={};try{if(!e)throw new Error("url not found!");const{data:r}=await Vt.get(`${or}${ir}/${encodeURIComponent(btoa(e))}`);r&&r.url&&(t=r)}catch(e){await zt(e)}return t}}},{APIS:{AUTH_API:{BASE_URL:cr,ENDPOINTS:{USER_PASSWORD:lr,USERS:ur}}},USERS:{MYSELF:dr}}=E,pr={userPassword:{update:async e=>{let t=null;try{t=await Vt.put(`${cr}${ur}/${dr}${lr}`,e)}catch(e){t={message:(((e||{}).response||{}).data||{}).message},await zt(e)}return t}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:fr,ENDPOINTS:{ANSWERS:hr,QUESTIONS:Er,LIKES:Sr}}}}=E,gr=`${fr}${Er}`,mr={create:async({questionSlug:e},t)=>{try{await Vt.post(`${gr}/${encodeURIComponent(e)}${hr}`,t)}catch(e){const t=await zt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t})=>{try{await Vt.delete(`${gr}/${encodeURIComponent(e)}${hr}/${encodeURIComponent(t)}`)}catch(e){const t=await zt(e);throw new Error(t)}},update:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.put(`${gr}/${encodeURIComponent(e)}${hr}/${encodeURIComponent(t)}`,r)}catch(e){const t=await zt(e);throw new Error(t)}},like:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.post(`${gr}/${encodeURIComponent(e)}${hr}/${encodeURIComponent(t)}${Sr}`,r)}catch(e){const t=await zt(e);throw new Error(t)}},unlike:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.delete(`${gr}/${encodeURIComponent(e)}${hr}/${encodeURIComponent(t)}${Sr}`)}catch(e){const t=await zt(e);throw new Error(t)}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:wr,ENDPOINTS:{QUESTIONS:yr}}}}=E,Rr=`${wr}${yr}`,Ir={create:async e=>{try{return await Vt.post(Rr,e)}catch(e){const t=await zt(e);throw new Error(t)}},remove:async({questionSlug:e})=>{try{await Vt.delete(`${Rr}/${encodeURIComponent(e)}`)}catch(e){const t=await zt(e);throw new Error(t)}},update:async({questionSlug:e},t)=>{try{return await Vt.put(`${Rr}/${encodeURIComponent(e)}`,t)}catch(e){const t=await zt(e);throw new Error(t)}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:br,ENDPOINTS:{REPLIES:Tr,ANSWERS:Ar,QUESTIONS:Or,LIKES:Nr}}}}=E,Pr=`${br}${Or}`,Lr=({questionSlug:e,answerSlug:t,replySlug:r},n=!1)=>{let s=`${Pr}/${encodeURIComponent(e)}${Ar}/${encodeURIComponent(t)}${Tr}`;return r&&(s=`${s}/${encodeURIComponent(r)}`,n&&(s=`${s}${Nr}`)),s},Ur={create:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.post(Lr({questionSlug:e,answerSlug:t}),r)}catch(e){const t=await zt(e);throw new Error(t)}},update:async({questionSlug:e,answerSlug:t,replySlug:r},n)=>{try{return await Vt.put(Lr({questionSlug:e,answerSlug:t,replySlug:r}),n)}catch(e){const t=await zt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t,replySlug:r})=>{try{await Vt.delete(Lr({questionSlug:e,answerSlug:t,replySlug:r}))}catch(e){const t=await zt(e);throw new Error(t)}},like:async({questionSlug:e,answerSlug:t,replySlug:r,payload:n})=>{try{await Vt.post(Lr({questionSlug:e,answerSlug:t,replySlug:r},!0),n)}catch(e){const t=await zt(e);throw new Error(t)}},unlike:async({questionSlug:e,answerSlug:t,replySlug:r})=>{try{await Vt.delete(Lr({questionSlug:e,answerSlug:t,replySlug:r},!0))}catch(e){const t=await zt(e);throw new Error(t)}},getReplyUrl:Lr},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:Cr,ENDPOINTS:{QUESTIONS:_r,ANSWERS:vr,LIKES:$r}}}}=E,Dr=`${Cr}${_r}`,Br={answers:mr,questions:Ir,replies:Ur,likes:{create:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.post(`${Dr}/${encodeURIComponent(e)}${vr}/${encodeURIComponent(t)}${$r}`)}catch(e){const t=await zt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.delete(`${Dr}/${encodeURIComponent(e)}${vr}/${encodeURIComponent(t)}${$r}`)}catch(e){const t=await zt(e);throw new Error(t)}}}},{APIS:{COMMUNITIES_API:{BASE_URL:jr,ENDPOINTS:{COMMUNITIES:kr}}}}=E,xr=`${jr}${kr}`,Mr={join:async e=>{let t=null;try{const{data:r}=await Vt.put(`${xr}/${encodeURIComponent(e)}/membership`,{});t=r}catch(e){await zt(e)}return t}},{APIS:{MANAGEMENT_API:{BASE_URL:Fr,ENDPOINTS:{ACCOUNTS:qr}}}}=E,Gr={create:async e=>{try{await Vt.post(`${Fr}${qr}`,e)}catch(e){throw await zt(e),e}},read:async(e,t=null)=>{let r=null;try{const n=`${Fr}${qr}/${encodeURIComponent(e)}`,s=t?{ref:t}:{};({data:r}=await Vt.get(n,{params:s}))}catch(e){await zt(e)}return r},update:async(e,t)=>{try{await Vt.put(`${Fr}${qr}/${encodeURIComponent(e)}`,t)}catch(e){throw await zt(e),e}}},{APIS:{MANAGEMENT_API:{BASE_URL:Vr,ENDPOINTS:{EVENT_REGISTRATIONS:Kr}}}}=E,Hr={create:async e=>{try{await Vt.post(`${Vr}${Kr}`,e)}catch(e){const t=await zt(e);throw new Error(t)}}},{APIS:{MANAGEMENT_API:{BASE_URL:Yr,ENDPOINTS:{LOGINS:Wr,LOGIN_PASSWORDLESS:Jr}}}}=E,zr=`${Yr}${Wr}`,Qr={update:async e=>{try{await Vt.put(`${zr}/${encodeURIComponent(e)}${Jr}`)}catch(e){throw await zt(e),e}}},{APIS:{MANAGEMENT_API:{BASE_URL:Xr}}}=E,Zr={create:async e=>{try{await Vt.post(`${Xr}/users/${e.id}/products`,e)}catch(e){const t=await zt(e);throw new Error(t)}}},{APIS:{MANAGEMENT_API:{BASE_URL:en,ENDPOINTS:{PROFILE:tn}}}}=E,rn={accounts:Gr,eventRegistrations:Hr,passwordless:Qr,userProducts:Zr,profile:{update:async e=>{try{const t=["name","jobTitle","organization","location","biography","image"];if(!Object.keys(e).some(e=>t.includes(e)))throw new Error("Profile data should include at least one of 'name', 'jobTitle', 'organization', 'location', 'biography', 'image'");await Vt.put(`${en}${tn}`,e)}catch(e){const t=await zt(e);throw new Error(`An error occurred while trying to update the user's profile in the management api: ${t}`)}}}},{APIS:{MGMT_API:{BASE_URL:nn,ENDPOINTS:{REFERRALS:sn}}}}=E,on={create:async e=>{try{await Vt.post(`${nn}${sn}`,e)}catch(e){throw await zt(e),e}}},{APIS:{MGMT_API:{BASE_URL:an,ENDPOINTS:{BULK_REFERRALS:cn}}}}=E,ln={create:async e=>{try{await Vt.post(`${an}${cn}`,e)}catch(e){throw await zt(e),e}}},{APIS:{MGMT_API:{BASE_URL:un,ENDPOINTS:{BULK_ENROLMENTS:dn}}}}=E,pn={referrals:on,bulkReferrals:ln,bulkEnrolments:{create:async e=>{try{await Vt.post(`${un}${dn}`,e)}catch(e){throw await zt(e),e}}}},{APIS:{PAYMENTS_API:{BASE_URL_V2:fn,ENDPOINTS:{PRODUCTS:hn}}}}=E,En=`${fn}${hn}`,Sn={products:{list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(En,r);e&&e.length&&(t=e)}catch(e){await zt(e)}return t}}},{APIS:{PEOPLE_API:{BASE_URL_V2:gn,ENDPOINTS:{BULK_ENROLMENTS:mn}}}}=E,wn={list:async e=>{let t=[];try{const{data:r}=await Vt.get(`${gn}${mn}`,{params:e});r&&r.length&&(t=r)}catch(e){await zt(e)}return t}},{OK:yn,MULTIPLE_CHOICES:Rn,NOT_FOUND:In,FORBIDDEN:bn}=Kt.StatusCodes,Tn=e=>e>=yn&&e<Rn||e===bn||e===In,{APIS:{PEOPLE_API:{BASE_URL_V2:An,ENDPOINTS:{USERS:On}}},STATUS_CODES:{INVALID_TOKEN:Nn},ERROR_MESSAGES:{INVALID_TOKEN:Pn}}=E,Ln=async e=>{let t=null;try{const{data:r}=await Vt.get(`${An}${On}/${encodeURIComponent(e)}`,{validateStatus:Tn});r&&r.id&&(t=r)}catch(e){if(e?.response?.status===Nn)throw new Error(Pn);await zt(e)}return t},Un=async e=>{let t=[];try{if(e&&e.length<2)throw new Error("users list method requires at least two ids");const r=e.map(e=>`ids=${encodeURIComponent(e)}`).join("&"),n=await Vt.get(`${An}${On}?${r}`,{validateStatus:Tn});n&&n.length&&(t=n)}catch(e){await zt(e)}return t},Cn={read:Ln,update:async(e,t)=>{let r=!1;try{const{data:n}=await Vt.put(`${An}${On}/${encodeURIComponent(e)}`,t);r=!(!n||!n.id)}catch(e){await zt(e)}return r},list:Un},{APIS:{PEOPLE_API:{BASE_URL_V2:_n,ENDPOINTS:{USERS:vn,USER_LIKES:$n}}},USERS:{MYSELF:Dn}}=E,Bn=`${_n}${vn}/${Dn}${$n}`,jn=async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Bn,r);e&&e.length&&(t=e)}catch(e){await zt(e)}return t},kn={list:jn},xn={authors:{readQuestionAuthors:async(e,t,r)=>{try{if(e.author=await Ln(e.authorId),e.answers&&e.answers.length&&!r.ignoreAnswersAuthors){e.answers.sort((e,t)=>new Date(t.updatedAt)-new Date(e.updatedAt)),e.totalAnswers=e.answers.length;let n=e.answers;if(r.limit&&r.pageNumber){const t=r.limit*(r.pageNumber-1);n=e.answers.slice(t,t+r.limit)}for(let e of n){e.author=e.authorId&&await Ln(e.authorId)||{};const[r]=t?await jn({contentType:E.CONTENTFUL.ANSWERS.TYPE,contentSlug:e.slug}):[null];e.userLiked=!!r}e.answers=n}else e.answers||(e.answers=[]);return e}catch(e){throw await zt(e),new Error(`Cannot read authors for question: ${e.message}`)}},readAuthors:async(e=[])=>{let t=[];try{if(!1===Array.isArray(e))throw new Error("authorIds is not an array!");if(e&&1===e.length){const r=await Ln(e[0]);r&&t.push(r)}else if(e&&e.length>1){const r=await Un(e);r&&r.length>0&&(t=r)}}catch(e){throw await zt(e),new Error(`Cannot read authors: ${e.message}`)}return t}}},{APIS:{PEOPLE_API:{BASE_URL:Mn,ENDPOINTS:{REGISTRATIONS:Fn}}}}=E,qn={list:async e=>{let t=[];try{const{data:r}=await Vt.get(`${Mn}${Fn}`,{params:e});r&&r.length&&(t=r)}catch(e){await zt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:Gn,ENDPOINTS:{COMMUNITIES:Vn,USERS:Kn}}}}=E,Hn=`${Gn}${Kn}`;function Yn(e){const t=e["content-range"].split(" ")[1].split("/"),[r,n,s]=[...t[0].split("-"),t[1]].map(e=>parseInt(e,10)||0);return{start:r,end:n,total:s}}const Wn={list:async(e="me",t={})=>{let r={items:[],start:0,end:0,total:0},n=t?{params:t}:{params:{}};try{const{data:t,headers:s}=await Vt.get(`${Hn}/${e}${Vn}`,{...n,headers:{"Cache-Control":"no-cache",Pragma:"no-cache",Expires:0}});return t?.length>0&&(r={data:t,pagination:Yn(s)}),r}catch(e){await zt(e)}return r}},{APIS:{PEOPLE_API:{BASE_URL_V2:Jn,ENDPOINTS:{USERS:zn,USER_COURSES:Qn}}},USERS:{MYSELF:Xn}}=E,Zn=`${Jn}${zn}/${Xn}${Qn}`,es={create:async e=>{try{await Vt.post(Zn,e)}catch(e){await zt(e)}},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Zn,r);e&&e.length&&(t=e)}catch(e){await zt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${Zn}/${e}`,t)}catch(e){await zt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:ts,ENDPOINTS:{USERS:rs,USER_EVENTS:ns}}},USERS:{MYSELF:ss}}=E,os=`${ts}${rs}/${ss}${ns}`,is={list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(os,r);e&&e.length&&(t=e)}catch(e){await zt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:as,ENDPOINTS:{USERS:cs,USER_LESSONS:ls}}},USERS:{MYSELF:us}}=E,ds=`${as}${cs}/${us}${ls}`,ps={create:async e=>{let t=null;try{t=await Vt.post(ds,e)}catch(e){await zt(e)}return t},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(ds,r);e&&e.length&&(t=e)}catch(e){await zt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:fs,ENDPOINTS:{USERS:hs,USER_PRODUCTS:Es}}},USERS:{MYSELF:Ss}}=E,gs=`${fs}${hs}/${Ss}${Es}`,ms={create:async e=>{let t=null;try{t=await Vt.post(gs,e)}catch(e){await zt(e)}return t},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(gs,r);e&&e.length&&(t=e)}catch(e){await zt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${gs}/${e}`,t)}catch(e){await zt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:ws,ENDPOINTS:{USERS:ys,USER_RATINGS:Rs}}},USERS:{MYSELF:Is}}=E,bs=`${ws}${ys}/${Is}${Rs}`,Ts={create:async e=>{let t=null;try{const{data:r}=await Vt.post(bs,e);r?.id&&(t=r)}catch(e){await zt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${bs}/${e}`,t)}catch(e){await zt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:As,ENDPOINTS:{USERS:Os,USER_REFERRALS:Ns}}},USERS:{MYSELF:Ps}}=E,Ls=`${As}${Os}/${Ps}${Ns}`,Us={bulkEnrolments:wn,handlers:xn,registrations:qn,users:Cn,userCommunities:Wn,userCourses:es,userEvents:is,userLessons:ps,userLikes:kn,userProducts:ms,userRatings:Ts,userReferrals:{list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Ls,r);e&&e.length&&(t=e)}catch(e){await zt(e)}return t}}},{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:Cs,ENDPOINTS:{ENQUIRY_EMAILS:_s}}}}=E,vs={create:async e=>{let t=null;try{const{data:r}=await Vt.post(`${Cs}${_s}`,e);r&&(t=r)}catch(e){await zt(e)}return t}},$s={forms:{sendEnquiryEmails:async e=>{let t=null;try{const{emailIds:r}=R();t=await xs.emails.create({...r,...e})}catch(e){await zt(e)}return t}}},{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:Ds,ENDPOINTS:{USERS:Bs,USER_PROPERTIES:js}}},USERS:{MYSELF:ks}}=E,xs={emails:vs,handlers:$s,userProperties:{update:async(e,t)=>{try{await Vt.put(`${Ds}${Bs}/${ks}${js}/${e}`,t)}catch(e){await zt(e)}}}};var Ms=c(443);const{APIS:{SEARCH_API:{BASE_URL:Fs,ENDPOINTS:{AI_SEARCH:qs}}}}=E,Gs=`${Fs}${qs}`,Vs={ask:async e=>{try{let t=null;const{data:r}=await Vt.get(Gs,{params:{question:e}});return r?.answer&&r?.references&&r?.version&&(t=r),t}catch(e){const t=await zt(e);throw new Error(t)}},stream:(e,t,r)=>{const n=(0,Ms.io)(void 0,{path:"/api/search-api/web-sockets"});function s(){n.emit("ai-search",{question:e})}function o(e){r(e),i(),n.disconnect()}function i(){n.off("connect",s),n.off("update",t),n.off("result",o)}return n.on("connect",s),n.on("update",t),n.on("result",o),i}},{APIS:{SEARCH_API:{BASE_URL:Ks,ENDPOINTS:{CHATBOT:{COURSES:Hs}}}}}=E,Ys=`${Ks}${Hs}`;async function Ws(e,t){try{let r=null;const{data:n}=await Vt.get(`${Ys}/${e}`,{params:{text:t}});return n&&(r=n),r}catch(e){await zt(e)}}const Js=(e,t,r,n)=>{const s=(0,Ms.io)(void 0,{path:"/api/search-api/web-sockets"});function o(){s.emit("chatbot",{text:e,courseSlug:t})}s.on("connect",o),s.on("update",r),s.on("result",function e(t){n(t),s.off("connect",o),s.off("update",r),s.off("result",e),s.disconnect()})};async function zs(e){try{let t=null;const{data:r}=await Vt.delete(`${Ys}/${e}`);return r&&(t=r),t}catch(e){await zt(e)}}const Qs={...Vs,chatbot:{courses:d}},{CONTENTFUL:Xs}=E,{TYPE:Zs,ORDER:eo,SELECT:to,SKIP:ro,LIMIT:no,INCLUDE:so}=Xs.BADGES,oo={list:async()=>{try{return await(0,p.getEntries)({content_type:Zs,include:so,limit:no,order:eo,select:to,skip:ro})}catch(e){return await zt(e),[]}}},{CONTENTFUL:io}=E,{CARD_TYPES:ao}=io.CAROUSELS,co={read:async(e,t)=>{try{if(!t||!t.sys||!t.sys.id)throw new Error("Invalid link to card");if(!e||!ao[e])throw new Error("Unsupported card content type");const{INCLUDE:r,SELECT:n}=ao[e],s=await(0,p.getEntry)({content_type:e,"sys.id":t.sys.id,include:r,select:n},{assetDetails:!0});if("courseJourney"===e){const e=await(0,p.getEntry)({content_type:"course","fields.journeys.sys.id":t.sys.id,include:1,select:"fields.slug,fields.journeys"});s.courseParent=e}return s}catch(e){throw await zt(e),new Error(`Cannot read carousel card: ${e.message}`)}}},lo=co,{CONTENTFUL:uo}=E,{INCLUDE:po,SELECT:fo,TYPE:ho}=uo.EDITORIAL_PAGES,Eo={read:async e=>{try{return await(0,p.getEntry)({content_type:ho,"fields.slug":e,include:po,select:fo})}catch(e){throw await zt(e),new Error(`Cannot read editorial page: ${e.message}`)}}},{CONTENTFUL:So}=E,{TYPE:go,ORDER:mo,SELECT:wo,SKIP:yo,LIMIT:Ro,INCLUDE:Io}=So.QUESTIONS,bo={read:async e=>{try{return await(0,p.getEntry)({content_type:go,"fields.slug":e,include:2,select:wo})}catch(e){throw await zt(e),new Error(`Cannot read question: ${e.message}`)}},list:async(e={})=>{try{return await(0,p.getEntries)({content_type:go,include:Io,limit:Ro,order:mo,select:wo,skip:yo,...e})}catch(e){throw await zt(e),new Error(`Cannot list questions: ${e.message}`)}}};var To=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(s=n;0!==s--;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(s=n;0!==s--;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;0!==s--;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r};const Ao="__googleMapsScriptId";var Oo;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(Oo||(Oo={}));class No{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:n,id:s=Ao,language:o,libraries:i=[],mapIds:a,nonce:c,region:l,retries:u=3,url:d="https://maps.googleapis.com/maps/api/js",version:p}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=r,this.client=n,this.id=s||Ao,this.language=o,this.libraries=i,this.mapIds=a,this.nonce=c,this.region=l,this.retries=u,this.url=d,this.version=p,No.instance){if(!To(this.options,No.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(No.instance.options)}`);return No.instance}No.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?Oo.FAILURE:this.done?Oo.SUCCESS:this.loading?Oo.LOADING:Oo.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`&region=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(r=>{r?t(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id))return void this.callback();const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(e=>!r[e]&&delete r[e]),(null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.importLibrary)||(e=>{let t,r,n,s="The Google Maps JavaScript API",o="google",i="importLibrary",a="__ib__",c=document,l=window;l=l[o]||(l[o]={});const u=l.maps||(l.maps={}),d=new Set,p=new URLSearchParams,f=()=>t||(t=new Promise((i,l)=>{return f=this,h=void 0,S=function*(){var f;for(n in yield r=c.createElement("script"),r.id=this.id,p.set("libraries",[...d]+""),e)p.set(n.replace(/[A-Z]/g,e=>"_"+e[0].toLowerCase()),e[n]);p.set("callback",o+".maps."+a),r.src=this.url+"?"+p,u[a]=i,r.onerror=()=>t=l(Error(s+" could not load.")),r.nonce=this.nonce||(null===(f=c.querySelector("script[nonce]"))||void 0===f?void 0:f.nonce)||"",c.head.append(r)},new((E=void 0)||(E=Promise))(function(e,t){function r(e){try{s(S.next(e))}catch(e){t(e)}}function n(e){try{s(S.throw(e))}catch(e){t(e)}}function s(t){var s;t.done?e(t.value):(s=t.value,s instanceof E?s:new E(function(e){e(s)})).then(r,n)}s((S=S.apply(f,h||[])).next())});var f,h,E,S}));u[i]?console.warn(s+" only loads once. Ignoring:",e):u[i]=(e,...t)=>d.add(e)&&f().then(()=>u[i](e,...t))})(r);const n=this.libraries.map(e=>this.importLibrary(e));n.length||n.push(this.importLibrary("core")),Promise.all(n).then(()=>this.callback(),e=>{const t=new ErrorEvent("error",{error:e});this.loadErrorCallback(t)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${e} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setScript())}}}const{GOOGLE:{MAPS:{LIBRARIES:{GEOCODING:Po,PLACES:Lo},VERSION:Uo}}}=E,Co=function(e={}){let t=[];const r=R(),n=new No({apiKey:r?.googleMaps?.apiKey,version:Uo});return{buildLocation:async function(e){try{const r=t.find(t=>t.description===e);if(!r)throw new Error("Place not found");const{place_id:s,description:o}=r,{Geocoder:i}=await n.importLibrary(Po),a=new i;return new Promise(e=>{a.geocode({placeId:s},(t=[],r)=>{if("OK"===r){const r=t[0].address_components.find(e=>e.types.includes("country")),n=r?r.short_name:null;e({id:s,en:o,code:n})}else e({id:s,en:o,code:null})}).catch(()=>e({id:s,en:o,code:null}))})}catch(e){return await zt(e),null}},isValidPlace:function(e){return t.some(t=>t.description===e)},predictPlaces:async function(r){try{const{AutocompleteService:s}=await n.importLibrary(Lo),o=new s;return new Promise(n=>{o.getPlacePredictions({...e,input:r,types:["(cities)"]},(e=[],r)=>{"OK"===r?(t=e,n(e)):n([])}).catch(()=>n([]))})}catch(e){return await zt(e),[]}}}},_o=async(e,t,r={ignoreAnswersAuthors:!1})=>{try{let n={};return n=await bo.read(e),n=await Us.handlers.authors.readQuestionAuthors(n,t,r),n}catch(e){throw await zt(e),new Error(`Cannot build question: ${e.message}`)}},{ARTICLES:{TYPE:vo},COURSES:{TYPE:$o},COURSE_JOURNEYS:{TYPE:Do},CUSTOM_CARD:{TYPE:Bo},COMMUNITY:{TYPE:jo},EVENTS:{TYPE:ko},LISTS:{TYPE:xo},QUESTIONS:{TYPE:Mo},LEARNING_HUB:{TYPE:Fo}}=E.CONTENTFUL,qo={ClosedHidden:"closed-hidden",ClosedVisible:"closed-visible",OpenHidden:"open-hidden",OpenVisible:"open-visible"},Go=e=>e&&e.url?(Object.assign(e,{aspect:"responsiveCard",query:"q=90&fit=fill"}),e):null,Vo=e=>e&&e.url?`${e.url}?w=100&h=100&fit=thumb&f=center`:null,Ko=e=>e.toLowerCase().split(" ")[0],Ho={[vo]:async e=>{const{authorIds:t,authorTag:r,image:n,coverImage:s,publishedDate:o,readingTime:i,slug:a,title:c}=e;let l=n;s&&(l.url=s.url,l.width=s.width,l.height=s.height,l.color=s.color);const u=await Us.handlers.authors.readAuthors(t),d=u&&u.length?u:r?[Ko(r)]:null;return{banner:Go(l),contributors:d,publishedDate:o,readingTime:i,slug:a,title:c}},[jo]:async e=>{const{title:t,slug:r,image:n,privacy:s,createdAt:o}=e,i=[qo.ClosedVisible,qo.ClosedHidden].includes(s),a=[qo.OpenVisible,qo.ClosedVisible].includes(s);return{banner:n?Go(n):null,slug:r,title:t,privacy:s,isPrivate:i,isVisible:a,createdAt:o}},[$o]:async(e,t)=>{const{banner:r,freeCourse:n,partnershipDetails:s,slug:o,title:i,registered:a,courseType:c,courseV2:l}=e,u={banner:Go(r),slug:o,title:i,pill:n?"free":"premium",registered:!!a,courseType:c,courseV2:l};if(s){const{partners:e}=s;if(e)if(e.length>1){let t=[];for(let r=0;r<e.length;r++)t.push(e[r].title);u.partner=t}else u.partner=[e[0].title]}if(void 0===a&&t){const[e]=await Us.userProducts.list({courseSlug:o});u.registered=!!e}return u},[Do]:async(e,t)=>{const{bannerImage:r,slug:n,title:s,courseParent:o,accessPrivacy:i,partnerLogos:a,locale:c}=e;let l,u=!1;if(t){const[e]=await Us.userProducts.list({courseSlug:o.slug,journeySlug:n});u=!!e}return l=o.journeys&&o.journeys[0]?.slug===n?o.slug:`${o.slug}/${n}`,{banner:Go(r),slug:l,title:s,partner:a?a.map(e=>e.title):[],registered:u,pill:i.includes("open")?"free":"premium",courseType:i.includes("public")?"Public":"Private",customLabel:"Course",locale:c||"en"}},[Bo]:e=>{const{authorName:t,authorImage:r,icon:n,image:s,label:o,link:i,primaryText:a}=e;return{...e,banner:s?Go(s):null,customIcon:n?n.toLowerCase():null,customLabel:o,contributors:t?[{name:t,image:r?{thumbnail:Vo(r)}:null}]:null,slug:i,text:a}},[ko]:async(e,t)=>{const{bannerImage:r,defaultStartDate:n,isEventOngoing:s,slug:o,speakers:i,title:a,registered:c}=e,l=new Date(n),u=!!l&&l<new Date;if(i&&i.length)for(const e of i)e.image=Vo(e.image);const d={banner:Go(r),dateHasPassed:u,title:a,slug:o,isOngoingEvent:s,contributors:i,startDate:l,registered:!!c};if(void 0===c&&t){const[e]=await Us.userEvents.list({eventSlug:o});d.registered=!!e}return d},[xo]:async e=>{const{hero:t,slug:r,title:n}=e;return{banner:Go(t),slug:r,title:n}},[Mo]:async e=>{const{answers:t,authorId:r,createdAt:n,slug:s,title:o}=e;let i=null;if(r){const e=await Us.users.read(r);e&&(i=e)}return{answers:t&&t.length?t.length:0,contributors:i?[i]:[],createdAt:n,slug:s,title:o}},[Fo]:e=>{const{bannerSection:t,customLabel:r,slug:n,title:s}=e;return{banner:Go(t.image),slug:n,title:s,customLabel:r}},people:e=>{const{id:t,name:r,jobTitle:n,location:s,image:o,customLink:i}=e;return{profile:o,slug:i?.link||t,title:r,text:n,secondaryText:s,customLinkText:i?.text}}},Yo=async({contentType:e,...t}={},r)=>{try{if(!Ho[e])throw new Error("Content type not supported");if("function"!=typeof Ho[e])throw new Error("No builder function for content type");return"people"!==e&&t.sys&&t.sys.type&&"Link"===t.sys.type&&(t=await lo.read(e,t)),{contentType:e,...await Ho[e](t,r)}}catch(e){throw await zt(e),new Error(`Cannot build carousel card: ${e.message}`)}},Wo=async(e,t,r={})=>{try{if(!e.replies||0===e.replies.length)return e.replies=[],e;e.replies.sort((e,t)=>new Date(e.postedAt)-new Date(t.postedAt)),e.totalReplies=e.totalReplies||e.replies.length;let n=e.replies;if(r.limit&&r.pageNumber){const t=r.limit*(r.pageNumber-1);n=e.replies.slice(t,t+r.limit)}for(const r of n){if(r.authorId===e.authorId){r.author=e.author,r.userLiked=!1;continue}r.author=r.authorId&&await Ln(r.authorId)||{};const[n]=t?await jn({contentType:E.CONTENTFUL.REPLIES.TYPE,contentSlug:r.slug}):[null];r.userLiked=!!n}return e.replies=n,e}catch(e){throw await zt(e),new Error(`Cannot build replies for answer: ${e.message}`)}},Jo="success",zo="error",Qo=e=>async t=>{const{contentType:r}=t;switch(r){case"event":try{return await rn.eventRegistrations.create({eventSlug:t.slug,expectation:null,userEmail:e.email,startsAt:new Date(t.startDate).toISOString()}),Jo}catch(e){return reportError(new Error(`Error registering for event: ${JSON.stringify(e)}`)),zo}case"microcourse":try{return await rn.userProducts.create({id:e.id,courseSlug:t.slug,email:e.email,courseType:t.courseType}),Jo}catch(e){return reportError(new Error(`Error registering for microcourse: ${JSON.stringify(e)}`)),zo}case"communityPage":try{return await Mr.join(t.slug),Jo}catch(e){return reportError(new Error(`Error joining community: ${JSON.stringify(e)}`)),zo}default:return zo}};var Xo=c(18);const Zo=e=>e&&Xo.Buffer.from(e,"base64").toString("ascii");function ei({contentContext:e=null,errorsContext:t=null,googleMapsContext:r=null,gtmContext:n=null,origin:s}){try{const o=P(s);return e&&(0,p.setContext)(Object.assign({},e,{environment:o})),t&&(0,f.setContext)(Object.assign({},t,{environment:o})),r&&y(Object.assign({},r,{environment:o})),n&&((0,h.setContext)(Object.assign({},n,{environment:o})),(0,h.setupGTM)()),w(Object.assign({},{environment:o})),o}catch(e){console.warn(`Cannot load SDK: ${e.message}`)}}return l})());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/sdk",
3
- "version": "12.2.0-ent-211.0",
3
+ "version": "12.2.1-ra0",
4
4
  "description": "Browser library to interact with Apolitical's APIs",
5
5
  "author": "Apolitical Group Limited <engineering@apolitical.co>",
6
6
  "license": "MIT",