@tryghost/content-api 1.11.8 → 1.11.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/content-api",
3
- "version": "1.11.8",
3
+ "version": "1.11.9",
4
4
  "repository": "https://github.com/TryGhost/SDK/tree/master/packages/content-api",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
@@ -35,7 +35,7 @@
35
35
  "@babel/preset-env": "7.21.4",
36
36
  "@rollup/plugin-json": "6.0.0",
37
37
  "c8": "7.13.0",
38
- "core-js": "3.30.0",
38
+ "core-js": "3.30.1",
39
39
  "eslint-plugin-ghost": "2.16.0",
40
40
  "mocha": "10.2.0",
41
41
  "rollup": "2.79.1",
@@ -51,5 +51,5 @@
51
51
  "dependencies": {
52
52
  "axios": "^0.27.0"
53
53
  },
54
- "gitHead": "cf56126d88e83961e52e001031cc8c3f43fd050a"
54
+ "gitHead": "5ab28a6e7bda4dd02c480e8fe20f22636f048272"
55
55
  }
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).GhostContentAPI=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}var r,n,o=function(e){return e&&e.Math==Math&&e},i=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof e&&e)||function(){return this}()||Function("return this")(),a=function(e){try{return!!e()}catch(e){return!0}},s=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u=!a((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),c=Function.prototype.call,f=u?c.bind(c):function(){return c.apply(c,arguments)},l={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,p={f:h&&!l.call({1:2},1)?function(e){var t=h(this,e);return!!t&&t.enumerable}:l},d=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},m=Function.prototype,v=m.call,g=u&&m.bind.bind(v,v),y=u?g:function(e){return function(){return v.apply(e,arguments)}},b=y({}.toString),w=y("".slice),O=function(e){return w(b(e),8,-1)},E=function(e){if("Function"===O(e))return y(e)},j=Object,R=E("".split),S=a((function(){return!j("z").propertyIsEnumerable(0)}))?function(e){return"String"==O(e)?R(e,""):j(e)}:j,A=function(e){return null==e},C=TypeError,P=function(e){if(A(e))throw C("Can't call method on "+e);return e},T=function(e){return S(P(e))},x="object"==typeof document&&document.all,U={all:x,IS_HTMLDDA:void 0===x&&void 0!==x},_=U.all,N=U.IS_HTMLDDA?function(e){return"function"==typeof e||e===_}:function(e){return"function"==typeof e},D=U.all,L=U.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:N(e)||e===D}:function(e){return"object"==typeof e?null!==e:N(e)},I=function(e){return N(e)?e:void 0},k=function(e,t){return arguments.length<2?I(i[e]):i[e]&&i[e][t]},q=E({}.isPrototypeOf),B=k("navigator","userAgent")||"",F=i.process,$=i.Deno,M=F&&F.versions||$&&$.version,z=M&&M.v8;z&&(n=(r=z.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&B&&(!(r=B.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=B.match(/Chrome\/(\d+)/))&&(n=+r[1]);var W=n,H=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&W&&W<41})),J=H&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,V=Object,K=J?function(e){return"symbol"==typeof e}:function(e){var t=k("Symbol");return N(t)&&q(t.prototype,V(e))},G=String,X=TypeError,Q=function(e){if(N(e))return e;throw X(function(e){try{return G(e)}catch(e){return"Object"}}(e)+" is not a function")},Y=TypeError,Z=Object.defineProperty,ee=function(e,t){try{Z(i,e,{value:t,configurable:!0,writable:!0})}catch(r){i[e]=t}return t},te="__core-js_shared__",re=i[te]||ee(te,{}),ne=t((function(e){(e.exports=function(e,t){return re[e]||(re[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"})})),oe=Object,ie=E({}.hasOwnProperty),ae=Object.hasOwn||function(e,t){return ie(oe(P(e)),t)},se=0,ue=Math.random(),ce=E(1..toString),fe=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ce(++se+ue,36)},le=ne("wks"),he=i.Symbol,pe=he&&he.for,de=J?he:he&&he.withoutSetter||fe,me=function(e){if(!ae(le,e)||!H&&"string"!=typeof le[e]){var t="Symbol."+e;H&&ae(he,e)?le[e]=he[e]:le[e]=J&&pe?pe(t):de(t)}return le[e]},ve=TypeError,ge=me("toPrimitive"),ye=function(e,t){if(!L(e)||K(e))return e;var r,n,o=(r=e[ge],A(r)?void 0:Q(r));if(o){if(void 0===t&&(t="default"),n=f(o,e,t),!L(n)||K(n))return n;throw ve("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,n;if("string"===t&&N(r=e.toString)&&!L(n=f(r,e)))return n;if(N(r=e.valueOf)&&!L(n=f(r,e)))return n;if("string"!==t&&N(r=e.toString)&&!L(n=f(r,e)))return n;throw Y("Can't convert object to primitive value")}(e,t)},be=function(e){var t=ye(e,"string");return K(t)?t:t+""},we=i.document,Oe=L(we)&&L(we.createElement),Ee=function(e){return Oe?we.createElement(e):{}},je=!s&&!a((function(){return 7!=Object.defineProperty(Ee("div"),"a",{get:function(){return 7}}).a})),Re=Object.getOwnPropertyDescriptor,Se={f:s?Re:function(e,t){if(e=T(e),t=be(t),je)try{return Re(e,t)}catch(e){}if(ae(e,t))return d(!f(p.f,e,t),e[t])}},Ae=s&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ce=String,Pe=TypeError,Te=function(e){if(L(e))return e;throw Pe(Ce(e)+" is not an object")},xe=TypeError,Ue=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,Ne="enumerable",De="configurable",Le="writable",Ie={f:s?Ae?function(e,t,r){if(Te(e),t=be(t),Te(r),"function"==typeof e&&"prototype"===t&&"value"in r&&Le in r&&!r.writable){var n=_e(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:De in r?r.configurable:n.configurable,enumerable:Ne in r?r.enumerable:n.enumerable,writable:!1})}return Ue(e,t,r)}:Ue:function(e,t,r){if(Te(e),t=be(t),Te(r),je)try{return Ue(e,t,r)}catch(e){}if("get"in r||"set"in r)throw xe("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},ke=s?function(e,t,r){return Ie.f(e,t,d(1,r))}:function(e,t,r){return e[t]=r,e},qe=Function.prototype,Be=s&&Object.getOwnPropertyDescriptor,Fe=ae(qe,"name"),$e={EXISTS:Fe,PROPER:Fe&&"something"===function(){}.name,CONFIGURABLE:Fe&&(!s||s&&Be(qe,"name").configurable)},Me=E(Function.toString);N(re.inspectSource)||(re.inspectSource=function(e){return Me(e)});var ze,We,He,Je=re.inspectSource,Ve=i.WeakMap,Ke=N(Ve)&&/native code/.test(String(Ve)),Ge=ne("keys"),Xe=function(e){return Ge[e]||(Ge[e]=fe(e))},Qe={},Ye="Object already initialized",Ze=i.TypeError,et=i.WeakMap;if(Ke||re.state){var tt=re.state||(re.state=new et);tt.get=tt.get,tt.has=tt.has,tt.set=tt.set,ze=function(e,t){if(tt.has(e))throw Ze(Ye);return t.facade=e,tt.set(e,t),t},We=function(e){return tt.get(e)||{}},He=function(e){return tt.has(e)}}else{var rt=Xe("state");Qe[rt]=!0,ze=function(e,t){if(ae(e,rt))throw Ze(Ye);return t.facade=e,ke(e,rt,t),t},We=function(e){return ae(e,rt)?e[rt]:{}},He=function(e){return ae(e,rt)}}var nt,ot={set:ze,get:We,has:He,enforce:function(e){return He(e)?We(e):ze(e,{})},getterFor:function(e){return function(t){var r;if(!L(t)||(r=We(t)).type!==e)throw Ze("Incompatible receiver, "+e+" required");return r}}},it=t((function(e){var t=$e.CONFIGURABLE,r=ot.enforce,n=ot.get,o=Object.defineProperty,i=s&&!a((function(){return 8!==o((function(){}),"length",{value:8}).length})),u=String(String).split("String"),c=e.exports=function(e,n,a){"Symbol("===String(n).slice(0,7)&&(n="["+String(n).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),a&&a.getter&&(n="get "+n),a&&a.setter&&(n="set "+n),(!ae(e,"name")||t&&e.name!==n)&&(s?o(e,"name",{value:n,configurable:!0}):e.name=n),i&&a&&ae(a,"arity")&&e.length!==a.arity&&o(e,"length",{value:a.arity});try{a&&ae(a,"constructor")&&a.constructor?s&&o(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var c=r(e);return ae(c,"source")||(c.source=u.join("string"==typeof n?n:"")),e};Function.prototype.toString=c((function(){return N(this)&&n(this).source||Je(this)}),"toString")})),at=function(e,t,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:t;if(N(r)&&it(r,i,n),n.global)o?e[t]=r:ee(t,r);else{try{n.unsafe?e[t]&&(o=!0):delete e[t]}catch(e){}o?e[t]=r:Ie.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},st=Math.ceil,ut=Math.floor,ct=Math.trunc||function(e){var t=+e;return(t>0?ut:st)(t)},ft=function(e){var t=+e;return t!=t||0===t?0:ct(t)},lt=Math.max,ht=Math.min,pt=Math.min,dt=function(e){return(t=e.length)>0?pt(ft(t),9007199254740991):0;var t},mt=function(e){return function(t,r,n){var o,i=T(t),a=dt(i),s=function(e,t){var r=ft(e);return r<0?lt(r+t,0):ht(r,t)}(n,a);if(e&&r!=r){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===r)return e||s||0;return!e&&-1}},vt={includes:mt(!0),indexOf:mt(!1)},gt=vt.indexOf,yt=E([].push),bt=function(e,t){var r,n=T(e),o=0,i=[];for(r in n)!ae(Qe,r)&&ae(n,r)&&yt(i,r);for(;t.length>o;)ae(n,r=t[o++])&&(~gt(i,r)||yt(i,r));return i},wt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ot=wt.concat("length","prototype"),Et={f:Object.getOwnPropertyNames||function(e){return bt(e,Ot)}},jt={f:Object.getOwnPropertySymbols},Rt=E([].concat),St=k("Reflect","ownKeys")||function(e){var t=Et.f(Te(e)),r=jt.f;return r?Rt(t,r(e)):t},At=function(e,t,r){for(var n=St(t),o=Ie.f,i=Se.f,a=0;a<n.length;a++){var s=n[a];ae(e,s)||r&&ae(r,s)||o(e,s,i(t,s))}},Ct=/#|\.prototype\./,Pt=function(e,t){var r=xt[Tt(e)];return r==_t||r!=Ut&&(N(t)?a(t):!!t)},Tt=Pt.normalize=function(e){return String(e).replace(Ct,".").toLowerCase()},xt=Pt.data={},Ut=Pt.NATIVE="N",_t=Pt.POLYFILL="P",Nt=Pt,Dt=Se.f,Lt=Object.keys||function(e){return bt(e,wt)},It=s&&!Ae?Object.defineProperties:function(e,t){Te(e);for(var r,n=T(t),o=Lt(t),i=o.length,a=0;i>a;)Ie.f(e,r=o[a++],n[r]);return e},kt={f:It},qt=k("document","documentElement"),Bt=Xe("IE_PROTO"),Ft=function(){},$t=function(e){return"<script>"+e+"</"+"script>"},Mt=function(e){e.write($t("")),e.close();var t=e.parentWindow.Object;return e=null,t},zt=function(){try{nt=new ActiveXObject("htmlfile")}catch(e){}var e,t;zt="undefined"!=typeof document?document.domain&&nt?Mt(nt):((t=Ee("iframe")).style.display="none",qt.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write($t("document.F=Object")),e.close(),e.F):Mt(nt);for(var r=wt.length;r--;)delete zt.prototype[wt[r]];return zt()};Qe[Bt]=!0;var Wt=Object.create||function(e,t){var r;return null!==e?(Ft.prototype=Te(e),r=new Ft,Ft.prototype=null,r[Bt]=e):r=zt(),void 0===t?r:kt.f(r,t)},Ht=Ie.f,Jt=me("unscopables"),Vt=Array.prototype;null==Vt[Jt]&&Ht(Vt,Jt,{configurable:!0,value:Wt(null)});var Kt,Gt=vt.includes;!function(e,t){var r,n,o,a,s,u=e.target,c=e.global,f=e.stat;if(r=c?i:f?i[u]||ee(u,{}):(i[u]||{}).prototype)for(n in t){if(a=t[n],o=e.dontCallGetSet?(s=Dt(r,n))&&s.value:r[n],!Nt(c?n:u+(f?".":"#")+n,e.forced)&&void 0!==o){if(typeof a==typeof o)continue;At(a,o)}(e.sham||o&&o.sham)&&ke(a,"sham",!0),at(r,n,a,e)}}({target:"Array",proto:!0,forced:a((function(){return!Array(1).includes()}))},{includes:function(e){return Gt(this,e,arguments.length>1?arguments[1]:void 0)}}),Kt="includes",Vt[Jt][Kt]=!0;var Xt,Qt=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},Yt=Object.prototype.toString,Zt=(Xt=Object.create(null),function(e){var t=Yt.call(e);return Xt[t]||(Xt[t]=t.slice(8,-1).toLowerCase())});function er(e){return e=e.toLowerCase(),function(t){return Zt(t)===e}}function tr(e){return Array.isArray(e)}function rr(e){return void 0===e}var nr=er("ArrayBuffer");function or(e){return null!==e&&"object"==typeof e}function ir(e){if("object"!==Zt(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var ar=er("Date"),sr=er("File"),ur=er("Blob"),cr=er("FileList");function fr(e){return"[object Function]"===Yt.call(e)}var lr=er("URLSearchParams");function hr(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),tr(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var pr,dr=(pr="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return pr&&e instanceof pr}),mr={supportedProtocols:["http:","https:","file:"],getProtocol:function(e){return e||"http:"},isArray:tr,isArrayBuffer:nr,isBuffer:function(e){return null!==e&&!rr(e)&&null!==e.constructor&&!rr(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||Yt.call(e)===t||fr(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&nr(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:or,isPlainObject:ir,isUndefined:rr,isDate:ar,isFile:sr,isBlob:ur,isFunction:fr,isStream:function(e){return or(e)&&fr(e.pipe)},isURLSearchParams:lr,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:hr,merge:function e(){var t={};function r(r,n){ir(t[n])&&ir(r)?t[n]=e(t[n],r):ir(r)?t[n]=e({},r):tr(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)hr(arguments[n],r);return t},extend:function(e,t,r){return hr(t,(function(t,n){e[n]=r&&"function"==typeof t?Qt(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var n,o,i,a={};t=t||{};do{for(o=(n=Object.getOwnPropertyNames(e)).length;o-- >0;)a[i=n[o]]||(t[i]=e[i],a[i]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:Zt,kindOfTest:er,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(rr(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:dr,isFileList:cr};function vr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var gr=function(e,t,r){if(!t)return e;var n;if(r)n=r(t);else if(mr.isURLSearchParams(t))n=t.toString();else{var o=[];mr.forEach(t,(function(e,t){null!=e&&(mr.isArray(e)?t+="[]":e=[e],mr.forEach(e,(function(e){mr.isDate(e)?e=e.toISOString():mr.isObject(e)&&(e=JSON.stringify(e)),o.push(vr(t)+"="+vr(e))})))})),n=o.join("&")}if(n){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e};function yr(){this.handlers=[]}yr.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},yr.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},yr.prototype.forEach=function(e){mr.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var br=yr,wr=function(e,t){mr.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))};function Or(e,t,r,n,o){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}mr.inherits(Or,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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Er=Or.prototype,jr={};["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"].forEach((function(e){jr[e]={value:e}})),Object.defineProperties(Or,jr),Object.defineProperty(Er,"isAxiosError",{value:!0}),Or.from=function(e,t,r,n,o,i){var a=Object.create(Er);return mr.toFlatObject(e,a,(function(e){return e!==Error.prototype})),Or.call(a,e.message,t,r,n,o),a.name=e.name,i&&Object.assign(a,i),a};var Rr=Or,Sr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Ar=function(e,t){t=t||new FormData;var r=[];function n(e){return null===e?"":mr.isDate(e)?e.toISOString():mr.isArrayBuffer(e)||mr.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}return function e(o,i){if(mr.isPlainObject(o)||mr.isArray(o)){if(-1!==r.indexOf(o))throw Error("Circular reference detected in "+i);r.push(o),mr.forEach(o,(function(r,o){if(!mr.isUndefined(r)){var a,s=i?i+"."+o:o;if(r&&!i&&"object"==typeof r)if(mr.endsWith(o,"{}"))r=JSON.stringify(r);else if(mr.endsWith(o,"[]")&&(a=mr.toArray(r)))return void a.forEach((function(e){!mr.isUndefined(e)&&t.append(s,n(e))}));e(r,s)}})),r.pop()}else t.append(i,n(o))}(e),t},Cr=mr.isStandardBrowserEnv()?{write:function(e,t,r,n,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),mr.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),mr.isString(n)&&a.push("path="+n),mr.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Pr=function(e,t){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t},Tr=["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"],xr=mr.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=mr.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},Ur="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_r=2147483647,Nr=/[^\x20-\x7E]/,Dr=/[\x2E\u3002\uFF0E\uFF61]/g,Lr={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ir=Math.floor,kr=String.fromCharCode;function qr(e){throw new RangeError(Lr[e])}function Br(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function Fr(e,t,r){var n=0;for(e=r?Ir(e/700):e>>1,e+=Ir(e/t);e>455;n+=36)e=Ir(e/35);return Ir(n+36*e/(e+38))}function $r(e){return function(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var o=function(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}((e=e.replace(Dr,".")).split("."),t).join(".");return n+o}(e,(function(e){return Nr.test(e)?"xn--"+function(e){var t,r,n,o,i,a,s,u,c,f,l,h,p,d,m,v=[];for(e=function(e){for(var t,r,n=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}(e),h=e.length,t=128,r=0,i=72,a=0;a<h;++a)(l=e[a])<128&&v.push(kr(l));for(n=o=v.length,o&&v.push("-");n<h;){for(s=_r,a=0;a<h;++a)(l=e[a])>=t&&l<s&&(s=l);for(s-t>Ir((_r-r)/(p=n+1))&&qr("overflow"),r+=(s-t)*p,t=s,a=0;a<h;++a)if((l=e[a])<t&&++r>_r&&qr("overflow"),l==t){for(u=r,c=36;!(u<(f=c<=i?1:c>=i+26?26:c-i));c+=36)m=u-f,d=36-f,v.push(kr(Br(f+m%d,0))),u=Ir(m/d);v.push(kr(Br(u,0))),i=Fr(r,p,n==o),r=0,++n}++r,++t}return v.join("")}(e):e}))}function Mr(e){return null===e}function zr(e){return"string"==typeof e}function Wr(e){return"object"==typeof e&&null!==e}function Hr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Jr=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function Vr(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function Kr(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var Gr=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t};function Xr(e,t,r,n){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var i=/\+/g;e=e.split(t);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var u=0;u<s;++u){var c,f,l,h,p=e[u].replace(i,"%20"),d=p.indexOf(r);d>=0?(c=p.substr(0,d),f=p.substr(d+1)):(c=p,f=""),l=decodeURIComponent(c),h=decodeURIComponent(f),Hr(o,l)?Jr(o[l])?o[l].push(h):o[l]=[o[l],h]:o[l]=h}return o}var Qr={parse:hn,resolve:function(e,t){return hn(e,!1,!0).resolve(t)},resolveObject:function(e,t){return e?hn(e,!1,!0).resolveObject(t):t},fileURLToPath:function(e){if("string"==typeof e)e=(new Yr).parse(e);else if(!(e instanceof Yr))throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type '+typeof e+String(e));if("file:"!==e.protocol)throw new TypeError("The URL must be of scheme file");return function(e){const t=e.pathname;for(let e=0;e<t.length;e++)if("%"===t[e]){const r=32|t.codePointAt(e+2);if("2"===t[e+1]&&102===r)throw new TypeError("must not include encoded / characters")}return decodeURIComponent(t)}(e)},format:function(e){zr(e)&&(e=pn({},e));return dn(e)},Url:Yr,URL:Ur.URL,URLSearchParams:Ur.URLSearchParams};function Yr(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Zr=/^([a-z0-9.+-]+:)/i,en=/:[0-9]*$/,tn=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,rn=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),nn=["'"].concat(rn),on=["%","/","?",";","#"].concat(nn),an=["/","?","#"],sn=/^[+a-z0-9A-Z_-]{0,63}$/,un=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,cn={javascript:!0,"javascript:":!0},fn={javascript:!0,"javascript:":!0},ln={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function hn(e,t,r){if(e&&Wr(e)&&e instanceof Yr)return e;var n=new Yr;return n.parse(e,t,r),n}function pn(e,t,r,n){if(!zr(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),i=-1!==o&&o<t.indexOf("#")?"?":"#",a=t.split(i);a[0]=a[0].replace(/\\/g,"/");var s=t=a.join(i);if(s=s.trim(),!n&&1===t.split("#").length){var u=tn.exec(s);if(u)return e.path=s,e.href=s,e.pathname=u[1],u[2]?(e.search=u[2],e.query=r?Xr(e.search.substr(1)):e.search.substr(1)):r&&(e.search="",e.query={}),e}var c,f,l,h,p=Zr.exec(s);if(p){var d=(p=p[0]).toLowerCase();e.protocol=d,s=s.substr(p.length)}if(n||p||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var m="//"===s.substr(0,2);!m||p&&fn[p]||(s=s.substr(2),e.slashes=!0)}if(!fn[p]&&(m||p&&!ln[p])){var v,g,y=-1;for(c=0;c<an.length;c++)-1!==(f=s.indexOf(an[c]))&&(-1===y||f<y)&&(y=f);for(-1!==(g=-1===y?s.lastIndexOf("@"):s.lastIndexOf("@",y))&&(v=s.slice(0,g),s=s.slice(g+1),e.auth=decodeURIComponent(v)),y=-1,c=0;c<on.length;c++)-1!==(f=s.indexOf(on[c]))&&(-1===y||f<y)&&(y=f);-1===y&&(y=s.length),e.host=s.slice(0,y),s=s.slice(y),mn(e),e.hostname=e.hostname||"";var b="["===e.hostname[0]&&"]"===e.hostname[e.hostname.length-1];if(!b){var w=e.hostname.split(/\./);for(c=0,l=w.length;c<l;c++){var O=w[c];if(O&&!O.match(sn)){for(var E="",j=0,R=O.length;j<R;j++)O.charCodeAt(j)>127?E+="x":E+=O[j];if(!E.match(sn)){var S=w.slice(0,c),A=w.slice(c+1),C=O.match(un);C&&(S.push(C[1]),A.unshift(C[2])),A.length&&(s="/"+A.join(".")+s),e.hostname=S.join(".");break}}}}e.hostname.length>255?e.hostname="":e.hostname=e.hostname.toLowerCase(),b||(e.hostname=$r(e.hostname)),h=e.port?":"+e.port:"";var P=e.hostname||"";e.host=P+h,e.href+=e.host,b&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!cn[d])for(c=0,l=nn.length;c<l;c++){var T=nn[c];if(-1!==s.indexOf(T)){var x=encodeURIComponent(T);x===T&&(x=escape(T)),s=s.split(T).join(x)}}var U=s.indexOf("#");-1!==U&&(e.hash=s.substr(U),s=s.slice(0,U));var _=s.indexOf("?");if(-1!==_?(e.search=s.substr(_),e.query=s.substr(_+1),r&&(e.query=Xr(e.query)),s=s.slice(0,_)):r&&(e.search="",e.query={}),s&&(e.pathname=s),ln[d]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){h=e.pathname||"";var N=e.search||"";e.path=h+N}return e.href=dn(e),e}function dn(e){var t=e.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var r=e.protocol||"",n=e.pathname||"",o=e.hash||"",i=!1,a="";e.host?i=t+e.host:e.hostname&&(i=t+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(i+=":"+e.port)),e.query&&Wr(e.query)&&Object.keys(e.query).length&&(a=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Kr(Gr(e),(function(n){var o=encodeURIComponent(Vr(n))+r;return Jr(e[n])?Kr(e[n],(function(e){return o+encodeURIComponent(Vr(e))})).join(t):o+encodeURIComponent(Vr(e[n]))})).join(t):n?encodeURIComponent(Vr(n))+r+encodeURIComponent(Vr(e)):""}(e.query));var s=e.search||a&&"?"+a||"";return r&&":"!==r.substr(-1)&&(r+=":"),e.slashes||(!r||ln[r])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),o&&"#"!==o.charAt(0)&&(o="#"+o),s&&"?"!==s.charAt(0)&&(s="?"+s),n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})),r+i+n+(s=s.replace("#","%23"))+o}function mn(e){var t=e.host,r=en.exec(t);r&&(":"!==(r=r[0])&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t)}function vn(e){Rr.call(this,null==e?"canceled":e,Rr.ERR_CANCELED),this.name="CanceledError"}Yr.prototype.parse=function(e,t,r){return pn(this,e,t,r)},Yr.prototype.format=function(){return dn(this)},Yr.prototype.resolve=function(e){return this.resolveObject(hn(e,!1,!0)).format()},Yr.prototype.resolveObject=function(e){if(zr(e)){var t=new Yr;t.parse(e,!1,!0),e=t}for(var r,n=new Yr,o=Object.keys(this),i=0;i<o.length;i++){var a=o[i];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(n[c]=e[c])}return ln[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!ln[e.protocol]){for(var f=Object.keys(e),l=0;l<f.length;l++){var h=f[l];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||fn[e.protocol])n.pathname=e.pathname;else{for(r=(e.pathname||"").split("/");r.length&&!(e.host=r.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==r[0]&&r.unshift(""),r.length<2&&r.unshift(""),n.pathname=r.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var p=n.pathname||"",d=n.search||"";n.path=p+d}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var m,v=n.pathname&&"/"===n.pathname.charAt(0),g=e.host||e.pathname&&"/"===e.pathname.charAt(0),y=g||v||n.host&&e.pathname,b=y,w=n.pathname&&n.pathname.split("/")||[],O=n.protocol&&!ln[n.protocol];if(r=e.pathname&&e.pathname.split("/")||[],O&&(n.hostname="",n.port=null,n.host&&(""===w[0]?w[0]=n.host:w.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===r[0]?r[0]=e.host:r.unshift(e.host)),e.host=null),y=y&&(""===r[0]||""===w[0])),g)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,w=r;else if(r.length)w||(w=[]),w.pop(),w=w.concat(r),n.search=e.search,n.query=e.query;else if(null!=e.search)return O&&(n.hostname=n.host=w.shift(),(m=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=m.shift(),n.host=n.hostname=m.shift())),n.search=e.search,n.query=e.query,Mr(n.pathname)&&Mr(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=w.slice(-1)[0],j=(n.host||e.host||w.length>1)&&("."===E||".."===E)||""===E,R=0,S=w.length;S>=0;S--)"."===(E=w[S])?w.splice(S,1):".."===E?(w.splice(S,1),R++):R&&(w.splice(S,1),R--);if(!y&&!b)for(;R--;R)w.unshift("..");!y||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),j&&"/"!==w.join("/").substr(-1)&&w.push("");var A=""===w[0]||w[0]&&"/"===w[0].charAt(0);return O&&(n.hostname=n.host=A?"":w.length?w.shift():"",(m=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=m.shift(),n.host=n.hostname=m.shift())),(y=y||n.host&&w.length)&&!A&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),Mr(n.pathname)&&Mr(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},Yr.prototype.parseHost=function(){return mn(this)},mr.inherits(vn,Rr,{__CANCEL__:!0});var gn=vn,yn=function(e){return new Promise((function(t,r){var n,o=e.data,i=e.headers,a=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(n),e.signal&&e.signal.removeEventListener("abort",n)}var u=new XMLHttpRequest;if(e.auth){var c=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.Authorization="Basic "+btoa(c+":"+f)}var l=Pr(e.baseURL,e.url),h=Qr.parse(l),p=mr.getProtocol(h.protocol);function d(){if(u){var n="getAllResponseHeaders"in u?function(e){var t,r,n,o={};return e?(mr.forEach(e.split("\n"),(function(e){if(n=e.indexOf(":"),t=mr.trim(e.substr(0,n)).toLowerCase(),r=mr.trim(e.substr(n+1)),t){if(o[t]&&Tr.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o}(u.getAllResponseHeaders()):null;!function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Rr("Request failed with status code "+r.status,[Rr.ERR_BAD_REQUEST,Rr.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),s()}),(function(e){r(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:e,request:u}),u=null}}if(u.open(e.method.toUpperCase(),gr(l,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=d:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(d)},u.onabort=function(){u&&(r(new Rr("Request aborted",Rr.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new Rr("Network Error",Rr.ERR_NETWORK,e,u,u)),u=null},u.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||Sr;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new Rr(t,n.clarifyTimeoutError?Rr.ETIMEDOUT:Rr.ECONNABORTED,e,u)),u=null},mr.isStandardBrowserEnv()){var m=(e.withCredentials||xr(l))&&e.xsrfCookieName?Cr.read(e.xsrfCookieName):void 0;m&&(i[e.xsrfHeaderName]=m)}"setRequestHeader"in u&&mr.forEach(i,(function(e,t){void 0===o&&"content-type"===t.toLowerCase()?delete i[t]:u.setRequestHeader(t,e)})),mr.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(n=function(e){u&&(r(!e||e&&e.type?new gn:e),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(n),e.signal&&(e.signal.aborted?n():e.signal.addEventListener("abort",n))),o||(o=null),null!==h.path?mr.supportedProtocols.includes(p)?u.send(o):r(new Rr("Unsupported protocol "+p,Rr.ERR_BAD_REQUEST,e)):r(new Rr("Malformed URL "+l,Rr.ERR_BAD_REQUEST,e))}))},bn={"Content-Type":"application/x-www-form-urlencoded"};function wn(e,t){!mr.isUndefined(e)&&mr.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var On,En={transitional:Sr,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(On=yn),On),transformRequest:[function(e,t){if(wr(t,"Accept"),wr(t,"Content-Type"),mr.isFormData(e)||mr.isArrayBuffer(e)||mr.isBuffer(e)||mr.isStream(e)||mr.isFile(e)||mr.isBlob(e))return e;if(mr.isArrayBufferView(e))return e.buffer;if(mr.isURLSearchParams(e))return wn(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,n=mr.isObject(e),o=t&&t["Content-Type"];if((r=mr.isFileList(e))||n&&"multipart/form-data"===o){var i=this.env&&this.env.FormData;return Ar(r?{"files[]":e}:e,i&&new i)}return n||"application/json"===o?(wn(t,"application/json"),function(e,t,r){if(mr.isString(e))try{return(t||JSON.parse)(e),mr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||En.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&mr.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw Rr.from(e,Rr.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:null},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};mr.forEach(["delete","get","head"],(function(e){En.headers[e]={}})),mr.forEach(["post","put","patch"],(function(e){En.headers[e]=mr.merge(bn)}));var jn=En,Rn=function(e,t,r){var n=this||jn;return mr.forEach(r,(function(r){e=r.call(n,e,t)})),e},Sn=function(e){return!(!e||!e.__CANCEL__)};function An(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gn}var Cn=function(e){return An(e),e.headers=e.headers||{},e.data=Rn.call(e,e.data,e.headers,e.transformRequest),e.headers=mr.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),mr.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||jn.adapter)(e).then((function(t){return An(e),t.data=Rn.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return Sn(t)||(An(e),t&&t.response&&(t.response.data=Rn.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},Pn=function(e,t){t=t||{};var r={};function n(e,t){return mr.isPlainObject(e)&&mr.isPlainObject(t)?mr.merge(e,t):mr.isPlainObject(t)?mr.merge({},t):mr.isArray(t)?t.slice():t}function o(r){return mr.isUndefined(t[r])?mr.isUndefined(e[r])?void 0:n(void 0,e[r]):n(e[r],t[r])}function i(e){if(!mr.isUndefined(t[e]))return n(void 0,t[e])}function a(r){return mr.isUndefined(t[r])?mr.isUndefined(e[r])?void 0:n(void 0,e[r]):n(void 0,t[r])}function s(r){return r in t?n(e[r],t[r]):r in e?n(void 0,e[r]):void 0}var u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s};return mr.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||o,n=t(e);mr.isUndefined(n)&&t!==s||(r[e]=n)})),r},Tn="0.27.0",xn=Tn,Un={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Un[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var _n={};Un.transitional=function(e,t,r){function n(e,t){return"[Axios v"+xn+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,o,i){if(!1===e)throw new Rr(n(o," has been removed"+(t?" in "+t:"")),Rr.ERR_DEPRECATED);return t&&!_n[o]&&(_n[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}};var Nn={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Rr("options must be an object",Rr.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var s=e[i],u=void 0===s||a(s,i,e);if(!0!==u)throw new Rr("option "+i+" must be "+u,Rr.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Rr("Unknown option "+i,Rr.ERR_BAD_OPTION)}},validators:Un},Dn=Nn.validators;function Ln(e){this.defaults=e,this.interceptors={request:new br,response:new br}}Ln.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=Pn(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&Nn.assertOptions(r,{silentJSONParsing:Dn.transitional(Dn.boolean),forcedJSONParsing:Dn.transitional(Dn.boolean),clarifyTimeoutError:Dn.transitional(Dn.boolean)},!1);var n=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var i,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!o){var s=[Cn,void 0];for(Array.prototype.unshift.apply(s,n),s=s.concat(a),i=Promise.resolve(t);s.length;)i=i.then(s.shift(),s.shift());return i}for(var u=t;n.length;){var c=n.shift(),f=n.shift();try{u=c(u)}catch(e){f(e);break}}try{i=Cn(u)}catch(e){return Promise.reject(e)}for(;a.length;)i=i.then(a.shift(),a.shift());return i},Ln.prototype.getUri=function(e){e=Pn(this.defaults,e);var t=Pr(e.baseURL,e.url);return gr(t,e.params,e.paramsSerializer)},mr.forEach(["delete","get","head","options"],(function(e){Ln.prototype[e]=function(t,r){return this.request(Pn(r||{},{method:e,url:t,data:(r||{}).data}))}})),mr.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(Pn(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ln.prototype[e]=t(),Ln.prototype[e+"Form"]=t(!0)}));var In=Ln;function kn(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new gn(e),t(r.reason))}))}kn.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},kn.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},kn.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},kn.source=function(){var e;return{token:new kn((function(t){e=t})),cancel:e}};var qn=kn;var Bn=function e(t){var r=new In(t),n=Qt(In.prototype.request,r);return mr.extend(n,In.prototype,r),mr.extend(n,r),n.create=function(r){return e(Pn(t,r))},n}(jn);Bn.Axios=In,Bn.CanceledError=gn,Bn.CancelToken=qn,Bn.isCancel=Sn,Bn.VERSION=Tn,Bn.toFormData=Ar,Bn.AxiosError=Rr,Bn.Cancel=Bn.CanceledError,Bn.all=function(e){return Promise.all(e)},Bn.spread=function(e){return function(t){return e.apply(null,t)}},Bn.isAxiosError=function(e){return mr.isObject(e)&&!0===e.isAxiosError};var Fn=Bn,$n=Bn;Fn.default=$n;var Mn=Fn;const zn="1.11.8",Wn="v5.0",Hn=["v2","v3","v4","v5","canary"],Jn="@tryghost/content-api",Vn=e=>{let t;if("v5"===e||void 0===e||e.match(/^v5\.\d+/))t="/content/";else if(e.match(/^v\d+\.\d+/)){t=`/${/^(v\d+)\.\d+/.exec(e)[1]}/content/`}else t=`/${e}/content/`;return t},Kn=e=>{let{url:t,method:r,params:n,headers:o}=e;return Mn[r](t,{params:n,paramsSerializer:e=>Object.keys(e).reduce(((t,r)=>{const n=encodeURIComponent([].concat(e[r]).join(","));return t.concat(`${r}=${n}`)}),[]).join("&"),headers:o})};return function e(t){let r,{url:n,key:o,host:i,version:a,userAgent:s,ghostPath:u="ghost",makeRequest:c=Kn}=t;if(i&&(console.warn(`${Jn}: The 'host' parameter is deprecated, please use 'url' instead`),n||(n=i)),this instanceof e)return e({url:n,key:o,version:a,userAgent:s,ghostPath:u,makeRequest:c});if(void 0===a)throw new Error(`${Jn} Config Missing: 'version' is required. E.g. ${Hn.join(",")}`);if("boolean"==typeof a)!0===a&&(r=Wn),a=void 0;else{if(a&&!Hn.includes(a)&&!a.match(/^v\d+\.\d+/))throw new Error(`${Jn} Config Invalid: 'version' ${a} is not supported`);"canary"===a?(console.warn(`${Jn}: The 'version' parameter has a deprecated format 'canary', please use 'v{major}.{minor}' format instead`),r=Wn):a.match(/^v\d+$/)?(console.warn(`${Jn}: The 'version' parameter has a deprecated format 'v{major}', please use 'v{major}.{minor}' format instead`),r=`${a}.0`):r=a}if(!n)throw new Error(`${Jn} Config Missing: 'url' is required. E.g. 'https://site.com'`);if(!/https?:\/\//.test(n))throw new Error(`${Jn} Config Invalid: 'url' ${n} requires a protocol. E.g. 'https://site.com'`);if(n.endsWith("/"))throw new Error(`${Jn} Config Invalid: 'url' ${n} must not have a trailing slash. E.g. 'https://site.com'`);if(u.endsWith("/")||u.startsWith("/"))throw new Error(`${Jn} Config Invalid: 'ghostPath' ${u} must not have a leading or trailing slash. E.g. 'ghost'`);if(o&&!/[0-9a-f]{26}/.test(o))throw new Error(`${Jn} Config Invalid: 'key' ${o} must have 26 hex characters`);void 0===s&&(s=false);const f=["posts","authors","tags","pages","settings","tiers","newsletters","offers"].reduce(((e,t)=>Object.assign(e,{[t]:{read:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(!e||!e.id&&!e.slug)return Promise.reject(new Error(`${Jn} read requires an id or slug.`));const o=Object.assign({},e,r);return l(t,o,e.id||`slug/${e.slug}`,n)},browse:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return l(t,e,null,r)}}})),{});return delete f.settings.read,delete f.tiers.read,delete f.newsletters.read,delete f.offers.browse,f;function l(e,t,i){let f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!f&&!o)return Promise.reject(new Error(`${Jn} Config Missing: 'key' is required.`));delete t.id;const l=f?{Authorization:`GhostMembers ${f}`}:{};s&&(l["User-Agent"]="boolean"==typeof s?`GhostContentSDK/${zn}`:s),r&&(l["Accept-Version"]=r),t=Object.assign({key:o},t);const h=`${n}/${u}/api${Vn(a)}${e}/${i?i+"/":""}`;return c({url:h,method:"get",params:t,headers:l}).then((t=>Array.isArray(t.data[e])?1!==t.data[e].length||t.data.meta?Object.assign(t.data[e],{meta:t.data.meta}):t.data[e][0]:t.data[e])).catch((e=>{if(e.response&&e.response.data&&e.response.data.errors){const t=e.response.data.errors[0],r=new Error(t.message),n=Object.keys(t);throw r.name=t.type,n.forEach((e=>{r[e]=t[e]})),r.response=e.response,r.request=e.request,r.config=e.config,r}throw e}))}}}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).GhostContentAPI=t()}(this,(function(){"use strict";var e,t=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},r=Object.prototype.toString,n=(e=Object.create(null),function(t){var n=r.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())});function o(e){return e=e.toLowerCase(),function(t){return n(t)===e}}function i(e){return Array.isArray(e)}function s(e){return void 0===e}var a=o("ArrayBuffer");function u(e){return null!==e&&"object"==typeof e}function c(e){if("object"!==n(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var f=o("Date"),l=o("File"),d=o("Blob"),h=o("FileList");function p(e){return"[object Function]"===r.call(e)}var m=o("URLSearchParams");function g(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var v,y=(v="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return v&&e instanceof v}),E={isArray:i,isArrayBuffer:a,isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||r.call(e)===t||p(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&a(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:c,isUndefined:s,isDate:f,isFile:l,isBlob:d,isFunction:p,isStream:function(e){return u(e)&&p(e.pipe)},isURLSearchParams:m,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:g,merge:function e(){var t={};function r(r,n){c(t[n])&&c(r)?t[n]=e(t[n],r):c(r)?t[n]=e({},r):i(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)g(arguments[n],r);return t},extend:function(e,r,n){return g(r,(function(r,o){e[o]=n&&"function"==typeof r?t(r,n):r})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var n,o,i,s={};t=t||{};do{for(o=(n=Object.getOwnPropertyNames(e)).length;o-- >0;)s[i=n[o]]||(t[i]=e[i],s[i]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:n,kindOfTest:o,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(s(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:y,isFileList:h};function w(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var b=function(e,t,r){if(!t)return e;var n;if(r)n=r(t);else if(E.isURLSearchParams(t))n=t.toString();else{var o=[];E.forEach(t,(function(e,t){null!=e&&(E.isArray(e)?t+="[]":e=[e],E.forEach(e,(function(e){E.isDate(e)?e=e.toISOString():E.isObject(e)&&(e=JSON.stringify(e)),o.push(w(t)+"="+w(e))})))})),n=o.join("&")}if(n){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e};function O(){this.handlers=[]}O.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},O.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},O.prototype.forEach=function(e){E.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var R=O,A=function(e,t){E.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))};function j(e,t,r,n,o){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}E.inherits(j,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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var S=j.prototype,C={};["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"].forEach((function(e){C[e]={value:e}})),Object.defineProperties(j,C),Object.defineProperty(S,"isAxiosError",{value:!0}),j.from=function(e,t,r,n,o,i){var s=Object.create(S);return E.toFlatObject(e,s,(function(e){return e!==Error.prototype})),j.call(s,e.message,t,r,n,o),s.name=e.name,i&&Object.assign(s,i),s};var T=j,N={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var _=function(e,t){t=t||new FormData;var r=[];function n(e){return null===e?"":E.isDate(e)?e.toISOString():E.isArrayBuffer(e)||E.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}return function e(o,i){if(E.isPlainObject(o)||E.isArray(o)){if(-1!==r.indexOf(o))throw Error("Circular reference detected in "+i);r.push(o),E.forEach(o,(function(r,o){if(!E.isUndefined(r)){var s,a=i?i+"."+o:o;if(r&&!i&&"object"==typeof r)if(E.endsWith(o,"{}"))r=JSON.stringify(r);else if(E.endsWith(o,"[]")&&(s=E.toArray(r)))return void s.forEach((function(e){!E.isUndefined(e)&&t.append(a,n(e))}));e(r,a)}})),r.pop()}else t.append(i,n(o))}(e),t},x=E.isStandardBrowserEnv()?{write:function(e,t,r,n,o,i){var s=[];s.push(e+"="+encodeURIComponent(t)),E.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),E.isString(n)&&s.push("path="+n),E.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},P=function(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t},U=["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"],D=E.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=E.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0};function B(e){T.call(this,null==e?"canceled":e,T.ERR_CANCELED),this.name="CanceledError"}E.inherits(B,T,{__CANCEL__:!0});var k=B,$=function(e){return new Promise((function(t,r){var n,o=e.data,i=e.headers,s=e.responseType;function a(){e.cancelToken&&e.cancelToken.unsubscribe(n),e.signal&&e.signal.removeEventListener("abort",n)}E.isFormData(o)&&E.isStandardBrowserEnv()&&delete i["Content-Type"];var u=new XMLHttpRequest;if(e.auth){var c=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.Authorization="Basic "+btoa(c+":"+f)}var l=P(e.baseURL,e.url);function d(){if(u){var n,o,i,c,f,l="getAllResponseHeaders"in u?(n=u.getAllResponseHeaders(),f={},n?(E.forEach(n.split("\n"),(function(e){if(c=e.indexOf(":"),o=E.trim(e.substr(0,c)).toLowerCase(),i=E.trim(e.substr(c+1)),o){if(f[o]&&U.indexOf(o)>=0)return;f[o]="set-cookie"===o?(f[o]?f[o]:[]).concat([i]):f[o]?f[o]+", "+i:i}})),f):f):null;!function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new T("Request failed with status code "+r.status,[T.ERR_BAD_REQUEST,T.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),a()}),(function(e){r(e),a()}),{data:s&&"text"!==s&&"json"!==s?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:l,config:e,request:u}),u=null}}if(u.open(e.method.toUpperCase(),b(l,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=d:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(d)},u.onabort=function(){u&&(r(new T("Request aborted",T.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new T("Network Error",T.ERR_NETWORK,e,u,u)),u=null},u.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||N;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new T(t,n.clarifyTimeoutError?T.ETIMEDOUT:T.ECONNABORTED,e,u)),u=null},E.isStandardBrowserEnv()){var h=(e.withCredentials||D(l))&&e.xsrfCookieName?x.read(e.xsrfCookieName):void 0;h&&(i[e.xsrfHeaderName]=h)}"setRequestHeader"in u&&E.forEach(i,(function(e,t){void 0===o&&"content-type"===t.toLowerCase()?delete i[t]:u.setRequestHeader(t,e)})),E.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),s&&"json"!==s&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(n=function(e){u&&(r(!e||e&&e.type?new k:e),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(n),e.signal&&(e.signal.aborted?n():e.signal.addEventListener("abort",n))),o||(o=null);var p,m=(p=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l))&&p[1]||"";m&&-1===["http","https","file"].indexOf(m)?r(new T("Unsupported protocol "+m+":",T.ERR_BAD_REQUEST,e)):u.send(o)}))},L={"Content-Type":"application/x-www-form-urlencoded"};function q(e,t){!E.isUndefined(e)&&E.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var F,I={transitional:N,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(F=$),F),transformRequest:[function(e,t){if(A(t,"Accept"),A(t,"Content-Type"),E.isFormData(e)||E.isArrayBuffer(e)||E.isBuffer(e)||E.isStream(e)||E.isFile(e)||E.isBlob(e))return e;if(E.isArrayBufferView(e))return e.buffer;if(E.isURLSearchParams(e))return q(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,n=E.isObject(e),o=t&&t["Content-Type"];if((r=E.isFileList(e))||n&&"multipart/form-data"===o){var i=this.env&&this.env.FormData;return _(r?{"files[]":e}:e,i&&new i)}return n||"application/json"===o?(q(t,"application/json"),function(e,t,r){if(E.isString(e))try{return(t||JSON.parse)(e),E.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||I.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&E.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw T.from(e,T.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:null},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};E.forEach(["delete","get","head"],(function(e){I.headers[e]={}})),E.forEach(["post","put","patch"],(function(e){I.headers[e]=E.merge(L)}));var M=I,J=function(e,t,r){var n=this||M;return E.forEach(r,(function(r){e=r.call(n,e,t)})),e},W=function(e){return!(!e||!e.__CANCEL__)};function z(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new k}var H=function(e){return z(e),e.headers=e.headers||{},e.data=J.call(e,e.data,e.headers,e.transformRequest),e.headers=E.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),E.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||M.adapter)(e).then((function(t){return z(e),t.data=J.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return W(t)||(z(e),t&&t.response&&(t.response.data=J.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},V=function(e,t){t=t||{};var r={};function n(e,t){return E.isPlainObject(e)&&E.isPlainObject(t)?E.merge(e,t):E.isPlainObject(t)?E.merge({},t):E.isArray(t)?t.slice():t}function o(r){return E.isUndefined(t[r])?E.isUndefined(e[r])?void 0:n(void 0,e[r]):n(e[r],t[r])}function i(e){if(!E.isUndefined(t[e]))return n(void 0,t[e])}function s(r){return E.isUndefined(t[r])?E.isUndefined(e[r])?void 0:n(void 0,e[r]):n(void 0,t[r])}function a(r){return r in t?n(e[r],t[r]):r in e?n(void 0,e[r]):void 0}var u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a};return E.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||o,n=t(e);E.isUndefined(n)&&t!==a||(r[e]=n)})),r},K="0.27.2",X=K,G={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){G[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var Q={};G.transitional=function(e,t,r){function n(e,t){return"[Axios v"+X+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,o,i){if(!1===e)throw new T(n(o," has been removed"+(t?" in "+t:"")),T.ERR_DEPRECATED);return t&&!Q[o]&&(Q[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}};var Y={assertOptions:function(e,t,r){if("object"!=typeof e)throw new T("options must be an object",T.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new T("option "+i+" must be "+u,T.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new T("Unknown option "+i,T.ERR_BAD_OPTION)}},validators:G},Z=Y.validators;function ee(e){this.defaults=e,this.interceptors={request:new R,response:new R}}ee.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=V(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&Y.assertOptions(r,{silentJSONParsing:Z.transitional(Z.boolean),forcedJSONParsing:Z.transitional(Z.boolean),clarifyTimeoutError:Z.transitional(Z.boolean)},!1);var n=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var i,s=[];if(this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)})),!o){var a=[H,void 0];for(Array.prototype.unshift.apply(a,n),a=a.concat(s),i=Promise.resolve(t);a.length;)i=i.then(a.shift(),a.shift());return i}for(var u=t;n.length;){var c=n.shift(),f=n.shift();try{u=c(u)}catch(e){f(e);break}}try{i=H(u)}catch(e){return Promise.reject(e)}for(;s.length;)i=i.then(s.shift(),s.shift());return i},ee.prototype.getUri=function(e){e=V(this.defaults,e);var t=P(e.baseURL,e.url);return b(t,e.params,e.paramsSerializer)},E.forEach(["delete","get","head","options"],(function(e){ee.prototype[e]=function(t,r){return this.request(V(r||{},{method:e,url:t,data:(r||{}).data}))}})),E.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(V(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ee.prototype[e]=t(),ee.prototype[e+"Form"]=t(!0)}));var te=ee;function re(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new k(e),t(r.reason))}))}re.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},re.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},re.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},re.source=function(){var e;return{token:new re((function(t){e=t})),cancel:e}};var ne=re;var oe=function e(r){var n=new te(r),o=t(te.prototype.request,n);return E.extend(o,te.prototype,n),E.extend(o,n),o.create=function(t){return e(V(r,t))},o}(M);oe.Axios=te,oe.CanceledError=k,oe.CancelToken=ne,oe.isCancel=W,oe.VERSION=K,oe.toFormData=_,oe.AxiosError=T,oe.Cancel=oe.CanceledError,oe.all=function(e){return Promise.all(e)},oe.spread=function(e){return function(t){return e.apply(null,t)}},oe.isAxiosError=function(e){return E.isObject(e)&&!0===e.isAxiosError};var ie=oe,se=oe;ie.default=se;var ae=ie;const ue="1.11.9",ce="v5.0",fe=["v2","v3","v4","v5","canary"],le="@tryghost/content-api",de=e=>{let t;if("v5"===e||void 0===e||e.match(/^v5\.\d+/))t="/content/";else if(e.match(/^v\d+\.\d+/)){t=`/${/^(v\d+)\.\d+/.exec(e)[1]}/content/`}else t=`/${e}/content/`;return t},he=e=>{let{url:t,method:r,params:n,headers:o}=e;return ae[r](t,{params:n,paramsSerializer:e=>Object.keys(e).reduce(((t,r)=>{const n=encodeURIComponent([].concat(e[r]).join(","));return t.concat(`${r}=${n}`)}),[]).join("&"),headers:o})};return function e(t){let r,{url:n,key:o,host:i,version:s,userAgent:a,ghostPath:u="ghost",makeRequest:c=he}=t;if(i&&(console.warn(`${le}: The 'host' parameter is deprecated, please use 'url' instead`),n||(n=i)),this instanceof e)return e({url:n,key:o,version:s,userAgent:a,ghostPath:u,makeRequest:c});if(void 0===s)throw new Error(`${le} Config Missing: 'version' is required. E.g. ${fe.join(",")}`);if("boolean"==typeof s)!0===s&&(r=ce),s=void 0;else{if(s&&!fe.includes(s)&&!s.match(/^v\d+\.\d+/))throw new Error(`${le} Config Invalid: 'version' ${s} is not supported`);"canary"===s?(console.warn(`${le}: The 'version' parameter has a deprecated format 'canary', please use 'v{major}.{minor}' format instead`),r=ce):s.match(/^v\d+$/)?(console.warn(`${le}: The 'version' parameter has a deprecated format 'v{major}', please use 'v{major}.{minor}' format instead`),r=`${s}.0`):r=s}if(!n)throw new Error(`${le} Config Missing: 'url' is required. E.g. 'https://site.com'`);if(!/https?:\/\//.test(n))throw new Error(`${le} Config Invalid: 'url' ${n} requires a protocol. E.g. 'https://site.com'`);if(n.endsWith("/"))throw new Error(`${le} Config Invalid: 'url' ${n} must not have a trailing slash. E.g. 'https://site.com'`);if(u.endsWith("/")||u.startsWith("/"))throw new Error(`${le} Config Invalid: 'ghostPath' ${u} must not have a leading or trailing slash. E.g. 'ghost'`);if(o&&!/[0-9a-f]{26}/.test(o))throw new Error(`${le} Config Invalid: 'key' ${o} must have 26 hex characters`);void 0===a&&(a=false);const f=["posts","authors","tags","pages","settings","tiers","newsletters","offers"].reduce(((e,t)=>Object.assign(e,{[t]:{read:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(!e||!e.id&&!e.slug)return Promise.reject(new Error(`${le} read requires an id or slug.`));const o=Object.assign({},e,r);return l(t,o,e.id||`slug/${e.slug}`,n)},browse:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return l(t,e,null,r)}}})),{});return delete f.settings.read,delete f.tiers.read,delete f.newsletters.read,delete f.offers.browse,f;function l(e,t,i){let f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!f&&!o)return Promise.reject(new Error(`${le} Config Missing: 'key' is required.`));delete t.id;const l=f?{Authorization:`GhostMembers ${f}`}:{};a&&(l["User-Agent"]="boolean"==typeof a?`GhostContentSDK/${ue}`:a),r&&(l["Accept-Version"]=r),t=Object.assign({key:o},t);const d=`${n}/${u}/api${de(s)}${e}/${i?i+"/":""}`;return c({url:d,method:"get",params:t,headers:l}).then((t=>Array.isArray(t.data[e])?1!==t.data[e].length||t.data.meta?Object.assign(t.data[e],{meta:t.data.meta}):t.data[e][0]:t.data[e])).catch((e=>{if(e.response&&e.response.data&&e.response.data.errors){const t=e.response.data.errors[0],r=new Error(t.message),n=Object.keys(t);throw r.name=t.type,n.forEach((e=>{r[e]=t[e]})),r.response=e.response,r.request=e.request,r.config=e.config,r}throw e}))}}}));
2
2
  //# sourceMappingURL=content-api.min.js.map