@magiclabs.ai/magicbook-client 0.5.0 → 0.5.2

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.
@@ -1,4 +1,4 @@
1
- export declare const states: readonly ["new", "ingesting", "submitted", "storyboarding", "storyboarding succeeded", "designing", "designing succeeded", "layouting", "layouting succeeded", "embellishing", "embellishing succeeded", "polishing", "polishing succeeded", "ready", "error"];
1
+ export declare const states: readonly ["new", "ingesting", "submitted", "storyboarding", "deduplication", "image selection", "designing", "layouting", "embellishing", "polishing", "ready", "error"];
2
2
  export declare const occasions: readonly ["baby", "birthday", "default", "everyday", "family", "kids", "life-stories", "portfolio", "school-memories", "seasonal-holidays", "special-celebrations", "sports-and-hobbies", "travel", "wedding", "year-in-review"];
3
3
  export declare const styles: {
4
4
  1005: {
@@ -1459,11 +1459,11 @@ async function Se(t) {
1459
1459
  return Promise.reject(e);
1460
1460
  }
1461
1461
  }
1462
- const Te = "https://zrrpg8wwbe.execute-api.us-east-1.amazonaws.com/sfly-sls", Vn = "wss://cwfzk5wg4m.execute-api.us-east-1.amazonaws.com/sfly-sls", Fn = "120000";
1462
+ const Te = "https://zrrpg8wwbe.execute-api.us-east-1.amazonaws.com/sfly-sls", Vn = "wss://cwfzk5wg4m.execute-api.us-east-1.amazonaws.com/sfly-sls", Fn = "300000";
1463
1463
  async function Hn(t, e, s) {
1464
1464
  return Se(async () => {
1465
1465
  const n = (await es({ url: `${Te}/api/v1/images/book/${e}`, apiKey: t, payload: s })).data;
1466
- return Hr.parse(n), n;
1466
+ return Hr.parse(n);
1467
1467
  });
1468
1468
  }
1469
1469
  var E;
@@ -4207,15 +4207,12 @@ const Wr = [
4207
4207
  "ingesting",
4208
4208
  "submitted",
4209
4209
  "storyboarding",
4210
- "storyboarding succeeded",
4210
+ "deduplication",
4211
+ "image selection",
4211
4212
  "designing",
4212
- "designing succeeded",
4213
4213
  "layouting",
4214
- "layouting succeeded",
4215
4214
  "embellishing",
4216
- "embellishing succeeded",
4217
4215
  "polishing",
4218
- "polishing succeeded",
4219
4216
  "ready",
4220
4217
  "error"
4221
4218
  ], cs = [
@@ -4464,7 +4461,7 @@ async function Yr(t, e, s) {
4464
4461
  const n = await Qt(
4465
4462
  { url: `${Te}/api/v1/designoptions/booksize/${e}/imagecount/${s}`, apiKey: t }
4466
4463
  ), r = jt(n.data);
4467
- return Xr.parse(r), r;
4464
+ return Xr.parse(r);
4468
4465
  });
4469
4466
  }
4470
4467
  const Qr = d.object({
@@ -4517,7 +4514,7 @@ const Qr = d.object({
4517
4514
  properties: d.array(sa)
4518
4515
  }), ia = d.object({
4519
4516
  backgroundId: d.string().nullable(),
4520
- assets: d.array(na)
4517
+ assets: d.array(na).optional()
4521
4518
  }), oa = d.object({
4522
4519
  pageNum: d.number(),
4523
4520
  type: d.string(),
@@ -4548,7 +4545,7 @@ async function At(t, e) {
4548
4545
  async function da(t, e) {
4549
4546
  return Se(async () => {
4550
4547
  const s = (await Qt({ url: `${Te}/api/v1/books/${e}/format/galleon`, apiKey: t })).data;
4551
- return ca.parse(s), s;
4548
+ return ca.parse(s);
4552
4549
  });
4553
4550
  }
4554
4551
  class fa {
@@ -4591,7 +4588,7 @@ class fa {
4591
4588
  if (e !== a.state) {
4592
4589
  e = a.state;
4593
4590
  const i = new CustomEvent("MagicBook.designRequestUpdated", { detail: a });
4594
- window.dispatchEvent(i), ["error", "ready"].includes(a.state) && (s.close(), clearTimeout(n));
4591
+ ["error", "ready"].includes(a.state) && (s.close(), clearTimeout(n)), window.dispatchEvent(i);
4595
4592
  }
4596
4593
  };
4597
4594
  }
@@ -1,3 +1,3 @@
1
1
  (function(O,Z){typeof exports=="object"&&typeof module<"u"?Z(exports):typeof define=="function"&&define.amd?define(["exports"],Z):(O=typeof globalThis<"u"?globalThis:O||self,Z(O["magicbook-client"]={}))})(this,function(O){"use strict";var aa=Object.defineProperty;var ia=(O,Z,q)=>Z in O?aa(O,Z,{enumerable:!0,configurable:!0,writable:!0,value:q}):O[Z]=q;var w=(O,Z,q)=>(ia(O,typeof Z!="symbol"?Z+"":Z,q),q);function Z(t,e,s){const n=e.pop()||"",r=e.reduce((a,i)=>a[i]=a[i]||{},t);r[n]=s}function q(t,e){return Object.keys(e).map(s=>{typeof t[s]=="object"&&typeof e[s]=="object"?q(t[s],e[s]):t[s]=e[s]}),t}function Ns(t){return t.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}function Ct(t){return Object.keys(t).map(e=>{const s=Ns(e);s.includes("_")&&(t[s]=t[e],delete t[e]),typeof t[s]=="object"&&(t[s]=Ct(t[s]))}),t}function Cs(t){return t.replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_",""))}function At(t){return Object.keys(t).map(e=>{const s=Cs(e);s!==e&&(t[s]=t[e],delete t[e]),typeof t[s]=="object"&&(t[s]=At(t[s]))}),t}function Rt(t,e){return function(){return t.apply(e,arguments)}}const{toString:As}=Object.prototype,{getPrototypeOf:et}=Object,Ae=(t=>e=>{const s=As.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),z=t=>(t=t.toLowerCase(),e=>Ae(e)===t),Re=t=>e=>typeof e===t,{isArray:ae}=Array,fe=Re("undefined");function Rs(t){return t!==null&&!fe(t)&&t.constructor!==null&&!fe(t.constructor)&&L(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const It=z("ArrayBuffer");function Is(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&It(t.buffer),e}const js=Re("string"),L=Re("function"),jt=Re("number"),Ie=t=>t!==null&&typeof t=="object",Zs=t=>t===!0||t===!1,je=t=>{if(Ae(t)!=="object")return!1;const e=et(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ls=z("Date"),Ds=z("File"),Ps=z("Blob"),Bs=z("FileList"),Ms=t=>Ie(t)&&L(t.pipe),Us=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||L(t.append)&&((e=Ae(t))==="formdata"||e==="object"&&L(t.toString)&&t.toString()==="[object FormData]"))},zs=z("URLSearchParams"),$s=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function he(t,e,{allOwnKeys:s=!1}={}){if(t===null||typeof t>"u")return;let n,r;if(typeof t!="object"&&(t=[t]),ae(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{const a=s?Object.getOwnPropertyNames(t):Object.keys(t),i=a.length;let o;for(n=0;n<i;n++)o=a[n],e.call(null,t[o],o,t)}}function Zt(t,e){e=e.toLowerCase();const s=Object.keys(t);let n=s.length,r;for(;n-- >0;)if(r=s[n],e===r.toLowerCase())return r;return null}const Lt=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Dt=t=>!fe(t)&&t!==Lt;function tt(){const{caseless:t}=Dt(this)&&this||{},e={},s=(n,r)=>{const a=t&&Zt(e,r)||r;je(e[a])&&je(n)?e[a]=tt(e[a],n):je(n)?e[a]=tt({},n):ae(n)?e[a]=n.slice():e[a]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&he(arguments[n],s);return e}const Vs=(t,e,s,{allOwnKeys:n}={})=>(he(e,(r,a)=>{s&&L(r)?t[a]=Rt(r,s):t[a]=r},{allOwnKeys:n}),t),Fs=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Hs=(t,e,s,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),s&&Object.assign(t.prototype,s)},Js=(t,e,s,n)=>{let r,a,i;const o={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),a=r.length;a-- >0;)i=r[a],(!n||n(i,t,e))&&!o[i]&&(e[i]=t[i],o[i]=!0);t=s!==!1&&et(t)}while(t&&(!s||s(t,e))&&t!==Object.prototype);return e},Ws=(t,e,s)=>{t=String(t),(s===void 0||s>t.length)&&(s=t.length),s-=e.length;const n=t.indexOf(e,s);return n!==-1&&n===s},Ks=t=>{if(!t)return null;if(ae(t))return t;let e=t.length;if(!jt(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=t[e];return s},qs=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&et(Uint8Array)),Gs=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const a=r.value;e.call(t,a[0],a[1])}},Xs=(t,e)=>{let s;const n=[];for(;(s=t.exec(e))!==null;)n.push(s);return n},Ys=z("HTMLFormElement"),Qs=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,n,r){return n.toUpperCase()+r}),Pt=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),en=z("RegExp"),Bt=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),n={};he(s,(r,a)=>{e(r,a,t)!==!1&&(n[a]=r)}),Object.defineProperties(t,n)},tn=t=>{Bt(t,(e,s)=>{if(L(t)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const n=t[s];if(L(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},sn=(t,e)=>{const s={},n=r=>{r.forEach(a=>{s[a]=!0})};return ae(t)?n(t):n(String(t).split(e)),s},nn=()=>{},rn=(t,e)=>(t=+t,Number.isFinite(t)?t:e),st="abcdefghijklmnopqrstuvwxyz",Mt="0123456789",Ut={DIGIT:Mt,ALPHA:st,ALPHA_DIGIT:st+st.toUpperCase()+Mt},an=(t=16,e=Ut.ALPHA_DIGIT)=>{let s="";const{length:n}=e;for(;t--;)s+=e[Math.random()*n|0];return s};function on(t){return!!(t&&L(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const ln=t=>{const e=new Array(10),s=(n,r)=>{if(Ie(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[r]=n;const a=ae(n)?[]:{};return he(n,(i,o)=>{const u=s(i,r+1);!fe(u)&&(a[o]=u)}),e[r]=void 0,a}}return n};return s(t,0)},cn=z("AsyncFunction"),c={isArray:ae,isArrayBuffer:It,isBuffer:Rs,isFormData:Us,isArrayBufferView:Is,isString:js,isNumber:jt,isBoolean:Zs,isObject:Ie,isPlainObject:je,isUndefined:fe,isDate:Ls,isFile:Ds,isBlob:Ps,isRegExp:en,isFunction:L,isStream:Ms,isURLSearchParams:zs,isTypedArray:qs,isFileList:Bs,forEach:he,merge:tt,extend:Vs,trim:$s,stripBOM:Fs,inherits:Hs,toFlatObject:Js,kindOf:Ae,kindOfTest:z,endsWith:Ws,toArray:Ks,forEachEntry:Gs,matchAll:Xs,isHTMLForm:Ys,hasOwnProperty:Pt,hasOwnProp:Pt,reduceDescriptors:Bt,freezeMethods:tn,toObjectSet:sn,toCamelCase:Qs,noop:nn,toFiniteNumber:rn,findKey:Zt,global:Lt,isContextDefined:Dt,ALPHABET:Ut,generateString:an,isSpecCompliantForm:on,toJSONObject:ln,isAsyncFn:cn,isThenable:t=>t&&(Ie(t)||L(t))&&L(t.then)&&L(t.catch)};function T(t,e,s,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),s&&(this.config=s),n&&(this.request=n),r&&(this.response=r)}c.inherits(T,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const zt=T.prototype,$t={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{$t[t]={value:t}}),Object.defineProperties(T,$t),Object.defineProperty(zt,"isAxiosError",{value:!0}),T.from=(t,e,s,n,r,a)=>{const i=Object.create(zt);return c.toFlatObject(t,i,function(u){return u!==Error.prototype},o=>o!=="isAxiosError"),T.call(i,t.message,e,s,n,r),i.cause=t,i.name=t.name,a&&Object.assign(i,a),i};const un=null;function nt(t){return c.isPlainObject(t)||c.isArray(t)}function Vt(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function Ft(t,e,s){return t?t.concat(e).map(function(r,a){return r=Vt(r),!s&&a?"["+r+"]":r}).join(s?".":""):e}function dn(t){return c.isArray(t)&&!t.some(nt)}const fn=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function Ze(t,e,s){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,s=c.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,K){return!c.isUndefined(K[S])});const n=s.metaTokens,r=s.visitor||f,a=s.dots,i=s.indexes,u=(s.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(r))throw new TypeError("visitor must be a function");function l(g){if(g===null)return"";if(c.isDate(g))return g.toISOString();if(!u&&c.isBlob(g))throw new T("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(g)||c.isTypedArray(g)?u&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function f(g,S,K){let U=g;if(g&&!K&&typeof g=="object"){if(c.endsWith(S,"{}"))S=n?S:S.slice(0,-2),g=JSON.stringify(g);else if(c.isArray(g)&&dn(g)||(c.isFileList(g)||c.endsWith(S,"[]"))&&(U=c.toArray(g)))return S=Vt(S),U.forEach(function(Qe,ra){!(c.isUndefined(Qe)||Qe===null)&&e.append(i===!0?Ft([S],ra,a):i===null?S:S+"[]",l(Qe))}),!1}return nt(g)?!0:(e.append(Ft(K,S,a),l(g)),!1)}const _=[],A=Object.assign(fn,{defaultVisitor:f,convertValue:l,isVisitable:nt});function N(g,S){if(!c.isUndefined(g)){if(_.indexOf(g)!==-1)throw Error("Circular reference detected in "+S.join("."));_.push(g),c.forEach(g,function(U,de){(!(c.isUndefined(U)||U===null)&&r.call(e,U,c.isString(de)?de.trim():de,S,A))===!0&&N(U,S?S.concat(de):[de])}),_.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return N(t),e}function Ht(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function rt(t,e){this._pairs=[],t&&Ze(t,this,e)}const Jt=rt.prototype;Jt.append=function(e,s){this._pairs.push([e,s])},Jt.toString=function(e){const s=e?function(n){return e.call(this,n,Ht)}:Ht;return this._pairs.map(function(r){return s(r[0])+"="+s(r[1])},"").join("&")};function hn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Wt(t,e,s){if(!e)return t;const n=s&&s.encode||hn,r=s&&s.serialize;let a;if(r?a=r(e,s):a=c.isURLSearchParams(e)?e.toString():new rt(e,s).toString(n),a){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class pn{constructor(){this.handlers=[]}use(e,s,n){return this.handlers.push({fulfilled:e,rejected:s,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(n){n!==null&&e(n)})}}const Kt=pn,qt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mn=typeof URLSearchParams<"u"?URLSearchParams:rt,yn=typeof FormData<"u"?FormData:null,gn=typeof Blob<"u"?Blob:null,vn=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),_n=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),$={isBrowser:!0,classes:{URLSearchParams:mn,FormData:yn,Blob:gn},isStandardBrowserEnv:vn,isStandardBrowserWebWorkerEnv:_n,protocols:["http","https","file","blob","url","data"]};function bn(t,e){return Ze(t,new $.classes.URLSearchParams,Object.assign({visitor:function(s,n,r,a){return $.isNode&&c.isBuffer(s)?(this.append(n,s.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function wn(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function xn(t){const e={},s=Object.keys(t);let n;const r=s.length;let a;for(n=0;n<r;n++)a=s[n],e[a]=t[a];return e}function Gt(t){function e(s,n,r,a){let i=s[a++];const o=Number.isFinite(+i),u=a>=s.length;return i=!i&&c.isArray(r)?r.length:i,u?(c.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!o):((!r[i]||!c.isObject(r[i]))&&(r[i]=[]),e(s,n,r[i],a)&&c.isArray(r[i])&&(r[i]=xn(r[i])),!o)}if(c.isFormData(t)&&c.isFunction(t.entries)){const s={};return c.forEachEntry(t,(n,r)=>{e(wn(n),r,s,0)}),s}return null}const kn={"Content-Type":void 0};function Sn(t,e,s){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(s||JSON.stringify)(t)}const Le={transitional:qt,adapter:["xhr","http"],transformRequest:[function(e,s){const n=s.getContentType()||"",r=n.indexOf("application/json")>-1,a=c.isObject(e);if(a&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return r&&r?JSON.stringify(Gt(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return bn(e,this.formSerializer).toString();if((o=c.isFileList(e))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Ze(o?{"files[]":e}:e,u&&new u,this.formSerializer)}}return a||r?(s.setContentType("application/json",!1),Sn(e)):e}],transformResponse:[function(e){const s=this.transitional||Le.transitional,n=s&&s.forcedJSONParsing,r=this.responseType==="json";if(e&&c.isString(e)&&(n&&!this.responseType||r)){const i=!(s&&s.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(o){if(i)throw o.name==="SyntaxError"?T.from(o,T.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$.classes.FormData,Blob:$.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};c.forEach(["delete","get","head"],function(e){Le.headers[e]={}}),c.forEach(["post","put","patch"],function(e){Le.headers[e]=c.merge(kn)});const at=Le,Tn=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),En=t=>{const e={};let s,n,r;return t&&t.split(`
2
2
  `).forEach(function(i){r=i.indexOf(":"),s=i.substring(0,r).trim().toLowerCase(),n=i.substring(r+1).trim(),!(!s||e[s]&&Tn[s])&&(s==="set-cookie"?e[s]?e[s].push(n):e[s]=[n]:e[s]=e[s]?e[s]+", "+n:n)}),e},Xt=Symbol("internals");function pe(t){return t&&String(t).trim().toLowerCase()}function De(t){return t===!1||t==null?t:c.isArray(t)?t.map(De):String(t)}function On(t){const e=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=s.exec(t);)e[n[1]]=n[2];return e}const Nn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function it(t,e,s,n,r){if(c.isFunction(n))return n.call(this,e,s);if(r&&(e=s),!!c.isString(e)){if(c.isString(n))return e.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(e)}}function Cn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,n)=>s.toUpperCase()+n)}function An(t,e){const s=c.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+s,{value:function(r,a,i){return this[n].call(this,e,r,a,i)},configurable:!0})})}class Pe{constructor(e){e&&this.set(e)}set(e,s,n){const r=this;function a(o,u,l){const f=pe(u);if(!f)throw new Error("header name must be a non-empty string");const _=c.findKey(r,f);(!_||r[_]===void 0||l===!0||l===void 0&&r[_]!==!1)&&(r[_||u]=De(o))}const i=(o,u)=>c.forEach(o,(l,f)=>a(l,f,u));return c.isPlainObject(e)||e instanceof this.constructor?i(e,s):c.isString(e)&&(e=e.trim())&&!Nn(e)?i(En(e),s):e!=null&&a(s,e,n),this}get(e,s){if(e=pe(e),e){const n=c.findKey(this,e);if(n){const r=this[n];if(!s)return r;if(s===!0)return On(r);if(c.isFunction(s))return s.call(this,r,n);if(c.isRegExp(s))return s.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,s){if(e=pe(e),e){const n=c.findKey(this,e);return!!(n&&this[n]!==void 0&&(!s||it(this,this[n],n,s)))}return!1}delete(e,s){const n=this;let r=!1;function a(i){if(i=pe(i),i){const o=c.findKey(n,i);o&&(!s||it(n,n[o],o,s))&&(delete n[o],r=!0)}}return c.isArray(e)?e.forEach(a):a(e),r}clear(e){const s=Object.keys(this);let n=s.length,r=!1;for(;n--;){const a=s[n];(!e||it(this,this[a],a,e,!0))&&(delete this[a],r=!0)}return r}normalize(e){const s=this,n={};return c.forEach(this,(r,a)=>{const i=c.findKey(n,a);if(i){s[i]=De(r),delete s[a];return}const o=e?Cn(a):String(a).trim();o!==a&&delete s[a],s[o]=De(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const s=Object.create(null);return c.forEach(this,(n,r)=>{n!=null&&n!==!1&&(s[r]=e&&c.isArray(n)?n.join(", "):n)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,s])=>e+": "+s).join(`
3
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...s){const n=new this(e);return s.forEach(r=>n.set(r)),n}static accessor(e){const n=(this[Xt]=this[Xt]={accessors:{}}).accessors,r=this.prototype;function a(i){const o=pe(i);n[o]||(An(r,i),n[o]=!0)}return c.isArray(e)?e.forEach(a):a(e),this}}Pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.freezeMethods(Pe.prototype),c.freezeMethods(Pe);const H=Pe;function ot(t,e){const s=this||at,n=e||s,r=H.from(n.headers);let a=n.data;return c.forEach(t,function(o){a=o.call(s,a,r.normalize(),e?e.status:void 0)}),r.normalize(),a}function Yt(t){return!!(t&&t.__CANCEL__)}function me(t,e,s){T.call(this,t??"canceled",T.ERR_CANCELED,e,s),this.name="CanceledError"}c.inherits(me,T,{__CANCEL__:!0});function Rn(t,e,s){const n=s.config.validateStatus;!s.status||!n||n(s.status)?t(s):e(new T("Request failed with status code "+s.status,[T.ERR_BAD_REQUEST,T.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}const In=$.isStandardBrowserEnv?function(){return{write:function(s,n,r,a,i,o){const u=[];u.push(s+"="+encodeURIComponent(n)),c.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),c.isString(a)&&u.push("path="+a),c.isString(i)&&u.push("domain="+i),o===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(s){const n=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function jn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Zn(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function Qt(t,e){return t&&!jn(e)?Zn(t,e):e}const Ln=$.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a");let n;function r(a){let i=a;return e&&(s.setAttribute("href",i),i=s.href),s.setAttribute("href",i),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return n=r(window.location.href),function(i){const o=c.isString(i)?r(i):i;return o.protocol===n.protocol&&o.host===n.host}}():function(){return function(){return!0}}();function Dn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Pn(t,e){t=t||10;const s=new Array(t),n=new Array(t);let r=0,a=0,i;return e=e!==void 0?e:1e3,function(u){const l=Date.now(),f=n[a];i||(i=l),s[r]=u,n[r]=l;let _=a,A=0;for(;_!==r;)A+=s[_++],_=_%t;if(r=(r+1)%t,r===a&&(a=(a+1)%t),l-i<e)return;const N=f&&l-f;return N?Math.round(A*1e3/N):void 0}}function es(t,e){let s=0;const n=Pn(50,250);return r=>{const a=r.loaded,i=r.lengthComputable?r.total:void 0,o=a-s,u=n(o),l=a<=i;s=a;const f={loaded:a,total:i,progress:i?a/i:void 0,bytes:o,rate:u||void 0,estimated:u&&i&&l?(i-a)/u:void 0,event:r};f[e?"download":"upload"]=!0,t(f)}}const Be={http:un,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(s,n){let r=t.data;const a=H.from(t.headers).normalize(),i=t.responseType;let o;function u(){t.cancelToken&&t.cancelToken.unsubscribe(o),t.signal&&t.signal.removeEventListener("abort",o)}c.isFormData(r)&&($.isStandardBrowserEnv||$.isStandardBrowserWebWorkerEnv?a.setContentType(!1):a.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(t.auth){const N=t.auth.username||"",g=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.set("Authorization","Basic "+btoa(N+":"+g))}const f=Qt(t.baseURL,t.url);l.open(t.method.toUpperCase(),Wt(f,t.params,t.paramsSerializer),!0),l.timeout=t.timeout;function _(){if(!l)return;const N=H.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),S={data:!i||i==="text"||i==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:N,config:t,request:l};Rn(function(U){s(U),u()},function(U){n(U),u()},S),l=null}if("onloadend"in l?l.onloadend=_:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(_)},l.onabort=function(){l&&(n(new T("Request aborted",T.ECONNABORTED,t,l)),l=null)},l.onerror=function(){n(new T("Network Error",T.ERR_NETWORK,t,l)),l=null},l.ontimeout=function(){let g=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const S=t.transitional||qt;t.timeoutErrorMessage&&(g=t.timeoutErrorMessage),n(new T(g,S.clarifyTimeoutError?T.ETIMEDOUT:T.ECONNABORTED,t,l)),l=null},$.isStandardBrowserEnv){const N=(t.withCredentials||Ln(f))&&t.xsrfCookieName&&In.read(t.xsrfCookieName);N&&a.set(t.xsrfHeaderName,N)}r===void 0&&a.setContentType(null),"setRequestHeader"in l&&c.forEach(a.toJSON(),function(g,S){l.setRequestHeader(S,g)}),c.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),i&&i!=="json"&&(l.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&l.addEventListener("progress",es(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",es(t.onUploadProgress)),(t.cancelToken||t.signal)&&(o=N=>{l&&(n(!N||N.type?new me(null,t,l):N),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(o),t.signal&&(t.signal.aborted?o():t.signal.addEventListener("abort",o)));const A=Dn(f);if(A&&$.protocols.indexOf(A)===-1){n(new T("Unsupported protocol "+A+":",T.ERR_BAD_REQUEST,t));return}l.send(r||null)})}};c.forEach(Be,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Bn={getAdapter:t=>{t=c.isArray(t)?t:[t];const{length:e}=t;let s,n;for(let r=0;r<e&&(s=t[r],!(n=c.isString(s)?Be[s.toLowerCase()]:s));r++);if(!n)throw n===!1?new T(`Adapter ${s} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(c.hasOwnProp(Be,s)?`Adapter '${s}' is not available in the build`:`Unknown adapter '${s}'`);if(!c.isFunction(n))throw new TypeError("adapter is not a function");return n},adapters:Be};function lt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new me(null,t)}function ts(t){return lt(t),t.headers=H.from(t.headers),t.data=ot.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Bn.getAdapter(t.adapter||at.adapter)(t).then(function(n){return lt(t),n.data=ot.call(t,t.transformResponse,n),n.headers=H.from(n.headers),n},function(n){return Yt(n)||(lt(t),n&&n.response&&(n.response.data=ot.call(t,t.transformResponse,n.response),n.response.headers=H.from(n.response.headers))),Promise.reject(n)})}const ss=t=>t instanceof H?t.toJSON():t;function ie(t,e){e=e||{};const s={};function n(l,f,_){return c.isPlainObject(l)&&c.isPlainObject(f)?c.merge.call({caseless:_},l,f):c.isPlainObject(f)?c.merge({},f):c.isArray(f)?f.slice():f}function r(l,f,_){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l,_)}else return n(l,f,_)}function a(l,f){if(!c.isUndefined(f))return n(void 0,f)}function i(l,f){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l)}else return n(void 0,f)}function o(l,f,_){if(_ in e)return n(l,f);if(_ in t)return n(void 0,l)}const u={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:o,headers:(l,f)=>r(ss(l),ss(f),!0)};return c.forEach(Object.keys(Object.assign({},t,e)),function(f){const _=u[f]||r,A=_(t[f],e[f],f);c.isUndefined(A)&&_!==o||(s[f]=A)}),s}const ns="1.4.0",ct={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ct[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const rs={};ct.transitional=function(e,s,n){function r(a,i){return"[Axios v"+ns+"] Transitional option '"+a+"'"+i+(n?". "+n:"")}return(a,i,o)=>{if(e===!1)throw new T(r(i," has been removed"+(s?" in "+s:"")),T.ERR_DEPRECATED);return s&&!rs[i]&&(rs[i]=!0,console.warn(r(i," has been deprecated since v"+s+" and will be removed in the near future"))),e?e(a,i,o):!0}};function Mn(t,e,s){if(typeof t!="object")throw new T("options must be an object",T.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let r=n.length;for(;r-- >0;){const a=n[r],i=e[a];if(i){const o=t[a],u=o===void 0||i(o,a,t);if(u!==!0)throw new T("option "+a+" must be "+u,T.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new T("Unknown option "+a,T.ERR_BAD_OPTION)}}const ut={assertOptions:Mn,validators:ct},G=ut.validators;class Me{constructor(e){this.defaults=e,this.interceptors={request:new Kt,response:new Kt}}request(e,s){typeof e=="string"?(s=s||{},s.url=e):s=e||{},s=ie(this.defaults,s);const{transitional:n,paramsSerializer:r,headers:a}=s;n!==void 0&&ut.assertOptions(n,{silentJSONParsing:G.transitional(G.boolean),forcedJSONParsing:G.transitional(G.boolean),clarifyTimeoutError:G.transitional(G.boolean)},!1),r!=null&&(c.isFunction(r)?s.paramsSerializer={serialize:r}:ut.assertOptions(r,{encode:G.function,serialize:G.function},!0)),s.method=(s.method||this.defaults.method||"get").toLowerCase();let i;i=a&&c.merge(a.common,a[s.method]),i&&c.forEach(["delete","get","head","post","put","patch","common"],g=>{delete a[g]}),s.headers=H.concat(i,a);const o=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(s)===!1||(u=u&&S.synchronous,o.unshift(S.fulfilled,S.rejected))});const l=[];this.interceptors.response.forEach(function(S){l.push(S.fulfilled,S.rejected)});let f,_=0,A;if(!u){const g=[ts.bind(this),void 0];for(g.unshift.apply(g,o),g.push.apply(g,l),A=g.length,f=Promise.resolve(s);_<A;)f=f.then(g[_++],g[_++]);return f}A=o.length;let N=s;for(_=0;_<A;){const g=o[_++],S=o[_++];try{N=g(N)}catch(K){S.call(this,K);break}}try{f=ts.call(this,N)}catch(g){return Promise.reject(g)}for(_=0,A=l.length;_<A;)f=f.then(l[_++],l[_++]);return f}getUri(e){e=ie(this.defaults,e);const s=Qt(e.baseURL,e.url);return Wt(s,e.params,e.paramsSerializer)}}c.forEach(["delete","get","head","options"],function(e){Me.prototype[e]=function(s,n){return this.request(ie(n||{},{method:e,url:s,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(e){function s(n){return function(a,i,o){return this.request(ie(o||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Me.prototype[e]=s(),Me.prototype[e+"Form"]=s(!0)});const Ue=Me;class dt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(a){s=a});const n=this;this.promise.then(r=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](r);n._listeners=null}),this.promise.then=r=>{let a;const i=new Promise(o=>{n.subscribe(o),a=o}).then(r);return i.cancel=function(){n.unsubscribe(a)},i},e(function(a,i,o){n.reason||(n.reason=new me(a,i,o),s(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const s=this._listeners.indexOf(e);s!==-1&&this._listeners.splice(s,1)}static source(){let e;return{token:new dt(function(r){e=r}),cancel:e}}}const Un=dt;function zn(t){return function(s){return t.apply(null,s)}}function $n(t){return c.isObject(t)&&t.isAxiosError===!0}const ft={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ft).forEach(([t,e])=>{ft[e]=t});const Vn=ft;function as(t){const e=new Ue(t),s=Rt(Ue.prototype.request,e);return c.extend(s,Ue.prototype,e,{allOwnKeys:!0}),c.extend(s,e,null,{allOwnKeys:!0}),s.create=function(r){return as(ie(t,r))},s}const R=as(at);R.Axios=Ue,R.CanceledError=me,R.CancelToken=Un,R.isCancel=Yt,R.VERSION=ns,R.toFormData=Ze,R.AxiosError=T,R.Cancel=R.CanceledError,R.all=function(e){return Promise.all(e)},R.spread=zn,R.isAxiosError=$n,R.mergeConfig=ie,R.AxiosHeaders=H,R.formToJSON=t=>Gt(c.isHTMLForm(t)?new FormData(t):t),R.HttpStatusCode=Vn,R.default=R;const ht=R;function pt({apiKey:t,options:e}){let s={};return t&&Z(s,["headers","Authorization"],`API-Key ${t}`),e&&(s=q(s,e)),s}async function is({url:t,apiKey:e,options:s}){return await ht.get(t,pt({apiKey:e,options:s}))}async function os({url:t,apiKey:e,options:s,payload:n={}}){return await ht.post(t,n,pt({apiKey:e,options:s}))}async function Fn({url:t,apiKey:e,options:s,payload:n}){return await ht.put(t,n,pt({apiKey:e,options:s}))}async function ye(t){try{return await t()}catch(e){return Promise.reject(e)}}const ge="https://zrrpg8wwbe.execute-api.us-east-1.amazonaws.com/sfly-sls",Hn="wss://cwfzk5wg4m.execute-api.us-east-1.amazonaws.com/sfly-sls",Jn="120000";async function Wn(t,e,s){return ye(async()=>{const n=(await os({url:`${ge}/api/v1/images/book/${e}`,apiKey:t,payload:s})).data;return _s.parse(n),n})}var E;(function(t){t.assertEqual=r=>r;function e(r){}t.assertIs=e;function s(r){throw new Error}t.assertNever=s,t.arrayToEnum=r=>{const a={};for(const i of r)a[i]=i;return a},t.getValidEnumValues=r=>{const a=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of a)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(a){return r[a]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const a=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&a.push(i);return a},t.find=(r,a)=>{for(const i of r)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function n(r,a=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(r,a)=>typeof a=="bigint"?a.toString():a})(E||(E={}));var mt;(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(mt||(mt={}));const p=E.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),X=t=>{switch(typeof t){case"undefined":return p.undefined;case"string":return p.string;case"number":return isNaN(t)?p.nan:p.number;case"boolean":return p.boolean;case"function":return p.function;case"bigint":return p.bigint;case"symbol":return p.symbol;case"object":return Array.isArray(t)?p.array:t===null?p.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?p.promise:typeof Map<"u"&&t instanceof Map?p.map:typeof Set<"u"&&t instanceof Set?p.set:typeof Date<"u"&&t instanceof Date?p.date:p.object;default:return p.unknown}},h=E.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Kn=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class D extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const s=e||function(a){return a.message},n={_errors:[]},r=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)n._errors.push(s(i));else{let o=n,u=0;for(;u<i.path.length;){const l=i.path[u];u===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(s(i))):o[l]=o[l]||{_errors:[]},o=o[l],u++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,E.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){const s={},n=[];for(const r of this.issues)r.path.length>0?(s[r.path[0]]=s[r.path[0]]||[],s[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:s}}get formErrors(){return this.flatten()}}D.create=t=>new D(t);const ve=(t,e)=>{let s;switch(t.code){case h.invalid_type:t.received===p.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case h.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,E.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:s=`Unrecognized key(s) in object: ${E.joinValues(t.keys,", ")}`;break;case h.invalid_union:s="Invalid input";break;case h.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${E.joinValues(t.options)}`;break;case h.invalid_enum_value:s=`Invalid enum value. Expected ${E.joinValues(t.options)}, received '${t.received}'`;break;case h.invalid_arguments:s="Invalid function arguments";break;case h.invalid_return_type:s="Invalid function return type";break;case h.invalid_date:s="Invalid date";break;case h.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:E.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case h.too_small:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:s="Invalid input";break;case h.too_big:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:s="Invalid input";break;case h.custom:s="Invalid input";break;case h.invalid_intersection_types:s="Intersection results could not be merged";break;case h.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case h.not_finite:s="Number must be finite";break;default:s=e.defaultError,E.assertNever(t)}return{message:s}};let ls=ve;function qn(t){ls=t}function ze(){return ls}const $e=t=>{const{data:e,path:s,errorMaps:n,issueData:r}=t,a=[...s,...r.path||[]],i={...r,path:a};let o="";const u=n.filter(l=>!!l).slice().reverse();for(const l of u)o=l(i,{data:e,defaultError:o}).message;return{...r,path:a,message:r.message||o}},Gn=[];function m(t,e){const s=$e({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ze(),ve].filter(n=>!!n)});t.common.issues.push(s)}class I{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){const n=[];for(const r of s){if(r.status==="aborted")return b;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,s){const n=[];for(const r of s)n.push({key:await r.key,value:await r.value});return I.mergeObjectSync(e,n)}static mergeObjectSync(e,s){const n={};for(const r of s){const{key:a,value:i}=r;if(a.status==="aborted"||i.status==="aborted")return b;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),(typeof i.value<"u"||r.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const b=Object.freeze({status:"aborted"}),cs=t=>({status:"dirty",value:t}),j=t=>({status:"valid",value:t}),yt=t=>t.status==="aborted",gt=t=>t.status==="dirty",Ve=t=>t.status==="valid",Fe=t=>typeof Promise<"u"&&t instanceof Promise;var y;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(y||(y={}));class V{constructor(e,s,n,r){this._cachedPath=[],this.parent=e,this.data=s,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const us=(t,e)=>{if(Ve(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new D(t.common.issues);return this._error=s,this._error}}};function x(t){if(!t)return{};const{errorMap:e,invalid_type_error:s,required_error:n,description:r}=t;if(e&&(s||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:n??o.defaultError}:{message:s??o.defaultError},description:r}}class k{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return X(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:X(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new I,ctx:{common:e.parent.common,data:e.data,parsedType:X(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const s=this._parse(e);if(Fe(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){const s=this._parse(e);return Promise.resolve(s)}parse(e,s){const n=this.safeParse(e,s);if(n.success)return n.data;throw n.error}safeParse(e,s){var n;const r={common:{issues:[],async:(n=s==null?void 0:s.async)!==null&&n!==void 0?n:!1,contextualErrorMap:s==null?void 0:s.errorMap},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)},a=this._parseSync({data:e,path:r.path,parent:r});return us(r,a)}async parseAsync(e,s){const n=await this.safeParseAsync(e,s);if(n.success)return n.data;throw n.error}async safeParseAsync(e,s){const n={common:{issues:[],contextualErrorMap:s==null?void 0:s.errorMap,async:!0},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(Fe(r)?r:Promise.resolve(r));return us(n,a)}refine(e,s){const n=r=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(r):s;return this._refinement((r,a)=>{const i=e(r),o=()=>a.addIssue({code:h.custom,...n(r)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,s){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof s=="function"?s(n,r):s),!1))}_refinement(e){return new M({schema:this,typeName:v.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return W.create(this,this._def)}nullable(){return re.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return B.create(this,this._def)}promise(){return ue.create(this,this._def)}or(e){return xe.create([this,e],this._def)}and(e){return ke.create(this,e,this._def)}transform(e){return new M({...x(this._def),schema:this,typeName:v.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const s=typeof e=="function"?e:()=>e;return new Ne({...x(this._def),innerType:this,defaultValue:s,typeName:v.ZodDefault})}brand(){return new fs({typeName:v.ZodBranded,type:this,...x(this._def)})}catch(e){const s=typeof e=="function"?e:()=>e;return new Ge({...x(this._def),innerType:this,catchValue:s,typeName:v.ZodCatch})}describe(e){const s=this.constructor;return new s({...this._def,description:e})}pipe(e){return Ce.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xn=/^c[^\s-]{8,}$/i,Yn=/^[a-z][a-z0-9]*$/,Qn=/[0-9A-HJKMNP-TV-Z]{26}/,er=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,tr=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,sr=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,nr=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,rr=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ar=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function ir(t,e){return!!((e==="v4"||!e)&&nr.test(t)||(e==="v6"||!e)&&rr.test(t))}class P extends k{constructor(){super(...arguments),this._regex=(e,s,n)=>this.refinement(r=>e.test(r),{validation:s,code:h.invalid_string,...y.errToObj(n)}),this.nonempty=e=>this.min(1,y.errToObj(e)),this.trim=()=>new P({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new P({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new P({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==p.string){const a=this._getOrReturnCtx(e);return m(a,{code:h.invalid_type,expected:p.string,received:a.parsedType}),b}const n=new I;let r;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(r=this._getOrReturnCtx(e,r),m(r,{code:h.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(r=this._getOrReturnCtx(e,r),m(r,{code:h.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(r=this._getOrReturnCtx(e,r),i?m(r,{code:h.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&m(r,{code:h.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")tr.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"email",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")sr.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"emoji",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")er.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"uuid",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Xn.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"cuid",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Yn.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"cuid2",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Qn.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"ulid",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),m(r,{validation:"url",code:h.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"regex",code:h.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(e,r),m(r,{code:h.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(r=this._getOrReturnCtx(e,r),m(r,{code:h.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(r=this._getOrReturnCtx(e,r),m(r,{code:h.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?ar(a).test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{code:h.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="ip"?ir(e.data,a.version)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"ip",code:h.invalid_string,message:a.message}),n.dirty()):E.assertNever(a);return{status:n.value,value:e.data}}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...y.errToObj(e)})}url(e){return this._addCheck({kind:"url",...y.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...y.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...y.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...y.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...y.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...y.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...y.errToObj(e)})}datetime(e){var s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(s=e==null?void 0:e.offset)!==null&&s!==void 0?s:!1,...y.errToObj(e==null?void 0:e.message)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...y.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s==null?void 0:s.position,...y.errToObj(s==null?void 0:s.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...y.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...y.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...y.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...y.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...y.errToObj(s)})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}P.create=t=>{var e;return new P({checks:[],typeName:v.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...x(t)})};function or(t,e){const s=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=s>n?s:n,a=parseInt(t.toFixed(r).replace(".","")),i=parseInt(e.toFixed(r).replace(".",""));return a%i/Math.pow(10,r)}class Y extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==p.number){const a=this._getOrReturnCtx(e);return m(a,{code:h.invalid_type,expected:p.number,received:a.parsedType}),b}let n;const r=new I;for(const a of this._def.checks)a.kind==="int"?E.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:h.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?or(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:h.not_finite,message:a.message}),r.dirty()):E.assertNever(a);return{status:r.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,y.toString(s))}gt(e,s){return this.setLimit("min",e,!1,y.toString(s))}lte(e,s){return this.setLimit("max",e,!0,y.toString(s))}lt(e,s){return this.setLimit("max",e,!1,y.toString(s))}setLimit(e,s,n,r){return new Y({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:n,message:y.toString(r)}]})}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:y.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:y.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.toString(e)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&E.isInteger(e.value))}get isFinite(){let e=null,s=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(s===null||n.value>s)&&(s=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(s)&&Number.isFinite(e)}}Y.create=t=>new Y({checks:[],typeName:v.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...x(t)});class Q extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==p.bigint){const a=this._getOrReturnCtx(e);return m(a,{code:h.invalid_type,expected:p.bigint,received:a.parsedType}),b}let n;const r=new I;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):E.assertNever(a);return{status:r.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,y.toString(s))}gt(e,s){return this.setLimit("min",e,!1,y.toString(s))}lte(e,s){return this.setLimit("max",e,!0,y.toString(s))}lt(e,s){return this.setLimit("max",e,!1,y.toString(s))}setLimit(e,s,n,r){return new Q({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:n,message:y.toString(r)}]})}_addCheck(e){return new Q({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(s)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}Q.create=t=>{var e;return new Q({checks:[],typeName:v.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...x(t)})};class _e extends k{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==p.boolean){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.boolean,received:n.parsedType}),b}return j(e.data)}}_e.create=t=>new _e({typeName:v.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...x(t)});class te extends k{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==p.date){const a=this._getOrReturnCtx(e);return m(a,{code:h.invalid_type,expected:p.date,received:a.parsedType}),b}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return m(a,{code:h.invalid_date}),b}const n=new I;let r;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),m(r,{code:h.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),m(r,{code:h.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):E.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new te({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:y.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:y.toString(s)})}get minDate(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}}te.create=t=>new te({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:v.ZodDate,...x(t)});class He extends k{_parse(e){if(this._getType(e)!==p.symbol){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.symbol,received:n.parsedType}),b}return j(e.data)}}He.create=t=>new He({typeName:v.ZodSymbol,...x(t)});class be extends k{_parse(e){if(this._getType(e)!==p.undefined){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.undefined,received:n.parsedType}),b}return j(e.data)}}be.create=t=>new be({typeName:v.ZodUndefined,...x(t)});class we extends k{_parse(e){if(this._getType(e)!==p.null){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.null,received:n.parsedType}),b}return j(e.data)}}we.create=t=>new we({typeName:v.ZodNull,...x(t)});class oe extends k{constructor(){super(...arguments),this._any=!0}_parse(e){return j(e.data)}}oe.create=t=>new oe({typeName:v.ZodAny,...x(t)});class se extends k{constructor(){super(...arguments),this._unknown=!0}_parse(e){return j(e.data)}}se.create=t=>new se({typeName:v.ZodUnknown,...x(t)});class J extends k{_parse(e){const s=this._getOrReturnCtx(e);return m(s,{code:h.invalid_type,expected:p.never,received:s.parsedType}),b}}J.create=t=>new J({typeName:v.ZodNever,...x(t)});class Je extends k{_parse(e){if(this._getType(e)!==p.undefined){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.void,received:n.parsedType}),b}return j(e.data)}}Je.create=t=>new Je({typeName:v.ZodVoid,...x(t)});class B extends k{_parse(e){const{ctx:s,status:n}=this._processInputParams(e),r=this._def;if(s.parsedType!==p.array)return m(s,{code:h.invalid_type,expected:p.array,received:s.parsedType}),b;if(r.exactLength!==null){const i=s.data.length>r.exactLength.value,o=s.data.length<r.exactLength.value;(i||o)&&(m(s,{code:i?h.too_big:h.too_small,minimum:o?r.exactLength.value:void 0,maximum:i?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&s.data.length<r.minLength.value&&(m(s,{code:h.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&s.data.length>r.maxLength.value&&(m(s,{code:h.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),s.common.async)return Promise.all([...s.data].map((i,o)=>r.type._parseAsync(new V(s,i,s.path,o)))).then(i=>I.mergeArray(n,i));const a=[...s.data].map((i,o)=>r.type._parseSync(new V(s,i,s.path,o)));return I.mergeArray(n,a)}get element(){return this._def.type}min(e,s){return new B({...this._def,minLength:{value:e,message:y.toString(s)}})}max(e,s){return new B({...this._def,maxLength:{value:e,message:y.toString(s)}})}length(e,s){return new B({...this._def,exactLength:{value:e,message:y.toString(s)}})}nonempty(e){return this.min(1,e)}}B.create=(t,e)=>new B({type:t,minLength:null,maxLength:null,exactLength:null,typeName:v.ZodArray,...x(e)});function le(t){if(t instanceof C){const e={};for(const s in t.shape){const n=t.shape[s];e[s]=W.create(le(n))}return new C({...t._def,shape:()=>e})}else return t instanceof B?new B({...t._def,type:le(t.element)}):t instanceof W?W.create(le(t.unwrap())):t instanceof re?re.create(le(t.unwrap())):t instanceof F?F.create(t.items.map(e=>le(e))):t}class C extends k{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),s=E.objectKeys(e);return this._cached={shape:e,keys:s}}_parse(e){if(this._getType(e)!==p.object){const l=this._getOrReturnCtx(e);return m(l,{code:h.invalid_type,expected:p.object,received:l.parsedType}),b}const{status:n,ctx:r}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof J&&this._def.unknownKeys==="strip"))for(const l in r.data)i.includes(l)||o.push(l);const u=[];for(const l of i){const f=a[l],_=r.data[l];u.push({key:{status:"valid",value:l},value:f._parse(new V(r,_,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof J){const l=this._def.unknownKeys;if(l==="passthrough")for(const f of o)u.push({key:{status:"valid",value:f},value:{status:"valid",value:r.data[f]}});else if(l==="strict")o.length>0&&(m(r,{code:h.unrecognized_keys,keys:o}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const f of o){const _=r.data[f];u.push({key:{status:"valid",value:f},value:l._parse(new V(r,_,r.path,f)),alwaysSet:f in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const l=[];for(const f of u){const _=await f.key;l.push({key:_,value:await f.value,alwaysSet:f.alwaysSet})}return l}).then(l=>I.mergeObjectSync(n,l)):I.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return y.errToObj,new C({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,n)=>{var r,a,i,o;const u=(i=(a=(r=this._def).errorMap)===null||a===void 0?void 0:a.call(r,s,n).message)!==null&&i!==void 0?i:n.defaultError;return s.code==="unrecognized_keys"?{message:(o=y.errToObj(e).message)!==null&&o!==void 0?o:u}:{message:u}}}:{}})}strip(){return new C({...this._def,unknownKeys:"strip"})}passthrough(){return new C({...this._def,unknownKeys:"passthrough"})}extend(e){return new C({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new C({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:v.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new C({...this._def,catchall:e})}pick(e){const s={};return E.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(s[n]=this.shape[n])}),new C({...this._def,shape:()=>s})}omit(e){const s={};return E.objectKeys(this.shape).forEach(n=>{e[n]||(s[n]=this.shape[n])}),new C({...this._def,shape:()=>s})}deepPartial(){return le(this)}partial(e){const s={};return E.objectKeys(this.shape).forEach(n=>{const r=this.shape[n];e&&!e[n]?s[n]=r:s[n]=r.optional()}),new C({...this._def,shape:()=>s})}required(e){const s={};return E.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])s[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof W;)a=a._def.innerType;s[n]=a}}),new C({...this._def,shape:()=>s})}keyof(){return ds(E.objectKeys(this.shape))}}C.create=(t,e)=>new C({shape:()=>t,unknownKeys:"strip",catchall:J.create(),typeName:v.ZodObject,...x(e)}),C.strictCreate=(t,e)=>new C({shape:()=>t,unknownKeys:"strict",catchall:J.create(),typeName:v.ZodObject,...x(e)}),C.lazycreate=(t,e)=>new C({shape:t,unknownKeys:"strip",catchall:J.create(),typeName:v.ZodObject,...x(e)});class xe extends k{_parse(e){const{ctx:s}=this._processInputParams(e),n=this._def.options;function r(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return s.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new D(o.ctx.common.issues));return m(s,{code:h.invalid_union,unionErrors:i}),b}if(s.common.async)return Promise.all(n.map(async a=>{const i={...s,common:{...s.common,issues:[]},parent:null};return{result:await a._parseAsync({data:s.data,path:s.path,parent:i}),ctx:i}})).then(r);{let a;const i=[];for(const u of n){const l={...s,common:{...s.common,issues:[]},parent:null},f=u._parseSync({data:s.data,path:s.path,parent:l});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(a)return s.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(u=>new D(u));return m(s,{code:h.invalid_union,unionErrors:o}),b}}get options(){return this._def.options}}xe.create=(t,e)=>new xe({options:t,typeName:v.ZodUnion,...x(e)});const We=t=>t instanceof Te?We(t.schema):t instanceof M?We(t.innerType()):t instanceof Ee?[t.value]:t instanceof ee?t.options:t instanceof Oe?Object.keys(t.enum):t instanceof Ne?We(t._def.innerType):t instanceof be?[void 0]:t instanceof we?[null]:null;class Ke extends k{_parse(e){const{ctx:s}=this._processInputParams(e);if(s.parsedType!==p.object)return m(s,{code:h.invalid_type,expected:p.object,received:s.parsedType}),b;const n=this.discriminator,r=s.data[n],a=this.optionsMap.get(r);return a?s.common.async?a._parseAsync({data:s.data,path:s.path,parent:s}):a._parseSync({data:s.data,path:s.path,parent:s}):(m(s,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),b)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,s,n){const r=new Map;for(const a of s){const i=We(a.shape[e]);if(!i)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,a)}}return new Ke({typeName:v.ZodDiscriminatedUnion,discriminator:e,options:s,optionsMap:r,...x(n)})}}function vt(t,e){const s=X(t),n=X(e);if(t===e)return{valid:!0,data:t};if(s===p.object&&n===p.object){const r=E.objectKeys(e),a=E.objectKeys(t).filter(o=>r.indexOf(o)!==-1),i={...t,...e};for(const o of a){const u=vt(t[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(s===p.array&&n===p.array){if(t.length!==e.length)return{valid:!1};const r=[];for(let a=0;a<t.length;a++){const i=t[a],o=e[a],u=vt(i,o);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return s===p.date&&n===p.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ke extends k{_parse(e){const{status:s,ctx:n}=this._processInputParams(e),r=(a,i)=>{if(yt(a)||yt(i))return b;const o=vt(a.value,i.value);return o.valid?((gt(a)||gt(i))&&s.dirty(),{status:s.value,value:o.data}):(m(n,{code:h.invalid_intersection_types}),b)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>r(a,i)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ke.create=(t,e,s)=>new ke({left:t,right:e,typeName:v.ZodIntersection,...x(s)});class F extends k{_parse(e){const{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==p.array)return m(n,{code:h.invalid_type,expected:p.array,received:n.parsedType}),b;if(n.data.length<this._def.items.length)return m(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;!this._def.rest&&n.data.length>this._def.items.length&&(m(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const a=[...n.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new V(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>I.mergeArray(s,i)):I.mergeArray(s,a)}get items(){return this._def.items}rest(e){return new F({...this._def,rest:e})}}F.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new F({items:t,typeName:v.ZodTuple,rest:null,...x(e)})};class Se extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==p.object)return m(n,{code:h.invalid_type,expected:p.object,received:n.parsedType}),b;const r=[],a=this._def.keyType,i=this._def.valueType;for(const o in n.data)r.push({key:a._parse(new V(n,o,n.path,o)),value:i._parse(new V(n,n.data[o],n.path,o))});return n.common.async?I.mergeObjectAsync(s,r):I.mergeObjectSync(s,r)}get element(){return this._def.valueType}static create(e,s,n){return s instanceof k?new Se({keyType:e,valueType:s,typeName:v.ZodRecord,...x(n)}):new Se({keyType:P.create(),valueType:e,typeName:v.ZodRecord,...x(s)})}}class qe extends k{_parse(e){const{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==p.map)return m(n,{code:h.invalid_type,expected:p.map,received:n.parsedType}),b;const r=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,u],l)=>({key:r._parse(new V(n,o,n.path,[l,"key"])),value:a._parse(new V(n,u,n.path,[l,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const l=await u.key,f=await u.value;if(l.status==="aborted"||f.status==="aborted")return b;(l.status==="dirty"||f.status==="dirty")&&s.dirty(),o.set(l.value,f.value)}return{status:s.value,value:o}})}else{const o=new Map;for(const u of i){const l=u.key,f=u.value;if(l.status==="aborted"||f.status==="aborted")return b;(l.status==="dirty"||f.status==="dirty")&&s.dirty(),o.set(l.value,f.value)}return{status:s.value,value:o}}}}qe.create=(t,e,s)=>new qe({valueType:e,keyType:t,typeName:v.ZodMap,...x(s)});class ne extends k{_parse(e){const{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==p.set)return m(n,{code:h.invalid_type,expected:p.set,received:n.parsedType}),b;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(m(n,{code:h.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),s.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(m(n,{code:h.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),s.dirty());const a=this._def.valueType;function i(u){const l=new Set;for(const f of u){if(f.status==="aborted")return b;f.status==="dirty"&&s.dirty(),l.add(f.value)}return{status:s.value,value:l}}const o=[...n.data.values()].map((u,l)=>a._parse(new V(n,u,n.path,l)));return n.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,s){return new ne({...this._def,minSize:{value:e,message:y.toString(s)}})}max(e,s){return new ne({...this._def,maxSize:{value:e,message:y.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}}ne.create=(t,e)=>new ne({valueType:t,minSize:null,maxSize:null,typeName:v.ZodSet,...x(e)});class ce extends k{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:s}=this._processInputParams(e);if(s.parsedType!==p.function)return m(s,{code:h.invalid_type,expected:p.function,received:s.parsedType}),b;function n(o,u){return $e({data:o,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,ze(),ve].filter(l=>!!l),issueData:{code:h.invalid_arguments,argumentsError:u}})}function r(o,u){return $e({data:o,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,ze(),ve].filter(l=>!!l),issueData:{code:h.invalid_return_type,returnTypeError:u}})}const a={errorMap:s.common.contextualErrorMap},i=s.data;return this._def.returns instanceof ue?j(async(...o)=>{const u=new D([]),l=await this._def.args.parseAsync(o,a).catch(A=>{throw u.addIssue(n(o,A)),u}),f=await i(...l);return await this._def.returns._def.type.parseAsync(f,a).catch(A=>{throw u.addIssue(r(f,A)),u})}):j((...o)=>{const u=this._def.args.safeParse(o,a);if(!u.success)throw new D([n(o,u.error)]);const l=i(...u.data),f=this._def.returns.safeParse(l,a);if(!f.success)throw new D([r(l,f.error)]);return f.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ce({...this._def,args:F.create(e).rest(se.create())})}returns(e){return new ce({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,s,n){return new ce({args:e||F.create([]).rest(se.create()),returns:s||se.create(),typeName:v.ZodFunction,...x(n)})}}class Te extends k{get schema(){return this._def.getter()}_parse(e){const{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}Te.create=(t,e)=>new Te({getter:t,typeName:v.ZodLazy,...x(e)});class Ee extends k{_parse(e){if(e.data!==this._def.value){const s=this._getOrReturnCtx(e);return m(s,{received:s.data,code:h.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ee.create=(t,e)=>new Ee({value:t,typeName:v.ZodLiteral,...x(e)});function ds(t,e){return new ee({values:t,typeName:v.ZodEnum,...x(e)})}class ee extends k{_parse(e){if(typeof e.data!="string"){const s=this._getOrReturnCtx(e),n=this._def.values;return m(s,{expected:E.joinValues(n),received:s.parsedType,code:h.invalid_type}),b}if(this._def.values.indexOf(e.data)===-1){const s=this._getOrReturnCtx(e),n=this._def.values;return m(s,{received:s.data,code:h.invalid_enum_value,options:n}),b}return j(e.data)}get options(){return this._def.values}get enum(){const e={};for(const s of this._def.values)e[s]=s;return e}get Values(){const e={};for(const s of this._def.values)e[s]=s;return e}get Enum(){const e={};for(const s of this._def.values)e[s]=s;return e}extract(e){return ee.create(e)}exclude(e){return ee.create(this.options.filter(s=>!e.includes(s)))}}ee.create=ds;class Oe extends k{_parse(e){const s=E.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==p.string&&n.parsedType!==p.number){const r=E.objectValues(s);return m(n,{expected:E.joinValues(r),received:n.parsedType,code:h.invalid_type}),b}if(s.indexOf(e.data)===-1){const r=E.objectValues(s);return m(n,{received:n.data,code:h.invalid_enum_value,options:r}),b}return j(e.data)}get enum(){return this._def.values}}Oe.create=(t,e)=>new Oe({values:t,typeName:v.ZodNativeEnum,...x(e)});class ue extends k{unwrap(){return this._def.type}_parse(e){const{ctx:s}=this._processInputParams(e);if(s.parsedType!==p.promise&&s.common.async===!1)return m(s,{code:h.invalid_type,expected:p.promise,received:s.parsedType}),b;const n=s.parsedType===p.promise?s.data:Promise.resolve(s.data);return j(n.then(r=>this._def.type.parseAsync(r,{path:s.path,errorMap:s.common.contextualErrorMap})))}}ue.create=(t,e)=>new ue({type:t,typeName:v.ZodPromise,...x(e)});class M extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===v.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:s,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if(r.type==="preprocess"){const i=r.transform(n.data);return n.common.async?Promise.resolve(i).then(o=>this._def.schema._parseAsync({data:o,path:n.path,parent:n})):this._def.schema._parseSync({data:i,path:n.path,parent:n})}const a={addIssue:i=>{m(n,i),i.fatal?s.abort():s.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),r.type==="refinement"){const i=o=>{const u=r.refinement(o,a);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?b:(o.status==="dirty"&&s.dirty(),i(o.value),{status:s.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?b:(o.status==="dirty"&&s.dirty(),i(o.value).then(()=>({status:s.value,value:o.value}))))}if(r.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ve(i))return i;const o=r.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ve(i)?Promise.resolve(r.transform(i.value,a)).then(o=>({status:s.value,value:o})):i);E.assertNever(r)}}M.create=(t,e,s)=>new M({schema:t,typeName:v.ZodEffects,effect:e,...x(s)}),M.createWithPreprocess=(t,e,s)=>new M({schema:e,effect:{type:"preprocess",transform:t},typeName:v.ZodEffects,...x(s)});class W extends k{_parse(e){return this._getType(e)===p.undefined?j(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}W.create=(t,e)=>new W({innerType:t,typeName:v.ZodOptional,...x(e)});class re extends k{_parse(e){return this._getType(e)===p.null?j(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}re.create=(t,e)=>new re({innerType:t,typeName:v.ZodNullable,...x(e)});class Ne extends k{_parse(e){const{ctx:s}=this._processInputParams(e);let n=s.data;return s.parsedType===p.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}Ne.create=(t,e)=>new Ne({innerType:t,typeName:v.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...x(e)});class Ge extends k{_parse(e){const{ctx:s}=this._processInputParams(e),n={...s,common:{...s.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Fe(r)?r.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ge.create=(t,e)=>new Ge({innerType:t,typeName:v.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...x(e)});class Xe extends k{_parse(e){if(this._getType(e)!==p.nan){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.nan,received:n.parsedType}),b}return{status:"valid",value:e.data}}}Xe.create=t=>new Xe({typeName:v.ZodNaN,...x(t)});const lr=Symbol("zod_brand");class fs extends k{_parse(e){const{ctx:s}=this._processInputParams(e),n=s.data;return this._def.type._parse({data:n,path:s.path,parent:s})}unwrap(){return this._def.type}}class Ce extends k{_parse(e){const{status:s,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?b:a.status==="dirty"?(s.dirty(),cs(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?b:r.status==="dirty"?(s.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,s){return new Ce({in:e,out:s,typeName:v.ZodPipeline})}}const hs=(t,e={},s)=>t?oe.create().superRefine((n,r)=>{var a,i;if(!t(n)){const o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(i=(a=o.fatal)!==null&&a!==void 0?a:s)!==null&&i!==void 0?i:!0,l=typeof o=="string"?{message:o}:o;r.addIssue({code:"custom",...l,fatal:u})}}):oe.create(),cr={object:C.lazycreate};var v;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline"})(v||(v={}));const ur=(t,e={message:`Input not instance of ${t.name}`})=>hs(s=>s instanceof t,e),ps=P.create,ms=Y.create,dr=Xe.create,fr=Q.create,ys=_e.create,hr=te.create,pr=He.create,mr=be.create,yr=we.create,gr=oe.create,vr=se.create,_r=J.create,br=Je.create,wr=B.create,xr=C.create,kr=C.strictCreate,Sr=xe.create,Tr=Ke.create,Er=ke.create,Or=F.create,Nr=Se.create,Cr=qe.create,Ar=ne.create,Rr=ce.create,Ir=Te.create,jr=Ee.create,Zr=ee.create,Lr=Oe.create,Dr=ue.create,gs=M.create,Pr=W.create,Br=re.create,Mr=M.createWithPreprocess,Ur=Ce.create;var d=Object.freeze({__proto__:null,defaultErrorMap:ve,setErrorMap:qn,getErrorMap:ze,makeIssue:$e,EMPTY_PATH:Gn,addIssueToContext:m,ParseStatus:I,INVALID:b,DIRTY:cs,OK:j,isAborted:yt,isDirty:gt,isValid:Ve,isAsync:Fe,get util(){return E},get objectUtil(){return mt},ZodParsedType:p,getParsedType:X,ZodType:k,ZodString:P,ZodNumber:Y,ZodBigInt:Q,ZodBoolean:_e,ZodDate:te,ZodSymbol:He,ZodUndefined:be,ZodNull:we,ZodAny:oe,ZodUnknown:se,ZodNever:J,ZodVoid:Je,ZodArray:B,ZodObject:C,ZodUnion:xe,ZodDiscriminatedUnion:Ke,ZodIntersection:ke,ZodTuple:F,ZodRecord:Se,ZodMap:qe,ZodSet:ne,ZodFunction:ce,ZodLazy:Te,ZodLiteral:Ee,ZodEnum:ee,ZodNativeEnum:Oe,ZodPromise:ue,ZodEffects:M,ZodTransformer:M,ZodOptional:W,ZodNullable:re,ZodDefault:Ne,ZodCatch:Ge,ZodNaN:Xe,BRAND:lr,ZodBranded:fs,ZodPipeline:Ce,custom:hs,Schema:k,ZodSchema:k,late:cr,get ZodFirstPartyTypeKind(){return v},coerce:{string:t=>P.create({...t,coerce:!0}),number:t=>Y.create({...t,coerce:!0}),boolean:t=>_e.create({...t,coerce:!0}),bigint:t=>Q.create({...t,coerce:!0}),date:t=>te.create({...t,coerce:!0})},any:gr,array:wr,bigint:fr,boolean:ys,date:hr,discriminatedUnion:Tr,effect:gs,enum:Zr,function:Rr,instanceof:ur,intersection:Er,lazy:Ir,literal:jr,map:Cr,nan:dr,nativeEnum:Lr,never:_r,null:yr,nullable:Br,number:ms,object:xr,oboolean:()=>ys().optional(),onumber:()=>ms().optional(),optional:Pr,ostring:()=>ps().optional(),pipeline:Ur,preprocess:Mr,promise:Dr,record:Nr,set:Ar,strictObject:kr,string:ps,symbol:pr,transformer:gs,tuple:Or,undefined:mr,union:Sr,unknown:vr,void:br,NEVER:b,ZodIssueCode:h,quotelessJson:Kn,ZodError:D});class vs{constructor(e,s){w(this,"apiKey");w(this,"parentId");w(this,"images");w(this,"length");this.apiKey=s,this.parentId=e,this.images=[],this.length=this.images.length}async add(e){return this.images.push(e),this.length=this.images.length,await Wn(this.apiKey,this.parentId,new bs(e)),new Promise(s=>{s(this.length)})}}const _s=d.object({handle:d.string(),url:d.string(),width:d.number(),height:d.number(),orientation:d.number(),taken_at:d.string(),camera_make:d.string().optional(),camera:d.string().optional(),filename:d.string()});class bs{constructor(e){w(this,"handle");w(this,"url");w(this,"width");w(this,"height");w(this,"orientation");w(this,"taken_at");w(this,"camera_make");w(this,"camera");w(this,"filename");this.handle=e.handle,this.url=e.url,this.width=e.width,this.height=e.height,this.orientation=e.rotation,this.taken_at=e.captureTime,this.camera_make=e.cameraMake,this.camera=e.cameraModel,this.filename=e.filename}}const ws=["new","ingesting","submitted","storyboarding","storyboarding succeeded","designing","designing succeeded","layouting","layouting succeeded","embellishing","embellishing succeeded","polishing","polishing succeeded","ready","error"],_t=["baby","birthday","default","everyday","family","kids","life-stories","portfolio","school-memories","seasonal-holidays","special-celebrations","sports-and-hobbies","travel","wedding","year-in-review"],bt={1005:{slug:"modern-black-sfly"},1101:{slug:"bon-voyage-sfly"},1103:{slug:"fun-in-the-sun-sfly"},1201:{slug:"modern-wedding-sfly"},3001:{slug:"digiscrap-sfly"},4034:{slug:"travel-snapshots-sfly"},4035:{slug:"vintage-travel-sfly"},5017:{slug:"natural-neutrals-sfly"},5033:{slug:"chalkboard-chic-sfly"},5079:{slug:"hello-spring-sfly"},5082:{slug:"familygram-sfly"},5085:{slug:"best-day-ever-sfly"},5091:{slug:"little-love-sfly"},5118:{slug:"a-year-in-color-sfly"},5120:{slug:"milestone-anniversaries-sfly"},5121:{slug:"the-travel-bug-sfly"},5122:{slug:"modern-white-sfly"},5127:{slug:"outdoor-wedding-sfly"},5134:{slug:"classic-wedding-sfly"},5138:{slug:"kraft-pop-sfly"},5142:{slug:"simply-black-sfly"},5144:{slug:"autumn-memories-sfly"},5146:{slug:"everyday-sentiments-sfly"},5149:{slug:"everyday-happiness-sfly"},5150:{slug:"its-a-girl-thing-sfly"},5155:{slug:"made-with-love-sfly"},5157:{slug:"high-school-memories-sfly"},5161:{slug:"rustic-wedding-sfly"},5165:{slug:"life-is-grand-sfly"},5167:{slug:"adventure-awaits-sfly"},5168:{slug:"disney-adventure-sfly"},5171:{slug:"world-travel-sfly"},5174:{slug:"hello-summer-sfly"},5183:{slug:"everything-sports-sfly"},5188:{slug:"everyday-watercolor-sfly"},5189:{slug:"holiday-memories-sfly"},5213:{slug:"love-and-thanks-sfly"},5218:{slug:"babys-first-year-sfly"},5219:{slug:"usa-travel-sfly"},5220:{slug:"vintage-wedding-sfly"},5226:{slug:"love-you-because-sfly"},5228:{slug:"reunion-sfly"},5238:{slug:"whimsy-chalkboard-sfly"},5242:{slug:"modern-indigo-sfly"},5250:{slug:"family-yearbook-sfly"},5255:{slug:"elegant-wedding-sfly"},5258:{slug:"family-vacation-sfly"},5259:{slug:"beach-travel-sfly"},5261:{slug:"sparkle-and-shine-sfly"},5262:{slug:"welcome-baby-sfly"},5265:{slug:"vivid-watercolor-sfly"},5266:{slug:"what-i-love-about-you-sfly"},5272:{slug:"love-grows-sfly"},5274:{slug:"painted-seasons-sfly"},5278:{slug:"vintage-disney-sfly"},5292:{slug:"modern-grey-sfly"},5297:{slug:"modern-love-story-sfly"},5299:{slug:"modern-travel-sfly"},5304:{slug:"beach-wedding-sfly"},5305:{slug:"rustic-farmhouse-sfly"},5308:{slug:"tropical-travel-sfly"},6e3:{slug:"travel-abroad-sfly"},6001:{slug:"everyday-rustic-sfly"},6002:{slug:"simply-modern-sfly"},6003:{slug:"modern-baby-sfly"},6004:{slug:"modern-photo-album-sfly"},6005:{slug:"travel-adventures-sfly"},6006:{slug:"watercolor-year-in-review-sfly"},6007:{slug:"beach-bliss-sfly"},6008:{slug:"simply-gray-sfly"},6009:{slug:"family-favorites-by-lure-design-sfly"},6010:{slug:"travel-gallery-sfly"},6011:{slug:"our-wedding-day-sfly"},6012:{slug:"chic-celebrations-by-float-paperie-sfly"},6013:{slug:"simply-bold-type-sfly"},6014:{slug:"colorful-florals-by-potts-design-sfly"},6015:{slug:"softly-rustic-sfly"},6016:{slug:"ombre-watercolor-sfly"},6017:{slug:"forever-love-by-with-merriment-sfly"},6018:{slug:"colorful-memories-by-britt-bass-sfly"},6019:{slug:"celebrate-family-by-float-paperie-sfly"},6020:{slug:"disney-family-adventures-sfly"},6021:{slug:"everyday-neutrals-sfly"},6022:{slug:"colorful-childhood-sfly"},6023:{slug:"everyday-indigo-sfly"},6024:{slug:"shimmer-and-shine-sfly"},6025:{slug:"summertime-fun-sfly"},6026:{slug:"pet-lover-sfly"},6027:{slug:"modern-wedding-story-sfly"},6028:{slug:"family-blessings-by-potts-design-sfly"},6030:{slug:"outdoor-adventures-by-sarah-hawkins-designs-sfly"},6031:{slug:"travel-memories-sfly"},6032:{slug:"tropical-travels-sfly"},6033:{slug:"everyday-chalkboard-by-potts-design-sfly"},6034:{slug:"classic-disney-sfly"},6035:{slug:"cheerful-color-sfly"},6036:{slug:"colorful-birthday-sfly"},6038:{slug:"classic-baby-sfly"},6039:{slug:"bold-year-in-review-by-float-paperie-sfly"},6040:{slug:"colorfully-fun-sfly"},6041:{slug:"colorful-year-in-review-by-sarah-hawkins-designs-sfly"},6042:{slug:"gilded-wedding-sfly"},6043:{slug:"road-trip-travel-by-sarah-hawkins-designs-sfly"},6044:{slug:"rustic-gilded-wedding-sfly"},6045:{slug:"elegantly-scripted-year-in-review-sfly"},6047:{slug:"2020-what-a-year-sfly"},6057:{slug:"best-mom-ever-sfly"},6052:{slug:"celebration-of-life-by-sarah-hawkins-designs-sfly"},6054:{slug:"colorful-school-days-by-float-paperie-sfly"},6051:{slug:"love-is-all-we-need-sfly"},6058:{slug:"graduation-celebration-sfly"},6056:{slug:"our-wedding-day-guestbook-sfly"},6055:{slug:"muted-everyday-abstract-sfly"},6046:{slug:"winter-memories-by-sarah-hawkins-design-sfly"},6053:{slug:"best-dad-ever-sfly"},6050:{slug:"watercolor-greenery-by-sarah-hawkins-designs-sfly"},6063:{slug:"watercolor-floral-wedding-by-kim-thoa-sfly"},6060:{slug:"watercolor-baby-girl-sfly"},6059:{slug:"watercolor-baby-boy-sfly"},6048:{slug:"simple-elegant-wedding-sfly"},6049:{slug:"gilded-wedding-guestbook-sfly"},6037:{slug:"everyday-fairytale-by-jenny-romanski-sfly"},6061:{slug:"best-grandparents-ever-sfly"},6068:{slug:"winter-getaway-sfly"},6067:{slug:"national-parks-travel-by-eiman-design-co-sfly"},6065:{slug:"go-sports-by-lure-design-sfly"},6066:{slug:"elegant-wedding-greenery-by-kim-thoa-sfly"},6064:{slug:"boho-travel-by-umaiana-studio-sfly"},6071:{slug:"modern-dark-neutrals-sfly"},6072:{slug:"modern-light-neutrals-sfly"},6073:{slug:"modern-celebrations-sfly"},6074:{slug:"bright-and-bold-kids-year-in-review-by-sarah-hawkins-designs-sfly"},6085:{slug:"classic-school-yearbook-sfly"},6084:{slug:"colorful-elementary-school-yearbook-sfly"},5402:{slug:"everyday-recipes-by-slightly-stationery-sfly"},6083:{slug:"school-days-yearbook-sfly"},6082:{slug:"the-story-of-me-sfly"},6086:{slug:"whimsical-recipes-by-slightly-stationery-sfly"},6101:{slug:"babys-first-sfly"},6103:{slug:"classic-recipes-sfly"},6104:{slug:"elevated-rustic-sfly"},6105:{slug:"boho-summer-sfly"},6116:{slug:"boho-baby-sfly"},6117:{slug:"simply-gallery-sfly"},6118:{slug:"this-is-love-sfly"},6120:{slug:"wedding-gallery-sfly"},6121:{slug:"watercolorwashes-sfly"},6124:{slug:"graduation-photo-album-sfly"},6125:{slug:"modern-year-in-review-photo-album-sfly"},6126:{slug:"black-white-photo-album-sfly"},6132:{slug:"travel-journal-sfly"},6133:{slug:"rustic-gallery-sfly"},6137:{slug:"summer-adventures-sfly"},6075:{slug:"together-again-sfly"},6078:{slug:"everyday-boho-by-umaiana-studio-sfly"},6089:{slug:"colorful-gradients-sfly"},6096:{slug:"simply-scrapbook-sfly"},6097:{slug:"boho-wedding-sfly"},6098:{slug:"black-and-white-rustic-sfly"},6099:{slug:"bright-color-pop-sfly"}},wt=["8x8","10x10","12x12","8x11","11x8","11x14"],xt=["sc","hc","pl"],kt=["sp","sl","dl"],St=["low","medium","high"],Tt=["best","most","all"],Et=["none","few","lots"],Ot=["none","few","lots"];class zr{constructor(e){w(this,"occasion");w(this,"style");w(this,"book_size");w(this,"cover_type");w(this,"page_type");w(this,"image_density");w(this,"image_filtering_level");w(this,"embellishment_level");w(this,"text_sticker_level");this.occasion=e.occasion,this.style=e.style,this.book_size=e.book_size,this.cover_type=e.cover_type,this.page_type=e.page_type,this.image_density=e.image_density,this.image_filtering_level=e.image_filtering_level,this.embellishment_level=e.embellishment_level,this.text_sticker_level=e.text_sticker_level}}const $r=d.object({occasion:d.enum(_t),style:d.string(),book_size:d.enum(wt),cover_type:d.enum(xt),page_type:d.enum(kt),image_density:d.enum(St),image_filtering_level:d.enum(Tt),embellishment_level:d.enum(Et),text_sticker_level:d.enum(Ot)}),xs=d.object({id:d.string(),title:d.string(),design_request:$r,state:d.enum(ws).optional(),guid:d.string().optional()});class Nt{constructor(e){w(this,"id");w(this,"title");w(this,"design_request");w(this,"state");w(this,"guid");this.id=e.id,this.title=e.title,this.design_request=new zr(e.design_request),this.state=e.state,this.guid=e.guid}}function ks(t){const e=bt[t.style].slug,s=Ct({...t});return s.style=e,new Nt({id:t.parentId,guid:t.guid,title:t.title,design_request:s})}const Ye=d.object({maxPageCount:d.number(),minPageCount:d.number(),maxImageCount:d.number(),avgImageCount:d.number(),minImageCount:d.number()}),Ss=d.object({high:Ye,medium:Ye,low:Ye}),Ts=d.object({densities:Ss});async function Vr(t,e,s){return ye(async()=>{const n=await is({url:`${ge}/api/v1/designoptions/booksize/${e}/imagecount/${s}`,apiKey:t}),r=At(n.data);return Ts.parse(r),r})}const Fr=d.object({photoRefId:d.string(),finalCrop:d.array(d.number())}),Hr=d.object({x:d.number(),y:d.number(),width:d.number().optional(),height:d.number().optional(),rotation:d.number()}),Jr=d.object({id:d.string(),llx:d.number(),lly:d.number(),urx:d.number(),ury:d.number(),data:d.string().nullable(),title:d.string(),width:d.number(),effect:d.string(),height:d.number(),source:d.string(),rotation:d.number(),uploadTime:d.string()}),Wr=d.object({key:d.string(),value:d.union([d.string(),d.number(),d.boolean()]).nullable()}),Kr=d.object({type:d.string(),imageAssignment:Fr.optional(),position:Hr,seqNum:d.number(),z:d.number(),id:d.string().optional(),horizJustification:d.string().optional(),vertJustification:d.string().optional().nullable(),text:d.string().optional(),fontId:d.string().optional(),fontSize:d.number().optional(),fontColor:d.string().optional(),frame:d.string().optional()}),qr=d.object({url:d.string(),encryptId:d.string(),photoRefId:d.string(),photoId:d.string(),photoMetadata:Jr}),Gr=d.object({properties:d.array(Wr)}),Xr=d.object({backgroundId:d.string().nullable(),assets:d.array(Kr)}),Yr=d.object({pageNum:d.number(),type:d.string(),canvas:Xr}),Qr=d.object({pages:d.array(Yr),photoStrip:d.array(qr)}),ea=d.object({title:d.string(),coverSpecId:d.string(),styleId:d.number(),userId:d.string(),magicShopBook:Qr,reportingData:Gr});async function ta(t,e){return ye(async()=>{const s=(await os({url:`${ge}/api/v1/books`,apiKey:t,payload:e})).data;return xs.safeParse(s),new Nt(s)})}async function Es(t,e){return ye(async()=>{const s=(await Fn({url:`${ge}/api/v1/books/${e.id}`,apiKey:t,payload:e})).data;return xs.safeParse(s),new Nt(s)})}async function sa(t,e){return ye(async()=>{const s=(await is({url:`${ge}/api/v1/books/${e}/format/galleon`,apiKey:t})).data;return ea.parse(s),s})}class Os{constructor(e,s,n){w(this,"apiKey");w(this,"parentId");w(this,"title");w(this,"occasion");w(this,"style");w(this,"bookSize");w(this,"coverType");w(this,"pageType");w(this,"imageDensity");w(this,"imageFilteringLevel");w(this,"embellishmentLevel");w(this,"textStickerLevel");w(this,"images");w(this,"guid");this.apiKey=s,this.parentId=e,this.title=(n==null?void 0:n.title)||"",this.occasion=(n==null?void 0:n.occasion)||_t[0],this.style=(n==null?void 0:n.style)||parseInt(Object.keys(bt)[0]),this.bookSize=(n==null?void 0:n.bookSize)||wt[0],this.coverType=(n==null?void 0:n.coverType)||xt[0],this.pageType=(n==null?void 0:n.pageType)||kt[0],this.imageDensity=(n==null?void 0:n.imageDensity)||St[0],this.imageFilteringLevel=(n==null?void 0:n.imageFilteringLevel)||Tt[0],this.embellishmentLevel=(n==null?void 0:n.embellishmentLevel)||Et[0],this.textStickerLevel=(n==null?void 0:n.textStickerLevel)||Ot[0],this.images=new vs(this.parentId,this.apiKey)}async getOptions(e){return await Vr(this.apiKey,this.bookSize,e||this.images.length)}async submit(e){return e&&Object.assign(this,e),this.getProgress(),await Es(this.apiKey,ks(this)),this}async setGuid(e){return this.guid=e,await Es(this.apiKey,ks(this)),this.guid}async getJSON(){return await sa(this.apiKey,this.parentId)}async getProgress(){let e="new";const s=new WebSocket(`${Hn}/?book_id=${this.parentId}`),n=setTimeout(()=>{throw s.close(),new Error("Something went wrong. Please try again.")},Jn);s.onmessage=r=>{const a=JSON.parse(r.data);if(e!==a.state){e=a.state;const i=new CustomEvent("MagicBook.designRequestUpdated",{detail:a});window.dispatchEvent(i),["error","ready"].includes(a.state)&&(s.close(),clearTimeout(n))}}}}class na{constructor(e){w(this,"apiKey");this.apiKey=e}async createDesignRequest(e){const s=await ta(this.apiKey);return new Os(s.id,this.apiKey,e)}}O.DesignRequest=Os,O.ImageServer=bs,O.Images=vs,O.MagicBookClient=na,O.bookSizes=wt,O.coverTypes=xt,O.designOptionsSchema=Ts,O.embellishmentLevels=Et,O.imageDensities=St,O.imageDensityOptionSchema=Ye,O.imageDensityOptionsSchema=Ss,O.imageFilteringLevels=Tt,O.imageServerSchema=_s,O.occasions=_t,O.pageTypes=kt,O.states=ws,O.styles=bt,O.textStickerLevels=Ot,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
3
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...s){const n=new this(e);return s.forEach(r=>n.set(r)),n}static accessor(e){const n=(this[Xt]=this[Xt]={accessors:{}}).accessors,r=this.prototype;function a(i){const o=pe(i);n[o]||(An(r,i),n[o]=!0)}return c.isArray(e)?e.forEach(a):a(e),this}}Pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.freezeMethods(Pe.prototype),c.freezeMethods(Pe);const H=Pe;function ot(t,e){const s=this||at,n=e||s,r=H.from(n.headers);let a=n.data;return c.forEach(t,function(o){a=o.call(s,a,r.normalize(),e?e.status:void 0)}),r.normalize(),a}function Yt(t){return!!(t&&t.__CANCEL__)}function me(t,e,s){T.call(this,t??"canceled",T.ERR_CANCELED,e,s),this.name="CanceledError"}c.inherits(me,T,{__CANCEL__:!0});function Rn(t,e,s){const n=s.config.validateStatus;!s.status||!n||n(s.status)?t(s):e(new T("Request failed with status code "+s.status,[T.ERR_BAD_REQUEST,T.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}const In=$.isStandardBrowserEnv?function(){return{write:function(s,n,r,a,i,o){const u=[];u.push(s+"="+encodeURIComponent(n)),c.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),c.isString(a)&&u.push("path="+a),c.isString(i)&&u.push("domain="+i),o===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(s){const n=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function jn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Zn(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function Qt(t,e){return t&&!jn(e)?Zn(t,e):e}const Ln=$.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a");let n;function r(a){let i=a;return e&&(s.setAttribute("href",i),i=s.href),s.setAttribute("href",i),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return n=r(window.location.href),function(i){const o=c.isString(i)?r(i):i;return o.protocol===n.protocol&&o.host===n.host}}():function(){return function(){return!0}}();function Dn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Pn(t,e){t=t||10;const s=new Array(t),n=new Array(t);let r=0,a=0,i;return e=e!==void 0?e:1e3,function(u){const l=Date.now(),f=n[a];i||(i=l),s[r]=u,n[r]=l;let _=a,A=0;for(;_!==r;)A+=s[_++],_=_%t;if(r=(r+1)%t,r===a&&(a=(a+1)%t),l-i<e)return;const N=f&&l-f;return N?Math.round(A*1e3/N):void 0}}function es(t,e){let s=0;const n=Pn(50,250);return r=>{const a=r.loaded,i=r.lengthComputable?r.total:void 0,o=a-s,u=n(o),l=a<=i;s=a;const f={loaded:a,total:i,progress:i?a/i:void 0,bytes:o,rate:u||void 0,estimated:u&&i&&l?(i-a)/u:void 0,event:r};f[e?"download":"upload"]=!0,t(f)}}const Be={http:un,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(s,n){let r=t.data;const a=H.from(t.headers).normalize(),i=t.responseType;let o;function u(){t.cancelToken&&t.cancelToken.unsubscribe(o),t.signal&&t.signal.removeEventListener("abort",o)}c.isFormData(r)&&($.isStandardBrowserEnv||$.isStandardBrowserWebWorkerEnv?a.setContentType(!1):a.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(t.auth){const N=t.auth.username||"",g=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.set("Authorization","Basic "+btoa(N+":"+g))}const f=Qt(t.baseURL,t.url);l.open(t.method.toUpperCase(),Wt(f,t.params,t.paramsSerializer),!0),l.timeout=t.timeout;function _(){if(!l)return;const N=H.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),S={data:!i||i==="text"||i==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:N,config:t,request:l};Rn(function(U){s(U),u()},function(U){n(U),u()},S),l=null}if("onloadend"in l?l.onloadend=_:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(_)},l.onabort=function(){l&&(n(new T("Request aborted",T.ECONNABORTED,t,l)),l=null)},l.onerror=function(){n(new T("Network Error",T.ERR_NETWORK,t,l)),l=null},l.ontimeout=function(){let g=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const S=t.transitional||qt;t.timeoutErrorMessage&&(g=t.timeoutErrorMessage),n(new T(g,S.clarifyTimeoutError?T.ETIMEDOUT:T.ECONNABORTED,t,l)),l=null},$.isStandardBrowserEnv){const N=(t.withCredentials||Ln(f))&&t.xsrfCookieName&&In.read(t.xsrfCookieName);N&&a.set(t.xsrfHeaderName,N)}r===void 0&&a.setContentType(null),"setRequestHeader"in l&&c.forEach(a.toJSON(),function(g,S){l.setRequestHeader(S,g)}),c.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),i&&i!=="json"&&(l.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&l.addEventListener("progress",es(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",es(t.onUploadProgress)),(t.cancelToken||t.signal)&&(o=N=>{l&&(n(!N||N.type?new me(null,t,l):N),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(o),t.signal&&(t.signal.aborted?o():t.signal.addEventListener("abort",o)));const A=Dn(f);if(A&&$.protocols.indexOf(A)===-1){n(new T("Unsupported protocol "+A+":",T.ERR_BAD_REQUEST,t));return}l.send(r||null)})}};c.forEach(Be,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Bn={getAdapter:t=>{t=c.isArray(t)?t:[t];const{length:e}=t;let s,n;for(let r=0;r<e&&(s=t[r],!(n=c.isString(s)?Be[s.toLowerCase()]:s));r++);if(!n)throw n===!1?new T(`Adapter ${s} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(c.hasOwnProp(Be,s)?`Adapter '${s}' is not available in the build`:`Unknown adapter '${s}'`);if(!c.isFunction(n))throw new TypeError("adapter is not a function");return n},adapters:Be};function lt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new me(null,t)}function ts(t){return lt(t),t.headers=H.from(t.headers),t.data=ot.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Bn.getAdapter(t.adapter||at.adapter)(t).then(function(n){return lt(t),n.data=ot.call(t,t.transformResponse,n),n.headers=H.from(n.headers),n},function(n){return Yt(n)||(lt(t),n&&n.response&&(n.response.data=ot.call(t,t.transformResponse,n.response),n.response.headers=H.from(n.response.headers))),Promise.reject(n)})}const ss=t=>t instanceof H?t.toJSON():t;function ie(t,e){e=e||{};const s={};function n(l,f,_){return c.isPlainObject(l)&&c.isPlainObject(f)?c.merge.call({caseless:_},l,f):c.isPlainObject(f)?c.merge({},f):c.isArray(f)?f.slice():f}function r(l,f,_){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l,_)}else return n(l,f,_)}function a(l,f){if(!c.isUndefined(f))return n(void 0,f)}function i(l,f){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l)}else return n(void 0,f)}function o(l,f,_){if(_ in e)return n(l,f);if(_ in t)return n(void 0,l)}const u={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:o,headers:(l,f)=>r(ss(l),ss(f),!0)};return c.forEach(Object.keys(Object.assign({},t,e)),function(f){const _=u[f]||r,A=_(t[f],e[f],f);c.isUndefined(A)&&_!==o||(s[f]=A)}),s}const ns="1.4.0",ct={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ct[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const rs={};ct.transitional=function(e,s,n){function r(a,i){return"[Axios v"+ns+"] Transitional option '"+a+"'"+i+(n?". "+n:"")}return(a,i,o)=>{if(e===!1)throw new T(r(i," has been removed"+(s?" in "+s:"")),T.ERR_DEPRECATED);return s&&!rs[i]&&(rs[i]=!0,console.warn(r(i," has been deprecated since v"+s+" and will be removed in the near future"))),e?e(a,i,o):!0}};function Mn(t,e,s){if(typeof t!="object")throw new T("options must be an object",T.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let r=n.length;for(;r-- >0;){const a=n[r],i=e[a];if(i){const o=t[a],u=o===void 0||i(o,a,t);if(u!==!0)throw new T("option "+a+" must be "+u,T.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new T("Unknown option "+a,T.ERR_BAD_OPTION)}}const ut={assertOptions:Mn,validators:ct},G=ut.validators;class Me{constructor(e){this.defaults=e,this.interceptors={request:new Kt,response:new Kt}}request(e,s){typeof e=="string"?(s=s||{},s.url=e):s=e||{},s=ie(this.defaults,s);const{transitional:n,paramsSerializer:r,headers:a}=s;n!==void 0&&ut.assertOptions(n,{silentJSONParsing:G.transitional(G.boolean),forcedJSONParsing:G.transitional(G.boolean),clarifyTimeoutError:G.transitional(G.boolean)},!1),r!=null&&(c.isFunction(r)?s.paramsSerializer={serialize:r}:ut.assertOptions(r,{encode:G.function,serialize:G.function},!0)),s.method=(s.method||this.defaults.method||"get").toLowerCase();let i;i=a&&c.merge(a.common,a[s.method]),i&&c.forEach(["delete","get","head","post","put","patch","common"],g=>{delete a[g]}),s.headers=H.concat(i,a);const o=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(s)===!1||(u=u&&S.synchronous,o.unshift(S.fulfilled,S.rejected))});const l=[];this.interceptors.response.forEach(function(S){l.push(S.fulfilled,S.rejected)});let f,_=0,A;if(!u){const g=[ts.bind(this),void 0];for(g.unshift.apply(g,o),g.push.apply(g,l),A=g.length,f=Promise.resolve(s);_<A;)f=f.then(g[_++],g[_++]);return f}A=o.length;let N=s;for(_=0;_<A;){const g=o[_++],S=o[_++];try{N=g(N)}catch(K){S.call(this,K);break}}try{f=ts.call(this,N)}catch(g){return Promise.reject(g)}for(_=0,A=l.length;_<A;)f=f.then(l[_++],l[_++]);return f}getUri(e){e=ie(this.defaults,e);const s=Qt(e.baseURL,e.url);return Wt(s,e.params,e.paramsSerializer)}}c.forEach(["delete","get","head","options"],function(e){Me.prototype[e]=function(s,n){return this.request(ie(n||{},{method:e,url:s,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(e){function s(n){return function(a,i,o){return this.request(ie(o||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Me.prototype[e]=s(),Me.prototype[e+"Form"]=s(!0)});const Ue=Me;class dt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(a){s=a});const n=this;this.promise.then(r=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](r);n._listeners=null}),this.promise.then=r=>{let a;const i=new Promise(o=>{n.subscribe(o),a=o}).then(r);return i.cancel=function(){n.unsubscribe(a)},i},e(function(a,i,o){n.reason||(n.reason=new me(a,i,o),s(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const s=this._listeners.indexOf(e);s!==-1&&this._listeners.splice(s,1)}static source(){let e;return{token:new dt(function(r){e=r}),cancel:e}}}const Un=dt;function zn(t){return function(s){return t.apply(null,s)}}function $n(t){return c.isObject(t)&&t.isAxiosError===!0}const ft={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ft).forEach(([t,e])=>{ft[e]=t});const Vn=ft;function as(t){const e=new Ue(t),s=Rt(Ue.prototype.request,e);return c.extend(s,Ue.prototype,e,{allOwnKeys:!0}),c.extend(s,e,null,{allOwnKeys:!0}),s.create=function(r){return as(ie(t,r))},s}const R=as(at);R.Axios=Ue,R.CanceledError=me,R.CancelToken=Un,R.isCancel=Yt,R.VERSION=ns,R.toFormData=Ze,R.AxiosError=T,R.Cancel=R.CanceledError,R.all=function(e){return Promise.all(e)},R.spread=zn,R.isAxiosError=$n,R.mergeConfig=ie,R.AxiosHeaders=H,R.formToJSON=t=>Gt(c.isHTMLForm(t)?new FormData(t):t),R.HttpStatusCode=Vn,R.default=R;const ht=R;function pt({apiKey:t,options:e}){let s={};return t&&Z(s,["headers","Authorization"],`API-Key ${t}`),e&&(s=q(s,e)),s}async function is({url:t,apiKey:e,options:s}){return await ht.get(t,pt({apiKey:e,options:s}))}async function os({url:t,apiKey:e,options:s,payload:n={}}){return await ht.post(t,n,pt({apiKey:e,options:s}))}async function Fn({url:t,apiKey:e,options:s,payload:n}){return await ht.put(t,n,pt({apiKey:e,options:s}))}async function ye(t){try{return await t()}catch(e){return Promise.reject(e)}}const ge="https://zrrpg8wwbe.execute-api.us-east-1.amazonaws.com/sfly-sls",Hn="wss://cwfzk5wg4m.execute-api.us-east-1.amazonaws.com/sfly-sls",Jn="300000";async function Wn(t,e,s){return ye(async()=>{const n=(await os({url:`${ge}/api/v1/images/book/${e}`,apiKey:t,payload:s})).data;return _s.parse(n)})}var E;(function(t){t.assertEqual=r=>r;function e(r){}t.assertIs=e;function s(r){throw new Error}t.assertNever=s,t.arrayToEnum=r=>{const a={};for(const i of r)a[i]=i;return a},t.getValidEnumValues=r=>{const a=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of a)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(a){return r[a]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const a=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&a.push(i);return a},t.find=(r,a)=>{for(const i of r)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function n(r,a=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(r,a)=>typeof a=="bigint"?a.toString():a})(E||(E={}));var mt;(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(mt||(mt={}));const p=E.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),X=t=>{switch(typeof t){case"undefined":return p.undefined;case"string":return p.string;case"number":return isNaN(t)?p.nan:p.number;case"boolean":return p.boolean;case"function":return p.function;case"bigint":return p.bigint;case"symbol":return p.symbol;case"object":return Array.isArray(t)?p.array:t===null?p.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?p.promise:typeof Map<"u"&&t instanceof Map?p.map:typeof Set<"u"&&t instanceof Set?p.set:typeof Date<"u"&&t instanceof Date?p.date:p.object;default:return p.unknown}},h=E.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Kn=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class D extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const s=e||function(a){return a.message},n={_errors:[]},r=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)n._errors.push(s(i));else{let o=n,u=0;for(;u<i.path.length;){const l=i.path[u];u===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(s(i))):o[l]=o[l]||{_errors:[]},o=o[l],u++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,E.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){const s={},n=[];for(const r of this.issues)r.path.length>0?(s[r.path[0]]=s[r.path[0]]||[],s[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:s}}get formErrors(){return this.flatten()}}D.create=t=>new D(t);const ve=(t,e)=>{let s;switch(t.code){case h.invalid_type:t.received===p.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case h.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,E.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:s=`Unrecognized key(s) in object: ${E.joinValues(t.keys,", ")}`;break;case h.invalid_union:s="Invalid input";break;case h.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${E.joinValues(t.options)}`;break;case h.invalid_enum_value:s=`Invalid enum value. Expected ${E.joinValues(t.options)}, received '${t.received}'`;break;case h.invalid_arguments:s="Invalid function arguments";break;case h.invalid_return_type:s="Invalid function return type";break;case h.invalid_date:s="Invalid date";break;case h.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:E.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case h.too_small:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:s="Invalid input";break;case h.too_big:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:s="Invalid input";break;case h.custom:s="Invalid input";break;case h.invalid_intersection_types:s="Intersection results could not be merged";break;case h.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case h.not_finite:s="Number must be finite";break;default:s=e.defaultError,E.assertNever(t)}return{message:s}};let ls=ve;function qn(t){ls=t}function ze(){return ls}const $e=t=>{const{data:e,path:s,errorMaps:n,issueData:r}=t,a=[...s,...r.path||[]],i={...r,path:a};let o="";const u=n.filter(l=>!!l).slice().reverse();for(const l of u)o=l(i,{data:e,defaultError:o}).message;return{...r,path:a,message:r.message||o}},Gn=[];function m(t,e){const s=$e({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ze(),ve].filter(n=>!!n)});t.common.issues.push(s)}class I{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){const n=[];for(const r of s){if(r.status==="aborted")return b;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,s){const n=[];for(const r of s)n.push({key:await r.key,value:await r.value});return I.mergeObjectSync(e,n)}static mergeObjectSync(e,s){const n={};for(const r of s){const{key:a,value:i}=r;if(a.status==="aborted"||i.status==="aborted")return b;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),(typeof i.value<"u"||r.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const b=Object.freeze({status:"aborted"}),cs=t=>({status:"dirty",value:t}),j=t=>({status:"valid",value:t}),yt=t=>t.status==="aborted",gt=t=>t.status==="dirty",Ve=t=>t.status==="valid",Fe=t=>typeof Promise<"u"&&t instanceof Promise;var y;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(y||(y={}));class V{constructor(e,s,n,r){this._cachedPath=[],this.parent=e,this.data=s,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const us=(t,e)=>{if(Ve(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new D(t.common.issues);return this._error=s,this._error}}};function x(t){if(!t)return{};const{errorMap:e,invalid_type_error:s,required_error:n,description:r}=t;if(e&&(s||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:n??o.defaultError}:{message:s??o.defaultError},description:r}}class k{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return X(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:X(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new I,ctx:{common:e.parent.common,data:e.data,parsedType:X(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const s=this._parse(e);if(Fe(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){const s=this._parse(e);return Promise.resolve(s)}parse(e,s){const n=this.safeParse(e,s);if(n.success)return n.data;throw n.error}safeParse(e,s){var n;const r={common:{issues:[],async:(n=s==null?void 0:s.async)!==null&&n!==void 0?n:!1,contextualErrorMap:s==null?void 0:s.errorMap},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)},a=this._parseSync({data:e,path:r.path,parent:r});return us(r,a)}async parseAsync(e,s){const n=await this.safeParseAsync(e,s);if(n.success)return n.data;throw n.error}async safeParseAsync(e,s){const n={common:{issues:[],contextualErrorMap:s==null?void 0:s.errorMap,async:!0},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(Fe(r)?r:Promise.resolve(r));return us(n,a)}refine(e,s){const n=r=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(r):s;return this._refinement((r,a)=>{const i=e(r),o=()=>a.addIssue({code:h.custom,...n(r)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,s){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof s=="function"?s(n,r):s),!1))}_refinement(e){return new M({schema:this,typeName:v.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return W.create(this,this._def)}nullable(){return re.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return B.create(this,this._def)}promise(){return ue.create(this,this._def)}or(e){return xe.create([this,e],this._def)}and(e){return ke.create(this,e,this._def)}transform(e){return new M({...x(this._def),schema:this,typeName:v.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const s=typeof e=="function"?e:()=>e;return new Ne({...x(this._def),innerType:this,defaultValue:s,typeName:v.ZodDefault})}brand(){return new fs({typeName:v.ZodBranded,type:this,...x(this._def)})}catch(e){const s=typeof e=="function"?e:()=>e;return new Ge({...x(this._def),innerType:this,catchValue:s,typeName:v.ZodCatch})}describe(e){const s=this.constructor;return new s({...this._def,description:e})}pipe(e){return Ce.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xn=/^c[^\s-]{8,}$/i,Yn=/^[a-z][a-z0-9]*$/,Qn=/[0-9A-HJKMNP-TV-Z]{26}/,er=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,tr=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,sr=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,nr=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,rr=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ar=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function ir(t,e){return!!((e==="v4"||!e)&&nr.test(t)||(e==="v6"||!e)&&rr.test(t))}class P extends k{constructor(){super(...arguments),this._regex=(e,s,n)=>this.refinement(r=>e.test(r),{validation:s,code:h.invalid_string,...y.errToObj(n)}),this.nonempty=e=>this.min(1,y.errToObj(e)),this.trim=()=>new P({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new P({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new P({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==p.string){const a=this._getOrReturnCtx(e);return m(a,{code:h.invalid_type,expected:p.string,received:a.parsedType}),b}const n=new I;let r;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(r=this._getOrReturnCtx(e,r),m(r,{code:h.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(r=this._getOrReturnCtx(e,r),m(r,{code:h.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(r=this._getOrReturnCtx(e,r),i?m(r,{code:h.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&m(r,{code:h.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")tr.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"email",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")sr.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"emoji",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")er.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"uuid",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Xn.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"cuid",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Yn.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"cuid2",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Qn.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"ulid",code:h.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),m(r,{validation:"url",code:h.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"regex",code:h.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(e,r),m(r,{code:h.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(r=this._getOrReturnCtx(e,r),m(r,{code:h.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(r=this._getOrReturnCtx(e,r),m(r,{code:h.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?ar(a).test(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{code:h.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="ip"?ir(e.data,a.version)||(r=this._getOrReturnCtx(e,r),m(r,{validation:"ip",code:h.invalid_string,message:a.message}),n.dirty()):E.assertNever(a);return{status:n.value,value:e.data}}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...y.errToObj(e)})}url(e){return this._addCheck({kind:"url",...y.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...y.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...y.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...y.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...y.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...y.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...y.errToObj(e)})}datetime(e){var s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(s=e==null?void 0:e.offset)!==null&&s!==void 0?s:!1,...y.errToObj(e==null?void 0:e.message)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...y.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s==null?void 0:s.position,...y.errToObj(s==null?void 0:s.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...y.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...y.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...y.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...y.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...y.errToObj(s)})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}P.create=t=>{var e;return new P({checks:[],typeName:v.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...x(t)})};function or(t,e){const s=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=s>n?s:n,a=parseInt(t.toFixed(r).replace(".","")),i=parseInt(e.toFixed(r).replace(".",""));return a%i/Math.pow(10,r)}class Y extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==p.number){const a=this._getOrReturnCtx(e);return m(a,{code:h.invalid_type,expected:p.number,received:a.parsedType}),b}let n;const r=new I;for(const a of this._def.checks)a.kind==="int"?E.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:h.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?or(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:h.not_finite,message:a.message}),r.dirty()):E.assertNever(a);return{status:r.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,y.toString(s))}gt(e,s){return this.setLimit("min",e,!1,y.toString(s))}lte(e,s){return this.setLimit("max",e,!0,y.toString(s))}lt(e,s){return this.setLimit("max",e,!1,y.toString(s))}setLimit(e,s,n,r){return new Y({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:n,message:y.toString(r)}]})}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:y.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:y.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.toString(e)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&E.isInteger(e.value))}get isFinite(){let e=null,s=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(s===null||n.value>s)&&(s=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(s)&&Number.isFinite(e)}}Y.create=t=>new Y({checks:[],typeName:v.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...x(t)});class Q extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==p.bigint){const a=this._getOrReturnCtx(e);return m(a,{code:h.invalid_type,expected:p.bigint,received:a.parsedType}),b}let n;const r=new I;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),m(n,{code:h.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):E.assertNever(a);return{status:r.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,y.toString(s))}gt(e,s){return this.setLimit("min",e,!1,y.toString(s))}lte(e,s){return this.setLimit("max",e,!0,y.toString(s))}lt(e,s){return this.setLimit("max",e,!1,y.toString(s))}setLimit(e,s,n,r){return new Q({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:n,message:y.toString(r)}]})}_addCheck(e){return new Q({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(s)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}Q.create=t=>{var e;return new Q({checks:[],typeName:v.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...x(t)})};class _e extends k{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==p.boolean){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.boolean,received:n.parsedType}),b}return j(e.data)}}_e.create=t=>new _e({typeName:v.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...x(t)});class te extends k{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==p.date){const a=this._getOrReturnCtx(e);return m(a,{code:h.invalid_type,expected:p.date,received:a.parsedType}),b}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return m(a,{code:h.invalid_date}),b}const n=new I;let r;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),m(r,{code:h.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),m(r,{code:h.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):E.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new te({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:y.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:y.toString(s)})}get minDate(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}}te.create=t=>new te({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:v.ZodDate,...x(t)});class He extends k{_parse(e){if(this._getType(e)!==p.symbol){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.symbol,received:n.parsedType}),b}return j(e.data)}}He.create=t=>new He({typeName:v.ZodSymbol,...x(t)});class be extends k{_parse(e){if(this._getType(e)!==p.undefined){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.undefined,received:n.parsedType}),b}return j(e.data)}}be.create=t=>new be({typeName:v.ZodUndefined,...x(t)});class we extends k{_parse(e){if(this._getType(e)!==p.null){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.null,received:n.parsedType}),b}return j(e.data)}}we.create=t=>new we({typeName:v.ZodNull,...x(t)});class oe extends k{constructor(){super(...arguments),this._any=!0}_parse(e){return j(e.data)}}oe.create=t=>new oe({typeName:v.ZodAny,...x(t)});class se extends k{constructor(){super(...arguments),this._unknown=!0}_parse(e){return j(e.data)}}se.create=t=>new se({typeName:v.ZodUnknown,...x(t)});class J extends k{_parse(e){const s=this._getOrReturnCtx(e);return m(s,{code:h.invalid_type,expected:p.never,received:s.parsedType}),b}}J.create=t=>new J({typeName:v.ZodNever,...x(t)});class Je extends k{_parse(e){if(this._getType(e)!==p.undefined){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.void,received:n.parsedType}),b}return j(e.data)}}Je.create=t=>new Je({typeName:v.ZodVoid,...x(t)});class B extends k{_parse(e){const{ctx:s,status:n}=this._processInputParams(e),r=this._def;if(s.parsedType!==p.array)return m(s,{code:h.invalid_type,expected:p.array,received:s.parsedType}),b;if(r.exactLength!==null){const i=s.data.length>r.exactLength.value,o=s.data.length<r.exactLength.value;(i||o)&&(m(s,{code:i?h.too_big:h.too_small,minimum:o?r.exactLength.value:void 0,maximum:i?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&s.data.length<r.minLength.value&&(m(s,{code:h.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&s.data.length>r.maxLength.value&&(m(s,{code:h.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),s.common.async)return Promise.all([...s.data].map((i,o)=>r.type._parseAsync(new V(s,i,s.path,o)))).then(i=>I.mergeArray(n,i));const a=[...s.data].map((i,o)=>r.type._parseSync(new V(s,i,s.path,o)));return I.mergeArray(n,a)}get element(){return this._def.type}min(e,s){return new B({...this._def,minLength:{value:e,message:y.toString(s)}})}max(e,s){return new B({...this._def,maxLength:{value:e,message:y.toString(s)}})}length(e,s){return new B({...this._def,exactLength:{value:e,message:y.toString(s)}})}nonempty(e){return this.min(1,e)}}B.create=(t,e)=>new B({type:t,minLength:null,maxLength:null,exactLength:null,typeName:v.ZodArray,...x(e)});function le(t){if(t instanceof C){const e={};for(const s in t.shape){const n=t.shape[s];e[s]=W.create(le(n))}return new C({...t._def,shape:()=>e})}else return t instanceof B?new B({...t._def,type:le(t.element)}):t instanceof W?W.create(le(t.unwrap())):t instanceof re?re.create(le(t.unwrap())):t instanceof F?F.create(t.items.map(e=>le(e))):t}class C extends k{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),s=E.objectKeys(e);return this._cached={shape:e,keys:s}}_parse(e){if(this._getType(e)!==p.object){const l=this._getOrReturnCtx(e);return m(l,{code:h.invalid_type,expected:p.object,received:l.parsedType}),b}const{status:n,ctx:r}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof J&&this._def.unknownKeys==="strip"))for(const l in r.data)i.includes(l)||o.push(l);const u=[];for(const l of i){const f=a[l],_=r.data[l];u.push({key:{status:"valid",value:l},value:f._parse(new V(r,_,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof J){const l=this._def.unknownKeys;if(l==="passthrough")for(const f of o)u.push({key:{status:"valid",value:f},value:{status:"valid",value:r.data[f]}});else if(l==="strict")o.length>0&&(m(r,{code:h.unrecognized_keys,keys:o}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const f of o){const _=r.data[f];u.push({key:{status:"valid",value:f},value:l._parse(new V(r,_,r.path,f)),alwaysSet:f in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const l=[];for(const f of u){const _=await f.key;l.push({key:_,value:await f.value,alwaysSet:f.alwaysSet})}return l}).then(l=>I.mergeObjectSync(n,l)):I.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return y.errToObj,new C({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,n)=>{var r,a,i,o;const u=(i=(a=(r=this._def).errorMap)===null||a===void 0?void 0:a.call(r,s,n).message)!==null&&i!==void 0?i:n.defaultError;return s.code==="unrecognized_keys"?{message:(o=y.errToObj(e).message)!==null&&o!==void 0?o:u}:{message:u}}}:{}})}strip(){return new C({...this._def,unknownKeys:"strip"})}passthrough(){return new C({...this._def,unknownKeys:"passthrough"})}extend(e){return new C({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new C({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:v.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new C({...this._def,catchall:e})}pick(e){const s={};return E.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(s[n]=this.shape[n])}),new C({...this._def,shape:()=>s})}omit(e){const s={};return E.objectKeys(this.shape).forEach(n=>{e[n]||(s[n]=this.shape[n])}),new C({...this._def,shape:()=>s})}deepPartial(){return le(this)}partial(e){const s={};return E.objectKeys(this.shape).forEach(n=>{const r=this.shape[n];e&&!e[n]?s[n]=r:s[n]=r.optional()}),new C({...this._def,shape:()=>s})}required(e){const s={};return E.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])s[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof W;)a=a._def.innerType;s[n]=a}}),new C({...this._def,shape:()=>s})}keyof(){return ds(E.objectKeys(this.shape))}}C.create=(t,e)=>new C({shape:()=>t,unknownKeys:"strip",catchall:J.create(),typeName:v.ZodObject,...x(e)}),C.strictCreate=(t,e)=>new C({shape:()=>t,unknownKeys:"strict",catchall:J.create(),typeName:v.ZodObject,...x(e)}),C.lazycreate=(t,e)=>new C({shape:t,unknownKeys:"strip",catchall:J.create(),typeName:v.ZodObject,...x(e)});class xe extends k{_parse(e){const{ctx:s}=this._processInputParams(e),n=this._def.options;function r(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return s.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new D(o.ctx.common.issues));return m(s,{code:h.invalid_union,unionErrors:i}),b}if(s.common.async)return Promise.all(n.map(async a=>{const i={...s,common:{...s.common,issues:[]},parent:null};return{result:await a._parseAsync({data:s.data,path:s.path,parent:i}),ctx:i}})).then(r);{let a;const i=[];for(const u of n){const l={...s,common:{...s.common,issues:[]},parent:null},f=u._parseSync({data:s.data,path:s.path,parent:l});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(a)return s.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(u=>new D(u));return m(s,{code:h.invalid_union,unionErrors:o}),b}}get options(){return this._def.options}}xe.create=(t,e)=>new xe({options:t,typeName:v.ZodUnion,...x(e)});const We=t=>t instanceof Te?We(t.schema):t instanceof M?We(t.innerType()):t instanceof Ee?[t.value]:t instanceof ee?t.options:t instanceof Oe?Object.keys(t.enum):t instanceof Ne?We(t._def.innerType):t instanceof be?[void 0]:t instanceof we?[null]:null;class Ke extends k{_parse(e){const{ctx:s}=this._processInputParams(e);if(s.parsedType!==p.object)return m(s,{code:h.invalid_type,expected:p.object,received:s.parsedType}),b;const n=this.discriminator,r=s.data[n],a=this.optionsMap.get(r);return a?s.common.async?a._parseAsync({data:s.data,path:s.path,parent:s}):a._parseSync({data:s.data,path:s.path,parent:s}):(m(s,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),b)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,s,n){const r=new Map;for(const a of s){const i=We(a.shape[e]);if(!i)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,a)}}return new Ke({typeName:v.ZodDiscriminatedUnion,discriminator:e,options:s,optionsMap:r,...x(n)})}}function vt(t,e){const s=X(t),n=X(e);if(t===e)return{valid:!0,data:t};if(s===p.object&&n===p.object){const r=E.objectKeys(e),a=E.objectKeys(t).filter(o=>r.indexOf(o)!==-1),i={...t,...e};for(const o of a){const u=vt(t[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(s===p.array&&n===p.array){if(t.length!==e.length)return{valid:!1};const r=[];for(let a=0;a<t.length;a++){const i=t[a],o=e[a],u=vt(i,o);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return s===p.date&&n===p.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ke extends k{_parse(e){const{status:s,ctx:n}=this._processInputParams(e),r=(a,i)=>{if(yt(a)||yt(i))return b;const o=vt(a.value,i.value);return o.valid?((gt(a)||gt(i))&&s.dirty(),{status:s.value,value:o.data}):(m(n,{code:h.invalid_intersection_types}),b)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>r(a,i)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ke.create=(t,e,s)=>new ke({left:t,right:e,typeName:v.ZodIntersection,...x(s)});class F extends k{_parse(e){const{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==p.array)return m(n,{code:h.invalid_type,expected:p.array,received:n.parsedType}),b;if(n.data.length<this._def.items.length)return m(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;!this._def.rest&&n.data.length>this._def.items.length&&(m(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const a=[...n.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new V(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>I.mergeArray(s,i)):I.mergeArray(s,a)}get items(){return this._def.items}rest(e){return new F({...this._def,rest:e})}}F.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new F({items:t,typeName:v.ZodTuple,rest:null,...x(e)})};class Se extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==p.object)return m(n,{code:h.invalid_type,expected:p.object,received:n.parsedType}),b;const r=[],a=this._def.keyType,i=this._def.valueType;for(const o in n.data)r.push({key:a._parse(new V(n,o,n.path,o)),value:i._parse(new V(n,n.data[o],n.path,o))});return n.common.async?I.mergeObjectAsync(s,r):I.mergeObjectSync(s,r)}get element(){return this._def.valueType}static create(e,s,n){return s instanceof k?new Se({keyType:e,valueType:s,typeName:v.ZodRecord,...x(n)}):new Se({keyType:P.create(),valueType:e,typeName:v.ZodRecord,...x(s)})}}class qe extends k{_parse(e){const{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==p.map)return m(n,{code:h.invalid_type,expected:p.map,received:n.parsedType}),b;const r=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,u],l)=>({key:r._parse(new V(n,o,n.path,[l,"key"])),value:a._parse(new V(n,u,n.path,[l,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const l=await u.key,f=await u.value;if(l.status==="aborted"||f.status==="aborted")return b;(l.status==="dirty"||f.status==="dirty")&&s.dirty(),o.set(l.value,f.value)}return{status:s.value,value:o}})}else{const o=new Map;for(const u of i){const l=u.key,f=u.value;if(l.status==="aborted"||f.status==="aborted")return b;(l.status==="dirty"||f.status==="dirty")&&s.dirty(),o.set(l.value,f.value)}return{status:s.value,value:o}}}}qe.create=(t,e,s)=>new qe({valueType:e,keyType:t,typeName:v.ZodMap,...x(s)});class ne extends k{_parse(e){const{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==p.set)return m(n,{code:h.invalid_type,expected:p.set,received:n.parsedType}),b;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(m(n,{code:h.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),s.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(m(n,{code:h.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),s.dirty());const a=this._def.valueType;function i(u){const l=new Set;for(const f of u){if(f.status==="aborted")return b;f.status==="dirty"&&s.dirty(),l.add(f.value)}return{status:s.value,value:l}}const o=[...n.data.values()].map((u,l)=>a._parse(new V(n,u,n.path,l)));return n.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,s){return new ne({...this._def,minSize:{value:e,message:y.toString(s)}})}max(e,s){return new ne({...this._def,maxSize:{value:e,message:y.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}}ne.create=(t,e)=>new ne({valueType:t,minSize:null,maxSize:null,typeName:v.ZodSet,...x(e)});class ce extends k{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:s}=this._processInputParams(e);if(s.parsedType!==p.function)return m(s,{code:h.invalid_type,expected:p.function,received:s.parsedType}),b;function n(o,u){return $e({data:o,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,ze(),ve].filter(l=>!!l),issueData:{code:h.invalid_arguments,argumentsError:u}})}function r(o,u){return $e({data:o,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,ze(),ve].filter(l=>!!l),issueData:{code:h.invalid_return_type,returnTypeError:u}})}const a={errorMap:s.common.contextualErrorMap},i=s.data;return this._def.returns instanceof ue?j(async(...o)=>{const u=new D([]),l=await this._def.args.parseAsync(o,a).catch(A=>{throw u.addIssue(n(o,A)),u}),f=await i(...l);return await this._def.returns._def.type.parseAsync(f,a).catch(A=>{throw u.addIssue(r(f,A)),u})}):j((...o)=>{const u=this._def.args.safeParse(o,a);if(!u.success)throw new D([n(o,u.error)]);const l=i(...u.data),f=this._def.returns.safeParse(l,a);if(!f.success)throw new D([r(l,f.error)]);return f.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ce({...this._def,args:F.create(e).rest(se.create())})}returns(e){return new ce({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,s,n){return new ce({args:e||F.create([]).rest(se.create()),returns:s||se.create(),typeName:v.ZodFunction,...x(n)})}}class Te extends k{get schema(){return this._def.getter()}_parse(e){const{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}Te.create=(t,e)=>new Te({getter:t,typeName:v.ZodLazy,...x(e)});class Ee extends k{_parse(e){if(e.data!==this._def.value){const s=this._getOrReturnCtx(e);return m(s,{received:s.data,code:h.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ee.create=(t,e)=>new Ee({value:t,typeName:v.ZodLiteral,...x(e)});function ds(t,e){return new ee({values:t,typeName:v.ZodEnum,...x(e)})}class ee extends k{_parse(e){if(typeof e.data!="string"){const s=this._getOrReturnCtx(e),n=this._def.values;return m(s,{expected:E.joinValues(n),received:s.parsedType,code:h.invalid_type}),b}if(this._def.values.indexOf(e.data)===-1){const s=this._getOrReturnCtx(e),n=this._def.values;return m(s,{received:s.data,code:h.invalid_enum_value,options:n}),b}return j(e.data)}get options(){return this._def.values}get enum(){const e={};for(const s of this._def.values)e[s]=s;return e}get Values(){const e={};for(const s of this._def.values)e[s]=s;return e}get Enum(){const e={};for(const s of this._def.values)e[s]=s;return e}extract(e){return ee.create(e)}exclude(e){return ee.create(this.options.filter(s=>!e.includes(s)))}}ee.create=ds;class Oe extends k{_parse(e){const s=E.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==p.string&&n.parsedType!==p.number){const r=E.objectValues(s);return m(n,{expected:E.joinValues(r),received:n.parsedType,code:h.invalid_type}),b}if(s.indexOf(e.data)===-1){const r=E.objectValues(s);return m(n,{received:n.data,code:h.invalid_enum_value,options:r}),b}return j(e.data)}get enum(){return this._def.values}}Oe.create=(t,e)=>new Oe({values:t,typeName:v.ZodNativeEnum,...x(e)});class ue extends k{unwrap(){return this._def.type}_parse(e){const{ctx:s}=this._processInputParams(e);if(s.parsedType!==p.promise&&s.common.async===!1)return m(s,{code:h.invalid_type,expected:p.promise,received:s.parsedType}),b;const n=s.parsedType===p.promise?s.data:Promise.resolve(s.data);return j(n.then(r=>this._def.type.parseAsync(r,{path:s.path,errorMap:s.common.contextualErrorMap})))}}ue.create=(t,e)=>new ue({type:t,typeName:v.ZodPromise,...x(e)});class M extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===v.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:s,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if(r.type==="preprocess"){const i=r.transform(n.data);return n.common.async?Promise.resolve(i).then(o=>this._def.schema._parseAsync({data:o,path:n.path,parent:n})):this._def.schema._parseSync({data:i,path:n.path,parent:n})}const a={addIssue:i=>{m(n,i),i.fatal?s.abort():s.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),r.type==="refinement"){const i=o=>{const u=r.refinement(o,a);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?b:(o.status==="dirty"&&s.dirty(),i(o.value),{status:s.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?b:(o.status==="dirty"&&s.dirty(),i(o.value).then(()=>({status:s.value,value:o.value}))))}if(r.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ve(i))return i;const o=r.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ve(i)?Promise.resolve(r.transform(i.value,a)).then(o=>({status:s.value,value:o})):i);E.assertNever(r)}}M.create=(t,e,s)=>new M({schema:t,typeName:v.ZodEffects,effect:e,...x(s)}),M.createWithPreprocess=(t,e,s)=>new M({schema:e,effect:{type:"preprocess",transform:t},typeName:v.ZodEffects,...x(s)});class W extends k{_parse(e){return this._getType(e)===p.undefined?j(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}W.create=(t,e)=>new W({innerType:t,typeName:v.ZodOptional,...x(e)});class re extends k{_parse(e){return this._getType(e)===p.null?j(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}re.create=(t,e)=>new re({innerType:t,typeName:v.ZodNullable,...x(e)});class Ne extends k{_parse(e){const{ctx:s}=this._processInputParams(e);let n=s.data;return s.parsedType===p.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}Ne.create=(t,e)=>new Ne({innerType:t,typeName:v.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...x(e)});class Ge extends k{_parse(e){const{ctx:s}=this._processInputParams(e),n={...s,common:{...s.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Fe(r)?r.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ge.create=(t,e)=>new Ge({innerType:t,typeName:v.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...x(e)});class Xe extends k{_parse(e){if(this._getType(e)!==p.nan){const n=this._getOrReturnCtx(e);return m(n,{code:h.invalid_type,expected:p.nan,received:n.parsedType}),b}return{status:"valid",value:e.data}}}Xe.create=t=>new Xe({typeName:v.ZodNaN,...x(t)});const lr=Symbol("zod_brand");class fs extends k{_parse(e){const{ctx:s}=this._processInputParams(e),n=s.data;return this._def.type._parse({data:n,path:s.path,parent:s})}unwrap(){return this._def.type}}class Ce extends k{_parse(e){const{status:s,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?b:a.status==="dirty"?(s.dirty(),cs(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?b:r.status==="dirty"?(s.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,s){return new Ce({in:e,out:s,typeName:v.ZodPipeline})}}const hs=(t,e={},s)=>t?oe.create().superRefine((n,r)=>{var a,i;if(!t(n)){const o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(i=(a=o.fatal)!==null&&a!==void 0?a:s)!==null&&i!==void 0?i:!0,l=typeof o=="string"?{message:o}:o;r.addIssue({code:"custom",...l,fatal:u})}}):oe.create(),cr={object:C.lazycreate};var v;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline"})(v||(v={}));const ur=(t,e={message:`Input not instance of ${t.name}`})=>hs(s=>s instanceof t,e),ps=P.create,ms=Y.create,dr=Xe.create,fr=Q.create,ys=_e.create,hr=te.create,pr=He.create,mr=be.create,yr=we.create,gr=oe.create,vr=se.create,_r=J.create,br=Je.create,wr=B.create,xr=C.create,kr=C.strictCreate,Sr=xe.create,Tr=Ke.create,Er=ke.create,Or=F.create,Nr=Se.create,Cr=qe.create,Ar=ne.create,Rr=ce.create,Ir=Te.create,jr=Ee.create,Zr=ee.create,Lr=Oe.create,Dr=ue.create,gs=M.create,Pr=W.create,Br=re.create,Mr=M.createWithPreprocess,Ur=Ce.create;var d=Object.freeze({__proto__:null,defaultErrorMap:ve,setErrorMap:qn,getErrorMap:ze,makeIssue:$e,EMPTY_PATH:Gn,addIssueToContext:m,ParseStatus:I,INVALID:b,DIRTY:cs,OK:j,isAborted:yt,isDirty:gt,isValid:Ve,isAsync:Fe,get util(){return E},get objectUtil(){return mt},ZodParsedType:p,getParsedType:X,ZodType:k,ZodString:P,ZodNumber:Y,ZodBigInt:Q,ZodBoolean:_e,ZodDate:te,ZodSymbol:He,ZodUndefined:be,ZodNull:we,ZodAny:oe,ZodUnknown:se,ZodNever:J,ZodVoid:Je,ZodArray:B,ZodObject:C,ZodUnion:xe,ZodDiscriminatedUnion:Ke,ZodIntersection:ke,ZodTuple:F,ZodRecord:Se,ZodMap:qe,ZodSet:ne,ZodFunction:ce,ZodLazy:Te,ZodLiteral:Ee,ZodEnum:ee,ZodNativeEnum:Oe,ZodPromise:ue,ZodEffects:M,ZodTransformer:M,ZodOptional:W,ZodNullable:re,ZodDefault:Ne,ZodCatch:Ge,ZodNaN:Xe,BRAND:lr,ZodBranded:fs,ZodPipeline:Ce,custom:hs,Schema:k,ZodSchema:k,late:cr,get ZodFirstPartyTypeKind(){return v},coerce:{string:t=>P.create({...t,coerce:!0}),number:t=>Y.create({...t,coerce:!0}),boolean:t=>_e.create({...t,coerce:!0}),bigint:t=>Q.create({...t,coerce:!0}),date:t=>te.create({...t,coerce:!0})},any:gr,array:wr,bigint:fr,boolean:ys,date:hr,discriminatedUnion:Tr,effect:gs,enum:Zr,function:Rr,instanceof:ur,intersection:Er,lazy:Ir,literal:jr,map:Cr,nan:dr,nativeEnum:Lr,never:_r,null:yr,nullable:Br,number:ms,object:xr,oboolean:()=>ys().optional(),onumber:()=>ms().optional(),optional:Pr,ostring:()=>ps().optional(),pipeline:Ur,preprocess:Mr,promise:Dr,record:Nr,set:Ar,strictObject:kr,string:ps,symbol:pr,transformer:gs,tuple:Or,undefined:mr,union:Sr,unknown:vr,void:br,NEVER:b,ZodIssueCode:h,quotelessJson:Kn,ZodError:D});class vs{constructor(e,s){w(this,"apiKey");w(this,"parentId");w(this,"images");w(this,"length");this.apiKey=s,this.parentId=e,this.images=[],this.length=this.images.length}async add(e){return this.images.push(e),this.length=this.images.length,await Wn(this.apiKey,this.parentId,new bs(e)),new Promise(s=>{s(this.length)})}}const _s=d.object({handle:d.string(),url:d.string(),width:d.number(),height:d.number(),orientation:d.number(),taken_at:d.string(),camera_make:d.string().optional(),camera:d.string().optional(),filename:d.string()});class bs{constructor(e){w(this,"handle");w(this,"url");w(this,"width");w(this,"height");w(this,"orientation");w(this,"taken_at");w(this,"camera_make");w(this,"camera");w(this,"filename");this.handle=e.handle,this.url=e.url,this.width=e.width,this.height=e.height,this.orientation=e.rotation,this.taken_at=e.captureTime,this.camera_make=e.cameraMake,this.camera=e.cameraModel,this.filename=e.filename}}const ws=["new","ingesting","submitted","storyboarding","deduplication","image selection","designing","layouting","embellishing","polishing","ready","error"],_t=["baby","birthday","default","everyday","family","kids","life-stories","portfolio","school-memories","seasonal-holidays","special-celebrations","sports-and-hobbies","travel","wedding","year-in-review"],bt={1005:{slug:"modern-black-sfly"},1101:{slug:"bon-voyage-sfly"},1103:{slug:"fun-in-the-sun-sfly"},1201:{slug:"modern-wedding-sfly"},3001:{slug:"digiscrap-sfly"},4034:{slug:"travel-snapshots-sfly"},4035:{slug:"vintage-travel-sfly"},5017:{slug:"natural-neutrals-sfly"},5033:{slug:"chalkboard-chic-sfly"},5079:{slug:"hello-spring-sfly"},5082:{slug:"familygram-sfly"},5085:{slug:"best-day-ever-sfly"},5091:{slug:"little-love-sfly"},5118:{slug:"a-year-in-color-sfly"},5120:{slug:"milestone-anniversaries-sfly"},5121:{slug:"the-travel-bug-sfly"},5122:{slug:"modern-white-sfly"},5127:{slug:"outdoor-wedding-sfly"},5134:{slug:"classic-wedding-sfly"},5138:{slug:"kraft-pop-sfly"},5142:{slug:"simply-black-sfly"},5144:{slug:"autumn-memories-sfly"},5146:{slug:"everyday-sentiments-sfly"},5149:{slug:"everyday-happiness-sfly"},5150:{slug:"its-a-girl-thing-sfly"},5155:{slug:"made-with-love-sfly"},5157:{slug:"high-school-memories-sfly"},5161:{slug:"rustic-wedding-sfly"},5165:{slug:"life-is-grand-sfly"},5167:{slug:"adventure-awaits-sfly"},5168:{slug:"disney-adventure-sfly"},5171:{slug:"world-travel-sfly"},5174:{slug:"hello-summer-sfly"},5183:{slug:"everything-sports-sfly"},5188:{slug:"everyday-watercolor-sfly"},5189:{slug:"holiday-memories-sfly"},5213:{slug:"love-and-thanks-sfly"},5218:{slug:"babys-first-year-sfly"},5219:{slug:"usa-travel-sfly"},5220:{slug:"vintage-wedding-sfly"},5226:{slug:"love-you-because-sfly"},5228:{slug:"reunion-sfly"},5238:{slug:"whimsy-chalkboard-sfly"},5242:{slug:"modern-indigo-sfly"},5250:{slug:"family-yearbook-sfly"},5255:{slug:"elegant-wedding-sfly"},5258:{slug:"family-vacation-sfly"},5259:{slug:"beach-travel-sfly"},5261:{slug:"sparkle-and-shine-sfly"},5262:{slug:"welcome-baby-sfly"},5265:{slug:"vivid-watercolor-sfly"},5266:{slug:"what-i-love-about-you-sfly"},5272:{slug:"love-grows-sfly"},5274:{slug:"painted-seasons-sfly"},5278:{slug:"vintage-disney-sfly"},5292:{slug:"modern-grey-sfly"},5297:{slug:"modern-love-story-sfly"},5299:{slug:"modern-travel-sfly"},5304:{slug:"beach-wedding-sfly"},5305:{slug:"rustic-farmhouse-sfly"},5308:{slug:"tropical-travel-sfly"},6e3:{slug:"travel-abroad-sfly"},6001:{slug:"everyday-rustic-sfly"},6002:{slug:"simply-modern-sfly"},6003:{slug:"modern-baby-sfly"},6004:{slug:"modern-photo-album-sfly"},6005:{slug:"travel-adventures-sfly"},6006:{slug:"watercolor-year-in-review-sfly"},6007:{slug:"beach-bliss-sfly"},6008:{slug:"simply-gray-sfly"},6009:{slug:"family-favorites-by-lure-design-sfly"},6010:{slug:"travel-gallery-sfly"},6011:{slug:"our-wedding-day-sfly"},6012:{slug:"chic-celebrations-by-float-paperie-sfly"},6013:{slug:"simply-bold-type-sfly"},6014:{slug:"colorful-florals-by-potts-design-sfly"},6015:{slug:"softly-rustic-sfly"},6016:{slug:"ombre-watercolor-sfly"},6017:{slug:"forever-love-by-with-merriment-sfly"},6018:{slug:"colorful-memories-by-britt-bass-sfly"},6019:{slug:"celebrate-family-by-float-paperie-sfly"},6020:{slug:"disney-family-adventures-sfly"},6021:{slug:"everyday-neutrals-sfly"},6022:{slug:"colorful-childhood-sfly"},6023:{slug:"everyday-indigo-sfly"},6024:{slug:"shimmer-and-shine-sfly"},6025:{slug:"summertime-fun-sfly"},6026:{slug:"pet-lover-sfly"},6027:{slug:"modern-wedding-story-sfly"},6028:{slug:"family-blessings-by-potts-design-sfly"},6030:{slug:"outdoor-adventures-by-sarah-hawkins-designs-sfly"},6031:{slug:"travel-memories-sfly"},6032:{slug:"tropical-travels-sfly"},6033:{slug:"everyday-chalkboard-by-potts-design-sfly"},6034:{slug:"classic-disney-sfly"},6035:{slug:"cheerful-color-sfly"},6036:{slug:"colorful-birthday-sfly"},6038:{slug:"classic-baby-sfly"},6039:{slug:"bold-year-in-review-by-float-paperie-sfly"},6040:{slug:"colorfully-fun-sfly"},6041:{slug:"colorful-year-in-review-by-sarah-hawkins-designs-sfly"},6042:{slug:"gilded-wedding-sfly"},6043:{slug:"road-trip-travel-by-sarah-hawkins-designs-sfly"},6044:{slug:"rustic-gilded-wedding-sfly"},6045:{slug:"elegantly-scripted-year-in-review-sfly"},6047:{slug:"2020-what-a-year-sfly"},6057:{slug:"best-mom-ever-sfly"},6052:{slug:"celebration-of-life-by-sarah-hawkins-designs-sfly"},6054:{slug:"colorful-school-days-by-float-paperie-sfly"},6051:{slug:"love-is-all-we-need-sfly"},6058:{slug:"graduation-celebration-sfly"},6056:{slug:"our-wedding-day-guestbook-sfly"},6055:{slug:"muted-everyday-abstract-sfly"},6046:{slug:"winter-memories-by-sarah-hawkins-design-sfly"},6053:{slug:"best-dad-ever-sfly"},6050:{slug:"watercolor-greenery-by-sarah-hawkins-designs-sfly"},6063:{slug:"watercolor-floral-wedding-by-kim-thoa-sfly"},6060:{slug:"watercolor-baby-girl-sfly"},6059:{slug:"watercolor-baby-boy-sfly"},6048:{slug:"simple-elegant-wedding-sfly"},6049:{slug:"gilded-wedding-guestbook-sfly"},6037:{slug:"everyday-fairytale-by-jenny-romanski-sfly"},6061:{slug:"best-grandparents-ever-sfly"},6068:{slug:"winter-getaway-sfly"},6067:{slug:"national-parks-travel-by-eiman-design-co-sfly"},6065:{slug:"go-sports-by-lure-design-sfly"},6066:{slug:"elegant-wedding-greenery-by-kim-thoa-sfly"},6064:{slug:"boho-travel-by-umaiana-studio-sfly"},6071:{slug:"modern-dark-neutrals-sfly"},6072:{slug:"modern-light-neutrals-sfly"},6073:{slug:"modern-celebrations-sfly"},6074:{slug:"bright-and-bold-kids-year-in-review-by-sarah-hawkins-designs-sfly"},6085:{slug:"classic-school-yearbook-sfly"},6084:{slug:"colorful-elementary-school-yearbook-sfly"},5402:{slug:"everyday-recipes-by-slightly-stationery-sfly"},6083:{slug:"school-days-yearbook-sfly"},6082:{slug:"the-story-of-me-sfly"},6086:{slug:"whimsical-recipes-by-slightly-stationery-sfly"},6101:{slug:"babys-first-sfly"},6103:{slug:"classic-recipes-sfly"},6104:{slug:"elevated-rustic-sfly"},6105:{slug:"boho-summer-sfly"},6116:{slug:"boho-baby-sfly"},6117:{slug:"simply-gallery-sfly"},6118:{slug:"this-is-love-sfly"},6120:{slug:"wedding-gallery-sfly"},6121:{slug:"watercolorwashes-sfly"},6124:{slug:"graduation-photo-album-sfly"},6125:{slug:"modern-year-in-review-photo-album-sfly"},6126:{slug:"black-white-photo-album-sfly"},6132:{slug:"travel-journal-sfly"},6133:{slug:"rustic-gallery-sfly"},6137:{slug:"summer-adventures-sfly"},6075:{slug:"together-again-sfly"},6078:{slug:"everyday-boho-by-umaiana-studio-sfly"},6089:{slug:"colorful-gradients-sfly"},6096:{slug:"simply-scrapbook-sfly"},6097:{slug:"boho-wedding-sfly"},6098:{slug:"black-and-white-rustic-sfly"},6099:{slug:"bright-color-pop-sfly"}},wt=["8x8","10x10","12x12","8x11","11x8","11x14"],xt=["sc","hc","pl"],kt=["sp","sl","dl"],St=["low","medium","high"],Tt=["best","most","all"],Et=["none","few","lots"],Ot=["none","few","lots"];class zr{constructor(e){w(this,"occasion");w(this,"style");w(this,"book_size");w(this,"cover_type");w(this,"page_type");w(this,"image_density");w(this,"image_filtering_level");w(this,"embellishment_level");w(this,"text_sticker_level");this.occasion=e.occasion,this.style=e.style,this.book_size=e.book_size,this.cover_type=e.cover_type,this.page_type=e.page_type,this.image_density=e.image_density,this.image_filtering_level=e.image_filtering_level,this.embellishment_level=e.embellishment_level,this.text_sticker_level=e.text_sticker_level}}const $r=d.object({occasion:d.enum(_t),style:d.string(),book_size:d.enum(wt),cover_type:d.enum(xt),page_type:d.enum(kt),image_density:d.enum(St),image_filtering_level:d.enum(Tt),embellishment_level:d.enum(Et),text_sticker_level:d.enum(Ot)}),xs=d.object({id:d.string(),title:d.string(),design_request:$r,state:d.enum(ws).optional(),guid:d.string().optional()});class Nt{constructor(e){w(this,"id");w(this,"title");w(this,"design_request");w(this,"state");w(this,"guid");this.id=e.id,this.title=e.title,this.design_request=new zr(e.design_request),this.state=e.state,this.guid=e.guid}}function ks(t){const e=bt[t.style].slug,s=Ct({...t});return s.style=e,new Nt({id:t.parentId,guid:t.guid,title:t.title,design_request:s})}const Ye=d.object({maxPageCount:d.number(),minPageCount:d.number(),maxImageCount:d.number(),avgImageCount:d.number(),minImageCount:d.number()}),Ss=d.object({high:Ye,medium:Ye,low:Ye}),Ts=d.object({densities:Ss});async function Vr(t,e,s){return ye(async()=>{const n=await is({url:`${ge}/api/v1/designoptions/booksize/${e}/imagecount/${s}`,apiKey:t}),r=At(n.data);return Ts.parse(r)})}const Fr=d.object({photoRefId:d.string(),finalCrop:d.array(d.number())}),Hr=d.object({x:d.number(),y:d.number(),width:d.number().optional(),height:d.number().optional(),rotation:d.number()}),Jr=d.object({id:d.string(),llx:d.number(),lly:d.number(),urx:d.number(),ury:d.number(),data:d.string().nullable(),title:d.string(),width:d.number(),effect:d.string(),height:d.number(),source:d.string(),rotation:d.number(),uploadTime:d.string()}),Wr=d.object({key:d.string(),value:d.union([d.string(),d.number(),d.boolean()]).nullable()}),Kr=d.object({type:d.string(),imageAssignment:Fr.optional(),position:Hr,seqNum:d.number(),z:d.number(),id:d.string().optional(),horizJustification:d.string().optional(),vertJustification:d.string().optional().nullable(),text:d.string().optional(),fontId:d.string().optional(),fontSize:d.number().optional(),fontColor:d.string().optional(),frame:d.string().optional()}),qr=d.object({url:d.string(),encryptId:d.string(),photoRefId:d.string(),photoId:d.string(),photoMetadata:Jr}),Gr=d.object({properties:d.array(Wr)}),Xr=d.object({backgroundId:d.string().nullable(),assets:d.array(Kr).optional()}),Yr=d.object({pageNum:d.number(),type:d.string(),canvas:Xr}),Qr=d.object({pages:d.array(Yr),photoStrip:d.array(qr)}),ea=d.object({title:d.string(),coverSpecId:d.string(),styleId:d.number(),userId:d.string(),magicShopBook:Qr,reportingData:Gr});async function ta(t,e){return ye(async()=>{const s=(await os({url:`${ge}/api/v1/books`,apiKey:t,payload:e})).data;return xs.safeParse(s),new Nt(s)})}async function Es(t,e){return ye(async()=>{const s=(await Fn({url:`${ge}/api/v1/books/${e.id}`,apiKey:t,payload:e})).data;return xs.safeParse(s),new Nt(s)})}async function sa(t,e){return ye(async()=>{const s=(await is({url:`${ge}/api/v1/books/${e}/format/galleon`,apiKey:t})).data;return ea.parse(s)})}class Os{constructor(e,s,n){w(this,"apiKey");w(this,"parentId");w(this,"title");w(this,"occasion");w(this,"style");w(this,"bookSize");w(this,"coverType");w(this,"pageType");w(this,"imageDensity");w(this,"imageFilteringLevel");w(this,"embellishmentLevel");w(this,"textStickerLevel");w(this,"images");w(this,"guid");this.apiKey=s,this.parentId=e,this.title=(n==null?void 0:n.title)||"",this.occasion=(n==null?void 0:n.occasion)||_t[0],this.style=(n==null?void 0:n.style)||parseInt(Object.keys(bt)[0]),this.bookSize=(n==null?void 0:n.bookSize)||wt[0],this.coverType=(n==null?void 0:n.coverType)||xt[0],this.pageType=(n==null?void 0:n.pageType)||kt[0],this.imageDensity=(n==null?void 0:n.imageDensity)||St[0],this.imageFilteringLevel=(n==null?void 0:n.imageFilteringLevel)||Tt[0],this.embellishmentLevel=(n==null?void 0:n.embellishmentLevel)||Et[0],this.textStickerLevel=(n==null?void 0:n.textStickerLevel)||Ot[0],this.images=new vs(this.parentId,this.apiKey)}async getOptions(e){return await Vr(this.apiKey,this.bookSize,e||this.images.length)}async submit(e){return e&&Object.assign(this,e),this.getProgress(),await Es(this.apiKey,ks(this)),this}async setGuid(e){return this.guid=e,await Es(this.apiKey,ks(this)),this.guid}async getJSON(){return await sa(this.apiKey,this.parentId)}async getProgress(){let e="new";const s=new WebSocket(`${Hn}/?book_id=${this.parentId}`),n=setTimeout(()=>{throw s.close(),new Error("Something went wrong. Please try again.")},Jn);s.onmessage=r=>{const a=JSON.parse(r.data);if(e!==a.state){e=a.state;const i=new CustomEvent("MagicBook.designRequestUpdated",{detail:a});["error","ready"].includes(a.state)&&(s.close(),clearTimeout(n)),window.dispatchEvent(i)}}}}class na{constructor(e){w(this,"apiKey");this.apiKey=e}async createDesignRequest(e){const s=await ta(this.apiKey);return new Os(s.id,this.apiKey,e)}}O.DesignRequest=Os,O.ImageServer=bs,O.Images=vs,O.MagicBookClient=na,O.bookSizes=wt,O.coverTypes=xt,O.designOptionsSchema=Ts,O.embellishmentLevels=Et,O.imageDensities=St,O.imageDensityOptionSchema=Ye,O.imageDensityOptionsSchema=Ss,O.imageFilteringLevels=Tt,O.imageServerSchema=_s,O.occasions=_t,O.pageTypes=kt,O.states=ws,O.styles=bt,O.textStickerLevels=Ot,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
package/models/book.d.ts CHANGED
@@ -88,7 +88,7 @@ export declare const BookPropsSchema: z.ZodObject<{
88
88
  embellishment_level: "none" | "few" | "lots";
89
89
  text_sticker_level: "none" | "few" | "lots";
90
90
  }>;
91
- state: z.ZodOptional<z.ZodEnum<["new", "ingesting", "submitted", "storyboarding", "storyboarding succeeded", "designing", "designing succeeded", "layouting", "layouting succeeded", "embellishing", "embellishing succeeded", "polishing", "polishing succeeded", "ready", "error"]>>;
91
+ state: z.ZodOptional<z.ZodEnum<["new", "ingesting", "submitted", "storyboarding", "deduplication", "image selection", "designing", "layouting", "embellishing", "polishing", "ready", "error"]>>;
92
92
  guid: z.ZodOptional<z.ZodString>;
93
93
  }, "strip", z.ZodTypeAny, {
94
94
  id: string;
@@ -104,7 +104,7 @@ export declare const BookPropsSchema: z.ZodObject<{
104
104
  embellishment_level: "none" | "few" | "lots";
105
105
  text_sticker_level: "none" | "few" | "lots";
106
106
  };
107
- state?: "new" | "ingesting" | "submitted" | "storyboarding" | "storyboarding succeeded" | "designing" | "designing succeeded" | "layouting" | "layouting succeeded" | "embellishing" | "embellishing succeeded" | "polishing" | "polishing succeeded" | "ready" | "error" | undefined;
107
+ state?: "new" | "ingesting" | "submitted" | "storyboarding" | "deduplication" | "image selection" | "designing" | "layouting" | "embellishing" | "polishing" | "ready" | "error" | undefined;
108
108
  guid?: string | undefined;
109
109
  }, {
110
110
  id: string;
@@ -120,7 +120,7 @@ export declare const BookPropsSchema: z.ZodObject<{
120
120
  embellishment_level: "none" | "few" | "lots";
121
121
  text_sticker_level: "none" | "few" | "lots";
122
122
  };
123
- state?: "new" | "ingesting" | "submitted" | "storyboarding" | "storyboarding succeeded" | "designing" | "designing succeeded" | "layouting" | "layouting succeeded" | "embellishing" | "embellishing succeeded" | "polishing" | "polishing succeeded" | "ready" | "error" | undefined;
123
+ state?: "new" | "ingesting" | "submitted" | "storyboarding" | "deduplication" | "image selection" | "designing" | "layouting" | "embellishing" | "polishing" | "ready" | "error" | undefined;
124
124
  guid?: string | undefined;
125
125
  }>;
126
126
  export type BookProps = z.infer<typeof BookPropsSchema>;
@@ -80,7 +80,7 @@ export declare class DesignRequest {
80
80
  pageNum: number;
81
81
  canvas: {
82
82
  backgroundId: string | null;
83
- assets: {
83
+ assets?: {
84
84
  type: string;
85
85
  position: {
86
86
  x: number;
@@ -103,7 +103,7 @@ export declare class DesignRequest {
103
103
  fontSize?: number | undefined;
104
104
  fontColor?: string | undefined;
105
105
  frame?: string | undefined;
106
- }[];
106
+ }[] | undefined;
107
107
  };
108
108
  }[];
109
109
  photoStrip: {
@@ -289,7 +289,7 @@ export declare const reportingDataSchema: z.ZodObject<{
289
289
  export type ReportingData = z.infer<typeof reportingDataSchema>;
290
290
  export declare const canvasSchema: z.ZodObject<{
291
291
  backgroundId: z.ZodNullable<z.ZodString>;
292
- assets: z.ZodArray<z.ZodObject<{
292
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
293
293
  type: z.ZodString;
294
294
  imageAssignment: z.ZodOptional<z.ZodObject<{
295
295
  photoRefId: z.ZodString;
@@ -376,10 +376,10 @@ export declare const canvasSchema: z.ZodObject<{
376
376
  fontSize?: number | undefined;
377
377
  fontColor?: string | undefined;
378
378
  frame?: string | undefined;
379
- }>, "many">;
379
+ }>, "many">>;
380
380
  }, "strip", z.ZodTypeAny, {
381
381
  backgroundId: string | null;
382
- assets: {
382
+ assets?: {
383
383
  type: string;
384
384
  position: {
385
385
  x: number;
@@ -402,10 +402,10 @@ export declare const canvasSchema: z.ZodObject<{
402
402
  fontSize?: number | undefined;
403
403
  fontColor?: string | undefined;
404
404
  frame?: string | undefined;
405
- }[];
405
+ }[] | undefined;
406
406
  }, {
407
407
  backgroundId: string | null;
408
- assets: {
408
+ assets?: {
409
409
  type: string;
410
410
  position: {
411
411
  x: number;
@@ -428,7 +428,7 @@ export declare const canvasSchema: z.ZodObject<{
428
428
  fontSize?: number | undefined;
429
429
  fontColor?: string | undefined;
430
430
  frame?: string | undefined;
431
- }[];
431
+ }[] | undefined;
432
432
  }>;
433
433
  export type Canvas = z.infer<typeof canvasSchema>;
434
434
  export declare const pageSchema: z.ZodObject<{
@@ -436,7 +436,7 @@ export declare const pageSchema: z.ZodObject<{
436
436
  type: z.ZodString;
437
437
  canvas: z.ZodObject<{
438
438
  backgroundId: z.ZodNullable<z.ZodString>;
439
- assets: z.ZodArray<z.ZodObject<{
439
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
440
440
  type: z.ZodString;
441
441
  imageAssignment: z.ZodOptional<z.ZodObject<{
442
442
  photoRefId: z.ZodString;
@@ -523,10 +523,10 @@ export declare const pageSchema: z.ZodObject<{
523
523
  fontSize?: number | undefined;
524
524
  fontColor?: string | undefined;
525
525
  frame?: string | undefined;
526
- }>, "many">;
526
+ }>, "many">>;
527
527
  }, "strip", z.ZodTypeAny, {
528
528
  backgroundId: string | null;
529
- assets: {
529
+ assets?: {
530
530
  type: string;
531
531
  position: {
532
532
  x: number;
@@ -549,10 +549,10 @@ export declare const pageSchema: z.ZodObject<{
549
549
  fontSize?: number | undefined;
550
550
  fontColor?: string | undefined;
551
551
  frame?: string | undefined;
552
- }[];
552
+ }[] | undefined;
553
553
  }, {
554
554
  backgroundId: string | null;
555
- assets: {
555
+ assets?: {
556
556
  type: string;
557
557
  position: {
558
558
  x: number;
@@ -575,14 +575,14 @@ export declare const pageSchema: z.ZodObject<{
575
575
  fontSize?: number | undefined;
576
576
  fontColor?: string | undefined;
577
577
  frame?: string | undefined;
578
- }[];
578
+ }[] | undefined;
579
579
  }>;
580
580
  }, "strip", z.ZodTypeAny, {
581
581
  type: string;
582
582
  pageNum: number;
583
583
  canvas: {
584
584
  backgroundId: string | null;
585
- assets: {
585
+ assets?: {
586
586
  type: string;
587
587
  position: {
588
588
  x: number;
@@ -605,14 +605,14 @@ export declare const pageSchema: z.ZodObject<{
605
605
  fontSize?: number | undefined;
606
606
  fontColor?: string | undefined;
607
607
  frame?: string | undefined;
608
- }[];
608
+ }[] | undefined;
609
609
  };
610
610
  }, {
611
611
  type: string;
612
612
  pageNum: number;
613
613
  canvas: {
614
614
  backgroundId: string | null;
615
- assets: {
615
+ assets?: {
616
616
  type: string;
617
617
  position: {
618
618
  x: number;
@@ -635,7 +635,7 @@ export declare const pageSchema: z.ZodObject<{
635
635
  fontSize?: number | undefined;
636
636
  fontColor?: string | undefined;
637
637
  frame?: string | undefined;
638
- }[];
638
+ }[] | undefined;
639
639
  };
640
640
  }>;
641
641
  export type Page = z.infer<typeof pageSchema>;
@@ -645,7 +645,7 @@ export declare const magicShopBookSchema: z.ZodObject<{
645
645
  type: z.ZodString;
646
646
  canvas: z.ZodObject<{
647
647
  backgroundId: z.ZodNullable<z.ZodString>;
648
- assets: z.ZodArray<z.ZodObject<{
648
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
649
649
  type: z.ZodString;
650
650
  imageAssignment: z.ZodOptional<z.ZodObject<{
651
651
  photoRefId: z.ZodString;
@@ -732,10 +732,10 @@ export declare const magicShopBookSchema: z.ZodObject<{
732
732
  fontSize?: number | undefined;
733
733
  fontColor?: string | undefined;
734
734
  frame?: string | undefined;
735
- }>, "many">;
735
+ }>, "many">>;
736
736
  }, "strip", z.ZodTypeAny, {
737
737
  backgroundId: string | null;
738
- assets: {
738
+ assets?: {
739
739
  type: string;
740
740
  position: {
741
741
  x: number;
@@ -758,10 +758,10 @@ export declare const magicShopBookSchema: z.ZodObject<{
758
758
  fontSize?: number | undefined;
759
759
  fontColor?: string | undefined;
760
760
  frame?: string | undefined;
761
- }[];
761
+ }[] | undefined;
762
762
  }, {
763
763
  backgroundId: string | null;
764
- assets: {
764
+ assets?: {
765
765
  type: string;
766
766
  position: {
767
767
  x: number;
@@ -784,14 +784,14 @@ export declare const magicShopBookSchema: z.ZodObject<{
784
784
  fontSize?: number | undefined;
785
785
  fontColor?: string | undefined;
786
786
  frame?: string | undefined;
787
- }[];
787
+ }[] | undefined;
788
788
  }>;
789
789
  }, "strip", z.ZodTypeAny, {
790
790
  type: string;
791
791
  pageNum: number;
792
792
  canvas: {
793
793
  backgroundId: string | null;
794
- assets: {
794
+ assets?: {
795
795
  type: string;
796
796
  position: {
797
797
  x: number;
@@ -814,14 +814,14 @@ export declare const magicShopBookSchema: z.ZodObject<{
814
814
  fontSize?: number | undefined;
815
815
  fontColor?: string | undefined;
816
816
  frame?: string | undefined;
817
- }[];
817
+ }[] | undefined;
818
818
  };
819
819
  }, {
820
820
  type: string;
821
821
  pageNum: number;
822
822
  canvas: {
823
823
  backgroundId: string | null;
824
- assets: {
824
+ assets?: {
825
825
  type: string;
826
826
  position: {
827
827
  x: number;
@@ -844,7 +844,7 @@ export declare const magicShopBookSchema: z.ZodObject<{
844
844
  fontSize?: number | undefined;
845
845
  fontColor?: string | undefined;
846
846
  frame?: string | undefined;
847
- }[];
847
+ }[] | undefined;
848
848
  };
849
849
  }>, "many">;
850
850
  photoStrip: z.ZodArray<z.ZodObject<{
@@ -942,7 +942,7 @@ export declare const magicShopBookSchema: z.ZodObject<{
942
942
  pageNum: number;
943
943
  canvas: {
944
944
  backgroundId: string | null;
945
- assets: {
945
+ assets?: {
946
946
  type: string;
947
947
  position: {
948
948
  x: number;
@@ -965,7 +965,7 @@ export declare const magicShopBookSchema: z.ZodObject<{
965
965
  fontSize?: number | undefined;
966
966
  fontColor?: string | undefined;
967
967
  frame?: string | undefined;
968
- }[];
968
+ }[] | undefined;
969
969
  };
970
970
  }[];
971
971
  photoStrip: {
@@ -995,7 +995,7 @@ export declare const magicShopBookSchema: z.ZodObject<{
995
995
  pageNum: number;
996
996
  canvas: {
997
997
  backgroundId: string | null;
998
- assets: {
998
+ assets?: {
999
999
  type: string;
1000
1000
  position: {
1001
1001
  x: number;
@@ -1018,7 +1018,7 @@ export declare const magicShopBookSchema: z.ZodObject<{
1018
1018
  fontSize?: number | undefined;
1019
1019
  fontColor?: string | undefined;
1020
1020
  frame?: string | undefined;
1021
- }[];
1021
+ }[] | undefined;
1022
1022
  };
1023
1023
  }[];
1024
1024
  photoStrip: {
@@ -1055,7 +1055,7 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1055
1055
  type: z.ZodString;
1056
1056
  canvas: z.ZodObject<{
1057
1057
  backgroundId: z.ZodNullable<z.ZodString>;
1058
- assets: z.ZodArray<z.ZodObject<{
1058
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
1059
1059
  type: z.ZodString;
1060
1060
  imageAssignment: z.ZodOptional<z.ZodObject<{
1061
1061
  photoRefId: z.ZodString;
@@ -1142,10 +1142,10 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1142
1142
  fontSize?: number | undefined;
1143
1143
  fontColor?: string | undefined;
1144
1144
  frame?: string | undefined;
1145
- }>, "many">;
1145
+ }>, "many">>;
1146
1146
  }, "strip", z.ZodTypeAny, {
1147
1147
  backgroundId: string | null;
1148
- assets: {
1148
+ assets?: {
1149
1149
  type: string;
1150
1150
  position: {
1151
1151
  x: number;
@@ -1168,10 +1168,10 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1168
1168
  fontSize?: number | undefined;
1169
1169
  fontColor?: string | undefined;
1170
1170
  frame?: string | undefined;
1171
- }[];
1171
+ }[] | undefined;
1172
1172
  }, {
1173
1173
  backgroundId: string | null;
1174
- assets: {
1174
+ assets?: {
1175
1175
  type: string;
1176
1176
  position: {
1177
1177
  x: number;
@@ -1194,14 +1194,14 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1194
1194
  fontSize?: number | undefined;
1195
1195
  fontColor?: string | undefined;
1196
1196
  frame?: string | undefined;
1197
- }[];
1197
+ }[] | undefined;
1198
1198
  }>;
1199
1199
  }, "strip", z.ZodTypeAny, {
1200
1200
  type: string;
1201
1201
  pageNum: number;
1202
1202
  canvas: {
1203
1203
  backgroundId: string | null;
1204
- assets: {
1204
+ assets?: {
1205
1205
  type: string;
1206
1206
  position: {
1207
1207
  x: number;
@@ -1224,14 +1224,14 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1224
1224
  fontSize?: number | undefined;
1225
1225
  fontColor?: string | undefined;
1226
1226
  frame?: string | undefined;
1227
- }[];
1227
+ }[] | undefined;
1228
1228
  };
1229
1229
  }, {
1230
1230
  type: string;
1231
1231
  pageNum: number;
1232
1232
  canvas: {
1233
1233
  backgroundId: string | null;
1234
- assets: {
1234
+ assets?: {
1235
1235
  type: string;
1236
1236
  position: {
1237
1237
  x: number;
@@ -1254,7 +1254,7 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1254
1254
  fontSize?: number | undefined;
1255
1255
  fontColor?: string | undefined;
1256
1256
  frame?: string | undefined;
1257
- }[];
1257
+ }[] | undefined;
1258
1258
  };
1259
1259
  }>, "many">;
1260
1260
  photoStrip: z.ZodArray<z.ZodObject<{
@@ -1352,7 +1352,7 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1352
1352
  pageNum: number;
1353
1353
  canvas: {
1354
1354
  backgroundId: string | null;
1355
- assets: {
1355
+ assets?: {
1356
1356
  type: string;
1357
1357
  position: {
1358
1358
  x: number;
@@ -1375,7 +1375,7 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1375
1375
  fontSize?: number | undefined;
1376
1376
  fontColor?: string | undefined;
1377
1377
  frame?: string | undefined;
1378
- }[];
1378
+ }[] | undefined;
1379
1379
  };
1380
1380
  }[];
1381
1381
  photoStrip: {
@@ -1405,7 +1405,7 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1405
1405
  pageNum: number;
1406
1406
  canvas: {
1407
1407
  backgroundId: string | null;
1408
- assets: {
1408
+ assets?: {
1409
1409
  type: string;
1410
1410
  position: {
1411
1411
  x: number;
@@ -1428,7 +1428,7 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1428
1428
  fontSize?: number | undefined;
1429
1429
  fontColor?: string | undefined;
1430
1430
  frame?: string | undefined;
1431
- }[];
1431
+ }[] | undefined;
1432
1432
  };
1433
1433
  }[];
1434
1434
  photoStrip: {
@@ -1486,7 +1486,7 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1486
1486
  pageNum: number;
1487
1487
  canvas: {
1488
1488
  backgroundId: string | null;
1489
- assets: {
1489
+ assets?: {
1490
1490
  type: string;
1491
1491
  position: {
1492
1492
  x: number;
@@ -1509,7 +1509,7 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1509
1509
  fontSize?: number | undefined;
1510
1510
  fontColor?: string | undefined;
1511
1511
  frame?: string | undefined;
1512
- }[];
1512
+ }[] | undefined;
1513
1513
  };
1514
1514
  }[];
1515
1515
  photoStrip: {
@@ -1551,7 +1551,7 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1551
1551
  pageNum: number;
1552
1552
  canvas: {
1553
1553
  backgroundId: string | null;
1554
- assets: {
1554
+ assets?: {
1555
1555
  type: string;
1556
1556
  position: {
1557
1557
  x: number;
@@ -1574,7 +1574,7 @@ export declare const bookCreationRequestSchema: z.ZodObject<{
1574
1574
  fontSize?: number | undefined;
1575
1575
  fontColor?: string | undefined;
1576
1576
  frame?: string | undefined;
1577
- }[];
1577
+ }[] | undefined;
1578
1578
  };
1579
1579
  }[];
1580
1580
  photoStrip: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@magiclabs.ai/magicbook-client",
3
3
  "private": false,
4
- "version": "0.5.0",
4
+ "version": "0.5.2",
5
5
  "description": "TypeScript package to create photo books with the Magicbook API.",
6
6
  "type": "module",
7
7
  "main": "./magicbook-client.umd.cjs",
@@ -9,7 +9,7 @@
9
9
  "types": "./src/index.d.ts",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "https://github.com/56kcloud/mb-client.git"
12
+ "url": "https://github.com/magiclabs-ai/mb-client"
13
13
  },
14
14
  "exports": {
15
15
  ".": {
@@ -13,7 +13,7 @@ export declare function retrieveGalleon(apiKey: string, bookId: string): Promise
13
13
  pageNum: number;
14
14
  canvas: {
15
15
  backgroundId: string | null;
16
- assets: {
16
+ assets?: {
17
17
  type: string;
18
18
  position: {
19
19
  x: number;
@@ -36,7 +36,7 @@ export declare function retrieveGalleon(apiKey: string, bookId: string): Promise
36
36
  fontSize?: number | undefined;
37
37
  fontColor?: string | undefined;
38
38
  frame?: string | undefined;
39
- }[];
39
+ }[] | undefined;
40
40
  };
41
41
  }[];
42
42
  photoStrip: {
@@ -1,2 +1,12 @@
1
1
  import { ImageServer } from '../../models/design-request/image';
2
- export declare function addImageInBook(apiKey: string, bookId: string, payload: ImageServer): Promise<ImageServer>;
2
+ export declare function addImageInBook(apiKey: string, bookId: string, payload: ImageServer): Promise<{
3
+ url: string;
4
+ width: number;
5
+ height: number;
6
+ handle: string;
7
+ orientation: number;
8
+ taken_at: string;
9
+ filename: string;
10
+ camera_make?: string | undefined;
11
+ camera?: string | undefined;
12
+ }>;