@hostlink/light 2.3.8 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/createClient.d.ts +2 -0
- package/dist/drive.d.ts +30 -0
- package/dist/light.js +355 -262
- package/dist/light.umd.cjs +12 -12
- package/package.json +1 -1
package/dist/light.umd.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(g,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("json-to-graphql-query"),require("axios")):typeof define=="function"&&define.amd?define(["exports","json-to-graphql-query","axios"],w):(g=typeof globalThis<"u"?globalThis:g||self,w(g.light={},g.jsonToGraphqlQuery,g.axios))})(this,function(g,w,P){"use strict";var uo=Object.defineProperty;var co=(g,w,P)=>w in g?uo(g,w,{enumerable:!0,configurable:!0,writable:!0,value:P}):g[w]=P;var S=(g,w,P)=>co(g,typeof w!="symbol"?w+"":w,P);function mt(e){const t="==".slice(0,(4-e.length%4)%4),r=e.replace(/-/g,"+").replace(/_/g,"/")+t,n=atob(r),i=new ArrayBuffer(n.length),s=new Uint8Array(i);for(let o=0;o<n.length;o++)s[o]=n.charCodeAt(o);return i}function dt(e){const t=new Uint8Array(e);let r="";for(const s of t)r+=String.fromCharCode(s);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var f="copy",_="convert";function F(e,t,r){if(t===f)return r;if(t===_)return e(r);if(t instanceof Array)return r.map(n=>F(e,t[0],n));if(t instanceof Object){const n={};for(const[i,s]of Object.entries(t)){if(s.derive){const o=s.derive(r);o!==void 0&&(r[i]=o)}if(!(i in r)){if(s.required)throw new Error(`Missing key: ${i}`);continue}if(r[i]==null){n[i]=null;continue}n[i]=F(e,s.schema,r[i])}return n}}function V(e,t){return{required:!0,schema:e,derive:t}}function p(e){return{required:!0,schema:e}}function v(e){return{required:!1,schema:e}}var vt={type:p(f),id:p(_),transports:v(f)},bt={appid:v(f),appidExclude:v(f),credProps:v(f)},gt={appid:v(f),appidExclude:v(f),credProps:v(f)},Zt={publicKey:p({rp:p(f),user:p({id:p(_),name:p(f),displayName:p(f)}),challenge:p(_),pubKeyCredParams:p(f),timeout:v(f),excludeCredentials:v([vt]),authenticatorSelection:v(f),attestation:v(f),extensions:v(bt)}),signal:v(f)},kt={type:p(f),id:p(f),rawId:p(_),authenticatorAttachment:v(f),response:p({clientDataJSON:p(_),attestationObject:p(_),transports:V(f,e=>{var t;return((t=e.getTransports)==null?void 0:t.call(e))||[]})}),clientExtensionResults:V(gt,e=>e.getClientExtensionResults())},tr={mediation:v(f),publicKey:p({challenge:p(_),timeout:v(f),rpId:v(f),allowCredentials:v([vt]),userVerification:v(f),extensions:v(bt)}),signal:v(f)},rr={type:p(f),id:p(f),rawId:p(_),authenticatorAttachment:v(f),response:p({clientDataJSON:p(_),authenticatorData:p(_),signature:p(_),userHandle:p(_)}),clientExtensionResults:V(gt,e=>e.getClientExtensionResults())};function er(e){return F(mt,Zt,e)}function nr(e){return F(dt,kt,e)}function ir(e){return F(mt,tr,e)}function sr(e){return F(dt,rr,e)}async function or(e){const t=await navigator.credentials.create(e);return t.toJSON=()=>nr(t),t}async function ar(e){const t=await navigator.credentials.get(e);return t.toJSON=()=>sr(t),t}const ur=e=>({login:async t=>{const{app:r}=await O(e,{app:{auth:{webAuthnRequestOptions:{__args:{username:t}}}}}),n=r.auth.webAuthnRequestOptions,i=ir({publicKey:n}),s=await ar(i);await y(e,"webAuthnAssertion",{username:t,assertion:s.toJSON()})},register:async()=>{const{app:t}=await O(e,{app:{auth:{webAuthnCreationOptions:!0}}}),r=er({publicKey:t.auth.webAuthnCreationOptions}),n=await or(r);await y(e,"webAuthnRegister",{registration:n.toJSON()})}}),cr=e=>({WebAuthn:ur(e),facebookLogin:t=>y(e,"facebookLogin",{access_token:t}),microsoftLogin:t=>y(e,"microsoftLogin",{access_token:t}),googleLogin:t=>y(e,"googleLogin",{credential:t}),login:(t,r,n="")=>y(e,"login",{username:t,password:r,code:n}),logout:()=>y(e,"logout"),changeExpiredPassword:(t,r,n)=>y(e,"changeExpiredPassword",{username:t,old_password:r,new_password:n}),updatePassword:(t,r)=>y(e,"updatePassword",{old_password:t,new_password:r}),resetPassword:(t,r,n)=>y(e,"resetPassword",{username:t,password:r,code:n}),forgetPassword:(t,r)=>y(e,"forgetPassword",{username:t,email:r}),verifyCode(t,r){return y(e,"forgetPasswordVerifyCode",{username:t,code:r})},granted:async t=>(await O(e,{granted:{__args:{rights:t}}})).granted}),fr=(e,t,r)=>{const n=t,i=e,s=r;let o="list"+t;const u=a=>s[a]?s[a]():null;return{field:u,$fields:s,setDataPath(a){return o=a,o},getDataPath(){return o},gqlFields(a){const c=[];for(const h of a)if(typeof h=="string"){const b=u(h);b&&c.push(b.getGQLField())}else typeof h=="object"&&c.push(h);return c},async update(a,c){return await y(i,"update"+n,{id:a,data:c})},async delete(a){return await y(i,"delete"+n,{id:a})},async add(a){return await y(i,"add"+n,{data:a})},fields(a){let c=[];for(let h of a){const b=u(h);b&&c.push(b)}return c},async get(a,c){return(await O(i,{["list"+n]:{__args:{filters:a},data:{__args:{limit:1},...B(c)}}}))["list"+n].data[0]},async list(a,c){return(await O(i,{["list"+n]:{__args:{filters:a},data:{...B(c)}}}))["list"+n].data}}};function lr(e){e="<~"+e+"~>";var t,r,n,i,s,o=String,u=255;for(e.slice(0,2)==="<~"&&e.slice(-2),e=e.slice(2,-2).replace(/\s/g,"").replace("z","!!!!!"),t="uuuuu".slice(e.length%5||5),e+=t,n=[],i=0,s=e.length;s>i;i+=5)r=52200625*(e.charCodeAt(i)-33)+614125*(e.charCodeAt(i+1)-33)+7225*(e.charCodeAt(i+2)-33)+85*(e.charCodeAt(i+3)-33)+(e.charCodeAt(i+4)-33),n.push(u&r>>24,u&r>>16,u&r>>8,u&r);return function(a,c){for(var h=c;h>0;h--)a.pop()}(n,t.length),o.fromCharCode.apply(o,n)}const q=(e="")=>{const t=e,r=(n="application/octet-stream")=>{const i=new Uint8Array(t.length);for(let u=0;u<t.length;u++)i[u]=t.charCodeAt(u);const s=new Blob([i],{type:n});return URL.createObjectURL(s)};return{getContent:()=>t,getURL:r,download:n=>{const i=document.createElement("a");i.download=n,i.href=r(),document.body.appendChild(i),i.click(),document.body.removeChild(i)},open:n=>{window.open(r(n),"_blank")}}},hr={fromBase85:e=>q(lr(e)),fromBase64:e=>q(atob(e)),fromString:e=>q(e)},L=e=>{let t={};return typeof e=="string"?(t[e]=!0,t):e instanceof Array?(e.forEach(r=>{Object.entries(L(r)).forEach(([n,i])=>{t[n]=i})}),t):(Object.entries(e).forEach(([r,n])=>{if(r=="__args"||r=="__aliasFor"||r=="__variables"||r=="__directives"||r=="__all_on"||r=="__name"){t[r]=n;return}if(typeof n=="boolean"){t[r]=n;return}t[r]=L(n)}),t)},B=e=>L(e),O=async(e,t)=>{let r=w.jsonToGraphQLQuery(B(t));const n=await e.post("",{query:`{ ${r} }`});if(n.data.errors)throw new Error(n.data.errors[0].message);return n.data.data};function pr(e){for(let t=0;t<e.length;t++)if(e[t]instanceof File)return!0;return!1}function yr(e){for(let t in e)if(e[t]instanceof File)return!0;return!1}const y=async(e,t,r=null,n=[])=>{let i={[t]:{}};const s=new FormData;let o=!1;if(r){const c={},h={},b={};let l=0;Object.entries(r).forEach(([m,A])=>{if(A instanceof Array&&pr(A)){o=!0;let T=0;A.forEach(N=>{N instanceof File&&(c[m]=new w.VariableType(m),h[l]=["variables."+m+"."+T],s.append(l.toString(),N),l++)}),b[m]="[Upload!]!"}else A instanceof File?(o=!0,c[m]=new w.VariableType(m),h[l]=["variables."+m],s.append(l.toString(),A),b[m]="Upload!",l++):A instanceof Object&&yr(A)?(o=!0,c[m]={},Object.entries(A).forEach(([T,N])=>{N instanceof File?(c[m][T]=new w.VariableType(T),h[l]=["variables."+T],s.append(l.toString(),N),b[T]="Upload!",l++):c[m][T]=N})):A!==void 0&&(c[m]=A)}),i[t].__args=c,i.__variables=b,o&&s.append("map",JSON.stringify(h))}Object.entries(B(n)).forEach(([c,h])=>{i[t][c]=h}),Object.entries(i[t]).length===0&&(i[t]=!0);let u=null;const a=w.jsonToGraphQLQuery({mutation:i});if(o?(s.append("operations",JSON.stringify({query:a})),u=await e.post("",s)):u=await e.post("",{query:a}),u.data.errors)throw new Error(u.data.errors[0].message);return u.data.data[t]},mr=e=>({uploadTempFile:t=>y(e,"fsUploadTempFile",{file:t},{name:!0,path:!0,size:!0,mime:!0}),folders:{list:async t=>(await O(e,{fsListFolders:{__args:{path:t},name:!0,path:!0}})).fsListFolders,create:t=>y(e,"fsCreateFolder",{path:t}),delete:t=>y(e,"fsDeleteFolder",{path:t}),rename:(t,r)=>y(e,"fsRenameFolder",{path:t,name:r})},files:{list:async t=>(await O(e,{fsListFiles:{__args:{path:t},name:!0,path:!0,size:!0,mime:!0,canPreview:!0,imagePath:!0}})).fsListFiles,read:async t=>{let r=await O(e,{fsFile:{__args:{path:t},base64Content:!0}});return window.atob(r.fsFile.base64Content)},write:(t,r)=>y(e,"fsWriteFile",{path:t,content:r}),delete:t=>y(e,"fsDeleteFile",{path:t}),rename:(t,r)=>y(e,"fsRenameFile",{path:t,name:r}),move:(t,r)=>y(e,"fsMoveFile",{source:t,target:r})}}),dr=e=>({get:async t=>(await e({config:{__args:{name:t}}})).config}),vr=e=>({send:(t,r,n)=>y(e,"sendMail",{email:t,subject:r,message:n})}),br=e=>({list:async()=>(await O(e,{listUser:{data:{user_id:!0,username:!0,first_name:!0,last_name:!0,status:!0}}})).listUser.data}),gr=e=>{const t=e,r={};return{create(n,i){r[n]=null;let s={};for(const o of Object.entries(i)){const[u,a]=o;s[u]=()=>({name:a.name?a.name:u,raw:a,getName:()=>a.name?a.name:u,getGQLField:()=>a.gqlField!==void 0?a.gqlField:a.name||u,getRaw(){return a},getValue(c){return a.field&&typeof a.field=="function"?a.field(c):a.field&&typeof a.field=="string"?c[a.field]:c[this.getName()]},getFormattedValue(c){const h=this.getValue(c);return a.format?a.format(h):h}})}r[n]=fr(t,n,s)},get(n){return r[n]||this.create(n,{}),r[n]}}},wr=e=>({list:async()=>(await O(e,{listRole:{name:!0}})).listRole});function Ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wt={exports:{}},_r=function(){var t=this,r=-1;return{next:function(){return r+=1,{value:t.items[r],done:r>=t.items.length}}}},Or=function(){return this.items};function H(e){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(e)}var d={isArray:function(t){return Array.isArray(t)},isObject:function(t){return H(t)==="object"&&Array.isArray(t)===!1&&t!==null},isFunction:function(t){return typeof t=="function"}},Sr=d,$r=Sr.isFunction,At=function(t){return t===void 0?this.sum()/this.items.length:$r(t)?new this.constructor(this.items).sum(t)/this.items.length:new this.constructor(this.items).pluck(t).sum()/this.items.length},jr=At,Er=jr;function Q(e){"@babel/helpers - typeof";return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(e)}var Ir=function(t){var r=this,n=[],i=0;if(Array.isArray(this.items))do{var s=this.items.slice(i,i+t),o=new this.constructor(s);n.push(o),i+=t}while(i<this.items.length);else if(Q(this.items)==="object"){var u=Object.keys(this.items),a=function(){var h=u.slice(i,i+t),b=new r.constructor({});h.forEach(function(l){return b.put(l,r.items[l])}),n.push(b),i+=t};do a();while(i<u.length)}else n.push(new this.constructor([this.items]));return new this.constructor(n)};function Cr(e){return Dr(e)||Fr(e)||Pr(e)||Tr()}function Tr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
5
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
6
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function te(e,t){if(e){if(typeof e=="string")return Y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Y(e,t)}}function re(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ee(e){if(Array.isArray(e))return Y(e)}function Y(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ne=E,ie=d,se=ie.isFunction,$t=function(t,r){if(r!==void 0)return Array.isArray(this.items)?this.items.filter(function(i){return i[t]!==void 0&&i[t]===r}).length>0:this.items[t]!==void 0&&this.items[t]===r;if(se(t))return this.items.filter(function(i,s){return t(i,s)}).length>0;if(Array.isArray(this.items))return this.items.indexOf(t)!==-1;var n=ne(this.items);return n.push.apply(n,Zr(Object.keys(this.items))),n.indexOf(t)!==-1},oe=function(){return this.count()===1},ae=function(){var t=0;return Array.isArray(this.items)&&(t=this.items.length),Math.max(Object.keys(this.items).length,t)},ue=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(r){return r};return new this.constructor(this.items).groupBy(t).map(function(r){return r.count()})},
|
|
7
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ae(e,t){if(e){if(typeof e=="string")return Z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Z(e,t)}}function _e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Oe(e){if(Array.isArray(e))return Z(e)}function Z(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Se=function(t){return this.each(function(r,n){t.apply(void 0,ge(r).concat([n]))}),this},$e=E,je=function(t){var r=$e(this.items);return r.every(t)},W=function(t){return Array.isArray(t[0])?t[0]:t},Ee=W,Ie=function(){for(var t=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=Ee(n);if(Array.isArray(this.items)){var o=this.items.filter(function(a){return s.indexOf(a)===-1});return new this.constructor(o)}var u={};return Object.keys(this.items).forEach(function(a){s.indexOf(a)===-1&&(u[a]=t.items[a])}),new this.constructor(u)};function k(e){"@babel/helpers - typeof";return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(e)}function jt(e){if(Array.isArray(e)){if(e.length)return!1}else if(e!=null&&k(e)==="object"){if(Object.keys(e).length)return!1}else if(e)return!1;return!0}function Ce(e,t){var r={};return Object.keys(t).forEach(function(n){e?e(t[n],n)&&(r[n]=t[n]):jt(t[n])||(r[n]=t[n])}),r}function Te(e,t){if(e)return t.filter(e);for(var r=[],n=0;n<t.length;n+=1){var i=t[n];jt(i)||r.push(i)}return r}var
|
|
1
|
+
(function(g,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("json-to-graphql-query"),require("axios")):typeof define=="function"&&define.amd?define(["exports","json-to-graphql-query","axios"],w):(g=typeof globalThis<"u"?globalThis:g||self,w(g.light={},g.jsonToGraphqlQuery,g.axios))})(this,function(g,w,D){"use strict";var fo=Object.defineProperty;var co=(g,w,D)=>w in g?fo(g,w,{enumerable:!0,configurable:!0,writable:!0,value:D}):g[w]=D;var S=(g,w,D)=>co(g,typeof w!="symbol"?w+"":w,D);function mt(e){const t="==".slice(0,(4-e.length%4)%4),r=e.replace(/-/g,"+").replace(/_/g,"/")+t,n=atob(r),i=new ArrayBuffer(n.length),s=new Uint8Array(i);for(let o=0;o<n.length;o++)s[o]=n.charCodeAt(o);return i}function dt(e){const t=new Uint8Array(e);let r="";for(const s of t)r+=String.fromCharCode(s);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var l="copy",O="convert";function F(e,t,r){if(t===l)return r;if(t===O)return e(r);if(t instanceof Array)return r.map(n=>F(e,t[0],n));if(t instanceof Object){const n={};for(const[i,s]of Object.entries(t)){if(s.derive){const o=s.derive(r);o!==void 0&&(r[i]=o)}if(!(i in r)){if(s.required)throw new Error(`Missing key: ${i}`);continue}if(r[i]==null){n[i]=null;continue}n[i]=F(e,s.schema,r[i])}return n}}function L(e,t){return{required:!0,schema:e,derive:t}}function y(e){return{required:!0,schema:e}}function v(e){return{required:!1,schema:e}}var vt={type:y(l),id:y(O),transports:v(l)},bt={appid:v(l),appidExclude:v(l),credProps:v(l)},gt={appid:v(l),appidExclude:v(l),credProps:v(l)},Zt={publicKey:y({rp:y(l),user:y({id:y(O),name:y(l),displayName:y(l)}),challenge:y(O),pubKeyCredParams:y(l),timeout:v(l),excludeCredentials:v([vt]),authenticatorSelection:v(l),attestation:v(l),extensions:v(bt)}),signal:v(l)},kt={type:y(l),id:y(l),rawId:y(O),authenticatorAttachment:v(l),response:y({clientDataJSON:y(O),attestationObject:y(O),transports:L(l,e=>{var t;return((t=e.getTransports)==null?void 0:t.call(e))||[]})}),clientExtensionResults:L(gt,e=>e.getClientExtensionResults())},tr={mediation:v(l),publicKey:y({challenge:y(O),timeout:v(l),rpId:v(l),allowCredentials:v([vt]),userVerification:v(l),extensions:v(bt)}),signal:v(l)},rr={type:y(l),id:y(l),rawId:y(O),authenticatorAttachment:v(l),response:y({clientDataJSON:y(O),authenticatorData:y(O),signature:y(O),userHandle:y(O)}),clientExtensionResults:L(gt,e=>e.getClientExtensionResults())};function er(e){return F(mt,Zt,e)}function nr(e){return F(dt,kt,e)}function ir(e){return F(mt,tr,e)}function sr(e){return F(dt,rr,e)}async function or(e){const t=await navigator.credentials.create(e);return t.toJSON=()=>nr(t),t}async function ar(e){const t=await navigator.credentials.get(e);return t.toJSON=()=>sr(t),t}const ur=e=>({login:async t=>{const{app:r}=await A(e,{app:{auth:{webAuthnRequestOptions:{__args:{username:t}}}}}),n=r.auth.webAuthnRequestOptions,i=ir({publicKey:n}),s=await ar(i);await c(e,"webAuthnAssertion",{username:t,assertion:s.toJSON()})},register:async()=>{const{app:t}=await A(e,{app:{auth:{webAuthnCreationOptions:!0}}}),r=er({publicKey:t.auth.webAuthnCreationOptions}),n=await or(r);await c(e,"webAuthnRegister",{registration:n.toJSON()})}}),fr=e=>({WebAuthn:ur(e),facebookLogin:t=>c(e,"facebookLogin",{access_token:t}),microsoftLogin:t=>c(e,"microsoftLogin",{access_token:t}),googleLogin:t=>c(e,"googleLogin",{credential:t}),login:(t,r,n="")=>c(e,"login",{username:t,password:r,code:n}),logout:()=>c(e,"logout"),changeExpiredPassword:(t,r,n)=>c(e,"changeExpiredPassword",{username:t,old_password:r,new_password:n}),updatePassword:(t,r)=>c(e,"updatePassword",{old_password:t,new_password:r}),resetPassword:(t,r,n)=>c(e,"resetPassword",{username:t,password:r,code:n}),forgetPassword:(t,r)=>c(e,"forgetPassword",{username:t,email:r}),verifyCode(t,r){return c(e,"forgetPasswordVerifyCode",{username:t,code:r})},granted:async t=>(await A(e,{granted:{__args:{rights:t}}})).granted}),cr=(e,t,r)=>{const n=t,i=e,s=r;let o="list"+t;const u=a=>s[a]?s[a]():null;return{field:u,$fields:s,setDataPath(a){return o=a,o},getDataPath(){return o},gqlFields(a){const f=[];for(const p of a)if(typeof p=="string"){const b=u(p);b&&f.push(b.getGQLField())}else typeof p=="object"&&f.push(p);return f},async update(a,f){return await c(i,"update"+n,{id:a,data:f})},async delete(a){return await c(i,"delete"+n,{id:a})},async add(a){return await c(i,"add"+n,{data:a})},fields(a){let f=[];for(let p of a){const b=u(p);b&&f.push(b)}return f},async get(a,f){return(await A(i,{["list"+n]:{__args:{filters:a},data:{__args:{limit:1},...B(f)}}}))["list"+n].data[0]},async list(a,f){return(await A(i,{["list"+n]:{__args:{filters:a},data:{...B(f)}}}))["list"+n].data}}};function lr(e){e="<~"+e+"~>";var t,r,n,i,s,o=String,u=255;for(e.slice(0,2)==="<~"&&e.slice(-2),e=e.slice(2,-2).replace(/\s/g,"").replace("z","!!!!!"),t="uuuuu".slice(e.length%5||5),e+=t,n=[],i=0,s=e.length;s>i;i+=5)r=52200625*(e.charCodeAt(i)-33)+614125*(e.charCodeAt(i+1)-33)+7225*(e.charCodeAt(i+2)-33)+85*(e.charCodeAt(i+3)-33)+(e.charCodeAt(i+4)-33),n.push(u&r>>24,u&r>>16,u&r>>8,u&r);return function(a,f){for(var p=f;p>0;p--)a.pop()}(n,t.length),o.fromCharCode.apply(o,n)}const q=(e="")=>{const t=e,r=(n="application/octet-stream")=>{const i=new Uint8Array(t.length);for(let u=0;u<t.length;u++)i[u]=t.charCodeAt(u);const s=new Blob([i],{type:n});return URL.createObjectURL(s)};return{getContent:()=>t,getURL:r,download:n=>{const i=document.createElement("a");i.download=n,i.href=r(),document.body.appendChild(i),i.click(),document.body.removeChild(i)},open:n=>{window.open(r(n),"_blank")}}},hr={fromBase85:e=>q(lr(e)),fromBase64:e=>q(atob(e)),fromString:e=>q(e)},x=e=>{let t={};return typeof e=="string"?(t[e]=!0,t):e instanceof Array?(e.forEach(r=>{Object.entries(x(r)).forEach(([n,i])=>{t[n]=i})}),t):(Object.entries(e).forEach(([r,n])=>{if(r=="__args"||r=="__aliasFor"||r=="__variables"||r=="__directives"||r=="__all_on"||r=="__name"){t[r]=n;return}if(typeof n=="boolean"){t[r]=n;return}t[r]=x(n)}),t)},B=e=>x(e),A=async(e,t)=>{let r=w.jsonToGraphQLQuery(B(t));const n=await e.post("",{query:`{ ${r} }`});if(n.data.errors)throw new Error(n.data.errors[0].message);return n.data.data};function pr(e){for(let t=0;t<e.length;t++)if(e[t]instanceof File)return!0;return!1}function yr(e){for(let t in e)if(e[t]instanceof File)return!0;return!1}const c=async(e,t,r=null,n=[])=>{let i={[t]:{}};const s=new FormData;let o=!1;if(r){const f={},p={},b={};let h=0;Object.entries(r).forEach(([m,_])=>{if(_ instanceof Array&&pr(_)){o=!0;let T=0;_.forEach(N=>{N instanceof File&&(f[m]=new w.VariableType(m),p[h]=["variables."+m+"."+T],s.append(h.toString(),N),h++)}),b[m]="[Upload!]!"}else _ instanceof File?(o=!0,f[m]=new w.VariableType(m),p[h]=["variables."+m],s.append(h.toString(),_),b[m]="Upload!",h++):_ instanceof Object&&yr(_)?(o=!0,f[m]={},Object.entries(_).forEach(([T,N])=>{N instanceof File?(f[m][T]=new w.VariableType(T),p[h]=["variables."+T],s.append(h.toString(),N),b[T]="Upload!",h++):f[m][T]=N})):_!==void 0&&(f[m]=_)}),i[t].__args=f,i.__variables=b,o&&s.append("map",JSON.stringify(p))}Object.entries(B(n)).forEach(([f,p])=>{i[t][f]=p}),Object.entries(i[t]).length===0&&(i[t]=!0);let u=null;const a=w.jsonToGraphQLQuery({mutation:i});if(o?(s.append("operations",JSON.stringify({query:a})),u=await e.post("",s)):u=await e.post("",{query:a}),u.data.errors)throw new Error(u.data.errors[0].message);return u.data.data[t]},mr=e=>({uploadTempFile:t=>c(e,"fsUploadTempFile",{file:t},{name:!0,path:!0,size:!0,mime:!0}),folders:{list:async t=>(await A(e,{fsListFolders:{__args:{path:t},name:!0,path:!0}})).fsListFolders,create:t=>c(e,"fsCreateFolder",{path:t}),delete:t=>c(e,"fsDeleteFolder",{path:t}),rename:(t,r)=>c(e,"fsRenameFolder",{path:t,name:r})},files:{list:async t=>(await A(e,{fsListFiles:{__args:{path:t},name:!0,path:!0,size:!0,mime:!0,canPreview:!0,imagePath:!0}})).fsListFiles,read:async t=>{let r=await A(e,{fsFile:{__args:{path:t},base64Content:!0}});return window.atob(r.fsFile.base64Content)},write:(t,r)=>c(e,"fsWriteFile",{path:t,content:r}),delete:t=>c(e,"fsDeleteFile",{path:t}),rename:(t,r)=>c(e,"fsRenameFile",{path:t,name:r}),move:(t,r)=>c(e,"fsMoveFile",{source:t,target:r})}}),dr=e=>({get:async t=>(await e({config:{__args:{name:t}}})).config}),vr=e=>({send:(t,r,n)=>c(e,"sendMail",{email:t,subject:r,message:n})}),br=e=>({list:async()=>(await A(e,{listUser:{data:{user_id:!0,username:!0,first_name:!0,last_name:!0,status:!0}}})).listUser.data}),gr=e=>{const t=e,r={};return{create(n,i){r[n]=null;let s={};for(const o of Object.entries(i)){const[u,a]=o;s[u]=()=>({name:a.name?a.name:u,raw:a,getName:()=>a.name?a.name:u,getGQLField:()=>a.gqlField!==void 0?a.gqlField:a.name||u,getRaw(){return a},getValue(f){return a.field&&typeof a.field=="function"?a.field(f):a.field&&typeof a.field=="string"?f[a.field]:f[this.getName()]},getFormattedValue(f){const p=this.getValue(f);return a.format?a.format(p):p}})}r[n]=cr(t,n,s)},get(n){return r[n]||this.create(n,{}),r[n]}}},wr=e=>({list:async()=>(await A(e,{listRole:{name:!0}})).listRole});function Ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wt={exports:{}},_r=function(){var t=this,r=-1;return{next:function(){return r+=1,{value:t.items[r],done:r>=t.items.length}}}},Or=function(){return this.items};function H(e){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(e)}var d={isArray:function(t){return Array.isArray(t)},isObject:function(t){return H(t)==="object"&&Array.isArray(t)===!1&&t!==null},isFunction:function(t){return typeof t=="function"}},Sr=d,$r=Sr.isFunction,At=function(t){return t===void 0?this.sum()/this.items.length:$r(t)?new this.constructor(this.items).sum(t)/this.items.length:new this.constructor(this.items).pluck(t).sum()/this.items.length},jr=At,Er=jr;function Q(e){"@babel/helpers - typeof";return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(e)}var Ir=function(t){var r=this,n=[],i=0;if(Array.isArray(this.items))do{var s=this.items.slice(i,i+t),o=new this.constructor(s);n.push(o),i+=t}while(i<this.items.length);else if(Q(this.items)==="object"){var u=Object.keys(this.items),a=function(){var p=u.slice(i,i+t),b=new r.constructor({});p.forEach(function(h){return b.put(h,r.items[h])}),n.push(b),i+=t};do a();while(i<u.length)}else n.push(new this.constructor([this.items]));return new this.constructor(n)};function Cr(e){return Pr(e)||Fr(e)||Dr(e)||Tr()}function Tr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dr(e,t){if(e){if(typeof e=="string")return z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(e,t)}}function Fr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pr(e){if(Array.isArray(e))return z(e)}function z(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Nr=function(){var t;return new this.constructor((t=[]).concat.apply(t,Cr(this.items)))};function Br(e,t){return Ur(e)||Rr(e,t)||Kr(e,t)||qr()}function qr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kr(e,t){if(e){if(typeof e=="string")return _t(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _t(e,t)}}function _t(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Rr(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,s=!1,o,u;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(a){s=!0,u=a}finally{try{!i&&r.return!=null&&r.return()}finally{if(s)throw u}}return n}}function Ur(e){if(Array.isArray(e))return e}function K(e){"@babel/helpers - typeof";return K=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(e)}var Wr=function(t){var r=this,n=t;n instanceof this.constructor&&(n=t.all());var i={};if(Array.isArray(this.items)&&Array.isArray(n))this.items.forEach(function(u,a){i[u]=n[a]});else if(K(this.items)==="object"&&K(n)==="object")Object.keys(this.items).forEach(function(u,a){i[r.items[u]]=n[Object.keys(n)[a]]});else if(Array.isArray(this.items))i[this.items[0]]=n;else if(typeof this.items=="string"&&Array.isArray(n)){var s=n,o=Br(s,1);i[this.items]=o[0]}else typeof this.items=="string"&&(i[this.items]=n);return new this.constructor(i)};function Mr(e){return xr(e)||Lr(e)||Vr(e)||Jr()}function Jr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vr(e,t){if(e){if(typeof e=="string")return G(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return G(e,t)}}function Lr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xr(e){if(Array.isArray(e))return G(e)}function G(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ot=function(t){var r;if(Array.isArray(t)){var n;r=[],(n=r).push.apply(n,Mr(t))}else r={},Object.keys(t).forEach(function(i){r[i]=t[i]});return r};function R(e){"@babel/helpers - typeof";return R=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(e)}var Hr=Ot,Qr=function(t){var r=t;t instanceof this.constructor?r=t.all():R(t)==="object"&&(r=[],Object.keys(t).forEach(function(i){r.push(t[i])}));var n=Hr(this.items);return r.forEach(function(i){R(i)==="object"?Object.keys(i).forEach(function(s){return n.push(i[s])}):n.push(i)}),new this.constructor(n)};function St(e){return Yr(e)||Xr(e)||Gr(e)||zr()}function zr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
5
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gr(e,t){if(e){if(typeof e=="string")return X(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(e,t)}}function Xr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yr(e){if(Array.isArray(e))return X(e)}function X(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var E=function(t){var r=[];return Array.isArray(t)?r.push.apply(r,St(t)):t.constructor.name==="Collection"?r.push.apply(r,St(t.all())):Object.keys(t).forEach(function(n){return r.push(t[n])}),r};function Zr(e){return ee(e)||re(e)||te(e)||kr()}function kr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
6
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function te(e,t){if(e){if(typeof e=="string")return Y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Y(e,t)}}function re(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ee(e){if(Array.isArray(e))return Y(e)}function Y(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ne=E,ie=d,se=ie.isFunction,$t=function(t,r){if(r!==void 0)return Array.isArray(this.items)?this.items.filter(function(i){return i[t]!==void 0&&i[t]===r}).length>0:this.items[t]!==void 0&&this.items[t]===r;if(se(t))return this.items.filter(function(i,s){return t(i,s)}).length>0;if(Array.isArray(this.items))return this.items.indexOf(t)!==-1;var n=ne(this.items);return n.push.apply(n,Zr(Object.keys(this.items))),n.indexOf(t)!==-1},oe=function(){return this.count()===1},ae=function(){var t=0;return Array.isArray(this.items)&&(t=this.items.length),Math.max(Object.keys(this.items).length,t)},ue=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(r){return r};return new this.constructor(this.items).groupBy(t).map(function(r){return r.count()})},fe=function(){function t(s,o,u){var a=u[0];a instanceof o&&(a=a.all());for(var f=u.slice(1),p=!f.length,b=[],h=0;h<a.length;h+=1){var m=s.slice();m.push(a[h]),p?b.push(m):b=b.concat(t(m,o,f))}return b}for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return new this.constructor(t([],this.constructor,[].concat([this.items],n)))},ce=function(){this.dump(),typeof process<"u"&&process.exit(1)},le=function(t){var r;t instanceof this.constructor?r=t.all():r=t;var n=this.items.filter(function(i){return r.indexOf(i)===-1});return new this.constructor(n)},he=function(t){var r=this,n=t;t instanceof this.constructor&&(n=t.all());var i={};return Object.keys(this.items).forEach(function(s){(n[s]===void 0||n[s]!==r.items[s])&&(i[s]=r.items[s])}),new this.constructor(i)},pe=function(t){var r;t instanceof this.constructor?r=t.all():r=t;var n=Object.keys(r),i=Object.keys(this.items).filter(function(s){return n.indexOf(s)===-1});return new this.constructor(this.items).only(i)},ye=function(t,r){var n=this.items.filter(function(i){return!(t&&t.some(function(s){return r(i,s)===0}))});return new this.constructor(n)},me=function(t,r){return!this.contains(t,r)},de=function(){return console.log(this),this};function U(e){"@babel/helpers - typeof";return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U(e)}var ve=function(){var t=this,r=[],n={},i=function(o){return Array.isArray(o)||U(o)==="object"?JSON.stringify(o):o};return Array.isArray(this.items)?this.items.forEach(function(s,o){var u=i(s);r.indexOf(u)===-1?r.push(u):n[o]=s}):U(this.items)==="object"&&Object.keys(this.items).forEach(function(s){var o=i(t.items[s]);r.indexOf(o)===-1?r.push(o):n[s]=t.items[s]}),new this.constructor(n)},be=function(t){var r=!1;if(Array.isArray(this.items))for(var n=this.items.length,i=0;i<n&&!r;i+=1)r=t(this.items[i],i,this.items)===!1;else for(var s=Object.keys(this.items),o=s.length,u=0;u<o&&!r;u+=1){var a=s[u];r=t(this.items[a],a,this.items)===!1}return this};function ge(e){return Oe(e)||_e(e)||Ae(e)||we()}function we(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
7
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ae(e,t){if(e){if(typeof e=="string")return Z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Z(e,t)}}function _e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Oe(e){if(Array.isArray(e))return Z(e)}function Z(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Se=function(t){return this.each(function(r,n){t.apply(void 0,ge(r).concat([n]))}),this},$e=E,je=function(t){var r=$e(this.items);return r.every(t)},W=function(t){return Array.isArray(t[0])?t[0]:t},Ee=W,Ie=function(){for(var t=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=Ee(n);if(Array.isArray(this.items)){var o=this.items.filter(function(a){return s.indexOf(a)===-1});return new this.constructor(o)}var u={};return Object.keys(this.items).forEach(function(a){s.indexOf(a)===-1&&(u[a]=t.items[a])}),new this.constructor(u)};function k(e){"@babel/helpers - typeof";return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(e)}function jt(e){if(Array.isArray(e)){if(e.length)return!1}else if(e!=null&&k(e)==="object"){if(Object.keys(e).length)return!1}else if(e)return!1;return!0}function Ce(e,t){var r={};return Object.keys(t).forEach(function(n){e?e(t[n],n)&&(r[n]=t[n]):jt(t[n])||(r[n]=t[n])}),r}function Te(e,t){if(e)return t.filter(e);for(var r=[],n=0;n<t.length;n+=1){var i=t[n];jt(i)||r.push(i)}return r}var De=function(t){var r=t||!1,n=null;return Array.isArray(this.items)?n=Te(r,this.items):n=Ce(r,this.items),new this.constructor(n)},Fe=d,tt=Fe.isFunction,Pe=function(t,r){if(tt(t)){for(var n=Object.keys(this.items),i=0;i<n.length;i+=1){var s=n[i],o=this.items[s];if(t(o,s))return o}return tt(r)?r():r}if(Array.isArray(this.items)&&this.items.length||Object.keys(this.items).length){if(Array.isArray(this.items))return this.items[0];var u=Object.keys(this.items)[0];return this.items[u]}return tt(r)?r():r},Ne=d,Be=Ne.isFunction,qe=function(t,r,n){if(Be(t))return this.first(t,function(){throw new Error("Item not found.")});var i=this.where(t,r,n);if(i.isEmpty())throw new Error("Item not found.");return i.first()},Ke=function(t,r,n){return this.where(t,r,n).first()||null},Re=function(t){return this.map(t).collapse()},Et=d,rt=Et.isArray,et=Et.isObject,Ue=function(t){var r=t||1/0,n=!1,i=[],s=function(u){i=[],rt(u)?u.forEach(function(a){rt(a)?i=i.concat(a):et(a)?Object.keys(a).forEach(function(f){i=i.concat(a[f])}):i.push(a)}):Object.keys(u).forEach(function(a){rt(u[a])?i=i.concat(u[a]):et(u[a])?Object.keys(u[a]).forEach(function(f){i=i.concat(u[a][f])}):i.push(u[a])}),n=i.filter(function(a){return et(a)}),n=n.length===0,r-=1};for(s(this.items);!n&&r>0;)s(i);return new this.constructor(i)},We=function(){var t=this,r={};return Array.isArray(this.items)?Object.keys(this.items).forEach(function(n){r[t.items[n]]=Number(n)}):Object.keys(this.items).forEach(function(n){r[t.items[n]]=n}),new this.constructor(r)},Me=function(t,r){var n=this,i={};return Array.isArray(this.items)?i=this.items.slice(t*r-r,t*r):Object.keys(this.items).slice(t*r-r,t*r).forEach(function(s){i[s]=n.items[s]}),new this.constructor(i)},Je=function(t){return Array.isArray(this.items)?this.items.splice(t,1):delete this.items[t],this},Ve=d,Le=Ve.isFunction,xe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.items[t]!==void 0?this.items[t]:Le(r)?r():r!==null?r:null},I=function(t,r){try{return r.split(".").reduce(function(n,i){return n[i]},t)}catch{return t}},nt=I,He=d,Qe=He.isFunction,ze=function(t){var r=this,n={};return this.items.forEach(function(i,s){var o;Qe(t)?o=t(i,s):nt(i,t)||nt(i,t)===0?o=nt(i,t):o="",n[o]===void 0&&(n[o]=new r.constructor([])),n[o].push(i)}),new this.constructor(n)},Ge=W,Xe=function(){for(var t=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=Ge(n);return s.filter(function(o){return Object.hasOwnProperty.call(t.items,o)}).length===s.length},Ye=function(t,r){return r===void 0?this.items.join(t):new this.constructor(this.items).pluck(t).all().join(r)},Ze=function(t){var r=t;t instanceof this.constructor&&(r=t.all());var n=this.items.filter(function(i){return r.indexOf(i)!==-1});return new this.constructor(n)},ke=function(t){var r=this,n=Object.keys(t);t instanceof this.constructor&&(n=Object.keys(t.all()));var i={};return Object.keys(this.items).forEach(function(s){n.indexOf(s)!==-1&&(i[s]=r.items[s])}),new this.constructor(i)},tn=function(){return Array.isArray(this.items)?!this.items.length:!Object.keys(this.items).length},rn=function(){return!this.isEmpty()},en=function(t,r){var n=this.values();if(r===void 0)return n.implode(t);var i=n.count();if(i===0)return"";if(i===1)return n.last();var s=n.pop();return n.implode(t)+r+s},nn=I,sn=d,on=sn.isFunction,an=function(t){var r={};return on(t)?this.items.forEach(function(n){r[t(n)]=n}):this.items.forEach(function(n){var i=nn(n,t);r[i||""]=n}),new this.constructor(r)},un=function(){var t=Object.keys(this.items);return Array.isArray(this.items)&&(t=t.map(Number)),new this.constructor(t)},fn=d,It=fn.isFunction,cn=function(t,r){var n=this.items;if(It(t)&&(n=this.filter(t).all()),Array.isArray(n)&&!n.length||!Object.keys(n).length)return It(r)?r():r;if(Array.isArray(n))return n[n.length-1];var i=Object.keys(n);return n[i[i.length-1]]},ln=function(t,r){this.constructor.prototype[t]=r},hn=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return new this.constructor(t)},pn=function(t){var r=this;if(Array.isArray(this.items))return new this.constructor(this.items.map(t));var n={};return Object.keys(this.items).forEach(function(i){n[i]=t(r.items[i],i)}),new this.constructor(n)};function yn(e){return bn(e)||vn(e)||dn(e)||mn()}function mn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
8
8
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dn(e,t){if(e){if(typeof e=="string")return it(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return it(e,t)}}function vn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bn(e){if(Array.isArray(e))return it(e)}function it(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var gn=function(t){return this.map(function(r,n){return t.apply(void 0,yn(r).concat([n]))})};function wn(e,t){return Sn(e)||On(e,t)||_n(e,t)||An()}function An(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
9
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _n(e,t){if(e){if(typeof e=="string")return Ct(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ct(e,t)}}function Ct(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function On(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,s=!1,o,u;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(a){s=!0,u=a}finally{try{!i&&r.return!=null&&r.return()}finally{if(s)throw u}}return n}}function Sn(e){if(Array.isArray(e))return e}var $n=function(t){var r={};return this.items.forEach(function(n,i){var s=t(n,i),o=wn(s,2),u=o[0],a=o[1];r[u]===void 0?r[u]=[a]:r[u].push(a)}),new this.constructor(r)},jn=function(t){return this.map(function(r,n){return new t(r,n)})};function En(e,t){return
|
|
10
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cn(e,t){if(e){if(typeof e=="string")return Tt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tt(e,t)}}function Tt(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Tn(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,s=!1,o,u;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(a){s=!0,u=a}finally{try{!i&&r.return!=null&&r.return()}finally{if(s)throw u}}return n}}function
|
|
11
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nn(e,t){if(e){if(typeof e=="string")return Ft(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ft(e,t)}}function Ft(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Bn(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,s=!1,o,u;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(a){s=!0,u=a}finally{try{!i&&r.return!=null&&r.return()}finally{if(s)throw u}}return n}}function qn(e){if(Array.isArray(e))return e}var
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Un(e,t){if(e){if(typeof e=="string")return st(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return st(e,t)}}function Wn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Mn(e){if(Array.isArray(e))return st(e)}function st(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var
|
|
13
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gn(e,t){if(e){if(typeof e=="string")return ot(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ot(e,t)}}function zn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xn(e){if(Array.isArray(e))return ot(e)}function ot(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Yn=function(t){if(t!==void 0){var r=this.items.filter(function(n){return n[t]!==void 0});return Math.min.apply(Math,qt(r.map(function(n){return n[t]})))}return Math.min.apply(Math,qt(this.items))},Zn=function(t){var r=[],n=1;return this.items.length?(this.items.forEach(function(i){var s=r.filter(function(u){return t!==void 0?u.key===i[t]:u.key===i});if(!s.length)t!==void 0?r.push({key:i[t],count:1}):r.push({key:i,count:1});else{s[0].count+=1;var o=s[0].count;o>n&&(n=o)}}),r.filter(function(i){return i.count===n}).map(function(i){return i.key})):null},kn=E,ti=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=kn(this.items),i=n.slice(r).filter(function(s,o){return o%t===0});return new this.constructor(i)},ri=W,ei=function(){for(var t=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=ri(n);if(Array.isArray(this.items)){var o=this.items.filter(function(a){return s.indexOf(a)!==-1});return new this.constructor(o)}var u={};return Object.keys(this.items).forEach(function(a){s.indexOf(a)!==-1&&(u[a]=t.items[a])}),new this.constructor(u)},ni=Ot,ii=function(t,r){var n=Math.abs(t),i=this.count();if(n<=i)return this;for(var s=n-i,o=ni(this.items),u=Array.isArray(this.items),a=t<0,c=0;c<s;)u?a?o.unshift(r):o.push(r):o[c]!==void 0?s+=1:o[c]=r,c+=1;return new this.constructor(o)},si=function(t){var r=this,n;return Array.isArray(this.items)?(n=[new this.constructor([]),new this.constructor([])],this.items.forEach(function(i){t(i)===!0?n[0].push(i):n[1].push(i)})):(n=[new this.constructor({}),new this.constructor({})],Object.keys(this.items).forEach(function(i){var s=r.items[i];t(s)===!0?n[0].put(i,s):n[1].put(i,s)})),new this.constructor(n)},oi=function(t){return t(this)},xt=d,ai=xt.isArray,ui=xt.isObject,R=I,ci=function(t){var r={};return t.forEach(function(n,i){function s(o,u){ui(o)?Object.keys(o).forEach(function(a){s(o[a],"".concat(u,".").concat(a))}):ai(o)&&o.forEach(function(a,c){s(a,"".concat(u,".").concat(c))}),r[u]=o}s(n,i)}),r},fi=function(t,r){if(t.indexOf("*")!==-1){var n=ci(this.items),i=[];if(r!==void 0){var s=new RegExp("0.".concat(r),"g"),o="0.".concat(r).split(".").length;Object.keys(n).forEach(function(l){var m=l.match(s);if(m){var A=m[0];A.split(".").length===o&&i.push(n[A])}})}var u=[],a=new RegExp("0.".concat(t),"g"),c="0.".concat(t).split(".").length;if(Object.keys(n).forEach(function(l){var m=l.match(a);if(m){var A=m[0];A.split(".").length===c&&u.push(n[A])}}),r!==void 0){var h={};return this.items.forEach(function(l,m){h[i[m]||""]=u}),new this.constructor(h)}return new this.constructor([u])}if(r!==void 0){var b={};return this.items.forEach(function(l){R(l,t)!==void 0?b[l[r]||""]=R(l,t):b[l[r]||""]=null}),new this.constructor(b)}return this.map(function(l){return R(l,t)!==void 0?R(l,t):null})},li=W,Kt=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];li(n).forEach(function(s){delete t[s]})},Ut=d,hi=Ut.isArray,pi=Ut.isObject,Wt=Kt,yi=function(){var t=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(hi(this.items))return r===1?this.items.pop():new this.constructor(this.items.splice(-r));if(pi(this.items)){var n=Object.keys(this.items);if(r===1){var i=n[n.length-1],s=this.items[i];return Wt(this.items,i),s}var o=n.slice(-r),u=o.reduce(function(a,c){return a[c]=t.items[c],a},{});return Wt(this.items,o),new this.constructor(u)}return null},mi=function(t,r){return r!==void 0?this.put(r,t):(this.items.unshift(t),this)},di=d,vi=di.isFunction,bi=function(t,r){var n=this.items[t]||null;return!n&&r!==void 0&&(vi(r)?n=r():n=r),delete this.items[t],n},gi=function(){var t;return(t=this.items).push.apply(t,arguments),this},wi=function(t,r){return this.items[t]=r,this},Ai=E,_i=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=Ai(this.items),n=new this.constructor(r).shuffle();return t!==parseInt(t,10)?n.first():n.take(t)},Oi=function(t,r){var n=this,i=null;return r!==void 0&&(i=r),Array.isArray(this.items)?this.items.forEach(function(s){i=t(i,s)}):Object.keys(this.items).forEach(function(s){i=t(i,n.items[s],s)}),i},Si=function(t){return new this.constructor(this.items).filter(function(r){return!t(r)})};function Mt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mt(Object(r),!0).forEach(function(n){$i(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ji=function(t){if(!t)return this;if(Array.isArray(t)){var r=this.items.map(function(s,o){return t[o]||s});return new this.constructor(r)}if(t.constructor.name==="Collection"){var n=J(J({},this.items),t.all());return new this.constructor(n)}var i=J(J({},this.items),t);return new this.constructor(i)};function C(e){"@babel/helpers - typeof";return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(e)}function Rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rt(Object(r),!0).forEach(function(n){Ei(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ei(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ii=function(t){var r=function n(i,s){var o=D({},i),u=Object.keys(D(D({},i),s));return u.forEach(function(a){!Array.isArray(s[a])&&C(s[a])==="object"?o[a]=n(i[a],s[a]):i[a]===void 0&&s[a]!==void 0?C(i[a])==="object"?o[a]=D({},s[a]):o[a]=s[a]:i[a]!==void 0&&s[a]===void 0?C(i[a])==="object"?o[a]=D({},i[a]):o[a]=i[a]:i[a]!==void 0&&s[a]!==void 0&&(C(s[a])==="object"?o[a]=D({},s[a]):o[a]=s[a])}),o};return t?!Array.isArray(t)&&C(t)!=="object"?new this.constructor(r(this.items,[t])):t.constructor.name==="Collection"?new this.constructor(r(this.items,t.all())):new this.constructor(r(this.items,t)):this},Ci=function(){var t=[].concat(this.items).reverse();return new this.constructor(t)},at=d,Ti=at.isArray,Pi=at.isObject,Fi=at.isFunction,Di=function(t,r){var n=this,i,s=function(u,a){return Fi(t)?t(n.items[a],a):r?n.items[a]===t:n.items[a]==t};return Ti(this.items)?i=this.items.findIndex(s):Pi(this.items)&&(i=Object.keys(this.items).find(function(o){return s(n.items[o],o)})),i===void 0||i<0?!1:i},Jt=d,Ni=Jt.isArray,Bi=Jt.isObject,qi=Kt,xi=function(){var t=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(Ni(this.items))return r===1?this.items.shift():new this.constructor(this.items.splice(0,r));if(Bi(this.items)){if(r===1){var n=Object.keys(this.items)[0],i=this.items[n];return delete this.items[n],i}var s=Object.keys(this.items),o=s.slice(0,r),u=o.reduce(function(a,c){return a[c]=t.items[c],a},{});return qi(this.items,o),new this.constructor(u)}return null},Ki=E,Ui=function(){var t=Ki(this.items),r,n,i;for(i=t.length;i;i-=1)r=Math.floor(Math.random()*i),n=t[i-1],t[i-1]=t[r],t[r]=n;return this.items=t,this},Wi=d,Mi=Wi.isObject,Ri=function(t){var r=this;return Mi(this.items)?new this.constructor(Object.keys(this.items).reduce(function(n,i,s){return s+1>t&&(n[i]=r.items[i]),n},{})):new this.constructor(this.items.slice(t))},ut=d,Ji=ut.isArray,Vi=ut.isObject,Li=ut.isFunction,Hi=function(t){var r=this,n=null,i,s=function(u){return u===t};return Li(t)&&(s=t),Ji(this.items)&&(i=this.items.filter(function(o){return n!==!0&&(n=s(o)),n})),Vi(this.items)&&(i=Object.keys(this.items).reduce(function(o,u){return n!==!0&&(n=s(r.items[u])),n!==!1&&(o[u]=r.items[u]),o},{})),new this.constructor(i)},ct=d,Qi=ct.isArray,Gi=ct.isObject,zi=ct.isFunction,Xi=function(t){var r=this,n=null,i,s=function(u){return u===t};return zi(t)&&(s=t),Qi(this.items)&&(i=this.items.filter(function(o){return n!==!0&&(n=!s(o)),n})),Gi(this.items)&&(i=Object.keys(this.items).reduce(function(o,u){return n!==!0&&(n=!s(r.items[u])),n!==!1&&(o[u]=r.items[u]),o},{})),new this.constructor(i)},Yi=function(t,r){var n=this.items.slice(t);return r!==void 0&&(n=n.slice(0,r)),new this.constructor(n)},Zi=d,ki=Zi.isFunction,ts=function(t,r,n){var i;if(ki(t)?i=this.filter(t):i=this.where(t,r,n),i.isEmpty())throw new Error("Item not found.");if(i.count()>1)throw new Error("Multiple items found.");return i.first()},rs=$t,es=rs,ns=function(t){var r=[].concat(this.items);return t===void 0?this.every(function(n){return typeof n=="number"})?r.sort(function(n,i){return n-i}):r.sort():r.sort(t),new this.constructor(r)},is=function(){return this.sort().reverse()},ss=I,os=d,as=os.isFunction,us=function(t){var r=[].concat(this.items),n=function(s){return as(t)?t(s):ss(s,t)};return r.sort(function(i,s){var o=n(i),u=n(s);return o==null?1:u==null||o<u?-1:o>u?1:0}),new this.constructor(r)},cs=function(t){return this.sortBy(t).reverse()},fs=function(){var t=this,r={};return Object.keys(this.items).sort().forEach(function(n){r[n]=t.items[n]}),new this.constructor(r)},ls=function(){var t=this,r={};return Object.keys(this.items).sort().reverse().forEach(function(n){r[n]=t.items[n]}),new this.constructor(r)},hs=function(t,r,n){var i=this.slice(t,r);if(this.items=this.diff(i.all()).all(),Array.isArray(n))for(var s=0,o=n.length;s<o;s+=1)this.items.splice(t+s,0,n[s]);return i},ps=function(t){for(var r=Math.round(this.items.length/t),n=JSON.parse(JSON.stringify(this.items)),i=[],s=0;s<t;s+=1)i.push(new this.constructor(n.splice(0,r)));return new this.constructor(i)},ys=E,ms=d,ds=ms.isFunction,vs=function(t){var r=ys(this.items),n=0;if(t===void 0)for(var i=0,s=r.length;i<s;i+=1)n+=parseFloat(r[i]);else if(ds(t))for(var o=0,u=r.length;o<u;o+=1)n+=parseFloat(t(r[o]));else for(var a=0,c=r.length;a<c;a+=1)n+=parseFloat(r[a][t]);return parseFloat(n.toPrecision(12))};function ft(e){"@babel/helpers - typeof";return ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ft(e)}var bs=function(t){var r=this;if(!Array.isArray(this.items)&&ft(this.items)==="object"){var n=Object.keys(this.items),i;t<0?i=n.slice(t):i=n.slice(0,t);var s={};return n.forEach(function(o){i.indexOf(o)!==-1&&(s[o]=r.items[o])}),new this.constructor(s)}return t<0?new this.constructor(this.items.slice(t)):new this.constructor(this.items.slice(0,t))},lt=d,gs=lt.isArray,ws=lt.isObject,As=lt.isFunction,_s=function(t){var r=this,n=null,i,s=function(u){return u===t};return As(t)&&(s=t),gs(this.items)&&(i=this.items.filter(function(o){return n!==!1&&(n=!s(o)),n})),ws(this.items)&&(i=Object.keys(this.items).reduce(function(o,u){return n!==!1&&(n=!s(r.items[u])),n!==!1&&(o[u]=r.items[u]),o},{})),new this.constructor(i)},ht=d,Os=ht.isArray,Ss=ht.isObject,$s=ht.isFunction,js=function(t){var r=this,n=null,i,s=function(u){return u===t};return $s(t)&&(s=t),Os(this.items)&&(i=this.items.filter(function(o){return n!==!1&&(n=s(o)),n})),Ss(this.items)&&(i=Object.keys(this.items).reduce(function(o,u){return n!==!1&&(n=s(r.items[u])),n!==!1&&(o[u]=r.items[u]),o},{})),new this.constructor(i)},Es=function(t){return t(this),this},Is=function(t,r){for(var n=1;n<=t;n+=1)this.items.push(r(n));return this},Cs=function(){var t=this.constructor;function r(i,s){var o=[];i instanceof t?(i.items.forEach(function(u){return r(u,o)}),s.push(o)):Array.isArray(i)?(i.forEach(function(u){return r(u,o)}),s.push(o)):s.push(i)}if(Array.isArray(this.items)){var n=[];return this.items.forEach(function(i){r(i,n)}),n}return this.values().all()};function pt(e){"@babel/helpers - typeof";return pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pt(e)}var Ts=function(){return pt(this.items)==="object"&&!Array.isArray(this.items)?JSON.stringify(this.all()):JSON.stringify(this.toArray())},Ps=function(t){var r=this;if(Array.isArray(this.items))this.items=this.items.map(t);else{var n={};Object.keys(this.items).forEach(function(i){n[i]=t(r.items[i],i)}),this.items=n}return this};function Vt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Lt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vt(Object(r),!0).forEach(function(n){Fs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ds=function(){var t=this;if(Array.isArray(this.items))return this;var r={};return Object.keys(this.items).forEach(function(n){if(n.indexOf(".")!==-1){var i=r;n.split(".").reduce(function(s,o,u,a){return s[o]||(s[o]={}),u===a.length-1&&(s[o]=t.items[n]),s[o]},i),r=Lt(Lt({},r),i)}else r[n]=t.items[n]}),new this.constructor(r)},Ns=function(t,r,n){t?n(this):r(this)},Ht=function(t,r){if(Array.isArray(this.items)&&this.items.length)return t(this);if(Object.keys(this.items).length)return t(this);if(r!==void 0){if(Array.isArray(this.items)&&!this.items.length)return r(this);if(!Object.keys(this.items).length)return r(this)}return this},Qt=function(t,r){if(Array.isArray(this.items)&&!this.items.length)return t(this);if(!Object.keys(this.items).length)return t(this);if(r!==void 0){if(Array.isArray(this.items)&&this.items.length)return r(this);if(Object.keys(this.items).length)return r(this)}return this},Bs=function(t){var r=this,n=JSON.parse(JSON.stringify(this.items));return Object.keys(t).forEach(function(i){r.items[i]===void 0&&(n[i]=t[i])}),new this.constructor(n)},qs=d,xs=qs.isFunction,Ks=function(t){var r;if(t===void 0)r=this.items.filter(function(u,a,c){return c.indexOf(u)===a});else{r=[];for(var n=[],i=0,s=this.items.length;i<s;i+=1){var o=void 0;xs(t)?o=t(this.items[i]):o=this.items[i][t],n.indexOf(o)===-1&&(r.push(this.items[i]),n.push(o))}}return new this.constructor(r)},Us=function(t){return t instanceof this.constructor?t.all():t},Ws=E,Ms=function(){return new this.constructor(Ws(this.items))},Rs=function(t,r,n){return t?r(this,t):n?n(this,t):this},Js=E,$=I,Vs=function(t,r,n){var i=r,s=n,o=Js(this.items);if(r===void 0||r===!0)return new this.constructor(o.filter(function(a){return $(a,t)}));if(r===!1)return new this.constructor(o.filter(function(a){return!$(a,t)}));n===void 0&&(s=r,i="===");var u=o.filter(function(a){switch(i){case"==":return $(a,t)===Number(s)||$(a,t)===s.toString();default:case"===":return $(a,t)===s;case"!=":case"<>":return $(a,t)!==Number(s)&&$(a,t)!==s.toString();case"!==":return $(a,t)!==s;case"<":return $(a,t)<s;case"<=":return $(a,t)<=s;case">":return $(a,t)>s;case">=":return $(a,t)>=s}});return new this.constructor(u)},Ls=function(t,r){return this.where(t,">=",r[0]).where(t,"<=",r[r.length-1])},Hs=E,Qs=I,Gs=function(t,r){var n=Hs(r),i=this.items.filter(function(s){return n.indexOf(Qs(s,t))!==-1});return new this.constructor(i)},zs=function(t){return this.filter(function(r){return r instanceof t})},Gt=I,Xs=function(t,r){return this.filter(function(n){return Gt(n,t)<r[0]||Gt(n,t)>r[r.length-1]})},Ys=E,Zs=I,ks=function(t,r){var n=Ys(r),i=this.items.filter(function(s){return n.indexOf(Zs(s,t))===-1});return new this.constructor(i)},to=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(t,"===",null)},ro=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(t,"!==",null)};function yt(e){"@babel/helpers - typeof";return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(e)}var eo=function(t){return t instanceof this.constructor?t:yt(t)==="object"?new this.constructor(t):new this.constructor([t])},no=function(t){var r=this,n=t;n instanceof this.constructor&&(n=n.all());var i=this.items.map(function(s,o){return new r.constructor([s,n[o]])});return new this.constructor(i)};(function(e){function t(s){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t(s)}function r(s){s!==void 0&&!Array.isArray(s)&&t(s)!=="object"?this.items=[s]:s instanceof this.constructor?this.items=s.all():this.items=s||[]}var n=_r;typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=n),r.prototype.toJSON=function(){return this.items},r.prototype.all=Or,r.prototype.average=At,r.prototype.avg=Er,r.prototype.chunk=Ir,r.prototype.collapse=Nr,r.prototype.combine=Wr,r.prototype.concat=Qr,r.prototype.contains=$t,r.prototype.containsOneItem=oe,r.prototype.count=ae,r.prototype.countBy=ue,r.prototype.crossJoin=ce,r.prototype.dd=fe,r.prototype.diff=le,r.prototype.diffAssoc=he,r.prototype.diffKeys=pe,r.prototype.diffUsing=ye,r.prototype.doesntContain=me,r.prototype.dump=de,r.prototype.duplicates=ve,r.prototype.each=be,r.prototype.eachSpread=Se,r.prototype.every=je,r.prototype.except=Ie,r.prototype.filter=Pe,r.prototype.first=De,r.prototype.firstOrFail=qe,r.prototype.firstWhere=xe,r.prototype.flatMap=Ke,r.prototype.flatten=Ue,r.prototype.flip=We,r.prototype.forPage=Me,r.prototype.forget=Re,r.prototype.get=Le,r.prototype.groupBy=Ge,r.prototype.has=Xe,r.prototype.implode=Ye,r.prototype.intersect=Ze,r.prototype.intersectByKeys=ke,r.prototype.isEmpty=tn,r.prototype.isNotEmpty=rn,r.prototype.join=en,r.prototype.keyBy=an,r.prototype.keys=un,r.prototype.last=fn,r.prototype.macro=ln,r.prototype.make=hn,r.prototype.map=pn,r.prototype.mapSpread=gn,r.prototype.mapToDictionary=$n,r.prototype.mapInto=jn,r.prototype.mapToGroups=Fn,r.prototype.mapWithKeys=xn,r.prototype.max=Rn,r.prototype.median=Jn,r.prototype.merge=Vn,r.prototype.mergeRecursive=Hn,r.prototype.min=Yn,r.prototype.mode=Zn,r.prototype.nth=ti,r.prototype.only=ei,r.prototype.pad=ii,r.prototype.partition=si,r.prototype.pipe=oi,r.prototype.pluck=fi,r.prototype.pop=yi,r.prototype.prepend=mi,r.prototype.pull=bi,r.prototype.push=gi,r.prototype.put=wi,r.prototype.random=_i,r.prototype.reduce=Oi,r.prototype.reject=Si,r.prototype.replace=ji,r.prototype.replaceRecursive=Ii,r.prototype.reverse=Ci,r.prototype.search=Di,r.prototype.shift=xi,r.prototype.shuffle=Ui,r.prototype.skip=Ri,r.prototype.skipUntil=Hi,r.prototype.skipWhile=Xi,r.prototype.slice=Yi,r.prototype.sole=ts,r.prototype.some=es,r.prototype.sort=ns,r.prototype.sortDesc=is,r.prototype.sortBy=us,r.prototype.sortByDesc=cs,r.prototype.sortKeys=fs,r.prototype.sortKeysDesc=ls,r.prototype.splice=hs,r.prototype.split=ps,r.prototype.sum=vs,r.prototype.take=bs,r.prototype.takeUntil=_s,r.prototype.takeWhile=js,r.prototype.tap=Es,r.prototype.times=Is,r.prototype.toArray=Cs,r.prototype.toJson=Ts,r.prototype.transform=Ps,r.prototype.undot=Ds,r.prototype.unless=Ns,r.prototype.unlessEmpty=Ht,r.prototype.unlessNotEmpty=Qt,r.prototype.union=Bs,r.prototype.unique=Ks,r.prototype.unwrap=Us,r.prototype.values=Ms,r.prototype.when=Rs,r.prototype.whenEmpty=Qt,r.prototype.whenNotEmpty=Ht,r.prototype.where=Vs,r.prototype.whereBetween=Ls,r.prototype.whereIn=Gs,r.prototype.whereInstanceOf=zs,r.prototype.whereNotBetween=Xs,r.prototype.whereNotIn=ks,r.prototype.whereNull=to,r.prototype.whereNotNull=ro,r.prototype.wrap=eo,r.prototype.zip=no;var i=function(o){return new r(o)};e.exports=i,e.exports.collect=i,e.exports.default=i,e.exports.Collection=r})(wt);var io=wt.exports;const zt=Ar(io),Xt=["chunk","shuffle","splice","sortBy","map","reverse","groupBy","implode","keyBy","keys","mapToDictionary","mapWithKeys","nth","skipUntil","skipWhile","takeUntil","takeWhile","unique"],so=["forPage","sortByDesc","sortBy","skip","take","splice","whereBetween","whereIn","whereNotBetween","whereNotIn","first","where","whereContains"],oo=["avg","count","countBy","dd","each","every","filter","firstWhere","isEmpty","isNotEmpty","last","mapToGroups","max","median","min","mode","contains","sole","sort","split","sum","toJson"];class j{constructor(t,r){S(this,"data_path","");S(this,"axios");S(this,"filters");S(this,"steps");S(this,"fields");S(this,"already_limit",!1);S(this,"already_offset",!1);S(this,"limit",null);S(this,"offset",null);S(this,"_sort",null);S(this,"_sortDesc",!1);S(this,"meta",{});this.axios=r,this.filters={},this.steps=[],this.fields=t}}j.prototype.dataPath=function(e){const t=this.clone();return t.data_path=e,t},j.prototype.buildArgs=function(){let e={};return Object.keys(this.filters).length>0&&(e.filters=this.filters),this._sort&&(e.sort=this._sort,this._sortDesc&&(e.sort+=":desc")),e},j.prototype.clone=function(){const e=Object.create(this);return e.steps=[...this.steps],e},zt().macro("whereContains",function(e,t){return this.filter(r=>r[e].toLowerCase().includes(t.toLowerCase()))}),j.prototype.fetchData=async function(){let e={meta:{total:!0,key:!0,name:!0}};e.__args=this.buildArgs(),e.data=this.fields,this.already_limit&&(e.data.__args=e.data.__args||{},e.data.__args.limit=this.limit),this.already_offset&&(e.data.__args=e.data.__args||{},e.data.__args.offset=this.offset);const t=this.data_path.split(".");let r={},n=r,i=t[t.length-1];for(const u of t){if(u===i){n[u]=e;break}n[u]={},n=n[u]}let o=await O(this.axios,r);for(const u of t)o=o[u];return this.meta=o.meta,zt(o.data)},j.prototype.processData=async function(){let e=null;for(const t of this.steps){if(Xt.includes(t.type)){e||(e=await this.fetchData()),e=e[t.type](...t.args);continue}if(t.type==="forPage"&&(e?e=e.forPage(t.args[0],t.args[1]):this.already_limit||this.already_offset?(e=await this.fetchData(),e=e.forPage(t.args[0],t.args[1])):(this.offset=(t.args[0]-1)*t.args[1],this.limit=t.args[1]),this.already_limit=!0,this.already_offset=!0),t.type==="where")if(e)e=e.where(...t.args);else{const r=t.args[0];let n="==",i=null;t.args.length==2&&(i=t.args[1]),t.args.length==3&&(n=t.args[1],i=t.args[2]),n==="=="&&(this.filters[r]=i),n==="<"&&(this.filters[r]={lt:i}),n==="<="&&(this.filters[r]={lte:i}),n===">"&&(this.filters[r]={gt:i}),n===">="&&(this.filters[r]={gte:i}),n==="!=="&&(this.filters[r]={ne:i})}t.type==="whereContains"&&(e?e=e.whereContains(...t.args):this.filters[t.args[0]]={contains:t.args[1]}),t.type==="whereIn"&&(e?e=e.whereIn(...t.args):this.filters[t.args[0]]={in:t.args[1]}),t.type==="whereNotBetween"&&(e?e=e.whereNotBetween(...t.args):this.filters[t.args[0]]={notBetween:t.args[1]}),t.type==="whereNotIn"&&(e?e=e.whereNotIn(...t.args):this.filters[t.args[0]]={notIn:t.args[1]}),t.type=="whereBetween"&&(e?e=e.whereBetween(...t.args):this.filters[t.args[0]]={between:t.args[1]}),t.type==="sortByDesc"&&(e?e=e.sortByDesc(t.args[0]):this.already_limit||this.already_offset?(e=await this.fetchData(),e=e.sortByDesc(t.args[0])):(this._sort=t.args[0],this._sortDesc=!0)),t.type==="sortBy"&&(e?e=e.sortBy(t.args[0]):this.already_limit||this.already_offset?(e=await this.fetchData(),e=e.sortBy(t.args[0])):this._sort=t.args[0]),t.type==="skip"&&(e?e=e.skip(t.args[0]):this.already_offset||this.already_limit?(e=await this.fetchData(),e=e.skip(t.args[0])):this.offset=t.args[0],this.already_offset=!0),t.type==="take"&&(e?e=e.take(...t.args):this.already_offset||this.already_limit?(e=await this.fetchData(),e=e.take(t.args[0])):this.limit=t.args[0],this.already_limit=!0),t.type==="splice"&&(e?e=e.splice(...t.args):(this.offset=t.args[0],this.limit=t.args[1]),this.already_limit=!0,this.already_offset=!0)}return e||(e=await this.fetchData()),e},j.prototype.all=async function(){return(await this.processData()).all()};for(const e of[...Xt,...so])j.prototype[e]=function(...t){const r=this.clone();return r.steps.push({type:e,args:t}),r};for(const e of oo)j.prototype[e]=async function(...t){return(await this.clone().processData())[e](...t)};j.prototype.average=j.prototype.avg,j.prototype.first=async function(){return this.take(1),(await this.processData()).first()};const Yt=(e,t,r)=>{const n=new j(r,t);return n.data_path="list"+e,n},ao=e=>{const t=P.create({baseURL:e,withCredentials:!0}),r=(s,o=null,u=[])=>y(t,s,o,u),n=s=>O(t,s),i=gr(t);return{baseURL:e,axios:t,auth:cr(t),mutation:r,query:n,config:dr(n),mail:vr(t),users:br(t),fs:mr(t),models:i,model(s){return i.get(s)},roles:wr(t),collect:(s,o)=>{const u=Yt(s,t,o);return u.data_path=i.get(s).getDataPath(),u}}};g.File=hr,g.createClient=ao,g.createCollection=Yt,g.file=q,g.mutation=y,g.query=O,g.toQuery=B,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
9
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _n(e,t){if(e){if(typeof e=="string")return Ct(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ct(e,t)}}function Ct(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function On(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,s=!1,o,u;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(a){s=!0,u=a}finally{try{!i&&r.return!=null&&r.return()}finally{if(s)throw u}}return n}}function Sn(e){if(Array.isArray(e))return e}var $n=function(t){var r={};return this.items.forEach(function(n,i){var s=t(n,i),o=wn(s,2),u=o[0],a=o[1];r[u]===void 0?r[u]=[a]:r[u].push(a)}),new this.constructor(r)},jn=function(t){return this.map(function(r,n){return new t(r,n)})};function En(e,t){return Dn(e)||Tn(e,t)||Cn(e,t)||In()}function In(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
10
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cn(e,t){if(e){if(typeof e=="string")return Tt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tt(e,t)}}function Tt(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Tn(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,s=!1,o,u;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(a){s=!0,u=a}finally{try{!i&&r.return!=null&&r.return()}finally{if(s)throw u}}return n}}function Dn(e){if(Array.isArray(e))return e}var Fn=function(t){var r={};return this.items.forEach(function(n,i){var s=t(n,i),o=En(s,2),u=o[0],a=o[1];r[u]===void 0?r[u]=[a]:r[u].push(a)}),new this.constructor(r)};function Dt(e,t){return qn(e)||Bn(e,t)||Nn(e,t)||Pn()}function Pn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
11
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nn(e,t){if(e){if(typeof e=="string")return Ft(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ft(e,t)}}function Ft(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Bn(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,s=!1,o,u;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(a){s=!0,u=a}finally{try{!i&&r.return!=null&&r.return()}finally{if(s)throw u}}return n}}function qn(e){if(Array.isArray(e))return e}var Kn=function(t){var r=this,n={};return Array.isArray(this.items)?this.items.forEach(function(i,s){var o=t(i,s),u=Dt(o,2),a=u[0],f=u[1];n[a]=f}):Object.keys(this.items).forEach(function(i){var s=t(r.items[i],i),o=Dt(s,2),u=o[0],a=o[1];n[u]=a}),new this.constructor(n)};function Pt(e){return Mn(e)||Wn(e)||Un(e)||Rn()}function Rn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
12
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Un(e,t){if(e){if(typeof e=="string")return st(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return st(e,t)}}function Wn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Mn(e){if(Array.isArray(e))return st(e)}function st(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Jn=function(t){if(typeof t=="string"){var r=this.items.filter(function(n){return n[t]!==void 0});return Math.max.apply(Math,Pt(r.map(function(n){return n[t]})))}return Math.max.apply(Math,Pt(this.items))},Vn=function(t){var r=this.items.length;return t===void 0?r%2===0?(this.items[r/2-1]+this.items[r/2])/2:this.items[Math.floor(r/2)]:r%2===0?(this.items[r/2-1][t]+this.items[r/2][t])/2:this.items[Math.floor(r/2)][t]},Ln=function(t){var r=t;if(typeof r=="string"&&(r=[r]),Array.isArray(this.items)&&Array.isArray(r))return new this.constructor(this.items.concat(r));var n=JSON.parse(JSON.stringify(this.items));return Object.keys(r).forEach(function(i){n[i]=r[i]}),new this.constructor(n)};function M(e){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function Nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nt(Object(r),!0).forEach(function(n){xn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Hn=function(t){var r=function n(i,s){var o={},u=Object.keys(Bt(Bt({},i),s));return u.forEach(function(a){i[a]===void 0&&s[a]!==void 0?o[a]=s[a]:i[a]!==void 0&&s[a]===void 0?o[a]=i[a]:i[a]!==void 0&&s[a]!==void 0&&(i[a]===s[a]?o[a]=i[a]:!Array.isArray(i[a])&&M(i[a])==="object"&&!Array.isArray(s[a])&&M(s[a])==="object"?o[a]=n(i[a],s[a]):o[a]=[].concat(i[a],s[a]))}),o};return t?t.constructor.name==="Collection"?new this.constructor(r(this.items,t.all())):new this.constructor(r(this.items,t)):this};function qt(e){return Xn(e)||Gn(e)||zn(e)||Qn()}function Qn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
13
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zn(e,t){if(e){if(typeof e=="string")return ot(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ot(e,t)}}function Gn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xn(e){if(Array.isArray(e))return ot(e)}function ot(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Yn=function(t){if(t!==void 0){var r=this.items.filter(function(n){return n[t]!==void 0});return Math.min.apply(Math,qt(r.map(function(n){return n[t]})))}return Math.min.apply(Math,qt(this.items))},Zn=function(t){var r=[],n=1;return this.items.length?(this.items.forEach(function(i){var s=r.filter(function(u){return t!==void 0?u.key===i[t]:u.key===i});if(!s.length)t!==void 0?r.push({key:i[t],count:1}):r.push({key:i,count:1});else{s[0].count+=1;var o=s[0].count;o>n&&(n=o)}}),r.filter(function(i){return i.count===n}).map(function(i){return i.key})):null},kn=E,ti=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=kn(this.items),i=n.slice(r).filter(function(s,o){return o%t===0});return new this.constructor(i)},ri=W,ei=function(){for(var t=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=ri(n);if(Array.isArray(this.items)){var o=this.items.filter(function(a){return s.indexOf(a)!==-1});return new this.constructor(o)}var u={};return Object.keys(this.items).forEach(function(a){s.indexOf(a)!==-1&&(u[a]=t.items[a])}),new this.constructor(u)},ni=Ot,ii=function(t,r){var n=Math.abs(t),i=this.count();if(n<=i)return this;for(var s=n-i,o=ni(this.items),u=Array.isArray(this.items),a=t<0,f=0;f<s;)u?a?o.unshift(r):o.push(r):o[f]!==void 0?s+=1:o[f]=r,f+=1;return new this.constructor(o)},si=function(t){var r=this,n;return Array.isArray(this.items)?(n=[new this.constructor([]),new this.constructor([])],this.items.forEach(function(i){t(i)===!0?n[0].push(i):n[1].push(i)})):(n=[new this.constructor({}),new this.constructor({})],Object.keys(this.items).forEach(function(i){var s=r.items[i];t(s)===!0?n[0].put(i,s):n[1].put(i,s)})),new this.constructor(n)},oi=function(t){return t(this)},Kt=d,ai=Kt.isArray,ui=Kt.isObject,J=I,fi=function(t){var r={};return t.forEach(function(n,i){function s(o,u){ui(o)?Object.keys(o).forEach(function(a){s(o[a],"".concat(u,".").concat(a))}):ai(o)&&o.forEach(function(a,f){s(a,"".concat(u,".").concat(f))}),r[u]=o}s(n,i)}),r},ci=function(t,r){if(t.indexOf("*")!==-1){var n=fi(this.items),i=[];if(r!==void 0){var s=new RegExp("0.".concat(r),"g"),o="0.".concat(r).split(".").length;Object.keys(n).forEach(function(h){var m=h.match(s);if(m){var _=m[0];_.split(".").length===o&&i.push(n[_])}})}var u=[],a=new RegExp("0.".concat(t),"g"),f="0.".concat(t).split(".").length;if(Object.keys(n).forEach(function(h){var m=h.match(a);if(m){var _=m[0];_.split(".").length===f&&u.push(n[_])}}),r!==void 0){var p={};return this.items.forEach(function(h,m){p[i[m]||""]=u}),new this.constructor(p)}return new this.constructor([u])}if(r!==void 0){var b={};return this.items.forEach(function(h){J(h,t)!==void 0?b[h[r]||""]=J(h,t):b[h[r]||""]=null}),new this.constructor(b)}return this.map(function(h){return J(h,t)!==void 0?J(h,t):null})},li=W,Rt=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];li(n).forEach(function(s){delete t[s]})},Ut=d,hi=Ut.isArray,pi=Ut.isObject,Wt=Rt,yi=function(){var t=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(hi(this.items))return r===1?this.items.pop():new this.constructor(this.items.splice(-r));if(pi(this.items)){var n=Object.keys(this.items);if(r===1){var i=n[n.length-1],s=this.items[i];return Wt(this.items,i),s}var o=n.slice(-r),u=o.reduce(function(a,f){return a[f]=t.items[f],a},{});return Wt(this.items,o),new this.constructor(u)}return null},mi=function(t,r){return r!==void 0?this.put(r,t):(this.items.unshift(t),this)},di=d,vi=di.isFunction,bi=function(t,r){var n=this.items[t]||null;return!n&&r!==void 0&&(vi(r)?n=r():n=r),delete this.items[t],n},gi=function(){var t;return(t=this.items).push.apply(t,arguments),this},wi=function(t,r){return this.items[t]=r,this},Ai=E,_i=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=Ai(this.items),n=new this.constructor(r).shuffle();return t!==parseInt(t,10)?n.first():n.take(t)},Oi=function(t,r){var n=this,i=null;return r!==void 0&&(i=r),Array.isArray(this.items)?this.items.forEach(function(s){i=t(i,s)}):Object.keys(this.items).forEach(function(s){i=t(i,n.items[s],s)}),i},Si=function(t){return new this.constructor(this.items).filter(function(r){return!t(r)})};function Mt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mt(Object(r),!0).forEach(function(n){$i(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ji=function(t){if(!t)return this;if(Array.isArray(t)){var r=this.items.map(function(s,o){return t[o]||s});return new this.constructor(r)}if(t.constructor.name==="Collection"){var n=V(V({},this.items),t.all());return new this.constructor(n)}var i=V(V({},this.items),t);return new this.constructor(i)};function C(e){"@babel/helpers - typeof";return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(e)}function Jt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jt(Object(r),!0).forEach(function(n){Ei(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ei(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ii=function(t){var r=function n(i,s){var o=P({},i),u=Object.keys(P(P({},i),s));return u.forEach(function(a){!Array.isArray(s[a])&&C(s[a])==="object"?o[a]=n(i[a],s[a]):i[a]===void 0&&s[a]!==void 0?C(i[a])==="object"?o[a]=P({},s[a]):o[a]=s[a]:i[a]!==void 0&&s[a]===void 0?C(i[a])==="object"?o[a]=P({},i[a]):o[a]=i[a]:i[a]!==void 0&&s[a]!==void 0&&(C(s[a])==="object"?o[a]=P({},s[a]):o[a]=s[a])}),o};return t?!Array.isArray(t)&&C(t)!=="object"?new this.constructor(r(this.items,[t])):t.constructor.name==="Collection"?new this.constructor(r(this.items,t.all())):new this.constructor(r(this.items,t)):this},Ci=function(){var t=[].concat(this.items).reverse();return new this.constructor(t)},at=d,Ti=at.isArray,Di=at.isObject,Fi=at.isFunction,Pi=function(t,r){var n=this,i,s=function(u,a){return Fi(t)?t(n.items[a],a):r?n.items[a]===t:n.items[a]==t};return Ti(this.items)?i=this.items.findIndex(s):Di(this.items)&&(i=Object.keys(this.items).find(function(o){return s(n.items[o],o)})),i===void 0||i<0?!1:i},Vt=d,Ni=Vt.isArray,Bi=Vt.isObject,qi=Rt,Ki=function(){var t=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(Ni(this.items))return r===1?this.items.shift():new this.constructor(this.items.splice(0,r));if(Bi(this.items)){if(r===1){var n=Object.keys(this.items)[0],i=this.items[n];return delete this.items[n],i}var s=Object.keys(this.items),o=s.slice(0,r),u=o.reduce(function(a,f){return a[f]=t.items[f],a},{});return qi(this.items,o),new this.constructor(u)}return null},Ri=E,Ui=function(){var t=Ri(this.items),r,n,i;for(i=t.length;i;i-=1)r=Math.floor(Math.random()*i),n=t[i-1],t[i-1]=t[r],t[r]=n;return this.items=t,this},Wi=d,Mi=Wi.isObject,Ji=function(t){var r=this;return Mi(this.items)?new this.constructor(Object.keys(this.items).reduce(function(n,i,s){return s+1>t&&(n[i]=r.items[i]),n},{})):new this.constructor(this.items.slice(t))},ut=d,Vi=ut.isArray,Li=ut.isObject,xi=ut.isFunction,Hi=function(t){var r=this,n=null,i,s=function(u){return u===t};return xi(t)&&(s=t),Vi(this.items)&&(i=this.items.filter(function(o){return n!==!0&&(n=s(o)),n})),Li(this.items)&&(i=Object.keys(this.items).reduce(function(o,u){return n!==!0&&(n=s(r.items[u])),n!==!1&&(o[u]=r.items[u]),o},{})),new this.constructor(i)},ft=d,Qi=ft.isArray,zi=ft.isObject,Gi=ft.isFunction,Xi=function(t){var r=this,n=null,i,s=function(u){return u===t};return Gi(t)&&(s=t),Qi(this.items)&&(i=this.items.filter(function(o){return n!==!0&&(n=!s(o)),n})),zi(this.items)&&(i=Object.keys(this.items).reduce(function(o,u){return n!==!0&&(n=!s(r.items[u])),n!==!1&&(o[u]=r.items[u]),o},{})),new this.constructor(i)},Yi=function(t,r){var n=this.items.slice(t);return r!==void 0&&(n=n.slice(0,r)),new this.constructor(n)},Zi=d,ki=Zi.isFunction,ts=function(t,r,n){var i;if(ki(t)?i=this.filter(t):i=this.where(t,r,n),i.isEmpty())throw new Error("Item not found.");if(i.count()>1)throw new Error("Multiple items found.");return i.first()},rs=$t,es=rs,ns=function(t){var r=[].concat(this.items);return t===void 0?this.every(function(n){return typeof n=="number"})?r.sort(function(n,i){return n-i}):r.sort():r.sort(t),new this.constructor(r)},is=function(){return this.sort().reverse()},ss=I,os=d,as=os.isFunction,us=function(t){var r=[].concat(this.items),n=function(s){return as(t)?t(s):ss(s,t)};return r.sort(function(i,s){var o=n(i),u=n(s);return o==null?1:u==null||o<u?-1:o>u?1:0}),new this.constructor(r)},fs=function(t){return this.sortBy(t).reverse()},cs=function(){var t=this,r={};return Object.keys(this.items).sort().forEach(function(n){r[n]=t.items[n]}),new this.constructor(r)},ls=function(){var t=this,r={};return Object.keys(this.items).sort().reverse().forEach(function(n){r[n]=t.items[n]}),new this.constructor(r)},hs=function(t,r,n){var i=this.slice(t,r);if(this.items=this.diff(i.all()).all(),Array.isArray(n))for(var s=0,o=n.length;s<o;s+=1)this.items.splice(t+s,0,n[s]);return i},ps=function(t){for(var r=Math.round(this.items.length/t),n=JSON.parse(JSON.stringify(this.items)),i=[],s=0;s<t;s+=1)i.push(new this.constructor(n.splice(0,r)));return new this.constructor(i)},ys=E,ms=d,ds=ms.isFunction,vs=function(t){var r=ys(this.items),n=0;if(t===void 0)for(var i=0,s=r.length;i<s;i+=1)n+=parseFloat(r[i]);else if(ds(t))for(var o=0,u=r.length;o<u;o+=1)n+=parseFloat(t(r[o]));else for(var a=0,f=r.length;a<f;a+=1)n+=parseFloat(r[a][t]);return parseFloat(n.toPrecision(12))};function ct(e){"@babel/helpers - typeof";return ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(e)}var bs=function(t){var r=this;if(!Array.isArray(this.items)&&ct(this.items)==="object"){var n=Object.keys(this.items),i;t<0?i=n.slice(t):i=n.slice(0,t);var s={};return n.forEach(function(o){i.indexOf(o)!==-1&&(s[o]=r.items[o])}),new this.constructor(s)}return t<0?new this.constructor(this.items.slice(t)):new this.constructor(this.items.slice(0,t))},lt=d,gs=lt.isArray,ws=lt.isObject,As=lt.isFunction,_s=function(t){var r=this,n=null,i,s=function(u){return u===t};return As(t)&&(s=t),gs(this.items)&&(i=this.items.filter(function(o){return n!==!1&&(n=!s(o)),n})),ws(this.items)&&(i=Object.keys(this.items).reduce(function(o,u){return n!==!1&&(n=!s(r.items[u])),n!==!1&&(o[u]=r.items[u]),o},{})),new this.constructor(i)},ht=d,Os=ht.isArray,Ss=ht.isObject,$s=ht.isFunction,js=function(t){var r=this,n=null,i,s=function(u){return u===t};return $s(t)&&(s=t),Os(this.items)&&(i=this.items.filter(function(o){return n!==!1&&(n=s(o)),n})),Ss(this.items)&&(i=Object.keys(this.items).reduce(function(o,u){return n!==!1&&(n=s(r.items[u])),n!==!1&&(o[u]=r.items[u]),o},{})),new this.constructor(i)},Es=function(t){return t(this),this},Is=function(t,r){for(var n=1;n<=t;n+=1)this.items.push(r(n));return this},Cs=function(){var t=this.constructor;function r(i,s){var o=[];i instanceof t?(i.items.forEach(function(u){return r(u,o)}),s.push(o)):Array.isArray(i)?(i.forEach(function(u){return r(u,o)}),s.push(o)):s.push(i)}if(Array.isArray(this.items)){var n=[];return this.items.forEach(function(i){r(i,n)}),n}return this.values().all()};function pt(e){"@babel/helpers - typeof";return pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pt(e)}var Ts=function(){return pt(this.items)==="object"&&!Array.isArray(this.items)?JSON.stringify(this.all()):JSON.stringify(this.toArray())},Ds=function(t){var r=this;if(Array.isArray(this.items))this.items=this.items.map(t);else{var n={};Object.keys(this.items).forEach(function(i){n[i]=t(r.items[i],i)}),this.items=n}return this};function Lt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lt(Object(r),!0).forEach(function(n){Fs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ps=function(){var t=this;if(Array.isArray(this.items))return this;var r={};return Object.keys(this.items).forEach(function(n){if(n.indexOf(".")!==-1){var i=r;n.split(".").reduce(function(s,o,u,a){return s[o]||(s[o]={}),u===a.length-1&&(s[o]=t.items[n]),s[o]},i),r=xt(xt({},r),i)}else r[n]=t.items[n]}),new this.constructor(r)},Ns=function(t,r,n){t?n(this):r(this)},Ht=function(t,r){if(Array.isArray(this.items)&&this.items.length)return t(this);if(Object.keys(this.items).length)return t(this);if(r!==void 0){if(Array.isArray(this.items)&&!this.items.length)return r(this);if(!Object.keys(this.items).length)return r(this)}return this},Qt=function(t,r){if(Array.isArray(this.items)&&!this.items.length)return t(this);if(!Object.keys(this.items).length)return t(this);if(r!==void 0){if(Array.isArray(this.items)&&this.items.length)return r(this);if(Object.keys(this.items).length)return r(this)}return this},Bs=function(t){var r=this,n=JSON.parse(JSON.stringify(this.items));return Object.keys(t).forEach(function(i){r.items[i]===void 0&&(n[i]=t[i])}),new this.constructor(n)},qs=d,Ks=qs.isFunction,Rs=function(t){var r;if(t===void 0)r=this.items.filter(function(u,a,f){return f.indexOf(u)===a});else{r=[];for(var n=[],i=0,s=this.items.length;i<s;i+=1){var o=void 0;Ks(t)?o=t(this.items[i]):o=this.items[i][t],n.indexOf(o)===-1&&(r.push(this.items[i]),n.push(o))}}return new this.constructor(r)},Us=function(t){return t instanceof this.constructor?t.all():t},Ws=E,Ms=function(){return new this.constructor(Ws(this.items))},Js=function(t,r,n){return t?r(this,t):n?n(this,t):this},Vs=E,$=I,Ls=function(t,r,n){var i=r,s=n,o=Vs(this.items);if(r===void 0||r===!0)return new this.constructor(o.filter(function(a){return $(a,t)}));if(r===!1)return new this.constructor(o.filter(function(a){return!$(a,t)}));n===void 0&&(s=r,i="===");var u=o.filter(function(a){switch(i){case"==":return $(a,t)===Number(s)||$(a,t)===s.toString();default:case"===":return $(a,t)===s;case"!=":case"<>":return $(a,t)!==Number(s)&&$(a,t)!==s.toString();case"!==":return $(a,t)!==s;case"<":return $(a,t)<s;case"<=":return $(a,t)<=s;case">":return $(a,t)>s;case">=":return $(a,t)>=s}});return new this.constructor(u)},xs=function(t,r){return this.where(t,">=",r[0]).where(t,"<=",r[r.length-1])},Hs=E,Qs=I,zs=function(t,r){var n=Hs(r),i=this.items.filter(function(s){return n.indexOf(Qs(s,t))!==-1});return new this.constructor(i)},Gs=function(t){return this.filter(function(r){return r instanceof t})},zt=I,Xs=function(t,r){return this.filter(function(n){return zt(n,t)<r[0]||zt(n,t)>r[r.length-1]})},Ys=E,Zs=I,ks=function(t,r){var n=Ys(r),i=this.items.filter(function(s){return n.indexOf(Zs(s,t))===-1});return new this.constructor(i)},to=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(t,"===",null)},ro=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(t,"!==",null)};function yt(e){"@babel/helpers - typeof";return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(e)}var eo=function(t){return t instanceof this.constructor?t:yt(t)==="object"?new this.constructor(t):new this.constructor([t])},no=function(t){var r=this,n=t;n instanceof this.constructor&&(n=n.all());var i=this.items.map(function(s,o){return new r.constructor([s,n[o]])});return new this.constructor(i)};(function(e){function t(s){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t(s)}function r(s){s!==void 0&&!Array.isArray(s)&&t(s)!=="object"?this.items=[s]:s instanceof this.constructor?this.items=s.all():this.items=s||[]}var n=_r;typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=n),r.prototype.toJSON=function(){return this.items},r.prototype.all=Or,r.prototype.average=At,r.prototype.avg=Er,r.prototype.chunk=Ir,r.prototype.collapse=Nr,r.prototype.combine=Wr,r.prototype.concat=Qr,r.prototype.contains=$t,r.prototype.containsOneItem=oe,r.prototype.count=ae,r.prototype.countBy=ue,r.prototype.crossJoin=fe,r.prototype.dd=ce,r.prototype.diff=le,r.prototype.diffAssoc=he,r.prototype.diffKeys=pe,r.prototype.diffUsing=ye,r.prototype.doesntContain=me,r.prototype.dump=de,r.prototype.duplicates=ve,r.prototype.each=be,r.prototype.eachSpread=Se,r.prototype.every=je,r.prototype.except=Ie,r.prototype.filter=De,r.prototype.first=Pe,r.prototype.firstOrFail=qe,r.prototype.firstWhere=Ke,r.prototype.flatMap=Re,r.prototype.flatten=Ue,r.prototype.flip=We,r.prototype.forPage=Me,r.prototype.forget=Je,r.prototype.get=xe,r.prototype.groupBy=ze,r.prototype.has=Xe,r.prototype.implode=Ye,r.prototype.intersect=Ze,r.prototype.intersectByKeys=ke,r.prototype.isEmpty=tn,r.prototype.isNotEmpty=rn,r.prototype.join=en,r.prototype.keyBy=an,r.prototype.keys=un,r.prototype.last=cn,r.prototype.macro=ln,r.prototype.make=hn,r.prototype.map=pn,r.prototype.mapSpread=gn,r.prototype.mapToDictionary=$n,r.prototype.mapInto=jn,r.prototype.mapToGroups=Fn,r.prototype.mapWithKeys=Kn,r.prototype.max=Jn,r.prototype.median=Vn,r.prototype.merge=Ln,r.prototype.mergeRecursive=Hn,r.prototype.min=Yn,r.prototype.mode=Zn,r.prototype.nth=ti,r.prototype.only=ei,r.prototype.pad=ii,r.prototype.partition=si,r.prototype.pipe=oi,r.prototype.pluck=ci,r.prototype.pop=yi,r.prototype.prepend=mi,r.prototype.pull=bi,r.prototype.push=gi,r.prototype.put=wi,r.prototype.random=_i,r.prototype.reduce=Oi,r.prototype.reject=Si,r.prototype.replace=ji,r.prototype.replaceRecursive=Ii,r.prototype.reverse=Ci,r.prototype.search=Pi,r.prototype.shift=Ki,r.prototype.shuffle=Ui,r.prototype.skip=Ji,r.prototype.skipUntil=Hi,r.prototype.skipWhile=Xi,r.prototype.slice=Yi,r.prototype.sole=ts,r.prototype.some=es,r.prototype.sort=ns,r.prototype.sortDesc=is,r.prototype.sortBy=us,r.prototype.sortByDesc=fs,r.prototype.sortKeys=cs,r.prototype.sortKeysDesc=ls,r.prototype.splice=hs,r.prototype.split=ps,r.prototype.sum=vs,r.prototype.take=bs,r.prototype.takeUntil=_s,r.prototype.takeWhile=js,r.prototype.tap=Es,r.prototype.times=Is,r.prototype.toArray=Cs,r.prototype.toJson=Ts,r.prototype.transform=Ds,r.prototype.undot=Ps,r.prototype.unless=Ns,r.prototype.unlessEmpty=Ht,r.prototype.unlessNotEmpty=Qt,r.prototype.union=Bs,r.prototype.unique=Rs,r.prototype.unwrap=Us,r.prototype.values=Ms,r.prototype.when=Js,r.prototype.whenEmpty=Qt,r.prototype.whenNotEmpty=Ht,r.prototype.where=Ls,r.prototype.whereBetween=xs,r.prototype.whereIn=zs,r.prototype.whereInstanceOf=Gs,r.prototype.whereNotBetween=Xs,r.prototype.whereNotIn=ks,r.prototype.whereNull=to,r.prototype.whereNotNull=ro,r.prototype.wrap=eo,r.prototype.zip=no;var i=function(o){return new r(o)};e.exports=i,e.exports.collect=i,e.exports.default=i,e.exports.Collection=r})(wt);var io=wt.exports;const Gt=Ar(io),Xt=["chunk","shuffle","splice","sortBy","map","reverse","groupBy","implode","keyBy","keys","mapToDictionary","mapWithKeys","nth","skipUntil","skipWhile","takeUntil","takeWhile","unique"],so=["forPage","sortByDesc","sortBy","skip","take","splice","whereBetween","whereIn","whereNotBetween","whereNotIn","first","where","whereContains"],oo=["avg","count","countBy","dd","each","every","filter","firstWhere","isEmpty","isNotEmpty","last","mapToGroups","max","median","min","mode","contains","sole","sort","split","sum","toJson"];class j{constructor(t,r){S(this,"data_path","");S(this,"axios");S(this,"filters");S(this,"steps");S(this,"fields");S(this,"already_limit",!1);S(this,"already_offset",!1);S(this,"limit",null);S(this,"offset",null);S(this,"_sort",null);S(this,"_sortDesc",!1);S(this,"meta",{});this.axios=r,this.filters={},this.steps=[],this.fields=t}}j.prototype.dataPath=function(e){const t=this.clone();return t.data_path=e,t},j.prototype.buildArgs=function(){let e={};return Object.keys(this.filters).length>0&&(e.filters=this.filters),this._sort&&(e.sort=this._sort,this._sortDesc&&(e.sort+=":desc")),e},j.prototype.clone=function(){const e=Object.create(this);return e.steps=[...this.steps],e},Gt().macro("whereContains",function(e,t){return this.filter(r=>r[e].toLowerCase().includes(t.toLowerCase()))}),j.prototype.fetchData=async function(){let e={meta:{total:!0,key:!0,name:!0}};e.__args=this.buildArgs(),e.data=this.fields,this.already_limit&&(e.data.__args=e.data.__args||{},e.data.__args.limit=this.limit),this.already_offset&&(e.data.__args=e.data.__args||{},e.data.__args.offset=this.offset);const t=this.data_path.split(".");let r={},n=r,i=t[t.length-1];for(const u of t){if(u===i){n[u]=e;break}n[u]={},n=n[u]}let o=await A(this.axios,r);for(const u of t)o=o[u];return this.meta=o.meta,Gt(o.data)},j.prototype.processData=async function(){let e=null;for(const t of this.steps){if(Xt.includes(t.type)){e||(e=await this.fetchData()),e=e[t.type](...t.args);continue}if(t.type==="forPage"&&(e?e=e.forPage(t.args[0],t.args[1]):this.already_limit||this.already_offset?(e=await this.fetchData(),e=e.forPage(t.args[0],t.args[1])):(this.offset=(t.args[0]-1)*t.args[1],this.limit=t.args[1]),this.already_limit=!0,this.already_offset=!0),t.type==="where")if(e)e=e.where(...t.args);else{const r=t.args[0];let n="==",i=null;t.args.length==2&&(i=t.args[1]),t.args.length==3&&(n=t.args[1],i=t.args[2]),n==="=="&&(this.filters[r]=i),n==="<"&&(this.filters[r]={lt:i}),n==="<="&&(this.filters[r]={lte:i}),n===">"&&(this.filters[r]={gt:i}),n===">="&&(this.filters[r]={gte:i}),n==="!=="&&(this.filters[r]={ne:i})}t.type==="whereContains"&&(e?e=e.whereContains(...t.args):this.filters[t.args[0]]={contains:t.args[1]}),t.type==="whereIn"&&(e?e=e.whereIn(...t.args):this.filters[t.args[0]]={in:t.args[1]}),t.type==="whereNotBetween"&&(e?e=e.whereNotBetween(...t.args):this.filters[t.args[0]]={notBetween:t.args[1]}),t.type==="whereNotIn"&&(e?e=e.whereNotIn(...t.args):this.filters[t.args[0]]={notIn:t.args[1]}),t.type=="whereBetween"&&(e?e=e.whereBetween(...t.args):this.filters[t.args[0]]={between:t.args[1]}),t.type==="sortByDesc"&&(e?e=e.sortByDesc(t.args[0]):this.already_limit||this.already_offset?(e=await this.fetchData(),e=e.sortByDesc(t.args[0])):(this._sort=t.args[0],this._sortDesc=!0)),t.type==="sortBy"&&(e?e=e.sortBy(t.args[0]):this.already_limit||this.already_offset?(e=await this.fetchData(),e=e.sortBy(t.args[0])):this._sort=t.args[0]),t.type==="skip"&&(e?e=e.skip(t.args[0]):this.already_offset||this.already_limit?(e=await this.fetchData(),e=e.skip(t.args[0])):this.offset=t.args[0],this.already_offset=!0),t.type==="take"&&(e?e=e.take(...t.args):this.already_offset||this.already_limit?(e=await this.fetchData(),e=e.take(t.args[0])):this.limit=t.args[0],this.already_limit=!0),t.type==="splice"&&(e?e=e.splice(...t.args):(this.offset=t.args[0],this.limit=t.args[1]),this.already_limit=!0,this.already_offset=!0)}return e||(e=await this.fetchData()),e},j.prototype.all=async function(){return(await this.processData()).all()};for(const e of[...Xt,...so])j.prototype[e]=function(...t){const r=this.clone();return r.steps.push({type:e,args:t}),r};for(const e of oo)j.prototype[e]=async function(...t){return(await this.clone().processData())[e](...t)};j.prototype.average=j.prototype.avg,j.prototype.first=async function(){return this.take(1),(await this.processData()).first()};const Yt=(e,t,r)=>{const n=new j(r,t);return n.data_path="list"+e,n},ao=(e,t)=>({folders:{list:async(r,n={name:!0,path:!0})=>(await A(t,{app:{drive:{__args:{index:e},folders:{__args:{path:r},...n}}}})).app.drive.folders,create:r=>c(t,"lightDriveCreateFolder",{index:e,path:r}),delete:r=>c(t,"lightDriveDeleteFolder",{index:e,path:r}),rename:(r,n)=>c(t,"lightDriveRenameFolder",{index:e,path:r,name:n})},files:{list:async(r,n={name:!0,path:!0,size:!0,mime:!0,url:!0})=>(await A(t,{app:{drive:{__args:{index:e},files:{__args:{path:r},...n}}}})).app.drive.files,get:async(r,n={name:!0,path:!0,size:!0,mime:!0,url:!0})=>(await A(t,{app:{drive:{__args:{index:e},file:{__args:{path:r},...n}}}})).app.drive.file,read:async r=>{let n=await A(t,{app:{drive:{__args:{index:e},file:{__args:{path:r},base64Content:!0}}}});return window.atob(n.app.drive.file.base64Content)},write:(r,n)=>c(t,"lightDriveWriteFile",{index:e,path:r,content:n}),delete:r=>c(t,"lightDriveDeleteFile",{index:e,path:r}),rename:(r,n)=>c(t,"lightDriveRenameFile",{index:e,path:r,name:n}),move:(r,n)=>c(t,"lightDriveMoveFile",{index:e,source:r,destination:n})}}),uo=e=>{const t=D.create({baseURL:e,withCredentials:!0}),r=(s,o=null,u=[])=>c(t,s,o,u),n=s=>A(t,s),i=gr(t);return{baseURL:e,axios:t,auth:fr(t),mutation:r,query:n,config:dr(n),mail:vr(t),users:br(t),fs:mr(t),models:i,model(s){return i.get(s)},roles:wr(t),collect:(s,o)=>{const u=Yt(s,t,o);return u.data_path=i.get(s).getDataPath(),u},drive(s){return ao(s,t)}}};g.File=hr,g.createClient=uo,g.createCollection=Yt,g.file=q,g.mutation=c,g.query=A,g.toQuery=B,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|