Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tryghost/content-api

Package Overview
Dependencies
Maintainers
21
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tryghost/content-api - npm Package Compare versions

Comparing version 1.6.3 to 1.7.0

122

cjs/content-api.js

@@ -5,7 +5,34 @@ 'use strict';

const supportedVersions = ['v2', 'v3', 'v4', 'canary'];
const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'canary'];
const name = '@tryghost/content-api';
function GhostContentAPI({url, host, ghostPath = 'ghost', version, key}) {
// host parameter is deprecated
const defaultMakeRequest = ({url, method, params, headers}) => {
return axios[method](url, {
params,
paramsSerializer: (parameters) => {
return Object.keys(parameters).reduce((parts, k) => {
const val = encodeURIComponent([].concat(parameters[k]).join(','));
return parts.concat(`${k}=${val}`);
}, []).join('&');
},
headers
});
};
/**
*
* @param {Object} options
* @param {String} options.url
* @param {String} options.key
* @param {String} [options.ghostPath]
* @param {String} [options.version]
* @param {Function} [options.makeRequest]
* @param {String} [options.host] Deprecated
* @returns
*/
function GhostContentAPI({url, key, host, version, ghostPath = 'ghost', makeRequest = defaultMakeRequest}) {
/**
* host parameter is deprecated
* @deprecated use "url" instead
*/
if (host) {

@@ -20,9 +47,6 @@ // eslint-disable-next-line

if (this instanceof GhostContentAPI) {
return GhostContentAPI({url, version, key});
return GhostContentAPI({url, key, version, ghostPath, makeRequest});
}
if (!version) {
throw new Error(`${name} Config Missing: 'version' is required. E.g. ${supportedVersions.join(',')}`);
}
if (!supportedVersions.includes(version)) {
if (version && !supportedVersions.includes(version)) {
throw new Error(`${name} Config Invalid: 'version' ${version} is not supported`);

@@ -47,3 +71,3 @@ }

function browse(options = {}, memberToken) {
return makeRequest(resourceType, options, null, memberToken);
return makeApiRequest(resourceType, options, null, memberToken);
}

@@ -57,3 +81,3 @@ function read(data, options = {}, memberToken) {

return makeRequest(resourceType, params, data.id || `slug/${data.slug}`, memberToken);
return makeApiRequest(resourceType, params, data.id || `slug/${data.slug}`, memberToken);
}

@@ -73,3 +97,3 @@

function makeRequest(resourceType, params, id, membersToken = null) {
function makeApiRequest(resourceType, params, id, membersToken = null) {
if (!membersToken && !key) {

@@ -84,44 +108,50 @@ return Promise.reject(

Authorization: `GhostMembers ${membersToken}`
} : undefined;
} : {};
return axios.get(`${url}/${ghostPath}/api/${version}/content/${resourceType}/${id ? id + '/' : ''}`, {
params: Object.assign({key}, params),
paramsSerializer: (parameters) => {
return Object.keys(parameters).reduce((parts, k) => {
const val = encodeURIComponent([].concat(parameters[k]).join(','));
return parts.concat(`${k}=${val}`);
}, []).join('&');
},
if (!version || ['v4', 'v5', 'canary'].includes(version)) {
headers['Accept-Version'] = version || 'v5';
}
params = Object.assign({key}, params);
const apiUrl = version
? `${url}/${ghostPath}/api/${version}/content/${resourceType}/${id ? id + '/' : ''}`
: `${url}/${ghostPath}/api/content/${resourceType}/${id ? id + '/' : ''}`;
return makeRequest({
url: apiUrl,
method: 'get',
params,
headers
}).then((res) => {
if (!Array.isArray(res.data[resourceType])) {
return res.data[resourceType];
}
if (res.data[resourceType].length === 1 && !res.data.meta) {
return res.data[resourceType][0];
}
return Object.assign(res.data[resourceType], {meta: res.data.meta});
}).catch((err) => {
if (err.response && err.response.data && err.response.data.errors) {
const props = err.response.data.errors[0];
const toThrow = new Error(props.message);
const keys = Object.keys(props);
})
.then((res) => {
if (!Array.isArray(res.data[resourceType])) {
return res.data[resourceType];
}
if (res.data[resourceType].length === 1 && !res.data.meta) {
return res.data[resourceType][0];
}
return Object.assign(res.data[resourceType], {meta: res.data.meta});
}).catch((err) => {
if (err.response && err.response.data && err.response.data.errors) {
const props = err.response.data.errors[0];
const toThrow = new Error(props.message);
const keys = Object.keys(props);
toThrow.name = props.type;
toThrow.name = props.type;
keys.forEach((k) => {
toThrow[k] = props[k];
});
keys.forEach((k) => {
toThrow[k] = props[k];
});
toThrow.response = err.response;
toThrow.response = err.response;
// @TODO: remove in 2.0. We have enhanced the error handling, but we don't want to break existing implementations.
toThrow.request = err.request;
toThrow.config = err.config;
// @TODO: remove in 2.0. We have enhanced the error handling, but we don't want to break existing implementations.
toThrow.request = err.request;
toThrow.config = err.config;
throw toThrow;
} else {
throw err;
}
});
throw toThrow;
} else {
throw err;
}
});
}

@@ -128,0 +158,0 @@ }

import axios from 'axios';
const supportedVersions = ['v2', 'v3', 'v4', 'canary'];
const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'canary'];
const name = '@tryghost/content-api';
export default function GhostContentAPI({url, host, ghostPath = 'ghost', version, key}) {
// host parameter is deprecated
const defaultMakeRequest = ({url, method, params, headers}) => {
return axios[method](url, {
params,
paramsSerializer: (parameters) => {
return Object.keys(parameters).reduce((parts, k) => {
const val = encodeURIComponent([].concat(parameters[k]).join(','));
return parts.concat(`${k}=${val}`);
}, []).join('&');
},
headers
});
};
/**
*
* @param {Object} options
* @param {String} options.url
* @param {String} options.key
* @param {String} [options.ghostPath]
* @param {String} [options.version]
* @param {Function} [options.makeRequest]
* @param {String} [options.host] Deprecated
* @returns
*/
export default function GhostContentAPI({url, key, host, version, ghostPath = 'ghost', makeRequest = defaultMakeRequest}) {
/**
* host parameter is deprecated
* @deprecated use "url" instead
*/
if (host) {

@@ -17,9 +44,6 @@ // eslint-disable-next-line

if (this instanceof GhostContentAPI) {
return GhostContentAPI({url, version, key});
return GhostContentAPI({url, key, version, ghostPath, makeRequest});
}
if (!version) {
throw new Error(`${name} Config Missing: 'version' is required. E.g. ${supportedVersions.join(',')}`);
}
if (!supportedVersions.includes(version)) {
if (version && !supportedVersions.includes(version)) {
throw new Error(`${name} Config Invalid: 'version' ${version} is not supported`);

@@ -44,3 +68,3 @@ }

function browse(options = {}, memberToken) {
return makeRequest(resourceType, options, null, memberToken);
return makeApiRequest(resourceType, options, null, memberToken);
}

@@ -54,3 +78,3 @@ function read(data, options = {}, memberToken) {

return makeRequest(resourceType, params, data.id || `slug/${data.slug}`, memberToken);
return makeApiRequest(resourceType, params, data.id || `slug/${data.slug}`, memberToken);
}

@@ -70,3 +94,3 @@

function makeRequest(resourceType, params, id, membersToken = null) {
function makeApiRequest(resourceType, params, id, membersToken = null) {
if (!membersToken && !key) {

@@ -81,45 +105,51 @@ return Promise.reject(

Authorization: `GhostMembers ${membersToken}`
} : undefined;
} : {};
return axios.get(`${url}/${ghostPath}/api/${version}/content/${resourceType}/${id ? id + '/' : ''}`, {
params: Object.assign({key}, params),
paramsSerializer: (parameters) => {
return Object.keys(parameters).reduce((parts, k) => {
const val = encodeURIComponent([].concat(parameters[k]).join(','));
return parts.concat(`${k}=${val}`);
}, []).join('&');
},
if (!version || ['v4', 'v5', 'canary'].includes(version)) {
headers['Accept-Version'] = version || 'v5';
}
params = Object.assign({key}, params);
const apiUrl = version
? `${url}/${ghostPath}/api/${version}/content/${resourceType}/${id ? id + '/' : ''}`
: `${url}/${ghostPath}/api/content/${resourceType}/${id ? id + '/' : ''}`;
return makeRequest({
url: apiUrl,
method: 'get',
params,
headers
}).then((res) => {
if (!Array.isArray(res.data[resourceType])) {
return res.data[resourceType];
}
if (res.data[resourceType].length === 1 && !res.data.meta) {
return res.data[resourceType][0];
}
return Object.assign(res.data[resourceType], {meta: res.data.meta});
}).catch((err) => {
if (err.response && err.response.data && err.response.data.errors) {
const props = err.response.data.errors[0];
const toThrow = new Error(props.message);
const keys = Object.keys(props);
})
.then((res) => {
if (!Array.isArray(res.data[resourceType])) {
return res.data[resourceType];
}
if (res.data[resourceType].length === 1 && !res.data.meta) {
return res.data[resourceType][0];
}
return Object.assign(res.data[resourceType], {meta: res.data.meta});
}).catch((err) => {
if (err.response && err.response.data && err.response.data.errors) {
const props = err.response.data.errors[0];
const toThrow = new Error(props.message);
const keys = Object.keys(props);
toThrow.name = props.type;
toThrow.name = props.type;
keys.forEach((k) => {
toThrow[k] = props[k];
});
keys.forEach((k) => {
toThrow[k] = props[k];
});
toThrow.response = err.response;
toThrow.response = err.response;
// @TODO: remove in 2.0. We have enhanced the error handling, but we don't want to break existing implementations.
toThrow.request = err.request;
toThrow.config = err.config;
// @TODO: remove in 2.0. We have enhanced the error handling, but we don't want to break existing implementations.
toThrow.request = err.request;
toThrow.config = err.config;
throw toThrow;
} else {
throw err;
}
});
throw toThrow;
} else {
throw err;
}
});
}
}
{
"name": "@tryghost/content-api",
"version": "1.6.3",
"version": "1.7.0",
"repository": "https://github.com/TryGhost/SDK/tree/master/packages/content-api",

@@ -40,3 +40,3 @@ "author": "Ghost Foundation",

"mocha": "7.2.0",
"rollup": "2.69.2",
"rollup": "2.70.0",
"rollup-plugin-babel": "4.4.0",

@@ -53,3 +53,3 @@ "rollup-plugin-commonjs": "10.1.0",

},
"gitHead": "6836a610915b9a58f2b5f5b208c38fd4fd2586f1"
"gitHead": "6182ab7f7af627c445310aa185a4a5aa2c5d30f6"
}

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).GhostContentAPI=e()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n,r,o=function(t){return t&&t.Math==Math&&t},i=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof t&&t)||function(){return this}()||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},c=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u=!a((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),s=Function.prototype.call,f=u?s.bind(s):function(){return s.apply(s,arguments)},l={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,d={f:p&&!l.call({1:2},1)?function(t){var e=p(this,t);return!!e&&e.enumerable}:l},h=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},v=Function.prototype,g=v.bind,m=v.call,y=u&&g.bind(m,m),b=u?function(t){return t&&y(t)}:function(t){return t&&function(){return m.apply(t,arguments)}},w=b({}.toString),E=b("".slice),j=function(t){return E(w(t),8,-1)},S=i.Object,O=b("".split),x=a((function(){return!S("z").propertyIsEnumerable(0)}))?function(t){return"String"==j(t)?O(t,""):S(t)}:S,T=i.TypeError,C=function(t){if(null==t)throw T("Can't call method on "+t);return t},P=function(t){return x(C(t))},R=function(t){return"function"==typeof t},A=function(t){return"object"==typeof t?null!==t:R(t)},L=function(t){return R(t)?t:void 0},I=function(t,e){return arguments.length<2?L(i[t]):i[t]&&i[t][e]},k=b({}.isPrototypeOf),N=I("navigator","userAgent")||"",M=i.process,U=i.Deno,B=M&&M.versions||U&&U.version,F=B&&B.v8;F&&(r=(n=F.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&N&&(!(n=N.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=N.match(/Chrome\/(\d+)/))&&(r=+n[1]);var D=r,_=!!Object.getOwnPropertySymbols&&!a((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&D&&D<41})),q=_&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,z=i.Object,W=q?function(t){return"symbol"==typeof t}:function(t){var e=I("Symbol");return R(e)&&k(e.prototype,z(t))},G=i.String,H=function(t){try{return G(t)}catch(t){return"Object"}},V=i.TypeError,X=function(t){if(R(t))return t;throw V(H(t)+" is not a function")},K=function(t,e){var n=t[e];return null==n?void 0:X(n)},$=i.TypeError,J=Object.defineProperty,Y=function(t,e){try{J(i,t,{value:e,configurable:!0,writable:!0})}catch(n){i[t]=e}return e},Q="__core-js_shared__",Z=i[Q]||Y(Q,{}),tt=e((function(t){(t.exports=function(t,e){return Z[t]||(Z[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.21.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"})})),et=i.Object,nt=function(t){return et(C(t))},rt=b({}.hasOwnProperty),ot=Object.hasOwn||function(t,e){return rt(nt(t),e)},it=0,at=Math.random(),ct=b(1..toString),ut=function(t){return"Symbol("+(void 0===t?"":t)+")_"+ct(++it+at,36)},st=tt("wks"),ft=i.Symbol,lt=ft&&ft.for,pt=q?ft:ft&&ft.withoutSetter||ut,dt=function(t){if(!ot(st,t)||!_&&"string"!=typeof st[t]){var e="Symbol."+t;_&&ot(ft,t)?st[t]=ft[t]:st[t]=q&&lt?lt(e):pt(e)}return st[t]},ht=i.TypeError,vt=dt("toPrimitive"),gt=function(t,e){if(!A(t)||W(t))return t;var n,r=K(t,vt);if(r){if(void 0===e&&(e="default"),n=f(r,t,e),!A(n)||W(n))return n;throw ht("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var n,r;if("string"===e&&R(n=t.toString)&&!A(r=f(n,t)))return r;if(R(n=t.valueOf)&&!A(r=f(n,t)))return r;if("string"!==e&&R(n=t.toString)&&!A(r=f(n,t)))return r;throw $("Can't convert object to primitive value")}(t,e)},mt=function(t){var e=gt(t,"string");return W(e)?e:e+""},yt=i.document,bt=A(yt)&&A(yt.createElement),wt=function(t){return bt?yt.createElement(t):{}},Et=!c&&!a((function(){return 7!=Object.defineProperty(wt("div"),"a",{get:function(){return 7}}).a})),jt=Object.getOwnPropertyDescriptor,St={f:c?jt:function(t,e){if(t=P(t),e=mt(e),Et)try{return jt(t,e)}catch(t){}if(ot(t,e))return h(!f(d.f,t,e),t[e])}},Ot=c&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),xt=i.String,Tt=i.TypeError,Ct=function(t){if(A(t))return t;throw Tt(xt(t)+" is not an object")},Pt=i.TypeError,Rt=Object.defineProperty,At=Object.getOwnPropertyDescriptor,Lt="enumerable",It="configurable",kt="writable",Nt={f:c?Ot?function(t,e,n){if(Ct(t),e=mt(e),Ct(n),"function"==typeof t&&"prototype"===e&&"value"in n&&kt in n&&!n.writable){var r=At(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:It in n?n.configurable:r.configurable,enumerable:Lt in n?n.enumerable:r.enumerable,writable:!1})}return Rt(t,e,n)}:Rt:function(t,e,n){if(Ct(t),e=mt(e),Ct(n),Et)try{return Rt(t,e,n)}catch(t){}if("get"in n||"set"in n)throw Pt("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},Mt=c?function(t,e,n){return Nt.f(t,e,h(1,n))}:function(t,e,n){return t[e]=n,t},Ut=b(Function.toString);R(Z.inspectSource)||(Z.inspectSource=function(t){return Ut(t)});var Bt,Ft,Dt,_t=Z.inspectSource,qt=i.WeakMap,zt=R(qt)&&/native code/.test(_t(qt)),Wt=tt("keys"),Gt=function(t){return Wt[t]||(Wt[t]=ut(t))},Ht={},Vt="Object already initialized",Xt=i.TypeError,Kt=i.WeakMap;if(zt||Z.state){var $t=Z.state||(Z.state=new Kt),Jt=b($t.get),Yt=b($t.has),Qt=b($t.set);Bt=function(t,e){if(Yt($t,t))throw new Xt(Vt);return e.facade=t,Qt($t,t,e),e},Ft=function(t){return Jt($t,t)||{}},Dt=function(t){return Yt($t,t)}}else{var Zt=Gt("state");Ht[Zt]=!0,Bt=function(t,e){if(ot(t,Zt))throw new Xt(Vt);return e.facade=t,Mt(t,Zt,e),e},Ft=function(t){return ot(t,Zt)?t[Zt]:{}},Dt=function(t){return ot(t,Zt)}}var te={set:Bt,get:Ft,has:Dt,enforce:function(t){return Dt(t)?Ft(t):Bt(t,{})},getterFor:function(t){return function(e){var n;if(!A(e)||(n=Ft(e)).type!==t)throw Xt("Incompatible receiver, "+t+" required");return n}}},ee=Function.prototype,ne=c&&Object.getOwnPropertyDescriptor,re=ot(ee,"name"),oe={EXISTS:re,PROPER:re&&"something"===function(){}.name,CONFIGURABLE:re&&(!c||c&&ne(ee,"name").configurable)},ie=e((function(t){var e=oe.CONFIGURABLE,n=te.get,r=te.enforce,o=String(String).split("String");(t.exports=function(t,n,a,c){var u,s=!!c&&!!c.unsafe,f=!!c&&!!c.enumerable,l=!!c&&!!c.noTargetGet,p=c&&void 0!==c.name?c.name:n;R(a)&&("Symbol("===String(p).slice(0,7)&&(p="["+String(p).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!ot(a,"name")||e&&a.name!==p)&&Mt(a,"name",p),(u=r(a)).source||(u.source=o.join("string"==typeof p?p:""))),t!==i?(s?!l&&t[n]&&(f=!0):delete t[n],f?t[n]=a:Mt(t,n,a)):f?t[n]=a:Y(n,a)})(Function.prototype,"toString",(function(){return R(this)&&n(this).source||_t(this)}))})),ae=Math.ceil,ce=Math.floor,ue=function(t){var e=+t;return e!=e||0===e?0:(e>0?ce:ae)(e)},se=Math.max,fe=Math.min,le=Math.min,pe=function(t){return t>0?le(ue(t),9007199254740991):0},de=function(t){return pe(t.length)},he=function(t){return function(e,n,r){var o,i=P(e),a=de(i),c=function(t,e){var n=ue(t);return n<0?se(n+e,0):fe(n,e)}(r,a);if(t&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},ve={includes:he(!0),indexOf:he(!1)},ge=ve.indexOf,me=b([].push),ye=function(t,e){var n,r=P(t),o=0,i=[];for(n in r)!ot(Ht,n)&&ot(r,n)&&me(i,n);for(;e.length>o;)ot(r,n=e[o++])&&(~ge(i,n)||me(i,n));return i},be=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],we=be.concat("length","prototype"),Ee={f:Object.getOwnPropertyNames||function(t){return ye(t,we)}},je={f:Object.getOwnPropertySymbols},Se=b([].concat),Oe=I("Reflect","ownKeys")||function(t){var e=Ee.f(Ct(t)),n=je.f;return n?Se(e,n(t)):e},xe=function(t,e,n){for(var r=Oe(e),o=Nt.f,i=St.f,a=0;a<r.length;a++){var c=r[a];ot(t,c)||n&&ot(n,c)||o(t,c,i(e,c))}},Te=/#|\.prototype\./,Ce=function(t,e){var n=Re[Pe(t)];return n==Le||n!=Ae&&(R(e)?a(e):!!e)},Pe=Ce.normalize=function(t){return String(t).replace(Te,".").toLowerCase()},Re=Ce.data={},Ae=Ce.NATIVE="N",Le=Ce.POLYFILL="P",Ie=Ce,ke=St.f,Ne=function(t,e){var n,r,o,a,c,u=t.target,s=t.global,f=t.stat;if(n=s?i:f?i[u]||Y(u,{}):(i[u]||{}).prototype)for(r in e){if(a=e[r],o=t.noTargetGet?(c=ke(n,r))&&c.value:n[r],!Ie(s?r:u+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof a==typeof o)continue;xe(a,o)}(t.sham||o&&o.sham)&&Mt(a,"sham",!0),ie(n,r,a,t)}},Me=function(t,e){var n=[][t];return!!n&&a((function(){n.call(null,e||function(){return 1},1)}))},Ue=b([].join),Be=x!=Object,Fe=Me("join",",");Ne({target:"Array",proto:!0,forced:Be||!Fe},{join:function(t){return Ue(P(this),void 0===t?",":t)}});var De,_e=Object.keys||function(t){return ye(t,be)},qe={f:c&&!Ot?Object.defineProperties:function(t,e){Ct(t);for(var n,r=P(e),o=_e(e),i=o.length,a=0;i>a;)Nt.f(t,n=o[a++],r[n]);return t}},ze=I("document","documentElement"),We=Gt("IE_PROTO"),Ge=function(){},He=function(t){return"<script>"+t+"</"+"script>"},Ve=function(t){t.write(He("")),t.close();var e=t.parentWindow.Object;return t=null,e},Xe=function(){try{De=new ActiveXObject("htmlfile")}catch(t){}var t,e;Xe="undefined"!=typeof document?document.domain&&De?Ve(De):((e=wt("iframe")).style.display="none",ze.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(He("document.F=Object")),t.close(),t.F):Ve(De);for(var n=be.length;n--;)delete Xe.prototype[be[n]];return Xe()};Ht[We]=!0;var Ke=Object.create||function(t,e){var n;return null!==t?(Ge.prototype=Ct(t),n=new Ge,Ge.prototype=null,n[We]=t):n=Xe(),void 0===e?n:qe.f(n,e)},$e=dt("unscopables"),Je=Array.prototype;null==Je[$e]&&Nt.f(Je,$e,{configurable:!0,value:Ke(null)});var Ye,Qe=ve.includes;Ne({target:"Array",proto:!0},{includes:function(t){return Qe(this,t,arguments.length>1?arguments[1]:void 0)}}),Ye="includes",Je[$e][Ye]=!0;var Ze={};Ze[dt("toStringTag")]="z";var tn,en,nn="[object z]"===String(Ze),rn=dt("toStringTag"),on=i.Object,an="Arguments"==j(function(){return arguments}()),cn=nn?j:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=on(t),rn))?n:an?j(e):"Object"==(r=j(e))&&R(e.callee)?"Arguments":r},un=i.String,sn=function(t){if("Symbol"===cn(t))throw TypeError("Cannot convert a Symbol value to a string");return un(t)},fn=function(){var t=Ct(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},ln=i.RegExp,pn=a((function(){var t=ln("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),dn=pn||a((function(){return!ln("a","y").sticky})),hn={BROKEN_CARET:pn||a((function(){var t=ln("^r","gy");return t.lastIndex=2,null!=t.exec("str")})),MISSED_STICKY:dn,UNSUPPORTED_Y:pn},vn=i.RegExp,gn=a((function(){var t=vn(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),mn=i.RegExp,yn=a((function(){var t=mn("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),bn=te.get,wn=tt("native-string-replace",String.prototype.replace),En=RegExp.prototype.exec,jn=En,Sn=b("".charAt),On=b("".indexOf),xn=b("".replace),Tn=b("".slice),Cn=(en=/b*/g,f(En,tn=/a/,"a"),f(En,en,"a"),0!==tn.lastIndex||0!==en.lastIndex),Pn=hn.BROKEN_CARET,Rn=void 0!==/()??/.exec("")[1];(Cn||Rn||Pn||gn||yn)&&(jn=function(t){var e,n,r,o,i,a,c,u=this,s=bn(u),l=sn(t),p=s.raw;if(p)return p.lastIndex=u.lastIndex,e=f(jn,p,l),u.lastIndex=p.lastIndex,e;var d=s.groups,h=Pn&&u.sticky,v=f(fn,u),g=u.source,m=0,y=l;if(h&&(v=xn(v,"y",""),-1===On(v,"g")&&(v+="g"),y=Tn(l,u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==Sn(l,u.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,m++),n=new RegExp("^(?:"+g+")",v)),Rn&&(n=new RegExp("^"+g+"$(?!\\s)",v)),Cn&&(r=u.lastIndex),o=f(En,h?n:u,y),h?o?(o.input=Tn(o.input,m),o[0]=Tn(o[0],m),o.index=u.lastIndex,u.lastIndex+=o[0].length):u.lastIndex=0:Cn&&o&&(u.lastIndex=u.global?o.index+o[0].length:r),Rn&&o&&o.length>1&&f(wn,o[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)})),o&&d)for(o.groups=a=Ke(null),i=0;i<d.length;i++)a[(c=d[i])[0]]=o[c[1]];return o});Ne({target:"RegExp",proto:!0,forced:/./.exec!==jn},{exec:jn});var An,Ln=dt("match"),In=i.TypeError,kn=function(t){if(function(t){var e;return A(t)&&(void 0!==(e=t[Ln])?!!e:"RegExp"==j(t))}(t))throw In("The method doesn't accept regular expressions");return t},Nn=dt("match"),Mn=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[Nn]=!1,"/./"[t](e)}catch(t){}}return!1},Un=St.f,Bn=b("".endsWith),Fn=b("".slice),Dn=Math.min,_n=Mn("endsWith");Ne({target:"String",proto:!0,forced:!!(_n||(An=Un(String.prototype,"endsWith"),!An||An.writable))&&!_n},{endsWith:function(t){var e=sn(C(this));kn(t);var n=arguments.length>1?arguments[1]:void 0,r=e.length,o=void 0===n?r:Dn(pe(n),r),i=sn(t);return Bn?Bn(e,i,o):Fn(e,o-i.length,o)===i}});var qn=St.f,zn=b("".startsWith),Wn=b("".slice),Gn=Math.min,Hn=Mn("startsWith");Ne({target:"String",proto:!0,forced:!(!Hn&&!!function(){var t=qn(String.prototype,"startsWith");return t&&!t.writable}())&&!Hn},{startsWith:function(t){var e=sn(C(this));kn(t);var n=pe(Gn(arguments.length>1?arguments[1]:void 0,e.length)),r=sn(t);return zn?zn(e,r,n):Wn(e,n,n+r.length)===r}});var Vn=nn?{}.toString:function(){return"[object "+cn(this)+"]"};nn||ie(Object.prototype,"toString",Vn,{unsafe:!0});var Xn=i.Promise,Kn=i.String,$n=i.TypeError,Jn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=b(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return Ct(n),function(t){if("object"==typeof t||R(t))return t;throw $n("Can't set "+Kn(t)+" as a prototype")}(r),e?t(n,r):n.__proto__=r,n}}():void 0),Yn=Nt.f,Qn=dt("toStringTag"),Zn=dt("species"),tr=i.TypeError,er=b(b.bind),nr=function(t,e){return X(t),void 0===e?t:u?er(t,e):function(){return t.apply(e,arguments)}},rr={},or=dt("iterator"),ir=Array.prototype,ar=dt("iterator"),cr=function(t){if(null!=t)return K(t,ar)||K(t,"@@iterator")||rr[cn(t)]},ur=i.TypeError,sr=function(t,e,n){var r,o;Ct(t);try{if(!(r=K(t,"return"))){if("throw"===e)throw n;return n}r=f(r,t)}catch(t){o=!0,r=t}if("throw"===e)throw n;if(o)throw r;return Ct(r),n},fr=i.TypeError,lr=function(t,e){this.stopped=t,this.result=e},pr=lr.prototype,dr=function(t,e,n){var r,o,i,a,c,u,s,l,p=n&&n.that,d=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),v=!(!n||!n.INTERRUPTED),g=nr(e,p),m=function(t){return r&&sr(r,"normal",t),new lr(!0,t)},y=function(t){return d?(Ct(t),v?g(t[0],t[1],m):g(t[0],t[1])):v?g(t,m):g(t)};if(h)r=t;else{if(!(o=cr(t)))throw fr(H(t)+" is not iterable");if(void 0!==(l=o)&&(rr.Array===l||ir[or]===l)){for(i=0,a=de(t);a>i;i++)if((c=y(t[i]))&&k(pr,c))return c;return new lr(!1)}r=function(t,e){var n=arguments.length<2?cr(t):e;if(X(n))return Ct(f(n,t));throw ur(H(t)+" is not iterable")}(t,o)}for(u=r.next;!(s=f(u,r)).done;){try{c=y(s.value)}catch(t){sr(r,"throw",t)}if("object"==typeof c&&c&&k(pr,c))return c}return new lr(!1)},hr=dt("iterator"),vr=!1;try{var gr=0,mr={next:function(){return{done:!!gr++}},return:function(){vr=!0}};mr[hr]=function(){return this},Array.from(mr,(function(){throw 2}))}catch(t){}var yr=function(){},br=[],wr=I("Reflect","construct"),Er=/^\s*(?:class|function)\b/,jr=b(Er.exec),Sr=!Er.exec(yr),Or=function(t){if(!R(t))return!1;try{return wr(yr,br,t),!0}catch(t){return!1}},xr=function(t){if(!R(t))return!1;switch(cn(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Sr||!!jr(Er,_t(t))}catch(t){return!0}};xr.sham=!0;var Tr,Cr,Pr,Rr,Ar=!wr||a((function(){var t;return Or(Or.call)||!Or(Object)||!Or((function(){t=!0}))||t}))?xr:Or,Lr=i.TypeError,Ir=dt("species"),kr=function(t,e){var n,r=Ct(t).constructor;return void 0===r||null==(n=Ct(r)[Ir])?e:function(t){if(Ar(t))return t;throw Lr(H(t)+" is not a constructor")}(n)},Nr=Function.prototype,Mr=Nr.apply,Ur=Nr.call,Br="object"==typeof Reflect&&Reflect.apply||(u?Ur.bind(Mr):function(){return Ur.apply(Mr,arguments)}),Fr=b([].slice),Dr=i.TypeError,_r=function(t,e){if(t<e)throw Dr("Not enough arguments");return t},qr=/(?:ipad|iphone|ipod).*applewebkit/i.test(N),zr="process"==j(i.process),Wr=i.setImmediate,Gr=i.clearImmediate,Hr=i.process,Vr=i.Dispatch,Xr=i.Function,Kr=i.MessageChannel,$r=i.String,Jr=0,Yr={},Qr="onreadystatechange";try{Tr=i.location}catch(t){}var Zr=function(t){if(ot(Yr,t)){var e=Yr[t];delete Yr[t],e()}},to=function(t){return function(){Zr(t)}},eo=function(t){Zr(t.data)},no=function(t){i.postMessage($r(t),Tr.protocol+"//"+Tr.host)};Wr&&Gr||(Wr=function(t){_r(arguments.length,1);var e=R(t)?t:Xr(t),n=Fr(arguments,1);return Yr[++Jr]=function(){Br(e,void 0,n)},Cr(Jr),Jr},Gr=function(t){delete Yr[t]},zr?Cr=function(t){Hr.nextTick(to(t))}:Vr&&Vr.now?Cr=function(t){Vr.now(to(t))}:Kr&&!qr?(Rr=(Pr=new Kr).port2,Pr.port1.onmessage=eo,Cr=nr(Rr.postMessage,Rr)):i.addEventListener&&R(i.postMessage)&&!i.importScripts&&Tr&&"file:"!==Tr.protocol&&!a(no)?(Cr=no,i.addEventListener("message",eo,!1)):Cr=Qr in wt("script")?function(t){ze.appendChild(wt("script")).onreadystatechange=function(){ze.removeChild(this),Zr(t)}}:function(t){setTimeout(to(t),0)});var ro,oo,io,ao,co,uo,so,fo,lo={set:Wr,clear:Gr},po=/ipad|iphone|ipod/i.test(N)&&void 0!==i.Pebble,ho=/web0s(?!.*chrome)/i.test(N),vo=St.f,go=lo.set,mo=i.MutationObserver||i.WebKitMutationObserver,yo=i.document,bo=i.process,wo=i.Promise,Eo=vo(i,"queueMicrotask"),jo=Eo&&Eo.value;jo||(ro=function(){var t,e;for(zr&&(t=bo.domain)&&t.exit();oo;){e=oo.fn,oo=oo.next;try{e()}catch(t){throw oo?ao():io=void 0,t}}io=void 0,t&&t.enter()},qr||zr||ho||!mo||!yo?!po&&wo&&wo.resolve?((so=wo.resolve(void 0)).constructor=wo,fo=nr(so.then,so),ao=function(){fo(ro)}):zr?ao=function(){bo.nextTick(ro)}:(go=nr(go,i),ao=function(){go(ro)}):(co=!0,uo=yo.createTextNode(""),new mo(ro).observe(uo,{characterData:!0}),ao=function(){uo.data=co=!co}));var So=jo||function(t){var e={fn:t,next:void 0};io&&(io.next=e),oo||(oo=e,ao()),io=e},Oo=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=X(e),this.reject=X(n)},xo={f:function(t){return new Oo(t)}},To=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Co=function(){this.head=null,this.tail=null};Co.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var Po,Ro,Ao,Lo,Io,ko,No,Mo=Co,Uo="object"==typeof window,Bo=lo.set,Fo=dt("species"),Do="Promise",_o=te.getterFor(Do),qo=te.set,zo=te.getterFor(Do),Wo=Xn&&Xn.prototype,Go=Xn,Ho=Wo,Vo=i.TypeError,Xo=i.document,Ko=i.process,$o=xo.f,Jo=$o,Yo=!!(Xo&&Xo.createEvent&&i.dispatchEvent),Qo=R(i.PromiseRejectionEvent),Zo="unhandledrejection",ti=!1,ei=Ie(Do,(function(){var t=_t(Go),e=t!==String(Go);if(!e&&66===D)return!0;if(D>=51&&/native code/.test(t))return!1;var n=new Go((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))};return(n.constructor={})[Fo]=r,!(ti=n.then((function(){}))instanceof r)||!e&&Uo&&!Qo})),ni=ei||!function(t,e){if(!e&&!vr)return!1;var n=!1;try{var r={};r[hr]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){Go.all(t).catch((function(){}))})),ri=function(t){var e;return!(!A(t)||!R(e=t.then))&&e},oi=function(t,e){var n,r,o,i=e.value,a=1==e.state,c=a?t.ok:t.fail,u=t.resolve,s=t.reject,l=t.domain;try{c?(a||(2===e.rejection&&si(e),e.rejection=1),!0===c?n=i:(l&&l.enter(),n=c(i),l&&(l.exit(),o=!0)),n===t.promise?s(Vo("Promise-chain cycle")):(r=ri(n))?f(r,n,u,s):u(n)):s(i)}catch(t){l&&!o&&l.exit(),s(t)}},ii=function(t,e){t.notified||(t.notified=!0,So((function(){for(var n,r=t.reactions;n=r.get();)oi(n,t);t.notified=!1,e&&!t.rejection&&ci(t)})))},ai=function(t,e,n){var r,o;Yo?((r=Xo.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),i.dispatchEvent(r)):r={promise:e,reason:n},!Qo&&(o=i["on"+t])?o(r):t===Zo&&function(t,e){var n=i.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}("Unhandled promise rejection",n)},ci=function(t){f(Bo,i,(function(){var e,n=t.facade,r=t.value;if(ui(t)&&(e=To((function(){zr?Ko.emit("unhandledRejection",r,n):ai(Zo,n,r)})),t.rejection=zr||ui(t)?2:1,e.error))throw e.value}))},ui=function(t){return 1!==t.rejection&&!t.parent},si=function(t){f(Bo,i,(function(){var e=t.facade;zr?Ko.emit("rejectionHandled",e):ai("rejectionhandled",e,t.value)}))},fi=function(t,e,n){return function(r){t(e,r,n)}},li=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,ii(t,!0))},pi=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw Vo("Promise can't be resolved itself");var r=ri(e);r?So((function(){var n={done:!1};try{f(r,e,fi(pi,n,t),fi(li,n,t))}catch(e){li(n,e,t)}})):(t.value=e,t.state=1,ii(t,!1))}catch(e){li({done:!1},e,t)}}};if(ei&&(Ho=(Go=function(t){!function(t,e){if(k(e,t))return t;throw tr("Incorrect invocation")}(this,Ho),X(t),f(Po,this);var e=_o(this);try{t(fi(pi,e),fi(li,e))}catch(t){li(e,t)}}).prototype,(Po=function(t){qo(this,{type:Do,done:!1,notified:!1,parent:!1,reactions:new Mo,rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)ie(t,r,e[r],n);return t}(Ho,{then:function(t,e){var n=zo(this),r=$o(kr(this,Go));return n.parent=!0,r.ok=!R(t)||t,r.fail=R(e)&&e,r.domain=zr?Ko.domain:void 0,0==n.state?n.reactions.add(r):So((function(){oi(r,n)})),r.promise},catch:function(t){return this.then(void 0,t)}}),Ro=function(){var t=new Po,e=_o(t);this.promise=t,this.resolve=fi(pi,e),this.reject=fi(li,e)},xo.f=$o=function(t){return t===Go||t===Ao?new Ro(t):Jo(t)},R(Xn)&&Wo!==Object.prototype)){Lo=Wo.then,ti||(ie(Wo,"then",(function(t,e){var n=this;return new Go((function(t,e){f(Lo,n,t,e)})).then(t,e)}),{unsafe:!0}),ie(Wo,"catch",Ho.catch,{unsafe:!0}));try{delete Wo.constructor}catch(t){}Jn&&Jn(Wo,Ho)}Ne({global:!0,wrap:!0,forced:ei},{Promise:Go}),ko=Do,No=!1,(Io=Go)&&!No&&(Io=Io.prototype),Io&&!ot(Io,Qn)&&Yn(Io,Qn,{configurable:!0,value:ko}),function(t){var e=I(t),n=Nt.f;c&&e&&!e[Zn]&&n(e,Zn,{configurable:!0,get:function(){return this}})}(Do),Ao=I(Do),Ne({target:Do,stat:!0,forced:ei},{reject:function(t){var e=$o(this);return f(e.reject,void 0,t),e.promise}}),Ne({target:Do,stat:!0,forced:ei},{resolve:function(t){return function(t,e){if(Ct(t),A(e)&&e.constructor===t)return e;var n=xo.f(t);return(0,n.resolve)(e),n.promise}(this,t)}}),Ne({target:Do,stat:!0,forced:ni},{all:function(t){var e=this,n=$o(e),r=n.resolve,o=n.reject,i=To((function(){var n=X(e.resolve),i=[],a=0,c=1;dr(t,(function(t){var u=a++,s=!1;c++,f(n,e,t).then((function(t){s||(s=!0,i[u]=t,--c||r(i))}),o)})),--c||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=$o(e),r=n.reject,o=To((function(){var o=X(e.resolve);dr(t,(function(t){f(o,e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}});var di=Object.assign,hi=Object.defineProperty,vi=b([].concat),gi=!di||a((function(){if(c&&1!==di({b:1},di(hi({},"a",{enumerable:!0,get:function(){hi(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=di({},t)[n]||_e(di({},e)).join("")!=r}))?function(t,e){for(var n=nt(t),r=arguments.length,o=1,i=je.f,a=d.f;r>o;)for(var u,s=x(arguments[o++]),l=i?vi(_e(s),i(s)):_e(s),p=l.length,h=0;p>h;)u=l[h++],c&&!f(a,s,u)||(n[u]=s[u]);return n}:di;Ne({target:"Object",stat:!0,forced:Object.assign!==gi},{assign:gi});var mi,yi=Array.isArray||function(t){return"Array"==j(t)},bi=function(t,e,n){var r=mt(e);r in t?Nt.f(t,r,h(0,n)):t[r]=n},wi=dt("species"),Ei=i.Array,ji=function(t,e){return new(function(t){var e;return yi(t)&&(e=t.constructor,(Ar(e)&&(e===Ei||yi(e.prototype))||A(e)&&null===(e=e[wi]))&&(e=void 0)),void 0===e?Ei:e}(t))(0===e?0:e)},Si=dt("species"),Oi=dt("isConcatSpreadable"),xi=9007199254740991,Ti="Maximum allowed index exceeded",Ci=i.TypeError,Pi=D>=51||!a((function(){var t=[];return t[Oi]=!1,t.concat()[0]!==t})),Ri=(mi="concat",D>=51||!a((function(){var t=[];return(t.constructor={})[Si]=function(){return{foo:1}},1!==t[mi](Boolean).foo}))),Ai=function(t){if(!A(t))return!1;var e=t[Oi];return void 0!==e?!!e:yi(t)};Ne({target:"Array",proto:!0,forced:!Pi||!Ri},{concat:function(t){var e,n,r,o,i,a=nt(this),c=ji(a,0),u=0;for(e=-1,r=arguments.length;e<r;e++)if(Ai(i=-1===e?a:arguments[e])){if(u+(o=de(i))>xi)throw Ci(Ti);for(n=0;n<o;n++,u++)n in i&&bi(c,u,i[n])}else{if(u>=xi)throw Ci(Ti);bi(c,u++,i)}return c.length=u,c}}),Ne({target:"Object",stat:!0,forced:a((function(){_e(1)}))},{keys:function(t){return _e(nt(t))}});var Li=oe.EXISTS,Ii=Nt.f,ki=Function.prototype,Ni=b(ki.toString),Mi=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Ui=b(Mi.exec);c&&!Li&&Ii(ki,"name",{configurable:!0,get:function(){try{return Ui(Mi,Ni(this))[1]}catch(t){return""}}});var Bi={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Fi=wt("span").classList,Di=Fi&&Fi.constructor&&Fi.constructor.prototype,_i=Di===Object.prototype?void 0:Di,qi=b([].push),zi=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,a=7==t,c=5==t||i;return function(u,s,f,l){for(var p,d,h=nt(u),v=x(h),g=nr(s,f),m=de(v),y=0,b=l||ji,w=e?b(u,m):n||a?b(u,0):void 0;m>y;y++)if((c||y in v)&&(d=g(p=v[y],y,h),t))if(e)w[y]=d;else if(d)switch(t){case 3:return!0;case 5:return p;case 6:return y;case 2:qi(w,p)}else switch(t){case 4:return!1;case 7:qi(w,p)}return i?-1:r||o?o:w}},Wi={forEach:zi(0),map:zi(1),filter:zi(2),some:zi(3),every:zi(4),find:zi(5),findIndex:zi(6),filterReject:zi(7)}.forEach,Gi=Me("forEach")?[].forEach:function(t){return Wi(this,t,arguments.length>1?arguments[1]:void 0)},Hi=function(t){if(t&&t.forEach!==Gi)try{Mt(t,"forEach",Gi)}catch(e){t.forEach=Gi}};for(var Vi in Bi)Bi[Vi]&&Hi(i[Vi]&&i[Vi].prototype);Hi(_i);var Xi=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}},Ki=Object.prototype.toString;function $i(t){return"[object Array]"===Ki.call(t)}function Ji(t){return void 0===t}function Yi(t){return null!==t&&"object"==typeof t}function Qi(t){if("[object Object]"!==Ki.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function Zi(t){return"[object Function]"===Ki.call(t)}function ta(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),$i(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}var ea={isArray:$i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===Ki.call(t)},isBuffer:function(t){return null!==t&&!Ji(t)&&null!==t.constructor&&!Ji(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:Yi,isPlainObject:Qi,isUndefined:Ji,isDate:function(t){return"[object Date]"===Ki.call(t)},isFile:function(t){return"[object File]"===Ki.call(t)},isBlob:function(t){return"[object Blob]"===Ki.call(t)},isFunction:Zi,isStream:function(t){return Yi(t)&&Zi(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:ta,merge:function t(){var e={};function n(n,r){Qi(e[r])&&Qi(n)?e[r]=t(e[r],n):Qi(n)?e[r]=t({},n):$i(n)?e[r]=n.slice():e[r]=n}for(var r=0,o=arguments.length;r<o;r++)ta(arguments[r],n);return e},extend:function(t,e,n){return ta(e,(function(e,r){t[r]=n&&"function"==typeof e?Xi(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}};function na(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var ra=function(t,e,n){if(!e)return t;var r;if(n)r=n(e);else if(ea.isURLSearchParams(e))r=e.toString();else{var o=[];ea.forEach(e,(function(t,e){null!=t&&(ea.isArray(t)?e+="[]":t=[t],ea.forEach(t,(function(t){ea.isDate(t)?t=t.toISOString():ea.isObject(t)&&(t=JSON.stringify(t)),o.push(na(e)+"="+na(t))})))})),r=o.join("&")}if(r){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t};function oa(){this.handlers=[]}oa.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},oa.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},oa.prototype.forEach=function(t){ea.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var ia=oa,aa=function(t,e,n){return ea.forEach(n,(function(n){t=n(t,e)})),t},ca=function(t){return!(!t||!t.__CANCEL__)},ua=function(t,e){ea.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))},sa=function(t,e,n,r,o){return function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t.isAxiosError=!0,t.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}},t}(new Error(t),e,n,r,o)},fa=ea.isStandardBrowserEnv()?{write:function(t,e,n,r,o,i){var a=[];a.push(t+"="+encodeURIComponent(e)),ea.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),ea.isString(r)&&a.push("path="+r),ea.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},la=["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"],pa=ea.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=r(window.location.href),function(e){var n=ea.isString(e)?r(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0},da=function(t){return new Promise((function(e,n){var r=t.data,o=t.headers;ea.isFormData(r)&&delete o["Content-Type"];var i=new XMLHttpRequest;if(t.auth){var a=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(a+":"+c)}var u,s,f=(u=t.baseURL,s=t.url,u&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(s)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(u,s):s);if(i.open(t.method.toUpperCase(),ra(f,t.params,t.paramsSerializer),!0),i.timeout=t.timeout,i.onreadystatechange=function(){if(i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in i?function(t){var e,n,r,o={};return t?(ea.forEach(t.split("\n"),(function(t){if(r=t.indexOf(":"),e=ea.trim(t.substr(0,r)).toLowerCase(),n=ea.trim(t.substr(r+1)),e){if(o[e]&&la.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([n]):o[e]?o[e]+", "+n:n}})),o):o}(i.getAllResponseHeaders()):null,o={data:t.responseType&&"text"!==t.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:r,config:t,request:i};!function(t,e,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(sa("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}(e,n,o),i=null}},i.onabort=function(){i&&(n(sa("Request aborted",t,"ECONNABORTED",i)),i=null)},i.onerror=function(){n(sa("Network Error",t,null,i)),i=null},i.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(sa(e,t,"ECONNABORTED",i)),i=null},ea.isStandardBrowserEnv()){var l=(t.withCredentials||pa(f))&&t.xsrfCookieName?fa.read(t.xsrfCookieName):void 0;l&&(o[t.xsrfHeaderName]=l)}if("setRequestHeader"in i&&ea.forEach(o,(function(t,e){void 0===r&&"content-type"===e.toLowerCase()?delete o[e]:i.setRequestHeader(e,t)})),ea.isUndefined(t.withCredentials)||(i.withCredentials=!!t.withCredentials),t.responseType)try{i.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&i.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){i&&(i.abort(),n(t),i=null)})),r||(r=null),i.send(r)}))},ha={"Content-Type":"application/x-www-form-urlencoded"};function va(t,e){!ea.isUndefined(t)&&ea.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var ga,ma={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(ga=da),ga),transformRequest:[function(t,e){return ua(e,"Accept"),ua(e,"Content-Type"),ea.isFormData(t)||ea.isArrayBuffer(t)||ea.isBuffer(t)||ea.isStream(t)||ea.isFile(t)||ea.isBlob(t)?t:ea.isArrayBufferView(t)?t.buffer:ea.isURLSearchParams(t)?(va(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):ea.isObject(t)?(va(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};ma.headers={common:{Accept:"application/json, text/plain, */*"}},ea.forEach(["delete","get","head"],(function(t){ma.headers[t]={}})),ea.forEach(["post","put","patch"],(function(t){ma.headers[t]=ea.merge(ha)}));var ya=ma;function ba(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var wa=function(t){return ba(t),t.headers=t.headers||{},t.data=aa(t.data,t.headers,t.transformRequest),t.headers=ea.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),ea.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||ya.adapter)(t).then((function(e){return ba(t),e.data=aa(e.data,e.headers,t.transformResponse),e}),(function(e){return ca(e)||(ba(t),e&&e.response&&(e.response.data=aa(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},Ea=function(t,e){e=e||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(t,e){return ea.isPlainObject(t)&&ea.isPlainObject(e)?ea.merge(t,e):ea.isPlainObject(e)?ea.merge({},e):ea.isArray(e)?e.slice():e}function u(r){ea.isUndefined(e[r])?ea.isUndefined(t[r])||(n[r]=c(void 0,t[r])):n[r]=c(t[r],e[r])}ea.forEach(r,(function(t){ea.isUndefined(e[t])||(n[t]=c(void 0,e[t]))})),ea.forEach(o,u),ea.forEach(i,(function(r){ea.isUndefined(e[r])?ea.isUndefined(t[r])||(n[r]=c(void 0,t[r])):n[r]=c(void 0,e[r])})),ea.forEach(a,(function(r){r in e?n[r]=c(t[r],e[r]):r in t&&(n[r]=c(void 0,t[r]))}));var s=r.concat(o).concat(i).concat(a),f=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===s.indexOf(t)}));return ea.forEach(f,u),n};function ja(t){this.defaults=t,this.interceptors={request:new ia,response:new ia}}ja.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Ea(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[wa,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)n=n.then(e.shift(),e.shift());return n},ja.prototype.getUri=function(t){return t=Ea(this.defaults,t),ra(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},ea.forEach(["delete","get","head","options"],(function(t){ja.prototype[t]=function(e,n){return this.request(Ea(n||{},{method:t,url:e,data:(n||{}).data}))}})),ea.forEach(["post","put","patch"],(function(t){ja.prototype[t]=function(e,n,r){return this.request(Ea(r||{},{method:t,url:e,data:n}))}}));var Sa=ja;function Oa(t){this.message=t}Oa.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Oa.prototype.__CANCEL__=!0;var xa=Oa;function Ta(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new xa(t),e(n.reason))}))}Ta.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Ta.source=function(){var t;return{token:new Ta((function(e){t=e})),cancel:t}};var Ca=Ta;function Pa(t){var e=new Sa(t),n=Xi(Sa.prototype.request,e);return ea.extend(n,Sa.prototype,e),ea.extend(n,e),n}var Ra=Pa(ya);Ra.Axios=Sa,Ra.create=function(t){return Pa(Ea(Ra.defaults,t))},Ra.Cancel=xa,Ra.CancelToken=Ca,Ra.isCancel=ca,Ra.all=function(t){return Promise.all(t)},Ra.spread=function(t){return function(e){return t.apply(null,e)}},Ra.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError};var Aa=Ra,La=Ra;Aa.default=La;var Ia=Aa,ka=["v2","v3","v4","canary"],Na="@tryghost/content-api";return function t(e){var n=e.url,r=e.host,o=e.ghostPath,i=void 0===o?"ghost":o,a=e.version,c=e.key;if(r&&(console.warn("".concat(Na,": The 'host' parameter is deprecated, please use 'url' instead")),n||(n=r)),this instanceof t)return t({url:n,version:a,key:c});if(!a)throw new Error("".concat(Na," Config Missing: 'version' is required. E.g. ").concat(ka.join(",")));if(!ka.includes(a))throw new Error("".concat(Na," Config Invalid: 'version' ").concat(a," is not supported"));if(!n)throw new Error("".concat(Na," Config Missing: 'url' is required. E.g. 'https://site.com'"));if(!/https?:\/\//.test(n))throw new Error("".concat(Na," Config Invalid: 'url' ").concat(n," requires a protocol. E.g. 'https://site.com'"));if(n.endsWith("/"))throw new Error("".concat(Na," Config Invalid: 'url' ").concat(n," must not have a trailing slash. E.g. 'https://site.com'"));if(i.endsWith("/")||i.startsWith("/"))throw new Error("".concat(Na," Config Invalid: 'ghostPath' ").concat(i," must not have a leading or trailing slash. E.g. 'ghost'"));if(c&&!/[0-9a-f]{26}/.test(c))throw new Error("".concat(Na," Config Invalid: 'key' ").concat(c," must have 26 hex characters"));var u=["posts","authors","tags","pages","settings"].reduce((function(t,e){return Object.assign(t,function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,{read:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!t||!t.id&&!t.slug)return Promise.reject(new Error("".concat(Na," read requires an id or slug.")));var o=Object.assign({},t,n);return s(e,o,t.id||"slug/".concat(t.slug),r)},browse:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return s(e,t,null,n)}}))}),{});return delete u.settings.read,u;function s(t,e,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!o&&!c)return Promise.reject(new Error("".concat(Na," Config Missing: 'key' is required.")));delete e.id;var u=o?{Authorization:"GhostMembers ".concat(o)}:void 0;return Ia.get("".concat(n,"/").concat(i,"/api/").concat(a,"/content/").concat(t,"/").concat(r?r+"/":""),{params:Object.assign({key:c},e),paramsSerializer:function(t){return Object.keys(t).reduce((function(e,n){var r=encodeURIComponent([].concat(t[n]).join(","));return e.concat("".concat(n,"=").concat(r))}),[]).join("&")},headers:u}).then((function(e){return Array.isArray(e.data[t])?1!==e.data[t].length||e.data.meta?Object.assign(e.data[t],{meta:e.data.meta}):e.data[t][0]:e.data[t]})).catch((function(t){if(t.response&&t.response.data&&t.response.data.errors){var e=t.response.data.errors[0],n=new Error(e.message),r=Object.keys(e);throw n.name=e.type,r.forEach((function(t){n[t]=e[t]})),n.response=t.response,n.request=t.request,n.config=t.config,n}throw t}))}}}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).GhostContentAPI=e()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n,r,o=function(t){return t&&t.Math==Math&&t},i=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof t&&t)||function(){return this}()||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},c=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u=!a((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),s=Function.prototype.call,f=u?s.bind(s):function(){return s.apply(s,arguments)},l={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,d={f:p&&!l.call({1:2},1)?function(t){var e=p(this,t);return!!e&&e.enumerable}:l},h=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},v=Function.prototype,g=v.bind,m=v.call,y=u&&g.bind(m,m),b=u?function(t){return t&&y(t)}:function(t){return t&&function(){return m.apply(t,arguments)}},w=b({}.toString),j=b("".slice),E=function(t){return j(w(t),8,-1)},S=i.Object,O=b("".split),x=a((function(){return!S("z").propertyIsEnumerable(0)}))?function(t){return"String"==E(t)?O(t,""):S(t)}:S,T=i.TypeError,P=function(t){if(null==t)throw T("Can't call method on "+t);return t},C=function(t){return x(P(t))},R=function(t){return"function"==typeof t},A=function(t){return"object"==typeof t?null!==t:R(t)},L=function(t){return R(t)?t:void 0},I=function(t,e){return arguments.length<2?L(i[t]):i[t]&&i[t][e]},k=b({}.isPrototypeOf),N=I("navigator","userAgent")||"",M=i.process,U=i.Deno,B=M&&M.versions||U&&U.version,F=B&&B.v8;F&&(r=(n=F.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&N&&(!(n=N.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=N.match(/Chrome\/(\d+)/))&&(r=+n[1]);var D=r,_=!!Object.getOwnPropertySymbols&&!a((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&D&&D<41})),q=_&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,z=i.Object,W=q?function(t){return"symbol"==typeof t}:function(t){var e=I("Symbol");return R(e)&&k(e.prototype,z(t))},G=i.String,H=function(t){try{return G(t)}catch(t){return"Object"}},V=i.TypeError,X=function(t){if(R(t))return t;throw V(H(t)+" is not a function")},K=function(t,e){var n=t[e];return null==n?void 0:X(n)},$=i.TypeError,J=Object.defineProperty,Y=function(t,e){try{J(i,t,{value:e,configurable:!0,writable:!0})}catch(n){i[t]=e}return e},Q="__core-js_shared__",Z=i[Q]||Y(Q,{}),tt=e((function(t){(t.exports=function(t,e){return Z[t]||(Z[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.21.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"})})),et=i.Object,nt=function(t){return et(P(t))},rt=b({}.hasOwnProperty),ot=Object.hasOwn||function(t,e){return rt(nt(t),e)},it=0,at=Math.random(),ct=b(1..toString),ut=function(t){return"Symbol("+(void 0===t?"":t)+")_"+ct(++it+at,36)},st=tt("wks"),ft=i.Symbol,lt=ft&&ft.for,pt=q?ft:ft&&ft.withoutSetter||ut,dt=function(t){if(!ot(st,t)||!_&&"string"!=typeof st[t]){var e="Symbol."+t;_&&ot(ft,t)?st[t]=ft[t]:st[t]=q&&lt?lt(e):pt(e)}return st[t]},ht=i.TypeError,vt=dt("toPrimitive"),gt=function(t,e){if(!A(t)||W(t))return t;var n,r=K(t,vt);if(r){if(void 0===e&&(e="default"),n=f(r,t,e),!A(n)||W(n))return n;throw ht("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var n,r;if("string"===e&&R(n=t.toString)&&!A(r=f(n,t)))return r;if(R(n=t.valueOf)&&!A(r=f(n,t)))return r;if("string"!==e&&R(n=t.toString)&&!A(r=f(n,t)))return r;throw $("Can't convert object to primitive value")}(t,e)},mt=function(t){var e=gt(t,"string");return W(e)?e:e+""},yt=i.document,bt=A(yt)&&A(yt.createElement),wt=function(t){return bt?yt.createElement(t):{}},jt=!c&&!a((function(){return 7!=Object.defineProperty(wt("div"),"a",{get:function(){return 7}}).a})),Et=Object.getOwnPropertyDescriptor,St={f:c?Et:function(t,e){if(t=C(t),e=mt(e),jt)try{return Et(t,e)}catch(t){}if(ot(t,e))return h(!f(d.f,t,e),t[e])}},Ot=c&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),xt=i.String,Tt=i.TypeError,Pt=function(t){if(A(t))return t;throw Tt(xt(t)+" is not an object")},Ct=i.TypeError,Rt=Object.defineProperty,At=Object.getOwnPropertyDescriptor,Lt="enumerable",It="configurable",kt="writable",Nt={f:c?Ot?function(t,e,n){if(Pt(t),e=mt(e),Pt(n),"function"==typeof t&&"prototype"===e&&"value"in n&&kt in n&&!n.writable){var r=At(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:It in n?n.configurable:r.configurable,enumerable:Lt in n?n.enumerable:r.enumerable,writable:!1})}return Rt(t,e,n)}:Rt:function(t,e,n){if(Pt(t),e=mt(e),Pt(n),jt)try{return Rt(t,e,n)}catch(t){}if("get"in n||"set"in n)throw Ct("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},Mt=c?function(t,e,n){return Nt.f(t,e,h(1,n))}:function(t,e,n){return t[e]=n,t},Ut=b(Function.toString);R(Z.inspectSource)||(Z.inspectSource=function(t){return Ut(t)});var Bt,Ft,Dt,_t=Z.inspectSource,qt=i.WeakMap,zt=R(qt)&&/native code/.test(_t(qt)),Wt=tt("keys"),Gt=function(t){return Wt[t]||(Wt[t]=ut(t))},Ht={},Vt="Object already initialized",Xt=i.TypeError,Kt=i.WeakMap;if(zt||Z.state){var $t=Z.state||(Z.state=new Kt),Jt=b($t.get),Yt=b($t.has),Qt=b($t.set);Bt=function(t,e){if(Yt($t,t))throw new Xt(Vt);return e.facade=t,Qt($t,t,e),e},Ft=function(t){return Jt($t,t)||{}},Dt=function(t){return Yt($t,t)}}else{var Zt=Gt("state");Ht[Zt]=!0,Bt=function(t,e){if(ot(t,Zt))throw new Xt(Vt);return e.facade=t,Mt(t,Zt,e),e},Ft=function(t){return ot(t,Zt)?t[Zt]:{}},Dt=function(t){return ot(t,Zt)}}var te={set:Bt,get:Ft,has:Dt,enforce:function(t){return Dt(t)?Ft(t):Bt(t,{})},getterFor:function(t){return function(e){var n;if(!A(e)||(n=Ft(e)).type!==t)throw Xt("Incompatible receiver, "+t+" required");return n}}},ee=Function.prototype,ne=c&&Object.getOwnPropertyDescriptor,re=ot(ee,"name"),oe={EXISTS:re,PROPER:re&&"something"===function(){}.name,CONFIGURABLE:re&&(!c||c&&ne(ee,"name").configurable)},ie=e((function(t){var e=oe.CONFIGURABLE,n=te.get,r=te.enforce,o=String(String).split("String");(t.exports=function(t,n,a,c){var u,s=!!c&&!!c.unsafe,f=!!c&&!!c.enumerable,l=!!c&&!!c.noTargetGet,p=c&&void 0!==c.name?c.name:n;R(a)&&("Symbol("===String(p).slice(0,7)&&(p="["+String(p).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!ot(a,"name")||e&&a.name!==p)&&Mt(a,"name",p),(u=r(a)).source||(u.source=o.join("string"==typeof p?p:""))),t!==i?(s?!l&&t[n]&&(f=!0):delete t[n],f?t[n]=a:Mt(t,n,a)):f?t[n]=a:Y(n,a)})(Function.prototype,"toString",(function(){return R(this)&&n(this).source||_t(this)}))})),ae=Math.ceil,ce=Math.floor,ue=function(t){var e=+t;return e!=e||0===e?0:(e>0?ce:ae)(e)},se=Math.max,fe=Math.min,le=Math.min,pe=function(t){return t>0?le(ue(t),9007199254740991):0},de=function(t){return pe(t.length)},he=function(t){return function(e,n,r){var o,i=C(e),a=de(i),c=function(t,e){var n=ue(t);return n<0?se(n+e,0):fe(n,e)}(r,a);if(t&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},ve={includes:he(!0),indexOf:he(!1)},ge=ve.indexOf,me=b([].push),ye=function(t,e){var n,r=C(t),o=0,i=[];for(n in r)!ot(Ht,n)&&ot(r,n)&&me(i,n);for(;e.length>o;)ot(r,n=e[o++])&&(~ge(i,n)||me(i,n));return i},be=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],we=be.concat("length","prototype"),je={f:Object.getOwnPropertyNames||function(t){return ye(t,we)}},Ee={f:Object.getOwnPropertySymbols},Se=b([].concat),Oe=I("Reflect","ownKeys")||function(t){var e=je.f(Pt(t)),n=Ee.f;return n?Se(e,n(t)):e},xe=function(t,e,n){for(var r=Oe(e),o=Nt.f,i=St.f,a=0;a<r.length;a++){var c=r[a];ot(t,c)||n&&ot(n,c)||o(t,c,i(e,c))}},Te=/#|\.prototype\./,Pe=function(t,e){var n=Re[Ce(t)];return n==Le||n!=Ae&&(R(e)?a(e):!!e)},Ce=Pe.normalize=function(t){return String(t).replace(Te,".").toLowerCase()},Re=Pe.data={},Ae=Pe.NATIVE="N",Le=Pe.POLYFILL="P",Ie=Pe,ke=St.f,Ne=function(t,e){var n,r,o,a,c,u=t.target,s=t.global,f=t.stat;if(n=s?i:f?i[u]||Y(u,{}):(i[u]||{}).prototype)for(r in e){if(a=e[r],o=t.noTargetGet?(c=ke(n,r))&&c.value:n[r],!Ie(s?r:u+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof a==typeof o)continue;xe(a,o)}(t.sham||o&&o.sham)&&Mt(a,"sham",!0),ie(n,r,a,t)}},Me=function(t,e){var n=[][t];return!!n&&a((function(){n.call(null,e||function(){return 1},1)}))},Ue=b([].join),Be=x!=Object,Fe=Me("join",",");Ne({target:"Array",proto:!0,forced:Be||!Fe},{join:function(t){return Ue(C(this),void 0===t?",":t)}});var De={};De[dt("toStringTag")]="z";var _e="[object z]"===String(De),qe=dt("toStringTag"),ze=i.Object,We="Arguments"==E(function(){return arguments}()),Ge=_e?E:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=ze(t),qe))?n:We?E(e):"Object"==(r=E(e))&&R(e.callee)?"Arguments":r},He=_e?{}.toString:function(){return"[object "+Ge(this)+"]"};_e||ie(Object.prototype,"toString",He,{unsafe:!0});var Ve=Object.keys||function(t){return ye(t,be)};Ne({target:"Object",stat:!0,forced:a((function(){Ve(1)}))},{keys:function(t){return Ve(nt(t))}});var Xe=Array.isArray||function(t){return"Array"==E(t)},Ke=function(t,e,n){var r=mt(e);r in t?Nt.f(t,r,h(0,n)):t[r]=n},$e=function(){},Je=[],Ye=I("Reflect","construct"),Qe=/^\s*(?:class|function)\b/,Ze=b(Qe.exec),tn=!Qe.exec($e),en=function(t){if(!R(t))return!1;try{return Ye($e,Je,t),!0}catch(t){return!1}},nn=function(t){if(!R(t))return!1;switch(Ge(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return tn||!!Ze(Qe,_t(t))}catch(t){return!0}};nn.sham=!0;var rn,on=!Ye||a((function(){var t;return en(en.call)||!en(Object)||!en((function(){t=!0}))||t}))?nn:en,an=dt("species"),cn=i.Array,un=function(t,e){return new(function(t){var e;return Xe(t)&&(e=t.constructor,(on(e)&&(e===cn||Xe(e.prototype))||A(e)&&null===(e=e[an]))&&(e=void 0)),void 0===e?cn:e}(t))(0===e?0:e)},sn=dt("species"),fn=dt("isConcatSpreadable"),ln=9007199254740991,pn="Maximum allowed index exceeded",dn=i.TypeError,hn=D>=51||!a((function(){var t=[];return t[fn]=!1,t.concat()[0]!==t})),vn=(rn="concat",D>=51||!a((function(){var t=[];return(t.constructor={})[sn]=function(){return{foo:1}},1!==t[rn](Boolean).foo}))),gn=function(t){if(!A(t))return!1;var e=t[fn];return void 0!==e?!!e:Xe(t)};Ne({target:"Array",proto:!0,forced:!hn||!vn},{concat:function(t){var e,n,r,o,i,a=nt(this),c=un(a,0),u=0;for(e=-1,r=arguments.length;e<r;e++)if(gn(i=-1===e?a:arguments[e])){if(u+(o=de(i))>ln)throw dn(pn);for(n=0;n<o;n++,u++)n in i&&Ke(c,u,i[n])}else{if(u>=ln)throw dn(pn);Ke(c,u++,i)}return c.length=u,c}});var mn,yn={f:c&&!Ot?Object.defineProperties:function(t,e){Pt(t);for(var n,r=C(e),o=Ve(e),i=o.length,a=0;i>a;)Nt.f(t,n=o[a++],r[n]);return t}},bn=I("document","documentElement"),wn=Gt("IE_PROTO"),jn=function(){},En=function(t){return"<script>"+t+"</"+"script>"},Sn=function(t){t.write(En("")),t.close();var e=t.parentWindow.Object;return t=null,e},On=function(){try{mn=new ActiveXObject("htmlfile")}catch(t){}var t,e;On="undefined"!=typeof document?document.domain&&mn?Sn(mn):((e=wt("iframe")).style.display="none",bn.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(En("document.F=Object")),t.close(),t.F):Sn(mn);for(var n=be.length;n--;)delete On.prototype[be[n]];return On()};Ht[wn]=!0;var xn=Object.create||function(t,e){var n;return null!==t?(jn.prototype=Pt(t),n=new jn,jn.prototype=null,n[wn]=t):n=On(),void 0===e?n:yn.f(n,e)},Tn=dt("unscopables"),Pn=Array.prototype;null==Pn[Tn]&&Nt.f(Pn,Tn,{configurable:!0,value:xn(null)});var Cn,Rn=ve.includes;Ne({target:"Array",proto:!0},{includes:function(t){return Rn(this,t,arguments.length>1?arguments[1]:void 0)}}),Cn="includes",Pn[Tn][Cn]=!0;var An,Ln,In=i.String,kn=function(t){if("Symbol"===Ge(t))throw TypeError("Cannot convert a Symbol value to a string");return In(t)},Nn=function(){var t=Pt(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},Mn=i.RegExp,Un=a((function(){var t=Mn("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),Bn=Un||a((function(){return!Mn("a","y").sticky})),Fn={BROKEN_CARET:Un||a((function(){var t=Mn("^r","gy");return t.lastIndex=2,null!=t.exec("str")})),MISSED_STICKY:Bn,UNSUPPORTED_Y:Un},Dn=i.RegExp,_n=a((function(){var t=Dn(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),qn=i.RegExp,zn=a((function(){var t=qn("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),Wn=te.get,Gn=tt("native-string-replace",String.prototype.replace),Hn=RegExp.prototype.exec,Vn=Hn,Xn=b("".charAt),Kn=b("".indexOf),$n=b("".replace),Jn=b("".slice),Yn=(Ln=/b*/g,f(Hn,An=/a/,"a"),f(Hn,Ln,"a"),0!==An.lastIndex||0!==Ln.lastIndex),Qn=Fn.BROKEN_CARET,Zn=void 0!==/()??/.exec("")[1];(Yn||Zn||Qn||_n||zn)&&(Vn=function(t){var e,n,r,o,i,a,c,u=this,s=Wn(u),l=kn(t),p=s.raw;if(p)return p.lastIndex=u.lastIndex,e=f(Vn,p,l),u.lastIndex=p.lastIndex,e;var d=s.groups,h=Qn&&u.sticky,v=f(Nn,u),g=u.source,m=0,y=l;if(h&&(v=$n(v,"y",""),-1===Kn(v,"g")&&(v+="g"),y=Jn(l,u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==Xn(l,u.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,m++),n=new RegExp("^(?:"+g+")",v)),Zn&&(n=new RegExp("^"+g+"$(?!\\s)",v)),Yn&&(r=u.lastIndex),o=f(Hn,h?n:u,y),h?o?(o.input=Jn(o.input,m),o[0]=Jn(o[0],m),o.index=u.lastIndex,u.lastIndex+=o[0].length):u.lastIndex=0:Yn&&o&&(u.lastIndex=u.global?o.index+o[0].length:r),Zn&&o&&o.length>1&&f(Gn,o[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)})),o&&d)for(o.groups=a=xn(null),i=0;i<d.length;i++)a[(c=d[i])[0]]=o[c[1]];return o});Ne({target:"RegExp",proto:!0,forced:/./.exec!==Vn},{exec:Vn});var tr,er=dt("match"),nr=i.TypeError,rr=function(t){if(function(t){var e;return A(t)&&(void 0!==(e=t[er])?!!e:"RegExp"==E(t))}(t))throw nr("The method doesn't accept regular expressions");return t},or=dt("match"),ir=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[or]=!1,"/./"[t](e)}catch(t){}}return!1},ar=St.f,cr=b("".endsWith),ur=b("".slice),sr=Math.min,fr=ir("endsWith");Ne({target:"String",proto:!0,forced:!!(fr||(tr=ar(String.prototype,"endsWith"),!tr||tr.writable))&&!fr},{endsWith:function(t){var e=kn(P(this));rr(t);var n=arguments.length>1?arguments[1]:void 0,r=e.length,o=void 0===n?r:sr(pe(n),r),i=kn(t);return cr?cr(e,i,o):ur(e,o-i.length,o)===i}});var lr=St.f,pr=b("".startsWith),dr=b("".slice),hr=Math.min,vr=ir("startsWith");Ne({target:"String",proto:!0,forced:!(!vr&&!!function(){var t=lr(String.prototype,"startsWith");return t&&!t.writable}())&&!vr},{startsWith:function(t){var e=kn(P(this));rr(t);var n=pe(hr(arguments.length>1?arguments[1]:void 0,e.length)),r=kn(t);return pr?pr(e,r,n):dr(e,n,n+r.length)===r}});var gr=i.Promise,mr=i.String,yr=i.TypeError,br=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=b(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return Pt(n),function(t){if("object"==typeof t||R(t))return t;throw yr("Can't set "+mr(t)+" as a prototype")}(r),e?t(n,r):n.__proto__=r,n}}():void 0),wr=Nt.f,jr=dt("toStringTag"),Er=dt("species"),Sr=i.TypeError,Or=b(b.bind),xr=function(t,e){return X(t),void 0===e?t:u?Or(t,e):function(){return t.apply(e,arguments)}},Tr={},Pr=dt("iterator"),Cr=Array.prototype,Rr=dt("iterator"),Ar=function(t){if(null!=t)return K(t,Rr)||K(t,"@@iterator")||Tr[Ge(t)]},Lr=i.TypeError,Ir=function(t,e,n){var r,o;Pt(t);try{if(!(r=K(t,"return"))){if("throw"===e)throw n;return n}r=f(r,t)}catch(t){o=!0,r=t}if("throw"===e)throw n;if(o)throw r;return Pt(r),n},kr=i.TypeError,Nr=function(t,e){this.stopped=t,this.result=e},Mr=Nr.prototype,Ur=function(t,e,n){var r,o,i,a,c,u,s,l,p=n&&n.that,d=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),v=!(!n||!n.INTERRUPTED),g=xr(e,p),m=function(t){return r&&Ir(r,"normal",t),new Nr(!0,t)},y=function(t){return d?(Pt(t),v?g(t[0],t[1],m):g(t[0],t[1])):v?g(t,m):g(t)};if(h)r=t;else{if(!(o=Ar(t)))throw kr(H(t)+" is not iterable");if(void 0!==(l=o)&&(Tr.Array===l||Cr[Pr]===l)){for(i=0,a=de(t);a>i;i++)if((c=y(t[i]))&&k(Mr,c))return c;return new Nr(!1)}r=function(t,e){var n=arguments.length<2?Ar(t):e;if(X(n))return Pt(f(n,t));throw Lr(H(t)+" is not iterable")}(t,o)}for(u=r.next;!(s=f(u,r)).done;){try{c=y(s.value)}catch(t){Ir(r,"throw",t)}if("object"==typeof c&&c&&k(Mr,c))return c}return new Nr(!1)},Br=dt("iterator"),Fr=!1;try{var Dr=0,_r={next:function(){return{done:!!Dr++}},return:function(){Fr=!0}};_r[Br]=function(){return this},Array.from(_r,(function(){throw 2}))}catch(t){}var qr,zr,Wr,Gr,Hr=i.TypeError,Vr=dt("species"),Xr=function(t,e){var n,r=Pt(t).constructor;return void 0===r||null==(n=Pt(r)[Vr])?e:function(t){if(on(t))return t;throw Hr(H(t)+" is not a constructor")}(n)},Kr=Function.prototype,$r=Kr.apply,Jr=Kr.call,Yr="object"==typeof Reflect&&Reflect.apply||(u?Jr.bind($r):function(){return Jr.apply($r,arguments)}),Qr=b([].slice),Zr=i.TypeError,to=function(t,e){if(t<e)throw Zr("Not enough arguments");return t},eo=/(?:ipad|iphone|ipod).*applewebkit/i.test(N),no="process"==E(i.process),ro=i.setImmediate,oo=i.clearImmediate,io=i.process,ao=i.Dispatch,co=i.Function,uo=i.MessageChannel,so=i.String,fo=0,lo={},po="onreadystatechange";try{qr=i.location}catch(t){}var ho=function(t){if(ot(lo,t)){var e=lo[t];delete lo[t],e()}},vo=function(t){return function(){ho(t)}},go=function(t){ho(t.data)},mo=function(t){i.postMessage(so(t),qr.protocol+"//"+qr.host)};ro&&oo||(ro=function(t){to(arguments.length,1);var e=R(t)?t:co(t),n=Qr(arguments,1);return lo[++fo]=function(){Yr(e,void 0,n)},zr(fo),fo},oo=function(t){delete lo[t]},no?zr=function(t){io.nextTick(vo(t))}:ao&&ao.now?zr=function(t){ao.now(vo(t))}:uo&&!eo?(Gr=(Wr=new uo).port2,Wr.port1.onmessage=go,zr=xr(Gr.postMessage,Gr)):i.addEventListener&&R(i.postMessage)&&!i.importScripts&&qr&&"file:"!==qr.protocol&&!a(mo)?(zr=mo,i.addEventListener("message",go,!1)):zr=po in wt("script")?function(t){bn.appendChild(wt("script")).onreadystatechange=function(){bn.removeChild(this),ho(t)}}:function(t){setTimeout(vo(t),0)});var yo,bo,wo,jo,Eo,So,Oo,xo,To={set:ro,clear:oo},Po=/ipad|iphone|ipod/i.test(N)&&void 0!==i.Pebble,Co=/web0s(?!.*chrome)/i.test(N),Ro=St.f,Ao=To.set,Lo=i.MutationObserver||i.WebKitMutationObserver,Io=i.document,ko=i.process,No=i.Promise,Mo=Ro(i,"queueMicrotask"),Uo=Mo&&Mo.value;Uo||(yo=function(){var t,e;for(no&&(t=ko.domain)&&t.exit();bo;){e=bo.fn,bo=bo.next;try{e()}catch(t){throw bo?jo():wo=void 0,t}}wo=void 0,t&&t.enter()},eo||no||Co||!Lo||!Io?!Po&&No&&No.resolve?((Oo=No.resolve(void 0)).constructor=No,xo=xr(Oo.then,Oo),jo=function(){xo(yo)}):no?jo=function(){ko.nextTick(yo)}:(Ao=xr(Ao,i),jo=function(){Ao(yo)}):(Eo=!0,So=Io.createTextNode(""),new Lo(yo).observe(So,{characterData:!0}),jo=function(){So.data=Eo=!Eo}));var Bo=Uo||function(t){var e={fn:t,next:void 0};wo&&(wo.next=e),bo||(bo=e,jo()),wo=e},Fo=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=X(e),this.reject=X(n)},Do={f:function(t){return new Fo(t)}},_o=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},qo=function(){this.head=null,this.tail=null};qo.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var zo,Wo,Go,Ho,Vo,Xo,Ko,$o=qo,Jo="object"==typeof window,Yo=To.set,Qo=dt("species"),Zo="Promise",ti=te.getterFor(Zo),ei=te.set,ni=te.getterFor(Zo),ri=gr&&gr.prototype,oi=gr,ii=ri,ai=i.TypeError,ci=i.document,ui=i.process,si=Do.f,fi=si,li=!!(ci&&ci.createEvent&&i.dispatchEvent),pi=R(i.PromiseRejectionEvent),di="unhandledrejection",hi=!1,vi=Ie(Zo,(function(){var t=_t(oi),e=t!==String(oi);if(!e&&66===D)return!0;if(D>=51&&/native code/.test(t))return!1;var n=new oi((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))};return(n.constructor={})[Qo]=r,!(hi=n.then((function(){}))instanceof r)||!e&&Jo&&!pi})),gi=vi||!function(t,e){if(!e&&!Fr)return!1;var n=!1;try{var r={};r[Br]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){oi.all(t).catch((function(){}))})),mi=function(t){var e;return!(!A(t)||!R(e=t.then))&&e},yi=function(t,e){var n,r,o,i=e.value,a=1==e.state,c=a?t.ok:t.fail,u=t.resolve,s=t.reject,l=t.domain;try{c?(a||(2===e.rejection&&Si(e),e.rejection=1),!0===c?n=i:(l&&l.enter(),n=c(i),l&&(l.exit(),o=!0)),n===t.promise?s(ai("Promise-chain cycle")):(r=mi(n))?f(r,n,u,s):u(n)):s(i)}catch(t){l&&!o&&l.exit(),s(t)}},bi=function(t,e){t.notified||(t.notified=!0,Bo((function(){for(var n,r=t.reactions;n=r.get();)yi(n,t);t.notified=!1,e&&!t.rejection&&ji(t)})))},wi=function(t,e,n){var r,o;li?((r=ci.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),i.dispatchEvent(r)):r={promise:e,reason:n},!pi&&(o=i["on"+t])?o(r):t===di&&function(t,e){var n=i.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}("Unhandled promise rejection",n)},ji=function(t){f(Yo,i,(function(){var e,n=t.facade,r=t.value;if(Ei(t)&&(e=_o((function(){no?ui.emit("unhandledRejection",r,n):wi(di,n,r)})),t.rejection=no||Ei(t)?2:1,e.error))throw e.value}))},Ei=function(t){return 1!==t.rejection&&!t.parent},Si=function(t){f(Yo,i,(function(){var e=t.facade;no?ui.emit("rejectionHandled",e):wi("rejectionhandled",e,t.value)}))},Oi=function(t,e,n){return function(r){t(e,r,n)}},xi=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,bi(t,!0))},Ti=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw ai("Promise can't be resolved itself");var r=mi(e);r?Bo((function(){var n={done:!1};try{f(r,e,Oi(Ti,n,t),Oi(xi,n,t))}catch(e){xi(n,e,t)}})):(t.value=e,t.state=1,bi(t,!1))}catch(e){xi({done:!1},e,t)}}};if(vi&&(ii=(oi=function(t){!function(t,e){if(k(e,t))return t;throw Sr("Incorrect invocation")}(this,ii),X(t),f(zo,this);var e=ti(this);try{t(Oi(Ti,e),Oi(xi,e))}catch(t){xi(e,t)}}).prototype,(zo=function(t){ei(this,{type:Zo,done:!1,notified:!1,parent:!1,reactions:new $o,rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)ie(t,r,e[r],n);return t}(ii,{then:function(t,e){var n=ni(this),r=si(Xr(this,oi));return n.parent=!0,r.ok=!R(t)||t,r.fail=R(e)&&e,r.domain=no?ui.domain:void 0,0==n.state?n.reactions.add(r):Bo((function(){yi(r,n)})),r.promise},catch:function(t){return this.then(void 0,t)}}),Wo=function(){var t=new zo,e=ti(t);this.promise=t,this.resolve=Oi(Ti,e),this.reject=Oi(xi,e)},Do.f=si=function(t){return t===oi||t===Go?new Wo(t):fi(t)},R(gr)&&ri!==Object.prototype)){Ho=ri.then,hi||(ie(ri,"then",(function(t,e){var n=this;return new oi((function(t,e){f(Ho,n,t,e)})).then(t,e)}),{unsafe:!0}),ie(ri,"catch",ii.catch,{unsafe:!0}));try{delete ri.constructor}catch(t){}br&&br(ri,ii)}Ne({global:!0,wrap:!0,forced:vi},{Promise:oi}),Xo=Zo,Ko=!1,(Vo=oi)&&!Ko&&(Vo=Vo.prototype),Vo&&!ot(Vo,jr)&&wr(Vo,jr,{configurable:!0,value:Xo}),function(t){var e=I(t),n=Nt.f;c&&e&&!e[Er]&&n(e,Er,{configurable:!0,get:function(){return this}})}(Zo),Go=I(Zo),Ne({target:Zo,stat:!0,forced:vi},{reject:function(t){var e=si(this);return f(e.reject,void 0,t),e.promise}}),Ne({target:Zo,stat:!0,forced:vi},{resolve:function(t){return function(t,e){if(Pt(t),A(e)&&e.constructor===t)return e;var n=Do.f(t);return(0,n.resolve)(e),n.promise}(this,t)}}),Ne({target:Zo,stat:!0,forced:gi},{all:function(t){var e=this,n=si(e),r=n.resolve,o=n.reject,i=_o((function(){var n=X(e.resolve),i=[],a=0,c=1;Ur(t,(function(t){var u=a++,s=!1;c++,f(n,e,t).then((function(t){s||(s=!0,i[u]=t,--c||r(i))}),o)})),--c||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=si(e),r=n.reject,o=_o((function(){var o=X(e.resolve);Ur(t,(function(t){f(o,e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}});var Pi=Object.assign,Ci=Object.defineProperty,Ri=b([].concat),Ai=!Pi||a((function(){if(c&&1!==Pi({b:1},Pi(Ci({},"a",{enumerable:!0,get:function(){Ci(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=Pi({},t)[n]||Ve(Pi({},e)).join("")!=r}))?function(t,e){for(var n=nt(t),r=arguments.length,o=1,i=Ee.f,a=d.f;r>o;)for(var u,s=x(arguments[o++]),l=i?Ri(Ve(s),i(s)):Ve(s),p=l.length,h=0;p>h;)u=l[h++],c&&!f(a,s,u)||(n[u]=s[u]);return n}:Pi;Ne({target:"Object",stat:!0,forced:Object.assign!==Ai},{assign:Ai});var Li=oe.EXISTS,Ii=Nt.f,ki=Function.prototype,Ni=b(ki.toString),Mi=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Ui=b(Mi.exec);c&&!Li&&Ii(ki,"name",{configurable:!0,get:function(){try{return Ui(Mi,Ni(this))[1]}catch(t){return""}}});var Bi={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Fi=wt("span").classList,Di=Fi&&Fi.constructor&&Fi.constructor.prototype,_i=Di===Object.prototype?void 0:Di,qi=b([].push),zi=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,a=7==t,c=5==t||i;return function(u,s,f,l){for(var p,d,h=nt(u),v=x(h),g=xr(s,f),m=de(v),y=0,b=l||un,w=e?b(u,m):n||a?b(u,0):void 0;m>y;y++)if((c||y in v)&&(d=g(p=v[y],y,h),t))if(e)w[y]=d;else if(d)switch(t){case 3:return!0;case 5:return p;case 6:return y;case 2:qi(w,p)}else switch(t){case 4:return!1;case 7:qi(w,p)}return i?-1:r||o?o:w}},Wi={forEach:zi(0),map:zi(1),filter:zi(2),some:zi(3),every:zi(4),find:zi(5),findIndex:zi(6),filterReject:zi(7)}.forEach,Gi=Me("forEach")?[].forEach:function(t){return Wi(this,t,arguments.length>1?arguments[1]:void 0)},Hi=function(t){if(t&&t.forEach!==Gi)try{Mt(t,"forEach",Gi)}catch(e){t.forEach=Gi}};for(var Vi in Bi)Bi[Vi]&&Hi(i[Vi]&&i[Vi].prototype);Hi(_i);var Xi=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}},Ki=Object.prototype.toString;function $i(t){return"[object Array]"===Ki.call(t)}function Ji(t){return void 0===t}function Yi(t){return null!==t&&"object"==typeof t}function Qi(t){if("[object Object]"!==Ki.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function Zi(t){return"[object Function]"===Ki.call(t)}function ta(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),$i(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}var ea={isArray:$i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===Ki.call(t)},isBuffer:function(t){return null!==t&&!Ji(t)&&null!==t.constructor&&!Ji(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:Yi,isPlainObject:Qi,isUndefined:Ji,isDate:function(t){return"[object Date]"===Ki.call(t)},isFile:function(t){return"[object File]"===Ki.call(t)},isBlob:function(t){return"[object Blob]"===Ki.call(t)},isFunction:Zi,isStream:function(t){return Yi(t)&&Zi(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:ta,merge:function t(){var e={};function n(n,r){Qi(e[r])&&Qi(n)?e[r]=t(e[r],n):Qi(n)?e[r]=t({},n):$i(n)?e[r]=n.slice():e[r]=n}for(var r=0,o=arguments.length;r<o;r++)ta(arguments[r],n);return e},extend:function(t,e,n){return ta(e,(function(e,r){t[r]=n&&"function"==typeof e?Xi(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}};function na(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var ra=function(t,e,n){if(!e)return t;var r;if(n)r=n(e);else if(ea.isURLSearchParams(e))r=e.toString();else{var o=[];ea.forEach(e,(function(t,e){null!=t&&(ea.isArray(t)?e+="[]":t=[t],ea.forEach(t,(function(t){ea.isDate(t)?t=t.toISOString():ea.isObject(t)&&(t=JSON.stringify(t)),o.push(na(e)+"="+na(t))})))})),r=o.join("&")}if(r){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t};function oa(){this.handlers=[]}oa.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},oa.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},oa.prototype.forEach=function(t){ea.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var ia=oa,aa=function(t,e,n){return ea.forEach(n,(function(n){t=n(t,e)})),t},ca=function(t){return!(!t||!t.__CANCEL__)},ua=function(t,e){ea.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))},sa=function(t,e,n,r,o){return function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t.isAxiosError=!0,t.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}},t}(new Error(t),e,n,r,o)},fa=ea.isStandardBrowserEnv()?{write:function(t,e,n,r,o,i){var a=[];a.push(t+"="+encodeURIComponent(e)),ea.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),ea.isString(r)&&a.push("path="+r),ea.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},la=["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"],pa=ea.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=r(window.location.href),function(e){var n=ea.isString(e)?r(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0},da=function(t){return new Promise((function(e,n){var r=t.data,o=t.headers;ea.isFormData(r)&&delete o["Content-Type"];var i=new XMLHttpRequest;if(t.auth){var a=t.auth.username||"",c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(a+":"+c)}var u,s,f=(u=t.baseURL,s=t.url,u&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(s)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(u,s):s);if(i.open(t.method.toUpperCase(),ra(f,t.params,t.paramsSerializer),!0),i.timeout=t.timeout,i.onreadystatechange=function(){if(i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in i?function(t){var e,n,r,o={};return t?(ea.forEach(t.split("\n"),(function(t){if(r=t.indexOf(":"),e=ea.trim(t.substr(0,r)).toLowerCase(),n=ea.trim(t.substr(r+1)),e){if(o[e]&&la.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([n]):o[e]?o[e]+", "+n:n}})),o):o}(i.getAllResponseHeaders()):null,o={data:t.responseType&&"text"!==t.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:r,config:t,request:i};!function(t,e,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(sa("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}(e,n,o),i=null}},i.onabort=function(){i&&(n(sa("Request aborted",t,"ECONNABORTED",i)),i=null)},i.onerror=function(){n(sa("Network Error",t,null,i)),i=null},i.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(sa(e,t,"ECONNABORTED",i)),i=null},ea.isStandardBrowserEnv()){var l=(t.withCredentials||pa(f))&&t.xsrfCookieName?fa.read(t.xsrfCookieName):void 0;l&&(o[t.xsrfHeaderName]=l)}if("setRequestHeader"in i&&ea.forEach(o,(function(t,e){void 0===r&&"content-type"===e.toLowerCase()?delete o[e]:i.setRequestHeader(e,t)})),ea.isUndefined(t.withCredentials)||(i.withCredentials=!!t.withCredentials),t.responseType)try{i.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&i.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){i&&(i.abort(),n(t),i=null)})),r||(r=null),i.send(r)}))},ha={"Content-Type":"application/x-www-form-urlencoded"};function va(t,e){!ea.isUndefined(t)&&ea.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var ga,ma={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(ga=da),ga),transformRequest:[function(t,e){return ua(e,"Accept"),ua(e,"Content-Type"),ea.isFormData(t)||ea.isArrayBuffer(t)||ea.isBuffer(t)||ea.isStream(t)||ea.isFile(t)||ea.isBlob(t)?t:ea.isArrayBufferView(t)?t.buffer:ea.isURLSearchParams(t)?(va(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):ea.isObject(t)?(va(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};ma.headers={common:{Accept:"application/json, text/plain, */*"}},ea.forEach(["delete","get","head"],(function(t){ma.headers[t]={}})),ea.forEach(["post","put","patch"],(function(t){ma.headers[t]=ea.merge(ha)}));var ya=ma;function ba(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var wa=function(t){return ba(t),t.headers=t.headers||{},t.data=aa(t.data,t.headers,t.transformRequest),t.headers=ea.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),ea.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||ya.adapter)(t).then((function(e){return ba(t),e.data=aa(e.data,e.headers,t.transformResponse),e}),(function(e){return ca(e)||(ba(t),e&&e.response&&(e.response.data=aa(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},ja=function(t,e){e=e||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(t,e){return ea.isPlainObject(t)&&ea.isPlainObject(e)?ea.merge(t,e):ea.isPlainObject(e)?ea.merge({},e):ea.isArray(e)?e.slice():e}function u(r){ea.isUndefined(e[r])?ea.isUndefined(t[r])||(n[r]=c(void 0,t[r])):n[r]=c(t[r],e[r])}ea.forEach(r,(function(t){ea.isUndefined(e[t])||(n[t]=c(void 0,e[t]))})),ea.forEach(o,u),ea.forEach(i,(function(r){ea.isUndefined(e[r])?ea.isUndefined(t[r])||(n[r]=c(void 0,t[r])):n[r]=c(void 0,e[r])})),ea.forEach(a,(function(r){r in e?n[r]=c(t[r],e[r]):r in t&&(n[r]=c(void 0,t[r]))}));var s=r.concat(o).concat(i).concat(a),f=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===s.indexOf(t)}));return ea.forEach(f,u),n};function Ea(t){this.defaults=t,this.interceptors={request:new ia,response:new ia}}Ea.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=ja(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[wa,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)n=n.then(e.shift(),e.shift());return n},Ea.prototype.getUri=function(t){return t=ja(this.defaults,t),ra(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},ea.forEach(["delete","get","head","options"],(function(t){Ea.prototype[t]=function(e,n){return this.request(ja(n||{},{method:t,url:e,data:(n||{}).data}))}})),ea.forEach(["post","put","patch"],(function(t){Ea.prototype[t]=function(e,n,r){return this.request(ja(r||{},{method:t,url:e,data:n}))}}));var Sa=Ea;function Oa(t){this.message=t}Oa.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Oa.prototype.__CANCEL__=!0;var xa=Oa;function Ta(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new xa(t),e(n.reason))}))}Ta.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Ta.source=function(){var t;return{token:new Ta((function(e){t=e})),cancel:t}};var Pa=Ta;function Ca(t){var e=new Sa(t),n=Xi(Sa.prototype.request,e);return ea.extend(n,Sa.prototype,e),ea.extend(n,e),n}var Ra=Ca(ya);Ra.Axios=Sa,Ra.create=function(t){return Ca(ja(Ra.defaults,t))},Ra.Cancel=xa,Ra.CancelToken=Pa,Ra.isCancel=ca,Ra.all=function(t){return Promise.all(t)},Ra.spread=function(t){return function(e){return t.apply(null,e)}},Ra.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError};var Aa=Ra,La=Ra;Aa.default=La;var Ia=Aa,ka=["v2","v3","v4","v5","canary"],Na="@tryghost/content-api",Ma=function(t){var e=t.url,n=t.method,r=t.params,o=t.headers;return Ia[n](e,{params:r,paramsSerializer:function(t){return Object.keys(t).reduce((function(e,n){var r=encodeURIComponent([].concat(t[n]).join(","));return e.concat("".concat(n,"=").concat(r))}),[]).join("&")},headers:o})};return function t(e){var n=e.url,r=e.key,o=e.host,i=e.version,a=e.ghostPath,c=void 0===a?"ghost":a,u=e.makeRequest,s=void 0===u?Ma:u;if(o&&(console.warn("".concat(Na,": The 'host' parameter is deprecated, please use 'url' instead")),n||(n=o)),this instanceof t)return t({url:n,key:r,version:i,ghostPath:c,makeRequest:s});if(i&&!ka.includes(i))throw new Error("".concat(Na," Config Invalid: 'version' ").concat(i," is not supported"));if(!n)throw new Error("".concat(Na," Config Missing: 'url' is required. E.g. 'https://site.com'"));if(!/https?:\/\//.test(n))throw new Error("".concat(Na," Config Invalid: 'url' ").concat(n," requires a protocol. E.g. 'https://site.com'"));if(n.endsWith("/"))throw new Error("".concat(Na," Config Invalid: 'url' ").concat(n," must not have a trailing slash. E.g. 'https://site.com'"));if(c.endsWith("/")||c.startsWith("/"))throw new Error("".concat(Na," Config Invalid: 'ghostPath' ").concat(c," must not have a leading or trailing slash. E.g. 'ghost'"));if(r&&!/[0-9a-f]{26}/.test(r))throw new Error("".concat(Na," Config Invalid: 'key' ").concat(r," must have 26 hex characters"));var f=["posts","authors","tags","pages","settings"].reduce((function(t,e){return Object.assign(t,function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,{read:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!t||!t.id&&!t.slug)return Promise.reject(new Error("".concat(Na," read requires an id or slug.")));var o=Object.assign({},t,n);return l(e,o,t.id||"slug/".concat(t.slug),r)},browse:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return l(e,t,null,n)}}))}),{});return delete f.settings.read,f;function l(t,e,o){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!a&&!r)return Promise.reject(new Error("".concat(Na," Config Missing: 'key' is required.")));delete e.id;var u=a?{Authorization:"GhostMembers ".concat(a)}:{};i&&!["v4","v5","canary"].includes(i)||(u["Accept-Version"]=i||"v5"),e=Object.assign({key:r},e);var f=i?"".concat(n,"/").concat(c,"/api/").concat(i,"/content/").concat(t,"/").concat(o?o+"/":""):"".concat(n,"/").concat(c,"/api/content/").concat(t,"/").concat(o?o+"/":"");return s({url:f,method:"get",params:e,headers:u}).then((function(e){return Array.isArray(e.data[t])?1!==e.data[t].length||e.data.meta?Object.assign(e.data[t],{meta:e.data.meta}):e.data[t][0]:e.data[t]})).catch((function(t){if(t.response&&t.response.data&&t.response.data.errors){var e=t.response.data.errors[0],n=new Error(e.message),r=Object.keys(e);throw n.name=e.type,r.forEach((function(t){n[t]=e[t]})),n.response=t.response,n.request=t.request,n.config=t.config,n}throw t}))}}}));
//# sourceMappingURL=content-api.min.js.map

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc