@directus/sdk
Advanced tools
Comparing version 9.0.0-rc.99 to 9.0.0-rc.100
@@ -15,3 +15,3 @@ /*! ***************************************************************************** | ||
***************************************************************************** */ | ||
function t(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class e{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(e)}`,{params:r})).data}))}readMany(e){return t(this,void 0,void 0,(function*(){const{data:t,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:e});return{data:t,meta:r}}))}createOne(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,e,{params:r})).data}))}createMany(e,r){return t(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,e,{params:r})}))}updateOne(e,r,n){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(e)}`,r,{params:n})).data}))}updateMany(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:e,data:r},{params:n})}))}updateByQuery(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:e,data:r},{params:n})}))}deleteOne(e){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(e)}`)}))}deleteMany(e){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,e)}))}}class r{constructor(t){this.transport=t}create(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",e)).data}))}update(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(e)}`,{comment:r})).data}))}delete(e){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(e)}`)}))}}class n extends e{constructor(t){super("directus_activity",t),this._comments=new r(this.transport)}get comments(){return this._comments}}class s{constructor(t){this.transport=t}readOne(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${e}`)).data}))}readAll(){return t(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",e)).data}))}createMany(e){return t(this,void 0,void 0,(function*(){const{data:t,meta:r}=yield this.transport.post("/collections",e);return{data:t,meta:r}}))}updateOne(e,r,n){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${e}`,r,{params:n})).data}))}deleteOne(e){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${e}`)}))}}class i{constructor(t){this.transport=t}readOne(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${e}/${r}`)).data}))}readMany(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${e}`)).data}))}readAll(){return t(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${e}`,r)).data}))}updateOne(e,r,n){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${e}/${r}`,n)).data}))}deleteOne(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${e}/${r}`)}))}}class o extends e{constructor(t){super("directus_files",t)}}class a extends e{constructor(t){super("directus_folders",t)}}class u extends e{constructor(t){super("directus_permissions",t)}}class d extends e{constructor(t){super("directus_presets",t)}}class h{constructor(t){this.transport=t}readOne(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${e}/${r}`)).data}))}readMany(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${e}`)).data}))}readAll(){return t(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",e)).data}))}updateOne(e,r,n){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${e}/${r}`,{params:n})).data}))}deleteOne(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${e}/${r}`)}))}}class c extends e{constructor(t){super("directus_revisions",t)}}class l extends e{constructor(t){super("directus_roles",t)}}class p{constructor(t){this.transport=t}ping(){return t(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return t(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class f{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:e})).data}))}update(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,e,{params:r})).data}))}}class v extends f{constructor(t){super("directus_settings",t)}}class m{constructor(t){this.transport=t}send(e,r,n){return t(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:e,role:r,invite_url:n})}))}accept(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:e,password:r})}))}}class g{constructor(t){this.transport=t}generate(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:e})).data}))}enable(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:e,otp:r})}))}disable(e){return t(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:e})}))}}class y{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new g(this._transport))}read(e){return t(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:e})).data}))}update(e,r){return t(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",e,{params:r})).data}))}}class _ extends e{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new m(this.transport))}get me(){return this._me||(this._me=new y(this.transport))}}class w{constructor(e){this.random={string:(e=32)=>t(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:e}})).data}))},this.hash={generate:e=>t(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:e})).data})),verify:(e,r)=>t(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:e,hash:r})).data}))},this.transport=e}sort(e,r,n){return t(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(e)}`,{item:r,to:n})}))}revert(e){return t(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(e)}`)}))}}var b;!function(t){t.TOTAL_COUNT="total_count",t.FILTER_COUNT="filter_count"}(b||(b={}));class x extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,x.prototype)}}class k{get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class O extends k{constructor(t=""){super(),this.values={},this.prefix=t}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class E extends k{constructor(t=""){super(),this.prefix=t}get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var S={exports:{}},T=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},j=T,R=Object.prototype.toString;function A(t){return"[object Array]"===R.call(t)}function $(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function U(t){if("[object Object]"!==R.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function q(t){return"[object Function]"===R.call(t)}function C(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),A(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var P={isArray:A,isArrayBuffer:function(t){return"[object ArrayBuffer]"===R.call(t)},isBuffer:function(t){return null!==t&&!$(t)&&null!==t.constructor&&!$(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:N,isPlainObject:U,isUndefined:$,isDate:function(t){return"[object Date]"===R.call(t)},isFile:function(t){return"[object File]"===R.call(t)},isBlob:function(t){return"[object Blob]"===R.call(t)},isFunction:q,isStream:function(t){return N(t)&&q(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:C,merge:function t(){var e={};function r(r,n){U(e[n])&&U(r)?e[n]=t(e[n],r):U(r)?e[n]=t({},r):A(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)C(arguments[n],r);return e},extend:function(t,e,r){return C(e,(function(e,n){t[n]=r&&"function"==typeof e?j(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},B=P;function L(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var I=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(B.isURLSearchParams(e))n=e.toString();else{var s=[];B.forEach(e,(function(t,e){null!=t&&(B.isArray(t)?e+="[]":t=[t],B.forEach(t,(function(t){B.isDate(t)?t=t.toISOString():B.isObject(t)&&(t=JSON.stringify(t)),s.push(L(e)+"="+L(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},D=P;function M(){this.handlers=[]}M.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},M.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},M.prototype.forEach=function(t){D.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var z=M,F=P,H=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,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,status:this.response&&this.response.status?this.response.status:null}},t},J=H,W=function(t,e,r,n,s){var i=new Error(t);return J(i,e,r,n,s)},V=W,X=P,K=X.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),X.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),X.isString(n)&&o.push("path="+n),X.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.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(){}},G=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},Q=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},Y=P,Z=["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"],tt=P,et=tt.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(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 t=n(window.location.href),function(e){var r=tt.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function rt(t){this.message=t}rt.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},rt.prototype.__CANCEL__=!0;var nt=rt,st=P,it=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(V("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},ot=K,at=I,ut=function(t,e){return t&&!G(e)?Q(t,e):e},dt=function(t){var e,r,n,s={};return t?(Y.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=Y.trim(t.substr(0,n)).toLowerCase(),r=Y.trim(t.substr(n+1)),e){if(s[e]&&Z.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ht=et,ct=W,lt=xt,pt=nt,ft=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}st.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+h)}var c=ut(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?dt(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};it((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),at(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(ct("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(ct("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||lt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(ct(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},st.isStandardBrowserEnv()){var p=(t.withCredentials||ht(c))&&t.xsrfCookieName?ot.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&st.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),st.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new pt("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},vt=P,mt=function(t,e){F.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},gt=H,yt={"Content-Type":"application/x-www-form-urlencoded"};function _t(t,e){!vt.isUndefined(t)&&vt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var wt,bt={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(wt=ft),wt),transformRequest:[function(t,e){return mt(e,"Accept"),mt(e,"Content-Type"),vt.isFormData(t)||vt.isArrayBuffer(t)||vt.isBuffer(t)||vt.isStream(t)||vt.isFile(t)||vt.isBlob(t)?t:vt.isArrayBufferView(t)?t.buffer:vt.isURLSearchParams(t)?(_t(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):vt.isObject(t)||e&&"application/json"===e["Content-Type"]?(_t(e,"application/json"),function(t,e,r){if(vt.isString(t))try{return(e||JSON.parse)(t),vt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||bt.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&vt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw gt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};vt.forEach(["delete","get","head"],(function(t){bt.headers[t]={}})),vt.forEach(["post","put","patch"],(function(t){bt.headers[t]=vt.merge(yt)}));var xt=bt,kt=P,Ot=xt,Et=function(t){return!(!t||!t.__CANCEL__)},St=P,Tt=function(t,e,r){var n=this||Ot;return kt.forEach(r,(function(r){t=r.call(n,t,e)})),t},jt=Et,Rt=xt,At=nt;function $t(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new At("canceled")}var Nt=P,Ut=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},qt="0.23.0",Ct=qt,Pt={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Pt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Bt={};Pt.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Ct+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Bt[s]&&(Bt[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Lt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Pt},It=P,Dt=I,Mt=z,zt=function(t){return $t(t),t.headers=t.headers||{},t.data=Tt.call(t,t.data,t.headers,t.transformRequest),t.headers=St.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),St.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||Rt.adapter)(t).then((function(e){return $t(t),e.data=Tt.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return jt(e)||($t(t),e&&e.response&&(e.response.data=Tt.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},Ft=Ut,Ht=Lt,Jt=Ht.validators;function Wt(t){this.defaults=t,this.interceptors={request:new Mt,response:new Mt}}Wt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Ft(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Ht.assertOptions(e,{silentJSONParsing:Jt.transitional(Jt.boolean),forcedJSONParsing:Jt.transitional(Jt.boolean),clarifyTimeoutError:Jt.transitional(Jt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[zt,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=zt(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Wt.prototype.getUri=function(t){return t=Ft(this.defaults,t),Dt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},It.forEach(["delete","get","head","options"],(function(t){Wt.prototype[t]=function(e,r){return this.request(Ft(r||{},{method:t,url:e,data:(r||{}).data}))}})),It.forEach(["post","put","patch"],(function(t){Wt.prototype[t]=function(e,r,n){return this.request(Ft(n||{},{method:t,url:e,data:r}))}}));var Vt=Wt,Xt=nt;function Kt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Xt(t),e(r.reason))}))}Kt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Kt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Kt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Kt.source=function(){var t;return{token:new Kt((function(e){t=e})),cancel:t}};var Gt=Kt,Qt=P,Yt=T,Zt=Vt,te=Ut;var ee=function t(e){var r=new Zt(e),n=Yt(Zt.prototype.request,r);return Qt.extend(n,Zt.prototype,r),Qt.extend(n,r),n.create=function(r){return t(te(e,r))},n}(xt);ee.Axios=Zt,ee.Cancel=nt,ee.CancelToken=Gt,ee.isCancel=Et,ee.VERSION=qt,ee.all=function(t){return Promise.all(t)},ee.spread=function(t){return function(e){return t.apply(null,e)}},ee.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},S.exports=ee,S.exports.default=ee;var re=S.exports;class ne{constructor(t,e,r=(()=>Promise.resolve())){this._url=t,this._storage=e,this._axios=null,this._refresh=r,this.url=t}get url(){return this._url}set url(t){this._url=t,this._axios=re.create({baseURL:t,withCredentials:!0})}get axios(){return this._axios}get requests(){return{intercept:(t,e)=>{const r=this._axios.interceptors.request.use(t,e);return{eject:()=>{this._axios.interceptors.request.eject(r)}}}}}get responses(){return{intercept:(t,e)=>{const r=this._axios.interceptors.response.use(t,e);return{eject:()=>{this._axios.interceptors.response.eject(r)}}}}}request(e,r,n,s){var i,o,a,u,d,h,c,l,p;return t(this,void 0,void 0,(function*(){try{(s=s||{}).sendAuthorizationHeaders=null===(i=s.sendAuthorizationHeaders)||void 0===i||i,s.refreshTokenIfNeeded=null===(o=s.refreshTokenIfNeeded)||void 0===o||o,s.headers=null!==(a=s.headers)&&void 0!==a?a:{},s.onUploadProgress=null!==(u=s.onUploadProgress)&&void 0!==u?u:void 0,s.refreshTokenIfNeeded&&(yield this._refresh());const t={method:e,url:r,data:n,params:s.params,headers:s.headers,onUploadProgress:s.onUploadProgress},d=this._storage.auth_token,h=this._storage.auth_expires;s.sendAuthorizationHeaders&&d&&(null!==h&&h>Date.now()||null===h)&&(d.startsWith("Bearer ")?t.headers.Authorization=d:t.headers.Authorization=`Bearer ${d}`);const c=yield this.axios.request(t),l=c.data,p={raw:c.data,status:c.status,statusText:c.statusText,headers:c.headers,data:l.data,meta:l.meta,errors:l.errors};if(l.errors)throw new x(null,p);return p}catch(t){if(!t||t instanceof Error==!1)throw t;if(re.isAxiosError(t)){const e=null===(d=t.response)||void 0===d?void 0:d.data;throw new x(t,{raw:null===(h=t.response)||void 0===h?void 0:h.data,status:null===(c=t.response)||void 0===c?void 0:c.status,statusText:null===(l=t.response)||void 0===l?void 0:l.statusText,headers:null===(p=t.response)||void 0===p?void 0:p.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new x(t)}}))}get(e,r){return t(this,void 0,void 0,(function*(){return yield this.request("get",e,void 0,r)}))}head(e,r){return t(this,void 0,void 0,(function*(){return yield this.request("head",e,void 0,r)}))}options(e,r){return t(this,void 0,void 0,(function*(){return yield this.request("options",e,void 0,r)}))}delete(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.request("delete",e,r,n)}))}put(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.request("put",e,r,n)}))}post(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.request("post",e,r,n)}))}patch(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.request("patch",e,r,n)}))}}class se{constructor(t){this.transport=t}request(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:e,reset_url:r})}))}reset(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:e,password:r})}))}}class ie{constructor(t){this.func=t,this.debounced=[],this.debouncing=!1}debounce(...e){return t(this,void 0,void 0,(function*(){return this.debouncing?yield new Promise(((t,e)=>{this.debounced.push({resolve:e=>t(e),reject:t=>e(t)})})):(this.debouncing=!0,new Promise(((t,r)=>{this.func(...e).then((e=>{const n=[{resolve:t,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((t=>t.resolve(e)))})).catch((e=>{const n=[{resolve:t,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((t=>t.reject(e)))}))})))}))}}class oe{constructor(t,e,r){var n,s,i,o,a;this.options=r||{},this.options.mode=(null==r?void 0:r.mode)||("undefined"!=typeof window?"cookie":"json"),this.options.refresh=(null==r?void 0:r.refresh)||{auto:!1,time:3e4},this.options.refresh.auto=null!==(s=null===(n=this.options.refresh)||void 0===n?void 0:n.auto)&&void 0!==s&&s,this.options.refresh.time=null!==(o=null===(i=this.options.refresh)||void 0===i?void 0:i.time)&&void 0!==o?o:3e4,this.transport=t,this.storage=e,this.timer=!1,this.refresher=new ie(this.refreshToken.bind(this));try{this.updateRefresh(null===(a=this.options)||void 0===a?void 0:a.refresh)}catch(t){}}get token(){return this.storage.auth_token}get password(){return this.passwords=this.passwords||new se(this.transport)}get expiring(){var t,e;const r=this.storage.auth_expires;if(null===r)return!1;return r-(null!==(e=null===(t=this.options.refresh)||void 0===t?void 0:t.time)&&void 0!==e?e:0)<=Date.now()}refreshToken(e=!1){var r;return t(this,void 0,void 0,(function*(){if(!e&&!this.expiring)return!1;const t=yield this.transport.post("/auth/refresh",{refresh_token:"json"===this.options.mode?this.storage.auth_refresh_token:void 0},{refreshTokenIfNeeded:!1});return this.updateStorage(t.data),this.updateRefresh(),{access_token:t.data.access_token,refresh_token:null===(r=t.data)||void 0===r?void 0:r.refresh_token,expires:t.data.expires}}))}updateStorage(t){var e;this.storage.auth_token=t.access_token,this.storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,t.expires?this.storage.auth_expires=Date.now()+t.expires:this.storage.auth_expires=null}updateRefresh(t){var e,r;const n=this.storage.auth_expires;if(null===n)return void clearTimeout(this.timer);t&&(this.options.refresh.auto=null!==(e=t.auto)&&void 0!==e?e:this.options.refresh.auto,this.options.refresh.time=null!==(r=t.time)&&void 0!==r?r:this.options.refresh.time),clearTimeout(this.timer);let s=n-this.options.refresh.time-Date.now();if(s<0){if(n<Date.now())return;s=0}this.options.refresh.auto&&(this.timer=setTimeout((()=>{this.refresh().then((()=>{})).catch((()=>{}))}),s))}refresh(e=!1){return t(this,void 0,void 0,(function*(){return yield this.refresher.debounce(e)}))}login(e,r){var n;return t(this,void 0,void 0,(function*(){r=r||{};const t=yield this.transport.post("/auth/login",Object.assign({mode:this.options.mode},e),{refreshTokenIfNeeded:!1,sendAuthorizationHeaders:!1});return this.updateStorage(t.data),this.updateRefresh(r.refresh),{access_token:t.data.access_token,refresh_token:null===(n=t.data)||void 0===n?void 0:n.refresh_token,expires:t.data.expires}}))}static(e){return t(this,void 0,void 0,(function*(){return yield this.transport.get("/users/me",{params:{access_token:e}}),this.storage.auth_token=e,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,!0}))}logout(){return t(this,void 0,void 0,(function*(){let t;"json"===this.options.mode&&(t=this.storage.auth_refresh_token||void 0),yield this.transport.post("/auth/logout",{refresh_token:t},{refreshTokenIfNeeded:!1}),this.storage.auth_token=null,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,clearTimeout(this.timer)}))}}class ae{constructor(t){this.transport=t}request(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.transport.post(e,{query:r,variables:void 0===n?{}:n})}))}items(e,r){return t(this,void 0,void 0,(function*(){return yield this.request("/graphql",e,r)}))}system(e,r){return t(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",e,r)}))}}class ue{constructor(e,r){this._storage=(null==r?void 0:r.storage)||("undefined"!=typeof window?new E:new O),this._transport=(null==r?void 0:r.transport)||new ne(e,this._storage,(()=>t(this,void 0,void 0,(function*(){yield this._auth.refresh()})))),this._auth=(null==r?void 0:r.auth)||new oe(this._transport,this._storage),this._items={},this._singletons={}}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new n(this.transport))}get collections(){return this._collections||(this._collections=new s(this.transport))}get fields(){return this._fields||(this._fields=new i(this.transport))}get files(){return this._files||(this._files=new o(this.transport))}get folders(){return this._folders||(this._folders=new a(this.transport))}get permissions(){return this._permissions||(this._permissions=new u(this.transport))}get presets(){return this._presets||(this._presets=new d(this.transport))}get relations(){return this._relations||(this._relations=new h(this.transport))}get revisions(){return this._revisions||(this._revisions=new c(this.transport))}get roles(){return this._roles||(this._roles=new l(this.transport))}get users(){return this._users||(this._users=new _(this.transport))}get settings(){return this._settings||(this._settings=new v(this.transport))}get server(){return this._server||(this._server=new p(this.transport))}get utils(){return this._utils||(this._utils=new w(this.transport))}get graphql(){return this._graphql||(this._graphql=new ae(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new f(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new e(t,this.transport))}}export{n as ActivityHandler,oe as Auth,ne as AxiosTransport,k as BaseStorage,s as CollectionsHandler,r as CommentsHandler,ue as Directus,i as FieldsHandler,o as FilesHandler,a as FoldersHandler,e as ItemsHandler,E as LocalStorage,O as MemoryStorage,b as Meta,u as PermissionsHandler,d as PresetsHandler,h as RelationsHandler,c as RevisionsHandler,l as RolesHandler,p as ServerHandler,v as SettingsHandler,x as TransportError,_ as UsersHandler,w as UtilsHandler}; | ||
function t(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class e{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(e)}`,{params:r})).data}))}readMany(e){return t(this,void 0,void 0,(function*(){const{data:t,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:e});return{data:t,meta:r}}))}createOne(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,e,{params:r})).data}))}createMany(e,r){return t(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,e,{params:r})}))}updateOne(e,r,n){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(e)}`,r,{params:n})).data}))}updateMany(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:e,data:r},{params:n})}))}updateByQuery(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:e,data:r},{params:n})}))}deleteOne(e){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(e)}`)}))}deleteMany(e){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,e)}))}}class r{constructor(t){this.transport=t}create(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",e)).data}))}update(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(e)}`,{comment:r})).data}))}delete(e){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(e)}`)}))}}class n extends e{constructor(t){super("directus_activity",t),this._comments=new r(this.transport)}get comments(){return this._comments}}class s{constructor(t){this.transport=t}readOne(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${e}`)).data}))}readAll(){return t(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",e)).data}))}createMany(e){return t(this,void 0,void 0,(function*(){const{data:t,meta:r}=yield this.transport.post("/collections",e);return{data:t,meta:r}}))}updateOne(e,r,n){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${e}`,r,{params:n})).data}))}deleteOne(e){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${e}`)}))}}class i{constructor(t){this.transport=t}readOne(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${e}/${r}`)).data}))}readMany(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${e}`)).data}))}readAll(){return t(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${e}`,r)).data}))}updateOne(e,r,n){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${e}/${r}`,n)).data}))}deleteOne(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${e}/${r}`)}))}}class o extends e{constructor(t){super("directus_files",t)}}class a extends e{constructor(t){super("directus_folders",t)}}class u extends e{constructor(t){super("directus_permissions",t)}}class d extends e{constructor(t){super("directus_presets",t)}}class h{constructor(t){this.transport=t}readOne(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${e}/${r}`)).data}))}readMany(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${e}`)).data}))}readAll(){return t(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",e)).data}))}updateOne(e,r,n){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${e}/${r}`,{params:n})).data}))}deleteOne(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${e}/${r}`)}))}}class c extends e{constructor(t){super("directus_revisions",t)}}class l extends e{constructor(t){super("directus_roles",t)}}class p{constructor(t){this.transport=t}ping(){return t(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return t(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class f{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:e})).data}))}update(e,r){return t(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,e,{params:r})).data}))}}class v extends f{constructor(t){super("directus_settings",t)}}class m{constructor(t){this.transport=t}send(e,r,n){return t(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:e,role:r,invite_url:n})}))}accept(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:e,password:r})}))}}class g{constructor(t){this.transport=t}generate(e){return t(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:e})).data}))}enable(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:e,otp:r})}))}disable(e){return t(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:e})}))}}class y{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new g(this._transport))}read(e){return t(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:e})).data}))}update(e,r){return t(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",e,{params:r})).data}))}}class _ extends e{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new m(this.transport))}get me(){return this._me||(this._me=new y(this.transport))}}class w{constructor(e){this.random={string:(e=32)=>t(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:e}})).data}))},this.hash={generate:e=>t(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:e})).data})),verify:(e,r)=>t(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:e,hash:r})).data}))},this.transport=e}sort(e,r,n){return t(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(e)}`,{item:r,to:n})}))}revert(e){return t(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(e)}`)}))}}var b;!function(t){t.TOTAL_COUNT="total_count",t.FILTER_COUNT="filter_count"}(b||(b={}));class x extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,x.prototype)}}class k{get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class O extends k{constructor(t=""){super(),this.values={},this.prefix=t}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class E extends k{constructor(t=""){super(),this.prefix=t}get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var S={exports:{}},T=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},j=T,R=Object.prototype.toString;function A(t){return"[object Array]"===R.call(t)}function $(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function U(t){if("[object Object]"!==R.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function q(t){return"[object Function]"===R.call(t)}function C(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),A(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var P={isArray:A,isArrayBuffer:function(t){return"[object ArrayBuffer]"===R.call(t)},isBuffer:function(t){return null!==t&&!$(t)&&null!==t.constructor&&!$(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:N,isPlainObject:U,isUndefined:$,isDate:function(t){return"[object Date]"===R.call(t)},isFile:function(t){return"[object File]"===R.call(t)},isBlob:function(t){return"[object Blob]"===R.call(t)},isFunction:q,isStream:function(t){return N(t)&&q(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:C,merge:function t(){var e={};function r(r,n){U(e[n])&&U(r)?e[n]=t(e[n],r):U(r)?e[n]=t({},r):A(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)C(arguments[n],r);return e},extend:function(t,e,r){return C(e,(function(e,n){t[n]=r&&"function"==typeof e?j(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},B=P;function L(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var I=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(B.isURLSearchParams(e))n=e.toString();else{var s=[];B.forEach(e,(function(t,e){null!=t&&(B.isArray(t)?e+="[]":t=[t],B.forEach(t,(function(t){B.isDate(t)?t=t.toISOString():B.isObject(t)&&(t=JSON.stringify(t)),s.push(L(e)+"="+L(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},D=P;function M(){this.handlers=[]}M.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},M.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},M.prototype.forEach=function(t){D.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var z=M,F=P,H=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,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,status:this.response&&this.response.status?this.response.status:null}},t},J=H,W=function(t,e,r,n,s){var i=new Error(t);return J(i,e,r,n,s)},V=W,X=P,K=X.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),X.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),X.isString(n)&&o.push("path="+n),X.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.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(){}},G=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},Q=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},Y=P,Z=["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"],tt=P,et=tt.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(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 t=n(window.location.href),function(e){var r=tt.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function rt(t){this.message=t}rt.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},rt.prototype.__CANCEL__=!0;var nt=rt,st=P,it=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(V("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},ot=K,at=I,ut=function(t,e){return t&&!G(e)?Q(t,e):e},dt=function(t){var e,r,n,s={};return t?(Y.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=Y.trim(t.substr(0,n)).toLowerCase(),r=Y.trim(t.substr(n+1)),e){if(s[e]&&Z.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ht=et,ct=W,lt=xt,pt=nt,ft=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}st.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+h)}var c=ut(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?dt(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};it((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),at(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(ct("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(ct("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||lt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(ct(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},st.isStandardBrowserEnv()){var p=(t.withCredentials||ht(c))&&t.xsrfCookieName?ot.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&st.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),st.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new pt("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},vt=P,mt=function(t,e){F.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},gt=H,yt={"Content-Type":"application/x-www-form-urlencoded"};function _t(t,e){!vt.isUndefined(t)&&vt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var wt,bt={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(wt=ft),wt),transformRequest:[function(t,e){return mt(e,"Accept"),mt(e,"Content-Type"),vt.isFormData(t)||vt.isArrayBuffer(t)||vt.isBuffer(t)||vt.isStream(t)||vt.isFile(t)||vt.isBlob(t)?t:vt.isArrayBufferView(t)?t.buffer:vt.isURLSearchParams(t)?(_t(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):vt.isObject(t)||e&&"application/json"===e["Content-Type"]?(_t(e,"application/json"),function(t,e,r){if(vt.isString(t))try{return(e||JSON.parse)(t),vt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||bt.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&vt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw gt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};vt.forEach(["delete","get","head"],(function(t){bt.headers[t]={}})),vt.forEach(["post","put","patch"],(function(t){bt.headers[t]=vt.merge(yt)}));var xt=bt,kt=P,Ot=xt,Et=function(t){return!(!t||!t.__CANCEL__)},St=P,Tt=function(t,e,r){var n=this||Ot;return kt.forEach(r,(function(r){t=r.call(n,t,e)})),t},jt=Et,Rt=xt,At=nt;function $t(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new At("canceled")}var Nt=P,Ut=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},qt="0.24.0",Ct=qt,Pt={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Pt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Bt={};Pt.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Ct+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Bt[s]&&(Bt[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Lt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Pt},It=P,Dt=I,Mt=z,zt=function(t){return $t(t),t.headers=t.headers||{},t.data=Tt.call(t,t.data,t.headers,t.transformRequest),t.headers=St.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),St.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||Rt.adapter)(t).then((function(e){return $t(t),e.data=Tt.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return jt(e)||($t(t),e&&e.response&&(e.response.data=Tt.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},Ft=Ut,Ht=Lt,Jt=Ht.validators;function Wt(t){this.defaults=t,this.interceptors={request:new Mt,response:new Mt}}Wt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Ft(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Ht.assertOptions(e,{silentJSONParsing:Jt.transitional(Jt.boolean),forcedJSONParsing:Jt.transitional(Jt.boolean),clarifyTimeoutError:Jt.transitional(Jt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[zt,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=zt(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Wt.prototype.getUri=function(t){return t=Ft(this.defaults,t),Dt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},It.forEach(["delete","get","head","options"],(function(t){Wt.prototype[t]=function(e,r){return this.request(Ft(r||{},{method:t,url:e,data:(r||{}).data}))}})),It.forEach(["post","put","patch"],(function(t){Wt.prototype[t]=function(e,r,n){return this.request(Ft(n||{},{method:t,url:e,data:r}))}}));var Vt=Wt,Xt=nt;function Kt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Xt(t),e(r.reason))}))}Kt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Kt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Kt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Kt.source=function(){var t;return{token:new Kt((function(e){t=e})),cancel:t}};var Gt=Kt,Qt=P,Yt=T,Zt=Vt,te=Ut;var ee=function t(e){var r=new Zt(e),n=Yt(Zt.prototype.request,r);return Qt.extend(n,Zt.prototype,r),Qt.extend(n,r),n.create=function(r){return t(te(e,r))},n}(xt);ee.Axios=Zt,ee.Cancel=nt,ee.CancelToken=Gt,ee.isCancel=Et,ee.VERSION=qt,ee.all=function(t){return Promise.all(t)},ee.spread=function(t){return function(e){return t.apply(null,e)}},ee.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},S.exports=ee,S.exports.default=ee;var re=S.exports;class ne{constructor(t,e,r=(()=>Promise.resolve())){this._url=t,this._storage=e,this._axios=null,this._refresh=r,this.url=t}get url(){return this._url}set url(t){this._url=t,this._axios=re.create({baseURL:t,withCredentials:!0})}get axios(){return this._axios}get requests(){return{intercept:(t,e)=>{const r=this._axios.interceptors.request.use(t,e);return{eject:()=>{this._axios.interceptors.request.eject(r)}}}}}get responses(){return{intercept:(t,e)=>{const r=this._axios.interceptors.response.use(t,e);return{eject:()=>{this._axios.interceptors.response.eject(r)}}}}}request(e,r,n,s){var i,o,a,u,d,h,c,l,p;return t(this,void 0,void 0,(function*(){try{(s=s||{}).sendAuthorizationHeaders=null===(i=s.sendAuthorizationHeaders)||void 0===i||i,s.refreshTokenIfNeeded=null===(o=s.refreshTokenIfNeeded)||void 0===o||o,s.headers=null!==(a=s.headers)&&void 0!==a?a:{},s.onUploadProgress=null!==(u=s.onUploadProgress)&&void 0!==u?u:void 0,s.refreshTokenIfNeeded&&(yield this._refresh());const t={method:e,url:r,data:n,params:s.params,headers:s.headers,onUploadProgress:s.onUploadProgress},d=this._storage.auth_token,h=this._storage.auth_expires;s.sendAuthorizationHeaders&&d&&(null!==h&&h>Date.now()||null===h)&&(d.startsWith("Bearer ")?t.headers.Authorization=d:t.headers.Authorization=`Bearer ${d}`);const c=yield this.axios.request(t),l=c.data,p={raw:c.data,status:c.status,statusText:c.statusText,headers:c.headers,data:l.data,meta:l.meta,errors:l.errors};if(l.errors)throw new x(null,p);return p}catch(t){if(!t||t instanceof Error==!1)throw t;if(re.isAxiosError(t)){const e=null===(d=t.response)||void 0===d?void 0:d.data;throw new x(t,{raw:null===(h=t.response)||void 0===h?void 0:h.data,status:null===(c=t.response)||void 0===c?void 0:c.status,statusText:null===(l=t.response)||void 0===l?void 0:l.statusText,headers:null===(p=t.response)||void 0===p?void 0:p.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new x(t)}}))}get(e,r){return t(this,void 0,void 0,(function*(){return yield this.request("get",e,void 0,r)}))}head(e,r){return t(this,void 0,void 0,(function*(){return yield this.request("head",e,void 0,r)}))}options(e,r){return t(this,void 0,void 0,(function*(){return yield this.request("options",e,void 0,r)}))}delete(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.request("delete",e,r,n)}))}put(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.request("put",e,r,n)}))}post(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.request("post",e,r,n)}))}patch(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.request("patch",e,r,n)}))}}class se{constructor(t){this.transport=t}request(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:e,reset_url:r})}))}reset(e,r){return t(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:e,password:r})}))}}class ie{constructor(t){this.func=t,this.debounced=[],this.debouncing=!1}debounce(...e){return t(this,void 0,void 0,(function*(){return this.debouncing?yield new Promise(((t,e)=>{this.debounced.push({resolve:e=>t(e),reject:t=>e(t)})})):(this.debouncing=!0,new Promise(((t,r)=>{this.func(...e).then((e=>{const n=[{resolve:t,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((t=>t.resolve(e)))})).catch((e=>{const n=[{resolve:t,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((t=>t.reject(e)))}))})))}))}}class oe{constructor(t,e,r){var n,s,i,o,a;this.options=r||{},this.options.mode=(null==r?void 0:r.mode)||("undefined"!=typeof window?"cookie":"json"),this.options.refresh=(null==r?void 0:r.refresh)||{auto:!1,time:3e4},this.options.refresh.auto=null!==(s=null===(n=this.options.refresh)||void 0===n?void 0:n.auto)&&void 0!==s&&s,this.options.refresh.time=null!==(o=null===(i=this.options.refresh)||void 0===i?void 0:i.time)&&void 0!==o?o:3e4,this.transport=t,this.storage=e,this.timer=!1,this.refresher=new ie(this.refreshToken.bind(this));try{this.updateRefresh(null===(a=this.options)||void 0===a?void 0:a.refresh)}catch(t){}}get token(){return this.storage.auth_token}get password(){return this.passwords=this.passwords||new se(this.transport)}get expiring(){var t,e;const r=this.storage.auth_expires;if(null===r)return!1;return r-(null!==(e=null===(t=this.options.refresh)||void 0===t?void 0:t.time)&&void 0!==e?e:0)<=Date.now()}refreshToken(e=!1){var r;return t(this,void 0,void 0,(function*(){if(!e&&!this.expiring)return!1;const t=yield this.transport.post("/auth/refresh",{refresh_token:"json"===this.options.mode?this.storage.auth_refresh_token:void 0},{refreshTokenIfNeeded:!1});return this.updateStorage(t.data),this.updateRefresh(),{access_token:t.data.access_token,refresh_token:null===(r=t.data)||void 0===r?void 0:r.refresh_token,expires:t.data.expires}}))}updateStorage(t){var e;this.storage.auth_token=t.access_token,this.storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,t.expires?this.storage.auth_expires=Date.now()+t.expires:this.storage.auth_expires=null}updateRefresh(t){var e,r;const n=this.storage.auth_expires;if(null===n)return void clearTimeout(this.timer);t&&(this.options.refresh.auto=null!==(e=t.auto)&&void 0!==e?e:this.options.refresh.auto,this.options.refresh.time=null!==(r=t.time)&&void 0!==r?r:this.options.refresh.time),clearTimeout(this.timer);let s=n-this.options.refresh.time-Date.now();if(s<0){if(n<Date.now())return;s=0}this.options.refresh.auto&&(this.timer=setTimeout((()=>{this.refresh().then((()=>{})).catch((()=>{}))}),s))}refresh(e=!1){return t(this,void 0,void 0,(function*(){return yield this.refresher.debounce(e)}))}login(e,r){var n;return t(this,void 0,void 0,(function*(){r=r||{};const t=yield this.transport.post("/auth/login",Object.assign({mode:this.options.mode},e),{refreshTokenIfNeeded:!1,sendAuthorizationHeaders:!1});return this.updateStorage(t.data),this.updateRefresh(r.refresh),{access_token:t.data.access_token,refresh_token:null===(n=t.data)||void 0===n?void 0:n.refresh_token,expires:t.data.expires}}))}static(e){return t(this,void 0,void 0,(function*(){return yield this.transport.get("/users/me",{params:{access_token:e}}),this.storage.auth_token=e,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,!0}))}logout(){return t(this,void 0,void 0,(function*(){let t;"json"===this.options.mode&&(t=this.storage.auth_refresh_token||void 0),yield this.transport.post("/auth/logout",{refresh_token:t},{refreshTokenIfNeeded:!1}),this.storage.auth_token=null,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,clearTimeout(this.timer)}))}}class ae{constructor(t){this.transport=t}request(e,r,n){return t(this,void 0,void 0,(function*(){return yield this.transport.post(e,{query:r,variables:void 0===n?{}:n})}))}items(e,r){return t(this,void 0,void 0,(function*(){return yield this.request("/graphql",e,r)}))}system(e,r){return t(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",e,r)}))}}class ue{constructor(e,r){this._storage=(null==r?void 0:r.storage)||("undefined"!=typeof window?new E:new O),this._transport=(null==r?void 0:r.transport)||new ne(e,this._storage,(()=>t(this,void 0,void 0,(function*(){yield this._auth.refresh()})))),this._auth=(null==r?void 0:r.auth)||new oe(this._transport,this._storage),this._items={},this._singletons={}}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new n(this.transport))}get collections(){return this._collections||(this._collections=new s(this.transport))}get fields(){return this._fields||(this._fields=new i(this.transport))}get files(){return this._files||(this._files=new o(this.transport))}get folders(){return this._folders||(this._folders=new a(this.transport))}get permissions(){return this._permissions||(this._permissions=new u(this.transport))}get presets(){return this._presets||(this._presets=new d(this.transport))}get relations(){return this._relations||(this._relations=new h(this.transport))}get revisions(){return this._revisions||(this._revisions=new c(this.transport))}get roles(){return this._roles||(this._roles=new l(this.transport))}get users(){return this._users||(this._users=new _(this.transport))}get settings(){return this._settings||(this._settings=new v(this.transport))}get server(){return this._server||(this._server=new p(this.transport))}get utils(){return this._utils||(this._utils=new w(this.transport))}get graphql(){return this._graphql||(this._graphql=new ae(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new f(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new e(t,this.transport))}}export{n as ActivityHandler,oe as Auth,ne as AxiosTransport,k as BaseStorage,s as CollectionsHandler,r as CommentsHandler,ue as Directus,i as FieldsHandler,o as FilesHandler,a as FoldersHandler,e as ItemsHandler,E as LocalStorage,O as MemoryStorage,b as Meta,u as PermissionsHandler,d as PresetsHandler,h as RelationsHandler,c as RevisionsHandler,l as RolesHandler,p as ServerHandler,v as SettingsHandler,x as TransportError,_ as UsersHandler,w as UtilsHandler}; | ||
//# sourceMappingURL=sdk.esm.min.js.map |
@@ -15,3 +15,3 @@ var Directus=function(t){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function e(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class r{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:r})).data}))}readMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:r})).data}))}createMany(t,r){return e(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:r})}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,r,{params:n})).data}))}updateMany(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:r},{params:n})}))}updateByQuery(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:r},{params:n})}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}class n{constructor(t){this.transport=t}create(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:r})).data}))}delete(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}class s extends r{constructor(t){super("directus_activity",t),this._comments=new n(this.transport)}get comments(){return this._comments}}class i{constructor(t){this.transport=t}readOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,r,{params:n})).data}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}class o{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,r)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${r}`,n)).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${r}`)}))}}class a extends r{constructor(t){super("directus_files",t)}}class u extends r{constructor(t){super("directus_folders",t)}}class d extends r{constructor(t){super("directus_permissions",t)}}class h extends r{constructor(t){super("directus_presets",t)}}class c{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${r}`,{params:n})).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${r}`)}))}}class l extends r{constructor(t){super("directus_revisions",t)}}class p extends r{constructor(t){super("directus_roles",t)}}class f{constructor(t){this.transport=t}ping(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class v{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:r})).data}))}}class m extends v{constructor(t){super("directus_settings",t)}}class g{constructor(t){this.transport=t}send(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:r,invite_url:n})}))}accept(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:r})}))}}class y{constructor(t){this.transport=t}generate(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:r})}))}disable(t){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class _{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new y(this._transport))}read(t){return e(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:r})).data}))}}class w extends r{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new g(this.transport))}get me(){return this._me||(this._me=new _(this.transport))}}class b{constructor(t){this.random={string:(t=32)=>e(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,r)=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:r})).data}))},this.transport=t}sort(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:r,to:n})}))}revert(t){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var x;t.Meta=void 0,(x=t.Meta||(t.Meta={})).TOTAL_COUNT="total_count",x.FILTER_COUNT="filter_count";class k extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,k.prototype)}}class O{get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class E extends O{constructor(t=""){super(),this.values={},this.prefix=t}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class S extends O{constructor(t=""){super(),this.prefix=t}get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var T={exports:{}},j=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},R=j,A=Object.prototype.toString;function U(t){return"[object Array]"===A.call(t)}function $(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function C(t){if("[object Object]"!==A.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function q(t){return"[object Function]"===A.call(t)}function P(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),U(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var B={isArray:U,isArrayBuffer:function(t){return"[object ArrayBuffer]"===A.call(t)},isBuffer:function(t){return null!==t&&!$(t)&&null!==t.constructor&&!$(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:N,isPlainObject:C,isUndefined:$,isDate:function(t){return"[object Date]"===A.call(t)},isFile:function(t){return"[object File]"===A.call(t)},isBlob:function(t){return"[object Blob]"===A.call(t)},isFunction:q,isStream:function(t){return N(t)&&q(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:P,merge:function t(){var e={};function r(r,n){C(e[n])&&C(r)?e[n]=t(e[n],r):C(r)?e[n]=t({},r):U(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)P(arguments[n],r);return e},extend:function(t,e,r){return P(e,(function(e,n){t[n]=r&&"function"==typeof e?R(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},H=B;function L(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var I=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(H.isURLSearchParams(e))n=e.toString();else{var s=[];H.forEach(e,(function(t,e){null!=t&&(H.isArray(t)?e+="[]":t=[t],H.forEach(t,(function(t){H.isDate(t)?t=t.toISOString():H.isObject(t)&&(t=JSON.stringify(t)),s.push(L(e)+"="+L(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},D=B;function M(){this.handlers=[]}M.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},M.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},M.prototype.forEach=function(t){D.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var F=M,z=B,J=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,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,status:this.response&&this.response.status?this.response.status:null}},t},W=J,V=function(t,e,r,n,s){var i=new Error(t);return W(i,e,r,n,s)},X=V,K=B,G=K.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),K.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),K.isString(n)&&o.push("path="+n),K.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.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(){}},Q=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},Y=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},Z=B,tt=["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"],et=B,rt=et.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(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 t=n(window.location.href),function(e){var r=et.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function nt(t){this.message=t}nt.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},nt.prototype.__CANCEL__=!0;var st=nt,it=B,ot=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(X("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},at=G,ut=I,dt=function(t,e){return t&&!Q(e)?Y(t,e):e},ht=function(t){var e,r,n,s={};return t?(Z.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=Z.trim(t.substr(0,n)).toLowerCase(),r=Z.trim(t.substr(n+1)),e){if(s[e]&&tt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ct=rt,lt=V,pt=kt,ft=st,vt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}it.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+h)}var c=dt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?ht(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};ot((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ut(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(lt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(lt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||pt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(lt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},it.isStandardBrowserEnv()){var p=(t.withCredentials||ct(c))&&t.xsrfCookieName?at.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&it.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),it.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new ft("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},mt=B,gt=function(t,e){z.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},yt=J,_t={"Content-Type":"application/x-www-form-urlencoded"};function wt(t,e){!mt.isUndefined(t)&&mt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var bt,xt={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(bt=vt),bt),transformRequest:[function(t,e){return gt(e,"Accept"),gt(e,"Content-Type"),mt.isFormData(t)||mt.isArrayBuffer(t)||mt.isBuffer(t)||mt.isStream(t)||mt.isFile(t)||mt.isBlob(t)?t:mt.isArrayBufferView(t)?t.buffer:mt.isURLSearchParams(t)?(wt(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):mt.isObject(t)||e&&"application/json"===e["Content-Type"]?(wt(e,"application/json"),function(t,e,r){if(mt.isString(t))try{return(e||JSON.parse)(t),mt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||xt.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&mt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw yt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};mt.forEach(["delete","get","head"],(function(t){xt.headers[t]={}})),mt.forEach(["post","put","patch"],(function(t){xt.headers[t]=mt.merge(_t)}));var kt=xt,Ot=B,Et=kt,St=function(t){return!(!t||!t.__CANCEL__)},Tt=B,jt=function(t,e,r){var n=this||Et;return Ot.forEach(r,(function(r){t=r.call(n,t,e)})),t},Rt=St,At=kt,Ut=st;function $t(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ut("canceled")}var Nt=B,Ct=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},qt="0.23.0",Pt=qt,Bt={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Bt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Ht={};Bt.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Pt+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Ht[s]&&(Ht[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Lt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Bt},It=B,Dt=I,Mt=F,Ft=function(t){return $t(t),t.headers=t.headers||{},t.data=jt.call(t,t.data,t.headers,t.transformRequest),t.headers=Tt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Tt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||At.adapter)(t).then((function(e){return $t(t),e.data=jt.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return Rt(e)||($t(t),e&&e.response&&(e.response.data=jt.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},zt=Ct,Jt=Lt,Wt=Jt.validators;function Vt(t){this.defaults=t,this.interceptors={request:new Mt,response:new Mt}}Vt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=zt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Jt.assertOptions(e,{silentJSONParsing:Wt.transitional(Wt.boolean),forcedJSONParsing:Wt.transitional(Wt.boolean),clarifyTimeoutError:Wt.transitional(Wt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Ft,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Ft(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Vt.prototype.getUri=function(t){return t=zt(this.defaults,t),Dt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},It.forEach(["delete","get","head","options"],(function(t){Vt.prototype[t]=function(e,r){return this.request(zt(r||{},{method:t,url:e,data:(r||{}).data}))}})),It.forEach(["post","put","patch"],(function(t){Vt.prototype[t]=function(e,r,n){return this.request(zt(n||{},{method:t,url:e,data:r}))}}));var Xt=Vt,Kt=st;function Gt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Kt(t),e(r.reason))}))}Gt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Gt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Gt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Gt.source=function(){var t;return{token:new Gt((function(e){t=e})),cancel:t}};var Qt=Gt,Yt=B,Zt=j,te=Xt,ee=Ct;var re=function t(e){var r=new te(e),n=Zt(te.prototype.request,r);return Yt.extend(n,te.prototype,r),Yt.extend(n,r),n.create=function(r){return t(ee(e,r))},n}(kt);re.Axios=te,re.Cancel=st,re.CancelToken=Qt,re.isCancel=St,re.VERSION=qt,re.all=function(t){return Promise.all(t)},re.spread=function(t){return function(e){return t.apply(null,e)}},re.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},T.exports=re,T.exports.default=re;var ne=T.exports;class se{constructor(t,e,r=(()=>Promise.resolve())){this._url=t,this._storage=e,this._axios=null,this._refresh=r,this.url=t}get url(){return this._url}set url(t){this._url=t,this._axios=ne.create({baseURL:t,withCredentials:!0})}get axios(){return this._axios}get requests(){return{intercept:(t,e)=>{const r=this._axios.interceptors.request.use(t,e);return{eject:()=>{this._axios.interceptors.request.eject(r)}}}}}get responses(){return{intercept:(t,e)=>{const r=this._axios.interceptors.response.use(t,e);return{eject:()=>{this._axios.interceptors.response.eject(r)}}}}}request(t,r,n,s){var i,o,a,u,d,h,c,l,p;return e(this,void 0,void 0,(function*(){try{(s=s||{}).sendAuthorizationHeaders=null===(i=s.sendAuthorizationHeaders)||void 0===i||i,s.refreshTokenIfNeeded=null===(o=s.refreshTokenIfNeeded)||void 0===o||o,s.headers=null!==(a=s.headers)&&void 0!==a?a:{},s.onUploadProgress=null!==(u=s.onUploadProgress)&&void 0!==u?u:void 0,s.refreshTokenIfNeeded&&(yield this._refresh());const e={method:t,url:r,data:n,params:s.params,headers:s.headers,onUploadProgress:s.onUploadProgress},d=this._storage.auth_token,h=this._storage.auth_expires;s.sendAuthorizationHeaders&&d&&(null!==h&&h>Date.now()||null===h)&&(d.startsWith("Bearer ")?e.headers.Authorization=d:e.headers.Authorization=`Bearer ${d}`);const c=yield this.axios.request(e),l=c.data,p={raw:c.data,status:c.status,statusText:c.statusText,headers:c.headers,data:l.data,meta:l.meta,errors:l.errors};if(l.errors)throw new k(null,p);return p}catch(t){if(!t||t instanceof Error==!1)throw t;if(ne.isAxiosError(t)){const e=null===(d=t.response)||void 0===d?void 0:d.data;throw new k(t,{raw:null===(h=t.response)||void 0===h?void 0:h.data,status:null===(c=t.response)||void 0===c?void 0:c.status,statusText:null===(l=t.response)||void 0===l?void 0:l.statusText,headers:null===(p=t.response)||void 0===p?void 0:p.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new k(t)}}))}get(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,r)}))}head(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,r)}))}options(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,r)}))}delete(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("delete",t,r,n)}))}put(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("put",t,r,n)}))}post(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("post",t,r,n)}))}patch(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("patch",t,r,n)}))}}class ie{constructor(t){this.transport=t}request(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:r})}))}reset(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:r})}))}}class oe{constructor(t){this.func=t,this.debounced=[],this.debouncing=!1}debounce(...t){return e(this,void 0,void 0,(function*(){return this.debouncing?yield new Promise(((t,e)=>{this.debounced.push({resolve:e=>t(e),reject:t=>e(t)})})):(this.debouncing=!0,new Promise(((e,r)=>{this.func(...t).then((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.resolve(t)))})).catch((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.reject(t)))}))})))}))}}class ae{constructor(t,e,r){var n,s,i,o,a;this.options=r||{},this.options.mode=(null==r?void 0:r.mode)||("undefined"!=typeof window?"cookie":"json"),this.options.refresh=(null==r?void 0:r.refresh)||{auto:!1,time:3e4},this.options.refresh.auto=null!==(s=null===(n=this.options.refresh)||void 0===n?void 0:n.auto)&&void 0!==s&&s,this.options.refresh.time=null!==(o=null===(i=this.options.refresh)||void 0===i?void 0:i.time)&&void 0!==o?o:3e4,this.transport=t,this.storage=e,this.timer=!1,this.refresher=new oe(this.refreshToken.bind(this));try{this.updateRefresh(null===(a=this.options)||void 0===a?void 0:a.refresh)}catch(t){}}get token(){return this.storage.auth_token}get password(){return this.passwords=this.passwords||new ie(this.transport)}get expiring(){var t,e;const r=this.storage.auth_expires;if(null===r)return!1;return r-(null!==(e=null===(t=this.options.refresh)||void 0===t?void 0:t.time)&&void 0!==e?e:0)<=Date.now()}refreshToken(t=!1){var r;return e(this,void 0,void 0,(function*(){if(!t&&!this.expiring)return!1;const e=yield this.transport.post("/auth/refresh",{refresh_token:"json"===this.options.mode?this.storage.auth_refresh_token:void 0},{refreshTokenIfNeeded:!1});return this.updateStorage(e.data),this.updateRefresh(),{access_token:e.data.access_token,refresh_token:null===(r=e.data)||void 0===r?void 0:r.refresh_token,expires:e.data.expires}}))}updateStorage(t){var e;this.storage.auth_token=t.access_token,this.storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,t.expires?this.storage.auth_expires=Date.now()+t.expires:this.storage.auth_expires=null}updateRefresh(t){var e,r;const n=this.storage.auth_expires;if(null===n)return void clearTimeout(this.timer);t&&(this.options.refresh.auto=null!==(e=t.auto)&&void 0!==e?e:this.options.refresh.auto,this.options.refresh.time=null!==(r=t.time)&&void 0!==r?r:this.options.refresh.time),clearTimeout(this.timer);let s=n-this.options.refresh.time-Date.now();if(s<0){if(n<Date.now())return;s=0}this.options.refresh.auto&&(this.timer=setTimeout((()=>{this.refresh().then((()=>{})).catch((()=>{}))}),s))}refresh(t=!1){return e(this,void 0,void 0,(function*(){return yield this.refresher.debounce(t)}))}login(t,r){var n;return e(this,void 0,void 0,(function*(){r=r||{};const e=yield this.transport.post("/auth/login",Object.assign({mode:this.options.mode},t),{refreshTokenIfNeeded:!1,sendAuthorizationHeaders:!1});return this.updateStorage(e.data),this.updateRefresh(r.refresh),{access_token:e.data.access_token,refresh_token:null===(n=e.data)||void 0===n?void 0:n.refresh_token,expires:e.data.expires}}))}static(t){return e(this,void 0,void 0,(function*(){return yield this.transport.get("/users/me",{params:{access_token:t}}),this.storage.auth_token=t,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,!0}))}logout(){return e(this,void 0,void 0,(function*(){let t;"json"===this.options.mode&&(t=this.storage.auth_refresh_token||void 0),yield this.transport.post("/auth/logout",{refresh_token:t},{refreshTokenIfNeeded:!1}),this.storage.auth_token=null,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,clearTimeout(this.timer)}))}}class ue{constructor(t){this.transport=t}request(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:r,variables:void 0===n?{}:n})}))}items(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,r)}))}system(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,r)}))}}return t.ActivityHandler=s,t.Auth=ae,t.AxiosTransport=se,t.BaseStorage=O,t.CollectionsHandler=i,t.CommentsHandler=n,t.Directus=class{constructor(t,r){this._storage=(null==r?void 0:r.storage)||("undefined"!=typeof window?new S:new E),this._transport=(null==r?void 0:r.transport)||new se(t,this._storage,(()=>e(this,void 0,void 0,(function*(){yield this._auth.refresh()})))),this._auth=(null==r?void 0:r.auth)||new ae(this._transport,this._storage),this._items={},this._singletons={}}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new s(this.transport))}get collections(){return this._collections||(this._collections=new i(this.transport))}get fields(){return this._fields||(this._fields=new o(this.transport))}get files(){return this._files||(this._files=new a(this.transport))}get folders(){return this._folders||(this._folders=new u(this.transport))}get permissions(){return this._permissions||(this._permissions=new d(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new c(this.transport))}get revisions(){return this._revisions||(this._revisions=new l(this.transport))}get roles(){return this._roles||(this._roles=new p(this.transport))}get users(){return this._users||(this._users=new w(this.transport))}get settings(){return this._settings||(this._settings=new m(this.transport))}get server(){return this._server||(this._server=new f(this.transport))}get utils(){return this._utils||(this._utils=new b(this.transport))}get graphql(){return this._graphql||(this._graphql=new ue(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new v(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new r(t,this.transport))}},t.FieldsHandler=o,t.FilesHandler=a,t.FoldersHandler=u,t.ItemsHandler=r,t.LocalStorage=S,t.MemoryStorage=E,t.PermissionsHandler=d,t.PresetsHandler=h,t.RelationsHandler=c,t.RevisionsHandler=l,t.RolesHandler=p,t.ServerHandler=f,t.SettingsHandler=m,t.TransportError=k,t.UsersHandler=w,t.UtilsHandler=b,Object.defineProperty(t,"__esModule",{value:!0}),t}({}); | ||
***************************************************************************** */function e(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class r{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:r})).data}))}readMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:r})).data}))}createMany(t,r){return e(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:r})}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,r,{params:n})).data}))}updateMany(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:r},{params:n})}))}updateByQuery(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:r},{params:n})}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}class n{constructor(t){this.transport=t}create(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:r})).data}))}delete(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}class s extends r{constructor(t){super("directus_activity",t),this._comments=new n(this.transport)}get comments(){return this._comments}}class i{constructor(t){this.transport=t}readOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,r,{params:n})).data}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}class o{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,r)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${r}`,n)).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${r}`)}))}}class a extends r{constructor(t){super("directus_files",t)}}class u extends r{constructor(t){super("directus_folders",t)}}class d extends r{constructor(t){super("directus_permissions",t)}}class h extends r{constructor(t){super("directus_presets",t)}}class c{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${r}`,{params:n})).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${r}`)}))}}class l extends r{constructor(t){super("directus_revisions",t)}}class p extends r{constructor(t){super("directus_roles",t)}}class f{constructor(t){this.transport=t}ping(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class v{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:r})).data}))}}class m extends v{constructor(t){super("directus_settings",t)}}class g{constructor(t){this.transport=t}send(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:r,invite_url:n})}))}accept(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:r})}))}}class y{constructor(t){this.transport=t}generate(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:r})}))}disable(t){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class _{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new y(this._transport))}read(t){return e(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:r})).data}))}}class w extends r{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new g(this.transport))}get me(){return this._me||(this._me=new _(this.transport))}}class b{constructor(t){this.random={string:(t=32)=>e(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,r)=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:r})).data}))},this.transport=t}sort(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:r,to:n})}))}revert(t){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var x;t.Meta=void 0,(x=t.Meta||(t.Meta={})).TOTAL_COUNT="total_count",x.FILTER_COUNT="filter_count";class k extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,k.prototype)}}class O{get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class E extends O{constructor(t=""){super(),this.values={},this.prefix=t}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class S extends O{constructor(t=""){super(),this.prefix=t}get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var T={exports:{}},j=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},R=j,A=Object.prototype.toString;function U(t){return"[object Array]"===A.call(t)}function $(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function C(t){if("[object Object]"!==A.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function q(t){return"[object Function]"===A.call(t)}function P(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),U(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var B={isArray:U,isArrayBuffer:function(t){return"[object ArrayBuffer]"===A.call(t)},isBuffer:function(t){return null!==t&&!$(t)&&null!==t.constructor&&!$(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:N,isPlainObject:C,isUndefined:$,isDate:function(t){return"[object Date]"===A.call(t)},isFile:function(t){return"[object File]"===A.call(t)},isBlob:function(t){return"[object Blob]"===A.call(t)},isFunction:q,isStream:function(t){return N(t)&&q(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:P,merge:function t(){var e={};function r(r,n){C(e[n])&&C(r)?e[n]=t(e[n],r):C(r)?e[n]=t({},r):U(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)P(arguments[n],r);return e},extend:function(t,e,r){return P(e,(function(e,n){t[n]=r&&"function"==typeof e?R(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},H=B;function L(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var I=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(H.isURLSearchParams(e))n=e.toString();else{var s=[];H.forEach(e,(function(t,e){null!=t&&(H.isArray(t)?e+="[]":t=[t],H.forEach(t,(function(t){H.isDate(t)?t=t.toISOString():H.isObject(t)&&(t=JSON.stringify(t)),s.push(L(e)+"="+L(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},D=B;function M(){this.handlers=[]}M.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},M.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},M.prototype.forEach=function(t){D.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var F=M,z=B,J=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,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,status:this.response&&this.response.status?this.response.status:null}},t},W=J,V=function(t,e,r,n,s){var i=new Error(t);return W(i,e,r,n,s)},X=V,K=B,G=K.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),K.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),K.isString(n)&&o.push("path="+n),K.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.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(){}},Q=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},Y=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},Z=B,tt=["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"],et=B,rt=et.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(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 t=n(window.location.href),function(e){var r=et.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function nt(t){this.message=t}nt.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},nt.prototype.__CANCEL__=!0;var st=nt,it=B,ot=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(X("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},at=G,ut=I,dt=function(t,e){return t&&!Q(e)?Y(t,e):e},ht=function(t){var e,r,n,s={};return t?(Z.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=Z.trim(t.substr(0,n)).toLowerCase(),r=Z.trim(t.substr(n+1)),e){if(s[e]&&tt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ct=rt,lt=V,pt=kt,ft=st,vt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}it.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+h)}var c=dt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?ht(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};ot((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ut(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(lt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(lt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||pt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(lt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},it.isStandardBrowserEnv()){var p=(t.withCredentials||ct(c))&&t.xsrfCookieName?at.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&it.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),it.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new ft("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},mt=B,gt=function(t,e){z.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},yt=J,_t={"Content-Type":"application/x-www-form-urlencoded"};function wt(t,e){!mt.isUndefined(t)&&mt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var bt,xt={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(bt=vt),bt),transformRequest:[function(t,e){return gt(e,"Accept"),gt(e,"Content-Type"),mt.isFormData(t)||mt.isArrayBuffer(t)||mt.isBuffer(t)||mt.isStream(t)||mt.isFile(t)||mt.isBlob(t)?t:mt.isArrayBufferView(t)?t.buffer:mt.isURLSearchParams(t)?(wt(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):mt.isObject(t)||e&&"application/json"===e["Content-Type"]?(wt(e,"application/json"),function(t,e,r){if(mt.isString(t))try{return(e||JSON.parse)(t),mt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||xt.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&mt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw yt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};mt.forEach(["delete","get","head"],(function(t){xt.headers[t]={}})),mt.forEach(["post","put","patch"],(function(t){xt.headers[t]=mt.merge(_t)}));var kt=xt,Ot=B,Et=kt,St=function(t){return!(!t||!t.__CANCEL__)},Tt=B,jt=function(t,e,r){var n=this||Et;return Ot.forEach(r,(function(r){t=r.call(n,t,e)})),t},Rt=St,At=kt,Ut=st;function $t(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ut("canceled")}var Nt=B,Ct=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},qt="0.24.0",Pt=qt,Bt={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Bt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Ht={};Bt.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Pt+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Ht[s]&&(Ht[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Lt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Bt},It=B,Dt=I,Mt=F,Ft=function(t){return $t(t),t.headers=t.headers||{},t.data=jt.call(t,t.data,t.headers,t.transformRequest),t.headers=Tt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Tt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||At.adapter)(t).then((function(e){return $t(t),e.data=jt.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return Rt(e)||($t(t),e&&e.response&&(e.response.data=jt.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},zt=Ct,Jt=Lt,Wt=Jt.validators;function Vt(t){this.defaults=t,this.interceptors={request:new Mt,response:new Mt}}Vt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=zt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Jt.assertOptions(e,{silentJSONParsing:Wt.transitional(Wt.boolean),forcedJSONParsing:Wt.transitional(Wt.boolean),clarifyTimeoutError:Wt.transitional(Wt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Ft,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Ft(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Vt.prototype.getUri=function(t){return t=zt(this.defaults,t),Dt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},It.forEach(["delete","get","head","options"],(function(t){Vt.prototype[t]=function(e,r){return this.request(zt(r||{},{method:t,url:e,data:(r||{}).data}))}})),It.forEach(["post","put","patch"],(function(t){Vt.prototype[t]=function(e,r,n){return this.request(zt(n||{},{method:t,url:e,data:r}))}}));var Xt=Vt,Kt=st;function Gt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Kt(t),e(r.reason))}))}Gt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Gt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Gt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Gt.source=function(){var t;return{token:new Gt((function(e){t=e})),cancel:t}};var Qt=Gt,Yt=B,Zt=j,te=Xt,ee=Ct;var re=function t(e){var r=new te(e),n=Zt(te.prototype.request,r);return Yt.extend(n,te.prototype,r),Yt.extend(n,r),n.create=function(r){return t(ee(e,r))},n}(kt);re.Axios=te,re.Cancel=st,re.CancelToken=Qt,re.isCancel=St,re.VERSION=qt,re.all=function(t){return Promise.all(t)},re.spread=function(t){return function(e){return t.apply(null,e)}},re.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},T.exports=re,T.exports.default=re;var ne=T.exports;class se{constructor(t,e,r=(()=>Promise.resolve())){this._url=t,this._storage=e,this._axios=null,this._refresh=r,this.url=t}get url(){return this._url}set url(t){this._url=t,this._axios=ne.create({baseURL:t,withCredentials:!0})}get axios(){return this._axios}get requests(){return{intercept:(t,e)=>{const r=this._axios.interceptors.request.use(t,e);return{eject:()=>{this._axios.interceptors.request.eject(r)}}}}}get responses(){return{intercept:(t,e)=>{const r=this._axios.interceptors.response.use(t,e);return{eject:()=>{this._axios.interceptors.response.eject(r)}}}}}request(t,r,n,s){var i,o,a,u,d,h,c,l,p;return e(this,void 0,void 0,(function*(){try{(s=s||{}).sendAuthorizationHeaders=null===(i=s.sendAuthorizationHeaders)||void 0===i||i,s.refreshTokenIfNeeded=null===(o=s.refreshTokenIfNeeded)||void 0===o||o,s.headers=null!==(a=s.headers)&&void 0!==a?a:{},s.onUploadProgress=null!==(u=s.onUploadProgress)&&void 0!==u?u:void 0,s.refreshTokenIfNeeded&&(yield this._refresh());const e={method:t,url:r,data:n,params:s.params,headers:s.headers,onUploadProgress:s.onUploadProgress},d=this._storage.auth_token,h=this._storage.auth_expires;s.sendAuthorizationHeaders&&d&&(null!==h&&h>Date.now()||null===h)&&(d.startsWith("Bearer ")?e.headers.Authorization=d:e.headers.Authorization=`Bearer ${d}`);const c=yield this.axios.request(e),l=c.data,p={raw:c.data,status:c.status,statusText:c.statusText,headers:c.headers,data:l.data,meta:l.meta,errors:l.errors};if(l.errors)throw new k(null,p);return p}catch(t){if(!t||t instanceof Error==!1)throw t;if(ne.isAxiosError(t)){const e=null===(d=t.response)||void 0===d?void 0:d.data;throw new k(t,{raw:null===(h=t.response)||void 0===h?void 0:h.data,status:null===(c=t.response)||void 0===c?void 0:c.status,statusText:null===(l=t.response)||void 0===l?void 0:l.statusText,headers:null===(p=t.response)||void 0===p?void 0:p.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new k(t)}}))}get(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,r)}))}head(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,r)}))}options(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,r)}))}delete(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("delete",t,r,n)}))}put(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("put",t,r,n)}))}post(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("post",t,r,n)}))}patch(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("patch",t,r,n)}))}}class ie{constructor(t){this.transport=t}request(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:r})}))}reset(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:r})}))}}class oe{constructor(t){this.func=t,this.debounced=[],this.debouncing=!1}debounce(...t){return e(this,void 0,void 0,(function*(){return this.debouncing?yield new Promise(((t,e)=>{this.debounced.push({resolve:e=>t(e),reject:t=>e(t)})})):(this.debouncing=!0,new Promise(((e,r)=>{this.func(...t).then((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.resolve(t)))})).catch((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.reject(t)))}))})))}))}}class ae{constructor(t,e,r){var n,s,i,o,a;this.options=r||{},this.options.mode=(null==r?void 0:r.mode)||("undefined"!=typeof window?"cookie":"json"),this.options.refresh=(null==r?void 0:r.refresh)||{auto:!1,time:3e4},this.options.refresh.auto=null!==(s=null===(n=this.options.refresh)||void 0===n?void 0:n.auto)&&void 0!==s&&s,this.options.refresh.time=null!==(o=null===(i=this.options.refresh)||void 0===i?void 0:i.time)&&void 0!==o?o:3e4,this.transport=t,this.storage=e,this.timer=!1,this.refresher=new oe(this.refreshToken.bind(this));try{this.updateRefresh(null===(a=this.options)||void 0===a?void 0:a.refresh)}catch(t){}}get token(){return this.storage.auth_token}get password(){return this.passwords=this.passwords||new ie(this.transport)}get expiring(){var t,e;const r=this.storage.auth_expires;if(null===r)return!1;return r-(null!==(e=null===(t=this.options.refresh)||void 0===t?void 0:t.time)&&void 0!==e?e:0)<=Date.now()}refreshToken(t=!1){var r;return e(this,void 0,void 0,(function*(){if(!t&&!this.expiring)return!1;const e=yield this.transport.post("/auth/refresh",{refresh_token:"json"===this.options.mode?this.storage.auth_refresh_token:void 0},{refreshTokenIfNeeded:!1});return this.updateStorage(e.data),this.updateRefresh(),{access_token:e.data.access_token,refresh_token:null===(r=e.data)||void 0===r?void 0:r.refresh_token,expires:e.data.expires}}))}updateStorage(t){var e;this.storage.auth_token=t.access_token,this.storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,t.expires?this.storage.auth_expires=Date.now()+t.expires:this.storage.auth_expires=null}updateRefresh(t){var e,r;const n=this.storage.auth_expires;if(null===n)return void clearTimeout(this.timer);t&&(this.options.refresh.auto=null!==(e=t.auto)&&void 0!==e?e:this.options.refresh.auto,this.options.refresh.time=null!==(r=t.time)&&void 0!==r?r:this.options.refresh.time),clearTimeout(this.timer);let s=n-this.options.refresh.time-Date.now();if(s<0){if(n<Date.now())return;s=0}this.options.refresh.auto&&(this.timer=setTimeout((()=>{this.refresh().then((()=>{})).catch((()=>{}))}),s))}refresh(t=!1){return e(this,void 0,void 0,(function*(){return yield this.refresher.debounce(t)}))}login(t,r){var n;return e(this,void 0,void 0,(function*(){r=r||{};const e=yield this.transport.post("/auth/login",Object.assign({mode:this.options.mode},t),{refreshTokenIfNeeded:!1,sendAuthorizationHeaders:!1});return this.updateStorage(e.data),this.updateRefresh(r.refresh),{access_token:e.data.access_token,refresh_token:null===(n=e.data)||void 0===n?void 0:n.refresh_token,expires:e.data.expires}}))}static(t){return e(this,void 0,void 0,(function*(){return yield this.transport.get("/users/me",{params:{access_token:t}}),this.storage.auth_token=t,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,!0}))}logout(){return e(this,void 0,void 0,(function*(){let t;"json"===this.options.mode&&(t=this.storage.auth_refresh_token||void 0),yield this.transport.post("/auth/logout",{refresh_token:t},{refreshTokenIfNeeded:!1}),this.storage.auth_token=null,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,clearTimeout(this.timer)}))}}class ue{constructor(t){this.transport=t}request(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:r,variables:void 0===n?{}:n})}))}items(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,r)}))}system(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,r)}))}}return t.ActivityHandler=s,t.Auth=ae,t.AxiosTransport=se,t.BaseStorage=O,t.CollectionsHandler=i,t.CommentsHandler=n,t.Directus=class{constructor(t,r){this._storage=(null==r?void 0:r.storage)||("undefined"!=typeof window?new S:new E),this._transport=(null==r?void 0:r.transport)||new se(t,this._storage,(()=>e(this,void 0,void 0,(function*(){yield this._auth.refresh()})))),this._auth=(null==r?void 0:r.auth)||new ae(this._transport,this._storage),this._items={},this._singletons={}}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new s(this.transport))}get collections(){return this._collections||(this._collections=new i(this.transport))}get fields(){return this._fields||(this._fields=new o(this.transport))}get files(){return this._files||(this._files=new a(this.transport))}get folders(){return this._folders||(this._folders=new u(this.transport))}get permissions(){return this._permissions||(this._permissions=new d(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new c(this.transport))}get revisions(){return this._revisions||(this._revisions=new l(this.transport))}get roles(){return this._roles||(this._roles=new p(this.transport))}get users(){return this._users||(this._users=new w(this.transport))}get settings(){return this._settings||(this._settings=new m(this.transport))}get server(){return this._server||(this._server=new f(this.transport))}get utils(){return this._utils||(this._utils=new b(this.transport))}get graphql(){return this._graphql||(this._graphql=new ue(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new v(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new r(t,this.transport))}},t.FieldsHandler=o,t.FilesHandler=a,t.FoldersHandler=u,t.ItemsHandler=r,t.LocalStorage=S,t.MemoryStorage=E,t.PermissionsHandler=d,t.PresetsHandler=h,t.RelationsHandler=c,t.RevisionsHandler=l,t.RolesHandler=p,t.ServerHandler=f,t.SettingsHandler=m,t.TransportError=k,t.UsersHandler=w,t.UtilsHandler=b,Object.defineProperty(t,"__esModule",{value:!0}),t}({}); | ||
//# sourceMappingURL=sdk.iife.min.js.map |
@@ -16,3 +16,3 @@ System.register("Directus",[],(function(t){"use strict";return{execute:function(){ | ||
***************************************************************************** */ | ||
function e(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class r{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:r})).data}))}readMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:r})).data}))}createMany(t,r){return e(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:r})}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,r,{params:n})).data}))}updateMany(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:r},{params:n})}))}updateByQuery(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:r},{params:n})}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}t("ItemsHandler",r);class n{constructor(t){this.transport=t}create(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:r})).data}))}delete(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}t("CommentsHandler",n);class s extends r{constructor(t){super("directus_activity",t),this._comments=new n(this.transport)}get comments(){return this._comments}}t("ActivityHandler",s);class i{constructor(t){this.transport=t}readOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,r,{params:n})).data}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}t("CollectionsHandler",i);class o{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,r)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${r}`,n)).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${r}`)}))}}t("FieldsHandler",o);class a extends r{constructor(t){super("directus_files",t)}}t("FilesHandler",a);class u extends r{constructor(t){super("directus_folders",t)}}t("FoldersHandler",u);class d extends r{constructor(t){super("directus_permissions",t)}}t("PermissionsHandler",d);class h extends r{constructor(t){super("directus_presets",t)}}t("PresetsHandler",h);class c{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${r}`,{params:n})).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${r}`)}))}}t("RelationsHandler",c);class l extends r{constructor(t){super("directus_revisions",t)}}t("RevisionsHandler",l);class p extends r{constructor(t){super("directus_roles",t)}}t("RolesHandler",p);class f{constructor(t){this.transport=t}ping(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}t("ServerHandler",f);class v{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:r})).data}))}}class m extends v{constructor(t){super("directus_settings",t)}}t("SettingsHandler",m);class g{constructor(t){this.transport=t}send(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:r,invite_url:n})}))}accept(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:r})}))}}class y{constructor(t){this.transport=t}generate(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:r})}))}disable(t){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class _{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new y(this._transport))}read(t){return e(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:r})).data}))}}class w extends r{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new g(this.transport))}get me(){return this._me||(this._me=new _(this.transport))}}t("UsersHandler",w);class b{constructor(t){this.random={string:(t=32)=>e(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,r)=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:r})).data}))},this.transport=t}sort(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:r,to:n})}))}revert(t){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var x;t("UtilsHandler",b),t("Meta",x),function(t){t.TOTAL_COUNT="total_count",t.FILTER_COUNT="filter_count"}(x||t("Meta",x={}));class k extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,k.prototype)}}t("TransportError",k);class O{get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}t("BaseStorage",O);class E extends O{constructor(t=""){super(),this.values={},this.prefix=t}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}t("MemoryStorage",E);class S extends O{constructor(t=""){super(),this.prefix=t}get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}t("LocalStorage",S);var T={exports:{}},j=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},R=j,A=Object.prototype.toString;function U(t){return"[object Array]"===A.call(t)}function $(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function C(t){if("[object Object]"!==A.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function q(t){return"[object Function]"===A.call(t)}function P(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),U(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var B={isArray:U,isArrayBuffer:function(t){return"[object ArrayBuffer]"===A.call(t)},isBuffer:function(t){return null!==t&&!$(t)&&null!==t.constructor&&!$(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:N,isPlainObject:C,isUndefined:$,isDate:function(t){return"[object Date]"===A.call(t)},isFile:function(t){return"[object File]"===A.call(t)},isBlob:function(t){return"[object Blob]"===A.call(t)},isFunction:q,isStream:function(t){return N(t)&&q(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:P,merge:function t(){var e={};function r(r,n){C(e[n])&&C(r)?e[n]=t(e[n],r):C(r)?e[n]=t({},r):U(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)P(arguments[n],r);return e},extend:function(t,e,r){return P(e,(function(e,n){t[n]=r&&"function"==typeof e?R(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},H=B;function L(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var I=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(H.isURLSearchParams(e))n=e.toString();else{var s=[];H.forEach(e,(function(t,e){null!=t&&(H.isArray(t)?e+="[]":t=[t],H.forEach(t,(function(t){H.isDate(t)?t=t.toISOString():H.isObject(t)&&(t=JSON.stringify(t)),s.push(L(e)+"="+L(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},D=B;function M(){this.handlers=[]}M.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},M.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},M.prototype.forEach=function(t){D.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var F=M,z=B,J=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,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,status:this.response&&this.response.status?this.response.status:null}},t},W=J,V=function(t,e,r,n,s){var i=new Error(t);return W(i,e,r,n,s)},X=V,K=B,G=K.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),K.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),K.isString(n)&&o.push("path="+n),K.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.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(){}},Q=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},Y=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},Z=B,tt=["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"],et=B,rt=et.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(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 t=n(window.location.href),function(e){var r=et.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function nt(t){this.message=t}nt.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},nt.prototype.__CANCEL__=!0;var st=nt,it=B,ot=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(X("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},at=G,ut=I,dt=function(t,e){return t&&!Q(e)?Y(t,e):e},ht=function(t){var e,r,n,s={};return t?(Z.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=Z.trim(t.substr(0,n)).toLowerCase(),r=Z.trim(t.substr(n+1)),e){if(s[e]&&tt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ct=rt,lt=V,pt=kt,ft=st,vt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}it.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+h)}var c=dt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?ht(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};ot((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ut(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(lt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(lt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||pt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(lt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},it.isStandardBrowserEnv()){var p=(t.withCredentials||ct(c))&&t.xsrfCookieName?at.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&it.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),it.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new ft("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},mt=B,gt=function(t,e){z.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},yt=J,_t={"Content-Type":"application/x-www-form-urlencoded"};function wt(t,e){!mt.isUndefined(t)&&mt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var bt,xt={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(bt=vt),bt),transformRequest:[function(t,e){return gt(e,"Accept"),gt(e,"Content-Type"),mt.isFormData(t)||mt.isArrayBuffer(t)||mt.isBuffer(t)||mt.isStream(t)||mt.isFile(t)||mt.isBlob(t)?t:mt.isArrayBufferView(t)?t.buffer:mt.isURLSearchParams(t)?(wt(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):mt.isObject(t)||e&&"application/json"===e["Content-Type"]?(wt(e,"application/json"),function(t,e,r){if(mt.isString(t))try{return(e||JSON.parse)(t),mt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||xt.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&mt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw yt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};mt.forEach(["delete","get","head"],(function(t){xt.headers[t]={}})),mt.forEach(["post","put","patch"],(function(t){xt.headers[t]=mt.merge(_t)}));var kt=xt,Ot=B,Et=kt,St=function(t){return!(!t||!t.__CANCEL__)},Tt=B,jt=function(t,e,r){var n=this||Et;return Ot.forEach(r,(function(r){t=r.call(n,t,e)})),t},Rt=St,At=kt,Ut=st;function $t(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ut("canceled")}var Nt=B,Ct=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},qt="0.23.0",Pt=qt,Bt={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Bt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Ht={};Bt.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Pt+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Ht[s]&&(Ht[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Lt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Bt},It=B,Dt=I,Mt=F,Ft=function(t){return $t(t),t.headers=t.headers||{},t.data=jt.call(t,t.data,t.headers,t.transformRequest),t.headers=Tt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Tt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||At.adapter)(t).then((function(e){return $t(t),e.data=jt.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return Rt(e)||($t(t),e&&e.response&&(e.response.data=jt.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},zt=Ct,Jt=Lt,Wt=Jt.validators;function Vt(t){this.defaults=t,this.interceptors={request:new Mt,response:new Mt}}Vt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=zt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Jt.assertOptions(e,{silentJSONParsing:Wt.transitional(Wt.boolean),forcedJSONParsing:Wt.transitional(Wt.boolean),clarifyTimeoutError:Wt.transitional(Wt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Ft,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Ft(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Vt.prototype.getUri=function(t){return t=zt(this.defaults,t),Dt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},It.forEach(["delete","get","head","options"],(function(t){Vt.prototype[t]=function(e,r){return this.request(zt(r||{},{method:t,url:e,data:(r||{}).data}))}})),It.forEach(["post","put","patch"],(function(t){Vt.prototype[t]=function(e,r,n){return this.request(zt(n||{},{method:t,url:e,data:r}))}}));var Xt=Vt,Kt=st;function Gt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Kt(t),e(r.reason))}))}Gt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Gt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Gt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Gt.source=function(){var t;return{token:new Gt((function(e){t=e})),cancel:t}};var Qt=Gt,Yt=B,Zt=j,te=Xt,ee=Ct;var re=function t(e){var r=new te(e),n=Zt(te.prototype.request,r);return Yt.extend(n,te.prototype,r),Yt.extend(n,r),n.create=function(r){return t(ee(e,r))},n}(kt);re.Axios=te,re.Cancel=st,re.CancelToken=Qt,re.isCancel=St,re.VERSION=qt,re.all=function(t){return Promise.all(t)},re.spread=function(t){return function(e){return t.apply(null,e)}},re.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},T.exports=re,T.exports.default=re;var ne=T.exports;class se{constructor(t,e,r=(()=>Promise.resolve())){this._url=t,this._storage=e,this._axios=null,this._refresh=r,this.url=t}get url(){return this._url}set url(t){this._url=t,this._axios=ne.create({baseURL:t,withCredentials:!0})}get axios(){return this._axios}get requests(){return{intercept:(t,e)=>{const r=this._axios.interceptors.request.use(t,e);return{eject:()=>{this._axios.interceptors.request.eject(r)}}}}}get responses(){return{intercept:(t,e)=>{const r=this._axios.interceptors.response.use(t,e);return{eject:()=>{this._axios.interceptors.response.eject(r)}}}}}request(t,r,n,s){var i,o,a,u,d,h,c,l,p;return e(this,void 0,void 0,(function*(){try{(s=s||{}).sendAuthorizationHeaders=null===(i=s.sendAuthorizationHeaders)||void 0===i||i,s.refreshTokenIfNeeded=null===(o=s.refreshTokenIfNeeded)||void 0===o||o,s.headers=null!==(a=s.headers)&&void 0!==a?a:{},s.onUploadProgress=null!==(u=s.onUploadProgress)&&void 0!==u?u:void 0,s.refreshTokenIfNeeded&&(yield this._refresh());const e={method:t,url:r,data:n,params:s.params,headers:s.headers,onUploadProgress:s.onUploadProgress},d=this._storage.auth_token,h=this._storage.auth_expires;s.sendAuthorizationHeaders&&d&&(null!==h&&h>Date.now()||null===h)&&(d.startsWith("Bearer ")?e.headers.Authorization=d:e.headers.Authorization=`Bearer ${d}`);const c=yield this.axios.request(e),l=c.data,p={raw:c.data,status:c.status,statusText:c.statusText,headers:c.headers,data:l.data,meta:l.meta,errors:l.errors};if(l.errors)throw new k(null,p);return p}catch(t){if(!t||t instanceof Error==!1)throw t;if(ne.isAxiosError(t)){const e=null===(d=t.response)||void 0===d?void 0:d.data;throw new k(t,{raw:null===(h=t.response)||void 0===h?void 0:h.data,status:null===(c=t.response)||void 0===c?void 0:c.status,statusText:null===(l=t.response)||void 0===l?void 0:l.statusText,headers:null===(p=t.response)||void 0===p?void 0:p.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new k(t)}}))}get(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,r)}))}head(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,r)}))}options(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,r)}))}delete(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("delete",t,r,n)}))}put(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("put",t,r,n)}))}post(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("post",t,r,n)}))}patch(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("patch",t,r,n)}))}}t("AxiosTransport",se);class ie{constructor(t){this.transport=t}request(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:r})}))}reset(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:r})}))}}class oe{constructor(t){this.func=t,this.debounced=[],this.debouncing=!1}debounce(...t){return e(this,void 0,void 0,(function*(){return this.debouncing?yield new Promise(((t,e)=>{this.debounced.push({resolve:e=>t(e),reject:t=>e(t)})})):(this.debouncing=!0,new Promise(((e,r)=>{this.func(...t).then((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.resolve(t)))})).catch((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.reject(t)))}))})))}))}}class ae{constructor(t,e,r){var n,s,i,o,a;this.options=r||{},this.options.mode=(null==r?void 0:r.mode)||("undefined"!=typeof window?"cookie":"json"),this.options.refresh=(null==r?void 0:r.refresh)||{auto:!1,time:3e4},this.options.refresh.auto=null!==(s=null===(n=this.options.refresh)||void 0===n?void 0:n.auto)&&void 0!==s&&s,this.options.refresh.time=null!==(o=null===(i=this.options.refresh)||void 0===i?void 0:i.time)&&void 0!==o?o:3e4,this.transport=t,this.storage=e,this.timer=!1,this.refresher=new oe(this.refreshToken.bind(this));try{this.updateRefresh(null===(a=this.options)||void 0===a?void 0:a.refresh)}catch(t){}}get token(){return this.storage.auth_token}get password(){return this.passwords=this.passwords||new ie(this.transport)}get expiring(){var t,e;const r=this.storage.auth_expires;if(null===r)return!1;return r-(null!==(e=null===(t=this.options.refresh)||void 0===t?void 0:t.time)&&void 0!==e?e:0)<=Date.now()}refreshToken(t=!1){var r;return e(this,void 0,void 0,(function*(){if(!t&&!this.expiring)return!1;const e=yield this.transport.post("/auth/refresh",{refresh_token:"json"===this.options.mode?this.storage.auth_refresh_token:void 0},{refreshTokenIfNeeded:!1});return this.updateStorage(e.data),this.updateRefresh(),{access_token:e.data.access_token,refresh_token:null===(r=e.data)||void 0===r?void 0:r.refresh_token,expires:e.data.expires}}))}updateStorage(t){var e;this.storage.auth_token=t.access_token,this.storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,t.expires?this.storage.auth_expires=Date.now()+t.expires:this.storage.auth_expires=null}updateRefresh(t){var e,r;const n=this.storage.auth_expires;if(null===n)return void clearTimeout(this.timer);t&&(this.options.refresh.auto=null!==(e=t.auto)&&void 0!==e?e:this.options.refresh.auto,this.options.refresh.time=null!==(r=t.time)&&void 0!==r?r:this.options.refresh.time),clearTimeout(this.timer);let s=n-this.options.refresh.time-Date.now();if(s<0){if(n<Date.now())return;s=0}this.options.refresh.auto&&(this.timer=setTimeout((()=>{this.refresh().then((()=>{})).catch((()=>{}))}),s))}refresh(t=!1){return e(this,void 0,void 0,(function*(){return yield this.refresher.debounce(t)}))}login(t,r){var n;return e(this,void 0,void 0,(function*(){r=r||{};const e=yield this.transport.post("/auth/login",Object.assign({mode:this.options.mode},t),{refreshTokenIfNeeded:!1,sendAuthorizationHeaders:!1});return this.updateStorage(e.data),this.updateRefresh(r.refresh),{access_token:e.data.access_token,refresh_token:null===(n=e.data)||void 0===n?void 0:n.refresh_token,expires:e.data.expires}}))}static(t){return e(this,void 0,void 0,(function*(){return yield this.transport.get("/users/me",{params:{access_token:t}}),this.storage.auth_token=t,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,!0}))}logout(){return e(this,void 0,void 0,(function*(){let t;"json"===this.options.mode&&(t=this.storage.auth_refresh_token||void 0),yield this.transport.post("/auth/logout",{refresh_token:t},{refreshTokenIfNeeded:!1}),this.storage.auth_token=null,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,clearTimeout(this.timer)}))}}t("Auth",ae);class ue{constructor(t){this.transport=t}request(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:r,variables:void 0===n?{}:n})}))}items(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,r)}))}system(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,r)}))}}t("Directus",class{constructor(t,r){this._storage=(null==r?void 0:r.storage)||("undefined"!=typeof window?new S:new E),this._transport=(null==r?void 0:r.transport)||new se(t,this._storage,(()=>e(this,void 0,void 0,(function*(){yield this._auth.refresh()})))),this._auth=(null==r?void 0:r.auth)||new ae(this._transport,this._storage),this._items={},this._singletons={}}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new s(this.transport))}get collections(){return this._collections||(this._collections=new i(this.transport))}get fields(){return this._fields||(this._fields=new o(this.transport))}get files(){return this._files||(this._files=new a(this.transport))}get folders(){return this._folders||(this._folders=new u(this.transport))}get permissions(){return this._permissions||(this._permissions=new d(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new c(this.transport))}get revisions(){return this._revisions||(this._revisions=new l(this.transport))}get roles(){return this._roles||(this._roles=new p(this.transport))}get users(){return this._users||(this._users=new w(this.transport))}get settings(){return this._settings||(this._settings=new m(this.transport))}get server(){return this._server||(this._server=new f(this.transport))}get utils(){return this._utils||(this._utils=new b(this.transport))}get graphql(){return this._graphql||(this._graphql=new ue(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new v(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new r(t,this.transport))}})}}})); | ||
function e(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class r{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:r})).data}))}readMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:r})).data}))}createMany(t,r){return e(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:r})}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,r,{params:n})).data}))}updateMany(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:r},{params:n})}))}updateByQuery(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:r},{params:n})}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}t("ItemsHandler",r);class n{constructor(t){this.transport=t}create(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:r})).data}))}delete(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}t("CommentsHandler",n);class s extends r{constructor(t){super("directus_activity",t),this._comments=new n(this.transport)}get comments(){return this._comments}}t("ActivityHandler",s);class i{constructor(t){this.transport=t}readOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,r,{params:n})).data}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}t("CollectionsHandler",i);class o{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,r)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${r}`,n)).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${r}`)}))}}t("FieldsHandler",o);class a extends r{constructor(t){super("directus_files",t)}}t("FilesHandler",a);class u extends r{constructor(t){super("directus_folders",t)}}t("FoldersHandler",u);class d extends r{constructor(t){super("directus_permissions",t)}}t("PermissionsHandler",d);class h extends r{constructor(t){super("directus_presets",t)}}t("PresetsHandler",h);class c{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${r}`,{params:n})).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${r}`)}))}}t("RelationsHandler",c);class l extends r{constructor(t){super("directus_revisions",t)}}t("RevisionsHandler",l);class p extends r{constructor(t){super("directus_roles",t)}}t("RolesHandler",p);class f{constructor(t){this.transport=t}ping(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}t("ServerHandler",f);class v{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:r})).data}))}}class m extends v{constructor(t){super("directus_settings",t)}}t("SettingsHandler",m);class g{constructor(t){this.transport=t}send(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:r,invite_url:n})}))}accept(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:r})}))}}class y{constructor(t){this.transport=t}generate(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:r})}))}disable(t){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class _{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new y(this._transport))}read(t){return e(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:r})).data}))}}class w extends r{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new g(this.transport))}get me(){return this._me||(this._me=new _(this.transport))}}t("UsersHandler",w);class b{constructor(t){this.random={string:(t=32)=>e(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,r)=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:r})).data}))},this.transport=t}sort(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:r,to:n})}))}revert(t){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var x;t("UtilsHandler",b),t("Meta",x),function(t){t.TOTAL_COUNT="total_count",t.FILTER_COUNT="filter_count"}(x||t("Meta",x={}));class k extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,k.prototype)}}t("TransportError",k);class O{get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}t("BaseStorage",O);class E extends O{constructor(t=""){super(),this.values={},this.prefix=t}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}t("MemoryStorage",E);class S extends O{constructor(t=""){super(),this.prefix=t}get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}t("LocalStorage",S);var T={exports:{}},j=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},R=j,A=Object.prototype.toString;function U(t){return"[object Array]"===A.call(t)}function $(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function C(t){if("[object Object]"!==A.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function q(t){return"[object Function]"===A.call(t)}function P(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),U(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var B={isArray:U,isArrayBuffer:function(t){return"[object ArrayBuffer]"===A.call(t)},isBuffer:function(t){return null!==t&&!$(t)&&null!==t.constructor&&!$(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:N,isPlainObject:C,isUndefined:$,isDate:function(t){return"[object Date]"===A.call(t)},isFile:function(t){return"[object File]"===A.call(t)},isBlob:function(t){return"[object Blob]"===A.call(t)},isFunction:q,isStream:function(t){return N(t)&&q(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:P,merge:function t(){var e={};function r(r,n){C(e[n])&&C(r)?e[n]=t(e[n],r):C(r)?e[n]=t({},r):U(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)P(arguments[n],r);return e},extend:function(t,e,r){return P(e,(function(e,n){t[n]=r&&"function"==typeof e?R(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},H=B;function L(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var I=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(H.isURLSearchParams(e))n=e.toString();else{var s=[];H.forEach(e,(function(t,e){null!=t&&(H.isArray(t)?e+="[]":t=[t],H.forEach(t,(function(t){H.isDate(t)?t=t.toISOString():H.isObject(t)&&(t=JSON.stringify(t)),s.push(L(e)+"="+L(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},D=B;function M(){this.handlers=[]}M.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},M.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},M.prototype.forEach=function(t){D.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var F=M,z=B,J=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,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,status:this.response&&this.response.status?this.response.status:null}},t},W=J,V=function(t,e,r,n,s){var i=new Error(t);return W(i,e,r,n,s)},X=V,K=B,G=K.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),K.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),K.isString(n)&&o.push("path="+n),K.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.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(){}},Q=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},Y=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},Z=B,tt=["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"],et=B,rt=et.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(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 t=n(window.location.href),function(e){var r=et.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function nt(t){this.message=t}nt.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},nt.prototype.__CANCEL__=!0;var st=nt,it=B,ot=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(X("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},at=G,ut=I,dt=function(t,e){return t&&!Q(e)?Y(t,e):e},ht=function(t){var e,r,n,s={};return t?(Z.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=Z.trim(t.substr(0,n)).toLowerCase(),r=Z.trim(t.substr(n+1)),e){if(s[e]&&tt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ct=rt,lt=V,pt=kt,ft=st,vt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}it.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+h)}var c=dt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?ht(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};ot((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ut(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(lt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(lt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||pt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(lt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},it.isStandardBrowserEnv()){var p=(t.withCredentials||ct(c))&&t.xsrfCookieName?at.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&it.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),it.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new ft("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},mt=B,gt=function(t,e){z.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},yt=J,_t={"Content-Type":"application/x-www-form-urlencoded"};function wt(t,e){!mt.isUndefined(t)&&mt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var bt,xt={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(bt=vt),bt),transformRequest:[function(t,e){return gt(e,"Accept"),gt(e,"Content-Type"),mt.isFormData(t)||mt.isArrayBuffer(t)||mt.isBuffer(t)||mt.isStream(t)||mt.isFile(t)||mt.isBlob(t)?t:mt.isArrayBufferView(t)?t.buffer:mt.isURLSearchParams(t)?(wt(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):mt.isObject(t)||e&&"application/json"===e["Content-Type"]?(wt(e,"application/json"),function(t,e,r){if(mt.isString(t))try{return(e||JSON.parse)(t),mt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||xt.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&mt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw yt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};mt.forEach(["delete","get","head"],(function(t){xt.headers[t]={}})),mt.forEach(["post","put","patch"],(function(t){xt.headers[t]=mt.merge(_t)}));var kt=xt,Ot=B,Et=kt,St=function(t){return!(!t||!t.__CANCEL__)},Tt=B,jt=function(t,e,r){var n=this||Et;return Ot.forEach(r,(function(r){t=r.call(n,t,e)})),t},Rt=St,At=kt,Ut=st;function $t(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ut("canceled")}var Nt=B,Ct=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},qt="0.24.0",Pt=qt,Bt={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Bt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Ht={};Bt.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Pt+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Ht[s]&&(Ht[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Lt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Bt},It=B,Dt=I,Mt=F,Ft=function(t){return $t(t),t.headers=t.headers||{},t.data=jt.call(t,t.data,t.headers,t.transformRequest),t.headers=Tt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Tt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||At.adapter)(t).then((function(e){return $t(t),e.data=jt.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return Rt(e)||($t(t),e&&e.response&&(e.response.data=jt.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},zt=Ct,Jt=Lt,Wt=Jt.validators;function Vt(t){this.defaults=t,this.interceptors={request:new Mt,response:new Mt}}Vt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=zt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Jt.assertOptions(e,{silentJSONParsing:Wt.transitional(Wt.boolean),forcedJSONParsing:Wt.transitional(Wt.boolean),clarifyTimeoutError:Wt.transitional(Wt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Ft,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Ft(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Vt.prototype.getUri=function(t){return t=zt(this.defaults,t),Dt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},It.forEach(["delete","get","head","options"],(function(t){Vt.prototype[t]=function(e,r){return this.request(zt(r||{},{method:t,url:e,data:(r||{}).data}))}})),It.forEach(["post","put","patch"],(function(t){Vt.prototype[t]=function(e,r,n){return this.request(zt(n||{},{method:t,url:e,data:r}))}}));var Xt=Vt,Kt=st;function Gt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Kt(t),e(r.reason))}))}Gt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Gt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Gt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Gt.source=function(){var t;return{token:new Gt((function(e){t=e})),cancel:t}};var Qt=Gt,Yt=B,Zt=j,te=Xt,ee=Ct;var re=function t(e){var r=new te(e),n=Zt(te.prototype.request,r);return Yt.extend(n,te.prototype,r),Yt.extend(n,r),n.create=function(r){return t(ee(e,r))},n}(kt);re.Axios=te,re.Cancel=st,re.CancelToken=Qt,re.isCancel=St,re.VERSION=qt,re.all=function(t){return Promise.all(t)},re.spread=function(t){return function(e){return t.apply(null,e)}},re.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},T.exports=re,T.exports.default=re;var ne=T.exports;class se{constructor(t,e,r=(()=>Promise.resolve())){this._url=t,this._storage=e,this._axios=null,this._refresh=r,this.url=t}get url(){return this._url}set url(t){this._url=t,this._axios=ne.create({baseURL:t,withCredentials:!0})}get axios(){return this._axios}get requests(){return{intercept:(t,e)=>{const r=this._axios.interceptors.request.use(t,e);return{eject:()=>{this._axios.interceptors.request.eject(r)}}}}}get responses(){return{intercept:(t,e)=>{const r=this._axios.interceptors.response.use(t,e);return{eject:()=>{this._axios.interceptors.response.eject(r)}}}}}request(t,r,n,s){var i,o,a,u,d,h,c,l,p;return e(this,void 0,void 0,(function*(){try{(s=s||{}).sendAuthorizationHeaders=null===(i=s.sendAuthorizationHeaders)||void 0===i||i,s.refreshTokenIfNeeded=null===(o=s.refreshTokenIfNeeded)||void 0===o||o,s.headers=null!==(a=s.headers)&&void 0!==a?a:{},s.onUploadProgress=null!==(u=s.onUploadProgress)&&void 0!==u?u:void 0,s.refreshTokenIfNeeded&&(yield this._refresh());const e={method:t,url:r,data:n,params:s.params,headers:s.headers,onUploadProgress:s.onUploadProgress},d=this._storage.auth_token,h=this._storage.auth_expires;s.sendAuthorizationHeaders&&d&&(null!==h&&h>Date.now()||null===h)&&(d.startsWith("Bearer ")?e.headers.Authorization=d:e.headers.Authorization=`Bearer ${d}`);const c=yield this.axios.request(e),l=c.data,p={raw:c.data,status:c.status,statusText:c.statusText,headers:c.headers,data:l.data,meta:l.meta,errors:l.errors};if(l.errors)throw new k(null,p);return p}catch(t){if(!t||t instanceof Error==!1)throw t;if(ne.isAxiosError(t)){const e=null===(d=t.response)||void 0===d?void 0:d.data;throw new k(t,{raw:null===(h=t.response)||void 0===h?void 0:h.data,status:null===(c=t.response)||void 0===c?void 0:c.status,statusText:null===(l=t.response)||void 0===l?void 0:l.statusText,headers:null===(p=t.response)||void 0===p?void 0:p.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new k(t)}}))}get(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,r)}))}head(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,r)}))}options(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,r)}))}delete(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("delete",t,r,n)}))}put(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("put",t,r,n)}))}post(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("post",t,r,n)}))}patch(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("patch",t,r,n)}))}}t("AxiosTransport",se);class ie{constructor(t){this.transport=t}request(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:r})}))}reset(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:r})}))}}class oe{constructor(t){this.func=t,this.debounced=[],this.debouncing=!1}debounce(...t){return e(this,void 0,void 0,(function*(){return this.debouncing?yield new Promise(((t,e)=>{this.debounced.push({resolve:e=>t(e),reject:t=>e(t)})})):(this.debouncing=!0,new Promise(((e,r)=>{this.func(...t).then((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.resolve(t)))})).catch((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.reject(t)))}))})))}))}}class ae{constructor(t,e,r){var n,s,i,o,a;this.options=r||{},this.options.mode=(null==r?void 0:r.mode)||("undefined"!=typeof window?"cookie":"json"),this.options.refresh=(null==r?void 0:r.refresh)||{auto:!1,time:3e4},this.options.refresh.auto=null!==(s=null===(n=this.options.refresh)||void 0===n?void 0:n.auto)&&void 0!==s&&s,this.options.refresh.time=null!==(o=null===(i=this.options.refresh)||void 0===i?void 0:i.time)&&void 0!==o?o:3e4,this.transport=t,this.storage=e,this.timer=!1,this.refresher=new oe(this.refreshToken.bind(this));try{this.updateRefresh(null===(a=this.options)||void 0===a?void 0:a.refresh)}catch(t){}}get token(){return this.storage.auth_token}get password(){return this.passwords=this.passwords||new ie(this.transport)}get expiring(){var t,e;const r=this.storage.auth_expires;if(null===r)return!1;return r-(null!==(e=null===(t=this.options.refresh)||void 0===t?void 0:t.time)&&void 0!==e?e:0)<=Date.now()}refreshToken(t=!1){var r;return e(this,void 0,void 0,(function*(){if(!t&&!this.expiring)return!1;const e=yield this.transport.post("/auth/refresh",{refresh_token:"json"===this.options.mode?this.storage.auth_refresh_token:void 0},{refreshTokenIfNeeded:!1});return this.updateStorage(e.data),this.updateRefresh(),{access_token:e.data.access_token,refresh_token:null===(r=e.data)||void 0===r?void 0:r.refresh_token,expires:e.data.expires}}))}updateStorage(t){var e;this.storage.auth_token=t.access_token,this.storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,t.expires?this.storage.auth_expires=Date.now()+t.expires:this.storage.auth_expires=null}updateRefresh(t){var e,r;const n=this.storage.auth_expires;if(null===n)return void clearTimeout(this.timer);t&&(this.options.refresh.auto=null!==(e=t.auto)&&void 0!==e?e:this.options.refresh.auto,this.options.refresh.time=null!==(r=t.time)&&void 0!==r?r:this.options.refresh.time),clearTimeout(this.timer);let s=n-this.options.refresh.time-Date.now();if(s<0){if(n<Date.now())return;s=0}this.options.refresh.auto&&(this.timer=setTimeout((()=>{this.refresh().then((()=>{})).catch((()=>{}))}),s))}refresh(t=!1){return e(this,void 0,void 0,(function*(){return yield this.refresher.debounce(t)}))}login(t,r){var n;return e(this,void 0,void 0,(function*(){r=r||{};const e=yield this.transport.post("/auth/login",Object.assign({mode:this.options.mode},t),{refreshTokenIfNeeded:!1,sendAuthorizationHeaders:!1});return this.updateStorage(e.data),this.updateRefresh(r.refresh),{access_token:e.data.access_token,refresh_token:null===(n=e.data)||void 0===n?void 0:n.refresh_token,expires:e.data.expires}}))}static(t){return e(this,void 0,void 0,(function*(){return yield this.transport.get("/users/me",{params:{access_token:t}}),this.storage.auth_token=t,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,!0}))}logout(){return e(this,void 0,void 0,(function*(){let t;"json"===this.options.mode&&(t=this.storage.auth_refresh_token||void 0),yield this.transport.post("/auth/logout",{refresh_token:t},{refreshTokenIfNeeded:!1}),this.storage.auth_token=null,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,clearTimeout(this.timer)}))}}t("Auth",ae);class ue{constructor(t){this.transport=t}request(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:r,variables:void 0===n?{}:n})}))}items(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,r)}))}system(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,r)}))}}t("Directus",class{constructor(t,r){this._storage=(null==r?void 0:r.storage)||("undefined"!=typeof window?new S:new E),this._transport=(null==r?void 0:r.transport)||new se(t,this._storage,(()=>e(this,void 0,void 0,(function*(){yield this._auth.refresh()})))),this._auth=(null==r?void 0:r.auth)||new ae(this._transport,this._storage),this._items={},this._singletons={}}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new s(this.transport))}get collections(){return this._collections||(this._collections=new i(this.transport))}get fields(){return this._fields||(this._fields=new o(this.transport))}get files(){return this._files||(this._files=new a(this.transport))}get folders(){return this._folders||(this._folders=new u(this.transport))}get permissions(){return this._permissions||(this._permissions=new d(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new c(this.transport))}get revisions(){return this._revisions||(this._revisions=new l(this.transport))}get roles(){return this._roles||(this._roles=new p(this.transport))}get users(){return this._users||(this._users=new w(this.transport))}get settings(){return this._settings||(this._settings=new m(this.transport))}get server(){return this._server||(this._server=new f(this.transport))}get utils(){return this._utils||(this._utils=new b(this.transport))}get graphql(){return this._graphql||(this._graphql=new ue(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new v(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new r(t,this.transport))}})}}})); | ||
//# sourceMappingURL=sdk.system.min.js.map |
@@ -15,3 +15,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Directus={})}(this,(function(t){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function e(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class r{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:r})).data}))}readMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:r})).data}))}createMany(t,r){return e(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:r})}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,r,{params:n})).data}))}updateMany(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:r},{params:n})}))}updateByQuery(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:r},{params:n})}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}class n{constructor(t){this.transport=t}create(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:r})).data}))}delete(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}class s extends r{constructor(t){super("directus_activity",t),this._comments=new n(this.transport)}get comments(){return this._comments}}class i{constructor(t){this.transport=t}readOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,r,{params:n})).data}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}class o{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,r)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${r}`,n)).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${r}`)}))}}class a extends r{constructor(t){super("directus_files",t)}}class u extends r{constructor(t){super("directus_folders",t)}}class d extends r{constructor(t){super("directus_permissions",t)}}class h extends r{constructor(t){super("directus_presets",t)}}class c{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${r}`,{params:n})).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${r}`)}))}}class l extends r{constructor(t){super("directus_revisions",t)}}class p extends r{constructor(t){super("directus_roles",t)}}class f{constructor(t){this.transport=t}ping(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class v{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:r})).data}))}}class m extends v{constructor(t){super("directus_settings",t)}}class g{constructor(t){this.transport=t}send(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:r,invite_url:n})}))}accept(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:r})}))}}class y{constructor(t){this.transport=t}generate(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:r})}))}disable(t){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class _{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new y(this._transport))}read(t){return e(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:r})).data}))}}class w extends r{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new g(this.transport))}get me(){return this._me||(this._me=new _(this.transport))}}class b{constructor(t){this.random={string:(t=32)=>e(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,r)=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:r})).data}))},this.transport=t}sort(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:r,to:n})}))}revert(t){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var x;t.Meta=void 0,(x=t.Meta||(t.Meta={})).TOTAL_COUNT="total_count",x.FILTER_COUNT="filter_count";class k extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,k.prototype)}}class O{get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class E extends O{constructor(t=""){super(),this.values={},this.prefix=t}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class S extends O{constructor(t=""){super(),this.prefix=t}get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var T={exports:{}},j=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},R=j,A=Object.prototype.toString;function U(t){return"[object Array]"===A.call(t)}function $(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function C(t){if("[object Object]"!==A.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function q(t){return"[object Function]"===A.call(t)}function P(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),U(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var B={isArray:U,isArrayBuffer:function(t){return"[object ArrayBuffer]"===A.call(t)},isBuffer:function(t){return null!==t&&!$(t)&&null!==t.constructor&&!$(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:N,isPlainObject:C,isUndefined:$,isDate:function(t){return"[object Date]"===A.call(t)},isFile:function(t){return"[object File]"===A.call(t)},isBlob:function(t){return"[object Blob]"===A.call(t)},isFunction:q,isStream:function(t){return N(t)&&q(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:P,merge:function t(){var e={};function r(r,n){C(e[n])&&C(r)?e[n]=t(e[n],r):C(r)?e[n]=t({},r):U(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)P(arguments[n],r);return e},extend:function(t,e,r){return P(e,(function(e,n){t[n]=r&&"function"==typeof e?R(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},H=B;function L(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var I=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(H.isURLSearchParams(e))n=e.toString();else{var s=[];H.forEach(e,(function(t,e){null!=t&&(H.isArray(t)?e+="[]":t=[t],H.forEach(t,(function(t){H.isDate(t)?t=t.toISOString():H.isObject(t)&&(t=JSON.stringify(t)),s.push(L(e)+"="+L(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},D=B;function M(){this.handlers=[]}M.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},M.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},M.prototype.forEach=function(t){D.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var F=M,z=B,J=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,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,status:this.response&&this.response.status?this.response.status:null}},t},W=J,V=function(t,e,r,n,s){var i=new Error(t);return W(i,e,r,n,s)},X=V,K=B,G=K.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),K.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),K.isString(n)&&o.push("path="+n),K.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.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(){}},Q=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},Y=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},Z=B,tt=["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"],et=B,rt=et.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(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 t=n(window.location.href),function(e){var r=et.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function nt(t){this.message=t}nt.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},nt.prototype.__CANCEL__=!0;var st=nt,it=B,ot=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(X("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},at=G,ut=I,dt=function(t,e){return t&&!Q(e)?Y(t,e):e},ht=function(t){var e,r,n,s={};return t?(Z.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=Z.trim(t.substr(0,n)).toLowerCase(),r=Z.trim(t.substr(n+1)),e){if(s[e]&&tt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ct=rt,lt=V,pt=kt,ft=st,vt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}it.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+h)}var c=dt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?ht(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};ot((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ut(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(lt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(lt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||pt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(lt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},it.isStandardBrowserEnv()){var p=(t.withCredentials||ct(c))&&t.xsrfCookieName?at.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&it.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),it.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new ft("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},mt=B,gt=function(t,e){z.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},yt=J,_t={"Content-Type":"application/x-www-form-urlencoded"};function wt(t,e){!mt.isUndefined(t)&&mt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var bt,xt={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(bt=vt),bt),transformRequest:[function(t,e){return gt(e,"Accept"),gt(e,"Content-Type"),mt.isFormData(t)||mt.isArrayBuffer(t)||mt.isBuffer(t)||mt.isStream(t)||mt.isFile(t)||mt.isBlob(t)?t:mt.isArrayBufferView(t)?t.buffer:mt.isURLSearchParams(t)?(wt(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):mt.isObject(t)||e&&"application/json"===e["Content-Type"]?(wt(e,"application/json"),function(t,e,r){if(mt.isString(t))try{return(e||JSON.parse)(t),mt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||xt.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&mt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw yt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};mt.forEach(["delete","get","head"],(function(t){xt.headers[t]={}})),mt.forEach(["post","put","patch"],(function(t){xt.headers[t]=mt.merge(_t)}));var kt=xt,Ot=B,Et=kt,St=function(t){return!(!t||!t.__CANCEL__)},Tt=B,jt=function(t,e,r){var n=this||Et;return Ot.forEach(r,(function(r){t=r.call(n,t,e)})),t},Rt=St,At=kt,Ut=st;function $t(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ut("canceled")}var Nt=B,Ct=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},qt="0.23.0",Pt=qt,Bt={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Bt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Ht={};Bt.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Pt+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Ht[s]&&(Ht[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Lt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Bt},It=B,Dt=I,Mt=F,Ft=function(t){return $t(t),t.headers=t.headers||{},t.data=jt.call(t,t.data,t.headers,t.transformRequest),t.headers=Tt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Tt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||At.adapter)(t).then((function(e){return $t(t),e.data=jt.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return Rt(e)||($t(t),e&&e.response&&(e.response.data=jt.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},zt=Ct,Jt=Lt,Wt=Jt.validators;function Vt(t){this.defaults=t,this.interceptors={request:new Mt,response:new Mt}}Vt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=zt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Jt.assertOptions(e,{silentJSONParsing:Wt.transitional(Wt.boolean),forcedJSONParsing:Wt.transitional(Wt.boolean),clarifyTimeoutError:Wt.transitional(Wt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Ft,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Ft(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Vt.prototype.getUri=function(t){return t=zt(this.defaults,t),Dt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},It.forEach(["delete","get","head","options"],(function(t){Vt.prototype[t]=function(e,r){return this.request(zt(r||{},{method:t,url:e,data:(r||{}).data}))}})),It.forEach(["post","put","patch"],(function(t){Vt.prototype[t]=function(e,r,n){return this.request(zt(n||{},{method:t,url:e,data:r}))}}));var Xt=Vt,Kt=st;function Gt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Kt(t),e(r.reason))}))}Gt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Gt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Gt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Gt.source=function(){var t;return{token:new Gt((function(e){t=e})),cancel:t}};var Qt=Gt,Yt=B,Zt=j,te=Xt,ee=Ct;var re=function t(e){var r=new te(e),n=Zt(te.prototype.request,r);return Yt.extend(n,te.prototype,r),Yt.extend(n,r),n.create=function(r){return t(ee(e,r))},n}(kt);re.Axios=te,re.Cancel=st,re.CancelToken=Qt,re.isCancel=St,re.VERSION=qt,re.all=function(t){return Promise.all(t)},re.spread=function(t){return function(e){return t.apply(null,e)}},re.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},T.exports=re,T.exports.default=re;var ne=T.exports;class se{constructor(t,e,r=(()=>Promise.resolve())){this._url=t,this._storage=e,this._axios=null,this._refresh=r,this.url=t}get url(){return this._url}set url(t){this._url=t,this._axios=ne.create({baseURL:t,withCredentials:!0})}get axios(){return this._axios}get requests(){return{intercept:(t,e)=>{const r=this._axios.interceptors.request.use(t,e);return{eject:()=>{this._axios.interceptors.request.eject(r)}}}}}get responses(){return{intercept:(t,e)=>{const r=this._axios.interceptors.response.use(t,e);return{eject:()=>{this._axios.interceptors.response.eject(r)}}}}}request(t,r,n,s){var i,o,a,u,d,h,c,l,p;return e(this,void 0,void 0,(function*(){try{(s=s||{}).sendAuthorizationHeaders=null===(i=s.sendAuthorizationHeaders)||void 0===i||i,s.refreshTokenIfNeeded=null===(o=s.refreshTokenIfNeeded)||void 0===o||o,s.headers=null!==(a=s.headers)&&void 0!==a?a:{},s.onUploadProgress=null!==(u=s.onUploadProgress)&&void 0!==u?u:void 0,s.refreshTokenIfNeeded&&(yield this._refresh());const e={method:t,url:r,data:n,params:s.params,headers:s.headers,onUploadProgress:s.onUploadProgress},d=this._storage.auth_token,h=this._storage.auth_expires;s.sendAuthorizationHeaders&&d&&(null!==h&&h>Date.now()||null===h)&&(d.startsWith("Bearer ")?e.headers.Authorization=d:e.headers.Authorization=`Bearer ${d}`);const c=yield this.axios.request(e),l=c.data,p={raw:c.data,status:c.status,statusText:c.statusText,headers:c.headers,data:l.data,meta:l.meta,errors:l.errors};if(l.errors)throw new k(null,p);return p}catch(t){if(!t||t instanceof Error==!1)throw t;if(ne.isAxiosError(t)){const e=null===(d=t.response)||void 0===d?void 0:d.data;throw new k(t,{raw:null===(h=t.response)||void 0===h?void 0:h.data,status:null===(c=t.response)||void 0===c?void 0:c.status,statusText:null===(l=t.response)||void 0===l?void 0:l.statusText,headers:null===(p=t.response)||void 0===p?void 0:p.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new k(t)}}))}get(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,r)}))}head(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,r)}))}options(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,r)}))}delete(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("delete",t,r,n)}))}put(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("put",t,r,n)}))}post(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("post",t,r,n)}))}patch(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("patch",t,r,n)}))}}class ie{constructor(t){this.transport=t}request(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:r})}))}reset(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:r})}))}}class oe{constructor(t){this.func=t,this.debounced=[],this.debouncing=!1}debounce(...t){return e(this,void 0,void 0,(function*(){return this.debouncing?yield new Promise(((t,e)=>{this.debounced.push({resolve:e=>t(e),reject:t=>e(t)})})):(this.debouncing=!0,new Promise(((e,r)=>{this.func(...t).then((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.resolve(t)))})).catch((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.reject(t)))}))})))}))}}class ae{constructor(t,e,r){var n,s,i,o,a;this.options=r||{},this.options.mode=(null==r?void 0:r.mode)||("undefined"!=typeof window?"cookie":"json"),this.options.refresh=(null==r?void 0:r.refresh)||{auto:!1,time:3e4},this.options.refresh.auto=null!==(s=null===(n=this.options.refresh)||void 0===n?void 0:n.auto)&&void 0!==s&&s,this.options.refresh.time=null!==(o=null===(i=this.options.refresh)||void 0===i?void 0:i.time)&&void 0!==o?o:3e4,this.transport=t,this.storage=e,this.timer=!1,this.refresher=new oe(this.refreshToken.bind(this));try{this.updateRefresh(null===(a=this.options)||void 0===a?void 0:a.refresh)}catch(t){}}get token(){return this.storage.auth_token}get password(){return this.passwords=this.passwords||new ie(this.transport)}get expiring(){var t,e;const r=this.storage.auth_expires;if(null===r)return!1;return r-(null!==(e=null===(t=this.options.refresh)||void 0===t?void 0:t.time)&&void 0!==e?e:0)<=Date.now()}refreshToken(t=!1){var r;return e(this,void 0,void 0,(function*(){if(!t&&!this.expiring)return!1;const e=yield this.transport.post("/auth/refresh",{refresh_token:"json"===this.options.mode?this.storage.auth_refresh_token:void 0},{refreshTokenIfNeeded:!1});return this.updateStorage(e.data),this.updateRefresh(),{access_token:e.data.access_token,refresh_token:null===(r=e.data)||void 0===r?void 0:r.refresh_token,expires:e.data.expires}}))}updateStorage(t){var e;this.storage.auth_token=t.access_token,this.storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,t.expires?this.storage.auth_expires=Date.now()+t.expires:this.storage.auth_expires=null}updateRefresh(t){var e,r;const n=this.storage.auth_expires;if(null===n)return void clearTimeout(this.timer);t&&(this.options.refresh.auto=null!==(e=t.auto)&&void 0!==e?e:this.options.refresh.auto,this.options.refresh.time=null!==(r=t.time)&&void 0!==r?r:this.options.refresh.time),clearTimeout(this.timer);let s=n-this.options.refresh.time-Date.now();if(s<0){if(n<Date.now())return;s=0}this.options.refresh.auto&&(this.timer=setTimeout((()=>{this.refresh().then((()=>{})).catch((()=>{}))}),s))}refresh(t=!1){return e(this,void 0,void 0,(function*(){return yield this.refresher.debounce(t)}))}login(t,r){var n;return e(this,void 0,void 0,(function*(){r=r||{};const e=yield this.transport.post("/auth/login",Object.assign({mode:this.options.mode},t),{refreshTokenIfNeeded:!1,sendAuthorizationHeaders:!1});return this.updateStorage(e.data),this.updateRefresh(r.refresh),{access_token:e.data.access_token,refresh_token:null===(n=e.data)||void 0===n?void 0:n.refresh_token,expires:e.data.expires}}))}static(t){return e(this,void 0,void 0,(function*(){return yield this.transport.get("/users/me",{params:{access_token:t}}),this.storage.auth_token=t,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,!0}))}logout(){return e(this,void 0,void 0,(function*(){let t;"json"===this.options.mode&&(t=this.storage.auth_refresh_token||void 0),yield this.transport.post("/auth/logout",{refresh_token:t},{refreshTokenIfNeeded:!1}),this.storage.auth_token=null,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,clearTimeout(this.timer)}))}}class ue{constructor(t){this.transport=t}request(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:r,variables:void 0===n?{}:n})}))}items(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,r)}))}system(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,r)}))}}t.ActivityHandler=s,t.Auth=ae,t.AxiosTransport=se,t.BaseStorage=O,t.CollectionsHandler=i,t.CommentsHandler=n,t.Directus=class{constructor(t,r){this._storage=(null==r?void 0:r.storage)||("undefined"!=typeof window?new S:new E),this._transport=(null==r?void 0:r.transport)||new se(t,this._storage,(()=>e(this,void 0,void 0,(function*(){yield this._auth.refresh()})))),this._auth=(null==r?void 0:r.auth)||new ae(this._transport,this._storage),this._items={},this._singletons={}}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new s(this.transport))}get collections(){return this._collections||(this._collections=new i(this.transport))}get fields(){return this._fields||(this._fields=new o(this.transport))}get files(){return this._files||(this._files=new a(this.transport))}get folders(){return this._folders||(this._folders=new u(this.transport))}get permissions(){return this._permissions||(this._permissions=new d(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new c(this.transport))}get revisions(){return this._revisions||(this._revisions=new l(this.transport))}get roles(){return this._roles||(this._roles=new p(this.transport))}get users(){return this._users||(this._users=new w(this.transport))}get settings(){return this._settings||(this._settings=new m(this.transport))}get server(){return this._server||(this._server=new f(this.transport))}get utils(){return this._utils||(this._utils=new b(this.transport))}get graphql(){return this._graphql||(this._graphql=new ue(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new v(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new r(t,this.transport))}},t.FieldsHandler=o,t.FilesHandler=a,t.FoldersHandler=u,t.ItemsHandler=r,t.LocalStorage=S,t.MemoryStorage=E,t.PermissionsHandler=d,t.PresetsHandler=h,t.RelationsHandler=c,t.RevisionsHandler=l,t.RolesHandler=p,t.ServerHandler=f,t.SettingsHandler=m,t.TransportError=k,t.UsersHandler=w,t.UtilsHandler=b,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
***************************************************************************** */function e(t,e,r,n){return new(r||(r=Promise))((function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))}class r{constructor(t,e){this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}/${encodeURI(t)}`,{params:r})).data}))}readMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.get(`${this.endpoint}`,{params:t});return{data:e,meta:r}}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`${this.endpoint}`,t,{params:r})).data}))}createMany(t,r){return e(this,void 0,void 0,(function*(){return yield this.transport.post(`${this.endpoint}`,t,{params:r})}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}/${encodeURI(t)}`,r,{params:n})).data}))}updateMany(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{keys:t,data:r},{params:n})}))}updateByQuery(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.patch(`${this.endpoint}`,{query:t,data:r},{params:n})}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}/${encodeURI(t)}`)}))}deleteMany(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`${this.endpoint}`,t)}))}}class n{constructor(t){this.transport=t}create(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/activity/comment",t)).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/activity/comment/${encodeURI(t)}`,{comment:r})).data}))}delete(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/activity/comment/${encodeURI(t)}`)}))}}class s extends r{constructor(t){super("directus_activity",t),this._comments=new n(this.transport)}get comments(){return this._comments}}class i{constructor(t){this.transport=t}readOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/collections/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){const{data:t,meta:e}=yield this.transport.get("/collections");return{data:t,meta:e}}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/collections",t)).data}))}createMany(t){return e(this,void 0,void 0,(function*(){const{data:e,meta:r}=yield this.transport.post("/collections",t);return{data:e,meta:r}}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/collections/${t}`,r,{params:n})).data}))}deleteOne(t){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/collections/${t}`)}))}}class o{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/fields/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/fields")).data}))}createOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.post(`/fields/${t}`,r)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/fields/${t}/${r}`,n)).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/fields/${t}/${r}`)}))}}class a extends r{constructor(t){super("directus_files",t)}}class u extends r{constructor(t){super("directus_folders",t)}}class d extends r{constructor(t){super("directus_permissions",t)}}class h extends r{constructor(t){super("directus_presets",t)}}class c{constructor(t){this.transport=t}readOne(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}/${r}`)).data}))}readMany(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`/relations/${t}`)).data}))}readAll(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/relations")).data}))}createOne(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/relations",t)).data}))}updateOne(t,r,n){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`/relations/${t}/${r}`,{params:n})).data}))}deleteOne(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.delete(`/relations/${t}/${r}`)}))}}class l extends r{constructor(t){super("directus_revisions",t)}}class p extends r{constructor(t){super("directus_roles",t)}}class f{constructor(t){this.transport=t}ping(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/ping")).raw}))}info(){return e(this,void 0,void 0,(function*(){return(yield this.transport.get("/server/info")).data}))}}class v{constructor(t,e){this.collection=t,this.transport=e,this.endpoint=t.startsWith("directus_")?`/${t.substring(9)}`:`/items/${t}`}read(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.get(`${this.endpoint}`,{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this.transport.patch(`${this.endpoint}`,t,{params:r})).data}))}}class m extends v{constructor(t){super("directus_settings",t)}}class g{constructor(t){this.transport=t}send(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite",{email:t,role:r,invite_url:n})}))}accept(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/invite/accept",{token:t,password:r})}))}}class y{constructor(t){this.transport=t}generate(t){return e(this,void 0,void 0,(function*(){return(yield this.transport.post("/users/me/tfa/generate",{password:t})).data}))}enable(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/enable",{secret:t,otp:r})}))}disable(t){return e(this,void 0,void 0,(function*(){yield this.transport.post("/users/me/tfa/disable",{otp:t})}))}}class _{constructor(t){this._transport=t}get tfa(){return this._tfa||(this._tfa=new y(this._transport))}read(t){return e(this,void 0,void 0,(function*(){return(yield this._transport.get("/users/me",{params:t})).data}))}update(t,r){return e(this,void 0,void 0,(function*(){return(yield this._transport.patch("/users/me",t,{params:r})).data}))}}class w extends r{constructor(t){super("directus_users",t)}get invites(){return this._invites||(this._invites=new g(this.transport))}get me(){return this._me||(this._me=new _(this.transport))}}class b{constructor(t){this.random={string:(t=32)=>e(this,void 0,void 0,(function*(){return(yield this.transport.get("/utils/random/string",{params:{length:t}})).data}))},this.hash={generate:t=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/generate",{string:t})).data})),verify:(t,r)=>e(this,void 0,void 0,(function*(){return(yield this.transport.post("/utils/hash/verify",{string:t,hash:r})).data}))},this.transport=t}sort(t,r,n){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/sort/${encodeURI(t)}`,{item:r,to:n})}))}revert(t){return e(this,void 0,void 0,(function*(){yield this.transport.post(`/utils/revert/${encodeURI(t)}`)}))}}var x;t.Meta=void 0,(x=t.Meta||(t.Meta={})).TOTAL_COUNT="total_count",x.FILTER_COUNT="filter_count";class k extends Error{constructor(t,e){var r,n;(null===(r=null==e?void 0:e.errors)||void 0===r?void 0:r.length)?super(null===(n=null==e?void 0:e.errors[0])||void 0===n?void 0:n.message):super((null==t?void 0:t.message)||"Unknown transport error"),this.parent=t,this.response=e,this.errors=(null==e?void 0:e.errors)||[],Object.values(e||{}).some((t=>void 0!==t))||(this.response=void 0),Object.setPrototypeOf(this,k.prototype)}}class O{get auth_token(){return this.get("auth_token")}set auth_token(t){null===t?this.delete("auth_token"):this.set("auth_token",t)}get auth_expires(){const t=this.get("auth_expires");return null===t?null:parseInt(t)}set auth_expires(t){null===t?this.delete("auth_expires"):this.set("auth_expires",t.toString())}get auth_refresh_token(){return this.get("auth_refresh_token")}set auth_refresh_token(t){null===t?this.delete("auth_refresh_token"):this.set("auth_refresh_token",t)}}class E extends O{constructor(t=""){super(),this.values={},this.prefix=t}get(t){const e=this.key(t);return e in this.values?this.values[e]:null}set(t,e){return this.values[this.key(t)]=e,e}delete(t){const e=this.key(t),r=this.get(t);return e in this.values&&delete this.values[e],r}key(t){return`${this.prefix}${t}`}}class S extends O{constructor(t=""){super(),this.prefix=t}get(t){const e=localStorage.getItem(this.key(t));return null!==e?e:null}set(t,e){return localStorage.setItem(this.key(t),e),e}delete(t){const e=this.key(t),r=this.get(e);return r&&localStorage.removeItem(e),r}key(t){return`${this.prefix}${t}`}}var T={exports:{}},j=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}},R=j,A=Object.prototype.toString;function U(t){return"[object Array]"===A.call(t)}function $(t){return void 0===t}function N(t){return null!==t&&"object"==typeof t}function C(t){if("[object Object]"!==A.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function q(t){return"[object Function]"===A.call(t)}function P(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),U(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}var B={isArray:U,isArrayBuffer:function(t){return"[object ArrayBuffer]"===A.call(t)},isBuffer:function(t){return null!==t&&!$(t)&&null!==t.constructor&&!$(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:N,isPlainObject:C,isUndefined:$,isDate:function(t){return"[object Date]"===A.call(t)},isFile:function(t){return"[object File]"===A.call(t)},isBlob:function(t){return"[object Blob]"===A.call(t)},isFunction:q,isStream:function(t){return N(t)&&q(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:P,merge:function t(){var e={};function r(r,n){C(e[n])&&C(r)?e[n]=t(e[n],r):C(r)?e[n]=t({},r):U(r)?e[n]=r.slice():e[n]=r}for(var n=0,s=arguments.length;n<s;n++)P(arguments[n],r);return e},extend:function(t,e,r){return P(e,(function(e,n){t[n]=r&&"function"==typeof e?R(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}},H=B;function L(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var I=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(H.isURLSearchParams(e))n=e.toString();else{var s=[];H.forEach(e,(function(t,e){null!=t&&(H.isArray(t)?e+="[]":t=[t],H.forEach(t,(function(t){H.isDate(t)?t=t.toISOString():H.isObject(t)&&(t=JSON.stringify(t)),s.push(L(e)+"="+L(t))})))})),n=s.join("&")}if(n){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t},D=B;function M(){this.handlers=[]}M.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},M.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},M.prototype.forEach=function(t){D.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var F=M,z=B,J=function(t,e,r,n,s){return t.config=e,r&&(t.code=r),t.request=n,t.response=s,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,status:this.response&&this.response.status?this.response.status:null}},t},W=J,V=function(t,e,r,n,s){var i=new Error(t);return W(i,e,r,n,s)},X=V,K=B,G=K.isStandardBrowserEnv()?{write:function(t,e,r,n,s,i){var o=[];o.push(t+"="+encodeURIComponent(e)),K.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),K.isString(n)&&o.push("path="+n),K.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.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(){}},Q=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)},Y=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t},Z=B,tt=["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"],et=B,rt=et.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var n=t;return e&&(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 t=n(window.location.href),function(e){var r=et.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0};function nt(t){this.message=t}nt.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},nt.prototype.__CANCEL__=!0;var st=nt,it=B,ot=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(X("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)},at=G,ut=I,dt=function(t,e){return t&&!Q(e)?Y(t,e):e},ht=function(t){var e,r,n,s={};return t?(Z.forEach(t.split("\n"),(function(t){if(n=t.indexOf(":"),e=Z.trim(t.substr(0,n)).toLowerCase(),r=Z.trim(t.substr(n+1)),e){if(s[e]&&tt.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s},ct=rt,lt=V,pt=kt,ft=st,vt=function(t){return new Promise((function(e,r){var n,s=t.data,i=t.headers,o=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(n),t.signal&&t.signal.removeEventListener("abort",n)}it.isFormData(s)&&delete i["Content-Type"];var u=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(d+":"+h)}var c=dt(t.baseURL,t.url);function l(){if(u){var n="getAllResponseHeaders"in u?ht(u.getAllResponseHeaders()):null,s={data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:t,request:u};ot((function(t){e(t),a()}),(function(t){r(t),a()}),s),u=null}}if(u.open(t.method.toUpperCase(),ut(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(lt("Request aborted",t,"ECONNABORTED",u)),u=null)},u.onerror=function(){r(lt("Network Error",t,null,u)),u=null},u.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||pt.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(lt(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},it.isStandardBrowserEnv()){var p=(t.withCredentials||ct(c))&&t.xsrfCookieName?at.read(t.xsrfCookieName):void 0;p&&(i[t.xsrfHeaderName]=p)}"setRequestHeader"in u&&it.forEach(i,(function(t,e){void 0===s&&"content-type"===e.toLowerCase()?delete i[e]:u.setRequestHeader(e,t)})),it.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&"json"!==o&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(n=function(t){u&&(r(!t||t&&t.type?new ft("canceled"):t),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(n),t.signal&&(t.signal.aborted?n():t.signal.addEventListener("abort",n))),s||(s=null),u.send(s)}))},mt=B,gt=function(t,e){z.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))},yt=J,_t={"Content-Type":"application/x-www-form-urlencoded"};function wt(t,e){!mt.isUndefined(t)&&mt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var bt,xt={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(bt=vt),bt),transformRequest:[function(t,e){return gt(e,"Accept"),gt(e,"Content-Type"),mt.isFormData(t)||mt.isArrayBuffer(t)||mt.isBuffer(t)||mt.isStream(t)||mt.isFile(t)||mt.isBlob(t)?t:mt.isArrayBufferView(t)?t.buffer:mt.isURLSearchParams(t)?(wt(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):mt.isObject(t)||e&&"application/json"===e["Content-Type"]?(wt(e,"application/json"),function(t,e,r){if(mt.isString(t))try{return(e||JSON.parse)(t),mt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||xt.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&mt.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw yt(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};mt.forEach(["delete","get","head"],(function(t){xt.headers[t]={}})),mt.forEach(["post","put","patch"],(function(t){xt.headers[t]=mt.merge(_t)}));var kt=xt,Ot=B,Et=kt,St=function(t){return!(!t||!t.__CANCEL__)},Tt=B,jt=function(t,e,r){var n=this||Et;return Ot.forEach(r,(function(r){t=r.call(n,t,e)})),t},Rt=St,At=kt,Ut=st;function $t(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ut("canceled")}var Nt=B,Ct=function(t,e){e=e||{};var r={};function n(t,e){return Nt.isPlainObject(t)&&Nt.isPlainObject(e)?Nt.merge(t,e):Nt.isPlainObject(e)?Nt.merge({},e):Nt.isArray(e)?e.slice():e}function s(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function i(t){if(!Nt.isUndefined(e[t]))return n(void 0,e[t])}function o(r){return Nt.isUndefined(e[r])?Nt.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function a(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return Nt.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);Nt.isUndefined(n)&&e!==a||(r[t]=n)})),r},qt="0.24.0",Pt=qt,Bt={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Bt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var Ht={};Bt.transitional=function(t,e,r){function n(t,e){return"[Axios v"+Pt+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,s,i){if(!1===t)throw new Error(n(s," has been removed"+(e?" in "+e:"")));return e&&!Ht[s]&&(Ht[s]=!0,console.warn(n(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,i)}};var Lt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var i=n[s],o=e[i];if(o){var a=t[i],u=void 0===a||o(a,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Bt},It=B,Dt=I,Mt=F,Ft=function(t){return $t(t),t.headers=t.headers||{},t.data=jt.call(t,t.data,t.headers,t.transformRequest),t.headers=Tt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Tt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||At.adapter)(t).then((function(e){return $t(t),e.data=jt.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return Rt(e)||($t(t),e&&e.response&&(e.response.data=jt.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},zt=Ct,Jt=Lt,Wt=Jt.validators;function Vt(t){this.defaults=t,this.interceptors={request:new Mt,response:new Mt}}Vt.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=zt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Jt.assertOptions(e,{silentJSONParsing:Wt.transitional(Wt.boolean),forcedJSONParsing:Wt.transitional(Wt.boolean),clarifyTimeoutError:Wt.transitional(Wt.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!n){var o=[Ft,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(i),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;r.length;){var u=r.shift(),d=r.shift();try{a=u(a)}catch(t){d(t);break}}try{s=Ft(a)}catch(t){return Promise.reject(t)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},Vt.prototype.getUri=function(t){return t=zt(this.defaults,t),Dt(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},It.forEach(["delete","get","head","options"],(function(t){Vt.prototype[t]=function(e,r){return this.request(zt(r||{},{method:t,url:e,data:(r||{}).data}))}})),It.forEach(["post","put","patch"],(function(t){Vt.prototype[t]=function(e,r,n){return this.request(zt(n||{},{method:t,url:e,data:r}))}}));var Xt=Vt,Kt=st;function Gt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new Kt(t),e(r.reason))}))}Gt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Gt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},Gt.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},Gt.source=function(){var t;return{token:new Gt((function(e){t=e})),cancel:t}};var Qt=Gt,Yt=B,Zt=j,te=Xt,ee=Ct;var re=function t(e){var r=new te(e),n=Zt(te.prototype.request,r);return Yt.extend(n,te.prototype,r),Yt.extend(n,r),n.create=function(r){return t(ee(e,r))},n}(kt);re.Axios=te,re.Cancel=st,re.CancelToken=Qt,re.isCancel=St,re.VERSION=qt,re.all=function(t){return Promise.all(t)},re.spread=function(t){return function(e){return t.apply(null,e)}},re.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError},T.exports=re,T.exports.default=re;var ne=T.exports;class se{constructor(t,e,r=(()=>Promise.resolve())){this._url=t,this._storage=e,this._axios=null,this._refresh=r,this.url=t}get url(){return this._url}set url(t){this._url=t,this._axios=ne.create({baseURL:t,withCredentials:!0})}get axios(){return this._axios}get requests(){return{intercept:(t,e)=>{const r=this._axios.interceptors.request.use(t,e);return{eject:()=>{this._axios.interceptors.request.eject(r)}}}}}get responses(){return{intercept:(t,e)=>{const r=this._axios.interceptors.response.use(t,e);return{eject:()=>{this._axios.interceptors.response.eject(r)}}}}}request(t,r,n,s){var i,o,a,u,d,h,c,l,p;return e(this,void 0,void 0,(function*(){try{(s=s||{}).sendAuthorizationHeaders=null===(i=s.sendAuthorizationHeaders)||void 0===i||i,s.refreshTokenIfNeeded=null===(o=s.refreshTokenIfNeeded)||void 0===o||o,s.headers=null!==(a=s.headers)&&void 0!==a?a:{},s.onUploadProgress=null!==(u=s.onUploadProgress)&&void 0!==u?u:void 0,s.refreshTokenIfNeeded&&(yield this._refresh());const e={method:t,url:r,data:n,params:s.params,headers:s.headers,onUploadProgress:s.onUploadProgress},d=this._storage.auth_token,h=this._storage.auth_expires;s.sendAuthorizationHeaders&&d&&(null!==h&&h>Date.now()||null===h)&&(d.startsWith("Bearer ")?e.headers.Authorization=d:e.headers.Authorization=`Bearer ${d}`);const c=yield this.axios.request(e),l=c.data,p={raw:c.data,status:c.status,statusText:c.statusText,headers:c.headers,data:l.data,meta:l.meta,errors:l.errors};if(l.errors)throw new k(null,p);return p}catch(t){if(!t||t instanceof Error==!1)throw t;if(ne.isAxiosError(t)){const e=null===(d=t.response)||void 0===d?void 0:d.data;throw new k(t,{raw:null===(h=t.response)||void 0===h?void 0:h.data,status:null===(c=t.response)||void 0===c?void 0:c.status,statusText:null===(l=t.response)||void 0===l?void 0:l.statusText,headers:null===(p=t.response)||void 0===p?void 0:p.headers,data:null==e?void 0:e.data,meta:null==e?void 0:e.meta,errors:null==e?void 0:e.errors})}throw new k(t)}}))}get(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("get",t,void 0,r)}))}head(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("head",t,void 0,r)}))}options(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("options",t,void 0,r)}))}delete(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("delete",t,r,n)}))}put(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("put",t,r,n)}))}post(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("post",t,r,n)}))}patch(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.request("patch",t,r,n)}))}}class ie{constructor(t){this.transport=t}request(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/request",{email:t,reset_url:r})}))}reset(t,r){return e(this,void 0,void 0,(function*(){yield this.transport.post("/auth/password/reset",{token:t,password:r})}))}}class oe{constructor(t){this.func=t,this.debounced=[],this.debouncing=!1}debounce(...t){return e(this,void 0,void 0,(function*(){return this.debouncing?yield new Promise(((t,e)=>{this.debounced.push({resolve:e=>t(e),reject:t=>e(t)})})):(this.debouncing=!0,new Promise(((e,r)=>{this.func(...t).then((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.resolve(t)))})).catch((t=>{const n=[{resolve:e,reject:r},...this.debounced];this.debounced=[],this.debouncing=!1,n.forEach((e=>e.reject(t)))}))})))}))}}class ae{constructor(t,e,r){var n,s,i,o,a;this.options=r||{},this.options.mode=(null==r?void 0:r.mode)||("undefined"!=typeof window?"cookie":"json"),this.options.refresh=(null==r?void 0:r.refresh)||{auto:!1,time:3e4},this.options.refresh.auto=null!==(s=null===(n=this.options.refresh)||void 0===n?void 0:n.auto)&&void 0!==s&&s,this.options.refresh.time=null!==(o=null===(i=this.options.refresh)||void 0===i?void 0:i.time)&&void 0!==o?o:3e4,this.transport=t,this.storage=e,this.timer=!1,this.refresher=new oe(this.refreshToken.bind(this));try{this.updateRefresh(null===(a=this.options)||void 0===a?void 0:a.refresh)}catch(t){}}get token(){return this.storage.auth_token}get password(){return this.passwords=this.passwords||new ie(this.transport)}get expiring(){var t,e;const r=this.storage.auth_expires;if(null===r)return!1;return r-(null!==(e=null===(t=this.options.refresh)||void 0===t?void 0:t.time)&&void 0!==e?e:0)<=Date.now()}refreshToken(t=!1){var r;return e(this,void 0,void 0,(function*(){if(!t&&!this.expiring)return!1;const e=yield this.transport.post("/auth/refresh",{refresh_token:"json"===this.options.mode?this.storage.auth_refresh_token:void 0},{refreshTokenIfNeeded:!1});return this.updateStorage(e.data),this.updateRefresh(),{access_token:e.data.access_token,refresh_token:null===(r=e.data)||void 0===r?void 0:r.refresh_token,expires:e.data.expires}}))}updateStorage(t){var e;this.storage.auth_token=t.access_token,this.storage.auth_refresh_token=null!==(e=t.refresh_token)&&void 0!==e?e:null,t.expires?this.storage.auth_expires=Date.now()+t.expires:this.storage.auth_expires=null}updateRefresh(t){var e,r;const n=this.storage.auth_expires;if(null===n)return void clearTimeout(this.timer);t&&(this.options.refresh.auto=null!==(e=t.auto)&&void 0!==e?e:this.options.refresh.auto,this.options.refresh.time=null!==(r=t.time)&&void 0!==r?r:this.options.refresh.time),clearTimeout(this.timer);let s=n-this.options.refresh.time-Date.now();if(s<0){if(n<Date.now())return;s=0}this.options.refresh.auto&&(this.timer=setTimeout((()=>{this.refresh().then((()=>{})).catch((()=>{}))}),s))}refresh(t=!1){return e(this,void 0,void 0,(function*(){return yield this.refresher.debounce(t)}))}login(t,r){var n;return e(this,void 0,void 0,(function*(){r=r||{};const e=yield this.transport.post("/auth/login",Object.assign({mode:this.options.mode},t),{refreshTokenIfNeeded:!1,sendAuthorizationHeaders:!1});return this.updateStorage(e.data),this.updateRefresh(r.refresh),{access_token:e.data.access_token,refresh_token:null===(n=e.data)||void 0===n?void 0:n.refresh_token,expires:e.data.expires}}))}static(t){return e(this,void 0,void 0,(function*(){return yield this.transport.get("/users/me",{params:{access_token:t}}),this.storage.auth_token=t,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,!0}))}logout(){return e(this,void 0,void 0,(function*(){let t;"json"===this.options.mode&&(t=this.storage.auth_refresh_token||void 0),yield this.transport.post("/auth/logout",{refresh_token:t},{refreshTokenIfNeeded:!1}),this.storage.auth_token=null,this.storage.auth_expires=null,this.storage.auth_refresh_token=null,clearTimeout(this.timer)}))}}class ue{constructor(t){this.transport=t}request(t,r,n){return e(this,void 0,void 0,(function*(){return yield this.transport.post(t,{query:r,variables:void 0===n?{}:n})}))}items(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql",t,r)}))}system(t,r){return e(this,void 0,void 0,(function*(){return yield this.request("/graphql/system",t,r)}))}}t.ActivityHandler=s,t.Auth=ae,t.AxiosTransport=se,t.BaseStorage=O,t.CollectionsHandler=i,t.CommentsHandler=n,t.Directus=class{constructor(t,r){this._storage=(null==r?void 0:r.storage)||("undefined"!=typeof window?new S:new E),this._transport=(null==r?void 0:r.transport)||new se(t,this._storage,(()=>e(this,void 0,void 0,(function*(){yield this._auth.refresh()})))),this._auth=(null==r?void 0:r.auth)||new ae(this._transport,this._storage),this._items={},this._singletons={}}get auth(){return this._auth}get storage(){return this._storage}get transport(){return this._transport}get activity(){return this._activity||(this._activity=new s(this.transport))}get collections(){return this._collections||(this._collections=new i(this.transport))}get fields(){return this._fields||(this._fields=new o(this.transport))}get files(){return this._files||(this._files=new a(this.transport))}get folders(){return this._folders||(this._folders=new u(this.transport))}get permissions(){return this._permissions||(this._permissions=new d(this.transport))}get presets(){return this._presets||(this._presets=new h(this.transport))}get relations(){return this._relations||(this._relations=new c(this.transport))}get revisions(){return this._revisions||(this._revisions=new l(this.transport))}get roles(){return this._roles||(this._roles=new p(this.transport))}get users(){return this._users||(this._users=new w(this.transport))}get settings(){return this._settings||(this._settings=new m(this.transport))}get server(){return this._server||(this._server=new f(this.transport))}get utils(){return this._utils||(this._utils=new b(this.transport))}get graphql(){return this._graphql||(this._graphql=new ue(this.transport))}singleton(t){return this._singletons[t]||(this._singletons[t]=new v(t,this.transport))}items(t){return this._items[t]||(this._items[t]=new r(t,this.transport))}},t.FieldsHandler=o,t.FilesHandler=a,t.FoldersHandler=u,t.ItemsHandler=r,t.LocalStorage=S,t.MemoryStorage=E,t.PermissionsHandler=d,t.PresetsHandler=h,t.RelationsHandler=c,t.RevisionsHandler=l,t.RolesHandler=p,t.ServerHandler=f,t.SettingsHandler=m,t.TransportError=k,t.UsersHandler=w,t.UtilsHandler=b,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=sdk.umd.min.js.map |
{ | ||
"name": "@directus/sdk", | ||
"version": "9.0.0-rc.99", | ||
"version": "9.0.0-rc.100", | ||
"description": "The official Directus SDK for use in JavaScript!", | ||
@@ -46,3 +46,3 @@ "repository": { | ||
"dependencies": { | ||
"axios": "^0.23.0" | ||
"axios": "^0.24.0" | ||
}, | ||
@@ -61,3 +61,3 @@ "devDependencies": { | ||
"rimraf": "3.0.2", | ||
"rollup": "2.58.0", | ||
"rollup": "2.58.3", | ||
"rollup-plugin-copy": "3.4.0", | ||
@@ -68,6 +68,6 @@ "rollup-plugin-sourcemaps": "0.6.3", | ||
"ts-jest": "27.0.7", | ||
"ts-node": "10.3.1", | ||
"ts-node": "10.4.0", | ||
"typescript": "4.4.4" | ||
}, | ||
"gitHead": "7c88f038844d6a64e36c9848fe95074aae7fdd0c" | ||
"gitHead": "41abc239221c0973ca1f83457be14f21155dc52d" | ||
} |
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
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
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
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
1507105
+ Addedaxios@0.24.0(transitive)
- Removedaxios@0.23.0(transitive)
Updatedaxios@^0.24.0