@tryghost/content-api
Advanced tools
Comparing version 1.4.3 to 1.4.4
{ | ||
"name": "@tryghost/content-api", | ||
"version": "1.4.3", | ||
"version": "1.4.4", | ||
"repository": "https://github.com/TryGhost/Ghost-SDK/tree/master/packages/content-api", | ||
@@ -46,3 +46,3 @@ "author": "Ghost Foundation", | ||
"should": "13.2.3", | ||
"sinon": "9.0.2" | ||
"sinon": "9.0.3" | ||
}, | ||
@@ -52,3 +52,3 @@ "dependencies": { | ||
}, | ||
"gitHead": "b449242550b3ec614b7578ff2c1fb81c2d7e48e2" | ||
"gitHead": "c26508cb017a24dada1d99fdd0695e2fbb861ff4" | ||
} |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("core-js/modules/es6.function.name"),require("core-js/modules/web.dom.iterable"),require("core-js/modules/es6.array.iterator"),require("core-js/modules/es6.object.keys"),require("core-js/modules/es6.object.assign"),require("core-js/modules/es6.promise"),require("core-js/modules/es6.object.to-string"),require("core-js/modules/es6.string.starts-with"),require("core-js/modules/es6.string.ends-with"),require("core-js/modules/es7.array.includes")):"function"==typeof define&&define.amd?define(["core-js/modules/es6.function.name","core-js/modules/web.dom.iterable","core-js/modules/es6.array.iterator","core-js/modules/es6.object.keys","core-js/modules/es6.object.assign","core-js/modules/es6.promise","core-js/modules/es6.object.to-string","core-js/modules/es6.string.starts-with","core-js/modules/es6.string.ends-with","core-js/modules/es7.array.includes"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).GhostContentAPI=t()}(this,(function(){"use strict";var e=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},t=Object.prototype.toString;function r(e){return"[object Array]"===t.call(e)}function n(e){return void 0===e}function o(e){return null!==e&&"object"==typeof e}function s(e){return"[object Function]"===t.call(e)}function i(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}var a={isArray:r,isArrayBuffer:function(e){return"[object ArrayBuffer]"===t.call(e)},isBuffer:function(e){return null!==e&&!n(e)&&null!==e.constructor&&!n(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:o,isUndefined:n,isDate:function(e){return"[object Date]"===t.call(e)},isFile:function(e){return"[object File]"===t.call(e)},isBlob:function(e){return"[object Blob]"===t.call(e)},isFunction:s,isStream:function(e){return o(e)&&s(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:i,merge:function e(){var t={};function r(r,n){"object"==typeof t[n]&&"object"==typeof r?t[n]=e(t[n],r):t[n]=r}for(var n=0,o=arguments.length;n<o;n++)i(arguments[n],r);return t},deepMerge:function e(){var t={};function r(r,n){"object"==typeof t[n]&&"object"==typeof r?t[n]=e(t[n],r):t[n]="object"==typeof r?e({},r):r}for(var n=0,o=arguments.length;n<o;n++)i(arguments[n],r);return t},extend:function(t,r,n){return i(r,(function(r,o){t[o]=n&&"function"==typeof r?e(r,n):r})),t},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}};function c(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var u=function(e,t,r){if(!t)return e;var n;if(r)n=r(t);else if(a.isURLSearchParams(t))n=t.toString();else{var o=[];a.forEach(t,(function(e,t){null!=e&&(a.isArray(e)?t+="[]":e=[e],a.forEach(e,(function(e){a.isDate(e)?e=e.toISOString():a.isObject(e)&&(e=JSON.stringify(e)),o.push(c(t)+"="+c(e))})))})),n=o.join("&")}if(n){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e};function f(){this.handlers=[]}f.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},f.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},f.prototype.forEach=function(e){a.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var d=f,l=function(e,t,r){return a.forEach(r,(function(r){e=r(e,t)})),e},p=function(e){return!(!e||!e.__CANCEL__)},h=function(e,t){a.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))},m=function(e,t,r,n,o){return function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.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}},e}(new Error(e),t,r,n,o)},g=["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"],v=a.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=a.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},y=a.isStandardBrowserEnv()?{write:function(e,t,r,n,o,s){var i=[];i.push(e+"="+encodeURIComponent(t)),a.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),a.isString(n)&&i.push("path="+n),a.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},w=function(e){return new Promise((function(t,r){var n=e.data,o=e.headers;a.isFormData(n)&&delete o["Content-Type"];var s=new XMLHttpRequest;if(e.auth){var i=e.auth.username||"",c=e.auth.password||"";o.Authorization="Basic "+btoa(i+":"+c)}var f,d,l=(f=e.baseURL,d=e.url,f&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(d)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(f,d):d);if(s.open(e.method.toUpperCase(),u(l,e.params,e.paramsSerializer),!0),s.timeout=e.timeout,s.onreadystatechange=function(){if(s&&4===s.readyState&&(0!==s.status||s.responseURL&&0===s.responseURL.indexOf("file:"))){var n,o,i,c,u,f="getAllResponseHeaders"in s?(n=s.getAllResponseHeaders(),u={},n?(a.forEach(n.split("\n"),(function(e){if(c=e.indexOf(":"),o=a.trim(e.substr(0,c)).toLowerCase(),i=a.trim(e.substr(c+1)),o){if(u[o]&&g.indexOf(o)>=0)return;u[o]="set-cookie"===o?(u[o]?u[o]:[]).concat([i]):u[o]?u[o]+", "+i:i}})),u):u):null,d={data:e.responseType&&"text"!==e.responseType?s.response:s.responseText,status:s.status,statusText:s.statusText,headers:f,config:e,request:s};!function(e,t,r){var n=r.config.validateStatus;!n||n(r.status)?e(r):t(m("Request failed with status code "+r.status,r.config,null,r.request,r))}(t,r,d),s=null}},s.onabort=function(){s&&(r(m("Request aborted",e,"ECONNABORTED",s)),s=null)},s.onerror=function(){r(m("Network Error",e,null,s)),s=null},s.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(m(t,e,"ECONNABORTED",s)),s=null},a.isStandardBrowserEnv()){var p=y,h=(e.withCredentials||v(l))&&e.xsrfCookieName?p.read(e.xsrfCookieName):void 0;h&&(o[e.xsrfHeaderName]=h)}if("setRequestHeader"in s&&a.forEach(o,(function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete o[t]:s.setRequestHeader(t,e)})),a.isUndefined(e.withCredentials)||(s.withCredentials=!!e.withCredentials),e.responseType)try{s.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&s.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&s.upload&&s.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){s&&(s.abort(),r(e),s=null)})),void 0===n&&(n=null),s.send(n)}))},b={"Content-Type":"application/x-www-form-urlencoded"};function j(e,t){!a.isUndefined(e)&&a.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var E,C={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(E=w),E),transformRequest:[function(e,t){return h(t,"Accept"),h(t,"Content-Type"),a.isFormData(e)||a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)?e:a.isArrayBufferView(e)?e.buffer:a.isURLSearchParams(e)?(j(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):a.isObject(e)?(j(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};C.headers={common:{Accept:"application/json, text/plain, */*"}},a.forEach(["delete","get","head"],(function(e){C.headers[e]={}})),a.forEach(["post","put","patch"],(function(e){C.headers[e]=a.merge(b)}));var x=C;function S(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var q=function(e){return S(e),e.headers=e.headers||{},e.data=l(e.data,e.headers,e.transformRequest),e.headers=a.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),a.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||x.adapter)(e).then((function(t){return S(e),t.data=l(t.data,t.headers,e.transformResponse),t}),(function(t){return p(t)||(S(e),t&&t.response&&(t.response.data=l(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},R=function(e,t){t=t||{};var r={},n=["url","method","params","data"],o=["headers","auth","proxy"],s=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];a.forEach(n,(function(e){void 0!==t[e]&&(r[e]=t[e])})),a.forEach(o,(function(n){a.isObject(t[n])?r[n]=a.deepMerge(e[n],t[n]):void 0!==t[n]?r[n]=t[n]:a.isObject(e[n])?r[n]=a.deepMerge(e[n]):void 0!==e[n]&&(r[n]=e[n])})),a.forEach(s,(function(n){void 0!==t[n]?r[n]=t[n]:void 0!==e[n]&&(r[n]=e[n])}));var i=n.concat(o).concat(s),c=Object.keys(t).filter((function(e){return-1===i.indexOf(e)}));return a.forEach(c,(function(n){void 0!==t[n]?r[n]=t[n]:void 0!==e[n]&&(r[n]=e[n])})),r};function A(e){this.defaults=e,this.interceptors={request:new d,response:new d}}A.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=R(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[q,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},A.prototype.getUri=function(e){return e=R(this.defaults,e),u(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},a.forEach(["delete","get","head","options"],(function(e){A.prototype[e]=function(t,r){return this.request(a.merge(r||{},{method:e,url:t}))}})),a.forEach(["post","put","patch"],(function(e){A.prototype[e]=function(t,r,n){return this.request(a.merge(n||{},{method:e,url:t,data:r}))}}));var O=A;function N(e){this.message=e}N.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},N.prototype.__CANCEL__=!0;var T=N;function k(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new T(e),t(r.reason))}))}k.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},k.source=function(){var e;return{token:new k((function(t){e=t})),cancel:e}};var B=k;function P(t){var r=new O(t),n=e(O.prototype.request,r);return a.extend(n,O.prototype,r),a.extend(n,r),n}var U=P(x);U.Axios=O,U.create=function(e){return P(R(U.defaults,e))},U.Cancel=T,U.CancelToken=B,U.isCancel=p,U.all=function(e){return Promise.all(e)},U.spread=function(e){return function(t){return e.apply(null,t)}};var L=U,D=U;L.default=D;var I=L,F=["v2","v3","canary"],M="@tryghost/content-api";return function e(t){var r=t.url,n=t.host,o=t.ghostPath,s=void 0===o?"ghost":o,i=t.version,a=t.key;if(n&&(console.warn("".concat(M,": The 'host' parameter is deprecated, please use 'url' instead")),r||(r=n)),this instanceof e)return e({url:r,version:i,key:a});if(!i)throw new Error("".concat(M," Config Missing: 'version' is required. E.g. ").concat(F.join(",")));if(!F.includes(i))throw new Error("".concat(M," Config Invalid: 'version' ").concat(i," is not supported"));if(!r)throw new Error("".concat(M," Config Missing: 'url' is required. E.g. 'https://site.com'"));if(!/https?:\/\//.test(r))throw new Error("".concat(M," Config Invalid: 'url' ").concat(r," requires a protocol. E.g. 'https://site.com'"));if(r.endsWith("/"))throw new Error("".concat(M," Config Invalid: 'url' ").concat(r," must not have a trailing slash. E.g. 'https://site.com'"));if(s.endsWith("/")||s.startsWith("/"))throw new Error("".concat(M," Config Invalid: 'ghostPath' ").concat(s," must not have a leading or trailing slash. E.g. 'ghost'"));if(a&&!/[0-9a-f]{26}/.test(a))throw new Error("".concat(M," Config Invalid: 'key' ").concat(a," must have 26 hex characters"));var c=["posts","authors","tags","pages","settings"].reduce((function(e,t){return Object.assign(e,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},t,{read:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(!e||!e.id&&!e.slug)return Promise.reject(new Error("".concat(M," read requires an id or slug.")));var o=Object.assign({},e,r);return u(t,o,e.id||"slug/".concat(e.slug),n)},browse:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return u(t,e,null,r)}}))}),{});return delete c.settings.read,c;function u(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!o&&!a)return Promise.reject(new Error("".concat(M," Config Missing: 'key' is required.")));delete t.id;var c=o?{Authorization:"GhostMembers ".concat(o)}:void 0;return I.get("".concat(r,"/").concat(s,"/api/").concat(i,"/content/").concat(e,"/").concat(n?n+"/":""),{params:Object.assign({key:a},t),paramsSerializer:function(e){return Object.keys(e).reduce((function(t,r){var n=encodeURIComponent([].concat(e[r]).join(","));return t.concat("".concat(r,"=").concat(n))}),[]).join("&")},headers:c}).then((function(t){return Array.isArray(t.data[e])?1!==t.data[e].length||t.data.meta?Object.assign(t.data[e],{meta:t.data.meta}):t.data[e][0]:t.data[e]})).catch((function(e){if(e.response&&e.response.data&&e.response.data.errors){var t=e.response.data.errors[0],r=new Error(t.message),n=Object.keys(t);throw r.name=t.type,n.forEach((function(e){r[e]=t[e]})),r.response=e.response,r.request=e.request,r.config=e.config,r}throw e}))}}})); | ||
!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=function(t){return t&&t.Math==Math&&t},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")(),o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,u={f:c&&!a.call({1:2},1)?function(t){var e=c(this,t);return!!e&&e.enumerable}:a},s=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},f={}.toString,l=function(t){return f.call(t).slice(8,-1)},p="".split,d=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==l(t)?p.call(t,""):Object(t)}:Object,h=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},v=function(t){return d(h(t))},g=function(t){return"object"==typeof t?null!==t:"function"==typeof t},m=function(t,e){if(!g(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!g(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!g(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!g(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},y={}.hasOwnProperty,b=function(t,e){return y.call(t,e)},w=r.document,S=g(w)&&g(w.createElement),j=function(t){return S?w.createElement(t):{}},E=!i&&!o((function(){return 7!=Object.defineProperty(j("div"),"a",{get:function(){return 7}}).a})),O=Object.getOwnPropertyDescriptor,T={f:i?O:function(t,e){if(t=v(t),e=m(e,!0),E)try{return O(t,e)}catch(t){}if(b(t,e))return s(!u.f.call(t,e),t[e])}},x=function(t){if(!g(t))throw TypeError(String(t)+" is not an object");return t},C=Object.defineProperty,A={f:i?C:function(t,e,n){if(x(t),e=m(e,!0),x(n),E)try{return C(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},P=i?function(t,e,n){return A.f(t,e,s(1,n))}:function(t,e,n){return t[e]=n,t},L=function(t,e){try{P(r,t,e)}catch(n){r[t]=e}return e},R=r["__core-js_shared__"]||L("__core-js_shared__",{}),k=Function.toString;"function"!=typeof R.inspectSource&&(R.inspectSource=function(t){return k.call(t)});var M,N,q,B=R.inspectSource,D=r.WeakMap,U="function"==typeof D&&/native code/.test(B(D)),I=e((function(t){(t.exports=function(t,e){return R[t]||(R[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),F=0,_=Math.random(),W=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++F+_).toString(36)},z=I("keys"),H=function(t){return z[t]||(z[t]=W(t))},V={},G=r.WeakMap;if(U){var X=new G,J=X.get,K=X.has,$=X.set;M=function(t,e){return $.call(X,t,e),e},N=function(t){return J.call(X,t)||{}},q=function(t){return K.call(X,t)}}else{var Y=H("state");V[Y]=!0,M=function(t,e){return P(t,Y,e),e},N=function(t){return b(t,Y)?t[Y]:{}},q=function(t){return b(t,Y)}}var Q,Z,tt={set:M,get:N,has:q,enforce:function(t){return q(t)?N(t):M(t,{})},getterFor:function(t){return function(e){var n;if(!g(e)||(n=N(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},et=e((function(t){var e=tt.get,n=tt.enforce,o=String(String).split("String");(t.exports=function(t,e,i,a){var c=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,s=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof e||b(i,"name")||P(i,"name",e),n(i).source=o.join("string"==typeof e?e:"")),t!==r?(c?!s&&t[e]&&(u=!0):delete t[e],u?t[e]=i:P(t,e,i)):u?t[e]=i:L(e,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||B(this)}))})),nt=r,rt=function(t){return"function"==typeof t?t:void 0},ot=function(t,e){return arguments.length<2?rt(nt[t])||rt(r[t]):nt[t]&&nt[t][e]||r[t]&&r[t][e]},it=Math.ceil,at=Math.floor,ct=function(t){return isNaN(t=+t)?0:(t>0?at:it)(t)},ut=Math.min,st=function(t){return t>0?ut(ct(t),9007199254740991):0},ft=Math.max,lt=Math.min,pt=function(t){return function(e,n,r){var o,i=v(e),a=st(i.length),c=function(t,e){var n=ct(t);return n<0?ft(n+e,0):lt(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}},dt={includes:pt(!0),indexOf:pt(!1)},ht=dt.indexOf,vt=function(t,e){var n,r=v(t),o=0,i=[];for(n in r)!b(V,n)&&b(r,n)&&i.push(n);for(;e.length>o;)b(r,n=e[o++])&&(~ht(i,n)||i.push(n));return i},gt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],mt=gt.concat("length","prototype"),yt={f:Object.getOwnPropertyNames||function(t){return vt(t,mt)}},bt={f:Object.getOwnPropertySymbols},wt=ot("Reflect","ownKeys")||function(t){var e=yt.f(x(t)),n=bt.f;return n?e.concat(n(t)):e},St=function(t,e){for(var n=wt(e),r=A.f,o=T.f,i=0;i<n.length;i++){var a=n[i];b(t,a)||r(t,a,o(e,a))}},jt=/#|\.prototype\./,Et=function(t,e){var n=Tt[Ot(t)];return n==Ct||n!=xt&&("function"==typeof e?o(e):!!e)},Ot=Et.normalize=function(t){return String(t).replace(jt,".").toLowerCase()},Tt=Et.data={},xt=Et.NATIVE="N",Ct=Et.POLYFILL="P",At=Et,Pt=T.f,Lt=function(t,e){var n,o,i,a,c,u=t.target,s=t.global,f=t.stat;if(n=s?r:f?r[u]||L(u,{}):(r[u]||{}).prototype)for(o in e){if(a=e[o],i=t.noTargetGet?(c=Pt(n,o))&&c.value:n[o],!At(s?o:u+(f?".":"#")+o,t.forced)&&void 0!==i){if(typeof a==typeof i)continue;St(a,i)}(t.sham||i&&i.sham)&&P(a,"sham",!0),et(n,o,a,t)}},Rt=Array.isArray||function(t){return"Array"==l(t)},kt=function(t){return Object(h(t))},Mt=function(t,e,n){var r=m(e);r in t?A.f(t,r,s(0,n)):t[r]=n},Nt=!!Object.getOwnPropertySymbols&&!o((function(){return!String(Symbol())})),qt=Nt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Bt=I("wks"),Dt=r.Symbol,Ut=qt?Dt:Dt&&Dt.withoutSetter||W,It=function(t){return b(Bt,t)||(Nt&&b(Dt,t)?Bt[t]=Dt[t]:Bt[t]=Ut("Symbol."+t)),Bt[t]},Ft=It("species"),_t=function(t,e){var n;return Rt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Rt(n.prototype)?g(n)&&null===(n=n[Ft])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Wt=ot("navigator","userAgent")||"",zt=r.process,Ht=zt&&zt.versions,Vt=Ht&&Ht.v8;Vt?Z=(Q=Vt.split("."))[0]+Q[1]:Wt&&(!(Q=Wt.match(/Edge\/(\d+)/))||Q[1]>=74)&&(Q=Wt.match(/Chrome\/(\d+)/))&&(Z=Q[1]);var Gt,Xt=Z&&+Z,Jt=It("species"),Kt=It("isConcatSpreadable"),$t=Xt>=51||!o((function(){var t=[];return t[Kt]=!1,t.concat()[0]!==t})),Yt=(Gt="concat",Xt>=51||!o((function(){var t=[];return(t.constructor={})[Jt]=function(){return{foo:1}},1!==t[Gt](Boolean).foo}))),Qt=function(t){if(!g(t))return!1;var e=t[Kt];return void 0!==e?!!e:Rt(t)};Lt({target:"Array",proto:!0,forced:!$t||!Yt},{concat:function(t){var e,n,r,o,i,a=kt(this),c=_t(a,0),u=0;for(e=-1,r=arguments.length;e<r;e++)if(Qt(i=-1===e?a:arguments[e])){if(u+(o=st(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,u++)n in i&&Mt(c,u,i[n])}else{if(u>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Mt(c,u++,i)}return c.length=u,c}});var Zt=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},te=function(t,e,n){if(Zt(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},ee=[].push,ne=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,a=5==t||i;return function(c,u,s,f){for(var l,p,h=kt(c),v=d(h),g=te(u,s,3),m=st(v.length),y=0,b=f||_t,w=e?b(c,m):n?b(c,0):void 0;m>y;y++)if((a||y in v)&&(p=g(l=v[y],y,h),t))if(e)w[y]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return y;case 2:ee.call(w,l)}else if(o)return!1;return i?-1:r||o?o:w}},re={forEach:ne(0),map:ne(1),filter:ne(2),some:ne(3),every:ne(4),find:ne(5),findIndex:ne(6)},oe=function(t,e){var n=[][t];return!!n&&o((function(){n.call(null,e||function(){throw 1},1)}))},ie=Object.defineProperty,ae={},ce=function(t){throw t},ue=function(t,e){if(b(ae,t))return ae[t];e||(e={});var n=[][t],r=!!b(e,"ACCESSORS")&&e.ACCESSORS,a=b(e,0)?e[0]:ce,c=b(e,1)?e[1]:void 0;return ae[t]=!!n&&!o((function(){if(r&&!i)return!0;var t={length:-1};r?ie(t,1,{enumerable:!0,get:ce}):t[1]=1,n.call(t,a,c)}))},se=re.forEach,fe=oe("forEach"),le=ue("forEach"),pe=fe&&le?[].forEach:function(t){return se(this,t,arguments.length>1?arguments[1]:void 0)};Lt({target:"Array",proto:!0,forced:[].forEach!=pe},{forEach:pe});var de,he=Object.keys||function(t){return vt(t,gt)},ve=i?Object.defineProperties:function(t,e){x(t);for(var n,r=he(e),o=r.length,i=0;o>i;)A.f(t,n=r[i++],e[n]);return t},ge=ot("document","documentElement"),me=H("IE_PROTO"),ye=function(){},be=function(t){return"<script>"+t+"<\/script>"},we=function(){try{de=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;we=de?function(t){t.write(be("")),t.close();var e=t.parentWindow.Object;return t=null,e}(de):((e=j("iframe")).style.display="none",ge.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(be("document.F=Object")),t.close(),t.F);for(var n=gt.length;n--;)delete we.prototype[gt[n]];return we()};V[me]=!0;var Se=Object.create||function(t,e){var n;return null!==t?(ye.prototype=x(t),n=new ye,ye.prototype=null,n[me]=t):n=we(),void 0===e?n:ve(n,e)},je=It("unscopables"),Ee=Array.prototype;null==Ee[je]&&A.f(Ee,je,{configurable:!0,value:Se(null)});var Oe,Te=dt.includes;Lt({target:"Array",proto:!0,forced:!ue("indexOf",{ACCESSORS:!0,1:0})},{includes:function(t){return Te(this,t,arguments.length>1?arguments[1]:void 0)}}),Oe="includes",Ee[je][Oe]=!0;var xe=[].join,Ce=d!=Object,Ae=oe("join",",");Lt({target:"Array",proto:!0,forced:Ce||!Ae},{join:function(t){return xe.call(v(this),void 0===t?",":t)}});var Pe=function(t){return function(e,n,r,o){Zt(n);var i=kt(e),a=d(i),c=st(i.length),u=t?c-1:0,s=t?-1:1;if(r<2)for(;;){if(u in a){o=a[u],u+=s;break}if(u+=s,t?u<0:c<=u)throw TypeError("Reduce of empty array with no initial value")}for(;t?u>=0:c>u;u+=s)u in a&&(o=n(o,a[u],u,i));return o}},Le={left:Pe(!1),right:Pe(!0)}.left,Re=oe("reduce"),ke=ue("reduce",{1:0});Lt({target:"Array",proto:!0,forced:!Re||!ke},{reduce:function(t){return Le(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Me=A.f,Ne=Function.prototype,qe=Ne.toString,Be=/^\s*function ([^ (]*)/;i&&!("name"in Ne)&&Me(Ne,"name",{configurable:!0,get:function(){try{return qe.call(this).match(Be)[1]}catch(t){return""}}});var De=Object.assign,Ue=Object.defineProperty,Ie=!De||o((function(){if(i&&1!==De({b:1},De(Ue({},"a",{enumerable:!0,get:function(){Ue(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol();return t[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(t){e[t]=t})),7!=De({},t)[n]||"abcdefghijklmnopqrst"!=he(De({},e)).join("")}))?function(t,e){for(var n=kt(t),r=arguments.length,o=1,a=bt.f,c=u.f;r>o;)for(var s,f=d(arguments[o++]),l=a?he(f).concat(a(f)):he(f),p=l.length,h=0;p>h;)s=l[h++],i&&!c.call(f,s)||(n[s]=f[s]);return n}:De;Lt({target:"Object",stat:!0,forced:Object.assign!==Ie},{assign:Ie}),Lt({target:"Object",stat:!0,forced:o((function(){he(1)}))},{keys:function(t){return he(kt(t))}});var Fe={};Fe[It("toStringTag")]="z";var _e="[object z]"===String(Fe),We=It("toStringTag"),ze="Arguments"==l(function(){return arguments}()),He=_e?l: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=Object(t),We))?n:ze?l(e):"Object"==(r=l(e))&&"function"==typeof e.callee?"Arguments":r},Ve=_e?{}.toString:function(){return"[object "+He(this)+"]"};_e||et(Object.prototype,"toString",Ve,{unsafe:!0});var Ge=r.Promise,Xe=A.f,Je=It("toStringTag"),Ke=It("species"),$e={},Ye=It("iterator"),Qe=Array.prototype,Ze=It("iterator"),tn=function(t,e,n,r){try{return r?e(x(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&x(o.call(t)),e}},en=e((function(t){var e=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,n,r,o,i){var a,c,u,s,f,l,p,d,h=te(n,r,o?2:1);if(i)a=t;else{if("function"!=typeof(c=function(t){if(null!=t)return t[Ze]||t["@@iterator"]||$e[He(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(d=c)&&($e.Array===d||Qe[Ye]===d)){for(u=0,s=st(t.length);s>u;u++)if((f=o?h(x(p=t[u])[0],p[1]):h(t[u]))&&f instanceof e)return f;return new e(!1)}a=c.call(t)}for(l=a.next;!(p=l.call(a)).done;)if("object"==typeof(f=tn(a,h,p.value,o))&&f&&f instanceof e)return f;return new e(!1)}).stop=function(t){return new e(!0,t)}})),nn=It("iterator"),rn=!1;try{var on=0,an={next:function(){return{done:!!on++}},return:function(){rn=!0}};an[nn]=function(){return this},Array.from(an,(function(){throw 2}))}catch(t){}var cn,un,sn,fn=It("species"),ln=/(iphone|ipod|ipad).*applewebkit/i.test(Wt),pn=r.location,dn=r.setImmediate,hn=r.clearImmediate,vn=r.process,gn=r.MessageChannel,mn=r.Dispatch,yn=0,bn={},wn=function(t){if(bn.hasOwnProperty(t)){var e=bn[t];delete bn[t],e()}},Sn=function(t){return function(){wn(t)}},jn=function(t){wn(t.data)},En=function(t){r.postMessage(t+"",pn.protocol+"//"+pn.host)};dn&&hn||(dn=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return bn[++yn]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},cn(yn),yn},hn=function(t){delete bn[t]},"process"==l(vn)?cn=function(t){vn.nextTick(Sn(t))}:mn&&mn.now?cn=function(t){mn.now(Sn(t))}:gn&&!ln?(sn=(un=new gn).port2,un.port1.onmessage=jn,cn=te(sn.postMessage,sn,1)):!r.addEventListener||"function"!=typeof postMessage||r.importScripts||o(En)||"file:"===pn.protocol?cn="onreadystatechange"in j("script")?function(t){ge.appendChild(j("script")).onreadystatechange=function(){ge.removeChild(this),wn(t)}}:function(t){setTimeout(Sn(t),0)}:(cn=En,r.addEventListener("message",jn,!1)));var On,Tn,xn,Cn,An,Pn,Ln,Rn,kn={set:dn,clear:hn},Mn=T.f,Nn=kn.set,qn=r.MutationObserver||r.WebKitMutationObserver,Bn=r.process,Dn=r.Promise,Un="process"==l(Bn),In=Mn(r,"queueMicrotask"),Fn=In&&In.value;Fn||(On=function(){var t,e;for(Un&&(t=Bn.domain)&&t.exit();Tn;){e=Tn.fn,Tn=Tn.next;try{e()}catch(t){throw Tn?Cn():xn=void 0,t}}xn=void 0,t&&t.enter()},Un?Cn=function(){Bn.nextTick(On)}:qn&&!ln?(An=!0,Pn=document.createTextNode(""),new qn(On).observe(Pn,{characterData:!0}),Cn=function(){Pn.data=An=!An}):Dn&&Dn.resolve?(Ln=Dn.resolve(void 0),Rn=Ln.then,Cn=function(){Rn.call(Ln,On)}):Cn=function(){Nn.call(r,On)});var _n,Wn,zn,Hn,Vn,Gn,Xn,Jn=Fn||function(t){var e={fn:t,next:void 0};xn&&(xn.next=e),Tn||(Tn=e,Cn()),xn=e},Kn=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=Zt(e),this.reject=Zt(n)},$n={f:function(t){return new Kn(t)}},Yn=function(t,e){if(x(t),g(e)&&e.constructor===t)return e;var n=$n.f(t);return(0,n.resolve)(e),n.promise},Qn=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Zn=kn.set,tr=It("species"),er="Promise",nr=tt.get,rr=tt.set,or=tt.getterFor(er),ir=Ge,ar=r.TypeError,cr=r.document,ur=r.process,sr=ot("fetch"),fr=$n.f,lr=fr,pr="process"==l(ur),dr=!!(cr&&cr.createEvent&&r.dispatchEvent),hr=At(er,(function(){if(!(B(ir)!==String(ir))){if(66===Xt)return!0;if(!pr&&"function"!=typeof PromiseRejectionEvent)return!0}if(Xt>=51&&/native code/.test(ir))return!1;var t=ir.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[tr]=e,!(t.then((function(){}))instanceof e)})),vr=hr||!function(t,e){if(!e&&!rn)return!1;var n=!1;try{var r={};r[nn]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){ir.all(t).catch((function(){}))})),gr=function(t){var e;return!(!g(t)||"function"!=typeof(e=t.then))&&e},mr=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;Jn((function(){for(var o=e.value,i=1==e.state,a=0;r.length>a;){var c,u,s,f=r[a++],l=i?f.ok:f.fail,p=f.resolve,d=f.reject,h=f.domain;try{l?(i||(2===e.rejection&&Sr(t,e),e.rejection=1),!0===l?c=o:(h&&h.enter(),c=l(o),h&&(h.exit(),s=!0)),c===f.promise?d(ar("Promise-chain cycle")):(u=gr(c))?u.call(c,p,d):p(c)):d(o)}catch(t){h&&!s&&h.exit(),d(t)}}e.reactions=[],e.notified=!1,n&&!e.rejection&&br(t,e)}))}},yr=function(t,e,n){var o,i;dr?((o=cr.createEvent("Event")).promise=e,o.reason=n,o.initEvent(t,!1,!0),r.dispatchEvent(o)):o={promise:e,reason:n},(i=r["on"+t])?i(o):"unhandledrejection"===t&&function(t,e){var n=r.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}("Unhandled promise rejection",n)},br=function(t,e){Zn.call(r,(function(){var n,r=e.value;if(wr(e)&&(n=Qn((function(){pr?ur.emit("unhandledRejection",r,t):yr("unhandledrejection",t,r)})),e.rejection=pr||wr(e)?2:1,n.error))throw n.value}))},wr=function(t){return 1!==t.rejection&&!t.parent},Sr=function(t,e){Zn.call(r,(function(){pr?ur.emit("rejectionHandled",t):yr("rejectionhandled",t,e.value)}))},jr=function(t,e,n,r){return function(o){t(e,n,o,r)}},Er=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=2,mr(t,e,!0))},Or=function(t,e,n,r){if(!e.done){e.done=!0,r&&(e=r);try{if(t===n)throw ar("Promise can't be resolved itself");var o=gr(n);o?Jn((function(){var r={done:!1};try{o.call(n,jr(Or,t,r,e),jr(Er,t,r,e))}catch(n){Er(t,r,n,e)}})):(e.value=n,e.state=1,mr(t,e,!1))}catch(n){Er(t,{done:!1},n,e)}}};hr&&(ir=function(t){!function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,ir,er),Zt(t),_n.call(this);var e=nr(this);try{t(jr(Or,this,e),jr(Er,this,e))}catch(t){Er(this,e,t)}},(_n=function(t){rr(this,{type:er,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)et(t,r,e[r],n);return t}(ir.prototype,{then:function(t,e){var n,r,o,i=or(this),a=fr((n=ir,void 0===(o=x(this).constructor)||null==(r=x(o)[fn])?n:Zt(r)));return a.ok="function"!=typeof t||t,a.fail="function"==typeof e&&e,a.domain=pr?ur.domain:void 0,i.parent=!0,i.reactions.push(a),0!=i.state&&mr(this,i,!1),a.promise},catch:function(t){return this.then(void 0,t)}}),Wn=function(){var t=new _n,e=nr(t);this.promise=t,this.resolve=jr(Or,t,e),this.reject=jr(Er,t,e)},$n.f=fr=function(t){return t===ir||t===zn?new Wn(t):lr(t)},"function"==typeof Ge&&(Hn=Ge.prototype.then,et(Ge.prototype,"then",(function(t,e){var n=this;return new ir((function(t,e){Hn.call(n,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof sr&&Lt({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return Yn(ir,sr.apply(r,arguments))}}))),Lt({global:!0,wrap:!0,forced:hr},{Promise:ir}),Gn=er,Xn=!1,(Vn=ir)&&!b(Vn=Xn?Vn:Vn.prototype,Je)&&Xe(Vn,Je,{configurable:!0,value:Gn}),function(t){var e=ot(t),n=A.f;i&&e&&!e[Ke]&&n(e,Ke,{configurable:!0,get:function(){return this}})}(er),zn=ot(er),Lt({target:er,stat:!0,forced:hr},{reject:function(t){var e=fr(this);return e.reject.call(void 0,t),e.promise}}),Lt({target:er,stat:!0,forced:hr},{resolve:function(t){return Yn(this,t)}}),Lt({target:er,stat:!0,forced:vr},{all:function(t){var e=this,n=fr(e),r=n.resolve,o=n.reject,i=Qn((function(){var n=Zt(e.resolve),i=[],a=0,c=1;en(t,(function(t){var u=a++,s=!1;i.push(void 0),c++,n.call(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=fr(e),r=n.reject,o=Qn((function(){var o=Zt(e.resolve);en(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}});var Tr,xr=It("match"),Cr=function(t){if(function(t){var e;return g(t)&&(void 0!==(e=t[xr])?!!e:"RegExp"==l(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},Ar=It("match"),Pr=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[Ar]=!1,"/./"[t](e)}catch(t){}}return!1},Lr=T.f,Rr="".endsWith,kr=Math.min,Mr=Pr("endsWith");Lt({target:"String",proto:!0,forced:!!(Mr||(Tr=Lr(String.prototype,"endsWith"),!Tr||Tr.writable))&&!Mr},{endsWith:function(t){var e=String(h(this));Cr(t);var n=arguments.length>1?arguments[1]:void 0,r=st(e.length),o=void 0===n?r:kr(st(n),r),i=String(t);return Rr?Rr.call(e,i,o):e.slice(o-i.length,o)===i}});var Nr=T.f,qr="".startsWith,Br=Math.min,Dr=Pr("startsWith");Lt({target:"String",proto:!0,forced:!(!Dr&&!!function(){var t=Nr(String.prototype,"startsWith");return t&&!t.writable}())&&!Dr},{startsWith:function(t){var e=String(h(this));Cr(t);var n=st(Br(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return qr?qr.call(e,r,n):e.slice(n,n+r.length)===r}});for(var Ur in{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}){var Ir=r[Ur],Fr=Ir&&Ir.prototype;if(Fr&&Fr.forEach!==pe)try{P(Fr,"forEach",pe)}catch(t){Fr.forEach=pe}}var _r=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)}},Wr=Object.prototype.toString;function zr(t){return"[object Array]"===Wr.call(t)}function Hr(t){return void 0===t}function Vr(t){return null!==t&&"object"==typeof t}function Gr(t){return"[object Function]"===Wr.call(t)}function Xr(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),zr(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 Jr={isArray:zr,isArrayBuffer:function(t){return"[object ArrayBuffer]"===Wr.call(t)},isBuffer:function(t){return null!==t&&!Hr(t)&&null!==t.constructor&&!Hr(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:Vr,isUndefined:Hr,isDate:function(t){return"[object Date]"===Wr.call(t)},isFile:function(t){return"[object File]"===Wr.call(t)},isBlob:function(t){return"[object Blob]"===Wr.call(t)},isFunction:Gr,isStream:function(t){return Vr(t)&&Gr(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:Xr,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)Xr(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)Xr(arguments[r],n);return e},extend:function(t,e,n){return Xr(e,(function(e,r){t[r]=n&&"function"==typeof e?_r(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}};function Kr(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var $r=function(t,e,n){if(!e)return t;var r;if(n)r=n(e);else if(Jr.isURLSearchParams(e))r=e.toString();else{var o=[];Jr.forEach(e,(function(t,e){null!=t&&(Jr.isArray(t)?e+="[]":t=[t],Jr.forEach(t,(function(t){Jr.isDate(t)?t=t.toISOString():Jr.isObject(t)&&(t=JSON.stringify(t)),o.push(Kr(e)+"="+Kr(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 Yr(){this.handlers=[]}Yr.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},Yr.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},Yr.prototype.forEach=function(t){Jr.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var Qr=Yr,Zr=function(t,e,n){return Jr.forEach(n,(function(n){t=n(t,e)})),t},to=function(t){return!(!t||!t.__CANCEL__)},eo=function(t,e){Jr.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))},no=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)},ro=["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"],oo=Jr.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=Jr.isString(e)?r(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0},io=Jr.isStandardBrowserEnv()?{write:function(t,e,n,r,o,i){var a=[];a.push(t+"="+encodeURIComponent(e)),Jr.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Jr.isString(r)&&a.push("path="+r),Jr.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(){}},ao=function(t){return new Promise((function(e,n){var r=t.data,o=t.headers;Jr.isFormData(r)&&delete o["Content-Type"];var i=new XMLHttpRequest;if(t.auth){var a=t.auth.username||"",c=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(),$r(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?(Jr.forEach(t.split("\n"),(function(t){if(r=t.indexOf(":"),e=Jr.trim(t.substr(0,r)).toLowerCase(),n=Jr.trim(t.substr(r+1)),e){if(o[e]&&ro.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;!r||r(n.status)?t(n):e(no("Request failed with status code "+n.status,n.config,null,n.request,n))}(e,n,o),i=null}},i.onabort=function(){i&&(n(no("Request aborted",t,"ECONNABORTED",i)),i=null)},i.onerror=function(){n(no("Network Error",t,null,i)),i=null},i.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(no(e,t,"ECONNABORTED",i)),i=null},Jr.isStandardBrowserEnv()){var l=io,p=(t.withCredentials||oo(f))&&t.xsrfCookieName?l.read(t.xsrfCookieName):void 0;p&&(o[t.xsrfHeaderName]=p)}if("setRequestHeader"in i&&Jr.forEach(o,(function(t,e){void 0===r&&"content-type"===e.toLowerCase()?delete o[e]:i.setRequestHeader(e,t)})),Jr.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)})),void 0===r&&(r=null),i.send(r)}))},co={"Content-Type":"application/x-www-form-urlencoded"};function uo(t,e){!Jr.isUndefined(t)&&Jr.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var so,fo={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(so=ao),so),transformRequest:[function(t,e){return eo(e,"Accept"),eo(e,"Content-Type"),Jr.isFormData(t)||Jr.isArrayBuffer(t)||Jr.isBuffer(t)||Jr.isStream(t)||Jr.isFile(t)||Jr.isBlob(t)?t:Jr.isArrayBufferView(t)?t.buffer:Jr.isURLSearchParams(t)?(uo(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):Jr.isObject(t)?(uo(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,validateStatus:function(t){return t>=200&&t<300}};fo.headers={common:{Accept:"application/json, text/plain, */*"}},Jr.forEach(["delete","get","head"],(function(t){fo.headers[t]={}})),Jr.forEach(["post","put","patch"],(function(t){fo.headers[t]=Jr.merge(co)}));var lo=fo;function po(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var ho=function(t){return po(t),t.headers=t.headers||{},t.data=Zr(t.data,t.headers,t.transformRequest),t.headers=Jr.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Jr.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||lo.adapter)(t).then((function(e){return po(t),e.data=Zr(e.data,e.headers,t.transformResponse),e}),(function(e){return to(e)||(po(t),e&&e.response&&(e.response.data=Zr(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},vo=function(t,e){e=e||{};var n={},r=["url","method","params","data"],o=["headers","auth","proxy"],i=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];Jr.forEach(r,(function(t){void 0!==e[t]&&(n[t]=e[t])})),Jr.forEach(o,(function(r){Jr.isObject(e[r])?n[r]=Jr.deepMerge(t[r],e[r]):void 0!==e[r]?n[r]=e[r]:Jr.isObject(t[r])?n[r]=Jr.deepMerge(t[r]):void 0!==t[r]&&(n[r]=t[r])})),Jr.forEach(i,(function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}));var a=r.concat(o).concat(i),c=Object.keys(e).filter((function(t){return-1===a.indexOf(t)}));return Jr.forEach(c,(function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])})),n};function go(t){this.defaults=t,this.interceptors={request:new Qr,response:new Qr}}go.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=vo(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[ho,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},go.prototype.getUri=function(t){return t=vo(this.defaults,t),$r(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},Jr.forEach(["delete","get","head","options"],(function(t){go.prototype[t]=function(e,n){return this.request(Jr.merge(n||{},{method:t,url:e}))}})),Jr.forEach(["post","put","patch"],(function(t){go.prototype[t]=function(e,n,r){return this.request(Jr.merge(r||{},{method:t,url:e,data:n}))}}));var mo=go;function yo(t){this.message=t}yo.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},yo.prototype.__CANCEL__=!0;var bo=yo;function wo(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 bo(t),e(n.reason))}))}wo.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},wo.source=function(){var t;return{token:new wo((function(e){t=e})),cancel:t}};var So=wo;function jo(t){var e=new mo(t),n=_r(mo.prototype.request,e);return Jr.extend(n,mo.prototype,e),Jr.extend(n,e),n}var Eo=jo(lo);Eo.Axios=mo,Eo.create=function(t){return jo(vo(Eo.defaults,t))},Eo.Cancel=bo,Eo.CancelToken=So,Eo.isCancel=to,Eo.all=function(t){return Promise.all(t)},Eo.spread=function(t){return function(e){return t.apply(null,e)}};var Oo=Eo,To=Eo;Oo.default=To;var xo=Oo,Co=["v2","v3","canary"],Ao="@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(Ao,": 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(Ao," Config Missing: 'version' is required. E.g. ").concat(Co.join(",")));if(!Co.includes(a))throw new Error("".concat(Ao," Config Invalid: 'version' ").concat(a," is not supported"));if(!n)throw new Error("".concat(Ao," Config Missing: 'url' is required. E.g. 'https://site.com'"));if(!/https?:\/\//.test(n))throw new Error("".concat(Ao," Config Invalid: 'url' ").concat(n," requires a protocol. E.g. 'https://site.com'"));if(n.endsWith("/"))throw new Error("".concat(Ao," 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(Ao," 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(Ao," 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(Ao," 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(Ao," Config Missing: 'key' is required.")));delete e.id;var u=o?{Authorization:"GhostMembers ".concat(o)}:void 0;return xo.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}))}}})); | ||
//# 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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
586095
3433
1